pub trait SimdBase<Element: SimdElement, S: Simd>:
Copy
+ Sync
+ Send
+ 'static
+ Bytes {
type Mask: SimdMask<Element::Mask, S>;
type Block: SimdBase<Element, S>;
const N: usize;
// Required methods
fn as_slice(&self) -> &[Element];
fn as_mut_slice(&mut self) -> &mut [Element];
fn from_slice(simd: S, slice: &[Element]) -> Self;
fn splat(simd: S, val: Element) -> Self;
fn block_splat(block: Self::Block) -> Self;
}
Required Associated Constants§
Required Associated Types§
Sourcetype Mask: SimdMask<Element::Mask, S>
type Mask: SimdMask<Element::Mask, S>
A SIMD vector mask with the same number of elements.
The mask element is represented as an integer which is
all-0 for false
and all-1 for true
. When we get deep
into AVX-512, we need to think about predication masks.
One possibility to consider is that the SIMD trait grows
maskAxB
associated types.
Required Methods§
fn as_slice(&self) -> &[Element]
fn as_mut_slice(&mut self) -> &mut [Element]
Sourcefn from_slice(simd: S, slice: &[Element]) -> Self
fn from_slice(simd: S, slice: &[Element]) -> Self
Create a SIMD vector from a slice.
The slice must be the proper width.
fn splat(simd: S, val: Element) -> Self
fn block_splat(block: Self::Block) -> Self
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.