Lines Matching refs:bit

15 // Common utilities for manipulating instruction bit fields.
19 // Return the bit field(s) from the most significant bit (msbit) to the
20 // least significant bit (lsbit) of a 64-bit unsigned value.
27 // Return the bit field(s) from the most significant bit (msbit) to the
28 // 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.
36 static inline uint32_t Bit32(const uint32_t bits, const uint32_t bit) {
37 return (bits >> bit) & 1u;
40 static inline uint64_t Bit64(const uint64_t bits, const uint32_t bit) {
41 return (bits >> bit) & 1ull;
44 // Set the bit field(s) from the most significant bit (msbit) to the
45 // least significant bit (lsbit) of a 32-bit unsigned value to 'val'.
54 // Set the 'bit' position of a 32-bit unsigned value to 'val'.
55 static inline void SetBit32(uint32_t &bits, const uint32_t bit,
57 SetBits32(bits, bit, bit, val);
60 // Rotate a 32-bit unsigned value right by the specified amount.
66 // Rotate a 32-bit unsigned value left by the specified amount.
72 // Create a mask that starts at bit zero and includes "bit"
73 static inline uint64_t MaskUpToBit(const uint64_t bit) {
74 if (bit >= 63)
76 return (1ull << (bit + 1ull)) - 1ull;
84 x &= x - 1; // clear the least significant bit set
89 static inline bool BitIsSet(const uint64_t value, const uint64_t bit) {
90 return (value & (1ull << bit)) != 0;
93 static inline bool BitIsClear(const uint64_t value, const uint64_t bit) {
94 return (value & (1ull << bit)) == 0;