pub trait SimdBits<B: Bits, const N: usize>where
LaneCount<N>: SupportedLaneCount,
for<'a, 'a, 'a, 'a, 'a, 'a, 'a, 'a, 'a, 'a, 'a> Self: Send + Sync + Clone + Copy + Default + PartialEq + Eq + PartialOrd + Ord + From<Simd<B, N>> + Into<Simd<B, N>> + From<[B; N]> + Into<[B; N]> + AsRef<[B; N]> + AsMut<[B; N]> + Product<Self> + Sum<Self> + Product<&'a Self> + Sum<&'a Self> + Hash + Debug + Index<usize, Output = B> + IndexMut<usize, Output = B> + Select<Self::Mask> + Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign + Mul<Output = Self> + MulAssign + Div<Output = Self> + DivAssign + Rem<Output = Self> + RemAssign + Shl<Output = Self> + ShlAssign + Shr<Output = Self> + ShrAssign + BitAnd<Output = Self> + BitAndAssign + BitOr<Output = Self> + BitOrAssign + BitXor<Output = Self> + BitXorAssign + Add<&'a Self, Output = Self> + AddAssign<&'a Self> + Sub<&'a Self, Output = Self> + SubAssign<&'a Self> + Mul<&'a Self, Output = Self> + MulAssign<&'a Self> + Div<&'a Self, Output = Self> + DivAssign<&'a Self> + Rem<&'a Self, Output = Self> + RemAssign<&'a Self> + Shl<&'a Self, Output = Self> + ShlAssign<&'a Self> + Shr<&'a Self, Output = Self> + ShrAssign<&'a Self> + BitAnd<&'a Self, Output = Self> + BitAndAssign<&'a Self> + BitOr<&'a Self, Output = Self> + BitOrAssign<&'a Self> + BitXor<&'a Self, Output = Self> + BitXorAssign<&'a Self> + Not<Output = Self>,{
type Mask: SimdMask<N>;
const N: usize = N;
Show 13 methods
// Required methods
fn splat(value: B) -> Self;
fn as_simd(slice: &[B]) -> (&[B], &[Self], &[B]);
fn as_simd_mut(slice: &mut [B]) -> (&mut [B], &mut [Self], &mut [B]);
fn simd_eq(self, other: Self) -> Self::Mask;
fn simd_ne(self, other: Self) -> Self::Mask;
fn simd_lt(self, other: Self) -> Self::Mask;
fn simd_gt(self, other: Self) -> Self::Mask;
fn simd_le(self, other: Self) -> Self::Mask;
fn simd_ge(self, other: Self) -> Self::Mask;
fn saturating_add(self, other: Self) -> Self;
fn saturating_sub(self, other: Self) -> Self;
// Provided methods
fn len(&self) -> usize { ... }
fn abs_sub(self, other: Self) -> Self { ... }
}
Required Associated Types§
Provided Associated Constants§
Required Methods§
sourcefn as_simd(slice: &[B]) -> (&[B], &[Self], &[B])
fn as_simd(slice: &[B]) -> (&[B], &[Self], &[B])
Split a slice into a prefix, a middle of aligned SIMD vectors, and a suffix.
You’re only assured thatcself.len() == prefix.len() + middle.len() * N + suffix.len()
.
Notably, all of the following are possible:
prefix.len() >= N
,middle.is_empty()
despiteself.len() >= 3 * N
,suffix.len() >= N
.
That said, this is a safe method, so if you’re only writing safe code, then this can at most cause incorrect logic, not unsoundness.
§Panics
Panic if the size of the SIMD vector is different from N
times that of the scalar.
sourcefn as_simd_mut(slice: &mut [B]) -> (&mut [B], &mut [Self], &mut [B])
fn as_simd_mut(slice: &mut [B]) -> (&mut [B], &mut [Self], &mut [B])
Split a mutable slice into a mutable prefix, a middle of aligned SIMD vectors, and a mutable suffix.
You’re only assured that self.len() == prefix.len() + middle.len() * N + suffix.len()
.
Notably, all of the following are possible:
prefix.len() >= N
,middle.is_empty()
despiteself.len() >= 3 * N
,suffix.len() >= N
.
That said, this is a safe method, so if you’re only writing safe code, then this can at most cause incorrect logic, not unsoundness.
This is the mutable version of Self::as_simd
.
§Panics
Panic if the size of the SIMD vector is different from N
times that of the scalar.
sourcefn simd_eq(self, other: Self) -> Self::Mask
fn simd_eq(self, other: Self) -> Self::Mask
Test if each lane is equal to the corresponding lane in other
.
sourcefn simd_ne(self, other: Self) -> Self::Mask
fn simd_ne(self, other: Self) -> Self::Mask
Test if each lane is not equal to the corresponding lane in other
.
sourcefn simd_lt(self, other: Self) -> Self::Mask
fn simd_lt(self, other: Self) -> Self::Mask
Test if each lane is less than the corresponding lane in other
.
sourcefn simd_gt(self, other: Self) -> Self::Mask
fn simd_gt(self, other: Self) -> Self::Mask
Test if each lane is greater than the corresponding lane in other
.
sourcefn simd_le(self, other: Self) -> Self::Mask
fn simd_le(self, other: Self) -> Self::Mask
Test if each lane is less than or equal to the corresponding lane in other
.
sourcefn simd_ge(self, other: Self) -> Self::Mask
fn simd_ge(self, other: Self) -> Self::Mask
Test if each lane is greater than or equal to the corresponding lane in other
.
sourcefn saturating_add(self, other: Self) -> Self
fn saturating_add(self, other: Self) -> Self
Lanewise saturating add.
sourcefn saturating_sub(self, other: Self) -> Self
fn saturating_sub(self, other: Self) -> Self
Lanewise saturating subtract.