pub struct KnownBits { /* private fields */ }Expand description
Per-bit knowledge about a W-bit value: bits in zero are certainly 0, bits in one are
certainly 1, and the two masks are disjoint. The concretization is every value v with
v & zero == 0 and v & one == one.
Implementations§
Source§impl KnownBits
impl KnownBits
Sourcepub fn new(zero: BitVec, one: BitVec) -> Option<Self>
pub fn new(zero: BitVec, one: BitVec) -> Option<Self>
From masks of known-zero and known-one bits; None unless the widths are equal and
the masks disjoint.
Sourcepub fn known_zero(&self) -> BitVec
pub fn known_zero(&self) -> BitVec
Bits that are certainly 0.
Sourcepub fn unknown_mask(&self) -> BitVec
pub fn unknown_mask(&self) -> BitVec
Bits whose value is not known.
Sourcepub fn as_constant(&self) -> Option<BitVec>
pub fn as_constant(&self) -> Option<BitVec>
The value, if every bit is known.
Sourcepub fn meet(&self, o: &KnownBits) -> Option<KnownBits>
pub fn meet(&self, o: &KnownBits) -> Option<KnownBits>
The knowledge of both (the intersection of the described sets); None if they
contradict each other or have different widths.
Sourcepub fn join(&self, o: &KnownBits) -> Option<KnownBits>
pub fn join(&self, o: &KnownBits) -> Option<KnownBits>
Knowledge true of either (the smallest description of the union); None if the
widths differ.
Sourcepub fn trailing_known_zeros(&self) -> u32
pub fn trailing_known_zeros(&self) -> u32
Number of low bits known to be zero.
Sourcepub fn leading_known_zeros(&self) -> u32
pub fn leading_known_zeros(&self) -> u32
Number of high bits known to be zero.
Sourcepub fn known_low_prefix(&self) -> u32
pub fn known_low_prefix(&self) -> u32
Number of low bits whose values are all known (a known prefix from bit 0).