tiny.simd.findFirstTrue
Defined in compare.
Returns the lowest true lane, or -1 when no lane is true.
Source
Source: lib/simd/src/compare.zig:168
zig
/// Returns the lowest true lane, or -1 when no lane is true. The mask selects/// lane indices and a minimum reduction picks the first, which compiles to a/// few vector instructions. Walking the lanes of an array copy, or bitcasting/// the mask to an integer, scalarizes under the pinned compiler.pub fn findFirstTrue(comptime D: type, mask: D.Mask) isize { const index = std.simd.firstTrue(mask) orelse return -1; return @intCast(index);}Source: lib/simd/src/root.zig:717
zig
pub const findFirstTrue = compare.findFirstTrue;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |