Struct memchr::vector::SensibleMoveMask
source · pub(crate) struct SensibleMoveMask(u32);
Expand description
This is a “sensible” movemask implementation where each bit represents whether the most significant bit is set in each corresponding lane of a vector. This is used on x86-64 and wasm, but such a mask is more expensive to get on aarch64 so we use something a little different.
We call this “sensible” because this is what we get using native sse/avx movemask instructions. But neon has no such native equivalent.
Tuple Fields§
§0: u32
Implementations§
source§impl SensibleMoveMask
impl SensibleMoveMask
sourcefn get_for_offset(self) -> u32
fn get_for_offset(self) -> u32
Get the mask in a form suitable for computing offsets.
Basically, this normalizes to little endian. On big endian, this swaps the bytes.
Trait Implementations§
source§impl Clone for SensibleMoveMask
impl Clone for SensibleMoveMask
source§fn clone(&self) -> SensibleMoveMask
fn clone(&self) -> SensibleMoveMask
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SensibleMoveMask
impl Debug for SensibleMoveMask
source§impl MoveMask for SensibleMoveMask
impl MoveMask for SensibleMoveMask
source§fn all_zeros_except_least_significant(n: usize) -> SensibleMoveMask
fn all_zeros_except_least_significant(n: usize) -> SensibleMoveMask
Return a mask that is all zeros except for the least significant
n
lanes in a corresponding vector.source§fn has_non_zero(self) -> bool
fn has_non_zero(self) -> bool
Returns true if and only if this mask has a a non-zero bit anywhere.
source§fn count_ones(self) -> usize
fn count_ones(self) -> usize
Returns the number of bits set to 1 in this mask.
source§fn and(self, other: SensibleMoveMask) -> SensibleMoveMask
fn and(self, other: SensibleMoveMask) -> SensibleMoveMask
Does a bitwise
and
operation between self
and other
.source§fn or(self, other: SensibleMoveMask) -> SensibleMoveMask
fn or(self, other: SensibleMoveMask) -> SensibleMoveMask
Does a bitwise
or
operation between self
and other
.source§fn clear_least_significant_bit(self) -> SensibleMoveMask
fn clear_least_significant_bit(self) -> SensibleMoveMask
Returns a mask that is equivalent to
self
but with the least
significant 1-bit set to 0.source§fn first_offset(self) -> usize
fn first_offset(self) -> usize
Returns the offset of the first non-zero lane this mask represents.
source§fn last_offset(self) -> usize
fn last_offset(self) -> usize
Returns the offset of the last non-zero lane this mask represents.
impl Copy for SensibleMoveMask
Auto Trait Implementations§
impl Freeze for SensibleMoveMask
impl RefUnwindSafe for SensibleMoveMask
impl Send for SensibleMoveMask
impl Sync for SensibleMoveMask
impl Unpin for SensibleMoveMask
impl UnwindSafe for SensibleMoveMask
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)