Home | History | Annotate | Download | only in Utility

Lines Matching refs:msbit

17 // Return the bit field(s) from the most significant bit (msbit) to the
20 Bits64 (const uint64_t bits, const uint32_t msbit, const uint32_t lsbit)
22 assert(msbit < 64 && lsbit <= msbit);
23 return (bits >> lsbit) & ((1u << (msbit - lsbit + 1)) - 1);
26 // Return the bit field(s) from the most significant bit (msbit) to the
29 Bits32 (const uint32_t bits, const uint32_t msbit, const uint32_t lsbit)
31 assert(msbit < 32 && lsbit <= msbit);
32 return (bits >> lsbit) & ((1u << (msbit - lsbit + 1)) - 1);
48 // Set the bit field(s) from the most significant bit (msbit) to the
51 SetBits32(uint32_t &bits, const uint32_t msbit, const uint32_t lsbit, const uint32_t val)
53 assert(msbit < 32 && lsbit < 32 && msbit >= lsbit);
54 uint32_t mask = ((1u << (msbit - lsbit + 1)) - 1);
115 UnsignedBits (const uint64_t value, const uint64_t msbit, const uint64_t lsbit)
118 result &= MaskUpToBit (msbit - lsbit);
123 SignedBits (const uint64_t value, const uint64_t msbit, const uint64_t lsbit)
125 uint64_t result = UnsignedBits (value, msbit, lsbit);
126 if (BitIsSet(value, msbit))
129 result |= ~MaskUpToBit (msbit - lsbit);