pub struct M128(/* private fields */);Expand description
128-bit underlier for the portable build — a transparent wrapper over u128.
On x86_64/aarch64 M128 is a SIMD register and on wasm32 (with simd128) a v128; here it is
a plain u128 newtype. Wrapping rather than aliasing u128 keeps M128 a distinct type on
every target, so the M128 <-> u128 conversions never collide with u128’s own reflexive
impls and the architecture-gated BinaryField128bGhash conversions need no cfg gate.
Implementations§
Trait Implementations§
Source§impl BitAndAssign for M128
impl BitAndAssign for M128
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&= operation. Read moreSource§impl BitOrAssign for M128
impl BitOrAssign for M128
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moreSource§impl BitXorAssign for M128
impl BitXorAssign for M128
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^= operation. Read moreSource§impl DeserializeBytes for M128
impl DeserializeBytes for M128
fn deserialize(read_buf: impl Buf) -> Result<Self, SerializationError>where
Self: Sized,
Source§impl Distribution<M128> for StandardUniform
impl Distribution<M128> for StandardUniform
Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> M128
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> M128
Generate a random value of
T, using rng as the source of randomness.§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>where
R: Rng,
Self: Sized,
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>where
R: Rng,
Self: Sized,
Create an iterator that generates random values of
T, using rng as
the source of randomness. Read moreSource§impl Divisible<M128> for M128
impl Divisible<M128> for M128
Source§fn value_iter(value: Self) -> impl ExactSizeIterator<Item = M128> + Send + Clone
fn value_iter(value: Self) -> impl ExactSizeIterator<Item = M128> + Send + Clone
Returns an iterator over subdivisions of this underlier value, ordered from LSB to MSB.
Source§fn ref_iter(
value: &Self,
) -> impl ExactSizeIterator<Item = M128> + Send + Clone + '_
fn ref_iter( value: &Self, ) -> impl ExactSizeIterator<Item = M128> + Send + Clone + '_
Returns an iterator over subdivisions of this underlier reference, ordered from LSB to MSB.
Source§fn slice_iter(
slice: &[Self],
) -> impl ExactSizeIterator<Item = M128> + Send + Clone + '_
fn slice_iter( slice: &[Self], ) -> impl ExactSizeIterator<Item = M128> + Send + Clone + '_
Returns an iterator over subdivisions of a slice of underliers, ordered from LSB to MSB.
Source§unsafe fn get_unchecked(&self, _index: usize) -> M128
unsafe fn get_unchecked(&self, _index: usize) -> M128
Get element at index (LSB-first ordering) without bounds checking. Read more
Source§unsafe fn set_unchecked(&mut self, _index: usize, val: M128)
unsafe fn set_unchecked(&mut self, _index: usize, val: M128)
Set element at index (LSB-first ordering) in place, without bounds checking. Read more
Source§impl Divisible<u128> for M128
impl Divisible<u128> for M128
Source§fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u128> + Send + Clone
fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u128> + Send + Clone
Returns an iterator over subdivisions of this underlier value, ordered from LSB to MSB.
Source§fn ref_iter(
value: &Self,
) -> impl ExactSizeIterator<Item = u128> + Send + Clone + '_
fn ref_iter( value: &Self, ) -> impl ExactSizeIterator<Item = u128> + Send + Clone + '_
Returns an iterator over subdivisions of this underlier reference, ordered from LSB to MSB.
Source§fn slice_iter(
slice: &[Self],
) -> impl ExactSizeIterator<Item = u128> + Send + Clone + '_
fn slice_iter( slice: &[Self], ) -> impl ExactSizeIterator<Item = u128> + Send + Clone + '_
Returns an iterator over subdivisions of a slice of underliers, ordered from LSB to MSB.
Source§unsafe fn get_unchecked(&self, index: usize) -> u128
unsafe fn get_unchecked(&self, index: usize) -> u128
Get element at index (LSB-first ordering) without bounds checking. Read more
Source§unsafe fn set_unchecked(&mut self, index: usize, val: u128)
unsafe fn set_unchecked(&mut self, index: usize, val: u128)
Set element at index (LSB-first ordering) in place, without bounds checking. Read more
Source§impl Divisible<u16> for M128
impl Divisible<u16> for M128
Source§fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u16> + Send + Clone
fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u16> + Send + Clone
Returns an iterator over subdivisions of this underlier value, ordered from LSB to MSB.
Source§fn ref_iter(
value: &Self,
) -> impl ExactSizeIterator<Item = u16> + Send + Clone + '_
fn ref_iter( value: &Self, ) -> impl ExactSizeIterator<Item = u16> + Send + Clone + '_
Returns an iterator over subdivisions of this underlier reference, ordered from LSB to MSB.
Source§fn slice_iter(
slice: &[Self],
) -> impl ExactSizeIterator<Item = u16> + Send + Clone + '_
fn slice_iter( slice: &[Self], ) -> impl ExactSizeIterator<Item = u16> + Send + Clone + '_
Returns an iterator over subdivisions of a slice of underliers, ordered from LSB to MSB.
Source§unsafe fn get_unchecked(&self, index: usize) -> u16
unsafe fn get_unchecked(&self, index: usize) -> u16
Get element at index (LSB-first ordering) without bounds checking. Read more
Source§unsafe fn set_unchecked(&mut self, index: usize, val: u16)
unsafe fn set_unchecked(&mut self, index: usize, val: u16)
Set element at index (LSB-first ordering) in place, without bounds checking. Read more
Source§impl Divisible<u32> for M128
impl Divisible<u32> for M128
Source§fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u32> + Send + Clone
fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u32> + Send + Clone
Returns an iterator over subdivisions of this underlier value, ordered from LSB to MSB.
Source§fn ref_iter(
value: &Self,
) -> impl ExactSizeIterator<Item = u32> + Send + Clone + '_
fn ref_iter( value: &Self, ) -> impl ExactSizeIterator<Item = u32> + Send + Clone + '_
Returns an iterator over subdivisions of this underlier reference, ordered from LSB to MSB.
Source§fn slice_iter(
slice: &[Self],
) -> impl ExactSizeIterator<Item = u32> + Send + Clone + '_
fn slice_iter( slice: &[Self], ) -> impl ExactSizeIterator<Item = u32> + Send + Clone + '_
Returns an iterator over subdivisions of a slice of underliers, ordered from LSB to MSB.
Source§unsafe fn get_unchecked(&self, index: usize) -> u32
unsafe fn get_unchecked(&self, index: usize) -> u32
Get element at index (LSB-first ordering) without bounds checking. Read more
Source§unsafe fn set_unchecked(&mut self, index: usize, val: u32)
unsafe fn set_unchecked(&mut self, index: usize, val: u32)
Set element at index (LSB-first ordering) in place, without bounds checking. Read more
Source§impl Divisible<u64> for M128
impl Divisible<u64> for M128
Source§fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u64> + Send + Clone
fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u64> + Send + Clone
Returns an iterator over subdivisions of this underlier value, ordered from LSB to MSB.
Source§fn ref_iter(
value: &Self,
) -> impl ExactSizeIterator<Item = u64> + Send + Clone + '_
fn ref_iter( value: &Self, ) -> impl ExactSizeIterator<Item = u64> + Send + Clone + '_
Returns an iterator over subdivisions of this underlier reference, ordered from LSB to MSB.
Source§fn slice_iter(
slice: &[Self],
) -> impl ExactSizeIterator<Item = u64> + Send + Clone + '_
fn slice_iter( slice: &[Self], ) -> impl ExactSizeIterator<Item = u64> + Send + Clone + '_
Returns an iterator over subdivisions of a slice of underliers, ordered from LSB to MSB.
Source§unsafe fn get_unchecked(&self, index: usize) -> u64
unsafe fn get_unchecked(&self, index: usize) -> u64
Get element at index (LSB-first ordering) without bounds checking. Read more
Source§unsafe fn set_unchecked(&mut self, index: usize, val: u64)
unsafe fn set_unchecked(&mut self, index: usize, val: u64)
Set element at index (LSB-first ordering) in place, without bounds checking. Read more
Source§impl Divisible<u8> for M128
impl Divisible<u8> for M128
Source§fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u8> + Send + Clone
fn value_iter(value: Self) -> impl ExactSizeIterator<Item = u8> + Send + Clone
Returns an iterator over subdivisions of this underlier value, ordered from LSB to MSB.
Source§fn ref_iter(
value: &Self,
) -> impl ExactSizeIterator<Item = u8> + Send + Clone + '_
fn ref_iter( value: &Self, ) -> impl ExactSizeIterator<Item = u8> + Send + Clone + '_
Returns an iterator over subdivisions of this underlier reference, ordered from LSB to MSB.
Source§fn slice_iter(
slice: &[Self],
) -> impl ExactSizeIterator<Item = u8> + Send + Clone + '_
fn slice_iter( slice: &[Self], ) -> impl ExactSizeIterator<Item = u8> + Send + Clone + '_
Returns an iterator over subdivisions of a slice of underliers, ordered from LSB to MSB.
Source§unsafe fn get_unchecked(&self, index: usize) -> u8
unsafe fn get_unchecked(&self, index: usize) -> u8
Get element at index (LSB-first ordering) without bounds checking. Read more
Source§unsafe fn set_unchecked(&mut self, index: usize, val: u8)
unsafe fn set_unchecked(&mut self, index: usize, val: u8)
Set element at index (LSB-first ordering) in place, without bounds checking. Read more
Source§impl Ord for M128
impl Ord for M128
Source§impl PartialOrd for M128
impl PartialOrd for M128
Source§impl UnderlierType for M128
impl UnderlierType for M128
const ZERO: Self
const ONE: Self
const ONES: Self
Source§fn interleave(self, other: Self, log_block_len: usize) -> (Self, Self)
fn interleave(self, other: Self, log_block_len: usize) -> (Self, Self)
Interleave with the given bit size
Source§const BITS: usize = _
const BITS: usize = _
Number of bits used to represent a value.
This may not be equal to the number of bits in a type instance.
Source§fn fill_with_bit(val: u8) -> Self
fn fill_with_bit(val: u8) -> Self
Fill value with the given bit
val must be 0 or 1.Source§fn transpose(self, other: Self, log_block_len: usize) -> (Self, Self)
fn transpose(self, other: Self, log_block_len: usize) -> (Self, Self)
Transpose with the given bit size
fn from_fn<T>(f: impl FnMut(usize) -> T) -> Selfwhere
T: UnderlierType,
Self: Divisible<T>,
Source§fn broadcast_subvalue<T>(value: T) -> Selfwhere
T: UnderlierType,
Self: Divisible<T>,
fn broadcast_subvalue<T>(value: T) -> Selfwhere
T: UnderlierType,
Self: Divisible<T>,
Broadcast subvalue to fill
Self.
Self::BITS/T::BITS is supposed to be a power of 2.impl Copy for M128
impl Eq for M128
impl Pod for M128
impl StructuralPartialEq for M128
Auto Trait Implementations§
impl Freeze for M128
impl RefUnwindSafe for M128
impl Send for M128
impl Sync for M128
impl Unpin for M128
impl UnsafeUnpin for M128
impl UnwindSafe for M128
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
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.§fn is_valid_bit_pattern(_bits: &T) -> bool
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 Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more