49 #include "debug/Rename.hh" 83 renamed_reg = prev_reg;
88 DPRINTF(Rename,
"Renaming pinned reg, numPinnedWrites %d\n",
90 renamed_reg = prev_reg;
100 DPRINTF(Rename,
"Renamed reg %d to physical reg %d (%d) old mapping was" 139 if (vecMode == Enums::Elem) {
143 "The free list is already tracking Vec elems");
146 "The free list has lost vector registers");
151 auto range = this->regFile->getRegElemIds(vr);
152 freeList->
addRegs(range.first, range.second);
155 }
else if (vecMode == Enums::Full) {
159 "The free list is already tracking full Vec");
161 regFile->numVecElemPhysRegs() -
163 "The free list has lost vector register elements");
177 if (newVecMode == Enums::Elem && vecMode == Enums::Full) {
180 vecMode = Enums::Elem;
184 for (
auto &vec: vecMap) {
187 for (
auto phys_elem = range.first;
188 phys_elem < range.second; idx++, phys_elem++) {
195 }
else if (newVecMode == Enums::Full && vecMode == Enums::Elem) {
198 vecMode = Enums::Full;
208 for (uint32_t
l = 0;
l < NVecElems;
l++) {
211 dst[
l] = regFile->readVecElem(s_prid);
217 regFile->setVecReg(regFile->getTrueId(&pregId), new_RF[
i]);
SimpleFreeList predList
The list of free predicate registers.
int getNumPinnedWrites() const
Arch2PhysMap map
The acutal arch-to-phys register map.
SimpleFreeList floatList
The list of free floating point registers.
void setNumPinnedWrites(int numWrites)
Simple physical register file class.
void setNumPinnedWritesToComplete(int numWrites)
bool hasFreeVecRegs() const
Checks if there are any free vector registers.
SimpleFreeList intList
The list of free integer registers.
Enums::VecRegRenameMode VecMode
unsigned numFreeVecRegs() const
Returns the number of free vector registers.
RegId zeroReg
The architectural index of the zero register.
Overload hash function for BasicBlockRange type.
SimpleFreeList vecList
The following two are exclusive interfaces.
Free list for a single class of registers (e.g., integer or floating point).
Vector Register Native Elem lane.
void addRegs(InputIt first, InputIt last)
Adds a register back to the free list.
PhysRegIdPtr getVecReg()
Gets a free vector register.
::DummyVecRegContainer VecRegContainer
int getNumPinnedWrites() const
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() ...
PhysRegIdPtr getVecElem()
Gets a free vector elemenet register.
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 ...
SimpleFreeList vecElemList
The list of free vector element registers.
FreeList class that simply holds the list of free integer and floating point registers.
SimpleFreeList ccList
The list of free condition-code registers.
void decrNumPinnedWrites()
std::pair< PhysRegIdPtr, PhysRegIdPtr > RenameInfo
Pair of a physical register and a physical register.
void switchMode(VecMode newVecMode)
Set vector mode to Full or Elem.
const PhysRegIndex & flatIndex() const
Flat index accessor.
RegIndex flatIndex() const
Index flattening.
void init(PhysRegFile *_regFile, RegIndex _intZeroReg, RegIndex _floatZeroReg, UnifiedFreeList *freeList, VecMode _mode)
Initializes rename map with given parameters.
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.
void switchFreeList(UnifiedFreeList *freeList)
Switch freeList of registers from Full to Elem or vicevers depending on vecMode (vector renaming mode...
PhysRegIdPtr getReg()
Get the next available register from the free list.
constexpr unsigned NumVecElemPerVecReg
unsigned numFreeVecElems() const
Returns the number of free vector registers.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
bool isZeroReg() const
Check if this is the zero register.
bool hasFreeVecElems() const
Checks if there are any free vector registers.