diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /vendor/packed_simd_2/src/codegen/swap_bytes.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/packed_simd_2/src/codegen/swap_bytes.rs')
-rw-r--r-- | vendor/packed_simd_2/src/codegen/swap_bytes.rs | 52 |
1 files changed, 6 insertions, 46 deletions
diff --git a/vendor/packed_simd_2/src/codegen/swap_bytes.rs b/vendor/packed_simd_2/src/codegen/swap_bytes.rs index b435fb5da..9cf34a3e0 100644 --- a/vendor/packed_simd_2/src/codegen/swap_bytes.rs +++ b/vendor/packed_simd_2/src/codegen/swap_bytes.rs @@ -5,7 +5,7 @@ use crate::*; -crate trait SwapBytes { +pub(crate) trait SwapBytes { fn swap_bytes(self) -> Self; } @@ -15,7 +15,7 @@ macro_rules! impl_swap_bytes { impl SwapBytes for $id { #[inline] fn swap_bytes(self) -> Self { - unsafe { shuffle!(self, [1, 0]) } + shuffle!(self, [1, 0]) } } )+ @@ -119,52 +119,12 @@ macro_rules! impl_swap_bytes { impl_swap_bytes!(v16: u8x2, i8x2,); impl_swap_bytes!(v32: u8x4, i8x4, u16x2, i16x2,); // FIXME: 64-bit single element vector -impl_swap_bytes!( - v64: u8x8, - i8x8, - u16x4, - i16x4, - u32x2, - i32x2, /* u64x1, i64x1, */ -); +impl_swap_bytes!(v64: u8x8, i8x8, u16x4, i16x4, u32x2, i32x2 /* u64x1, i64x1, */,); -impl_swap_bytes!( - v128: u8x16, - i8x16, - u16x8, - i16x8, - u32x4, - i32x4, - u64x2, - i64x2, - u128x1, - i128x1, -); -impl_swap_bytes!( - v256: u8x32, - i8x32, - u16x16, - i16x16, - u32x8, - i32x8, - u64x4, - i64x4, - u128x2, - i128x2, -); +impl_swap_bytes!(v128: u8x16, i8x16, u16x8, i16x8, u32x4, i32x4, u64x2, i64x2, u128x1, i128x1,); +impl_swap_bytes!(v256: u8x32, i8x32, u16x16, i16x16, u32x8, i32x8, u64x4, i64x4, u128x2, i128x2,); -impl_swap_bytes!( - v512: u8x64, - i8x64, - u16x32, - i16x32, - u32x16, - i32x16, - u64x8, - i64x8, - u128x4, - i128x4, -); +impl_swap_bytes!(v512: u8x64, i8x64, u16x32, i16x32, u32x16, i32x16, u64x8, i64x8, u128x4, i128x4,); cfg_if! { if #[cfg(target_pointer_width = "8")] { |