π¬This is a nightly-only experimental API. (
portable_simd #86656)Re-exportsΒ§
use crate::simd::Select;πExperimental use crate::simd::Simd;πExperimental use crate::simd::SimdElement;πExperimental use crate::simd::cmp::SimdPartialEq;πExperimental use core::ops::Add;πuse core::ops::Mul;πuse core::ops::BitAnd;πuse core::ops::BitOr;πuse core::ops::BitXor;πuse core::ops::Div;πuse core::ops::Rem;πuse core::ops::Sub;πuse core::ops::Shl;πuse core::ops::Shr;π
ModulesΒ§
- assign π
Experimental - Assignment operators
- deref π
Experimental - This module hacks in βimplicit derefβ for Simdβs operators. Ideally, Rust would take care of this itself, and method calls usually handle the LHS implicitly. But this is not the case with arithmetic ops.
- shift_
scalar πExperimental - unary π
Experimental
MacrosΒ§
- for_
base_ πops Experimental - for_
base_ πtypes Experimental - int_
divrem_ πguard Experimental - SAFETY: This macro must only be used to impl Div or Rem and given the matching intrinsic. It guards against LLVMβs UB conditions for integer div or rem using masks and selects, thus guaranteeing a Rust value returns instead.
- unsafe_
base πExperimental - wrap_
bitshift πExperimental - SAFETY: This macro should not be used for anything except Shl or Shr, and passed the appropriate shift intrinsic.
It handles performing a bitand in addition to calling the shift operator, so that the result
is well-defined: LLVM can return a poison value if you shl, lshr, or ashr if
rhs >= <Int>::BITSAt worst, this will maybe add another instruction and cycle, at best, it may open up more optimization opportunities, or simply be elided entirely, especially for SIMD ISAs which default to this.