42#ifndef __CPU_O3_RENAME_MAP_HH__
43#define __CPU_O3_RENAME_MAP_HH__
124 assert(arch_reg.
index() <= map.size());
125 return map[arch_reg.
index()];
137 assert(arch_reg.
index() <= map.size());
138 map[arch_reg.
index()] = phys_reg;
237 return renameMaps[reg_class].lookup(arch_reg);
257 assert(phys_reg ==
lookup(arch_reg));
273 auto min_free = std::numeric_limits<unsigned>::max();
276 if (map.numArchRegs())
277 min_free = std::min(min_free, map.numFreeEntries());
constexpr bool is(RegClassType reg_class) const
Register ID: describe an architectural register with its class and index.
constexpr bool isRenameable() const
Return true if this register can be renamed.
constexpr RegClassType classValue() const
constexpr RegIndex index() const
Index accessors.
Simple physical register file class.
PhysRegIdPtr getMiscRegId(RegIndex reg_idx)
Gets a misc register PhysRegIdPtr.
Free list for a single class of registers (e.g., integer or floating point).
unsigned numFreeRegs() const
Return the number of free registers on the list.
Register rename map for a single class of registers (e.g., integer or floating point).
const_iterator cend() const
unsigned numFreeEntries() const
Return the number of free entries on the associated free list.
RenameInfo rename(const RegId &arch_reg)
Tell rename map to get a new free physical register to remap the specified architectural register.
size_t numArchRegs() const
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
const_iterator end() const
SimpleFreeList * freeList
Pointer to the free list from which new physical registers should be allocated in rename()
iterator end()
Forward end/cend to the map.
Arch2PhysMap map
The acutal arch-to-phys register map.
iterator begin()
Forward begin/cbegin to the map.
void setEntry(const RegId &arch_reg, PhysRegIdPtr phys_reg)
Update rename map with a specific mapping.
std::pair< PhysRegIdPtr, PhysRegIdPtr > RenameInfo
Pair of a physical register and a physical register.
const_iterator cbegin() const
const_iterator begin() const
Arch2PhysMap::const_iterator const_iterator
Arch2PhysMap::iterator iterator
FreeList class that simply holds the list of free integer and floating point registers.
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.
SimpleRenameMap::RenameInfo RenameInfo
unsigned numFreeEntries(RegClassType type) const
UnifiedRenameMap()
Default constructor.
unsigned minFreeEntries() const
Return the minimum number of free entries across all of the register classes.
~UnifiedRenameMap()
Destructor.
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
std::array< UnifiedRenameMap, MaxThreads > PerThreadUnifiedRenameMap
bool canRename(DynInstPtr inst) const
Return whether there are enough registers to serve the request.
RenameInfo rename(const RegId &arch_reg)
Tell rename map to get a new free physical register to remap the specified architectural register.
std::array< SimpleRenameMap, CCRegClass+1 > renameMaps
static PhysRegId invalidPhysRegId
const FlagsType init
This Stat is Initialized.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
RegClassType
Enumerate the classes of registers.
@ MiscRegClass
Control (misc) register.