tiny.simd.sumsOfShuffledQuadAbsDiff
Defined in reduce.
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
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |