pub struct i8x32<S: Simd> {
pub simd: S,
/* private fields */
}Expand description
A SIMD vector of 32 i8 elements.
This type’s memory layout is identical to that of [i8; 32], except that it is aligned to 32 bytes.
You may construct this vector type using the Self::splat, Self::from_slice, Self::simd_from, Self::from_fn, and Self::block_splat methods.
fn construct_simd<S: Simd>(simd: S) {
// From a single scalar value:
let a = i8x32::splat(simd, 1);
let b = i8x32::simd_from(simd, 1);
// From a slice:
let c = i8x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);
// From an array:
let d = i8x32::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);
// From an element-wise function:
let e = i8x32::from_fn(simd, |i| i as i8);
// From `Self::Block`:
let f = i8x32::block_splat(i8x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]));
}Fields§
§simd: STrait Implementations§
Source§impl<S: Simd> AddAssign for i8x32<S>
impl<S: Simd> AddAssign for i8x32<S>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Add two vectors element-wise, wrapping on overflow.
Source§impl<S: Simd> AddAssign<i8> for i8x32<S>
impl<S: Simd> AddAssign<i8> for i8x32<S>
Source§fn add_assign(&mut self, rhs: i8)
fn add_assign(&mut self, rhs: i8)
+= operation. Read moreSource§impl<S: Simd> BitAndAssign for i8x32<S>
impl<S: Simd> BitAndAssign for i8x32<S>
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Compute the bitwise AND of two vectors.
Source§impl<S: Simd> BitAndAssign<i8> for i8x32<S>
impl<S: Simd> BitAndAssign<i8> for i8x32<S>
Source§fn bitand_assign(&mut self, rhs: i8)
fn bitand_assign(&mut self, rhs: i8)
&= operation. Read moreSource§impl<S: Simd> BitOrAssign for i8x32<S>
impl<S: Simd> BitOrAssign for i8x32<S>
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Compute the bitwise OR of two vectors.
Source§impl<S: Simd> BitOrAssign<i8> for i8x32<S>
impl<S: Simd> BitOrAssign<i8> for i8x32<S>
Source§fn bitor_assign(&mut self, rhs: i8)
fn bitor_assign(&mut self, rhs: i8)
|= operation. Read moreSource§impl<S: Simd> BitXorAssign for i8x32<S>
impl<S: Simd> BitXorAssign for i8x32<S>
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Compute the bitwise XOR of two vectors.
Source§impl<S: Simd> BitXorAssign<i8> for i8x32<S>
impl<S: Simd> BitXorAssign<i8> for i8x32<S>
Source§fn bitxor_assign(&mut self, rhs: i8)
fn bitxor_assign(&mut self, rhs: i8)
^= operation. Read moreSource§impl<S: Simd> Bytes for i8x32<S>
impl<S: Simd> Bytes for i8x32<S>
impl<S: Copy + Simd> Copy for i8x32<S>where
S::i8x32: Copy,
Source§impl<S: Simd> ExtractToken for i8x32<S>
impl<S: Simd> ExtractToken for i8x32<S>
Source§impl<S: Simd> MulAssign for i8x32<S>
impl<S: Simd> MulAssign for i8x32<S>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Multiply two vectors element-wise, wrapping on overflow.
Source§impl<S: Simd> MulAssign<i8> for i8x32<S>
impl<S: Simd> MulAssign<i8> for i8x32<S>
Source§fn mul_assign(&mut self, rhs: i8)
fn mul_assign(&mut self, rhs: i8)
*= operation. Read moreSource§impl<S: Simd> Shl for i8x32<S>
impl<S: Simd> Shl for i8x32<S>
Source§fn shl(self, rhs: Self) -> Self::Output
fn shl(self, rhs: Self) -> Self::Output
Shift each element left by the given number of bits.
Bits shifted out of the left side are discarded, and zeros are shifted in on the right.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
§Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for u8 and i8 elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
Source§impl<S: Simd> Shl<u32> for i8x32<S>
impl<S: Simd> Shl<u32> for i8x32<S>
Source§fn shl(self, rhs: u32) -> Self::Output
fn shl(self, rhs: u32) -> Self::Output
Shift each element left by the given number of bits.
Bits shifted out of the left side are discarded, and zeros are shifted in on the right.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
Source§impl<S: Simd> ShlAssign for i8x32<S>
impl<S: Simd> ShlAssign for i8x32<S>
Source§fn shl_assign(&mut self, rhs: Self)
fn shl_assign(&mut self, rhs: Self)
Shift each element left by the given number of bits.
Bits shifted out of the left side are discarded, and zeros are shifted in on the right.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
§Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for u8 and i8 elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
Source§impl<S: Simd> ShlAssign<u32> for i8x32<S>
impl<S: Simd> ShlAssign<u32> for i8x32<S>
Source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
<<= operation. Read moreSource§impl<S: Simd> Shr for i8x32<S>
impl<S: Simd> Shr for i8x32<S>
Source§fn shr(self, rhs: Self) -> Self::Output
fn shr(self, rhs: Self) -> Self::Output
Shift each element right by the corresponding element in another vector.
For unsigned integers, zeros are shifted in on the left. For signed integers, the sign bit is replicated.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
§Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for u8 and i8 elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
Source§impl<S: Simd> Shr<u32> for i8x32<S>
impl<S: Simd> Shr<u32> for i8x32<S>
Source§fn shr(self, rhs: u32) -> Self::Output
fn shr(self, rhs: u32) -> Self::Output
Shift each element right by the given number of bits.
For unsigned integers, zeros are shifted in on the left. For signed integers, the sign bit is replicated.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
Source§impl<S: Simd> ShrAssign for i8x32<S>
impl<S: Simd> ShrAssign for i8x32<S>
Source§fn shr_assign(&mut self, rhs: Self)
fn shr_assign(&mut self, rhs: Self)
Shift each element right by the corresponding element in another vector.
For unsigned integers, zeros are shifted in on the left. For signed integers, the sign bit is replicated.
When shifting out of bounds (e.g. shifting a 32-bit value by 32 or more), the result is implementation-defined and may vary by platform.
§Performance
This per-lane shift is slower than shifting the entire vector by a scalar. It is not vectorized at all on WebAssembly, SSE4.2, and for u8 and i8 elements on AVX2. Prefer shifting by a single scalar value instead of by a vector whenever possible.
Source§impl<S: Simd> ShrAssign<u32> for i8x32<S>
impl<S: Simd> ShrAssign<u32> for i8x32<S>
Source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
>>= operation. Read moreSource§impl<S: Simd> SimdBase<S> for i8x32<S>
impl<S: Simd> SimdBase<S> for i8x32<S>
Source§const LEN: usize = 32
const LEN: usize = 32
Simd::f32s) and
want to process data in native-width chunks.Source§type ByteVector = u8x32<S>
type ByteVector = u8x32<S>
u8 lanes used as the byte representation. Read moreSource§type Array = [i8; 32]
type Array = [i8; 32]
[Self::Element; Self::LEN]. It has the same layout as
this vector type, but likely has a lower alignment.fn as_slice(&self) -> &[i8]
fn as_mut_slice(&mut self) -> &mut [i8]
Source§fn from_slice(simd: S, slice: &[i8]) -> Self
fn from_slice(simd: S, slice: &[i8]) -> Self
Source§fn store_slice(&self, slice: &mut [i8])
fn store_slice(&self, slice: &mut [i8])
Source§fn splat(simd: S, val: i8) -> Self
fn splat(simd: S, val: i8) -> Self
Source§fn block_splat(block: Self::Block) -> Self
fn block_splat(block: Self::Block) -> Self
Source§fn from_fn(simd: S, f: impl FnMut(usize) -> i8) -> Self
fn from_fn(simd: S, f: impl FnMut(usize) -> i8) -> Self
f with that element’s lane index (from 0 to
SimdBase::LEN - 1).Source§fn slide_within_blocks<const SHIFT: usize>(
self,
rhs: impl SimdInto<Self, S>,
) -> Self
fn slide_within_blocks<const SHIFT: usize>( self, rhs: impl SimdInto<Self, S>, ) -> Self
slide, but operates independently on each 128-bit block.Source§fn swizzle_dyn_within_blocks(
self,
indices: impl SimdInto<Self::Bytes, S>,
) -> Self
fn swizzle_dyn_within_blocks( self, indices: impl SimdInto<Self::Bytes, S>, ) -> Self
Source§fn swizzle_dyn(self, indices: impl SimdInto<Self::Bytes, S>) -> Self
fn swizzle_dyn(self, indices: impl SimdInto<Self::Bytes, S>) -> Self
Source§fn swizzle_dyn_precise(self, indices: impl SimdInto<Self::Bytes, S>) -> Self
fn swizzle_dyn_precise(self, indices: impl SimdInto<Self::Bytes, S>) -> Self
Source§fn reduce_max(self) -> Self::Element
fn reduce_max(self) -> Self::Element
Source§fn reduce_min(self) -> Self::Element
fn reduce_min(self) -> Self::Element
Source§fn reduce_max_precise(self) -> Self::Element
fn reduce_max_precise(self) -> Self::Element
Source§fn reduce_min_precise(self) -> Self::Element
fn reduce_min_precise(self) -> Self::Element
Source§fn reduce_sum(self) -> Self::Element
fn reduce_sum(self) -> Self::Element
Source§fn reduce_product(self) -> Self::Element
fn reduce_product(self) -> Self::Element
Source§fn max(self, rhs: impl SimdInto<Self, S>) -> Self
fn max(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn min(self, rhs: impl SimdInto<Self, S>) -> Self
fn min(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn max_precise(self, rhs: impl SimdInto<Self, S>) -> Self
fn max_precise(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn min_precise(self, rhs: impl SimdInto<Self, S>) -> Self
fn min_precise(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn simd_eq(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
fn simd_eq(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
Source§fn simd_lt(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
fn simd_lt(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
Source§fn simd_le(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
fn simd_le(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
Source§fn simd_ge(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
fn simd_ge(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
Source§fn simd_gt(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
fn simd_gt(self, rhs: impl SimdInto<Self, S>) -> Self::Mask
Source§fn zip_low(self, rhs: impl SimdInto<Self, S>) -> Self
fn zip_low(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn zip_high(self, rhs: impl SimdInto<Self, S>) -> Self
fn zip_high(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn unzip_low(self, rhs: impl SimdInto<Self, S>) -> Self
fn unzip_low(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn unzip_high(self, rhs: impl SimdInto<Self, S>) -> Self
fn unzip_high(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn interleave(self, rhs: impl SimdInto<Self, S>) -> (Self, Self)
fn interleave(self, rhs: impl SimdInto<Self, S>) -> (Self, Self)
Source§fn deinterleave(self, rhs: impl SimdInto<Self, S>) -> (Self, Self)
fn deinterleave(self, rhs: impl SimdInto<Self, S>) -> (Self, Self)
Source§fn load_array(simd: S, val: Self::Array) -> Self
fn load_array(simd: S, val: Self::Array) -> Self
Source§fn load_array_ref(simd: S, val: &Self::Array) -> Self
fn load_array_ref(simd: S, val: &Self::Array) -> Self
Source§fn as_array(&self) -> &Self::Array
fn as_array(&self) -> &Self::Array
Source§fn as_mut_array(&mut self) -> &mut Self::Array
fn as_mut_array(&mut self) -> &mut Self::Array
Source§fn store_array(self, dest: &mut Self::Array)
fn store_array(self, dest: &mut Self::Array)
Source§fn rotate_elements_left<const OFFSET: usize>(self) -> Self
fn rotate_elements_left<const OFFSET: usize>(self) -> Self
OFFSET. Read moreSource§fn rotate_elements_right<const OFFSET: usize>(self) -> Self
fn rotate_elements_right<const OFFSET: usize>(self) -> Self
OFFSET. Read moreSource§fn shift_elements_left<const OFFSET: usize>(
self,
padding: Self::Element,
) -> Self
fn shift_elements_left<const OFFSET: usize>( self, padding: Self::Element, ) -> Self
Source§impl<S: Simd> SimdCombine<S> for i8x32<S>
impl<S: Simd> SimdCombine<S> for i8x32<S>
Source§impl<S: Simd> SimdInt<S> for i8x32<S>
impl<S: Simd> SimdInt<S> for i8x32<S>
Source§fn count_ones(self) -> Self
fn count_ones(self) -> Self
Source§fn count_zeros(self) -> Self
fn count_zeros(self) -> Self
Source§fn saturating_add(self, rhs: impl SimdInto<Self, S>) -> Self
fn saturating_add(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn saturating_sub(self, rhs: impl SimdInto<Self, S>) -> Self
fn saturating_sub(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn to_float<T: SimdCvtFloat<Self>>(self) -> T
fn to_float<T: SimdCvtFloat<Self>>(self) -> T
SimdCvtFloat::float_from, and can only be called if there
actually exists a target type of the same bit width (f32 or f64).