ARM: Move the longer MemoryReg::printoffset function in mem.hh into the cc file.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:18 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:18 +0000 (12:58 -0500)
src/arch/arm/insts/mem.cc
src/arch/arm/insts/mem.hh

index ccac3a25d028ae067c438face3119691adba2e19..3dde0aa35dbfb40c811ddd7bb31e0b7ea7bc9e12 100644 (file)
@@ -48,6 +48,42 @@ using namespace std;
 namespace ArmISA
 {
 
+void
+MemoryReg::printOffset(std::ostream &os) const
+{
+    if (!add)
+        os << "-";
+    printReg(os, index);
+    if (shiftType != LSL || shiftAmt != 0) {
+        switch (shiftType) {
+          case LSL:
+            ccprintf(os, " LSL #%d", shiftAmt);
+            break;
+          case LSR:
+            if (shiftAmt == 0) {
+                ccprintf(os, " LSR #%d", 32);
+            } else {
+                ccprintf(os, " LSR #%d", shiftAmt);
+            }
+            break;
+          case ASR:
+            if (shiftAmt == 0) {
+                ccprintf(os, " ASR #%d", 32);
+            } else {
+                ccprintf(os, " ASR #%d", shiftAmt);
+            }
+            break;
+          case ROR:
+            if (shiftAmt == 0) {
+                ccprintf(os, " RRX");
+            } else {
+                ccprintf(os, " ROR #%d", shiftAmt);
+            }
+            break;
+        }
+    }
+}
+
 string
 Swap::generateDisassembly(Addr pc, const SymbolTable *symtab) const
 {
index 50f718b9995ed5c80d83bb372733191d3b0b304b..609afa9aa3832271e276a8057b1f9ddebbdaac07 100644 (file)
@@ -246,41 +246,7 @@ class MemoryReg : public Memory
           shiftAmt(_shiftAmt), shiftType(_shiftType), index(_index)
     {}
 
-    void
-    printOffset(std::ostream &os) const
-    {
-        if (!add)
-            os << "-";
-        printReg(os, index);
-        if (shiftType != LSL || shiftAmt != 0) {
-            switch (shiftType) {
-              case LSL:
-                ccprintf(os, " LSL #%d", shiftAmt);
-                break;
-              case LSR:
-                if (shiftAmt == 0) {
-                    ccprintf(os, " LSR #%d", 32);
-                } else {
-                    ccprintf(os, " LSR #%d", shiftAmt);
-                }
-                break;
-              case ASR:
-                if (shiftAmt == 0) {
-                    ccprintf(os, " ASR #%d", 32);
-                } else {
-                    ccprintf(os, " ASR #%d", shiftAmt);
-                }
-                break;
-              case ROR:
-                if (shiftAmt == 0) {
-                    ccprintf(os, " RRX");
-                } else {
-                    ccprintf(os, " ROR #%d", shiftAmt);
-                }
-                break;
-            }
-        }
-    }
+    void printOffset(std::ostream &os) const;
 };
 
 class MemoryDReg : public MemoryReg