44 #ifndef __CPU_O3_FREE_LIST_HH__ 45 #define __CPU_O3_FREE_LIST_HH__ 55 #include "debug/FreeList.hh" 79 template<
class InputIt>
82 std::for_each(first, last, [
this](
typename InputIt::value_type&
reg) {
83 this->freeRegs.push(®);
90 assert(!freeRegs.empty());
171 std::string
name()
const {
return _name; };
198 template<
class InputIt>
199 void addRegs(InputIt first, InputIt last);
212 vecElemList.
addReg(freed_reg);
258 template<
class InputIt>
267 first->classValue() != (last-1)->classValue(),
268 "Attempt to add mixed type regs: %s and %s",
270 (last-1)->className());
271 switch (first->classValue()) {
273 intList.addRegs(first, last);
276 floatList.addRegs(first, last);
279 vecList.addRegs(first, last);
282 vecElemList.addRegs(first, last);
285 predList.addRegs(first, last);
288 ccList.addRegs(first, last);
291 panic(
"Unexpected RegClass (%s)",
300 DPRINTF(FreeList,
"Freeing register %i (%s).\n", freed_reg->
index(),
306 intList.addReg(freed_reg);
309 floatList.addReg(freed_reg);
312 vecList.addReg(freed_reg);
315 vecElemList.addReg(freed_reg);
318 predList.addReg(freed_reg);
321 ccList.addReg(freed_reg);
324 panic(
"Unexpected RegClass (%s)",
342 #endif // __CPU_O3_FREE_LIST_HH__ #define panic(...)
This implements a cprintf based panic() function.
SimpleFreeList predList
The list of free predicate registers.
std::queue< PhysRegIdPtr > freeRegs
The actual free list.
SimpleFreeList floatList
The list of free floating point registers.
bool hasFreeRegs() const
True iff there are free registers on the list.
Simple physical register file class.
std::string name() const
Gives the name of the freelist.
bool hasFreeVecRegs() const
Checks if there are any free vector registers.
SimpleFreeList intList
The list of free integer registers.
PhysRegIdPtr getIntReg()
Gets a free integer register.
unsigned numFreeVecRegs() const
Returns the number of free vector registers.
PhysRegIdPtr getCCReg()
Gets a free cc register.
bool hasFreeCCRegs() const
Checks if there are any free cc registers.
SimpleFreeList * getCCList()
Returns a pointer to the condition-code free list.
SimpleFreeList vecList
The following two are exclusive interfaces.
bool hasFreeFloatRegs() const
Checks if there are any free fp registers.
Free list for a single class of registers (e.g., integer or floating point).
Vector Register Native Elem lane.
void addReg(PhysRegIdPtr freed_reg)
Adds a register back to the free list.
void addRegs(InputIt first, InputIt last)
Adds a register back to the free list.
PhysRegIdPtr getVecReg()
Gets a free vector register.
void addVecElem(PhysRegIdPtr freed_reg)
Adds a vector element register back to the free list.
void addRegs(InputIt first, InputIt last)
Add physical registers to the free list.
void addCCReg(PhysRegIdPtr freed_reg)
Adds a cc register back to the free list.
Unified register rename map for all classes of registers.
void addFloatReg(PhysRegIdPtr freed_reg)
Adds a fp register back to the free list.
PhysRegFile * regFile
The register file object is used only to distinguish integer from floating-point physical register in...
bool hasFreeIntRegs() const
Checks if there are any free integer registers.
void addIntReg(PhysRegIdPtr freed_reg)
Adds an integer register back to the free list.
PhysRegIdPtr getVecElem()
Gets a free vector elemenet register.
SimpleFreeList vecElemList
The list of free vector element registers.
void addReg(PhysRegIdPtr reg)
Add a physical register to the free list.
unsigned numFreeRegs() const
Return the number of free registers on the list.
unsigned numFreeCCRegs() const
Returns the number of free cc registers.
const std::string _name
The object name, for DPRINTF.
bool hasFreeVecPredRegs() const
Checks if there are any free predicate registers.
unsigned numFreeFloatRegs() const
Returns the number of free fp registers.
FreeList class that simply holds the list of free integer and floating point registers.
SimpleFreeList ccList
The list of free condition-code registers.
PhysRegIdPtr getFloatReg()
Gets a free fp register.
const RegClass & classValue() const
Class accessor.
unsigned numFreeIntRegs() const
Returns the number of free integer registers.
unsigned numFreeVecPredRegs() const
Returns the number of free predicate registers.
const RegIndex & index() const
Index accessors.
PhysRegIdPtr getReg()
Get the next available register from the free list.
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 hasFreeVecElems() const
Checks if there are any free vector registers.
PhysRegIdPtr getVecPredReg()
Gets a free predicate register.
void addVecReg(PhysRegIdPtr freed_reg)
Adds a vector register back to the free list.
const char * className() const
Return a const char* with the register class name.
void addVecPredReg(PhysRegIdPtr freed_reg)
Adds a predicate register back to the free list.