#[repr(C, align(32))]pub struct u16x16<S: Simd> {
pub(crate) val: S::u16x16,
pub simd: S,
}Expand description
A SIMD vector of 16 u16 elements.
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 = u16x16::splat(simd, 1);
let b = u16x16::simd_from(simd, 1);
// From a slice:
let c = u16x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
// From an array:
let d = u16x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
// From an element-wise function:
let e = u16x16::from_fn(simd, |i| i as u16);
// From `Self::Block`:
let f = u16x16::block_splat(u16x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]));
}Fields§
§val: S::u16x16§simd: STrait Implementations§
Source§impl<S: Simd> AddAssign<u16> for u16x16<S>
impl<S: Simd> AddAssign<u16> for u16x16<S>
Source§fn add_assign(&mut self, rhs: u16)
fn add_assign(&mut self, rhs: u16)
+= operation. Read moreSource§impl<S: Simd> AddAssign for u16x16<S>
impl<S: Simd> AddAssign for u16x16<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> BitAndAssign<u16> for u16x16<S>
impl<S: Simd> BitAndAssign<u16> for u16x16<S>
Source§fn bitand_assign(&mut self, rhs: u16)
fn bitand_assign(&mut self, rhs: u16)
&= operation. Read moreSource§impl<S: Simd> BitAndAssign for u16x16<S>
impl<S: Simd> BitAndAssign for u16x16<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> BitOrAssign<u16> for u16x16<S>
impl<S: Simd> BitOrAssign<u16> for u16x16<S>
Source§fn bitor_assign(&mut self, rhs: u16)
fn bitor_assign(&mut self, rhs: u16)
|= operation. Read moreSource§impl<S: Simd> BitOrAssign for u16x16<S>
impl<S: Simd> BitOrAssign for u16x16<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> BitXorAssign<u16> for u16x16<S>
impl<S: Simd> BitXorAssign<u16> for u16x16<S>
Source§fn bitxor_assign(&mut self, rhs: u16)
fn bitxor_assign(&mut self, rhs: u16)
^= operation. Read moreSource§impl<S: Simd> BitXorAssign for u16x16<S>
impl<S: Simd> BitXorAssign for u16x16<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> Bytes for u16x16<S>
impl<S: Simd> Bytes for u16x16<S>
Source§impl<S: Simd> MulAssign<u16> for u16x16<S>
impl<S: Simd> MulAssign<u16> for u16x16<S>
Source§fn mul_assign(&mut self, rhs: u16)
fn mul_assign(&mut self, rhs: u16)
*= operation. Read moreSource§impl<S: Simd> MulAssign for u16x16<S>
impl<S: Simd> MulAssign for u16x16<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> Shl for u16x16<S>
impl<S: Simd> Shl for u16x16<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.
This operation is not implemented in hardware on all platforms. On WebAssembly, and on x86 platforms without AVX2, this will use a fallback scalar implementation.
Source§impl<S: Simd> ShlAssign<u32> for u16x16<S>
impl<S: Simd> ShlAssign<u32> for u16x16<S>
Source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
<<= operation. Read moreSource§impl<S: Simd> ShlAssign for u16x16<S>
impl<S: Simd> ShlAssign for u16x16<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.
This operation is not implemented in hardware on all platforms. On WebAssembly, and on x86 platforms without AVX2, this will use a fallback scalar implementation.
Source§impl<S: Simd> Shr for u16x16<S>
impl<S: Simd> Shr for u16x16<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.
This operation is not implemented in hardware on all platforms. On WebAssembly, and on x86 platforms without AVX2, this will use a fallback scalar implementation.
Source§impl<S: Simd> ShrAssign<u32> for u16x16<S>
impl<S: Simd> ShrAssign<u32> for u16x16<S>
Source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
>>= operation. Read moreSource§impl<S: Simd> ShrAssign for u16x16<S>
impl<S: Simd> ShrAssign for u16x16<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.
This operation is not implemented in hardware on all platforms. On WebAssembly, and on x86 platforms without AVX2, this will use a fallback scalar implementation.
Source§impl<S: Simd> SimdBase<S> for u16x16<S>
impl<S: Simd> SimdBase<S> for u16x16<S>
Source§const N: usize = 16
const N: usize = 16
Simd::f32s) and
want to process data in native-width chunks.Source§type Array = [u16; 16]
type Array = [u16; 16]
[Self::Element; Self::N]. It has the same layout as
this vector type, but likely has a lower alignment.fn as_slice(&self) -> &[u16]
fn as_mut_slice(&mut self) -> &mut [u16]
Source§fn from_slice(simd: S, slice: &[u16]) -> Self
fn from_slice(simd: S, slice: &[u16]) -> Self
Source§fn store_slice(&self, slice: &mut [u16])
fn store_slice(&self, slice: &mut [u16])
Source§fn splat(simd: S, val: u16) -> Self
fn splat(simd: S, val: u16) -> 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) -> u16) -> Self
fn from_fn(simd: S, f: impl FnMut(usize) -> u16) -> Self
f with that element’s lane index (from 0 to
SimdBase::N - 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§impl<S: Simd> SimdCombine<S> for u16x16<S>
impl<S: Simd> SimdCombine<S> for u16x16<S>
Source§impl<S: Simd> SimdInt<S> for u16x16<S>
impl<S: Simd> SimdInt<S> for u16x16<S>
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 min(self, rhs: impl SimdInto<Self, S>) -> Self
fn min(self, rhs: impl SimdInto<Self, S>) -> Self
Source§fn max(self, rhs: impl SimdInto<Self, S>) -> Self
fn max(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 (currently, only f32).Source§impl<S: Simd> SubAssign<u16> for u16x16<S>
impl<S: Simd> SubAssign<u16> for u16x16<S>
Source§fn sub_assign(&mut self, rhs: u16)
fn sub_assign(&mut self, rhs: u16)
-= operation. Read moreSource§impl<S: Simd> SubAssign for u16x16<S>
impl<S: Simd> SubAssign for u16x16<S>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Subtract two vectors element-wise, wrapping on overflow.