diff --git a/build.rs b/build.rs index 19425925..e204d80c 100644 --- a/build.rs +++ b/build.rs @@ -463,7 +463,6 @@ mod c { if (target_arch == "aarch64" || target_arch == "arm64ec") && consider_float_intrinsics { sources.extend(&[ - ("__comparetf2", "comparetf2.c"), ("__extenddftf2", "extenddftf2.c"), ("__extendsftf2", "extendsftf2.c"), ("__fixtfdi", "fixtfdi.c"), diff --git a/src/float/mod.rs b/src/float/mod.rs index 6a5357bc..de0456fa 100644 --- a/src/float/mod.rs +++ b/src/float/mod.rs @@ -127,7 +127,20 @@ macro_rules! float_impl { self.to_bits() as Self::SignedInt } fn eq_repr(self, rhs: Self) -> bool { - if self.is_nan() && rhs.is_nan() { + #[cfg(feature = "mangled-names")] + fn is_nan(x: $ty) -> bool { + // When using mangled-names, the "real" compiler-builtins might not have the + // necessary builtin (__unordtf2) to test whether `f128` is NaN. + // FIXME: Remove once the nightly toolchain has the __unordtf2 builtin + // x is NaN if all the bits of the exponent are set and the significand is non-0 + x.repr() & $ty::EXPONENT_MASK == $ty::EXPONENT_MASK + && x.repr() & $ty::SIGNIFICAND_MASK != 0 + } + #[cfg(not(feature = "mangled-names"))] + fn is_nan(x: $ty) -> bool { + x.is_nan() + } + if is_nan(self) && is_nan(rhs) { true } else { self.repr() == rhs.repr() diff --git a/src/int/big.rs b/src/int/big.rs index 59f5c1d0..b3c9ebcd 100644 --- a/src/int/big.rs +++ b/src/int/big.rs @@ -11,7 +11,9 @@ const WORD_FULL_MASK: u64 = 0xffffffffffffffff; const U128_LO_MASK: u128 = u64::MAX as u128; const U128_HI_MASK: u128 = (u64::MAX as u128) << 64; -// Stored little endian +/// A 256-bit unsigned integer represented as 4 64-bit limbs. +/// +/// Each limb is a native-endian number, but the array is little-limb-endian. #[allow(non_camel_case_types)] #[derive(Clone, Copy, Debug, PartialEq, PartialOrd)] pub struct u256(pub [u64; 4]); @@ -32,7 +34,9 @@ impl i256 { } } -// Stored little endian +/// A 256-bit signed integer represented as 4 64-bit limbs. +/// +/// Each limb is a native-endian number, but the array is little-limb-endian. #[allow(non_camel_case_types)] #[derive(Clone, Copy, Debug, PartialEq, PartialOrd)] pub struct i256(pub [u64; 4]); diff --git a/src/int/mod.rs b/src/int/mod.rs index b0a949eb..79855bae 100644 --- a/src/int/mod.rs +++ b/src/int/mod.rs @@ -10,8 +10,8 @@ pub mod sdiv; pub mod shift; pub mod udiv; -pub use leading_zeros::__clzsi2; pub use big::{i256, u256}; +pub use leading_zeros::__clzsi2; public_test_dep! { /// Minimal integer implementations needed on all integer types, including wide integers.