Skip to main content

Simd

Struct Simd 

Source
#[repr(simd)]
pub(crate) struct Simd<T: SimdElement, const N: usize>([T; N]);

Tuple Fields§

§0: [T; N]

Implementations§

Source§

impl<T: SimdElement, const N: usize> Simd<T, N>

Source

pub(crate) const ZERO: Self

A value of this type where all elements are zeroed out.

Source

pub(crate) const fn from_array(elements: [T; N]) -> Self

Source

pub(crate) const fn splat(value: T) -> Self

Source

pub(crate) const fn extract_dyn(&self, index: usize) -> T

Extract the element at position index. Note that index is not a constant so this operation is not efficient on most platforms. Use for testing only.

Source

pub(crate) const fn as_array(&self) -> &[T; N]

Source§

impl<T: SimdElement> Simd<T, 1>

Source

pub(crate) const fn new(x0: T) -> Self

Source§

impl<T: SimdElement> Simd<T, 2>

Source

pub(crate) const fn new(x0: T, x1: T) -> Self

Source§

impl<T: SimdElement> Simd<T, 4>

Source

pub(crate) const fn new(x0: T, x1: T, x2: T, x3: T) -> Self

Source§

impl<T: SimdElement> Simd<T, 8>

Source

pub(crate) const fn new( x0: T, x1: T, x2: T, x3: T, x4: T, x5: T, x6: T, x7: T, ) -> Self

Source§

impl<T: SimdElement> Simd<T, 16>

Source

pub(crate) const fn new( x0: T, x1: T, x2: T, x3: T, x4: T, x5: T, x6: T, x7: T, x8: T, x9: T, x10: T, x11: T, x12: T, x13: T, x14: T, x15: T, ) -> Self

Source§

impl<T: SimdElement> Simd<T, 32>

Source

pub(crate) const fn new( x0: T, x1: T, x2: T, x3: T, x4: T, x5: T, x6: T, x7: T, x8: T, x9: T, x10: T, x11: T, x12: T, x13: T, x14: T, x15: T, x16: T, x17: T, x18: T, x19: T, x20: T, x21: T, x22: T, x23: T, x24: T, x25: T, x26: T, x27: T, x28: T, x29: T, x30: T, x31: T, ) -> Self

Source§

impl<const N: usize> Simd<f16, N>

Source

pub(crate) const fn to_bits(self) -> Simd<u16, N>

Source

pub(crate) const fn from_bits(bits: Simd<u16, N>) -> Self

Source§

impl<const N: usize> Simd<f32, N>

Source

pub(crate) const fn to_bits(self) -> Simd<u32, N>

Source

pub(crate) const fn from_bits(bits: Simd<u32, N>) -> Self

Source§

impl<const N: usize> Simd<f64, N>

Source

pub(crate) const fn to_bits(self) -> Simd<u64, N>

Source

pub(crate) const fn from_bits(bits: Simd<u64, N>) -> Self

Source§

impl Simd<u8, 16>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<u16, 8>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<u32, 4>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<u64, 2>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<i8, 16>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<i16, 8>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<i32, 4>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<i64, 2>

Source

pub(crate) const fn as_m128i(self) -> __m128i

Available on x86 or x86-64 only.
Source§

impl Simd<u8, 32>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<u16, 16>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<u32, 8>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<u64, 4>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<i8, 32>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<i16, 16>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<i32, 8>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<i64, 4>

Source

pub(crate) const fn as_m256i(self) -> __m256i

Available on x86 or x86-64 only.
Source§

impl Simd<u8, 64>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<u16, 32>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<u32, 16>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<u64, 8>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<i8, 64>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<i16, 32>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<i32, 16>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<i64, 8>

Source

pub(crate) const fn as_m512i(self) -> __m512i

Available on x86 or x86-64 only.
Source§

impl Simd<f32, 4>

Source

pub(crate) const fn as_m128(self) -> __m128

Available on x86 or x86-64 only.
Source§

impl Simd<f64, 2>

Source

pub(crate) const fn as_m128d(self) -> __m128d

Available on x86 or x86-64 only.
Source§

impl Simd<f32, 8>

Source

pub(crate) const fn as_m256(self) -> __m256

Available on x86 or x86-64 only.
Source§

impl Simd<f64, 4>

Source

pub(crate) const fn as_m256d(self) -> __m256d

Available on x86 or x86-64 only.
Source§

impl Simd<f32, 16>

Source

pub(crate) const fn as_m512(self) -> __m512

Available on x86 or x86-64 only.
Source§

impl Simd<f64, 8>

Source

pub(crate) const fn as_m512d(self) -> __m512d

Available on x86 or x86-64 only.
Source§

impl Simd<u16, 8>

Source

pub(crate) const fn as_m128bh(self) -> __m128bh

Available on x86 or x86-64 only.
Source§

impl Simd<u32, 4>

Source

pub(crate) const fn as_m128bh(self) -> __m128bh

Available on x86 or x86-64 only.
Source§

impl Simd<i16, 8>

Source

pub(crate) const fn as_m128bh(self) -> __m128bh

Available on x86 or x86-64 only.
Source§

impl Simd<i32, 4>

Source

pub(crate) const fn as_m128bh(self) -> __m128bh

Available on x86 or x86-64 only.
Source§

impl Simd<u16, 16>

Source

pub(crate) const fn as_m256bh(self) -> __m256bh

Available on x86 or x86-64 only.
Source§

impl Simd<u32, 8>

Source

pub(crate) const fn as_m256bh(self) -> __m256bh

Available on x86 or x86-64 only.
Source§

impl Simd<i16, 16>

Source

pub(crate) const fn as_m256bh(self) -> __m256bh

Available on x86 or x86-64 only.
Source§

impl Simd<i32, 8>

