diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-07-22 19:32:09 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2025-07-22 19:32:09 +0200 |
| commit | b658b3d251a7776ff35807c1a49ab1c57c9ca6c2 (patch) | |
| tree | f2475c975173d26612206799781a6cdc6a40505a /library/stdarch/crates | |
| parent | 9b7d31c851cabc2e6e541d3cf146787d597a9166 (diff) | |
| download | rust-b658b3d251a7776ff35807c1a49ab1c57c9ca6c2.tar.gz rust-b658b3d251a7776ff35807c1a49ab1c57c9ca6c2.zip | |
work around not being able to project out of SIMD values any more
Diffstat (limited to 'library/stdarch/crates')
| -rw-r--r-- | library/stdarch/crates/core_arch/src/s390x/vector.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index a09a27a029c..0ce720a9244 100644 --- a/library/stdarch/crates/core_arch/src/s390x/vector.rs +++ b/library/stdarch/crates/core_arch/src/s390x/vector.rs @@ -5831,24 +5831,30 @@ mod tests { use crate::core_arch::simd::*; use stdarch_test::simd_test; + impl<const N: usize> ShuffleMask<N> { + fn as_array(&self) -> &[u32; N] { + unsafe { std::mem::transmute(self) } + } + } + #[test] fn reverse_mask() { - assert_eq!(ShuffleMask::<4>::reverse().0, [3, 2, 1, 0]); + assert_eq!(ShuffleMask::<4>::reverse().as_array(), &[3, 2, 1, 0]); } #[test] fn mergel_mask() { - assert_eq!(ShuffleMask::<4>::merge_low().0, [2, 6, 3, 7]); + assert_eq!(ShuffleMask::<4>::merge_low().as_array(), &[2, 6, 3, 7]); } #[test] fn mergeh_mask() { - assert_eq!(ShuffleMask::<4>::merge_high().0, [0, 4, 1, 5]); + assert_eq!(ShuffleMask::<4>::merge_high().as_array(), &[0, 4, 1, 5]); } #[test] fn pack_mask() { - assert_eq!(ShuffleMask::<4>::pack().0, [1, 3, 5, 7]); + assert_eq!(ShuffleMask::<4>::pack().as_array(), &[1, 3, 5, 7]); } #[test] |
