tiny.simd.multiRotateRight
Defined in rotate.
Source
Source: lib/simd/src/rotate.zig:50
zig
pub fn multiRotateRight( comptime D: type, value: D.Vector, indices: D.repartition(u8).Vector,) D.Vector { validate(D); if (@bitSizeOf(D.Lane) != 64) @compileError("multiRotateRight requires 64-bit lanes"); const bits: @Vector(D.lane_count, u64) = @bitCast(value); const index_lanes: [D.lane_count * 8]u8 = indices; var result: @Vector(D.lane_count, u64) = @splat(0); inline for (0..D.lane_count) |lane_index| { var lane: u64 = 0; inline for (0..8) |byte_index| { const amount = index_lanes[lane_index * 8 + byte_index] & 63; const byte: u8 = @truncate(std.math.rotr(u64, bits[lane_index], amount)); const destination = if (builtin.cpu.arch.endian() == .little) byte_index else byte_index ^ 7; lane |= @as(u64, byte) << @intCast(destination * 8); } result[lane_index] = lane; } return @bitCast(result);}Source: lib/simd/src/root.zig:761
zig
pub const multiRotateRight = rotate.multiRotateRight;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |