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

Change subject: cpu: Revamp the RegId << operator.
......................................................................

cpu: Revamp the RegId << operator.

Now that we have a pointer to the actual RegClass the RegId is
associated with, we can use it's regName method to pretty print the
RegId for us. This gets rid of the redundant print method for RegId.

Also, replace the default register printing method with the
implementation in the << operator, which is more descriptive.

Change-Id: I00e93032ddea77e167ca13e54b370de7210f1a2b
---
M src/cpu/reg_class.cc
M src/cpu/reg_class.hh
2 files changed, 2 insertions(+), 2 deletions(-)



diff --git a/src/cpu/reg_class.cc b/src/cpu/reg_class.cc
index 57a489a..3a1c137 100644
--- a/src/cpu/reg_class.cc
+++ b/src/cpu/reg_class.cc
@@ -50,7 +50,7 @@
 std::string
 RegClassOps::regName(const RegId &id) const
 {
-    return csprintf("r%d", id.index());
+    return csprintf("%s[%d]", id.className(), id.index());
 }

 std::string
diff --git a/src/cpu/reg_class.hh b/src/cpu/reg_class.hh
index 7be8988..052941b 100644
--- a/src/cpu/reg_class.hh
+++ b/src/cpu/reg_class.hh
@@ -222,7 +222,7 @@
     friend std::ostream&
     operator<<(std::ostream& os, const RegId& rid)
     {
-        return os << rid.className() << "{" << rid.index() << "}";
+        return os << rid.regClass().regName(rid);
     }
 };


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49808
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: I00e93032ddea77e167ca13e54b370de7210f1a2b
Gerrit-Change-Number: 49808
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
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