gem5
|
Unified register rename map for all classes of registers. More...
#include <rename_map.hh>
Public Types | |
typedef TheISA::RegIndex | RegIndex |
typedef SimpleRenameMap::RenameInfo | RenameInfo |
Public Member Functions | |
UnifiedRenameMap () | |
Default constructor. More... | |
~UnifiedRenameMap () | |
Destructor. More... | |
void | init (PhysRegFile *_regFile, RegIndex _intZeroReg, RegIndex _floatZeroReg, UnifiedFreeList *freeList) |
Initializes rename map with given parameters. More... | |
RenameInfo | rename (RegIndex arch_reg) |
Tell rename map to get a new free physical register to remap the specified architectural register. More... | |
RenameInfo | renameInt (RegIndex rel_arch_reg) |
Perform rename() on an integer register, given a relative integer register index. More... | |
RenameInfo | renameFloat (RegIndex rel_arch_reg) |
Perform rename() on a floating-point register, given a relative floating-point register index. More... | |
RenameInfo | renameCC (RegIndex rel_arch_reg) |
Perform rename() on a condition-code register, given a relative condition-code register index. More... | |
RenameInfo | renameMisc (RegIndex rel_arch_reg) |
Perform rename() on a misc register, given a relative misc register index. More... | |
PhysRegIndex | lookup (RegIndex arch_reg) const |
Look up the physical register mapped to an architectural register. More... | |
PhysRegIndex | lookupInt (RegIndex rel_arch_reg) const |
Perform lookup() on an integer register, given a relative integer register index. More... | |
PhysRegIndex | lookupFloat (RegIndex rel_arch_reg) const |
Perform lookup() on a floating-point register, given a relative floating-point register index. More... | |
PhysRegIndex | lookupCC (RegIndex rel_arch_reg) const |
Perform lookup() on a condition-code register, given a relative condition-code register index. More... | |
PhysRegIndex | lookupMisc (RegIndex rel_arch_reg) const |
Perform lookup() on a misc register, given a relative misc register index. More... | |
void | setEntry (RegIndex arch_reg, PhysRegIndex phys_reg) |
Update rename map with a specific mapping. More... | |
void | setIntEntry (RegIndex arch_reg, PhysRegIndex phys_reg) |
Perform setEntry() on an integer register, given a relative integer register index. More... | |
void | setFloatEntry (RegIndex arch_reg, PhysRegIndex phys_reg) |
Perform setEntry() on a floating-point register, given a relative floating-point register index. More... | |
void | setCCEntry (RegIndex arch_reg, PhysRegIndex phys_reg) |
Perform setEntry() on a condition-code register, given a relative condition-code register index. More... | |
unsigned | numFreeEntries () const |
Return the minimum number of free entries across all of the register classes. More... | |
bool | canRename (uint32_t intRegs, uint32_t floatRegs, uint32_t ccRegs) const |
Return whether there are enough registers to serve the request. More... | |
Private Attributes | |
SimpleRenameMap | intMap |
The integer register rename map. More... | |
SimpleRenameMap | floatMap |
The floating-point register rename map. More... | |
PhysRegFile * | regFile |
The register file object is used only to distinguish integer from floating-point physical register indices, which in turn is used only for assert statements that make sure the physical register indices that get passed in and handed out are of the proper class. More... | |
SimpleRenameMap | ccMap |
The condition-code register rename map. More... | |
Unified register rename map for all classes of registers.
Wraps a set of class-specific rename maps. Methods that do not specify a register class (e.g., rename()) take unified register indices, while methods that do specify a register class (e.g., renameInt()) take relative register indices. See http://gem5.org/Register_Indexing.
Definition at line 159 of file rename_map.hh.
typedef TheISA::RegIndex UnifiedRenameMap::RegIndex |
Definition at line 182 of file rename_map.hh.
Definition at line 184 of file rename_map.hh.
|
inline |
Default constructor.
init() must be called prior to use.
Definition at line 187 of file rename_map.hh.
|
inline |
Destructor.
Definition at line 190 of file rename_map.hh.
|
inline |
Return whether there are enough registers to serve the request.
Definition at line 365 of file rename_map.hh.
References ccMap, floatMap, intMap, and SimpleRenameMap::numFreeEntries().
void UnifiedRenameMap::init | ( | PhysRegFile * | _regFile, |
RegIndex | _intZeroReg, | ||
RegIndex | _floatZeroReg, | ||
UnifiedFreeList * | freeList | ||
) |
Initializes rename map with given parameters.
Definition at line 91 of file rename_map.cc.
References UnifiedFreeList::ccList, ccMap, UnifiedFreeList::floatList, floatMap, SimpleRenameMap::init(), UnifiedFreeList::intList, intMap, AlphaISA::NumCCRegs, AlphaISA::NumFloatRegs, AlphaISA::NumIntRegs, and regFile.
PhysRegIndex UnifiedRenameMap::lookup | ( | RegIndex | arch_reg | ) | const |
Look up the physical register mapped to an architectural register.
This version takes a unified flattened architectural register index and calls the appropriate class-specific rename table.
arch_reg | The unified architectural register to look up. |
Definition at line 132 of file rename_map.cc.
References CCRegClass, FloatRegClass, IntRegClass, lookupCC(), lookupFloat(), lookupInt(), lookupMisc(), MiscRegClass, panic, RegClassStrings, and regIdxToClass().
|
inline |
Perform lookup() on a condition-code register, given a relative condition-code register index.
Definition at line 292 of file rename_map.hh.
References ccMap, PhysRegFile::isCCPhysReg(), SimpleRenameMap::lookup(), and regFile.
Referenced by lookup().
|
inline |
Perform lookup() on a floating-point register, given a relative floating-point register index.
Definition at line 281 of file rename_map.hh.
References floatMap, PhysRegFile::isFloatPhysReg(), SimpleRenameMap::lookup(), and regFile.
Referenced by lookup().
|
inline |
Perform lookup() on an integer register, given a relative integer register index.
Definition at line 270 of file rename_map.hh.
References intMap, PhysRegFile::isIntPhysReg(), SimpleRenameMap::lookup(), and regFile.
Referenced by lookup().
|
inline |
Perform lookup() on a misc register, given a relative misc register index.
Definition at line 303 of file rename_map.hh.
References regFile, and PhysRegFile::totalNumPhysRegs().
Referenced by lookup(), renameMisc(), and setEntry().
|
inline |
Return the minimum number of free entries across all of the register classes.
The minimum is used so we guarantee that this number of entries is available regardless of which class of registers is requested.
Definition at line 357 of file rename_map.hh.
References floatMap, intMap, and SimpleRenameMap::numFreeEntries().
UnifiedRenameMap::RenameInfo UnifiedRenameMap::rename | ( | RegIndex | arch_reg | ) |
Tell rename map to get a new free physical register to remap the specified architectural register.
This version takes a unified flattened architectural register index and calls the appropriate class-specific rename table.
arch_reg | The unified architectural register index to remap. |
Definition at line 107 of file rename_map.cc.
References CCRegClass, FloatRegClass, IntRegClass, MiscRegClass, panic, RegClassStrings, regIdxToClass(), renameCC(), renameFloat(), renameInt(), and renameMisc().
|
inline |
Perform rename() on a condition-code register, given a relative condition-code register index.
Definition at line 235 of file rename_map.hh.
References ccMap, PhysRegFile::isCCPhysReg(), regFile, and SimpleRenameMap::rename().
Referenced by rename().
|
inline |
Perform rename() on a floating-point register, given a relative floating-point register index.
Definition at line 224 of file rename_map.hh.
References floatMap, PhysRegFile::isFloatPhysReg(), regFile, and SimpleRenameMap::rename().
Referenced by rename().
|
inline |
Perform rename() on an integer register, given a relative integer register index.
Definition at line 213 of file rename_map.hh.
References intMap, PhysRegFile::isIntPhysReg(), regFile, and SimpleRenameMap::rename().
Referenced by rename().
|
inline |
Perform rename() on a misc register, given a relative misc register index.
Definition at line 246 of file rename_map.hh.
References lookupMisc().
Referenced by rename().
|
inline |
Perform setEntry() on a condition-code register, given a relative condition-code register index.
Definition at line 345 of file rename_map.hh.
References ccMap, PhysRegFile::isCCPhysReg(), regFile, and SimpleRenameMap::setEntry().
Referenced by setEntry().
void UnifiedRenameMap::setEntry | ( | RegIndex | arch_reg, |
PhysRegIndex | phys_reg | ||
) |
Update rename map with a specific mapping.
Generally used to roll back to old mappings on a squash. This version takes a unified flattened architectural register index and calls the appropriate class-specific rename table.
arch_reg | The unified architectural register to remap. |
phys_reg | The physical register to remap it to. |
Definition at line 156 of file rename_map.cc.
References CCRegClass, FloatRegClass, IntRegClass, lookupMisc(), MiscRegClass, panic, RegClassStrings, regIdxToClass(), setCCEntry(), setFloatEntry(), and setIntEntry().
|
inline |
Perform setEntry() on a floating-point register, given a relative floating-point register index.
Definition at line 335 of file rename_map.hh.
References floatMap, PhysRegFile::isFloatPhysReg(), regFile, and SimpleRenameMap::setEntry().
Referenced by setEntry().
|
inline |
Perform setEntry() on an integer register, given a relative integer register index.
Definition at line 325 of file rename_map.hh.
References intMap, PhysRegFile::isIntPhysReg(), regFile, and SimpleRenameMap::setEntry().
Referenced by setEntry().
|
private |
The condition-code register rename map.
Definition at line 179 of file rename_map.hh.
Referenced by canRename(), init(), lookupCC(), renameCC(), and setCCEntry().
|
private |
The floating-point register rename map.
Definition at line 167 of file rename_map.hh.
Referenced by canRename(), init(), lookupFloat(), numFreeEntries(), renameFloat(), and setFloatEntry().
|
private |
The integer register rename map.
Definition at line 164 of file rename_map.hh.
Referenced by canRename(), init(), lookupInt(), numFreeEntries(), renameInt(), and setIntEntry().
|
private |
The register file object is used only to distinguish integer from floating-point physical register indices, which in turn is used only for assert statements that make sure the physical register indices that get passed in and handed out are of the proper class.
Definition at line 176 of file rename_map.hh.
Referenced by init(), lookupCC(), lookupFloat(), lookupInt(), lookupMisc(), renameCC(), renameFloat(), renameInt(), setCCEntry(), setFloatEntry(), and setIntEntry().