|
| constexpr uint64_t | gem5::mask (unsigned nbits) |
| | Generate a 64-bit mask of 'nbits' 1s, right justified. More...
|
| |
| template<class T > |
| constexpr T | gem5::bits (T val, unsigned first, unsigned last) |
| | Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it. More...
|
| |
| template<class T > |
| constexpr T | gem5::bits (T val, unsigned bit) |
| | Extract the bit from this position from 'val' and right justify it. More...
|
| |
| template<class T > |
| constexpr T | gem5::mbits (T val, unsigned first, unsigned last) |
| | Mask off the given bits in place like bits() but without shifting. More...
|
| |
| constexpr uint64_t | gem5::mask (unsigned first, unsigned last) |
| |
| template<int N> |
| constexpr uint64_t | gem5::sext (uint64_t val) |
| | Sign-extend an N-bit value to 64 bits. More...
|
| |
| template<int N> |
| constexpr uint64_t | gem5::szext (uint64_t val) |
| | Sign-extend an N-bit value to 64 bits. More...
|
| |
| template<class T , class B > |
| constexpr T | gem5::insertBits (T val, unsigned first, unsigned last, B bit_val) |
| | Returns val with bits first to last set to the LSBs of bit_val. More...
|
| |
| template<class T , class B > |
| constexpr T | gem5::insertBits (T val, unsigned bit, B bit_val) |
| | Overloaded for access to only one bit in value. More...
|
| |
| template<class T , class B > |
| constexpr void | gem5::replaceBits (T &val, unsigned first, unsigned last, B bit_val) |
| | A convenience function to replace bits first to last of val with bit_val in place. More...
|
| |
| template<class T , class B > |
| constexpr void | gem5::replaceBits (T &val, unsigned bit, B bit_val) |
| | Overloaded function to allow to access only 1 bit. More...
|
| |
| template<class T > |
| std::enable_if_t< std::is_integral< T >::value &&sizeof(T) !=1, T > | gem5::reverseBits (T val, size_t size=sizeof(T)) |
| | Takes a value and returns the bit reversed version. More...
|
| |
| template<class T > |
| std::enable_if_t< std::is_integral< T >::value &&sizeof(T)==1, T > | gem5::reverseBits (T val, size_t size=sizeof(T)) |
| |
| constexpr int | gem5::findMsbSet (uint64_t val) |
| | Returns the bit position of the MSB that is set in the input. More...
|
| |
| constexpr int | gem5::findLsbSet (uint64_t val) |
| | Returns the bit position of the LSB that is set in the input. More...
|
| |
| constexpr int | gem5::popCount (uint64_t val) |
| | Returns the number of set ones in the provided value. More...
|
| |
| constexpr uint64_t | gem5::alignToPowerOfTwo (uint64_t val) |
| | Align to the next highest power of two. More...
|
| |
| constexpr int | gem5::ctz32 (uint32_t value) |
| | Count trailing zeros in a 32-bit value. More...
|
| |
| constexpr int | gem5::ctz64 (uint64_t value) |
| | Count trailing zeros in a 64-bit value. More...
|
| |