Skip to main content

F4

Struct F4 

Source
#[repr(transparent)]
pub struct F4(pub u8);
Expand description

Finite-only 4-bit float: E3M0 with the top exponent reserved for NaN.

Tuple Fields§

§0: u8

Implementations§

Source§

impl F4

Source

pub fn to_f32(self) -> f32

Convert to f32 exactly.

Source

pub fn from_f32(val: f32) -> F4

Convert from f32 with round-to-nearest, ties-to-even.

Infinity and finite overflow saturate to the signed maximum finite value. NaN maps to the reserved top exponent.

Source

pub fn pack_pair(low: F4, high: F4) -> u8

Pack two F4 values into one byte.

Source

pub fn unpack_pair(packed: u8) -> (F4, F4)

Unpack one byte into two F4 values.

Trait Implementations§

Source§

impl Add for F4

Source§

type Output = F4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: F4) -> F4

Performs the + operation. Read more
Source§

impl AddAssign for F4

Source§

fn add_assign(&mut self, rhs: F4)

Performs the += operation. Read more
Source§

impl CastFrom<Bf4> for F4

Source§

fn cast_from(val: Bf4) -> F4

Cast from type T to Self.
Source§

impl CastFrom<Bf8> for F4

Source§

fn cast_from(val: Bf8) -> F4

Cast from type T to Self.
Source§

impl CastFrom<Bf16> for F4

Source§

fn cast_from(val: Bf16) -> F4

Cast from type T to Self.
Source§

impl CastFrom<F4> for f32

Source§

fn cast_from(val: F4) -> f32

Cast from type T to Self.
Source§

impl CastFrom<F4> for f64

Source§

fn cast_from(val: F4) -> f64

Cast from type T to Self.
Source§

impl CastFrom<F4> for i8

Source§

fn cast_from(val: F4) -> i8

Cast from type T to Self.
Source§

impl CastFrom<F4> for i16

Source§

fn cast_from(val: F4) -> i16

Cast from type T to Self.
Source§

impl CastFrom<F4> for i32

Source§

fn cast_from(val: F4) -> i32

Cast from type T to Self.
Source§

impl CastFrom<F4> for usize

Source§

fn cast_from(val: F4) -> usize

Cast from type T to Self.
Source§

impl CastFrom<F4> for I8

Source§

fn cast_from(val: F4) -> I8

Cast from type T to Self.
Source§

impl CastFrom<F4> for I16

Source§

fn cast_from(val: F4) -> I16

Cast from type T to Self.
Source§

impl CastFrom<F4> for I32

Source§

fn cast_from(val: F4) -> I32

Cast from type T to Self.
Source§

impl CastFrom<F4> for F16

Source§

fn cast_from(val: F4) -> F16

Cast from type T to Self.
Source§

impl CastFrom<F4> for F32

Source§

fn cast_from(val: F4) -> F32

Cast from type T to Self.
Source§

impl CastFrom<F4> for F64

Source§

fn cast_from(val: F4) -> F64

Cast from type T to Self.
Source§

impl CastFrom<F4> for Bf16

Source§

fn cast_from(val: F4) -> Bf16

Cast from type T to Self.
Source§

impl CastFrom<F4> for Bf8

Source§

fn cast_from(val: F4) -> Bf8

Cast from type T to Self.
Source§

impl CastFrom<F4> for Bf4

Source§

fn cast_from(val: F4) -> Bf4

Cast from type T to Self.
Source§

impl CastFrom<F4> for F8

Source§

fn cast_from(val: F4) -> F8

Cast from type T to Self.
Source§

impl CastFrom<F4> for F4

Source§

fn cast_from(val: F4) -> F4

Cast from type T to Self.
Source§

impl CastFrom<F8> for F4

Source§

fn cast_from(val: F8) -> F4

Cast from type T to Self.
Source§

impl CastFrom<F16> for F4

Source§

fn cast_from(val: F16) -> F4

Cast from type T to Self.
Source§

impl CastFrom<F32> for F4

Source§

fn cast_from(val: F32) -> F4

Cast from type T to Self.
Source§

impl CastFrom<F64> for F4

Source§

fn cast_from(val: F64) -> F4

Cast from type T to Self.
Source§

impl CastFrom<I8> for F4

Source§

fn cast_from(val: I8) -> F4

Cast from type T to Self.
Source§

impl CastFrom<I16> for F4

Source§

fn cast_from(val: I16) -> F4

Cast from type T to Self.
Source§

impl CastFrom<I32> for F4

Source§

fn cast_from(val: I32) -> F4

Cast from type T to Self.
Source§

impl CastFrom<f32> for F4

Source§

fn cast_from(val: f32) -> F4

Cast from type T to Self.
Source§

impl CastFrom<f64> for F4

Source§

fn cast_from(val: f64) -> F4

Cast from type T to Self.
Source§

impl CastFrom<i8> for F4

Source§

fn cast_from(val: i8) -> F4

Cast from type T to Self.
Source§

impl CastFrom<i16> for F4

Source§

fn cast_from(val: i16) -> F4

Cast from type T to Self.
Source§

impl CastFrom<i32> for F4

Source§

fn cast_from(val: i32) -> F4

Cast from type T to Self.
Source§

impl Clone for F4

Source§

fn clone(&self) -> F4

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 Copy for F4

Source§

impl Debug for F4

Source§

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

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

impl Default for F4

Source§

fn default() -> F4

Returns the “default value” for a type. Read more
Source§

impl Div for F4

Source§

type Output = F4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: F4) -> F4

Performs the / operation. Read more
Source§

impl FloatElement for F4

Source§

fn from_f32(val: f32) -> F4

Convert from f32.
Source§

fn from_f64(val: f64) -> F4

Convert from f64.
Source§

fn to_f32(self) -> f32

Cast to f32.
Source§

fn exp(self) -> Self

e^self.
Source§

fn ln(self) -> Self

Natural logarithm.
Source§

fn sin(self) -> Self

Sine (radians).
Source§

fn cos(self) -> Self

Cosine (radians).
Source§

fn acos(self) -> Self

Inverse cosine (radians).
Source§

fn tan(self) -> Self

Tangent (radians).
Source§

fn sinh(self) -> Self

Hyperbolic sine.
Source§

fn cosh(self) -> Self

Hyperbolic cosine.
Source§

fn tanh(self) -> Self

Hyperbolic tangent.
Source§

fn atan2(self, other: Self) -> Self

Four-quadrant arctangent of self / other.
Source§

fn powf(self, n: Self) -> Self

self raised to the power n.
Source§

fn recip(self) -> Self

Reciprocal 1 / self.
Source§

fn floor(self) -> Self

Largest integer ≤ self.
Source§

fn ceil(self) -> Self

