Skip to documentation
SLOP

tiny.simd.findFirstTrue

Reference tiny.simd findFirstTrue

Defined in compare.

Returns the lowest true lane, or -1 when no lane is true.

Called byCallsNo direct callsalgofindalgofindIfcomparefindKnownFirstTruecomparesetBeforeFirstcomparesetOnlyFirsttest sourcelib.simd.src.comparetest: Highway mask searches and first...comparefindFirstTrue
Static calls · unresolved targets: 0 · external targets: 0.

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

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433