Expand description
A crate to help with bit manipulation of integers.
Naming Conventions
- The
bit
function work on a single bit. - The
region
functions work on multiple adjacent bits. - The
value
functions are like aregion
but the value is automatically shifted down on read and up on write so that you can input/output normal values and the function will put it in place for you. get
reads a value.with
returns a new value.
Features
track_caller
adds the#[track_caller]
attribute on all the functions that assert stuff. Note that using thetrack_caller
attribute can give LLVM trouble with inlining, so it’s suggested that you only use this feature as necessary during debugging.
Structs
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Two
u8
values packed as au16
.
Functions
- Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
.