pub unsafe trait NativeSimd:
Sized
+ Default
+ Copy {
type Native: NativeType;
type Chunk: BitChunk;
type Mask: FromMaskChunk<Self::Chunk>;
const LANES: usize;
// Required methods
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 Constants§
Required Associated Types§
Sourcetype Native: NativeType
type Native: NativeType
The NativeType of this struct. E.g. f32 for a NativeSimd = f32x16.
Sourcetype Mask: FromMaskChunk<Self::Chunk>
type Mask: FromMaskChunk<Self::Chunk>
Type used for masking.
Required Methods§
Sourcefn from_chunk(v: &[Self::Native]) -> Self
fn from_chunk(v: &[Self::Native]) -> Self
Sourcefn from_incomplete_chunk(v: &[Self::Native], remaining: Self::Native) -> Self
fn from_incomplete_chunk(v: &[Self::Native], remaining: Self::Native) -> Self
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl NativeSimd for days_msx8
impl NativeSimd for days_msx8
Source§impl NativeSimd for f16x32
impl NativeSimd for f16x32
Source§impl NativeSimd for f32x16
Available on non-crate feature simd only.
impl NativeSimd for f32x16
Available on non-crate feature
simd only.Source§impl NativeSimd for f64x8
Available on non-crate feature simd only.
impl NativeSimd for f64x8
Available on non-crate feature
simd only.Source§impl NativeSimd for i8x64
Available on non-crate feature simd only.
impl NativeSimd for i8x64
Available on non-crate feature
simd only.Source§impl NativeSimd for i16x32
Available on non-crate feature simd only.
impl NativeSimd for i16x32
Available on non-crate feature
simd only.Source§impl NativeSimd for i32x16
Available on non-crate feature simd only.
impl NativeSimd for i32x16
Available on non-crate feature
simd only.Source§impl NativeSimd for i64x8
Available on non-crate feature simd only.
impl NativeSimd for i64x8
Available on non-crate feature
simd only.Source§impl NativeSimd for i128x8
impl NativeSimd for i128x8
Source§impl NativeSimd for i256x8
impl NativeSimd for i256x8
Source§impl NativeSimd for months_days_nsx8
impl NativeSimd for months_days_nsx8
Source§impl NativeSimd for u8x64
Available on non-crate feature simd only.
impl NativeSimd for u8x64
Available on non-crate feature
simd only.Source§impl NativeSimd for u16x32
Available on non-crate feature simd only.
impl NativeSimd for u16x32
Available on non-crate feature
simd only.Source§impl NativeSimd for u32x16
Available on non-crate feature simd only.
impl NativeSimd for u32x16
Available on non-crate feature
simd only.