tiny.simd.findIf
Defined in algo.
Source
Source: lib/simd/src/algo.zig:108
zig
pub fn findIf(comptime D: type, input: []const D.Lane, predicate: anytype) usize { var index: usize = 0; while (index + D.lane_count <= input.len) : (index += D.lane_count) { const value = memory.load(D, input[index..]); const position = compare.findFirstTrue(D, predicate.call(D, value)); if (position >= 0) return index + @as(usize, @intCast(position)); } if (index != input.len) { const remaining = input.len - index; const value = memory.loadN(D, input[index..], remaining); const matches = predicate.call(D, value) & construct.firstN(D, remaining); const position = compare.findFirstTrue(D, matches); if (position >= 0) return index + @as(usize, @intCast(position)); } return input.len;}Source: lib/simd/src/root.zig:460
zig
pub const findIf = algo.findIf;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |