mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Use relative intrinsics paths for bitmasks
This commit is contained in:
parent
81484a399c
commit
533f0fc81a
@ -105,18 +105,14 @@ where
|
|||||||
#[must_use = "method returns a new vector and does not mutate the original value"]
|
#[must_use = "method returns a new vector and does not mutate the original value"]
|
||||||
pub fn to_int(self) -> Simd<T, LANES> {
|
pub fn to_int(self) -> Simd<T, LANES> {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::intrinsics::simd_select_bitmask(
|
intrinsics::simd_select_bitmask(self.0, Simd::splat(T::TRUE), Simd::splat(T::FALSE))
|
||||||
self.0,
|
|
||||||
Simd::splat(T::TRUE),
|
|
||||||
Simd::splat(T::FALSE),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use = "method returns a new mask and does not mutate the original value"]
|
#[must_use = "method returns a new mask and does not mutate the original value"]
|
||||||
pub unsafe fn from_int_unchecked(value: Simd<T, LANES>) -> Self {
|
pub unsafe fn from_int_unchecked(value: Simd<T, LANES>) -> Self {
|
||||||
unsafe { Self(crate::intrinsics::simd_bitmask(value), PhantomData) }
|
unsafe { Self(intrinsics::simd_bitmask(value), PhantomData) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "generic_const_exprs")]
|
#[cfg(feature = "generic_const_exprs")]
|
||||||
|
@ -115,7 +115,7 @@ where
|
|||||||
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
|
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN] =
|
let mut bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN] =
|
||||||
crate::intrinsics::simd_bitmask(self.0);
|
intrinsics::simd_bitmask(self.0);
|
||||||
|
|
||||||
// There is a bug where LLVM appears to implement this operation with the wrong
|
// There is a bug where LLVM appears to implement this operation with the wrong
|
||||||
// bit order.
|
// bit order.
|
||||||
@ -144,7 +144,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Self::from_int_unchecked(crate::intrinsics::simd_select_bitmask(
|
Self::from_int_unchecked(intrinsics::simd_select_bitmask(
|
||||||
bitmask,
|
bitmask,
|
||||||
Self::splat(true).to_int(),
|
Self::splat(true).to_int(),
|
||||||
Self::splat(false).to_int(),
|
Self::splat(false).to_int(),
|
||||||
|
Loading…
Reference in New Issue
Block a user