pub struct u32x8 { /* private fields */ }Expand description
A SIMD vector containing 8 u32s.
Implementations§
Source§impl u32x8
impl u32x8
pub const fn new(array: [u32; 8]) -> u32x8
Sourcepub fn simd_eq<Rhs>(self, other: Rhs) -> <u32x8 as CmpEq<Rhs>>::Output
pub fn simd_eq<Rhs>(self, other: Rhs) -> <u32x8 as CmpEq<Rhs>>::Output
Test if each element is equal to the corresponding element in other.
Sourcepub fn simd_ne<Rhs>(self, other: Rhs) -> <u32x8 as CmpNe<Rhs>>::Output
pub fn simd_ne<Rhs>(self, other: Rhs) -> <u32x8 as CmpNe<Rhs>>::Output
Test if each element is not equal to the corresponding element in
other.
Sourcepub fn simd_lt<Rhs>(self, other: Rhs) -> <u32x8 as CmpLt<Rhs>>::Output
pub fn simd_lt<Rhs>(self, other: Rhs) -> <u32x8 as CmpLt<Rhs>>::Output
Test if each element is less than the corresponding element in other.
Sourcepub fn simd_gt<Rhs>(self, other: Rhs) -> <u32x8 as CmpGt<Rhs>>::Output
pub fn simd_gt<Rhs>(self, other: Rhs) -> <u32x8 as CmpGt<Rhs>>::Output
Test if each element is greater than the corresponding element in
other.
Sourcepub fn simd_le<Rhs>(self, other: Rhs) -> <u32x8 as CmpLe<Rhs>>::Output
pub fn simd_le<Rhs>(self, other: Rhs) -> <u32x8 as CmpLe<Rhs>>::Output
Test if each element is less than or equal to the corresponding element
in other.
Sourcepub fn simd_ge<Rhs>(self, other: Rhs) -> <u32x8 as CmpGe<Rhs>>::Output
pub fn simd_ge<Rhs>(self, other: Rhs) -> <u32x8 as CmpGe<Rhs>>::Output
Test if each element is greater than or equal to the corresponding
element in other.
Sourcepub fn mul_keep_high(self, rhs: u32x8) -> u32x8
pub fn mul_keep_high(self, rhs: u32x8) -> u32x8
Multiplies 32x32 bit to 64 bit and then only keeps the high 32 bits of the
result. Useful for implementing divide constant value (see t_usefulness
example)
pub fn blend(self, t: u32x8, f: u32x8) -> u32x8
pub fn reduce_add(self) -> u32
pub fn reduce_max(self) -> u32
pub fn reduce_min(self) -> u32
pub fn max(self, rhs: u32x8) -> u32x8
pub fn min(self, rhs: u32x8) -> u32x8
Sourcepub fn clamp(self, min: u32x8, max: u32x8) -> u32x8
pub fn clamp(self, min: u32x8, max: u32x8) -> u32x8
Restrict each element to a certain interval.
If min > max, the result is unspeficied. Consider manually checking
for that case.
pub fn saturating_add(self, rhs: u32x8) -> u32x8
pub fn saturating_sub(self, rhs: u32x8) -> u32x8
Sourcepub fn saturating_mul(self, rhs: u32x8) -> u32x8
pub fn saturating_mul(self, rhs: u32x8) -> u32x8
Lanewise saturating multiply.
Sourcepub fn saturating_div(self, rhs: u32x8) -> u32x8
pub fn saturating_div(self, rhs: u32x8) -> u32x8
Lanewise saturating divide.
Note that because division has no hardware support, this operation is very slow and should be avoided if possible.
pub fn to_bitmask(self) -> u32
pub fn any(self) -> bool
pub fn all(self) -> bool
pub fn none(self) -> bool
Sourcepub fn transpose(data: [u32x8; 8]) -> [u32x8; 8]
pub fn transpose(data: [u32x8; 8]) -> [u32x8; 8]
Transpose matrix of 8x8 u32 matrix. Currently only accelerated on AVX2.
pub fn to_array(self) -> [u32; 8]
pub fn as_array(&self) -> &[u32; 8]
pub fn as_mut_array(&mut self) -> &mut [u32; 8]
Trait Implementations§
Source§impl Add<u32> for u32x8
impl Add<u32> for u32x8
Source§impl AddAssign for u32x8
impl AddAssign for u32x8
Source§fn add_assign(&mut self, rhs: u32x8)
fn add_assign(&mut self, rhs: u32x8)
+= operation. Read moreSource§impl AddAssign<&u32x8> for u32x8
impl AddAssign<&u32x8> for u32x8
Source§fn add_assign(&mut self, rhs: &u32x8)
fn add_assign(&mut self, rhs: &u32x8)
+= operation. Read moreSource§impl BitAndAssign for u32x8
impl BitAndAssign for u32x8
Source§fn bitand_assign(&mut self, rhs: u32x8)
fn bitand_assign(&mut self, rhs: u32x8)
&= operation. Read moreSource§impl BitAndAssign<&u32x8> for u32x8
impl BitAndAssign<&u32x8> for u32x8
Source§fn bitand_assign(&mut self, rhs: &u32x8)
fn bitand_assign(&mut self, rhs: &u32x8)
&= operation. Read moreSource§impl BitOrAssign for u32x8
impl BitOrAssign for u32x8
Source§fn bitor_assign(&mut self, rhs: u32x8)
fn bitor_assign(&mut self, rhs: u32x8)
|= operation. Read moreSource§impl BitOrAssign<&u32x8> for u32x8
impl BitOrAssign<&u32x8> for u32x8
Source§fn bitor_assign(&mut self, rhs: &u32x8)
fn bitor_assign(&mut self, rhs: &u32x8)
|= operation. Read moreSource§impl BitXorAssign for u32x8
impl BitXorAssign for u32x8
Source§fn bitxor_assign(&mut self, rhs: u32x8)
fn bitxor_assign(&mut self, rhs: u32x8)
^= operation. Read moreSource§impl BitXorAssign<&u32x8> for u32x8
impl BitXorAssign<&u32x8> for u32x8
Source§fn bitxor_assign(&mut self, rhs: &u32x8)
fn bitxor_assign(&mut self, rhs: &u32x8)
^= operation. Read moreSource§impl CmpEq for u32x8
impl CmpEq for u32x8
Source§fn simd_eq(self, rhs: u32x8) -> <u32x8 as CmpEq>::Output
👎Deprecated since 1.5.0: use inherit function instead
fn simd_eq(self, rhs: u32x8) -> <u32x8 as CmpEq>::Output
use inherit function instead
Element-wise equality comparison.
Returns a mask where each element is all-ones (0xFFFFFFFF) if the corresponding elements are equal, or all-zeros (0x00000000) otherwise.
§Examples
let a = u32x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
let b = u32x8::from([1, 0, 3, 0, 5, 0, 7, 0]);
let mask = a.simd_eq(b);
let expected = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0];
assert_eq!(mask.to_array(), expected);Source§impl CmpGe for u32x8
impl CmpGe for u32x8
Source§fn simd_ge(self, rhs: u32x8) -> <u32x8 as CmpGe>::Output
👎Deprecated since 1.5.0: use inherit function instead
fn simd_ge(self, rhs: u32x8) -> <u32x8 as CmpGe>::Output
use inherit function instead
Element-wise greater-than-or-equal comparison.
Returns a mask where each element is all-ones (0xFFFFFFFF) if the
corresponding element in self is greater than or equal to the one in
rhs, or all-zeros (0x00000000) otherwise.
§Examples
let a = u32x8::from([5, 4, 3, 2, 10, 9, 8, 7]);
let b = u32x8::from([5, 2, 3, 4, 5, 6, 8, 8]);
let mask = a.simd_ge(b);
let expected = [
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0,
];
assert_eq!(mask.to_array(), expected);Source§impl CmpGt for u32x8
impl CmpGt for u32x8
Source§fn simd_gt(self, rhs: u32x8) -> <u32x8 as CmpGt>::Output
👎Deprecated since 1.5.0: use inherit function instead
fn simd_gt(self, rhs: u32x8) -> <u32x8 as CmpGt>::Output
use inherit function instead
Element-wise greater-than comparison.
Returns a mask where each element is all-ones (0xFFFFFFFF) if the
corresponding element in self is greater than the one in rhs,
or all-zeros (0x00000000) otherwise.
§Examples
let a = u32x8::from([5, 4, 3, 2, 10, 9, 8, 7]);
let b = u32x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
let mask = a.simd_gt(b);
let expected =
[0xFFFFFFFF, 0xFFFFFFFF, 0, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0];
assert_eq!(mask.to_array(), expected);Source§impl CmpLe for u32x8
impl CmpLe for u32x8
Source§fn simd_le(self, rhs: u32x8) -> <u32x8 as CmpLe>::Output
👎Deprecated since 1.5.0: use inherit function instead
fn simd_le(self, rhs: u32x8) -> <u32x8 as CmpLe>::Output
use inherit function instead
Element-wise less-than-or-equal comparison.
Returns a mask where each element is all-ones (0xFFFFFFFF) if the
corresponding element in self is less than or equal to the one in rhs,
or all-zeros (0x00000000) otherwise.
§Examples
let a = u32x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
let b = u32x8::from([1, 4, 3, 2, 10, 9, 7, 7]);
let mask = a.simd_le(b);
let expected = [
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0,
];
assert_eq!(mask.to_array(), expected);Source§impl CmpLt for u32x8
impl CmpLt for u32x8
Source§fn simd_lt(self, rhs: u32x8) -> <u32x8 as CmpLt>::Output
👎Deprecated since 1.5.0: use inherit function instead
fn simd_lt(self, rhs: u32x8) -> <u32x8 as CmpLt>::Output
use inherit function instead
Element-wise less-than comparison.
Returns a mask where each element is all-ones (0xFFFFFFFF) if the
corresponding element in self is less than the one in rhs,
or all-zeros (0x00000000) otherwise.
§Examples
let a = u32x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
let b = u32x8::from([5, 4, 3, 2, 10, 9, 8, 7]);
let mask = a.simd_lt(b);
let expected =
[0xFFFFFFFF, 0xFFFFFFFF, 0, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0];
assert_eq!(mask.to_array(), expected);Source§impl CmpNe for u32x8
impl CmpNe for u32x8
Source§fn simd_ne(self, rhs: u32x8) -> <u32x8 as CmpNe>::Output
👎Deprecated since 1.5.0: use inherit function instead
fn simd_ne(self, rhs: u32x8) -> <u32x8 as CmpNe>::Output
use inherit function instead
Element-wise not-equal comparison.
Returns a mask where each element is all-ones (0xFFFFFFFF) if the corresponding elements are not equal, or all-zeros (0x00000000) otherwise.
§Examples
let a = u32x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
let b = u32x8::from([1, 0, 3, 0, 5, 0, 7, 0]);
let mask = a.simd_ne(b);
let expected = [0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF];
assert_eq!(mask.to_array(), expected);impl Copy for u32x8
impl Eq for u32x8
Source§impl Mul<u32> for u32x8
impl Mul<u32> for u32x8
impl Pod for u32x8
Source§impl Shl for u32x8
Shifts lanes by the corresponding lane.
impl Shl for u32x8
Shifts lanes by the corresponding lane.
Bitwise shift-left; yields self << mask(rhs), where mask removes any
high-order bits of rhs that would cause the shift to exceed the bitwidth
of the type. (same as wrapping_shl)
Source§impl Shr for u32x8
Shifts lanes by the corresponding lane.
impl Shr for u32x8
Shifts lanes by the corresponding lane.
Bitwise shift-right; yields self >> mask(rhs), where mask removes any
high-order bits of rhs that would cause the shift to exceed the bitwidth
of the type. (same as wrapping_shr)
impl StructuralPartialEq for u32x8
Source§impl Sub<u32> for u32x8
impl Sub<u32> for u32x8
Source§impl SubAssign for u32x8
impl SubAssign for u32x8
Source§fn sub_assign(&mut self, rhs: u32x8)
fn sub_assign(&mut self, rhs: u32x8)
-= operation. Read moreSource§impl SubAssign<&u32x8> for u32x8
impl SubAssign<&u32x8> for u32x8
Source§fn sub_assign(&mut self, rhs: &u32x8)
fn sub_assign(&mut self, rhs: &u32x8)
-= operation. Read moreAuto Trait Implementations§
impl Freeze for u32x8
impl RefUnwindSafe for u32x8
impl Send for u32x8
impl Sync for u32x8
impl Unpin for u32x8
impl UnsafeUnpin for u32x8
impl UnwindSafe for u32x8
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more