pub struct Simd<T: SimdElement, A: Arch = StaticArch> { /* private fields */ }Implementations§
Source§impl<T: SimdElement, A: Arch> Simd<T, A>
impl<T: SimdElement, A: Arch> Simd<T, A>
pub fn zero() -> Self
pub fn from_aligned_slice(slice: &[T]) -> Self
Sourcepub unsafe fn from_aligned_slice_unchecked(slice: &[T]) -> Self
pub unsafe fn from_aligned_slice_unchecked(slice: &[T]) -> Self
§Safety
Does not check if the slice goes out of bounds.
pub fn from_slice(slice: &[T]) -> Self
Sourcepub unsafe fn from_slice_partial(slice: &[T]) -> Self
pub unsafe fn from_slice_partial(slice: &[T]) -> Self
§Safety
Requires allocated memory to be behind (left) of the slice. Bounds are not checked. Length of the slice must be less than or equal to the number of lanes.
Sourcepub unsafe fn from_slice_unchecked(slice: &[T]) -> Self
pub unsafe fn from_slice_unchecked(slice: &[T]) -> Self
§Safety
Does not check if the slice goes out of bounds.
pub fn copy_to_aligned_slice(self, slice: &mut [T])
Sourcepub unsafe fn copy_to_aligned_slice_unchecked(self, slice: &mut [T])
pub unsafe fn copy_to_aligned_slice_unchecked(self, slice: &mut [T])
§Safety
Does not check if the slice goes out of bounds.
pub fn copy_to_slice(self, slice: &mut [T])
Sourcepub unsafe fn copy_to_slice_unchecked(self, slice: &mut [T])
pub unsafe fn copy_to_slice_unchecked(self, slice: &mut [T])
§Safety
Does not check if the slice goes out of bounds.
pub fn iota(offset: T) -> Self
Source§impl<T: SimdElement, A: Arch> Simd<T, A>
impl<T: SimdElement, A: Arch> Simd<T, A>
pub fn raw_cast<S: SimdElement>(self) -> Simd<S, A>
Source§impl<T: SimdElement, A: Arch> Simd<T, A>
impl<T: SimdElement, A: Arch> Simd<T, A>
Sourcepub fn clamp(self, lower_bound: Self, upper_bound: Self) -> Self
pub fn clamp(self, lower_bound: Self, upper_bound: Self) -> Self
Clamps the values in a register between two bounds, inclusive.
§Parameters:
lower_bound: Minimum value after clampingupper_bound: Maximum value after clamping
Sourcepub fn block_left_byte_shift<const N: i32>(self) -> Self
pub fn block_left_byte_shift<const N: i32>(self) -> Self
Shifts bytes N to the left within 128-bit blocks.
Sourcepub fn block_right_byte_shift<const N: i32>(self) -> Self
pub fn block_right_byte_shift<const N: i32>(self) -> Self
Shifts bytes N to the right within 128-bit blocks.
Source§impl<T: SimdElement, A: Arch> Simd<T, A>
impl<T: SimdElement, A: Arch> Simd<T, A>
Sourcepub fn masked_load(slice: &[T], mask: Mask<T, A>) -> Self
pub fn masked_load(slice: &[T], mask: Mask<T, A>) -> Self
Loads a register according to a mask.
Sourcepub fn partial_load(slice: &[T], amount: usize) -> Self
pub fn partial_load(slice: &[T], amount: usize) -> Self
Loads only the first amount elements into the register.
Sourcepub unsafe fn partial_load_unchecked(slice: &[T], amount: usize) -> Self
pub unsafe fn partial_load_unchecked(slice: &[T], amount: usize) -> Self
Loads only the first amount elements into the register.
§Safety
- Slice must be greater than or equal to
ArchSimd::<T>::LANES
Sourcepub fn masked_store(self, slice: &mut [T], mask: Mask<T, A>)
pub fn masked_store(self, slice: &mut [T], mask: Mask<T, A>)
Stores the register using a given mask.
Sourcepub fn partial_store(self, slice: &mut [T], amount: usize)
pub fn partial_store(self, slice: &mut [T], amount: usize)
Stores only the first amount elements into the register.
pub fn simd_eq(self, rhs: Self) -> Mask<T, A>
pub fn simd_ne(self, rhs: Self) -> Mask<T, A>
pub fn simd_gt(self, rhs: Self) -> Mask<T, A>
pub fn simd_ge(self, rhs: Self) -> Mask<T, A>
pub fn simd_lt(self, rhs: Self) -> Mask<T, A>
pub fn simd_le(self, rhs: Self) -> Mask<T, A>
pub fn max(self, rhs: Self) -> Self
pub fn min(self, rhs: Self) -> Self
Source§impl<T: SimdElement + SimdElement<BitWidthType = B32>, A: Arch> Simd<T, A>
impl<T: SimdElement + SimdElement<BitWidthType = B32>, A: Arch> Simd<T, A>
pub fn permute_32(self, indices: Simd<u32, A>) -> Self
Source§impl<T: SimdElement, A: Arch> Simd<T, A>
impl<T: SimdElement, A: Arch> Simd<T, A>
Source§impl<A: Arch> Simd<u32, A>
impl<A: Arch> Simd<u32, A>
pub fn gather<S: SimdElement + SimdElement<BitWidthType = B32>, const N: usize>( self, slice: &[S; N], ) -> Simd<S, A>
Source§impl<A: Arch> Simd<u64, A>
impl<A: Arch> Simd<u64, A>
pub fn gather<S: SimdElement + SimdElement<BitWidthType = B64>, const N: usize>( self, slice: &[S; N], ) -> Simd<S, A>
Source§impl<T: SimdElement, A: Arch> Simd<T, A>
impl<T: SimdElement, A: Arch> Simd<T, A>
pub fn left_lane_shift(self, n: u32) -> Self
pub fn right_lane_shift(self, n: u32) -> Self
Source§impl<T: SimdInteger + HasSigned, A: Arch> Simd<T, A>
impl<T: SimdInteger + HasSigned, A: Arch> Simd<T, A>
pub fn cast_signed(self) -> Simd<<T as SimdInteger>::Signed, A>
Source§impl<T: SimdInteger + HasUnsigned, A: Arch> Simd<T, A>
impl<T: SimdInteger + HasUnsigned, A: Arch> Simd<T, A>
pub fn cast_unsigned(self) -> Simd<<T as SimdInteger>::Unsigned, A>
Source§impl<T: SimdInteger + HasFloat, A: Arch> Simd<T, A>
impl<T: SimdInteger + HasFloat, A: Arch> Simd<T, A>
pub fn cast_float(self) -> Simd<<T as HasFloat>::Float, A>
Source§impl<T: SimdFloat, A: Arch> Simd<T, A>
impl<T: SimdFloat, A: Arch> Simd<T, A>
pub fn floor(self) -> Self
pub fn round(self) -> Self
pub fn ceil(self) -> Self
pub fn fract(self) -> Self
pub fn mul_add(self, mult: Self, add: Self) -> Self
pub fn mul_sub(self, mult: Self, sub: Self) -> Self
pub fn negated_mul_add(self, mult: Self, add: Self) -> Self
pub fn negated_mul_sub(self, mult: Self, sub: Self) -> Self
pub fn cast_int_trunc(self) -> Simd<T::Signed, A>
pub fn cast_int_round(self) -> Simd<T::Signed, A>
pub fn cast_uint_trunc(self) -> Simd<T::Unsigned, A>
pub fn cast_uint_round(self) -> Simd<T::Unsigned, A>
pub fn quintic_lerp(self) -> Self
pub fn cubic_lerp(self) -> Self
pub fn sqrt(self) -> Self
pub fn abs(self) -> Self
Source§impl<T: SimdFloat, A: Arch> Simd<T, A>
impl<T: SimdFloat, A: Arch> Simd<T, A>
pub fn exp(self) -> Self
Sourcepub unsafe fn exp_unchecked(self) -> Self
pub unsafe fn exp_unchecked(self) -> Self
§Safety
Does not check for the 0.0 or INF cases. Assumes the given values do not result in 0.0 or INF.
pub fn exp2(self) -> Self
Sourcepub unsafe fn exp2_unchecked(self) -> Self
pub unsafe fn exp2_unchecked(self) -> Self
§Safety
Does not check for the 0.0 or INF cases. Assumes the given values do not result in 0.0 or INF.
pub fn log2(self) -> Self
Sourcepub unsafe fn log2_unchecked(self) -> Self
pub unsafe fn log2_unchecked(self) -> Self
§Safety
Does not check for the -INF, INF, or NaN cases. Assumes the given values do not result in 0.0 or INF.
pub fn pow(self, y: Self) -> Self
Sourcepub unsafe fn pow_unchecked(self, y: Self) -> Self
pub unsafe fn pow_unchecked(self, y: Self) -> Self
§Safety
selfmust be positive, normal, and finite.ymust be finite.- Result must be representable as an f32.
Trait Implementations§
Source§impl<T: SimdElement, A: Arch> AddAssign for Simd<T, A>
impl<T: SimdElement, A: Arch> AddAssign for Simd<T, A>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<T: SimdElement, A: Arch> BitAndAssign for Simd<T, A>
impl<T: SimdElement, A: Arch> BitAndAssign for Simd<T, A>
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl<T: SimdElement, A: Arch> BitOrAssign for Simd<T, A>
impl<T: SimdElement, A: Arch> BitOrAssign for Simd<T, A>
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl<T: SimdElement, A: Arch> BitXorAssign for Simd<T, A>
impl<T: SimdElement, A: Arch> BitXorAssign for Simd<T, A>
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreimpl<T: Copy + SimdElement, A: Copy + Arch> Copy for Simd<T, A>
Source§impl<T: SimdElement, A: Arch> DivAssign for Simd<T, A>
impl<T: SimdElement, A: Arch> DivAssign for Simd<T, A>
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl<T: SimdElement, A: Arch, const N: usize> FromIterator<Simd<T, A>> for [T; N]
impl<T: SimdElement, A: Arch, const N: usize> FromIterator<Simd<T, A>> for [T; N]
Source§impl<T: SimdElement, A: Arch> FromIterator<Simd<T, A>> for Vec<T>
impl<T: SimdElement, A: Arch> FromIterator<Simd<T, A>> for Vec<T>
Source§impl<T: SimdElement, A: Arch> MulAssign for Simd<T, A>
impl<T: SimdElement, A: Arch> MulAssign for Simd<T, A>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl<T: SimdElement, A: Arch> RemAssign for Simd<T, A>
impl<T: SimdElement, A: Arch> RemAssign for Simd<T, A>
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%= operation. Read more