We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c7dbe0 commit 11c43c0Copy full SHA for 11c43c0
crates/core_simd/src/elements/float.rs
@@ -336,7 +336,10 @@ macro_rules! impl_trait {
336
337
#[inline]
338
fn is_subnormal(self) -> Self::Mask {
339
- self.abs().simd_ne(Self::splat(0.0)) & (self.to_bits() & Self::splat(Self::Scalar::INFINITY).to_bits()).simd_eq(Simd::splat(0))
+ // On some architectures (e.g. armv7 and some ppc) subnormals are flushed to zero,
340
+ // so this comparison must be done with integers.
341
+ let not_zero = self.abs().to_bits().simd_ne(Self::splat(0.0).to_bits());
342
+ not_zero & (self.to_bits() & Self::splat(Self::Scalar::INFINITY).to_bits()).simd_eq(Simd::splat(0))
343
}
344
345
0 commit comments