Skip to content

Commit 419c848

Browse files
committed
Disable aarch64 assembly if target_abi = "softfloat"
The target `aarch64-unknown-none-softfloat` still sets the `neon` target feature, so the assembly implementations are incorrectly being enabled. Update gates to differentiate the `softfloat` ABI.
1 parent a2f6440 commit 419c848

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

libm/src/math/arch/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ cfg_if! {
1919
pub use x86::{sqrt, sqrtf, fma, fmaf};
2020
} else if #[cfg(all(
2121
any(target_arch = "aarch64", target_arch = "arm64ec"),
22-
target_feature = "neon"
22+
target_feature = "neon",
23+
not(target_abi = "softfloat"),
2324
))] {
2425
mod aarch64;
2526

libm/src/math/fma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn fmaf(x: f32, y: f32, z: f32) -> f32 {
2020
select_implementation! {
2121
name: fmaf,
2222
use_arch: any(
23-
all(target_arch = "aarch64", target_feature = "neon"),
23+
all(target_arch = "aarch64", target_feature = "neon", not(target_abi = "softfloat")),
2424
target_feature = "sse2",
2525
),
2626
args: x, y, z,
@@ -37,7 +37,7 @@ pub fn fma(x: f64, y: f64, z: f64) -> f64 {
3737
select_implementation! {
3838
name: fma,
3939
use_arch: any(
40-
all(target_arch = "aarch64", target_feature = "neon"),
40+
all(target_arch = "aarch64", target_feature = "neon", not(target_abi = "softfloat")),
4141
target_feature = "sse2",
4242
),
4343
args: x, y, z,

libm/src/math/rint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn rintf(x: f32) -> f32 {
1919
select_implementation! {
2020
name: rintf,
2121
use_arch: any(
22-
all(target_arch = "aarch64", target_feature = "neon"),
22+
all(target_arch = "aarch64", target_feature = "neon", not(target_abi = "softfloat")),
2323
all(target_arch = "wasm32", intrinsics_enabled),
2424
),
2525
args: x,
@@ -34,7 +34,7 @@ pub fn rint(x: f64) -> f64 {
3434
select_implementation! {
3535
name: rint,
3636
use_arch: any(
37-
all(target_arch = "aarch64", target_feature = "neon"),
37+
all(target_arch = "aarch64", target_feature = "neon", not(target_abi = "softfloat")),
3838
all(target_arch = "wasm32", intrinsics_enabled),
3939
),
4040
args: x,

libm/src/math/sqrt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn sqrtf(x: f32) -> f32 {
1717
select_implementation! {
1818
name: sqrtf,
1919
use_arch: any(
20-
all(target_arch = "aarch64", target_feature = "neon"),
20+
all(target_arch = "aarch64", target_feature = "neon", not(target_abi = "softfloat")),
2121
all(target_arch = "wasm32", intrinsics_enabled),
2222
target_feature = "sse2"
2323
),
@@ -33,7 +33,7 @@ pub fn sqrt(x: f64) -> f64 {
3333
select_implementation! {
3434
name: sqrt,
3535
use_arch: any(
36-
all(target_arch = "aarch64", target_feature = "neon"),
36+
all(target_arch = "aarch64", target_feature = "neon", not(target_abi = "softfloat")),
3737
all(target_arch = "wasm32", intrinsics_enabled),
3838
target_feature = "sse2"
3939
),

0 commit comments

Comments
 (0)