Smallest integer ≥ self.
Source§

fn round(self) -> Self

Nearest integer, half away from zero.
Source§

fn trunc(self) -> Self

Integer part (toward zero).
Source§

fn signum(self) -> Self

Sign of self: 1 for positive/+0, -1 for negative/-0, NaN for NaN (matching f64::signum / num_traits::Float::signum).
Source§

fn powi(self, n: i32) -> Self

self raised to an integer power via exponentiation by squaring. Read more
Source§

fn log10(self) -> Self

Base-10 logarithm, log₁₀(self). Read more
Source§

fn log2(self) -> Self

Base-2 logarithm, log₂(self). Read more
Source§

fn erf(self) -> Self

Error function erf(self) = 2/√π ∫₀ˢᵉˡᶠ e^(-t²) dt. Read more
Source§

fn erfc(self) -> Self

Complementary error function erfc(self) = 1 - erf(self), computed without the cancellation error of 1 - erf for large self.
Source§

fn lgamma(self) -> Self

Natural logarithm of the absolute value of the gamma function, ln|Γ(self)|.
Source§

fn default_epsilon() -> Self
where Self: RealField,

Machine epsilon (nalgebra::RealField::default_epsilon compatibility alias). Read more
Source§

fn pi() -> Self
where Self: RealField,

Returns π as this float type (nalgebra compatibility alias for RealField::PI).
Source§

fn max(self, other: Self) -> Self

Componentwise maximum (method form; prefer NumericElement::max_scalar in new code).
Source§

fn min(self, other: Self) -> Self

Componentwise minimum (method form; prefer NumericElement::min_scalar in new code).
Source§

fn norm(self) -> Self

L2 (Euclidean) norm — for scalars this is the absolute value.
Source§

impl Mul for F4

Source§

type Output = F4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: F4) -> F4

Performs the * operation. Read more
Source§

impl MulAssign for F4

Source§

fn mul_assign(&mut self, rhs: F4)

Performs the *= operation. Read more
Source§

impl Neg for F4

Source§

type Output = F4

The resulting type after applying the - operator.
Source§

fn neg(self) -> F4

Performs the unary - operation. Read more
Source§

impl NumericElement for F4

Source§

const ZERO: F4

Additive identity.
Source§

const ONE: F4

Multiplicative identity.
Source§

const NAN: F4

IEEE 754 not-a-number sentinel.
Source§

const INFINITY: F4

IEEE 754 positive infinity.
Source§

const MIN_VALUE: F4

The minimum representable finite value (negative infinity or i32::MIN). Read more
Source§

const MAX_VALUE: F4

The maximum representable finite value (positive infinity or i32::MAX). Read more
Source§

const BYTE_WIDTH: usize = 1

Number of bytes per element.
Source§

const ALL_ONES: F4

Bitwise representation with all bits set to 1.
Source§

const SIGN_MASK: F4

IEEE 754 sign-bit mask: only the most-significant bit is set. Read more
Source§

fn abs(self) -> F4

Absolute value.
Source§

fn scalar_fmadd(self, b: F4, c: F4) -> F4

Scalar fused multiply-add: (self * b) + c.
Source§

fn sqrt(self) -> F4

Square root. Floats follow IEEE 754 (NaN for negative inputs); integers return the exact floor integer square root (isqrt), with negative signed inputs defined to return 0 (integers have no NaN to signal the domain error). No f64 round-trip, so the integer result is exact for all operands.
Source§

fn is_finite(self) -> bool

Returns true if finite.
Source§

fn is_nan(self) -> bool

Returns true if NaN.
Source§

fn to_f64(self) -> f64

Cast to f64.
Source§

fn bitand(self, rhs: F4) -> F4

Bitwise AND.
Source§

fn bitor(self, rhs: F4) -> F4

Bitwise OR.
Source§

fn bitxor(self, rhs: F4) -> F4

Bitwise XOR.
Source§

fn count_ones(self) -> u32

Count set bits (population count).
Source§

fn min_scalar(self, other: Self) -> Self
where Self: PartialOrd,

Elementwise minimum: returns self if self <= other, else other. Read more
Source§

fn max_scalar(self, other: Self) -> Self
where Self: PartialOrd,

Elementwise maximum: returns self if self >= other, else other. Read more
Source§

fn saturating_add(self, rhs: Self) -> Self

Saturating addition. Read more
Source§

fn saturating_mul(self, rhs: Self) -> Self

Saturating multiplication. Read more
Source§

fn checked_add(self, rhs: Self) -> Option<Self>

Checked addition: returns Some(self + rhs) or None on integer overflow. Read more
Source§

fn checked_mul(self, rhs: Self) -> Option<Self>

Checked multiplication: returns Some(self * rhs) or None on integer overflow. Read more
Source§

impl Packable4 for F4

Source§

type Unpacked = F32

The unpacked representation type.
Source§

fn pack_pair(low: F4, high: F4) -> u8

Pack a low and high element into a single byte.
Source§

fn unpack_pair(packed: u8) -> (F4, F4)

Unpack a single byte into a low and high element.
Source§

fn unpack_slice_packed(packed: &[u8], unpacked: &mut [F32])

Unpack a slice of packed pairs to a slice of unpacked elements.
Source§

fn unpack_single(element: F4) -> F32

Unpack a single element.
Source§

impl PartialEq for F4

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for F4

Source§

fn partial_cmp(&self, other: &F4) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Pod for F4

Source§

impl Pod for F4

Source§

impl Rem for F4

Source§

type Output = F4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: F4) -> F4

Performs the % operation. Read more
Source§

impl RemAssign for F4

Source§

fn rem_assign(&mut self, rhs: F4)

Performs the %= operation. Read more
Source§

impl SimdKernel<F4> for Scalar

Source§

const LANE_COUNT: usize = 16

Number of primitive elements of type T in one Vector.
Source§

const UNROLL_FACTOR: usize = 4

Loop unrolling register accumulation factor to break loop-carried dependency chains.
Source§

type Vector = [F4; 16]

The underlying raw register/vector type for this architecture and element type.
Source§

type Mask = [bool; 16]

Hardware-native mask type. Read more
Source§

type IndexVector = [i32; 16]

Integer index vector for gather operations. Read more
Source§

unsafe fn load_aligned(ptr: *const F4) -> <Scalar as SimdKernel<F4>>::Vector

Load a vector from an aligned pointer. Read more
Source§

unsafe fn load_unaligned(ptr: *const F4) -> <Scalar as SimdKernel<F4>>::Vector

Load a vector from an unaligned pointer. Read more
Source§

unsafe fn store_aligned(ptr: *mut F4, val: <Scalar as SimdKernel<F4>>::Vector)

Store a vector to an aligned pointer. Read more
Source§

