gem5  v20.1.0.0
Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
RegId Class Reference

Register ID: describe an architectural register with its class and index. More...

#include <reg_class.hh>

Inheritance diagram for RegId:
PhysRegId X86ISA::InstRegIndex

Public Member Functions

 RegId ()
 
 RegId (RegClass reg_class, RegIndex reg_idx)
 
 RegId (RegClass reg_class, RegIndex reg_idx, ElemIndex elem_idx)
 
bool operator== (const RegId &that) const
 
bool operator!= (const RegId &that) const
 
bool operator< (const RegId &that) const
 Order operator. More...
 
bool isRenameable () const
 Return true if this register can be renamed. More...
 
bool isZeroReg () const
 Check if this is the zero register. More...
 
bool isIntReg () const
 
bool isFloatReg () const
 
bool isVecReg () const
 @Return true if it is a condition-code physical register. More...
 
bool isVecElem () const
 @Return true if it is a condition-code physical register. More...
 
bool isVecPredReg () const
 @Return true if it is a predicate physical register. More...
 
bool isCCReg () const
 @Return true if it is a condition-code physical register. More...
 
bool isMiscReg () const
 @Return true if it is a condition-code physical register. More...
 
bool isRenameable ()
 Return true if this register can be renamed. More...
 
const RegIndexelemIndex () const
 Elem accessor. More...
 
const RegClassclassValue () const
 Class accessor. More...
 
const char * className () const
 Return a const char* with the register class name. More...
 
int getNumPinnedWrites () const
 
void setNumPinnedWrites (int num_writes)
 
const RegIndexindex () const
 Index accessors. More...
 
RegIndexindex ()
 
RegIndex flatIndex () const
 Index flattening. More...
 

Protected Attributes

RegClass regClass
 
RegIndex regIdx
 
ElemIndex elemIdx
 
int numPinnedWrites
 

Static Protected Attributes

static const char * regClassStrings []
 
static constexpr size_t Scale = TheISA::NumVecElemPerVecReg
 

Friends

struct std::hash< RegId >
 
std::ostream & operator<< (std::ostream &os, const RegId &rid)
 

Detailed Description

Register ID: describe an architectural register with its class and index.

This structure is used instead of just the register index to disambiguate between different classes of registers. For example, a integer register with index 3 is represented by Regid(IntRegClass, 3).

Definition at line 75 of file reg_class.hh.

Constructor & Destructor Documentation

◆ RegId() [1/3]

RegId::RegId ( )
inline

Definition at line 87 of file reg_class.hh.

◆ RegId() [2/3]

RegId::RegId ( RegClass  reg_class,
RegIndex  reg_idx 
)
inline

Definition at line 89 of file reg_class.hh.

◆ RegId() [3/3]

RegId::RegId ( RegClass  reg_class,
RegIndex  reg_idx,
ElemIndex  elem_idx 
)
inlineexplicit

Definition at line 92 of file reg_class.hh.

References elemIdx, ILLEGAL_ELEM_INDEX, panic_if, regClass, and VecElemClass.

Member Function Documentation

◆ className()

const char* RegId::className ( ) const
inline

◆ classValue()

const RegClass& RegId::classValue ( ) const
inline

◆ elemIndex()

const RegIndex& RegId::elemIndex ( ) const
inline

Elem accessor.

Definition at line 198 of file reg_class.hh.

References elemIdx.

Referenced by ArmISA::ISA::flattenRegId(), operator<(), and operator==().

◆ flatIndex()

RegIndex RegId::flatIndex ( ) const
inline

Index flattening.

Required to be able to use a vector for the register mapping.

Definition at line 179 of file reg_class.hh.

References CCRegClass, elemIdx, FloatRegClass, IntRegClass, MiscRegClass, panic, regClass, regIdx, Scale, VecElemClass, VecPredRegClass, and VecRegClass.

Referenced by SimpleRenameMap::lookup(), UnifiedRenameMap::lookup(), std::hash< RegId >::operator()(), SimpleRenameMap::rename(), and SimpleRenameMap::setEntry().

◆ getNumPinnedWrites()

int RegId::getNumPinnedWrites ( ) const
inline

Definition at line 204 of file reg_class.hh.

References numPinnedWrites.

Referenced by SimpleRenameMap::rename(), and DefaultRename< Impl >::renameDestRegs().

◆ index() [1/2]

RegIndex& RegId::index ( )
inline

Definition at line 174 of file reg_class.hh.

References regIdx.

◆ index() [2/2]

const RegIndex& RegId::index ( ) const
inline

◆ isCCReg()

bool RegId::isCCReg ( ) const
inline

@Return true if it is a condition-code physical register.

Definition at line 158 of file reg_class.hh.

References CCRegClass, and regClass.

Referenced by PhysRegId::isCCPhysReg().

