Skip to documentation
SLOP

tiny.simd.isNegative

Reference tiny.simd isNegative

Defined in compare.

Called byCallsNo direct callstest sourcelib.simd.src.comparetest: Highway sign classification rea...private sourcelib.simd.src.testverifySignOraclecompareisNegative
Static calls · unresolved targets: 1 · external targets: 0.

Source

Source: lib/simd/src/compare.zig:51

zig
pub fn isNegative(comptime D: type, value: D.Vector) D.Mask {    const info = @typeInfo(D.Lane);    if (info != .float and (info != .int or info.int.signedness != .signed)) {        @compileError("isNegative requires signed integer or floating-point lanes");    }    const U = @Int(.unsigned, @bitSizeOf(D.Lane));    const UV = @Vector(D.lane_count, U);    const bits: UV = @bitCast(value);    const sign: UV = @splat(@as(U, 1) << (@bitSizeOf(D.Lane) - 1));    return bits & sign != @as(UV, @splat(0));}

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

zig
pub const isNegative = compare.isNegative;

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433