Skip to main content

Emulated

Struct Emulated 

Source
pub struct Emulated<T, const N: usize, A = Scalar>(/* private fields */);
Expand description

An emulated SIMD vector.

The emulated implementation behaves just like an intrinsic, but the APIs are implemented using loops over arrays rather than dispatching to platform specific instructions.

The idea behind this type is that it can be used on architecture where explicit backend support has not been added, or when an architecture does not support a given type/length pair well.

Furthermore, it can be used when developing new back-ends to provide fallback implementations. This allows new back-ends to be developed one piece at a time instead of all at once.

NOTE: The alignment requirements of an emulated vector will be different than the alignment requirements of an actual intrinsic.

Higher level code must not rely on alignments being compatible across architectures!

Implementations§

Source§

impl<T, const N: usize, A> Emulated<T, N, A>

Source

pub fn from_arch_fn<F>(arch: A, f: F) -> Self
where F: FnMut(usize) -> T,

Trait Implementations§

Source§

impl<T, const N: usize, A> Add for Emulated<T, N, A>
where T: ReferenceScalarOps + Copy + Debug + Default, Const<N>: ArrayType<T>,

Binary Ops

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl AsSIMD<f16x16> for Emulated<f16, 16>

Source§

fn as_simd(self, arch: V3) -> f16x16

Source§

impl AsSIMD<f16x16> for Emulated<f16, 16>

Source§

fn as_simd(self, arch: V4) -> f16x16

Source§

impl AsSIMD<f16x8> for Emulated<f16, 8>

Source§

fn as_simd(self, arch: V3) -> f16x8

Source§

impl AsSIMD<f16x8> for Emulated<f16, 8>

Source§

fn as_simd(self, arch: V4) -> f16x8

Source§

impl AsSIMD<f32x16> for Emulated<f32, 16>

Source§

fn as_simd(self, arch: V4) -> f32x16

Source§

impl AsSIMD<f32x4> for Emulated<f32, 4>

Source§

fn as_simd(self, arch: V3) -> f32x4

Source§

impl AsSIMD<f32x4> for Emulated<f32, 4>

Source§

fn as_simd(self, arch: V4) -> f32x4

Source§

impl AsSIMD<f32x8> for Emulated<f32, 8>

Source§

fn as_simd(self, arch: V3) -> f32x8

Source§

impl AsSIMD<f32x8> for Emulated<f32, 8>

Source§

fn as_simd(self, arch: V4) -> f32x8

Source§

impl AsSIMD<i16x16> for Emulated<i16, 16>

Source§

fn as_simd(self, arch: V3) -> i16x16

Source§

impl AsSIMD<i16x16> for Emulated<i16, 16>

Source§

fn as_simd(self, arch: V4) -> i16x16

Source§

impl AsSIMD<i16x32> for Emulated<i16, 32>

Source§

fn as_simd(self, arch: V4) -> i16x32

Source§

impl AsSIMD<i16x8> for Emulated<i16, 8>

Source§

fn as_simd(self, arch: V3) -> i16x8

Source§

impl AsSIMD<i16x8> for Emulated<i16, 8>

Source§

fn as_simd(self, arch: V4) -> i16x8

Source§

impl AsSIMD<i32x16> for Emulated<i32, 16>

Source§

fn as_simd(self, arch: V4) -> i32x16

Source§

impl AsSIMD<i32x4> for Emulated<i32, 4>

Source§

fn as_simd(self, arch: V3) -> i32x4

Source§

impl AsSIMD<i32x4> for Emulated<i32, 4>

Source§

fn as_simd(self, arch: V4) -> i32x4

Source§

impl AsSIMD<i32x8> for Emulated<i32, 8>

Source§

fn as_simd(self, arch: V3) -> i32x8

Source§

impl AsSIMD<i32x8> for Emulated<i32, 8>

Source§

fn as_simd(self, arch: V4) -> i32x8