Source

pub(crate) const fn as_m256bh(self) -> __m256bh

Available on x86 or x86-64 only.
Source§

impl Simd<u16, 32>

Source

pub(crate) const fn as_m512bh(self) -> __m512bh

Available on x86 or x86-64 only.
Source§

impl Simd<u32, 16>

Source

pub(crate) const fn as_m512bh(self) -> __m512bh

Available on x86 or x86-64 only.
Source§

impl Simd<i16, 32>

Source

pub(crate) const fn as_m512bh(self) -> __m512bh

Available on x86 or x86-64 only.
Source§

impl Simd<i32, 16>

Source

pub(crate) const fn as_m512bh(self) -> __m512bh

Available on x86 or x86-64 only.
Source§

impl Simd<f16, 8>

Source

pub(crate) const fn as_m128h(self) -> __m128h

Available on x86 or x86-64 only.
Source§

impl Simd<f16, 16>

Source

pub(crate) const fn as_m256h(self) -> __m256h

Available on x86 or x86-64 only.
Source§

impl Simd<f16, 32>

Source

pub(crate) const fn as_m512h(self) -> __m512h

Available on x86 or x86-64 only.

Trait Implementations§

Source§

impl<T: SimdElement, const N: usize> Clone for Simd<T, N>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: SimdElement, const N: usize> Debug for Simd<T, N>

Source§

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

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

impl From<Simd<f16, 16>> for __m256h

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f16, 16>) -> Self

Converts to this type from the input type.
1.94.0 · Source§

impl From<Simd<f16, 32>> for __m512h

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f16, 32>) -> Self

Converts to this type from the input type.
1.94.0 · Source§

impl From<Simd<f16, 8>> for __m128h

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f16, 8>) -> Self

Converts to this type from the input type.
1.72.0 · Source§

impl From<Simd<f32, 16>> for __m512

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f32, 16>) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<Simd<f32, 4>> for __m128

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f32, 4>) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<Simd<f32, 8>> for __m256

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f32, 8>) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<Simd<f64, 2>> for __m128d

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f64, 2>) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<Simd<f64, 4>> for __m256d

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f64, 4>) -> Self

Converts to this type from the input type.
1.72.0 · Source§

impl From<Simd<f64, 8>> for __m512d

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<f64, 8>) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<Simd<i64, 2>> for __m128i

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<i64, 2>) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<Simd<i64, 4>> for __m256i

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<i64, 4>) -> Self

Converts to this type from the input type.
1.72.0 · Source§

impl From<Simd<i64, 8>> for __m512i

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<i64, 8>) -> Self

Converts to this type from the input type.
1.89.0 · Source§

impl From<Simd<u16, 16>> for __m256bh

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<u16, 16>) -> Self

Converts to this type from the input type.
1.89.0 · Source§

impl From<Simd<u16, 32>> for __m512bh

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<u16, 32>) -> Self

Converts to this type from the input type.
1.89.0 · Source§

impl From<Simd<u16, 8>> for __m128bh

Available on x86 or x86-64 only.
Source§

fn from(simd: Simd<u16, 8>) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<__m128> for Simd<f32, 4>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m128) -> Self

Converts to this type from the input type.
1.89.0 · Source§

impl From<__m128bh> for Simd<u16, 8>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m128bh) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<__m128d> for Simd<f64, 2>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m128d) -> Self

Converts to this type from the input type.
1.94.0 · Source§

impl From<__m128h> for Simd<f16, 8>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m128h) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<__m128i> for Simd<i64, 2>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m128i) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<__m256> for Simd<f32, 8>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m256) -> Self

Converts to this type from the input type.
1.89.0 · Source§

impl From<__m256bh> for Simd<u16, 16>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m256bh) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<__m256d> for Simd<f64, 4>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m256d) -> Self

Converts to this type from the input type.
1.94.0 · Source§

impl From<__m256h> for Simd<f16, 16>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m256h) -> Self

Converts to this type from the input type.
1.27.0 · Source§

impl From<__m256i> for Simd<i64, 4>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m256i) -> Self

Converts to this type from the input type.
1.72.0 · Source§

impl From<__m512> for Simd<f32, 16>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m512) -> Self

Converts to this type from the input type.
1.89.0 · Source§

impl From<__m512bh> for Simd<u16, 32>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m512bh) -> Self

Converts to this type from the input type.
1.72.0 · Source§

impl From<__m512d> for Simd<f64, 8>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m512d) -> Self

Converts to this type from the input type.
1.94.0 · Source§

impl From<__m512h> for Simd<f16, 32>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m512h) -> Self

Converts to this type from the input type.
1.72.0 · Source§

impl From<__m512i> for Simd<i64, 8>

Available on x86 or x86-64 only.
Source§

fn from(simd: __m512i) -> Self

Converts to this type from the input type.
Source§

impl<T: SimdElement, const N: usize> PartialEq for Simd<T, N>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Copy + SimdElement, const N: usize> Copy for Simd<T, N>

Auto Trait Implementations§

§

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

§

impl<T, const N: usize> RefUnwindSafe for Simd<T, N>
where T: RefUnwindSafe,

§

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

§

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

§

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

§

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

§

impl<T, const N: usize> UnwindSafe for Simd<T, N>
where 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 #126799)
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> SizedTypeProperties for T

Source§

#[doc(hidden)]
const SIZE: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGN: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGNMENT: Alignment = _

🔬This is a nightly-only experimental API. (ptr_alignment_type #102070)
Source§

#[doc(hidden)]
const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
Source§

#[doc(hidden)]
const LAYOUT: Layout = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const MAX_SLICE_LEN: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
The largest safe length for a [Self]. 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> NonDrop for T
where T: Copy,

Source§

impl<T> Printable for T
where T: Copy + Debug,