cpu: Add an StaticInst accessor for setting register index storage.
authorGabe Black <gabe.black@gmail.com>
Sun, 1 Nov 2020 11:46:22 +0000 (03:46 -0800)
committerGabe Black <gabe.black@gmail.com>
Thu, 19 Nov 2020 02:51:29 +0000 (02:51 +0000)
Change-Id: I66adccd8851f035b5d61ace9153ae7acc57403ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36877
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/static_inst.hh

index 22e55ca406fa9c3e16a42bc4d6fd93fc285cf0e4..e5d9753fea8ae5f7f0a99d805ab4782057c8e050 100644 (file)
@@ -270,6 +270,19 @@ class StaticInst : public RefCounted, public StaticInstFlags
 
   protected:
 
+    /**
+     * Set the pointers which point to the arrays of source and destination
+     * register indices. These will be defined in derived classes which know
+     * what size they need to be, and installed here so they can be accessed
+     * with the base class accessors.
+     */
+    void
+    setRegIdxArrays(RegIdArrayPtr src, RegIdArrayPtr dest)
+    {
+        _srcRegIdxPtr = src;
+        _destRegIdxPtr = dest;
+    }
+
     /**
      * Base mnemonic (e.g., "add").  Used by generateDisassembly()
      * methods.  Also useful to readily identify instructions from