pub unsafe trait NativeSimd: Sized + Default + Copy {
    type Native: NativeType;
    type Chunk: BitChunk;
    type Mask: FromMaskChunk<Self::Chunk>;

    const LANES: usize;

    fn select(self, mask: Self::Mask, default: Self) -> Self;
    fn from_chunk(v: &[Self::Native]) -> Self;
    fn from_incomplete_chunk(v: &[Self::Native], remaining: Self::Native) -> Self;
    fn align(
        values: &[Self::Native]
    ) -> (&[Self::Native], &[Self], &[Self::Native]); }
Expand description

A struct that lends itself well to be compiled leveraging SIMD

Safety

The NativeType and the NativeSimd must have possible a matching alignment. e.g. slicing &[NativeType] by align_of<NativeSimd>() must be properly aligned/safe.

Required Associated Types

The NativeType of this struct. E.g. f32 for a NativeSimd = f32x16.

The type holding bits for masks.

Type used for masking.

Required Associated Constants

Number of lanes

Required Methods

Sets values to default based on mask.

Convert itself from a slice.

Panics
  • iff v.len() != T::LANES

creates a new Self from v by populating items from v up to its length. Items from v at positions larger than the number of lanes are ignored; remaining items are populated with remaining.

Returns a tuple of 3 items whose middle item is itself, and the remaining are the head and tail of the un-aligned parts.

Implementors