Skip to content

Commit

Permalink
Switch from using unstable-intrinsics to intrinsics_enabled
Browse files Browse the repository at this point in the history
Unlike `unstable-intrinsics`, `intrinsics_enabled` gets disabled with
`force-soft-floats` which is what we want here.
  • Loading branch information
tgross35 committed Jan 6, 2025
1 parent 9d043c5 commit d4ea030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/math/arch/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ pub fn ceilf(x: f32) -> f32 {
}

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

pub fn fabsf(x: f32) -> f32 {
// SAFETY: safe intrinsic with no preconditions
unsafe { core::intrinsics::fabsf32(x) }
x.abs()
}

pub fn floor(x: f64) -> f64 {
Expand Down
4 changes: 2 additions & 2 deletions src/math/support/float_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ macro_rules! float_impl {
fn abs(self) -> Self {
cfg_if! {
// FIXME(msrv): `abs` is available in `core` starting with 1.85.
if #[cfg(feature = "unstable-intrinsics")] {
if #[cfg(intrinsics_enabled)] {
self.abs()
} else {
super::super::generic::fabs(self)
Expand All @@ -210,7 +210,7 @@ macro_rules! float_impl {
fn copysign(self, other: Self) -> Self {
cfg_if! {
// FIXME(msrv): `copysign` is available in `core` starting with 1.85.
if #[cfg(feature = "unstable-intrinsics")] {
if #[cfg(intrinsics_enabled)] {
self.copysign(other)
} else {
super::super::generic::copysign(self, other)
Expand Down

0 comments on commit d4ea030

Please sign in to comment.