gem5  v22.1.0.0
Public Member Functions | 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 (const RegClass &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

const RegClass_regClass = nullptr
 
RegIndex regIdx
 
int numPinnedWrites
 

Friends

struct std::hash< RegId >
 
class RegClassIterator
 
std::ostream & operator<< (std::ostream &os, const RegId &rid)
 
constexpr RegIndex index () const
 Index accessors. More...
 
constexpr const RegClassregClass () const
 Class accessor. More...
 
constexpr RegClassType classValue () const
 
constexpr const char * className () const
 Return a const char* with the register class name. More...
 
constexpr bool isFlat () const
 
RegId flatten (const BaseISA &isa) const
 
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 90 of file reg_class.hh.

Constructor & Destructor Documentation

◆ RegId() [1/2]

constexpr gem5::RegId::RegId ( )
inlineconstexpr

Definition at line 264 of file reg_class.hh.

◆ RegId() [2/2]

constexpr gem5::RegId::RegId ( const RegClass reg_class,
RegIndex  reg_idx 
)
inlineconstexpr

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

References _regClass, and gem5::RegClass::name().

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

◆ classValue()

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

◆ flatten()

RegId gem5::RegId::flatten ( const BaseISA isa) const
inline

◆ getNumPinnedWrites()

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

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

References _regClass, and gem5::RegClass::type().

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

◆ isFlat()

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

Definition at line 275 of file reg_class.hh.

References _regClass, and gem5::RegClass::isFlat().

◆ isRenameable()

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

◆ operator RegIndex()

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

Definition at line 107 of file reg_class.hh.

References index().

◆ operator!=()

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

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

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

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

◆ operator==()

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

Definition at line 113 of file reg_class.hh.

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

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

◆ regClass()

constexpr const RegClass& gem5::RegId::regClass ( ) const
inlineconstexpr

Class accessor.

Definition at line 151 of file reg_class.hh.

References _regClass.

Referenced by gem5::o3::DynInst::forwardOldRegs(), and gem5::CheckerCPU::setRegOperand().

◆ setNumPinnedWrites()

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

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

◆ RegClassIterator

friend class RegClassIterator
friend

Definition at line 98 of file reg_class.hh.

◆ std::hash< RegId >

friend struct std::hash< RegId >
friend

Definition at line 95 of file reg_class.hh.

Member Data Documentation

◆ _regClass

const RegClass* gem5::RegId::_regClass = nullptr
protected

Definition at line 93 of file reg_class.hh.

Referenced by className(), classValue(), flatten(), is(), isFlat(), and regClass().

◆ numPinnedWrites

int gem5::RegId::numPinnedWrites
protected

◆ regIdx

RegIndex gem5::RegId::regIdx
protected

Definition at line 94 of file reg_class.hh.

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


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

Generated on Wed Dec 21 2022 10:23:13 for gem5 by doxygen 1.9.1