gem5  v21.1.0.2
Namespaces | Macros | Functions
bitfield.hh File Reference
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <type_traits>

Go to the source code of this file.

Namespaces

 gem5
 Reference material can be found at the JEDEC website: UFS standard http://www.jedec.org/standards-documents/results/jesd220 UFS HCI specification http://www.jedec.org/standards-documents/results/jesd223.
 

Macros

#define __has_builtin(foo)   0
 

Functions

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...
 

Macro Definition Documentation

◆ __has_builtin

#define __has_builtin (   foo)    0

Generated on Tue Sep 21 2021 12:26:26 for gem5 by doxygen 1.8.17