Struct mask8x16
pub struct mask8x16<S: Simd> { /* private fields */ }
A SIMD mask of 16 logical lanes corresponding to 8-bit vector elements.
The storage representation of this type is intentionally opaque and may vary depending on the SIMD level.
You can construct this mask type using the Self::splat, Self::from_bitmask, Self::from_slice, and Self::simd_from methods.
# use fearless_simd::{prelude::*, mask8x16};
fn construct_mask<S: Simd>(simd: S) {
// From a single boolean value:
let a = mask8x16::splat(simd, true);
let b = mask8x16::simd_from(simd, true);
// From signed integer mask lanes:
let c = mask8x16::from_slice(simd, &[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
let d = mask8x16::simd_from(simd, [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
// From a compact bitmask (same mask as above, least significant bit maps to lane 0):
let e = mask8x16::from_bitmask(simd, 0b0001);
// By setting individual lanes:
let mut f = mask8x16::splat(simd, false);
f.set(0, true);
}
Trait Implementations
impl<S: Clone + Simd> Clone for mask8x16<S>
where
S::mask8x16: Clone,
fn clone(&self) -> Self
impl<S: Copy + Simd> Copy for mask8x16<S>
where
S::mask8x16: Copy,
impl<S: Simd + Debug> Debug for mask8x16<S>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<S: Simd> BitAnd for mask8x16<S>
type Output = mask8x16<S>;fn bitand(self, rhs: Self) -> Self::OutputCompute the logical AND of two masks.
impl<S: Simd> BitAndAssign for mask8x16<S>
fn bitand_assign(&mut self, rhs: Self)Compute the logical AND of two masks.
impl<S: Simd> BitOr for mask8x16<S>
type Output = mask8x16<S>;fn bitor(self, rhs: Self) -> Self::OutputCompute the logical OR of two masks.
impl<S: Simd> BitOrAssign for mask8x16<S>
fn bitor_assign(&mut self, rhs: Self)Compute the logical OR of two masks.
impl<S: Simd> BitXor for mask8x16<S>
type Output = mask8x16<S>;fn bitxor(self, rhs: Self) -> Self::OutputCompute the logical XOR of two masks.
impl<S: Simd> BitXorAssign for mask8x16<S>
fn bitxor_assign(&mut self, rhs: Self)Compute the logical XOR of two masks.
impl<S: Simd> ExtractToken for mask8x16<S>
type S = S;fn token(&self) -> S
impl<S: Simd> MaskWiden<S> for mask8x16<S>
type Widened = mask16x8<S>;fn widen(self) -> (Self::Widened, Self::Widened)
impl<S: Simd> Not for mask8x16<S>
type Output = mask8x16<S>;fn not(self) -> Self::OutputCompute the logical NOT of the mask.
impl<S: Simd> Select<i8x16<S>> for mask8x16<S>
fn select(self, if_true: i8x16<S>, if_false: i8x16<S>) -> i8x16<S>
impl<S: Simd> Select<mask8x16<S>> for mask8x16<S>
fn select(self, if_true: mask8x16<S>, if_false: mask8x16<S>) -> mask8x16<S>
impl<S: Simd> Select<u8x16<S>> for mask8x16<S>
fn select(self, if_true: u8x16<S>, if_false: u8x16<S>) -> u8x16<S>
impl<S: Simd> SimdFrom<[i8; 16], S> for mask8x16<S>
fn simd_from(simd: S, val: [i8; 16]) -> Self
impl<S: Simd> SimdFrom<__m128i, S> for mask8x16<S>
fn simd_from(simd: S, arch: __m128i) -> Self
impl<S: Simd> SimdFrom<bool, S> for mask8x16<S>
fn simd_from(simd: S, value: bool) -> Self
impl<S: Simd> SimdFrom<u16, S> for mask8x16<S>
fn simd_from(simd: S, arch: __mmask16) -> Self
impl<S: Simd> SimdMask<S> for mask8x16<S>
type Element = i8;type Ints = i8x16<S>;const LEN: usize = 16;fn splat(simd: S, val: bool) -> Selffn from_bitmask(simd: S, bits: u64) -> Selffn to_bitmask(self) -> u64fn from_vector(vector: Self::Ints) -> Selffn to_vector(self) -> Self::Intsfn set(&mut self, index: usize, value: bool)fn from_slice(simd: S, slice: &[i8]) -> Selffn store_slice(&self, slice: &mut [i8])fn rotate_elements_left<const OFFSET: usize>(self) -> Selffn rotate_elements_right<const OFFSET: usize>(self) -> Selffn reverse(self) -> Selffn simd_eq(self, rhs: impl SimdInto<Self, S>) -> Selffn simd_ne(self, rhs: impl SimdInto<Self, S>) -> Selffn any_true(self) -> boolfn all_true(self) -> boolfn any_false(self) -> boolfn all_false(self) -> bool