ARM: Add base classes suitable for the REV* instructions.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:05 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:05 +0000 (12:58 -0500)
src/arch/arm/insts/misc.cc
src/arch/arm/insts/misc.hh
src/arch/arm/isa/templates/misc.isa

index 588586e00f8675040d1a8a9190d1b197819adaa3..3547c67124ec151869b3a1c31f8e0f484dfddbba 100644 (file)
@@ -142,3 +142,14 @@ MsrRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
     printReg(ss, op1);
     return ss.str();
 }
+
+std::string
+RevOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+{
+    std::stringstream ss;
+    printMnemonic(ss);
+    printReg(ss, dest);
+    ss << ", ";
+    printReg(ss, op1);
+    return ss.str();
+}
index 105a90c37a69d99579e43c1462c24b064052a1f9..ae8d20e79347dab58426228e5399408049607bf8 100644 (file)
@@ -94,4 +94,18 @@ class MsrRegOp : public MsrBase
     std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
 };
 
+class RevOp : public PredOp
+{
+  protected:
+    IntRegIndex dest;
+    IntRegIndex op1;
+
+    RevOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass,
+          IntRegIndex _dest, IntRegIndex _op1) :
+        PredOp(mnem, _machInst, __opClass), dest(_dest), op1(_op1)
+    {}
+
+    std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+};
+
 #endif
index a19228b3b310d049a5ec45ea21585868d7a529d1..566d0a8dd9ea49d149e5ea2be113ac09ac493473 100644 (file)
@@ -98,3 +98,24 @@ def template MsrImmConstructor {{
         %(constructor)s;
     }
 }};
+
+def template RevOpDeclare {{
+class %(class_name)s : public %(base_class)s
+{
+  protected:
+    public:
+        // Constructor
+        %(class_name)s(ExtMachInst machInst,
+                       IntRegIndex _dest, IntRegIndex _op1);
+        %(BasicExecDeclare)s
+};
+}};
+
+def template RevOpConstructor {{
+    inline %(class_name)s::%(class_name)s(ExtMachInst machInst,
+                                          IntRegIndex _dest, IntRegIndex _op1)
+        : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s, _dest, _op1)
+    {
+        %(constructor)s;
+    }
+}};