tiny.simd.hashArray
Defined in hash.
Source
Source: lib/simd/src/hash.zig:219
zig
pub fn hashArray( comptime D: type, hash: anytype, input: []const D.Lane, output: []D.Lane,) void { std.debug.assert(input.len == output.len); const lanes = D.lane_count; var index: usize = 0; var remaining = input.len; while (remaining >= 4 * lanes) : ({ index += 4 * lanes; remaining -= 4 * lanes; }) { var first = loadVector(D, input[index + 0 * lanes ..]); var second = loadVector(D, input[index + 1 * lanes ..]); var third = loadVector(D, input[index + 2 * lanes ..]); var fourth = loadVector(D, input[index + 3 * lanes ..]); hash.twoVec(D, &first, &second); hash.twoVec(D, &third, &fourth); storeVector(D, first, output[index + 0 * lanes ..]); storeVector(D, second, output[index + 1 * lanes ..]); storeVector(D, third, output[index + 2 * lanes ..]); storeVector(D, fourth, output[index + 3 * lanes ..]); } while (remaining >= lanes) : ({ index += lanes; remaining -= lanes; }) { const value = hash.oneVec(D, loadVector(D, input[index..])); storeVector(D, value, output[index..]); } if (remaining != 0) { var tail: [D.lane_count]D.Lane = @splat(0); @memcpy(tail[0..remaining], input[index..]); const value = hash.oneVec(D, @as(D.Vector, tail)); const result: [D.lane_count]D.Lane = value; @memcpy(output[index..], result[0..remaining]); }}Source: lib/simd/src/root.zig:573
zig
pub const hashArray = hash.hashArray;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |