Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/49714 )

 (

52 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
 )Change subject: cpu-o3: Make canRename extract register counts locally.
......................................................................

cpu-o3: Make canRename extract register counts locally.

This avoids having an argument for each register type, which prevents
building in an assumption about what register types exist.

Change-Id: I81473db51d930c757f4e0b24e6f3017a4965a721
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49714
Reviewed-by: Giacomo Travaglini <[email protected]>
Maintainer: Giacomo Travaglini <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/o3/rename.cc
M src/cpu/o3/rename_map.cc
M src/cpu/o3/rename_map.hh
3 files changed, 31 insertions(+), 18 deletions(-)

Approvals:
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/cpu/o3/rename.cc b/src/cpu/o3/rename.cc
index d6c4efe..e2b2d14 100644
--- a/src/cpu/o3/rename.cc
+++ b/src/cpu/o3/rename.cc
@@ -656,12 +656,7 @@

         // Check here to make sure there are enough destination registers
         // to rename to.  Otherwise block.
-        if (!renameMap[tid]->canRename(inst->numDestRegs(IntRegClass),
-                                       inst->numDestRegs(FloatRegClass),
-                                       inst->numDestRegs(VecRegClass),
-                                       inst->numDestRegs(VecElemClass),
-                                       inst->numDestRegs(VecPredRegClass),
-                                       inst->numDestRegs(CCRegClass))) {
+        if (!renameMap[tid]->canRename(inst)) {
             DPRINTF(Rename,
                     "Blocking due to "
                     " lack of free physical registers to rename to.\n");
diff --git a/src/cpu/o3/rename_map.cc b/src/cpu/o3/rename_map.cc
index 30e4684..7a18ab5 100644
--- a/src/cpu/o3/rename_map.cc
+++ b/src/cpu/o3/rename_map.cc
@@ -44,6 +44,7 @@
 #include <vector>

 #include "arch/vecregs.hh"
+#include "cpu/o3/dyn_inst.hh"
 #include "cpu/reg_class.hh"
 #include "debug/Rename.hh"

@@ -122,5 +123,16 @@
     ccMap.init(regClasses.at(CCRegClass), &(freeList->ccList));
 }

+bool
+UnifiedRenameMap::canRename(DynInstPtr inst) const
+{
+    return inst->numDestRegs(IntRegClass) <= intMap.numFreeEntries() &&
+        inst->numDestRegs(FloatRegClass) <= floatMap.numFreeEntries() &&
+        inst->numDestRegs(VecRegClass) <= vecMap.numFreeEntries() &&
+        inst->numDestRegs(VecElemClass) <= vecElemMap.numFreeEntries() &&
+        inst->numDestRegs(VecPredRegClass) <= predMap.numFreeEntries() &&
+        inst->numDestRegs(CCRegClass) <= ccMap.numFreeEntries();
+}
+
 } // namespace o3
 } // namespace gem5
diff --git a/src/cpu/o3/rename_map.hh b/src/cpu/o3/rename_map.hh
index 0e1a6f5..e5886f1 100644
--- a/src/cpu/o3/rename_map.hh
+++ b/src/cpu/o3/rename_map.hh
@@ -47,6 +47,7 @@
 #include <vector>

 #include "arch/generic/isa.hh"
+#include "cpu/o3/dyn_inst_ptr.hh"
 #include "cpu/o3/free_list.hh"
 #include "cpu/o3/regfile.hh"
 #include "cpu/reg_class.hh"
@@ -365,18 +366,7 @@
     /**
      * Return whether there are enough registers to serve the request.
      */
-    bool
-    canRename(uint32_t intRegs, uint32_t floatRegs, uint32_t vectorRegs,
-              uint32_t vecElemRegs, uint32_t vecPredRegs,
-              uint32_t ccRegs) const
-    {
-        return intRegs <= intMap.numFreeEntries() &&
-            floatRegs <= floatMap.numFreeEntries() &&
-            vectorRegs <= vecMap.numFreeEntries() &&
-            vecElemRegs <= vecElemMap.numFreeEntries() &&
-            vecPredRegs <= predMap.numFreeEntries() &&
-            ccRegs <= ccMap.numFreeEntries();
-    }
+    bool canRename(DynInstPtr inst) const;
 };

 } // namespace o3

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49714
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I81473db51d930c757f4e0b24e6f3017a4965a721
Gerrit-Change-Number: 49714
Gerrit-PatchSet: 56
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to