mips: Convert MIPS to use local register index storage.
authorGabe Black <gabe.black@gmail.com>
Sun, 1 Nov 2020 12:23:01 +0000 (04:23 -0800)
committerGabe Black <gabe.black@gmail.com>
Tue, 24 Nov 2020 06:25:23 +0000 (06:25 +0000)
Change-Id: Ib691f3dd666c0877fc53b2f50dbaaf7bb4a6905b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36880
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/mips/isa/formats/basic.isa
src/arch/mips/isa/formats/mem.isa

index 17d08ef3b989aea2804040908c29421d2c827ba2..765dae275540743dcaa108372643cc710ff9217d 100644 (file)
@@ -35,19 +35,23 @@ def template BasicDeclare {{
          */
         class %(class_name)s : public %(base_class)s
         {
+          private:
+            %(reg_idx_arr_decl)s;
           public:
-                /// Constructor.
-                %(class_name)s(MachInst machInst);
-                Fault execute(ExecContext *,
-                              Trace::InstRecord *) const override;
+            /// Constructor.
+            %(class_name)s(MachInst machInst);
+            Fault execute(ExecContext *,
+                          Trace::InstRecord *) const override;
         };
 }};
 
 // Basic instruction class constructor template.
 def template BasicConstructor {{
-        %(class_name)s::%(class_name)s(MachInst machInst)  : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
+        %(class_name)s::%(class_name)s(MachInst machInst) :
+            %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
         {
-                %(constructor)s;
+            %(set_reg_idx_arr)s;
+            %(constructor)s;
         }
 }};
 
index a31485dd6abe654e0bacf839bbcaaf2ec7ab1959..ac56803c06a52c01ceb2ef2da86ce71fecca7814 100644 (file)
@@ -129,8 +129,10 @@ def template LoadStoreDeclare {{
      */
     class %(class_name)s : public %(base_class)s
     {
-      public:
+      private:
+        %(reg_idx_arr_decl)s;
 
+      public:
         /// Constructor.
         %(class_name)s(ExtMachInst machInst);
 
@@ -146,6 +148,7 @@ def template LoadStoreConstructor {{
     %(class_name)s::%(class_name)s(ExtMachInst machInst)
          : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
     {
+        %(set_reg_idx_arr)s;
         %(constructor)s;
     }
 }};