pub trait SimdUint: Copy + Sealed {
type Scalar;
type Cast<T: SimdElement>;
Show 17 methods
// Required methods
fn cast<T: SimdCast>(self) -> Self::Cast<T>;
fn wrapping_neg(self) -> Self;
fn saturating_add(self, second: Self) -> Self;
fn saturating_sub(self, second: Self) -> Self;
fn reduce_sum(self) -> Self::Scalar;
fn reduce_product(self) -> Self::Scalar;
fn reduce_max(self) -> Self::Scalar;
fn reduce_min(self) -> Self::Scalar;
fn reduce_and(self) -> Self::Scalar;
fn reduce_or(self) -> Self::Scalar;
fn reduce_xor(self) -> Self::Scalar;
fn swap_bytes(self) -> Self;
fn reverse_bits(self) -> Self;
fn leading_zeros(self) -> Self;
fn trailing_zeros(self) -> Self;
fn leading_ones(self) -> Self;
fn trailing_ones(self) -> Self;
}
portable_simd
#86656)Expand description
Operations on SIMD vectors of unsigned integers.
Required Associated Types§
Sourcetype Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
type Scalar
portable_simd
#86656)Scalar type contained by this SIMD vector type.
Sourcetype Cast<T: SimdElement>
🔬This is a nightly-only experimental API. (portable_simd
#86656)
type Cast<T: SimdElement>
portable_simd
#86656)A SIMD vector with a different element type.
Required Methods§
Sourcefn cast<T: SimdCast>(self) -> Self::Cast<T>
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn cast<T: SimdCast>(self) -> Self::Cast<T>
portable_simd
#86656)Performs elementwise conversion of this vector’s elements to another SIMD-valid type.
This follows the semantics of Rust’s as
conversion for casting integers (wrapping to
other integer types, and saturating to float types).
Sourcefn wrapping_neg(self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn wrapping_neg(self) -> Self
portable_simd
#86656)Wrapping negation.
Like u32::wrapping_neg
, all applications of this function will wrap, with the exception
of -0
.
Sourcefn saturating_add(self, second: Self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn saturating_add(self, second: Self) -> Self
portable_simd
#86656)Lanewise saturating add.
§Examples
Sourcefn saturating_sub(self, second: Self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn saturating_sub(self, second: Self) -> Self
portable_simd
#86656)Lanewise saturating subtract.
§Examples
Sourcefn reduce_sum(self) -> Self::Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reduce_sum(self) -> Self::Scalar
portable_simd
#86656)Returns the sum of the elements of the vector, with wrapping addition.
Sourcefn reduce_product(self) -> Self::Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reduce_product(self) -> Self::Scalar
portable_simd
#86656)Returns the product of the elements of the vector, with wrapping multiplication.
Sourcefn reduce_max(self) -> Self::Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reduce_max(self) -> Self::Scalar
portable_simd
#86656)Returns the maximum element in the vector.
Sourcefn reduce_min(self) -> Self::Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reduce_min(self) -> Self::Scalar
portable_simd
#86656)Returns the minimum element in the vector.
Sourcefn reduce_and(self) -> Self::Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reduce_and(self) -> Self::Scalar
portable_simd
#86656)Returns the cumulative bitwise “and” across the elements of the vector.
Sourcefn reduce_or(self) -> Self::Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reduce_or(self) -> Self::Scalar
portable_simd
#86656)Returns the cumulative bitwise “or” across the elements of the vector.
Sourcefn reduce_xor(self) -> Self::Scalar
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reduce_xor(self) -> Self::Scalar
portable_simd
#86656)Returns the cumulative bitwise “xor” across the elements of the vector.
Sourcefn swap_bytes(self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn swap_bytes(self) -> Self
portable_simd
#86656)Reverses the byte order of each element.
Sourcefn reverse_bits(self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn reverse_bits(self) -> Self
portable_simd
#86656)Reverses the order of bits in each elemnent. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
Sourcefn leading_zeros(self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn leading_zeros(self) -> Self
portable_simd
#86656)Returns the number of leading zeros in the binary representation of each element.
Sourcefn trailing_zeros(self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn trailing_zeros(self) -> Self
portable_simd
#86656)Returns the number of trailing zeros in the binary representation of each element.
Sourcefn leading_ones(self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn leading_ones(self) -> Self
portable_simd
#86656)Returns the number of leading ones in the binary representation of each element.
Sourcefn trailing_ones(self) -> Self
🔬This is a nightly-only experimental API. (portable_simd
#86656)
fn trailing_ones(self) -> Self
portable_simd
#86656)Returns the number of trailing ones in the binary representation of each element.
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.