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§
Sourcefn simd_eq(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
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.
Sourcefn any_true(self) -> bool
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.
Sourcefn all_true(self) -> bool
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.
Sourcefn any_false(self) -> bool
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.
Sourcefn all_false(self) -> bool
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.