Skip to main content

SimdMask

Trait SimdMask 

Source
pub trait SimdMask<S: Simd>:
    SimdBase<S>
    + BitAnd<Output = Self>
    + BitAndAssign
    + BitAnd<Self::Element, Output = Self>
    + BitAndAssign<Self::Element>
    + BitOr<Output = Self>
    + BitOrAssign
    + BitOr<Self::Element, Output = Self>
    + BitOrAssign<Self::Element>
    + BitXor<Output = Self>
    + BitXorAssign
    + BitXor<Self::Element, Output = Self>
    + BitXorAssign<Self::Element>
    + Not<Output = Self> {
    // Required methods
    fn simd_eq(self, rhs: impl SimdInto<Self, S>) -> Self::Mask;
    fn any_true(self) -> bool;
    fn all_true(self) -> bool;
    fn any_false(self) -> bool;
    fn all_false(self) -> bool;
}
Expand description

Functionality implemented by SIMD masks.

Required Methods§

Source

fn simd_eq(self, rhs: impl SimdInto<Self, S>) -> Self::Mask

Compare two vectors element-wise for equality.

Returns a mask where each element is all ones if the corresponding elements are equal, and all zeroes if not.

Source

fn any_true(self) -> bool

Returns true if any elements in this mask are true (all ones).

Behavior on mask elements that are not all zeroes or all ones is unspecified. It may vary depending on architecture, feature level, the mask elements’ width, the mask vector’s width, or library version.

The behavior is also not guaranteed to be logically consistent if mask elements are not all zeroes or all ones. any_true may not return the same result as !all_false, and all_true may not return the same result as !any_false.

The select operation also has unspecified behavior for mask elements that are not all zeroes or all ones. That behavior may not match the behavior of this operation.

Source

fn all_true(self) -> bool

Returns true if all elements in this mask are true (all ones).

Behavior on mask elements that are not all zeroes or all ones is unspecified. It may vary depending on architecture, feature level, the mask elements’ width, the mask vector’s width, or library version.

The behavior is also not guaranteed to be logically consistent if mask elements are not all zeroes or all ones. any_true may not return the same result as !all_false, and all_true may not return the same result as !any_false.

The select operation also has unspecified behavior for mask elements that are not all zeroes or all ones. That behavior may not match the behavior of this operation.

Source

fn any_false(self) -> bool

Returns true if any elements in this mask are false (all zeroes).

This is logically equivalent to !all_true, but may be faster.

Behavior on mask elements that are not all zeroes or all ones is unspecified. It may vary depending on architecture, feature level, the mask elements’ width, the mask vector’s width, or library version.

The behavior is also not guaranteed to be logically consistent if mask elements are not all zeroes or all ones. any_true may not return the same result as !all_false, and all_true may not return the same result as !any_false.

The select operation also has unspecified behavior for mask elements that are not all zeroes or all ones. That behavior may not match the behavior of this operation.

Source

fn all_false(self) -> bool

Returns true if all elements in this mask are false (all zeroes).

This is logically equivalent to !any_true, but may be faster.

Behavior on mask elements that are not all zeroes or all ones is unspecified. It may vary depending on architecture, feature level, the mask elements’ width, the mask vector’s width, or library version.

The behavior is also not guaranteed to be logically consistent if mask elements are not all zeroes or all ones. any_true may not return the same result as !all_false, and all_true may not return the same result as !any_false.

The select operation also has unspecified behavior for mask elements that are not all zeroes or all ones. That behavior may not match the behavior of this operation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S: Simd> SimdMask<S> for mask8x16<S>

Source§

impl<S: Simd> SimdMask<S> for mask8x32<S>

Source§

impl<S: Simd> SimdMask<S> for mask8x64<S>

Source§

impl<S: Simd> SimdMask<S> for mask16x8<S>

Source§

impl<S: Simd> SimdMask<S> for mask16x16<S>

Source§

impl<S: Simd> SimdMask<S> for mask16x32<S>

Source§

impl<S: Simd> SimdMask<S> for mask32x4<S>

Source§

impl<S: Simd> SimdMask<S> for mask32x8<S>

Source§

impl<S: Simd> SimdMask<S> for mask32x16<S>

Source§

impl<S: Simd> SimdMask<S> for mask64x2<S>

Source§

impl<S: Simd> SimdMask<S> for mask64x4<S>

Source§

impl<S: Simd> SimdMask<S> for mask64x8<S>