pub struct SwarUtils;Expand description
Pure SWAR bitwise utility primitives.
Implementations§
Source§impl SwarUtils
impl SwarUtils
Sourcepub fn bit_scan_forward(x: u64) -> u32
pub fn bit_scan_forward(x: u64) -> u32
Find the least significant set bit (bit index 0-63) using SWAR trailing zero count.
Sourcepub fn bit_scan_reverse(x: u64) -> u32
pub fn bit_scan_reverse(x: u64) -> u32
Find the most significant set bit (bit index 0-63) using SWAR leading zero count.
Sourcepub fn parallel_prefix_shift<F>(x: u64, shift_fn: F) -> u64
pub fn parallel_prefix_shift<F>(x: u64, shift_fn: F) -> u64
Computes parallel prefix shift (Kogge-Stone style prefix scan) on a 64-bit mask.
Sourcepub fn isolate_lsb(x: u64) -> u64
pub fn isolate_lsb(x: u64) -> u64
Isolates the least significant set bit (all other bits set to zero).
Sourcepub fn isolate_msb(x: u64) -> u64
pub fn isolate_msb(x: u64) -> u64
Isolates the most significant set bit (all other bits set to zero).
Sourcepub fn popcount_8(x: u64) -> u64
pub fn popcount_8(x: u64) -> u64
Computes parallel popcount for each of the 8-bit fields in a 64-bit word.
Sourcepub fn popcount_16(x: u64) -> u64
pub fn popcount_16(x: u64) -> u64
Computes parallel popcount for each of the 16-bit fields in a 64-bit word.
Sourcepub fn popcount_32(x: u64) -> u64
pub fn popcount_32(x: u64) -> u64
Computes parallel popcount for each of the 32-bit fields in a 64-bit word.
Sourcepub fn blsmsk(x: u64) -> u64
pub fn blsmsk(x: u64) -> u64
Bit isolation mask: sets all bits from the lowest set bit to bit 0.
Auto Trait Implementations§
impl Freeze for SwarUtils
impl RefUnwindSafe for SwarUtils
impl Send for SwarUtils
impl Sync for SwarUtils
impl Unpin for SwarUtils
impl UnsafeUnpin for SwarUtils
impl UnwindSafe for SwarUtils
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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