Skip to content

Commit

Permalink
Fix compilation with no_std on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Sep 21, 2024
1 parent 75ada2f commit 09e03c2
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/octets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -671,15 +668,14 @@ fn add_assign_fallback(octets: &mut [u8], other: &[u8]) {
}
}

#[cfg(target_arch = "aarch64")]
#[cfg(all(target_arch = "aarch64", feature = "std"))]
use std::arch::aarch64::uint8x16_t;
// TODO: enable when stable
// #[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")]
Expand All @@ -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")]
Expand Down

0 comments on commit 09e03c2

Please sign in to comment.