diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2023-05-31 20:00:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-31 20:00:26 -0400 |
| commit | d975d8fad4e1cb7850307c75ac9f752915aeeb5e (patch) | |
| tree | 249f2b219457de6d2ae62e187b9f3e61afe56ba9 | |
| parent | 5161f2ecd0873309fc143d964368125aff760349 (diff) | |
| parent | 1af32f0a3a2c34ab9822f96d199d0d9bad7c5b66 (diff) | |
| download | rust-d975d8fad4e1cb7850307c75ac9f752915aeeb5e.tar.gz rust-d975d8fad4e1cb7850307c75ac9f752915aeeb5e.zip | |
Merge pull request #348 from taiki-e/arm-big
Fix build error on big endian arm/aarch64
| -rw-r--r-- | crates/core_simd/src/swizzle_dyn.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/crates/core_simd/src/swizzle_dyn.rs b/crates/core_simd/src/swizzle_dyn.rs index 3eb80d5dca1..a4da461d546 100644 --- a/crates/core_simd/src/swizzle_dyn.rs +++ b/crates/core_simd/src/swizzle_dyn.rs @@ -16,9 +16,9 @@ where #[inline] pub fn swizzle_dyn(self, idxs: Simd<u8, N>) -> Self { #![allow(unused_imports, unused_unsafe)] - #[cfg(target_arch = "aarch64")] + #[cfg(all(target_arch = "aarch64", target_endian = "little"))] use core::arch::aarch64::{uint8x8_t, vqtbl1q_u8, vtbl1_u8}; - #[cfg(all(target_arch = "arm", target_feature = "v7"))] + #[cfg(all(target_arch = "arm", target_feature = "v7", target_endian = "little"))] use core::arch::arm::{uint8x8_t, vtbl1_u8}; #[cfg(target_arch = "wasm32")] use core::arch::wasm32 as wasm; @@ -29,13 +29,24 @@ where // SAFETY: Intrinsics covered by cfg unsafe { match N { - #[cfg(target_feature = "neon")] + #[cfg(all( + any( + target_arch = "aarch64", + all(target_arch = "arm", target_feature = "v7") + ), + target_feature = "neon", + target_endian = "little" + ))] 8 => transize(vtbl1_u8, self, idxs), #[cfg(target_feature = "ssse3")] 16 => transize(x86::_mm_shuffle_epi8, self, idxs), #[cfg(target_feature = "simd128")] 16 => transize(wasm::i8x16_swizzle, self, idxs), - #[cfg(all(target_arch = "aarch64", target_feature = "neon"))] + #[cfg(all( + target_arch = "aarch64", + target_feature = "neon", + target_endian = "little" + ))] 16 => transize(vqtbl1q_u8, self, idxs), #[cfg(all(target_feature = "avx2", not(target_feature = "avx512vbmi")))] 32 => transize_raw(avx2_pshufb, self, idxs), |