Source§

impl AsSIMD<i8x16> for Emulated<i8, 16>

Source§

fn as_simd(self, arch: V3) -> i8x16

Source§

impl AsSIMD<i8x16> for Emulated<i8, 16>

Source§

fn as_simd(self, arch: V4) -> i8x16

Source§

impl AsSIMD<i8x32> for Emulated<i8, 32>

Source§

fn as_simd(self, arch: V3) -> i8x32

Source§

impl AsSIMD<i8x32> for Emulated<i8, 32>

Source§

fn as_simd(self, arch: V4) -> i8x32

Source§

impl AsSIMD<i8x64> for Emulated<i8, 64>

Source§

fn as_simd(self, arch: V4) -> i8x64

Source§

impl AsSIMD<u32x16> for Emulated<u32, 16>

Source§

fn as_simd(self, arch: V4) -> u32x16

Source§

impl AsSIMD<u32x4> for Emulated<u32, 4>

Source§

fn as_simd(self, arch: V3) -> u32x4

Source§

impl AsSIMD<u32x4> for Emulated<u32, 4>

Source§

fn as_simd(self, arch: V4) -> u32x4

Source§

impl AsSIMD<u32x8> for Emulated<u32, 8>

Source§

fn as_simd(self, arch: V3) -> u32x8

Source§

impl AsSIMD<u32x8> for Emulated<u32, 8>

Source§

fn as_simd(self, arch: V4) -> u32x8

Source§

impl AsSIMD<u64x2> for Emulated<u64, 2>

Source§

fn as_simd(self, arch: V3) -> u64x2

Source§

impl AsSIMD<u64x2> for Emulated<u64, 2>

Source§

fn as_simd(self, arch: V4) -> u64x2

Source§

impl AsSIMD<u64x4> for Emulated<u64, 4>

Source§

fn as_simd(self, arch: V3) -> u64x4

Source§

impl AsSIMD<u64x4> for Emulated<u64, 4>

Source§

fn as_simd(self, arch: V4) -> u64x4

Source§

impl AsSIMD<u8x16> for Emulated<u8, 16>

Source§

fn as_simd(self, arch: V3) -> u8x16

Source§

impl AsSIMD<u8x16> for Emulated<u8, 16>

Source§

fn as_simd(self, arch: V4) -> u8x16

Source§

impl AsSIMD<u8x32> for Emulated<u8, 32>

Source§

fn as_simd(self, arch: V3) -> u8x32

Source§

impl AsSIMD<u8x32> for Emulated<u8, 32>

Source§

fn as_simd(self, arch: V4) -> u8x32

Source§

impl AsSIMD<u8x64> for Emulated<u8, 64>

Source§

fn as_simd(self, arch: V4) -> u8x64

Source§

impl<T, const N: usize, A> BitAnd for Emulated<T, N, A>
where T: BitAnd<Output = T> + Copy,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<T, const N: usize, A> BitOr for Emulated<T, N, A>
where T: BitOr<Output = T> + Copy,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<T, const N: usize, A> BitXor for Emulated<T, N, A>
where T: BitXor<Output = T> + Copy,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<T: Clone, const N: usize, A: Clone> Clone for Emulated<T, N, A>

Source§

fn clone(&self) -> Emulated<T, N, A>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, const N: usize, A: Debug> Debug for Emulated<T, N, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A> From<Emulated<f16, 1, A>> for Emulated<f32, 1, A>

Source§

