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
impl SimdIntrinsic
Sourcepub fn x86_name(&self, ty: ScalarType, width: u8) -> &'static str
pub fn x86_name(&self, ty: ScalarType, width: u8) -> &'static str
Returns the x86 intrinsic name for this operation.
Sourcepub fn arm_name(&self, ty: ScalarType, width: u8) -> &'static str
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
impl Clone for SimdIntrinsic
Source§fn clone(&self) -> SimdIntrinsic
fn clone(&self) -> SimdIntrinsic
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SimdIntrinsic
impl Debug for SimdIntrinsic
Source§impl PartialEq for SimdIntrinsic
impl PartialEq for SimdIntrinsic
Source§fn eq(&self, other: &SimdIntrinsic) -> bool
fn eq(&self, other: &SimdIntrinsic) -> bool
self and other values to be equal, and is used by ==.