unsafe fn store_unaligned(ptr: *mut F4, val: <Scalar as SimdKernel<F4>>::Vector)

Store a vector to an unaligned pointer. Read more
Source§

unsafe fn add( a: <Scalar as SimdKernel<F4>>::Vector, b: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Vector

Elementwise addition: a + b. Read more
Source§

unsafe fn mul( a: <Scalar as SimdKernel<F4>>::Vector, b: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Vector

Elementwise multiplication: a * b. Read more
Source§

unsafe fn sub( a: <Scalar as SimdKernel<F4>>::Vector, b: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Vector

Elementwise subtraction: a - b. Read more
Source§

unsafe fn neg( a: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Vector

Elementwise negate: -a. Read more
Source§

unsafe fn fmadd( a: <Scalar as SimdKernel<F4>>::Vector, b: <Scalar as SimdKernel<F4>>::Vector, c: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Vector

Fused multiply-add: (a * b) + c. Read more
Source§

unsafe fn sum_reduce(v: <Scalar as SimdKernel<F4>>::Vector) -> F4

Horizontal sum of all lanes. Read more
Source§

unsafe fn compress( src: <Scalar as SimdKernel<F4>>::Vector, mask: <Scalar as SimdKernel<F4>>::Mask, ) -> <Scalar as SimdKernel<F4>>::Vector

Compress: pack selected lanes (where mask[i]=1) into the low lanes of the result. Read more
Source§

unsafe fn expand( src: <Scalar as SimdKernel<F4>>::Vector, mask: <Scalar as SimdKernel<F4>>::Mask, fill: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Vector

Expand: scatter the low lanes of src into result positions where mask[i]=1. Read more
Source§

unsafe fn gather( base: *const F4, indices: <Scalar as SimdKernel<F4>>::IndexVector, ) -> <Scalar as SimdKernel<F4>>::Vector

Gather: load LANE_COUNT elements at base + indices[i] for each lane i. Read more
Source§

unsafe fn gather_masked( base: *const F4, indices: <Scalar as SimdKernel<F4>>::IndexVector, mask: <Scalar as SimdKernel<F4>>::Mask, src: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Vector

Masked gather: gather active lanes; inactive lanes take value from src. Read more
Source§

unsafe fn mask_from_bools(bits: &[bool]) -> <Scalar as SimdKernel<F4>>::Mask

Construct a mask from a slice of booleans (length must equal LANE_COUNT). Read more
Source§

unsafe fn leading_k_mask(k: usize) -> <Scalar as SimdKernel<F4>>::Mask

Construct a mask with the first k lanes active and the rest inactive. Read more
Source§

unsafe fn zero() -> <Scalar as SimdKernel<F4>>::Vector

Set all lanes to zero. Read more
Source§

unsafe fn splat(val: F4) -> <Scalar as SimdKernel<F4>>::Vector

Broadcast a scalar value to all lanes. Read more
Source§

unsafe fn mask_to_bitmask(mask: <Scalar as SimdKernel<F4>>::Mask) -> u64

Convert the native mask back to a raw u64 bitmask. Read more
Source§

unsafe fn mask_to_vector( mask: <Scalar as SimdKernel<F4>>::Mask, ) -> <Scalar as SimdKernel<F4>>::Vector

Convert the native mask back to a vector register where active lanes are set to T::ALL_ONES and inactive lanes to T::ZERO. Read more
Source§

unsafe fn vector_to_mask( v: <Scalar as SimdKernel<F4>>::Vector, ) -> <Scalar as SimdKernel<F4>>::Mask

Convert a comparison-result vector into the native mask, the inverse of SimdKernel::mask_to_vector. Read more
Source§

const LANE_BOUND_CHECK: () = _

Compile-time guard that LANE_COUNT fits the fixed MAX_SIMD_LANES scalar-fallback stack buffers. Referencing this const in the buffer-using default methods forces the assertion to be evaluated for each concrete backend at monomorphization, turning a would-be silent stack-buffer overflow into a compile error.
Source§

const SUPPORTS_NT_STORE: bool = false

Whether this backend provides a non-temporal (cache-bypassing) store via store_streaming. Backends leaving this false keep the regular store default; callers gate the streaming path on this const so it is a compile-time branch, dead-code-eliminated where unsupported.
Source§

unsafe fn store_streaming(ptr: *mut T, val: Self::Vector)

Store a vector with a non-temporal (streaming) hint that bypasses the cache, avoiding the read-for-ownership traffic a normal write-allocate pays for write-only data larger than the last-level cache (measured 1.71× on out-of-LLC AVX2 f32 elementwise writes; see streaming_bench). Read more
Source§

fn stream_write_barrier()

Fence ordering this backend’s non-temporal stores before subsequent reads. No-op by default (only meaningful where store_streaming is a weakly ordered non-temporal store).
Source§

unsafe fn masked_load_unaligned( ptr: *const T, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked load: active lanes loaded from ptr, inactive lanes taken from src. Read more
Source§

unsafe fn masked_store_unaligned( ptr: *mut T, mask: Self::Mask, val: Self::Vector, )

Masked store: active lanes written to ptr, inactive lanes left unchanged. Read more
Source§

unsafe fn masked_add( a: Self::Vector, b: Self::Vector, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked elementwise add: active lanes compute a + b, inactive lanes yield src. Read more
Source§

unsafe fn masked_mul( a: Self::Vector, b: Self::Vector, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked elementwise multiply: active lanes compute a * b, inactive lanes yield src. Read more
Source§

unsafe fn masked_fmadd( a: Self::Vector, b: Self::Vector, c: Self::Vector, mask: Self::Mask, ) -> Self::Vector

Masked fused multiply-add: active lanes compute (a * b) + c, inactive lanes retain c. Read more
Source§

unsafe fn masked_sum_reduce(v: Self::Vector, mask: Self::Mask) -> T

Masked horizontal sum: only lanes where mask[i]=1 contribute. Read more
Source§

unsafe fn mask_from_bitmask(bm: u64) -> Self::Mask

Convert a raw u64 bitmask to the architecture-native mask type. Read more
Source§

unsafe fn scan_vector<Op, SMode>(v: Self::Vector, carry: T) -> (Self::Vector, T)
where Op: ScanOp<T>, SMode: ScanMode,

Perform an intra-vector prefix scan (inclusive or exclusive) of the vector, using the specified ScanOp strategy and starting carry value. Returns the scanned vector and the final carry value. Read more
Source§

unsafe fn div(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise division: a / b. Read more
Source§

unsafe fn bitand(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise AND: a & b. Read more
Source§

unsafe fn bitor(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise OR: a | b. Read more
Source§

unsafe fn bitxor(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise XOR: a ^ b. Read more
Source§

unsafe fn abs(a: Self::Vector) -> Self::Vector

Elementwise absolute value. Read more
Source§

unsafe fn min(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise minimum of a and b. Read more
Source§

unsafe fn max(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise maximum of a and b. Read more
Source§

unsafe fn sqrt(a: Self::Vector) -> Self::Vector

Elementwise square root. Read more
Source§

unsafe fn recip_sqrt(a: Self::Vector) -> Self::Vector

Elementwise reciprocal square root, 1/√x, to full T precision (~1 ulp). Read more
Source§

unsafe fn cmp_eq(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise equal: a == b. Read more
Source§

unsafe fn cmp_ne(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise not equal: a != b. Read more
Source§

unsafe fn cmp_lt(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise less than: a < b. Read more
Source§

unsafe fn cmp_le(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise less than or equal: a <= b. Read more
Source§

unsafe fn cmp_gt(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise greater than: a > b. Read more
Source§

unsafe fn cmp_ge(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise greater than or equal: a >= b. Read more
Source§

unsafe fn blend( mask: Self::Vector, true_val: Self::Vector, false_val: Self::Vector, ) -> Self::Vector

Elementwise blend: select lanes from true_val where the sign bit of mask is set, and from false_val otherwise. Read more
Source§

unsafe fn bitnot(a: Self::Vector) -> Self::Vector

Elementwise bitwise NOT: !a. Read more
Source§

unsafe fn min_reduce(v: Self::Vector) -> T

Horizontal minimum across all lanes. Read more
Source§

unsafe fn max_reduce(v: Self::Vector) -> T

Horizontal maximum across all lanes. Read more
Source§

unsafe fn popcount(a: Self::Vector) -> Self::Vector

Elementwise population count (number of set bits). Read more
Source§

unsafe fn horizontal_bitwise_and(v: Self::Vector) -> T

Horizontal bitwise AND across all lanes. Read more
Source§

unsafe fn horizontal_bitwise_or(v: Self::Vector) -> T

Horizontal bitwise OR across all lanes. Read more
Source§

unsafe fn horizontal_bitwise_xor(v: Self::Vector) -> T

Horizontal bitwise XOR across all lanes. Read more
Source§

unsafe fn swap_adjacent(v: Self::Vector) -> Self::Vector

Swap each adjacent lane pair: [a0, a1, a2, a3, ...] -> [a1, a0, a3, a2, ...]. Read more
Source§

unsafe fn dup_even(v: Self::Vector) -> Self::Vector

Duplicate even lanes into odd lanes: [a0, a1, a2, a3, ...] -> [a0, a0, a2, a2, ...]. Read more
Source§

unsafe fn dup_odd(v: Self::Vector) -> Self::Vector

Duplicate odd lanes into even lanes: [a0, a1, a2, a3, ...] -> [a1, a1, a3, a3, ...]. Read more
Source§

unsafe fn fmaddsub( a: Self::Vector, b: Self::Vector, c: Self::Vector, ) -> Self::Vector

Alternating fused multiply: even lanes a*b - c, odd lanes a*b + c. Read more
Source§

unsafe fn fmsubadd( a: Self::Vector, b: Self::Vector, c: Self::Vector, ) -> Self::Vector

Alternating fused multiply: even lanes a*b + c, odd lanes a*b - c. Read more
Source§

impl SimdKernel<F4> for Avx2

Available on x86 or x86-64 only.
Source§

const LANE_COUNT: usize = 32

Number of primitive elements of type T in one Vector.
Source§

const UNROLL_FACTOR: usize = 4

Loop unrolling register accumulation factor to break loop-carried dependency chains.
Source§

type Vector = [F4; 32]

The underlying raw register/vector type for this architecture and element type.
Source§

type Mask = [bool; 32]

Hardware-native mask type. Read more
Source§

type IndexVector = [i32; 32]

Integer index vector for gather operations. Read more
Source§

unsafe fn load_aligned(ptr: *const F4) -> <Avx2 as SimdKernel<F4>>::Vector

Load a vector from an aligned pointer. Read more
Source§

unsafe fn load_unaligned(ptr: *const F4) -> <Avx2 as SimdKernel<F4>>::Vector

Load a vector from an unaligned pointer. Read more
Source§

unsafe fn store_aligned(ptr: *mut F4, val: <Avx2 as SimdKernel<F4>>::Vector)

Store a vector to an aligned pointer. Read more
Source§

unsafe fn store_unaligned(ptr: *mut F4, val: <Avx2 as SimdKernel<F4>>::Vector)

Store a vector to an unaligned pointer. Read more
Source§

unsafe fn add( a: <Avx2 as SimdKernel<F4>>::Vector, b: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Elementwise addition: a + b. Read more
Source§

unsafe fn mul( a: <Avx2 as SimdKernel<F4>>::Vector, b: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Elementwise multiplication: a * b. Read more
Source§

unsafe fn sub( a: <Avx2 as SimdKernel<F4>>::Vector, b: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Elementwise subtraction: a - b. Read more
Source§

unsafe fn neg( a: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Elementwise negate: -a. Read more
Source§

unsafe fn fmadd( a: <Avx2 as SimdKernel<F4>>::Vector, b: <Avx2 as SimdKernel<F4>>::Vector, c: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Fused multiply-add: (a * b) + c. Read more
Source§

unsafe fn sum_reduce(v: <Avx2 as SimdKernel<F4>>::Vector) -> F4

Horizontal sum of all lanes. Read more
Source§

unsafe fn compress( src: <Avx2 as SimdKernel<F4>>::Vector, mask: <Avx2 as SimdKernel<F4>>::Mask, ) -> <Avx2 as SimdKernel<F4>>::Vector

Compress: pack selected lanes (where mask[i]=1) into the low lanes of the result. Read more
Source§

unsafe fn expand( src: <Avx2 as SimdKernel<F4>>::Vector, mask: <Avx2 as SimdKernel<F4>>::Mask, fill: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Expand: scatter the low lanes of src into result positions where mask[i]=1. Read more
Source§

unsafe fn gather( base: *const F4, indices: <Avx2 as SimdKernel<F4>>::IndexVector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Gather: load LANE_COUNT elements at base + indices[i] for each lane i. Read more
Source§

unsafe fn gather_masked( base: *const F4, indices: <Avx2 as SimdKernel<F4>>::IndexVector, mask: <Avx2 as SimdKernel<F4>>::Mask, src: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Vector

Masked gather: gather active lanes; inactive lanes take value from src. Read more
Source§

unsafe fn mask_from_bools(bits: &[bool]) -> <Avx2 as SimdKernel<F4>>::Mask

Construct a mask from a slice of booleans (length must equal LANE_COUNT). Read more
Source§

unsafe fn leading_k_mask(k: usize) -> <Avx2 as SimdKernel<F4>>::Mask

Construct a mask with the first k lanes active and the rest inactive. Read more
Source§

unsafe fn zero() -> <Avx2 as SimdKernel<F4>>::Vector

Set all lanes to zero. Read more
Source§

unsafe fn splat(val: F4) -> <Avx2 as SimdKernel<F4>>::Vector

Broadcast a scalar value to all lanes. Read more
Source§

unsafe fn mask_to_bitmask(mask: <Avx2 as SimdKernel<F4>>::Mask) -> u64

Convert the native mask back to a raw u64 bitmask. Read more
Source§

unsafe fn mask_to_vector( mask: <Avx2 as SimdKernel<F4>>::Mask, ) -> <Avx2 as SimdKernel<F4>>::Vector

Convert the native mask back to a vector register where active lanes are set to T::ALL_ONES and inactive lanes to T::ZERO. Read more
Source§

unsafe fn vector_to_mask( v: <Avx2 as SimdKernel<F4>>::Vector, ) -> <Avx2 as SimdKernel<F4>>::Mask

Convert a comparison-result vector into the native mask, the inverse of SimdKernel::mask_to_vector. Read more
Source§

const LANE_BOUND_CHECK: () = _

Compile-time guard that LANE_COUNT fits the fixed MAX_SIMD_LANES scalar-fallback stack buffers. Referencing this const in the buffer-using default methods forces the assertion to be evaluated for each concrete backend at monomorphization, turning a would-be silent stack-buffer overflow into a compile error.
Source§

const SUPPORTS_NT_STORE: bool = false

Whether this backend provides a non-temporal (cache-bypassing) store via store_streaming. Backends leaving this false keep the regular store default; callers gate the streaming path on this const so it is a compile-time branch, dead-code-eliminated where unsupported.
Source§

unsafe fn store_streaming(ptr: *mut T, val: Self::Vector)

Store a vector with a non-temporal (streaming) hint that bypasses the cache, avoiding the read-for-ownership traffic a normal write-allocate pays for write-only data larger than the last-level cache (measured 1.71× on out-of-LLC AVX2 f32 elementwise writes; see streaming_bench). Read more
Source§

fn stream_write_barrier()

Fence ordering this backend’s non-temporal stores before subsequent reads. No-op by default (only meaningful where store_streaming is a weakly ordered non-temporal store).
Source§

unsafe fn masked_load_unaligned( ptr: *const T, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked load: active lanes loaded from ptr, inactive lanes taken from src. Read more
Source§

unsafe fn masked_store_unaligned( ptr: *mut T, mask: Self::Mask, val: Self::Vector, )

Masked store: active lanes written to ptr, inactive lanes left unchanged. Read more
Source§

unsafe fn masked_add( a: Self::Vector, b: Self::Vector, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked elementwise add: active lanes compute a + b, inactive lanes yield src. Read more
Source§

unsafe fn masked_mul( a: Self::Vector, b: Self::Vector, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked elementwise multiply: active lanes compute a * b, inactive lanes yield src. Read more
Source§

unsafe fn masked_fmadd( a: Self::Vector, b: Self::Vector, c: Self::Vector, mask: Self::Mask, ) -> Self::Vector

Masked fused multiply-add: active lanes compute (a * b) + c, inactive lanes retain c. Read more
Source§

unsafe fn masked_sum_reduce(v: Self::Vector, mask: Self::Mask) -> T

Masked horizontal sum: only lanes where mask[i]=1 contribute. Read more
Source§

unsafe fn mask_from_bitmask(bm: u64) -> Self::Mask

Convert a raw u64 bitmask to the architecture-native mask type. Read more
Source§

unsafe fn scan_vector<Op, SMode>(v: Self::Vector, carry: T) -> (Self::Vector, T)
where Op: ScanOp<T>, SMode: ScanMode,

Perform an intra-vector prefix scan (inclusive or exclusive) of the vector, using the specified ScanOp strategy and starting carry value. Returns the scanned vector and the final carry value. Read more
Source§

unsafe fn div(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise division: a / b. Read more
Source§

unsafe fn bitand(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise AND: a & b. Read more
Source§

unsafe fn bitor(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise OR: a | b. Read more
Source§

unsafe fn bitxor(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise XOR: a ^ b. Read more
Source§

unsafe fn abs(a: Self::Vector) -> Self::Vector

Elementwise absolute value. Read more
Source§

unsafe fn min(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise minimum of a and b. Read more
Source§

unsafe fn max(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise maximum of a and b. Read more
Source§

unsafe fn sqrt(a: Self::Vector) -> Self::Vector

Elementwise square root. Read more
Source§

unsafe fn recip_sqrt(a: Self::Vector) -> Self::Vector

Elementwise reciprocal square root, 1/√x, to full T precision (~1 ulp). Read more
Source§

unsafe fn cmp_eq(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise equal: a == b. Read more
Source§

unsafe fn cmp_ne(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise not equal: a != b. Read more
Source§

unsafe fn cmp_lt(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise less than: a < b. Read more
Source§

unsafe fn cmp_le(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise less than or equal: a <= b. Read more
Source§

unsafe fn cmp_gt(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise greater than: a > b. Read more
Source§

unsafe fn cmp_ge(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise greater than or equal: a >= b. Read more
Source§

unsafe fn blend( mask: Self::Vector, true_val: Self::Vector, false_val: Self::Vector, ) -> Self::Vector

Elementwise blend: select lanes from true_val where the sign bit of mask is set, and from false_val otherwise. Read more
Source§

unsafe fn bitnot(a: Self::Vector) -> Self::Vector

Elementwise bitwise NOT: !a. Read more
Source§

unsafe fn min_reduce(v: Self::Vector) -> T

Horizontal minimum across all lanes. Read more
Source§

unsafe fn max_reduce(v: Self::Vector) -> T

Horizontal maximum across all lanes. Read more
Source§

unsafe fn popcount(a: Self::Vector) -> Self::Vector

Elementwise population count (number of set bits). Read more
Source§

unsafe fn horizontal_bitwise_and(v: Self::Vector) -> T

Horizontal bitwise AND across all lanes. Read more
Source§

unsafe fn horizontal_bitwise_or(v: Self::Vector) -> T

Horizontal bitwise OR across all lanes. Read more
Source§

unsafe fn horizontal_bitwise_xor(v: Self::Vector) -> T

Horizontal bitwise XOR across all lanes. Read more
Source§

unsafe fn swap_adjacent(v: Self::Vector) -> Self::Vector

Swap each adjacent lane pair: [a0, a1, a2, a3, ...] -> [a1, a0, a3, a2, ...]. Read more
Source§

unsafe fn dup_even(v: Self::Vector) -> Self::Vector

Duplicate even lanes into odd lanes: [a0, a1, a2, a3, ...] -> [a0, a0, a2, a2, ...]. Read more
Source§

unsafe fn dup_odd(v: Self::Vector) -> Self::Vector

Duplicate odd lanes into even lanes: [a0, a1, a2, a3, ...] -> [a1, a1, a3, a3, ...]. Read more
Source§

unsafe fn fmaddsub( a: Self::Vector, b: Self::Vector, c: Self::Vector, ) -> Self::Vector

Alternating fused multiply: even lanes a*b - c, odd lanes a*b + c. Read more
Source§

unsafe fn fmsubadd( a: Self::Vector, b: Self::Vector, c: Self::Vector, ) -> Self::Vector

Alternating fused multiply: even lanes a*b + c, odd lanes a*b - c. Read more
Source§

impl SimdKernel<F4> for Avx512

Available on x86 or x86-64 only.
Source§

const LANE_COUNT: usize = 64

Number of primitive elements of type T in one Vector.
Source§

const UNROLL_FACTOR: usize = 4

Loop unrolling register accumulation factor to break loop-carried dependency chains.
Source§

type Vector = [F4; 64]

The underlying raw register/vector type for this architecture and element type.
Source§

type Mask = [bool; 64]

Hardware-native mask type. Read more
Source§

type IndexVector = [i32; 64]

Integer index vector for gather operations. Read more
Source§

unsafe fn load_aligned(ptr: *const F4) -> <Avx512 as SimdKernel<F4>>::Vector

Load a vector from an aligned pointer. Read more
Source§

unsafe fn load_unaligned(ptr: *const F4) -> <Avx512 as SimdKernel<F4>>::Vector

Load a vector from an unaligned pointer. Read more
Source§

unsafe fn store_aligned(ptr: *mut F4, val: <Avx512 as SimdKernel<F4>>::Vector)

Store a vector to an aligned pointer. Read more
Source§

unsafe fn store_unaligned(ptr: *mut F4, val: <Avx512 as SimdKernel<F4>>::Vector)

Store a vector to an unaligned pointer. Read more
Source§

unsafe fn add( a: <Avx512 as SimdKernel<F4>>::Vector, b: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Elementwise addition: a + b. Read more
Source§

unsafe fn mul( a: <Avx512 as SimdKernel<F4>>::Vector, b: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Elementwise multiplication: a * b. Read more
Source§

unsafe fn sub( a: <Avx512 as SimdKernel<F4>>::Vector, b: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Elementwise subtraction: a - b. Read more
Source§

unsafe fn neg( a: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Elementwise negate: -a. Read more
Source§

unsafe fn fmadd( a: <Avx512 as SimdKernel<F4>>::Vector, b: <Avx512 as SimdKernel<F4>>::Vector, c: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Fused multiply-add: (a * b) + c. Read more
Source§

unsafe fn sum_reduce(v: <Avx512 as SimdKernel<F4>>::Vector) -> F4

Horizontal sum of all lanes. Read more
Source§

unsafe fn compress( src: <Avx512 as SimdKernel<F4>>::Vector, mask: <Avx512 as SimdKernel<F4>>::Mask, ) -> <Avx512 as SimdKernel<F4>>::Vector

Compress: pack selected lanes (where mask[i]=1) into the low lanes of the result. Read more
Source§

unsafe fn expand( src: <Avx512 as SimdKernel<F4>>::Vector, mask: <Avx512 as SimdKernel<F4>>::Mask, fill: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Expand: scatter the low lanes of src into result positions where mask[i]=1. Read more
Source§

unsafe fn gather( base: *const F4, indices: <Avx512 as SimdKernel<F4>>::IndexVector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Gather: load LANE_COUNT elements at base + indices[i] for each lane i. Read more
Source§

unsafe fn gather_masked( base: *const F4, indices: <Avx512 as SimdKernel<F4>>::IndexVector, mask: <Avx512 as SimdKernel<F4>>::Mask, src: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Vector

Masked gather: gather active lanes; inactive lanes take value from src. Read more
Source§

unsafe fn mask_from_bools(bits: &[bool]) -> <Avx512 as SimdKernel<F4>>::Mask

Construct a mask from a slice of booleans (length must equal LANE_COUNT). Read more
Source§

unsafe fn leading_k_mask(k: usize) -> <Avx512 as SimdKernel<F4>>::Mask

Construct a mask with the first k lanes active and the rest inactive. Read more
Source§

unsafe fn zero() -> <Avx512 as SimdKernel<F4>>::Vector

Set all lanes to zero. Read more
Source§

unsafe fn splat(val: F4) -> <Avx512 as SimdKernel<F4>>::Vector

Broadcast a scalar value to all lanes. Read more
Source§

unsafe fn mask_to_bitmask(mask: <Avx512 as SimdKernel<F4>>::Mask) -> u64

Convert the native mask back to a raw u64 bitmask. Read more
Source§

unsafe fn mask_to_vector( mask: <Avx512 as SimdKernel<F4>>::Mask, ) -> <Avx512 as SimdKernel<F4>>::Vector

Convert the native mask back to a vector register where active lanes are set to T::ALL_ONES and inactive lanes to T::ZERO. Read more
Source§

unsafe fn vector_to_mask( v: <Avx512 as SimdKernel<F4>>::Vector, ) -> <Avx512 as SimdKernel<F4>>::Mask

Convert a comparison-result vector into the native mask, the inverse of SimdKernel::mask_to_vector. Read more
Source§

const LANE_BOUND_CHECK: () = _

Compile-time guard that LANE_COUNT fits the fixed MAX_SIMD_LANES scalar-fallback stack buffers. Referencing this const in the buffer-using default methods forces the assertion to be evaluated for each concrete backend at monomorphization, turning a would-be silent stack-buffer overflow into a compile error.
Source§

const SUPPORTS_NT_STORE: bool = false

Whether this backend provides a non-temporal (cache-bypassing) store via store_streaming. Backends leaving this false keep the regular store default; callers gate the streaming path on this const so it is a compile-time branch, dead-code-eliminated where unsupported.
Source§

unsafe fn store_streaming(ptr: *mut T, val: Self::Vector)

Store a vector with a non-temporal (streaming) hint that bypasses the cache, avoiding the read-for-ownership traffic a normal write-allocate pays for write-only data larger than the last-level cache (measured 1.71× on out-of-LLC AVX2 f32 elementwise writes; see streaming_bench). Read more
Source§

fn stream_write_barrier()

Fence ordering this backend’s non-temporal stores before subsequent reads. No-op by default (only meaningful where store_streaming is a weakly ordered non-temporal store).
Source§

unsafe fn masked_load_unaligned( ptr: *const T, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked load: active lanes loaded from ptr, inactive lanes taken from src. Read more
Source§

unsafe fn masked_store_unaligned( ptr: *mut T, mask: Self::Mask, val: Self::Vector, )

Masked store: active lanes written to ptr, inactive lanes left unchanged. Read more
Source§

unsafe fn masked_add( a: Self::Vector, b: Self::Vector, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked elementwise add: active lanes compute a + b, inactive lanes yield src. Read more
Source§

unsafe fn masked_mul( a: Self::Vector, b: Self::Vector, mask: Self::Mask, src: Self::Vector, ) -> Self::Vector

Masked elementwise multiply: active lanes compute a * b, inactive lanes yield src. Read more
Source§

unsafe fn masked_fmadd( a: Self::Vector, b: Self::Vector, c: Self::Vector, mask: Self::Mask, ) -> Self::Vector

Masked fused multiply-add: active lanes compute (a * b) + c, inactive lanes retain c. Read more
Source§

unsafe fn masked_sum_reduce(v: Self::Vector, mask: Self::Mask) -> T

Masked horizontal sum: only lanes where mask[i]=1 contribute. Read more
Source§

unsafe fn mask_from_bitmask(bm: u64) -> Self::Mask

Convert a raw u64 bitmask to the architecture-native mask type. Read more
Source§

unsafe fn scan_vector<Op, SMode>(v: Self::Vector, carry: T) -> (Self::Vector, T)
where Op: ScanOp<T>, SMode: ScanMode,

Perform an intra-vector prefix scan (inclusive or exclusive) of the vector, using the specified ScanOp strategy and starting carry value. Returns the scanned vector and the final carry value. Read more
Source§

unsafe fn div(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise division: a / b. Read more
Source§

unsafe fn bitand(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise AND: a & b. Read more
Source§

unsafe fn bitor(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise OR: a | b. Read more
Source§

unsafe fn bitxor(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise bitwise XOR: a ^ b. Read more
Source§

unsafe fn abs(a: Self::Vector) -> Self::Vector

Elementwise absolute value. Read more
Source§

unsafe fn min(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise minimum of a and b. Read more
Source§

unsafe fn max(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise maximum of a and b. Read more
Source§

unsafe fn sqrt(a: Self::Vector) -> Self::Vector

Elementwise square root. Read more
Source§

unsafe fn recip_sqrt(a: Self::Vector) -> Self::Vector

Elementwise reciprocal square root, 1/√x, to full T precision (~1 ulp). Read more
Source§

unsafe fn cmp_eq(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise equal: a == b. Read more
Source§

unsafe fn cmp_ne(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise not equal: a != b. Read more
Source§

unsafe fn cmp_lt(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise less than: a < b. Read more
Source§

unsafe fn cmp_le(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise less than or equal: a <= b. Read more
Source§

unsafe fn cmp_gt(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise greater than: a > b. Read more
Source§

unsafe fn cmp_ge(a: Self::Vector, b: Self::Vector) -> Self::Vector

Elementwise greater than or equal: a >= b. Read more
Source§

unsafe fn blend( mask: Self::Vector, true_val: Self::Vector, false_val: Self::Vector, ) -> Self::Vector

Elementwise blend: select lanes from true_val where the sign bit of mask is set, and from false_val otherwise. Read more
Source§

unsafe fn bitnot(a: Self::Vector) -> Self::Vector

Elementwise bitwise NOT: !a. Read more
Source§

unsafe fn min_reduce(v: Self::Vector) -> T

Horizontal minimum across all lanes. Read more
Source§

unsafe fn max_reduce(v: Self::Vector) -> T

Horizontal maximum across all lanes. Read more
Source§

unsafe fn popcount(a: Self::Vector) -> Self::Vector

Elementwise population count (number of set bits). Read more
Source§

unsafe fn horizontal_bitwise_and(v: Self::Vector) -> T

Horizontal bitwise AND across all lanes. Read more
Source§

unsafe fn horizontal_bitwise_or(v: Self::Vector) -> T

Horizontal bitwise OR across all lanes. Read more
Source§

unsafe fn horizontal_bitwise_xor(v: Self::Vector) -> T

Horizontal bitwise XOR across all lanes. Read more
Source§

unsafe fn swap_adjacent(v: Self::Vector) -> Self::Vector

Swap each adjacent lane pair: [a0, a1, a2, a3, ...] -> [a1, a0, a3, a2, ...]. Read more
Source§

unsafe fn dup_even(v: Self::Vector) -> Self::Vector

Duplicate even lanes into odd lanes: [a0, a1, a2, a3, ...] -> [a0, a0, a2, a2, ...]. Read more
Source§

unsafe fn dup_odd(v: Self::Vector) -> Self::Vector

Duplicate odd lanes into even lanes: [a0, a1, a2, a3, ...] -> [a1, a1, a3, a3, ...]. Read more
Source§

unsafe fn fmaddsub( a: Self::Vector, b: Self::Vector, c: Self::Vector, ) -> Self::Vector

Alternating fused multiply: even lanes a*b - c, odd lanes a*b + c. Read more
Source§

unsafe fn fmsubadd( a: Self::Vector, b: Self::Vector, c: Self::Vector, ) -> Self::Vector

Alternating fused multiply: even lanes a*b + c, odd lanes a*b - c. Read more
Source§

impl StructuralPartialEq for F4

Source§

impl Sub for F4

Source§

type Output = F4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: F4) -> F4

Performs the - operation. Read more
Source§

impl SubAssign for F4

Source§

fn sub_assign(&mut self, rhs: F4)

Performs the -= operation. Read more
Source§

impl UnitScalar for F4

Source§

fn scale_by_f64(self, factor: f64) -> F4

Scale this value by a real coefficient in the scalar’s native precision.
Source§

impl Zeroable for F4

Source§

fn zeroed() -> Self

Returns a value of Self with every byte set to zero.
Source§

impl Zeroable for F4

Source§

fn zeroed() -> Self

Auto Trait Implementations§

§

impl Freeze for F4

§

impl RefUnwindSafe for F4

§

impl Send for F4

§

impl Sync for F4

§

impl Unpin for F4

§

impl UnsafeUnpin for F4

§

impl UnwindSafe for F4

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> AnyBitPattern for T
where T: Pod,

Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> CastTo for T
where T: Copy,

Source§

fn cast_to<U>(self) -> U
where U: CastFrom<Self>,

Cast self to type U.
Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> NoUninit for T
where T: Pod,

Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> SimdOps for T
where T: NumericElement + Sealed, Scalar: SimdKernel<T>, Avx2: SimdKernel<T>, Avx512: SimdKernel<T>,

Source§

fn sum(data: &[T]) -> T

Reduces the slice to its sum.
Source§

fn abs_sum(data: &[T]) -> T

Reduces the slice to Σ |x| (L1-norm accumulator); T::ZERO for empty.
Source§

fn abs_max(data: &[T]) -> T

Reduces the slice to max |x| (∞-norm accumulator); T::ZERO for empty.
Source§

fn min(data: &[T]) -> T

Reduces the slice to its minimum element. Read more
Source§

fn max(data: &[T]) -> T

Reduces the slice to its maximum element. Read more
Source§

fn scale(data: &mut [T], scalar: T)

Multiplies every element by scalar in-place.
Source§

fn argmin(data: &[T]) -> Option<(usize, T)>

Returns Some((index, value)) of the minimum element, or None for empty.
Source§

fn argmax(data: &[T]) -> Option<(usize, T)>

Returns Some((index, value)) of the maximum element, or None for empty.
Source§

fn dot(a: &[T], b: &[T]) -> Result<T, SimdError>

Computes the dot product of two slices.
Source§

fn axpy(alpha: T, x: &[T], out: &mut [T]) -> Result<(), SimdError>

Fused row update out[i] += alpha * x[i] (AXPY) with no temporaries.
Source§

fn axpy_mul(alpha: T, a: &[T], b: &[T], out: &mut [T]) -> Result<(), SimdError>

Fused ternary update out[i] += alpha * a[i] * b[i] with no temporary.
Source§

fn axpy_rows( alphas: &[T], x: &[T], out: &mut [T], row_stride: usize, rows: usize, cols: usize, ) -> Result<(), SimdError>

Fused multi-row update out[row, i] += alphas[row] * x[i].
Source§

fn axpy_rows_batch( alphas: &[T], x_panel: &[T], out: &mut [T], row_stride: usize, rows: usize, depth: usize, cols: usize, ) -> Result<(), SimdError>

Fused batched multi-row update: out[row, i] += sum_k alphas[k, row] * x_panel[k, i].
Source§

fn elementwise_mul(a: &[T], b: &[T], out: &mut [T]) -> Result<(), SimdError>

Computes the elementwise product and writes to out.
Source§

fn elementwise_add(a: &[T], b: &[T], out: &mut [T]) -> Result<(), SimdError>

Computes the elementwise sum a[i] + b[i] and writes to out.
Source§

fn elementwise_sub(a: &[T], b: &[T], out: &mut [T]) -> Result<(), SimdError>

Computes the elementwise difference a[i] - b[i] and writes to out.
Source§

fn elementwise_div(a: &[T], b: &[T], out: &mut [T]) -> Result<(), SimdError>

Computes the elementwise quotient a[i] / b[i] and writes to out.
Source§

fn masked_sum(data: &[T], mask: &[bool]) -> T

Computes the sum of elements matching a boolean mask.
Source§

fn masked_dot(a: &[T], b: &[T], mask: &[bool]) -> Result<T, SimdError>

Computes the dot product of elements matching a boolean mask.
Source§

fn masked_add( a: &[T], b: &[T], mask: &[bool], out: &mut [T], ) -> Result<(), SimdError>

Computes the elementwise sum of elements matching a boolean mask.
Source§

fn spmv_csr( data: ValidatedData<CsrMatrix<T, &[T], &[i32]>>, x: &[T], y: &mut [T], )

Computes sparse SpMV using CSR.
Source§

fn spmv_bcoo<const BM: usize, const BN: usize>( data: ValidatedData<BlockedCooMatrix<T, BM, BN, &[T], &[i32]>>, x: &[T], y: &mut [T], )

Computes sparse SpMV using const-generic Blocked-COO tiles.
Source§

fn spmv_dense_masked( data: DenseWithMaskMatrix<T, &[T], &[bool]>, x: &[T], y: &mut [T], )

Computes sparse SpMV using Dense-with-Mask.
Source§

fn spmv_sellp<const C: usize>( data: ValidatedData<SellPMatrix<T, C, &[T], &[i32]>>, x: &[T], y: &mut [T], )

Computes sparse SpMV using const-generic Sliced ELLPACK (SELL-p).
Source§

fn tiled_gemm( a: &[T], b: &[T], c: &mut [T], m: usize, n: usize, k: usize, ) -> Result<(), SimdError>

Computes register-blocked tiled GEMM: c += A * B.
Source§

fn gemv( a: &[T], x: &[T], y: &mut [T], nrows: usize, ncols: usize, ) -> Result<(), SimdError>

Computes register-blocked GEMV: y += A * x (A row-major nrows × ncols).
Source§

fn gemv_transpose( a: &[T], x: &[T], y: &mut [T], nrows: usize, ncols: usize, ) -> Result<(), SimdError>

Computes register-blocked transposed GEMV: y += Aᵀ * x (A row-major nrows × ncols, x length nrows, y length ncols).
Source§

fn gemv_strided( a: &[T], x: &[T], y: &mut [T], nrows: usize, ncols: usize, lda: usize, ) -> Result<(), SimdError>

Computes register-blocked sub-matrix GEMV: y += A * x with row stride lda ≥ ncols (lda = ncols is the packed Self::gemv).
Source§

fn gemv_transpose_strided( a: &[T], x: &[T], y: &mut [T], nrows: usize, ncols: usize, lda: usize, ) -> Result<(), SimdError>

Computes register-blocked transposed sub-matrix GEMV: y += Aᵀ * x with row stride lda ≥ ncols (lda = ncols is the packed Self::gemv_transpose).
Source§

fn interleaved_complex_mul_assign<const CONJ_B: bool>( a: &mut [T], b: &[T], ) -> Result<(), SimdError>
where T: Neg<Output = T>,

Multiplies interleaved complex lanes in-place: a[k] *= b[k] (a[k] *= conj(b[k]) when CONJ_B).
Source§

fn interleaved_complex_dot<const CONJ_B: bool>( a: &[T], b: &[T], ) -> Result<(T, T), SimdError>
where T: Neg<Output = T>,

Computes the interleaved complex dot product (re, im) of sum(a[k] * b[k]) (sum(a[k] * conj(b[k])) when CONJ_B).
Source§

fn reduce_popcount(data: &[T]) -> usize

Computes the horizontal sum of population counts of all elements.
Source§

fn reduce_popcount_and(a: &[T], b: &[T]) -> Result<usize, SimdError>

Computes the horizontal sum of population counts of a[i] & b[i].
Source§

fn reduce_popcount_or(a: &[T], b: &[T]) -> Result<usize, SimdError>

Computes the horizontal sum of population counts of a[i] | b[i].
Source§

fn reduce_popcount_xor(a: &[T], b: &[T]) -> Result<usize, SimdError>

Computes the horizontal sum of population counts of a[i] ^ b[i] (Hamming distance).
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.