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.
This commit is contained in:
Trevor Gross 2025-01-06 21:57:29 +00:00 committed by Trevor Gross
parent deb87d0a70
commit ac9fec04ef
2 changed files with 4 additions and 6 deletions

View file

@ -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 {

View file

@ -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)
@ -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)