42 #ifndef __CPU_O3_RENAME_MAP_HH__ 43 #define __CPU_O3_RENAME_MAP_HH__ 49 #include "arch/types.hh" 50 #include "config/the_isa.hh" 54 #include "enums/VecRegRenameMode.hh" 126 assert(arch_reg.
flatIndex() <= map.size());
138 assert(arch_reg.
flatIndex() <= map.size());
230 return intMap.
rename(arch_reg);
232 return floatMap.
rename(arch_reg);
234 assert(vecMode == Enums::Full);
235 return vecMap.
rename(arch_reg);
237 assert(vecMode == Enums::Elem);
238 return vecElemMap.
rename(arch_reg);
240 return predMap.
rename(arch_reg);
242 return ccMap.
rename(arch_reg);
253 panic(
"rename rename(): unknown reg class %s\n",
269 return intMap.
lookup(arch_reg);
272 return floatMap.
lookup(arch_reg);
275 assert(vecMode == Enums::Full);
276 return vecMap.
lookup(arch_reg);
279 assert(vecMode == Enums::Elem);
280 return vecElemMap.
lookup(arch_reg);
283 return predMap.
lookup(arch_reg);
286 return ccMap.
lookup(arch_reg);
294 panic(
"rename lookup(): unknown reg class %s\n",
312 return intMap.
setEntry(arch_reg, phys_reg);
316 return floatMap.
setEntry(arch_reg, phys_reg);
320 assert(vecMode == Enums::Full);
321 return vecMap.
setEntry(arch_reg, phys_reg);
325 assert(vecMode == Enums::Elem);
326 return vecElemMap.
setEntry(arch_reg, phys_reg);
330 return predMap.
setEntry(arch_reg, phys_reg);
334 return ccMap.
setEntry(arch_reg, phys_reg);
341 assert(phys_reg ==
lookup(arch_reg));
345 panic(
"rename setEntry(): unknown reg class %s\n",
358 return std::min(std::min(
369 return vecMode == Enums::Full
379 bool canRename(uint32_t intRegs, uint32_t floatRegs, uint32_t vectorRegs,
380 uint32_t vecElemRegs, uint32_t vecPredRegs,
381 uint32_t ccRegs)
const 396 void switchMode(
VecMode newVecMode);
406 #endif //__CPU_O3_RENAME_MAP_HH__ #define panic(...)
This implements a cprintf based panic() function.
Arch2PhysMap::const_iterator const_iterator
unsigned numFreeEntries() const
Return the minimum number of free entries across all of the register classes.
unsigned numFreeFloatEntries() const
Arch2PhysMap map
The acutal arch-to-phys register map.
iterator end()
Forward end/cend to the map.
bool isCCPhysReg() const
true if it is a condition-code physical register.
iterator begin()
Forward begin/cbegin to the map.
bool canRename(uint32_t intRegs, uint32_t floatRegs, uint32_t vectorRegs, uint32_t vecElemRegs, uint32_t vecPredRegs, uint32_t ccRegs) const
Return whether there are enough registers to serve the request.
Simple physical register file class.
bool isVectorPhysReg() const
true if it is a vector physical register.
unsigned numFreeCCEntries() const
unsigned numFreePredEntries() const
SimpleRenameMap ccMap
The condition-code register rename map.
SimpleRenameMap predMap
The predicate register rename map.
Enums::VecRegRenameMode VecMode
TheISA::VecPredReg VecPredReg
RegId zeroReg
The architectural index of the zero register.
constexpr unsigned NumVecElemPerVecReg
::VecPredRegT< VecElem, NumVecElemPerVecReg, VecPredRegHasPackedRepr, false > VecPredReg
SimpleRenameMap floatMap
The floating-point register rename map.
const_iterator cend() const
Free list for a single class of registers (e.g., integer or floating point).
::VecRegT< VecElem, NumVecElemPerVecReg, false > VecReg
bool isVecPredPhysReg() const
PhysRegIdPtr getMiscRegId(RegIndex reg_idx)
Gets a misc register PhysRegIdPtr.
unsigned numFreeVecEntries() const
Vector Register Native Elem lane.
unsigned numFreeIntEntries() const
Arch2PhysMap::iterator iterator
UnifiedRenameMap()
Default constructor.
SimpleRenameMap intMap
The integer register rename map.
Unified register rename map for all classes of registers.
PhysRegFile * regFile
The register file object is used only to get PhysRegIdPtr on MiscRegs, as they are stored in it...
void setEntry(const RegId &arch_reg, PhysRegIdPtr phys_reg)
Update rename map with a specific mapping.
SimpleFreeList * freeList
Pointer to the free list from which new physical registers should be allocated in rename() ...
void init(unsigned size, SimpleFreeList *_freeList, RegIndex _zeroReg)
Because we have an array of rename maps (one per thread) in the CPU, it's awkward to initialize this ...
void setEntry(const RegId &arch_reg, PhysRegIdPtr phys_reg)
Update rename map with a specific mapping.
RenameInfo rename(const RegId &arch_reg)
Tell rename map to get a new free physical register to remap the specified architectural register...
unsigned numFreeRegs() const
Return the number of free registers on the list.
const_iterator end() const
bool isFloatPhysReg() const
FreeList class that simply holds the list of free integer and floating point registers.
~UnifiedRenameMap()
Destructor.
bool isIntPhysReg() const
std::pair< PhysRegIdPtr, PhysRegIdPtr > RenameInfo
Pair of a physical register and a physical register.
const RegClass & classValue() const
Class accessor.
unsigned numFreeEntries() const
Return the number of free entries on the associated free list.
SimpleRenameMap vecMap
The vector register rename map.
RegIndex flatIndex() const
Index flattening.
RenameInfo rename(const RegId &arch_reg)
Tell rename map to get a new free physical register to remap the specified architectural register...
Register ID: describe an architectural register with its class and index.
const_iterator begin() const
SimpleRenameMap::RenameInfo RenameInfo
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
bool isVectorPhysElem() const
true if it is a vector element physical register.
const_iterator cbegin() const
const char * className() const
Return a const char* with the register class name.
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
Register rename map for a single class of registers (e.g., integer or floating point).
SimpleRenameMap vecElemMap
The vector element register rename map.