Trait lav::SimdMask

source ·
pub trait SimdMask<const N: usize>
where LaneCount<N>: SupportedLaneCount, Self: Send + Sync + Clone + Copy + Default + PartialEq + PartialOrd + Debug + From<[bool; N]> + Into<[bool; N]> + Select<Self> + BitAnd<Output = Self> + BitAndAssign + BitAnd<bool, Output = Self> + BitAndAssign<bool> + BitOr<Output = Self> + BitOrAssign + BitOr<bool, Output = Self> + BitOrAssign<bool> + BitXor<Output = Self> + BitXorAssign + BitXor<bool, Output = Self> + BitXorAssign<bool> + Not<Output = Self>,
{ const N: usize = N; // Required methods fn splat(value: bool) -> Self; fn from_array(array: [bool; N]) -> Self; fn to_array(self) -> [bool; N]; fn all(self) -> bool; fn any(self) -> bool; fn set(&mut self, lane: usize, value: bool); fn test(&self, lane: usize) -> bool; // Provided methods fn len(&self) -> usize { ... } fn flag(lane: usize, value: bool) -> Self { ... } fn select<S: Select<Self>>(self, true_values: S, false_values: S) -> S { ... } fn negate<S: Select<Self> + Neg<Output = S> + Copy>(self, values: S) -> S { ... } }
Expand description

Mask vector of Mask<i32, N> or Mask<i64, N>.

Provided Associated Constants§

source

const N: usize = N

Number of lanes in this vector.

Required Methods§

source

fn splat(value: bool) -> Self

Constructs a mask by setting all lanes to the given value.

source

fn from_array(array: [bool; N]) -> Self

Converts an array to a SIMD vector mask.

source

fn to_array(self) -> [bool; N]

Converts a SIMD vector mask to an array.

source

fn all(self) -> bool

Returns true if all lanes are set, or false otherwise.

source

fn any(self) -> bool

Returns true if any lane is set, or false otherwise.

source

fn set(&mut self, lane: usize, value: bool)

Sets the value of the specified lane.

Panics

Panics if lane is greater than or equal to the number of lanes in the vector.

source

fn test(&self, lane: usize) -> bool

Tests the value of the specified lane.

Panics

Panics if lane is greater than or equal to the number of lanes in the vector.

Provided Methods§

source

fn len(&self) -> usize

Get the number of lanes in this vector.

source

fn flag(lane: usize, value: bool) -> Self

Constructs a mask with lane set to value and all the other lanes set to !value.

source

fn select<S: Select<Self>>(self, true_values: S, false_values: S) -> S

Chooses lanes from two vectors.

For each lane in the mask, choose the corresponding lane from true_values if that lane mask is true, and false_values if that lane mask is false.

source

fn negate<S: Select<Self> + Neg<Output = S> + Copy>(self, values: S) -> S

Negates lanes if their lane mask is true.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<const N: usize> SimdMask<N> for Mask<i32, N>

source§

fn splat(value: bool) -> Self

source§

fn from_array(array: [bool; N]) -> Self

source§

fn to_array(self) -> [bool; N]

source§

fn all(self) -> bool

source§

fn any(self) -> bool

source§

fn set(&mut self, lane: usize, value: bool)

source§

fn test(&self, lane: usize) -> bool

source§

impl<const N: usize> SimdMask<N> for Mask<i64, N>

source§

fn splat(value: bool) -> Self

source§

fn from_array(array: [bool; N]) -> Self

source§

fn to_array(self) -> [bool; N]

source§

fn all(self) -> bool

source§

fn any(self) -> bool

source§

fn set(&mut self, lane: usize, value: bool)

source§

fn test(&self, lane: usize) -> bool

Implementors§