From e4d33640d03a5dc8cee30b284ca46a449cdc29dd Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Wed, 19 Feb 2025 23:16:37 +0100 Subject: [PATCH] add `vec_reve` --- .../stdarch/crates/core_arch/src/s390x/vector.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index 795e42638466..db0d228bca5d 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([u32; N]); + + impl ReverseMask { + 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),*) => { $(