gem5  v21.1.0.2
Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
gem5::RegId Class Reference

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

#include <reg_class.hh>

Inheritance diagram for gem5::RegId:
gem5::PhysRegId

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 is (RegClass reg_class) const
 
RegIndex elemIndex () const
 Elem accessor. More...
 
RegClass classValue () 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)
 
RegIndex index () const
 Index accessors. More...
 
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 88 of file reg_class.hh.

Constructor & Destructor Documentation

◆ RegId() [1/3]

gem5::RegId::RegId ( )
inline

Definition at line 101 of file reg_class.hh.

◆ RegId() [2/3]

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

Definition at line 103 of file reg_class.hh.

◆ RegId() [3/3]

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

Definition at line 106 of file reg_class.hh.

References elemIdx, gem5::IllegalElemIndex, panic_if, regClass, and gem5::VecElemClass.

Member Function Documentation

◆ className()

const char* gem5::RegId::className ( ) const
inline

◆ classValue()

RegClass gem5::RegId::classValue ( ) const
inline

◆ elemIndex()

RegIndex gem5::RegId::elemIndex ( ) const
inline

Elem accessor.

Definition at line 178 of file reg_class.hh.

References elemIdx.

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

◆ flatIndex()

RegIndex gem5::RegId::flatIndex ( ) const
inline

◆ getNumPinnedWrites()

int gem5::RegId::getNumPinnedWrites ( ) const
inline

Definition at line 184 of file reg_class.hh.

References numPinnedWrites.

Referenced by gem5::o3::SimpleRenameMap::rename(), and gem5::o3::Rename::renameDestRegs().

◆ index()

RegIndex gem5::RegId::index ( ) const
inline

◆ is()

bool gem5::RegId::is ( RegClass  reg_class) const
inline
Returns
true if it is of the specified class.

Definition at line 150 of file reg_class.hh.

References regClass.

Referenced by gem5::o3::ElasticTrace::updateRegDep().

◆ isRenameable()

bool gem5::RegId::isRenameable ( ) const
inline

Return true if this register can be renamed.

Definition at line 144 of file reg_class.hh.

References gem5::MiscRegClass, and regClass.

Referenced by gem5::PhysRegId::isFixedMapping().

◆ operator!=()

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

Definition at line 126 of file reg_class.hh.

Referenced by gem5::PhysRegId::operator!=().

◆ operator<()

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

Order operator.

The order is required to implement maps with key type RegId

Definition at line 132 of file reg_class.hh.

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

Referenced by gem5::PhysRegId::operator<().

◆ operator==()

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

Definition at line 120 of file reg_class.hh.

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

Referenced by gem5::PhysRegId::operator==().

◆ setNumPinnedWrites()

void gem5::RegId::setNumPinnedWrites ( int  num_writes)
inline

Definition at line 185 of file reg_class.hh.

References numPinnedWrites.

Referenced by gem5::o3::Rename::renameDestRegs().

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 188 of file reg_class.hh.

◆ std::hash< RegId >

friend struct std::hash< RegId >
friend

Definition at line 98 of file reg_class.hh.

Member Data Documentation

◆ elemIdx

ElemIndex gem5::RegId::elemIdx
protected

Definition at line 94 of file reg_class.hh.

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

◆ numPinnedWrites

int gem5::RegId::numPinnedWrites
protected

◆ regClass

RegClass gem5::RegId::regClass
protected

◆ regClassStrings

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

Definition at line 91 of file reg_class.hh.

Referenced by className().

◆ regIdx

RegIndex gem5::RegId::regIdx
protected

Definition at line 93 of file reg_class.hh.

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

◆ Scale

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

Definition at line 95 of file reg_class.hh.

Referenced by flatIndex().


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

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