Skip to main content

LanesVal

Enum LanesVal 

Source
pub enum LanesVal {
    L8W32(Lanes8Word32),
    L4W64(Lanes4Word64),
    L16W16(Lanes16Word16),
    L4W32(Lanes4Word32),
    L16W8(Lanes16Word8),
}
Expand description

A SIMD lane vector of any supported lane config — the single runtime carrier the interpreter/VM match on, mirroring WordVal. Binary ops require the same config; a mismatch returns None.

Variants§

§

L8W32(Lanes8Word32)

8 lanes of Word32 (one __m256i).

§

L4W64(Lanes4Word64)

4 lanes of Word64 (one __m256i) — the Poly1305 accumulator.

§

L16W16(Lanes16Word16)

16 lanes of Word16 (one __m256i) — NTT coefficients.

§

L4W32(Lanes4Word32)

4 lanes of Word32 (one __m128i) — the SHA-1 state/message register (SHA-NI ops).

§

L16W8(Lanes16Word8)

16 lanes of Word8 (one __m128i) — the byte-shuffle register for SIMD text codecs.

Implementations§

Source§

impl LanesVal

Source

pub const fn lanes(self) -> usize

The lane count.

Source

pub const fn elem_bits(self) -> u32

The lane-element bit width.

Source

pub const fn type_name(self) -> &'static str

The Logos type name.

Source

pub fn lane(self, i: usize) -> u64

Lane i’s value, zero-extended to u64 (for unpacking back into a Seq and for display).

Source

pub fn shuffle(self, idx: Self) -> Option<Self>

Byte-shuffle vocabulary, defined only on the L16W8 config (SIMD hex codec); None otherwise.

Source

pub fn byte_and(self, o: Self) -> Option<Self>

Source

pub fn shr_bytes(self, n: u32) -> Option<Self>

Source

pub fn interleave_lo(self, o: Self) -> Option<Self>

Source

pub fn interleave_hi(self, o: Self) -> Option<Self>

Source

pub fn byte_add(self, o: Self) -> Option<Self>

Source

pub fn maddubs_bytes(self, o: Self) -> Option<Self>

Source

pub fn packus_bytes(self, o: Self) -> Option<Self>

Source

pub fn sha1rnds4(self, msg: Self, func: u32) -> Option<Self>

The four SHA-1 (SHA-NI) operations, defined only on the L4W32 config; None otherwise.

Source

pub fn sha1msg1(self, o: Self) -> Option<Self>

Source

pub fn sha1msg2(self, o: Self) -> Option<Self>

Source

pub fn sha1nexte(self, o: Self) -> Option<Self>

Source

pub fn bitxor(self, o: Self) -> Option<Self>

Lane-wise XOR; None on a config mismatch (or a config that does not define XOR).

Source

pub fn bitand(self, o: Self) -> Option<Self>

Lane-wise AND (the MD5 F/G mixing) — None on a config mismatch or a config without AND.

Source

pub fn bitor(self, o: Self) -> Option<Self>

Lane-wise OR — None on a config mismatch or a config without OR.

Source

pub fn lane_not(self) -> Option<Self>

Lane-wise complement — None for a config without NOT.

Source

pub fn add(self, o: Self) -> Option<Self>

Lane-wise wrapping add; None on a config mismatch.

Source

pub fn sub(self, o: Self) -> Option<Self>

Lane-wise wrapping subtract; None on a config mismatch (the i16 NTT and the i32 ML-DSA NTT).

Source

pub fn mullo(self, o: Self) -> Option<Self>

Lane-wise low-16 multiply (vpmullw); None unless Word16.

Source

pub fn mulhi(self, o: Self) -> Option<Self>

Lane-wise SIGNED high-16 multiply (vpmulhw, the Montgomery mulhi); None unless Word16.

Source

pub fn ntt_bcast_lo(self, h: usize) -> Option<Self>

Within-vector NTT source-low duplication at stride h (vperm2i128/vpshufd); None unless Word16.

Source

pub fn ntt_bcast_hi(self, h: usize) -> Option<Self>

Within-vector NTT source-high duplication at stride h; None unless Word16/Word32.

Source

pub fn ntt_blend(self, o: Self, h: usize) -> Option<Self>

Within-vector NTT half-recombine at stride h (vperm2i128/vpblendd); None unless both are Word16/Word32.

Source

pub fn rotl(self, n: u32) -> Option<Self>

Lane-wise left rotation by n; None for a config that does not define rotation.

Source

pub fn mul_lo32_wide(self, o: Self) -> Option<Self>

Lane-wise widening low-32 multiply (the Poly1305 4-way limb product); None unless Word64.

Source

pub fn montmul32(self, b: Self, q: Self, qinv: Self) -> Option<Self>

The signed i32 Montgomery multiply (ML-DSA NTT butterfly), q/qinv broadcast; None unless all four are Word32.

Source

pub fn hsum(self) -> i64

Horizontal sum of the lanes as an Int.

Trait Implementations§

Source§

impl Clone for LanesVal

Source§

fn clone(&self) -> LanesVal

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 LanesVal

Source§

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

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

impl Hash for LanesVal

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for LanesVal

Source§

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

Source§

impl Eq for LanesVal

Source§

impl StructuralPartialEq for LanesVal

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> 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.