From 0495332cbf061bf50fe3f80d8bf5fa6e2a587561 Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Sat, 21 Sep 2024 13:23:25 -0700 Subject: [PATCH] Fix compilation with no_std on arm --- src/octets.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/octets.rs b/src/octets.rs index a564571..16bebf1 100644 --- a/src/octets.rs +++ b/src/octets.rs @@ -135,9 +135,8 @@ pub fn fused_addassign_mul_scalar_binary( } } -#[cfg(target_arch = "aarch64")] // TODO: enable when stable -// #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] +#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), feature = "std"))] // #[target_feature(enable = "neon")] unsafe fn fused_addassign_mul_scalar_binary_neon( octets: &mut [u8], @@ -290,9 +289,8 @@ fn mulassign_scalar_fallback(octets: &mut [u8], scalar: &Octet) { } } -#[cfg(target_arch = "aarch64")] // TODO: enable when stable -// #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] +#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), feature = "std"))] // #[target_feature(enable = "neon")] unsafe fn mulassign_scalar_neon(octets: &mut [u8], scalar: &Octet) { #[cfg(target_arch = "aarch64")] @@ -458,9 +456,8 @@ fn fused_addassign_mul_scalar_fallback(octets: &mut [u8], other: &[u8], scalar: } } -#[cfg(target_arch = "aarch64")] // TODO: enable when stable -// #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] +#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), feature = "std"))] // #[target_feature(enable = "neon")] unsafe fn fused_addassign_mul_scalar_neon(octets: &mut [u8], other: &[u8], scalar: &Octet) { #[cfg(target_arch = "aarch64")] @@ -677,9 +674,8 @@ use std::arch::aarch64::uint8x16_t; // #[cfg(target_arch = "arm")] // use std::arch::arm::uint8x16_t; -#[cfg(target_arch = "aarch64")] // TODO: enable when stable -// #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] +#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), feature = "std"))] // #[target_feature(enable = "neon")] unsafe fn store_neon(ptr: *mut uint8x16_t, value: uint8x16_t) { #[cfg(target_arch = "aarch64")] @@ -695,9 +691,8 @@ unsafe fn store_neon(ptr: *mut uint8x16_t, value: uint8x16_t) { .write_unaligned(vgetq_lane_u64(reinterp, 1)); } -#[cfg(all(target_arch = "aarch64", feature = "std"))] // TODO: enable when stable -// #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] +#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), feature = "std"))] // #[target_feature(enable = "neon")] unsafe fn add_assign_neon(octets: &mut [u8], other: &[u8]) { #[cfg(target_arch = "aarch64")]