tiny.simd.countValue
Defined in algo.
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
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |