Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 59485a3

Browse files
committed
Switch from using unstable-intrinsics to intrinsics_enabled
Unlike `unstable-intrinsics`, `intrinsics_enabled` gets disabled with `force-soft-floats` which is what we want here.
1 parent 0012969 commit 59485a3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

libm/src/math/arch/intrinsics.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ pub fn ceilf(x: f32) -> f32 {
1212
}
1313

1414
pub fn fabs(x: f64) -> f64 {
15-
// SAFETY: safe intrinsic with no preconditions
16-
unsafe { core::intrinsics::fabsf64(x) }
15+
x.abs()
1716
}
1817

1918
pub fn fabsf(x: f32) -> f32 {
20-
// SAFETY: safe intrinsic with no preconditions
21-
unsafe { core::intrinsics::fabsf32(x) }
19+
x.abs()
2220
}
2321

2422
pub fn floor(x: f64) -> f64 {

libm/src/math/support/float_traits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ macro_rules! float_impl {
200200
fn abs(self) -> Self {
201201
cfg_if! {
202202
// FIXME(msrv): `abs` is available in `core` starting with 1.85.
203-
if #[cfg(feature = "unstable-intrinsics")] {
203+
if #[cfg(intrinsics_enabled)] {
204204
self.abs()
205205
} else {
206206
super::super::generic::fabs(self)
@@ -210,7 +210,7 @@ macro_rules! float_impl {
210210
fn copysign(self, other: Self) -> Self {
211211
cfg_if! {
212212
// FIXME(msrv): `copysign` is available in `core` starting with 1.85.
213-
if #[cfg(feature = "unstable-intrinsics")] {
213+
if #[cfg(intrinsics_enabled)] {
214214
self.copysign(other)
215215
} else {
216216
super::super::generic::copysign(self, other)

0 commit comments

Comments
 (0)