Home | History | Annotate | Download | only in Utility

Lines Matching refs:bit

13 // Common utilities for manipulating instruction bit fields.
17 // Return the bit field(s) from the most significant bit (msbit) to the
18 // least significant bit (lsbit) of a 64-bit unsigned value.
26 // Return the bit field(s) from the most significant bit (msbit) to the
27 // least significant bit (lsbit) of a 32-bit unsigned value.
35 // Return the bit value from the 'bit' position of a 32-bit unsigned value.
37 Bit32 (const uint32_t bits, const uint32_t bit)
39 return (bits >> bit) & 1u;
43 Bit64 (const uint64_t bits, const uint32_t bit)
45 return (bits >> bit) & 1ull;
48 // Set the bit field(s) from the most significant bit (msbit) to the
49 // least significant bit (lsbit) of a 32-bit unsigned value to 'val'.
59 // Set the 'bit' position of a 32-bit unsigned value to 'val'.
61 SetBit32(uint32_t &bits, const uint32_t bit, const uint32_t val)
63 SetBits32(bits, bit, bit, val);
66 // Rotate a 32-bit unsigned value right by the specified amount.
74 // Rotate a 32-bit unsigned value left by the specified amount.
82 // Create a mask that starts at bit zero and includes "bit"
84 MaskUpToBit (const uint64_t bit)
86 return (1ull << (bit + 1ull)) - 1ull;
97 x &= x - 1; // clear the least significant bit set
103 BitIsSet (const uint64_t value, const uint64_t bit)
105 return (value & (1ull << bit)) != 0;
109 BitIsClear (const uint64_t value, const uint64_t bit)
111 return (value & (1ull << bit)) == 0;