We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6620015 commit 06814beCopy full SHA for 06814be
crates/core_simd/src/intrinsics.rs
@@ -48,6 +48,9 @@ extern "platform-intrinsic" {
48
#[cfg(feature = "std")]
49
pub(crate) fn simd_ceil<T>(x: T) -> T;
50
51
+ /// fabs
52
+ pub(crate) fn simd_fabs<T>(x: T) -> T;
53
+
54
pub(crate) fn simd_eq<T, U>(x: T, y: T) -> U;
55
pub(crate) fn simd_ne<T, U>(x: T, y: T) -> U;
56
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