Expand description
A crate to help with bit manipulation of integers.
Naming Conventions
- The
bitfunction work on a single bit. - The
regionfunctions work on multiple adjacent bits. - The
valuefunctions are like aregionbut 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. getreads a value.withreturns a new value.
Features
track_calleradds the#[track_caller]attribute on all the functions that assert stuff. Note that using thetrack_callerattribute 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
u8values packed as au16.
Functions
- Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the low
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow.