We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e73985f + 9acc112 commit b2e25bcCopy full SHA for b2e25bc
crates/core_simd/src/intrinsics.rs
@@ -51,6 +51,9 @@ extern "platform-intrinsic" {
51
#[cfg(feature = "std")]
52
pub(crate) fn simd_ceil<T>(x: T) -> T;
53
54
+ /// fabs
55
+ pub(crate) fn simd_fabs<T>(x: T) -> T;
56
+
57
pub(crate) fn simd_eq<T, U>(x: T, y: T) -> U;
58
pub(crate) fn simd_ne<T, U>(x: T, y: T) -> U;
59
pub(crate) fn simd_lt<T, U>(x: T, y: T) -> U;
crates/core_simd/src/vector/float.rs
@@ -32,8 +32,7 @@ macro_rules! impl_float_vector {
32
/// equivalently-indexed lane in `self`.
33
#[inline]
34
pub fn abs(self) -> Self {
35
- let no_sign = crate::$bits_ty::splat(!0 >> 1);
36
- Self::from_bits(self.to_bits() & no_sign)
+ unsafe { crate::intrinsics::simd_fabs(self) }
37
}
38
39
0 commit comments