Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/49711 )

Change subject: cpu-minor: Use the InvalidRegClass to track invalid RegIds.
......................................................................

cpu-minor: Use the InvalidRegClass to track invalid RegIds.

Use that instead of the zero register. This avoids two assumptions,
first that there is a zero register in the first place, and second that
the zero register is an integer.

It also avoids referring to the IntRegClass in non-ISA specific code.
It's very likely that all ISAs will have integer registers, but we
should not build in assumptions about what types of registers an ISA has
in general. For instance, not all ISAs have vector predicate registers,
or a scalar floating point register file.

Change-Id: I730fec90f42b90b5be7e1baddf896e18c53e8510
---
M src/cpu/minor/scoreboard.cc
1 file changed, 7 insertions(+), 9 deletions(-)



diff --git a/src/cpu/minor/scoreboard.cc b/src/cpu/minor/scoreboard.cc
index b957c3d..8c286eb 100644
--- a/src/cpu/minor/scoreboard.cc
+++ b/src/cpu/minor/scoreboard.cc
@@ -55,13 +55,8 @@

     switch (reg.classValue()) {
       case IntRegClass:
-        if (reg.index() == zeroReg) {
-            /* Don't bother with the zero register */
-            ret = false;
-        } else {
-            scoreboard_index = reg.index();
-            ret = true;
-        }
+        scoreboard_index = reg.index();
+        ret = true;
         break;
       case FloatRegClass:
         scoreboard_index = floatRegOffset + reg.index();
@@ -84,6 +79,9 @@
           /* Don't bother with Misc registers */
         ret = false;
         break;
+      case InvalidRegClass:
+        ret = false;
+        break;
       default:
         panic("Unknown register class: %d", reg.classValue());
     }
@@ -135,8 +133,8 @@
                 " regIndex: %d final numResults: %d returnCycle: %d\n",
                 *inst, index, numResults[index], returnCycle[index]);
         } else {
-            /* Use zeroReg to mark invalid/untracked dests */
-            inst->flatDestRegIdx[dest_index] = RegId(IntRegClass, zeroReg);
+            /* Use an invalid ID to mark invalid/untracked dests */
+            inst->flatDestRegIdx[dest_index] = RegId();
         }
     }
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49711
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: I730fec90f42b90b5be7e1baddf896e18c53e8510
Gerrit-Change-Number: 49711
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to