Skip to main content

Lanes16Word16

Struct Lanes16Word16 

#[repr(C, align(32))]
pub struct Lanes16Word16(pub [u16; 16]);
Expand description

Sixteen lanes of Word16 (one 256-bit SIMD register) — the NTT coefficient lane vector. Carries [u16; 16]; the multiply-high is the SIGNED _mm256_mulhi_epi16 (the Montgomery butterfly’s mulhi). Ops have an AVX2 fast path proven byte-identical to the scalar lanes.

Tuple Fields§

§0: [u16; 16]

Implementations§

§

impl Lanes16Word16

pub const LANES: usize = 16

The number of lanes.

pub const fn splat(x: u16) -> Lanes16Word16

Broadcast one value into all sixteen lanes.

pub fn from_words(s: &[Word16]) -> Lanes16Word16

Pack the first sixteen Word16s of a slice into a lane vector (shorter slices zero-fill).

pub fn to_words(self) -> [Word16; 16]

The lanes as sixteen Word16s.

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

Lane i (0-based) as a Word16.

pub fn add(self, o: Lanes16Word16) -> Lanes16Word16

Lane-wise wrapping add in ℤ/2¹⁶ (vpaddw).

pub fn sub(self, o: Lanes16Word16) -> Lanes16Word16

Lane-wise wrapping subtract in ℤ/2¹⁶ (vpsubw).

pub fn mullo(self, o: Lanes16Word16) -> Lanes16Word16

Lane-wise low 16 bits of the product (vpmullw) — interpretation-independent.

pub fn mulhi(self, o: Lanes16Word16) -> Lanes16Word16

Lane-wise high 16 bits of the SIGNED product (vpmulhw) — the Montgomery butterfly’s mulhi.

pub fn ntt_bcast_lo(self, h: usize) -> Lanes16Word16

Broadcast each 2h-block’s low h lanes into both of its halves — the within-vector NTT butterfly’s source-low duplication, at stride h ∈ {8,4,2}. h=8vperm2i128(v,v,0x00); h=4vpshufd(v,0x44); h=2vpshufd(v,0xA0) (all per-128-bit-lane, so the multiple blocks packed in one register are handled at once).

pub fn ntt_bcast_hi(self, h: usize) -> Lanes16Word16

Broadcast each 2h-block’s high h lanes into both of its halves — the source-high duplication. h=8vperm2i128(v,v,0x11); h=4vpshufd(v,0xEE); h=2vpshufd(v,0xF5).

pub fn ntt_blend(self, o: Lanes16Word16, h: usize) -> Lanes16Word16

Recombine the +/ halves of the within-vector butterfly: each 2h-block’s low h lanes from self, high h from o. h=8vperm2i128(a,b,0x30); h=4vpblendd(a,b,0xCC); h=2vpblendd(a,b,0xAA).

Trait Implementations§

§

impl Add for Lanes16Word16

§

type Output = Lanes16Word16

The resulting type after applying the + operator.
§

fn add(self, o: Lanes16Word16) -> Lanes16Word16

Performs the + operation. Read more
§

impl Clone for Lanes16Word16

§

fn clone(&self) -> Lanes16Word16

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
§

impl Debug for Lanes16Word16

§

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

Formats the value using the given formatter. Read more
§

impl Hash for Lanes16Word16

§

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

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
§

impl Mul for Lanes16Word16

§

type Output = Lanes16Word16

The resulting type after applying the * operator.
§

fn mul(self, o: Lanes16Word16) -> Lanes16Word16

Performs the * operation. Read more
§

impl PartialEq for Lanes16Word16

§

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

impl Sub for Lanes16Word16

§

type Output = Lanes16Word16

The resulting type after applying the - operator.
§

fn sub(self, o: Lanes16Word16) -> Lanes16Word16

Performs the - operation. Read more
§

impl Copy for Lanes16Word16

§

impl Eq for Lanes16Word16

§

impl StructuralPartialEq for Lanes16Word16

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,