diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-02-19 23:16:37 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2025-03-16 13:50:11 +0000 |
| commit | e4d33640d03a5dc8cee30b284ca46a449cdc29dd (patch) | |
| tree | a81f809c88e1f0ceca6671d1012c2897a61c213a /library | |
| parent | 267558c5c2e805d2e61eebbc85f33d53b2d34b21 (diff) | |
| download | rust-e4d33640d03a5dc8cee30b284ca46a449cdc29dd.tar.gz rust-e4d33640d03a5dc8cee30b284ca46a449cdc29dd.zip | |
add `vec_reve`
Diffstat (limited to 'library')
| -rw-r--r-- | library/stdarch/crates/core_arch/src/s390x/vector.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index 795e4263846..db0d228bca5 100644 --- a/library/stdarch/crates/core_arch/src/s390x/vector.rs +++ b/library/stdarch/crates/core_arch/src/s390x/vector.rs @@ -1212,6 +1212,21 @@ mod sealed { unsafe fn vec_reve(self) -> Self; } + #[repr(simd)] + struct ReverseMask<const N: usize>([u32; N]); + + impl<const N: usize> ReverseMask<N> { + const fn new() -> Self { + let mut index = [0; N]; + let mut i = 0; + while i < N { + index[i] = (N - i - 1) as u32; + i += 1; + } + ReverseMask(index) + } + } + macro_rules! impl_reve { ($($ty:ident, $fun:ident, $instr:ident),*) => { $( |