fn from(value: Emulated<f16, 1, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<f16, 16, A>> for Emulated<f32, 16, A>

Source§

fn from(value: Emulated<f16, 16, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<f16, 2, A>> for Emulated<f32, 2, A>

Source§

fn from(value: Emulated<f16, 2, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<f16, 4, A>> for Emulated<f32, 4, A>

Source§

fn from(value: Emulated<f16, 4, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<f16, 8, A>> for Emulated<f32, 8, A>

Source§

fn from(value: Emulated<f16, 8, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<i8, 1, A>> for Emulated<i32, 1, A>

Source§

fn from(value: Emulated<i8, 1, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<i8, 16, A>> for Emulated<i16, 16, A>

Source§

fn from(value: Emulated<i8, 16, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<i8, 32, A>> for Emulated<i16, 32, A>

Source§

fn from(value: Emulated<i8, 32, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<i8, 4, A>> for Emulated<i32, 4, A>

Source§

fn from(value: Emulated<i8, 4, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<u8, 1, A>> for Emulated<i32, 1, A>

Source§

fn from(value: Emulated<u8, 1, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<u8, 16, A>> for Emulated<i16, 16, A>

Source§

fn from(value: Emulated<u8, 16, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<u8, 32, A>> for Emulated<i16, 32, A>

Source§

fn from(value: Emulated<u8, 32, A>) -> Self

Converts to this type from the input type.
Source§

impl<A> From<Emulated<u8, 4, A>> for Emulated<i32, 4, A>

Source§

fn from(value: Emulated<u8, 4, A>) -> Self

Converts to this type from the input type.
Source§

impl<T, const N: usize, A> Mul for Emulated<T, N, A>
where T: ReferenceScalarOps,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl<T, const N: usize, A> Not for Emulated<T, N, A>
where T: Not<Output = T> + Copy,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<T, const N: usize, A> SIMDAbs for Emulated<T, N, A>
where T: ReferenceAbs,

Abs

Source§

fn abs_simd(self) -> Self

Source§

impl<A> SIMDCast<f16> for Emulated<f32, 16, A>
where A: Sealed,

Source§

type Cast = Emulated<f16, 16, A>

The SIMDVector type of the result.
Source§

fn simd_cast(self) -> Self::Cast

Perform the cast.
Source§

impl<A> SIMDCast<f16> for Emulated<f32, 8, A>
where A: Sealed,

Source§

type Cast = Emulated<f16, 8, A>

The SIMDVector type of the result.
Source§

fn simd_cast(self) -> Self::Cast

Perform the cast.
Source§

impl<A> SIMDCast<f32> for Emulated<f16, 16, A>
where A: Sealed,

Source§

type Cast = Emulated<f32, 16, A>

The SIMDVector type of the result.
Source§

fn simd_cast(self) -> Self::Cast

Perform the cast.
Source§

impl<A> SIMDCast<f32> for Emulated<f16, 8, A>
where A: Sealed,

Source§

type Cast = Emulated<f32, 8, A>

The SIMDVector type of the result.
Source§

fn simd_cast(self) -> Self::Cast

Perform the cast.
Source§

impl<A> SIMDCast<f32> for Emulated<i32, 8, A>
where A: Sealed,

Source§

type Cast = Emulated<f32, 8, A>

The SIMDVector type of the result.
Source§

fn simd_cast(self) -> Self::Cast

Perform the cast.
Source§

impl<A> SIMDDotProduct<Emulated<i16, 16, A>> for Emulated<i32, 8, A>
where A: Sealed,

Promote intermediate values to i32 and then perform accumulation.

Source§

fn dot_simd( self, left: Emulated<i16, 16, A>, right: Emulated<i16, 16, A>, ) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i16, 32, A>> for Emulated<i32, 16, A>
where A: Sealed,

Promote intermediate values to i32 and then perform accumulation.

Source§

fn dot_simd( self, left: Emulated<i16, 32, A>, right: Emulated<i16, 32, A>, ) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i16, 8, A>> for Emulated<i32, 4, A>
where A: Sealed,

Promote intermediate values to i32 and then perform accumulation.

Source§

fn dot_simd(self, left: Emulated<i16, 8, A>, right: Emulated<i16, 8, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i8, 16, A>> for Emulated<i32, 4, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<i8, 16, A>, right: Emulated<i8, 16, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i8, 16, A>, Emulated<u8, 16, A>> for Emulated<i32, 4, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<i8, 16, A>, right: Emulated<u8, 16, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i8, 32, A>> for Emulated<i32, 8, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<i8, 32, A>, right: Emulated<i8, 32, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i8, 32, A>, Emulated<u8, 32, A>> for Emulated<i32, 8, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<i8, 32, A>, right: Emulated<u8, 32, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i8, 64, A>> for Emulated<i32, 16, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<i8, 64, A>, right: Emulated<i8, 64, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<i8, 64, A>, Emulated<u8, 64, A>> for Emulated<i32, 16, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<i8, 64, A>, right: Emulated<u8, 64, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<u8, 16, A>> for Emulated<u32, 4, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<u8, 16, A>, right: Emulated<u8, 16, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<u8, 16, A>, Emulated<i8, 16, A>> for Emulated<i32, 4, A>
where A: Sealed,

Promote intermediate values to i32 and then perform accumulation.

Source§

fn dot_simd(self, left: Emulated<u8, 16, A>, right: Emulated<i8, 16, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<u8, 32, A>> for Emulated<u32, 8, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<u8, 32, A>, right: Emulated<u8, 32, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<u8, 32, A>, Emulated<i8, 32, A>> for Emulated<i32, 8, A>
where A: Sealed,

Promote intermediate values to i32 and then perform accumulation.

Source§

fn dot_simd(self, left: Emulated<u8, 32, A>, right: Emulated<i8, 32, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<u8, 64, A>> for Emulated<u32, 16, A>
where A: Sealed,

Source§

fn dot_simd(self, left: Emulated<u8, 64, A>, right: Emulated<u8, 64, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<A> SIMDDotProduct<Emulated<u8, 64, A>, Emulated<i8, 64, A>> for Emulated<i32, 16, A>
where A: Sealed,

Promote intermediate values to i32 and then perform accumulation.

Source§

fn dot_simd(self, left: Emulated<u8, 64, A>, right: Emulated<i8, 64, A>) -> Self

Element wise multiply each component of left and right, promoting the intermediate results to a higher precision. Read more
Source§

impl<T, const N: usize, A> SIMDMinMax for Emulated<T, N, A>
where T: ReferenceScalarOps,

MinMax

Source§

fn min_simd(self, rhs: Self) -> Self

Return the pairwise minimum of self and rhs, subject to looser NaN handling.
Source§

fn max_simd(self, rhs: Self) -> Self

Return the pairwise maximum of self and rhs, subject to looser NaN handling.
Source§

fn min_simd_standard(self, rhs: Self) -> Self

Return the pairwise minimum of self and rhs as if by applying the standard library’s min method for the scalar type.
Source§

fn max_simd_standard(self, rhs: Self) -> Self

Return the pairwise maximum of self and rhs as if by applying the standard library’s max method for the scalar type.
Source§

impl<T, const N: usize, A> SIMDMulAdd for Emulated<T, N, A>
where T: ReferenceScalarOps,

MulAdd

Source§

fn mul_add_simd(self, rhs: Self, accumulator: Self) -> Self

Source§

impl<T, const N: usize, A> SIMDPartialEq for Emulated<T, N, A>
where T: PartialEq, Self: SIMDVector,

SIMDPartialEq

Source§

fn eq_simd(self, other: Self) -> Self::Mask

SIMD equivalent of std::cmp::PartialEq::eq, applying the latter trait to each lane-wise pair of elements in self and other.
Source§

fn ne_simd(self, other: Self) -> Self::Mask

SIMD equivalent of std::cmp::PartialEq::neq, applying the latter trait to each lane-wise pair of elements in self and other.
Source§

impl<T, const N: usize, A> SIMDPartialOrd for Emulated<T, N, A>
where T: PartialOrd, Self: SIMDVector,

SIMDPartialOrd

Source§

fn lt_simd(self, other: Self) -> Self::Mask

SIMD equivalent of std::cmp::PartialOrd::lt.
Source§

fn le_simd(self, other: Self) -> Self::Mask

SIMD equivalent of std::cmp::PartialOrd::le.
Source§

fn gt_simd(self, other: Self) -> Self::Mask

SIMD equivalent of std::cmp::PartialOrd::gt. Read more
Source§

fn ge_simd(self, other: Self) -> Self::Mask

SIMD equivalent of std::cmp::PartialOrd::ge. Read more
Source§

impl<A> SIMDReinterpret<Emulated<i16, 16, A>> for Emulated<u32, 8, A>
where A: Sealed,

Available on little-endian only.
Source§

impl<A> SIMDReinterpret<Emulated<i16, 8, A>> for Emulated<u8, 16, A>
where A: Sealed,

Available on little-endian only.
Source§

impl<A> SIMDReinterpret<Emulated<i8, 64, A>> for Emulated<u32, 16, A>
where A: Sealed,

Available on little-endian only.
Source§

impl<A> SIMDReinterpret<Emulated<u32, 16, A>> for Emulated<i8, 64, A>
where A: Sealed,

Available on little-endian only.
Source§

impl<A> SIMDReinterpret<Emulated<u32, 16, A>> for Emulated<u8, 64, A>
where A: Sealed,

Available on little-endian only.
Source§

impl<A> SIMDReinterpret<Emulated<u8, 16, A>> for Emulated<i16, 8, A>
where A: Sealed,

Available on little-endian only.
Source§

impl<A> SIMDReinterpret<Emulated<u8, 64, A>> for Emulated<u32, 16, A>
where A: Sealed,

Available on little-endian only.
Source§

impl<T, const N: usize, A> SIMDSelect<Emulated<T, N, A>> for BitMask<N, A>
where T: Copy, A: Sealed, Const<N>: SupportedLaneCount, BitMask<N, A>: SIMDMask<Arch = A>, Emulated<T, N, A>: SIMDVector<Mask = BitMask<N, A>>,

Source§

fn select(self, x: Emulated<T, N, A>, y: Emulated<T, N, A>) -> Emulated<T, N, A>

Source§

impl<A> SIMDSumTree for Emulated<f32, 1, A>
where A: Sealed,

Source§

fn sum_tree(self) -> f32

Source§

impl<A> SIMDSumTree for Emulated<f32, 16, A>
where A: Sealed,

Source§

fn sum_tree(self) -> f32

Source§

impl<A> SIMDSumTree for Emulated<f32, 2, A>
where A: Sealed,

Source§

fn sum_tree(self) -> f32

Source§

impl<A> SIMDSumTree for Emulated<f32, 4, A>
where A: Sealed,

Source§

fn sum_tree(self) -> f32

Source§

impl<A> SIMDSumTree for Emulated<f32, 8, A>
where A: Sealed,

Source§

fn sum_tree(self) -> f32

Source§

impl<A> SIMDSumTree for Emulated<i32, 16, A>
where A: Sealed,

Source§

fn sum_tree(self) -> i32

Source§

impl<A> SIMDSumTree for Emulated<i32, 4, A>
where A: Sealed,

Source§

fn sum_tree(self) -> i32

Source§

impl<A> SIMDSumTree for Emulated<i32, 8, A>
where A: Sealed,

Source§

fn sum_tree(self) -> i32

Source§

impl<A> SIMDSumTree for Emulated<u32, 16, A>
where A: Sealed,

Source§

fn sum_tree(self) -> u32

Source§

impl<A> SIMDSumTree for Emulated<u32, 4, A>
where A: Sealed,

Source§

fn sum_tree(self) -> u32

Source§

impl<A> SIMDSumTree for Emulated<u32, 8, A>
where A: Sealed,

Source§

fn sum_tree(self) -> u32

Source§

impl<T, const N: usize, A> SIMDVector for Emulated<T, N, A>
where T: Copy + Debug + Default, Const<N>: ArrayType<T, Type = [T; N]>, BitMask<N, A>: SIMDMask<Arch = A>, A: Sealed,

Source§

const EMULATED: bool = true

The underlying behavior is emulated using loops and is not accelerated by back-end intrinsics.

Source§

fn arch(self) -> A

Return the Scalar architecture.

Source§

fn to_underlying(self) -> Self::Underlying

Return the underlying array.

Source§

fn from_underlying(arch: A, repr: [T; N]) -> Self

Construct from the underlying array.

Source§

fn to_array(self) -> [T; N]

Return the underlying array.

Source§

fn from_array(arch: A, x: [T; N]) -> Self

Construct from the underlying array.

Source§

fn splat(arch: A, value: Self::Scalar) -> Self

Broadcast the provided scalar across all lanes.

Source§

unsafe fn load_simd(arch: A, ptr: *const T) -> Self

Load all the things.

Source§

unsafe fn load_simd_masked_logical( arch: A, ptr: *const T, mask: Self::Mask, ) -> Self

Only load values when the corresponding mask lane is set.

Source§

unsafe fn load_simd_first(arch: A, ptr: *const T, first: usize) -> Self

Only load the first first items. Set the rest to zero.

Source§

unsafe fn store_simd(self, ptr: *mut T)

Store all the things.

Source§

unsafe fn store_simd_masked_logical(self, ptr: *mut T, mask: Self::Mask)

Only store values when the corresponding mask lane is set.

Source§

unsafe fn store_simd_first(self, ptr: *mut T, first: usize)

Only store the first first items. Set the rest to zero.

Source§

const LANES: usize = N

The number of lanes in the vector.
Source§

type Arch = A

The architecture this vector belongs to.
Source§

type Scalar = T

The type of each element in the vector.
Source§

type Underlying = [T; N]

The underlying representation.
Source§

type ConstLanes = Const<N>

The value of LANES but in the type domain so we can use it to constrain other aspects of this trait. Read more
Source§

type Mask = BitMask<N, A>

The expanded logical mask representation. This may-or-may-not actually be a bitmask, but should be easily convertible to and from a bitmask.
Source§

fn default(arch: A) -> Self

Return the default value for the type. This is always the numeric 0 for the associated scalar type.
Source§

fn num_lanes() -> usize

Return the number of lanes in this vector.
Source§

unsafe fn load_simd_masked( arch: Self::Arch, ptr: *const <Self as SIMDVector>::Scalar, mask: <<Self as SIMDVector>::ConstLanes as BitMaskType<Self::Arch>>::Type, ) -> Self

The same as load_simd_masked_logical but taking a BitMask instead. Read more
Source§

unsafe fn store_simd_masked( self, ptr: *mut <Self as SIMDVector>::Scalar, mask: <<Self as SIMDVector>::ConstLanes as BitMaskType<Self::Arch>>::Type, )

The same as store_simd_masked_logical but taking a BitMask instead. Read more
Source§

fn cast<T>(self) -> <Self as SIMDCast<T>>::Cast
where Self: SIMDCast<T>,

Perform a numeric cast on each element, returning a new SIMD vector. Read more
Source§

impl<T, const N: usize, A> Shl<T> for Emulated<T, N, A>
where T: ReferenceShifts,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: T) -> Self::Output

Performs the << operation. Read more
Source§

impl<T, const N: usize, A> Shl for Emulated<T, N, A>
where T: ReferenceShifts,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Self) -> Self::Output

Performs the << operation. Read more
Source§

impl<T, const N: usize, A> Shr<T> for Emulated<T, N, A>
where T: ReferenceShifts,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: T) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T, const N: usize, A> Shr for Emulated<T, N, A>
where T: ReferenceShifts,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Self) -> Self::Output

Performs the >> operation. Read more
Source§

impl<A> SplitJoin for Emulated<f16, 16, A>
where A: Copy,

Source§

type Halved = Emulated<f16, 8, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<f32, 16, A>
where A: Copy,

Source§

type Halved = Emulated<f32, 8, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<f32, 8, A>
where A: Copy,

Source§

type Halved = Emulated<f32, 4, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<i16, 16, A>
where A: Copy,

Source§

type Halved = Emulated<i16, 8, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<i16, 32, A>
where A: Copy,

Source§

type Halved = Emulated<i16, 16, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<i32, 16, A>
where A: Copy,

Source§

type Halved = Emulated<i32, 8, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<i32, 8, A>
where A: Copy,

Source§

type Halved = Emulated<i32, 4, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<i8, 32, A>
where A: Copy,

Source§

type Halved = Emulated<i8, 16, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<i8, 64, A>
where A: Copy,

Source§

type Halved = Emulated<i8, 32, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<u32, 16, A>
where A: Copy,

Source§

type Halved = Emulated<u32, 8, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<u32, 8, A>
where A: Copy,

Source§

type Halved = Emulated<u32, 4, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<u64, 4, A>
where A: Copy,

Source§

type Halved = Emulated<u64, 2, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<u8, 32, A>
where A: Copy,

Source§

type Halved = Emulated<u8, 16, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<A> SplitJoin for Emulated<u8, 64, A>
where A: Copy,

Source§

type Halved = Emulated<u8, 32, A>

The type of the halved element.
Source§

fn split(self) -> LoHi<Self::Halved>

Split self into two equal halves.
Source§

fn join(lohi: LoHi<Self::Halved>) -> Self

Create self by joining the two halves.
Source§

impl<T, const N: usize, A> Sub for Emulated<T, N, A>
where T: ReferenceScalarOps,

Source§

type Output = Emulated<T, N, A>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<A> ZipUnzip for Emulated<f16, 16, A>
where A: Copy,

Source§

fn zip(halves: LoHi<Self::Halved>) -> Self

Interleave elements from halves.lo and halves.hi into Self.
Source§

fn unzip(self) -> LoHi<Self::Halved>

Separate even-indexed elements into lo and odd-indexed into hi.
Source§

fn zip_flat(self) -> Self

Interleave in-place: the low half of self supplies the even-indexed positions and the high half supplies the odd-indexed positions. Read more
Source§

fn unzip_flat(self) -> Self

Deinterleave in-place: even-indexed elements are collected into the low half of the result and odd-indexed elements into the high half. Read more
Source§

impl<A> ZipUnzip for Emulated<i16, 16, A>
where A: Copy,

Source§

fn zip(halves: LoHi<Self::Halved>) -> Self

Interleave elements from halves.lo and halves.hi into Self.
Source§

fn unzip(self) -> LoHi<Self::Halved>

Separate even-indexed elements into lo and odd-indexed into hi.
Source§

fn zip_flat(self) -> Self

Interleave in-place: the low half of self supplies the even-indexed positions and the high half supplies the odd-indexed positions. Read more
Source§

fn unzip_flat(self) -> Self

Deinterleave in-place: even-indexed elements are collected into the low half of the result and odd-indexed elements into the high half. Read more
Source§

impl<A> ZipUnzip for Emulated<i32, 8, A>
where A: Copy,

Source§

fn zip(halves: LoHi<Self::Halved>) -> Self

Interleave elements from halves.lo and halves.hi into Self.
Source§

fn unzip(self) -> LoHi<Self::Halved>

Separate even-indexed elements into lo and odd-indexed into hi.
Source§

fn zip_flat(self) -> Self

Interleave in-place: the low half of self supplies the even-indexed positions and the high half supplies the odd-indexed positions. Read more
Source§

fn unzip_flat(self) -> Self

Deinterleave in-place: even-indexed elements are collected into the low half of the result and odd-indexed elements into the high half. Read more
Source§

impl<A> ZipUnzip for Emulated<i8, 32, A>
where A: Copy,

Source§

fn zip(halves: LoHi<Self::Halved>) -> Self

Interleave elements from halves.lo and halves.hi into Self.
Source§

fn unzip(self) -> LoHi<Self::Halved>

Separate even-indexed elements into lo and odd-indexed into hi.
Source§

fn zip_flat(self) -> Self

Interleave in-place: the low half of self supplies the even-indexed positions and the high half supplies the odd-indexed positions. Read more
Source§

fn unzip_flat(self) -> Self

Deinterleave in-place: even-indexed elements are collected into the low half of the result and odd-indexed elements into the high half. Read more
Source§

impl<A> ZipUnzip for Emulated<u32, 8, A>
where A: Copy,

Source§

fn zip(halves: LoHi<Self::Halved>) -> Self

Interleave elements from halves.lo and halves.hi into Self.
Source§

fn unzip(self) -> LoHi<Self::Halved>

Separate even-indexed elements into lo and odd-indexed into hi.
Source§

fn zip_flat(self) -> Self

Interleave in-place: the low half of self supplies the even-indexed positions and the high half supplies the odd-indexed positions. Read more
Source§

fn unzip_flat(self) -> Self

Deinterleave in-place: even-indexed elements are collected into the low half of the result and odd-indexed elements into the high half. Read more
Source§

impl<A> ZipUnzip for Emulated<u8, 32, A>
where A: Copy,

Source§

fn zip(halves: LoHi<Self::Halved>) -> Self

Interleave elements from halves.lo and halves.hi into Self.
Source§

fn unzip(self) -> LoHi<Self::Halved>

Separate even-indexed elements into lo and odd-indexed into hi.
Source§

fn zip_flat(self) -> Self

Interleave in-place: the low half of self supplies the even-indexed positions and the high half supplies the odd-indexed positions. Read more
Source§

fn unzip_flat(self) -> Self

Deinterleave in-place: even-indexed elements are collected into the low half of the result and odd-indexed elements into the high half. Read more
Source§

impl<T: Copy, const N: usize, A: Copy> Copy for Emulated<T, N, A>

Auto Trait Implementations§

§

impl<T, const N: usize, A> Freeze for Emulated<T, N, A>
where A: Freeze, T: Freeze,

§

impl<T, const N: usize, A> RefUnwindSafe for Emulated<T, N, A>

§

impl<T, const N: usize, A> Send for Emulated<T, N, A>
where A: Send, T: Send,

§

impl<T, const N: usize, A> Sync for Emulated<T, N, A>
where A: Sync, T: Sync,

§

impl<T, const N: usize, A> Unpin for Emulated<T, N, A>
where A: Unpin, T: Unpin,

§

impl<T, const N: usize, A> UnsafeUnpin for Emulated<T, N, A>
where A: UnsafeUnpin, T: UnsafeUnpin,

§

impl<T, const N: usize, A> UnwindSafe for Emulated<T, N, A>
where A: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> SIMDFloat for T
where T: Mul<Output = T> + SIMDVector + Sub<Output = T> + Add<Output = T> + SIMDMulAdd + SIMDMinMax + SIMDPartialEq + SIMDPartialOrd,

Source§

impl<T> SIMDSigned for T
where T: SIMDUnsigned + SIMDAbs,

Source§

impl<T> SIMDUnsigned for T
where T: BitOr<Output = T> + Mul<Output = T> + BitXor<Output = T> + SIMDVector + Shr<Output = T, Output = T> + Sub<Output = T> + Shl<Output = T, Output = T> + Add<Output = T> + Shr<<T as SIMDVector>::Scalar> + BitAnd<Output = T> + Shl<<T as SIMDVector>::Scalar> + SIMDMulAdd + SIMDPartialEq + SIMDPartialOrd,