Go to the documentation of this file.
41 #ifndef __CPU__REG_CLASS_HH__
42 #define __CPU__REG_CLASS_HH__
48 #include "arch/registers.hh"
49 #include "config/the_isa.hh"
97 "Creating vector physical index w/o element index");
100 "Creating non-vector physical index w/ element index");
110 return !(*
this==that);
192 panic(
"Trying to flatten a register without class!");
244 :
RegId(_regClass, _regIdx, elem_idx),
flatIdx(flat_idx),
323 pinned = (numWrites != 0);
356 const size_t flat_index =
static_cast<size_t>(reg_id.
flatIndex());
357 const size_t class_num =
static_cast<size_t>(reg_id.
regClass);
359 const size_t shifted_class_num = class_num << (
sizeof(
RegIndex) << 3);
363 const size_t concatenated_hash = flat_index | shifted_class_num;
368 static_assert(
sizeof(
RegIndex) <
sizeof(
size_t),
369 "sizeof(RegIndex) should be less than sizeof(size_t)");
371 return concatenated_hash;
376 #endif // __CPU__REG_CLASS_HH__
int getNumPinnedWrites() const
bool isFloatPhysReg() const
static PhysRegId elemId(PhysRegId *vid, ElemIndex elem)
bool isMiscReg() const
@Return true if it is a condition-code physical register.
bool isVecPredReg() const
@Return true if it is a predicate physical register.
bool isVectorPhysElem() const
@Return true if it is a vector element physical register.
bool isZeroReg() const
Check if this is the zero register.
RegId(RegClass reg_class, RegIndex reg_idx, ElemIndex elem_idx)
@ VecElemClass
Vector Register Native Elem lane.
const char * className() const
Return a const char* with the register class name.
void incrNumPinnedWritesToComplete()
RegId(RegClass reg_class, RegIndex reg_idx)
bool operator!=(const RegId &that) const
const int NumRegClasses
Number of register classes.
bool operator<(const PhysRegId &that) const
Explicit forward methods, to prevent comparisons of PhysRegId with RegIds.
PhysRegId(RegClass _regClass, PhysRegIndex _regIdx, ElemIndex elem_idx, PhysRegIndex flat_idx)
Vector PhysRegId constructor (w/ elemIndex).
bool isVectorPhysReg() const
@Return true if it is a vector physical register.
const PhysRegIndex & flatIndex() const
Flat index accessor.
bool isFixedMapping() const
Returns true if this register is always associated to the same architectural register.
bool isCCReg() const
@Return true if it is a condition-code physical register.
const RegIndex & elemIndex() const
Elem accessor.
bool isRenameable()
Return true if this register can be renamed.
static const char * regClassStrings[]
Register ID: describe an architectural register with its class and index.
void setNumPinnedWrites(int num_writes)
const RegIndex & index() const
Visible RegId methods.
void incrNumPinnedWrites()
bool isVecElem() const
@Return true if it is a condition-code physical register.
@ FloatRegClass
Floating-point register.
static constexpr size_t Scale
RegClass
Enumerate the classes of registers.
constexpr unsigned NumVecElemPerVecReg
void setNumPinnedWritesToComplete(int numWrites)
void decrNumPinnedWrites()
friend std::ostream & operator<<(std::ostream &os, const RegId &rid)
bool isCCPhysReg() const
@Return true if it is a condition-code physical register.
short int PhysRegIndex
Physical register index type.
void decrNumPinnedWritesToComplete()
int getNumPinnedWrites() const
bool isIntPhysReg() const
int numPinnedWritesToComplete
@ IntRegClass
Integer register.
bool operator==(const PhysRegId &that) const
@ CCRegClass
Condition-code register.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
@ MiscRegClass
Control (misc) register.
@ VecRegClass
Vector Register.
bool isMiscPhysReg() const
@Return true if it is a condition-code physical register.
Overload hash function for BasicBlockRange type.
int getNumPinnedWritesToComplete() const
bool operator!=(const PhysRegId &that) const
void setNumPinnedWrites(int numWrites)
uint16_t ElemIndex
Logical vector register elem index type.
PhysRegId(RegClass _regClass, PhysRegIndex _regIdx, PhysRegIndex _flatIdx)
Scalar PhysRegId constructor.
bool operator==(const RegId &that) const
bool isVecReg() const
@Return true if it is a condition-code physical register.
bool isRenameable() const
Return true if this register can be renamed.
RegIndex flatIndex() const
Index flattening.
const RegIndex & index() const
Index accessors.
#define ILLEGAL_ELEM_INDEX
ElemIndex value that indicates that the register is not a vector.
bool isVecPredPhysReg() const
size_t operator()(const RegId ®_id) const
const RegClass & classValue() const
Class accessor.
bool operator<(const RegId &that) const
Order operator.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17