ARM: Decode the 16 bit thumb versions of the REV* instructions.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:06 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:06 +0000 (12:58 -0500)
src/arch/arm/isa/formats/data.isa

index b1baca16b8fd558d8c2746ec261cadda0201ce14..217f1364b1ac5a7233144d6c8c51ad08248b4b44 100644 (file)
@@ -649,15 +649,19 @@ def format Thumb16Misc() {{
                             (bits(machInst, 7, 3) << 1),
                             (IntRegIndex)(uint32_t)bits(machInst, 2, 0));
           case 0xa:
-            switch (bits(machInst, 7, 5)) {
-              case 0x0:
-                return new WarnUnimplemented("rev", machInst);
-              case 0x1:
-                return new WarnUnimplemented("rev16", machInst);
-              case 0x3:
-                return new WarnUnimplemented("revsh", machInst);
-              default:
-                break;
+            {
+                IntRegIndex rd = (IntRegIndex)(uint32_t)bits(machInst, 2, 0);
+                IntRegIndex rm = (IntRegIndex)(uint32_t)bits(machInst, 5, 3);
+                switch (bits(machInst, 7, 6)) {
+                  case 0x0:
+                    return new Rev(machInst, rd, rm);
+                  case 0x1:
+                    return new Rev16(machInst, rd, rm);
+                  case 0x3:
+                    return new Revsh(machInst, rd, rm);
+                  default:
+                    break;
+                }
             }
             break;
           case 0xb: