summaryrefslogtreecommitdiff
path: root/src/cpu/o3/free_list.hh
diff options
context:
space:
mode:
authorYasuko Eckert <yasuko.eckert@amd.com>2013-10-15 14:22:44 -0400
committerYasuko Eckert <yasuko.eckert@amd.com>2013-10-15 14:22:44 -0400
commit2c293823aa7cb6d2cac4c0ff35e2023ff132a8f2 (patch)
tree040fdd5bad814d7cb7ee40934974d2b38b28d67a /src/cpu/o3/free_list.hh
parent552622184752dc798bc81f9b0b395db68aee9511 (diff)
downloadgem5-2c293823aa7cb6d2cac4c0ff35e2023ff132a8f2.tar.xz
cpu: add a condition-code register class
Add a third register class for condition codes, in parallel with the integer and FP classes. No ISAs use the CC class at this point though.
Diffstat (limited to 'src/cpu/o3/free_list.hh')
-rw-r--r--src/cpu/o3/free_list.hh24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/cpu/o3/free_list.hh b/src/cpu/o3/free_list.hh
index 3919d0afb..aa805e26e 100644
--- a/src/cpu/o3/free_list.hh
+++ b/src/cpu/o3/free_list.hh
@@ -106,6 +106,9 @@ class UnifiedFreeList
/** The list of free floating point registers. */
SimpleFreeList floatList;
+ /** The list of free condition-code registers. */
+ SimpleFreeList ccList;
+
/**
* The register file object is used only to distinguish integer
* from floating-point physical register indices.
@@ -133,12 +136,18 @@ class UnifiedFreeList
/** Gives the name of the freelist. */
std::string name() const { return _name; };
+ /** Returns a pointer to the condition-code free list */
+ SimpleFreeList *getCCList() { return &ccList; }
+
/** Gets a free integer register. */
PhysRegIndex getIntReg() { return intList.getReg(); }
/** Gets a free fp register. */
PhysRegIndex getFloatReg() { return floatList.getReg(); }
+ /** Gets a free cc register. */
+ PhysRegIndex getCCReg() { return ccList.getReg(); }
+
/** Adds a register back to the free list. */
void addReg(PhysRegIndex freed_reg);
@@ -148,17 +157,26 @@ class UnifiedFreeList
/** Adds a fp register back to the free list. */
void addFloatReg(PhysRegIndex freed_reg) { floatList.addReg(freed_reg); }
+ /** Adds a cc register back to the free list. */
+ void addCCReg(PhysRegIndex freed_reg) { ccList.addReg(freed_reg); }
+
/** Checks if there are any free integer registers. */
bool hasFreeIntRegs() const { return intList.hasFreeRegs(); }
/** Checks if there are any free fp registers. */
bool hasFreeFloatRegs() const { return floatList.hasFreeRegs(); }
+ /** Checks if there are any free cc registers. */
+ bool hasFreeCCRegs() const { return ccList.hasFreeRegs(); }
+
/** Returns the number of free integer registers. */
unsigned numFreeIntRegs() const { return intList.numFreeRegs(); }
/** Returns the number of free fp registers. */
unsigned numFreeFloatRegs() const { return floatList.numFreeRegs(); }
+
+ /** Returns the number of free cc registers. */
+ unsigned numFreeCCRegs() const { return ccList.numFreeRegs(); }
};
inline void
@@ -169,9 +187,11 @@ UnifiedFreeList::addReg(PhysRegIndex freed_reg)
//already in there. A bit vector or something similar would be useful.
if (regFile->isIntPhysReg(freed_reg)) {
intList.addReg(freed_reg);
- } else {
- assert(regFile->isFloatPhysReg(freed_reg));
+ } else if (regFile->isFloatPhysReg(freed_reg)) {
floatList.addReg(freed_reg);
+ } else {
+ assert(regFile->isCCPhysReg(freed_reg));
+ ccList.addReg(freed_reg);
}
// These assert conditions ensure that the number of free