Skip to documentation
SLOP

tiny.simd.countValue

Reference tiny.simd countValue

Defined in algo.

Called byCallstest sourcelib.simd.src.algotest: Highway span copy count find an...private sourcelib.simd.src.algoverifyAllTypeAlgorithmscomparecountTrueconstructfirstNmemoryloadNalgocount
Static calls · unresolved targets: 0 · external targets: 1.

Source

Source: lib/simd/src/algo.zig:60

zig
pub fn count(comptime D: type, input: []const D.Lane, value: D.Lane) usize {    const broadcast: D.Vector = @splat(value);    var total: usize = 0;    var index: usize = 0;    while (index + D.lane_count <= input.len) : (index += D.lane_count) {        total += compare.countTrue(D, memory.load(D, input[index..]) == broadcast);    }    if (index != input.len) {        const remaining = input.len - index;        const matches = memory.loadN(D, input[index..], remaining) == broadcast;        total += compare.countTrue(D, matches & construct.firstN(D, remaining));    }    std.debug.assert(total <= input.len);    return total;}

Source: lib/simd/src/root.zig:457

zig
pub const countValue = algo.count;

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433