sonic_simd::bits

Struct NeonBits

Source
pub struct NeonBits(/* private fields */);
Expand description

Use u64 representation the bitmask of Neon vector. (low) Vector: 00-ff-ff-ff-ff-00-00-00 Mask : 0000-1111-1111-1111-1111-0000-0000-0000

first_offset() = 1 clear_high_bits(4) = Mask(0000-1111-1111-1111-[0000]-0000-0000-0000)

reference: https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon

Implementations§

Source§

impl NeonBits

Source

pub fn new(u: u64) -> Self

Trait Implementations§

Source§

impl BitMask for NeonBits

Source§

const LEN: usize = 16usize

Total bits in the bitmask.
Source§

fn first_offset(&self) -> usize

get the offset of the first 1 bit.
Source§

fn before(&self, rhs: &Self) -> bool

check if this bitmask is before the other bitmask.
Source§

fn as_little_endian(&self) -> Self

convert bitmask as little endian
Source§

fn all_zero(&self) -> bool

whether all bits are zero.
Source§

fn clear_high_bits(&self, n: usize) -> Self

clear high n bits.

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