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

Change subject: arch: Make the DummyVec... types the same size as RegVal.
......................................................................

arch: Make the DummyVec... types the same size as RegVal.

This makes RegClass-es which don't specify a size work with the Dummy
types of VecRegContainer and VecPredRegContainer, and avoids having to
set up extra plumbing in ISAs that don't need it.

Change-Id: I059306a54b2a9cf7a22258a01e0821e370f0590a
---
M src/arch/generic/vec_pred_reg.hh
M src/arch/generic/vec_reg.hh
2 files changed, 55 insertions(+), 2 deletions(-)



diff --git a/src/arch/generic/vec_pred_reg.hh b/src/arch/generic/vec_pred_reg.hh
index ad6bcce..fc0137b 100644
--- a/src/arch/generic/vec_pred_reg.hh
+++ b/src/arch/generic/vec_pred_reg.hh
@@ -394,7 +394,27 @@
/// Dummy type aliases and constants for architectures that do not implement
 /// vector predicate registers.
 /// @{
-using DummyVecPredRegContainer = VecPredRegContainer<8, false>;
+struct DummyVecPredRegContainer
+{
+    RegVal filler = 0;
+ bool operator == (const DummyVecPredRegContainer &d) const { return true; } + bool operator != (const DummyVecPredRegContainer &d) const { return true; }
+};
+template <>
+struct ParseParam<DummyVecPredRegContainer>
+{
+    static bool
+    parse(const std::string &s, DummyVecPredRegContainer &value)
+    {
+        return false;
+    }
+};
+static_assert(sizeof(DummyVecPredRegContainer) == sizeof(RegVal));
+static inline std::ostream &
+operator<<(std::ostream &os, const DummyVecPredRegContainer &d)
+{
+    return os;
+}
 /// @}

 } // namespace gem5
diff --git a/src/arch/generic/vec_reg.hh b/src/arch/generic/vec_reg.hh
index 99d67f3..6dada8f 100644
--- a/src/arch/generic/vec_reg.hh
+++ b/src/arch/generic/vec_reg.hh
@@ -263,7 +263,27 @@
  * vector registers.
  */
 /** @{ */
-using DummyVecRegContainer = VecRegContainer<8>;
+struct DummyVecRegContainer
+{
+    RegVal filler = 0;
+    bool operator == (const DummyVecRegContainer &d) const { return true; }
+    bool operator != (const DummyVecRegContainer &d) const { return true; }
+};
+template <>
+struct ParseParam<DummyVecRegContainer>
+{
+    static bool
+    parse(const std::string &s, DummyVecRegContainer &value)
+    {
+        return false;
+    }
+};
+static_assert(sizeof(DummyVecRegContainer) == sizeof(RegVal));
+static inline std::ostream &
+operator<<(std::ostream &os, const DummyVecRegContainer &d)
+{
+    return os;
+}
 /** @} */

 } // namespace gem5

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56929
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: I059306a54b2a9cf7a22258a01e0821e370f0590a
Gerrit-Change-Number: 56929
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