Skip to documentation
SLOP

tiny.simd.sumsOfShuffledQuadAbsDiff

Reference tiny.simd sumsOfShuffledQuadAbsDiff

Defined in reduce.

Called byCallstest sourcelib.simd.src.reducetest: Highway absolute-difference red...private sourcelib.simd.src.reduceabsoluteDifferenceprivate sourcelib.simd.src.reducerequireByteLaneprivate sourcelib.simd.src.reducewideLanereducesumsOfShuffledQuadAbsDiff
Static calls · unresolved targets: 1 · external targets: 0.

Source

Source: lib/simd/src/reduce.zig:164

zig
pub fn sumsOfShuffledQuadAbsDiff(    comptime D: type,    comptime index3: usize,    comptime index2: usize,    comptime index1: usize,    comptime index0: usize,    a: D.Vector,    b: D.Vector,) D.repartition(wideLane(D.Lane)).Vector {    requireByteLane(D, "sumsOfShuffledQuadAbsDiff");    if (index0 > 3 or index1 > 3 or index2 > 3 or index3 > 3) {        @compileError("quad shuffle indices must be less than four");    }    const W = wideLane(D.Lane);    const R = D.repartition(W);    const selectors = [4]usize{ index0, index1, index2, index3 };    var shuffled: [D.lane_count]D.Lane = @splat(0);    inline for (0..(D.lane_count + 15) / 16) |block_index| {        inline for (0..4) |group| {            inline for (0..4) |byte| {                const destination = block_index * 16 + group * 4 + byte;                const source = block_index * 16 + selectors[group] * 4 + byte;                if (destination < D.lane_count and source < D.lane_count) {                    shuffled[destination] = a[source];                }            }        }    }    var result: R.Vector = @splat(0);    inline for (0..R.lane_count) |index| {        const a_base = (index / 4) * 8 + (index & 3);        const b_base = (index / 2) * 4;        if (a_base + 3 < D.lane_count and b_base + 3 < D.lane_count) {            var total: W = 0;            inline for (0..4) |offset| {                total += absoluteDifference(W, shuffled[a_base + offset], b[b_base + offset]);            }            result[index] = total;        }    }    return result;}

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

zig
pub const sumsOfShuffledQuadAbsDiff = reduce.sumsOfShuffledQuadAbsDiff;

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433