pub struct Simd<T, A = Scalar128>where
T: SimdElement,
A: Arch,{ /* private fields */ }Implementations§
Source§impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
pub fn zero() -> Simd<T, A>
pub fn from_aligned_slice(slice: &[T]) -> Simd<T, A>
Sourcepub unsafe fn from_aligned_slice_unchecked(slice: &[T]) -> Simd<T, A>
pub unsafe fn from_aligned_slice_unchecked(slice: &[T]) -> Simd<T, A>
§Safety
Does not check if the slice goes out of bounds.
pub fn from_slice(slice: &[T]) -> Simd<T, A>
Sourcepub unsafe fn from_slice_partial(slice: &[T]) -> Simd<T, A>
pub unsafe fn from_slice_partial(slice: &[T]) -> Simd<T, A>
§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]) -> Simd<T, A>
pub unsafe fn from_slice_unchecked(slice: &[T]) -> Simd<T, A>
§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.
Sourcepub fn to_array(self) -> <T as SimdElement>::Array<A>
pub fn to_array(self) -> <T as SimdElement>::Array<A>
pub fn iota(offset: T) -> Simd<T, A>
Source§impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
pub fn raw_cast<S>(self) -> Simd<S, A>where
S: SimdElement,
Source§impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
Sourcepub fn clamp(
self,
lower_bound: Simd<T, A>,
upper_bound: Simd<T, A>,
) -> Simd<T, A>
pub fn clamp( self, lower_bound: Simd<T, A>, upper_bound: Simd<T, A>, ) -> Simd<T, A>
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) -> Simd<T, A>
pub fn block_left_byte_shift<const N: i32>(self) -> Simd<T, A>
Shifts bytes N to the left within 128-bit blocks.
Sourcepub fn block_right_byte_shift<const N: i32>(self) -> Simd<T, A>
pub fn block_right_byte_shift<const N: i32>(self) -> Simd<T, A>
Shifts bytes N to the right within 128-bit blocks.
Source§impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
Sourcepub fn masked_load(slice: &[T], mask: Mask<T, A>) -> Simd<T, A>
pub fn masked_load(slice: &[T], mask: Mask<T, A>) -> Simd<T, A>
Loads a register according to a mask.
Sourcepub fn partial_load(slice: &[T], amount: usize) -> Simd<T, A>
pub fn partial_load(slice: &[T], amount: usize) -> Simd<T, A>
Loads only the first amount elements into the register.
Sourcepub unsafe fn partial_load_unchecked(slice: &[T], amount: usize) -> Simd<T, A>
pub unsafe fn partial_load_unchecked(slice: &[T], amount: usize) -> Simd<T, A>
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: Simd<T, A>) -> Mask<T, A>
pub fn simd_ne(self, rhs: Simd<T, A>) -> Mask<T, A>
pub fn simd_gt(self, rhs: Simd<T, A>) -> Mask<T, A>
pub fn simd_ge(self, rhs: Simd<T, A>) -> Mask<T, A>
pub fn simd_lt(self, rhs: Simd<T, A>) -> Mask<T, A>
pub fn simd_le(self, rhs: Simd<T, A>) -> Mask<T, A>
pub fn max(self, rhs: Simd<T, A>) -> Simd<T, A>
pub fn min(self, rhs: Simd<T, A>) -> Simd<T, A>
Source§impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
Source§impl<A> Simd<u32, A>where
A: Arch,
impl<A> Simd<u32, A>where
A: Arch,
Source§impl<A> Simd<u64, A>where
A: Arch,
impl<A> Simd<u64, A>where
A: Arch,
Source§impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
impl<T, A> Simd<T, A>where
T: SimdElement,
A: Arch,
pub fn left_lane_shift(self, n: u32) -> Simd<T, A>
pub fn right_lane_shift(self, n: u32) -> Simd<T, A>
Source§impl<T, A> Simd<T, A>where
T: SimdInteger,
A: Arch,
impl<T, A> Simd<T, A>where
T: SimdInteger,
A: Arch,
Source§impl<T, A> Simd<T, A>
impl<T, A> Simd<T, A>
pub fn cast_signed(self) -> Simd<<T as SimdInteger>::Signed, A>
Source§impl<T, A> Simd<T, A>
impl<T, A> Simd<T, A>
pub fn cast_unsigned(self) -> Simd<<T as SimdInteger>::Unsigned, A>
Source§impl<T, A> Simd<T, A>
impl<T, A> Simd<T, A>
pub fn floor(self) -> Simd<T, A>
pub fn round(self) -> Simd<T, A>
pub fn ceil(self) -> Simd<T, A>
pub fn fract(self) -> Simd<T, A>
pub fn mul_add(self, mult: Simd<T, A>, add: Simd<T, A>) -> Simd<T, A>
pub fn mul_sub(self, mult: Simd<T, A>, sub: Simd<T, A>) -> Simd<T, A>
pub fn negated_mul_add(self, mult: Simd<T, A>, add: Simd<T, A>) -> Simd<T, A>
pub fn negated_mul_sub(self, mult: Simd<T, A>, sub: Simd<T, A>) -> Simd<T, A>
pub fn cast_int_trunc(self) -> Simd<<T as HasSigned>::Signed, A>
pub fn cast_int_round(self) -> Simd<<T as HasSigned>::Signed, A>
pub fn cast_uint_trunc(self) -> Simd<<T as HasUnsigned>::Unsigned, A>
pub fn cast_uint_round(self) -> Simd<<T as HasUnsigned>::Unsigned, A>
pub fn quintic_lerp(self) -> Simd<T, A>
pub fn cubic_lerp(self) -> Simd<T, A>
pub fn sqrt(self) -> Simd<T, A>
pub fn abs(self) -> Simd<T, A>
Source§impl<T, A> Simd<T, A>
impl<T, A> Simd<T, A>
pub fn exp(self) -> Simd<T, A>
Sourcepub unsafe fn exp_unchecked(self) -> Simd<T, A>
pub unsafe fn exp_unchecked(self) -> Simd<T, A>
§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) -> Simd<T, A>
Sourcepub unsafe fn exp2_unchecked(self) -> Simd<T, A>
pub unsafe fn exp2_unchecked(self) -> Simd<T, A>
§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) -> Simd<T, A>
Sourcepub unsafe fn log2_unchecked(self) -> Simd<T, A>
pub unsafe fn log2_unchecked(self) -> Simd<T, A>
§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: Simd<T, A>) -> Simd<T, A>
Sourcepub unsafe fn pow_unchecked(self, y: Simd<T, A>) -> Simd<T, A>
pub unsafe fn pow_unchecked(self, y: Simd<T, A>) -> Simd<T, A>
§Safety
selfmust be positive, normal, and finite.ymust be finite.- Result must be representable as an f32.
Trait Implementations§
Source§impl<T, A> AddAssign for Simd<T, A>
impl<T, A> AddAssign for Simd<T, A>
Source§fn add_assign(&mut self, rhs: Simd<T, A>)
fn add_assign(&mut self, rhs: Simd<T, A>)
+= operation. Read moreSource§impl<T, A> BitAndAssign for Simd<T, A>
impl<T, A> BitAndAssign for Simd<T, A>
Source§fn bitand_assign(&mut self, rhs: Simd<T, A>)
fn bitand_assign(&mut self, rhs: Simd<T, A>)
&= operation. Read moreSource§impl<T, A> BitOrAssign for Simd<T, A>
impl<T, A> BitOrAssign for Simd<T, A>
Source§fn bitor_assign(&mut self, rhs: Simd<T, A>)
fn bitor_assign(&mut self, rhs: Simd<T, A>)
|= operation. Read moreSource§impl<T, A> BitXorAssign for Simd<T, A>
impl<T, A> BitXorAssign for Simd<T, A>
Source§fn bitxor_assign(&mut self, rhs: Simd<T, A>)
fn bitxor_assign(&mut self, rhs: Simd<T, A>)
^= operation. Read moreimpl<T, A> Copy for Simd<T, A>
Source§impl<T, A> DivAssign for Simd<T, A>
impl<T, A> DivAssign for Simd<T, A>
Source§fn div_assign(&mut self, rhs: Simd<T, A>)
fn div_assign(&mut self, rhs: Simd<T, A>)
/= operation. Read moreSource§impl<T, A> MulAssign for Simd<T, A>
impl<T, A> MulAssign for Simd<T, A>
Source§fn mul_assign(&mut self, rhs: Simd<T, A>)
fn mul_assign(&mut self, rhs: Simd<T, A>)
*= operation. Read moreSource§impl<T, A> RemAssign for Simd<T, A>
impl<T, A> RemAssign for Simd<T, A>
Source§fn rem_assign(&mut self, rhs: Simd<T, A>)
fn rem_assign(&mut self, rhs: Simd<T, A>)
%= operation. Read more