gem5  v22.0.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

constexpr RegId ()
 
constexpr RegId (RegClassType reg_class, RegIndex reg_idx)
 
constexpr operator RegIndex () const
 
constexpr bool operator== (const RegId &that) const
 
constexpr bool operator!= (const RegId &that) const
 
constexpr bool operator< (const RegId &that) const
 Order operator. More...
 
constexpr bool isRenameable () const
 Return true if this register can be renamed. More...
 
constexpr bool is (RegClassType reg_class) const
 

Protected Attributes

RegClassType regClass
 
RegIndex regIdx
 
int numPinnedWrites
 

Static Protected Attributes

static const char * regClassStrings []
 

Friends

struct std::hash< RegId >
 
std::ostream & operator<< (std::ostream &os, const RegId &rid)
 
constexpr RegIndex index () const
 Index accessors. More...
 
constexpr RegClassType classValue () const
 Class accessor. More...
 
constexpr const char * className () const
 Return a const char* with the register class name. More...
 
int getNumPinnedWrites () const
 
void setNumPinnedWrites (int num_writes)
 

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 126 of file reg_class.hh.

Constructor & Destructor Documentation

◆ RegId() [1/2]

constexpr gem5::RegId::RegId ( )
inlineconstexpr

Definition at line 137 of file reg_class.hh.

◆ RegId() [2/2]

constexpr gem5::RegId::RegId ( RegClassType  reg_class,
RegIndex  reg_idx 
)
inlineconstexpr

Definition at line 139 of file reg_class.hh.

Member Function Documentation

◆ className()

constexpr const char* gem5::RegId::className ( ) const
inlineconstexpr

Return a const char* with the register class name.

Definition at line 194 of file reg_class.hh.

References regClass, and regClassStrings.

Referenced by gem5::o3::Rename::renameDestRegs(), gem5::o3::Rename::renameSrcRegs(), and gem5::o3::ElasticTrace::updateRegDep().

◆ classValue()

constexpr RegClassType gem5::RegId::classValue ( ) const
inlineconstexpr

◆ getNumPinnedWrites()

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

Definition at line 199 of file reg_class.hh.

References numPinnedWrites.

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

◆ index()

constexpr RegIndex gem5::RegId::index ( ) const
inlineconstexpr

◆ is()

constexpr bool gem5::RegId::is ( RegClassType  reg_class) const
inlineconstexpr
Returns
true if it is of the specified class.

Definition at line 181 of file reg_class.hh.

References regClass.

Referenced by gem5::o3::SimpleRenameMap::rename(), and gem5::o3::ElasticTrace::updateRegDep().

◆ isRenameable()

constexpr bool gem5::RegId::isRenameable ( ) const
inlineconstexpr

Return true if this register can be renamed.

Definition at line 174 of file reg_class.hh.

References gem5::InvalidRegClass, gem5::MiscRegClass, and regClass.

Referenced by gem5::PhysRegId::isFixedMapping(), gem5::o3::UnifiedRenameMap::rename(), and gem5::o3::UnifiedRenameMap::setEntry().

◆ operator RegIndex()

constexpr gem5::RegId::operator RegIndex ( ) const
inlineconstexpr

Definition at line 143 of file reg_class.hh.

References index().

◆ operator!=()

constexpr bool gem5::RegId::operator!= ( const RegId that) const
inlineconstexpr

Definition at line 155 of file reg_class.hh.

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

◆ operator<()

constexpr bool gem5::RegId::operator< ( const RegId that) const
inlineconstexpr

Order operator.

The order is required to implement maps with key type RegId

Definition at line 164 of file reg_class.hh.

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

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

◆ operator==()

constexpr bool gem5::RegId::operator== ( const RegId that) const
inlineconstexpr

Definition at line 149 of file reg_class.hh.

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

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

◆ setNumPinnedWrites()

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

Definition at line 200 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 203 of file reg_class.hh.

◆ std::hash< RegId >

friend struct std::hash< RegId >
friend

Definition at line 134 of file reg_class.hh.

Member Data Documentation

◆ numPinnedWrites

int gem5::RegId::numPinnedWrites
protected

◆ regClass

RegClassType gem5::RegId::regClass
protected

◆ regClassStrings

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

Definition at line 129 of file reg_class.hh.

Referenced by className().

◆ regIdx

RegIndex gem5::RegId::regIdx
protected

Definition at line 131 of file reg_class.hh.

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


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

Generated on Thu Jul 28 2022 13:33:11 for gem5 by doxygen 1.8.17