Skip to main content

SimdIntrinsic

Enum SimdIntrinsic 

Source
pub enum SimdIntrinsic {
Show 22 variants Add, Sub, Mul, Div, Fmadd, Fmsub, Fnmadd, Hadd, HorizontalSum, Min, Max, CmpEq, CmpLt, CmpLe, Broadcast, Extract, Insert, Shuffle, LoadAligned, LoadUnaligned, StoreAligned, StoreUnaligned,
}
Expand description

SIMD intrinsic operations.

These map directly to hardware SIMD instructions on supported targets.

Variants§

§

Add

Vector add: result[i] = a[i] + b[i]

§

Sub

Vector subtract: result[i] = a[i] - b[i]

§

Mul

Vector multiply: result[i] = a[i] * b[i]

§

Div

Vector divide: result[i] = a[i] / b[i]

§

Fmadd

Fused multiply-add: result[i] = a[i] * b[i] + c[i]

§

Fmsub

Fused multiply-subtract: result[i] = a[i] * b[i] - c[i]

§

Fnmadd

Fused negative multiply-add: result[i] = -(a[i] * b[i]) + c[i]

§

Hadd

Horizontal add (pairwise): hadd([a,b,c,d], [e,f,g,h]) = [a+b, c+d, e+f, g+h]

§

HorizontalSum

Horizontal sum (reduce all elements): sum([a,b,c,d]) = a+b+c+d

§

Min

Vector minimum: result[i] = min(a[i], b[i])

§

Max

Vector maximum: result[i] = max(a[i], b[i])

§

CmpEq

Vector compare equal: result[i] = a[i] == b[i] ? ~0 : 0

§

CmpLt

Vector compare less than: result[i] = a[i] < b[i] ? ~0 : 0

§

CmpLe

Vector compare less or equal: result[i] = a[i] <= b[i] ? ~0 : 0

§

Broadcast

Broadcast scalar to all lanes

§

Extract

Extract element from vector

§

Insert

Insert element into vector

§

Shuffle

Shuffle/permute elements

§

LoadAligned

Aligned load

§

LoadUnaligned

Unaligned load

§

StoreAligned

Aligned store

§

StoreUnaligned

Unaligned store

Implementations§

Source§

impl SimdIntrinsic

Source

pub fn x86_name(&self, ty: ScalarType, width: u8) -> &'static str

Returns the x86 intrinsic name for this operation.

Source

pub fn arm_name(&self, ty: ScalarType, width: u8) -> &'static str

Returns the ARM NEON intrinsic name for this operation.

Trait Implementations§

Source§

impl Clone for SimdIntrinsic

Source§

fn clone(&self) -> SimdIntrinsic

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SimdIntrinsic

Source§

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

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

impl PartialEq for SimdIntrinsic

Source§

fn eq(&self, other: &SimdIntrinsic) -> 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 Copy for SimdIntrinsic

Source§

impl Eq for SimdIntrinsic

Source§

impl StructuralPartialEq for SimdIntrinsic

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.