From 6ddf7ad8e19dfc3c73501bc4dbe066e46ced0f36 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Thu, 11 Nov 2021 10:54:27 -0800 Subject: [PATCH] Restrict Arm types to Arm v7+ This mostly mirrors the restrictions in std::arch. It can be loosened slightly with later refactoring. --- crates/core_simd/src/vendor.rs | 5 ++++- crates/core_simd/src/vendor/arm.rs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/core_simd/src/vendor.rs b/crates/core_simd/src/vendor.rs index bdb9d45eb9d..5f6a480f081 100644 --- a/crates/core_simd/src/vendor.rs +++ b/crates/core_simd/src/vendor.rs @@ -21,7 +21,10 @@ fn from(value: $from) -> $to { #[cfg(any(target_arch = "wasm32"))] mod wasm32; -#[cfg(any(target_arch = "arm", target_arch = "aarch64"))] +#[cfg(any( + target_arch = "aarch64", + all(target_arch = "arm", target_feature = "v7") +))] mod arm; #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] diff --git a/crates/core_simd/src/vendor/arm.rs b/crates/core_simd/src/vendor/arm.rs index 3e9487dfb33..720c84cdd88 100644 --- a/crates/core_simd/src/vendor/arm.rs +++ b/crates/core_simd/src/vendor/arm.rs @@ -1,6 +1,6 @@ use crate::simd::*; -#[cfg(target_arch = "arm")] +#[cfg(all(target_arch = "arm", target_feature = "v7"))] use core::arch::arm::*; #[cfg(target_arch = "aarch64")] @@ -35,7 +35,7 @@ from_transmute! { unsafe Simd => poly64x1_t } from_transmute! { unsafe u64x2 => poly64x2_t } -#[cfg(target_arch = "arm")] +#[cfg(all(target_arch = "arm", target_feature = "v7"))] mod arm { use super::*; from_transmute! { unsafe Simd => uint8x4_t }