◆ isFloatReg()

bool RegId::isFloatReg ( ) const
inline
Returns
true if it is a floating-point physical register.

Definition at line 146 of file reg_class.hh.

References FloatRegClass, and regClass.

Referenced by PhysRegId::isFloatPhysReg().

◆ isIntReg()

bool RegId::isIntReg ( ) const
inline
Returns
true if it is an integer physical register.

Definition at line 143 of file reg_class.hh.

References IntRegClass, and regClass.

Referenced by PhysRegId::isIntPhysReg().

◆ isMiscReg()

bool RegId::isMiscReg ( ) const
inline

@Return true if it is a condition-code physical register.

Definition at line 161 of file reg_class.hh.

References MiscRegClass, and regClass.

Referenced by PhysRegId::isMiscPhysReg(), and ElasticTrace::updateRegDep().

◆ isRenameable() [1/2]

bool RegId::isRenameable ( )
inline

Return true if this register can be renamed.

Definition at line 166 of file reg_class.hh.

References MiscRegClass, and regClass.

◆ isRenameable() [2/2]

bool RegId::isRenameable ( ) const
inline

Return true if this register can be renamed.

Definition at line 126 of file reg_class.hh.

References MiscRegClass, and regClass.

Referenced by PhysRegId::isFixedMapping().

◆ isVecElem()

bool RegId::isVecElem ( ) const
inline

@Return true if it is a condition-code physical register.

Definition at line 152 of file reg_class.hh.

References regClass, and VecElemClass.

Referenced by PhysRegId::isVectorPhysElem().

◆ isVecPredReg()

bool RegId::isVecPredReg ( ) const
inline

@Return true if it is a predicate physical register.

Definition at line 155 of file reg_class.hh.

References regClass, and VecPredRegClass.

Referenced by PhysRegId::isVecPredPhysReg().

◆ isVecReg()

bool RegId::isVecReg ( ) const
inline

@Return true if it is a condition-code physical register.

Definition at line 149 of file reg_class.hh.

References regClass, and VecRegClass.

Referenced by PhysRegId::isVectorPhysReg().

◆ isZeroReg()

bool RegId::isZeroReg ( ) const
inline

Check if this is the zero register.

Returns true if this register is a zero register (needs to have a constant zero value throughout the execution).

Definition at line 137 of file reg_class.hh.

References IntRegClass, regClass, regIdx, and ArmISA::ZeroReg.

Referenced by ElasticTrace::updateRegDep().

◆ operator!=()

bool RegId::operator!= ( const RegId that) const
inline

Definition at line 109 of file reg_class.hh.

Referenced by PhysRegId::operator!=().

◆ operator<()

bool RegId::operator< ( const RegId that) const
inline

Order operator.

The order is required to implement maps with key type RegId

Definition at line 116 of file reg_class.hh.

References classValue(), elemIdx, elemIndex(), index(), regClass, and regIdx.

Referenced by PhysRegId::operator<().

◆ operator==()

bool RegId::operator== ( const RegId that) const
inline

Definition at line 104 of file reg_class.hh.

References classValue(), elemIdx, elemIndex(), index(), regClass, and regIdx.

Referenced by PhysRegId::operator==().

◆ setNumPinnedWrites()

void RegId::setNumPinnedWrites ( int  num_writes)
inline

Definition at line 205 of file reg_class.hh.

References numPinnedWrites.

Referenced by DefaultRename< Impl >::renameDestRegs().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RegId rid 
)
friend

Definition at line 208 of file reg_class.hh.

◆ std::hash< RegId >

friend struct std::hash< RegId >
friend

Definition at line 84 of file reg_class.hh.

Member Data Documentation

◆ elemIdx

ElemIndex RegId::elemIdx
protected

Definition at line 80 of file reg_class.hh.

Referenced by elemIndex(), flatIndex(), operator<(), operator==(), and RegId().

◆ numPinnedWrites

int RegId::numPinnedWrites
protected

◆ regClass

RegClass RegId::regClass
protected

◆ regClassStrings

const char * RegId::regClassStrings
staticprotected
Initial value:
= {
"IntRegClass",
"FloatRegClass",
"VecRegClass",
"VecElemClass",
"VecPredRegClass",
"CCRegClass",
"MiscRegClass"
}

Definition at line 77 of file reg_class.hh.

Referenced by className().

◆ regIdx

RegIndex RegId::regIdx
protected

Definition at line 79 of file reg_class.hh.

Referenced by flatIndex(), index(), isZeroReg(), operator<(), and operator==().

◆ Scale

constexpr size_t RegId::Scale = TheISA::NumVecElemPerVecReg
staticconstexprprotected

Definition at line 81 of file reg_class.hh.

Referenced by flatIndex().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:30 for gem5 by doxygen 1.8.17