ARM: Hook up 16 bit thumb load/store multiple.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:02 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:02 +0000 (12:58 -0500)
src/arch/arm/isa/decoder/thumb.isa
src/arch/arm/isa/formats/macromem.isa

index 56dbcfe2890173849dfdacbfc8267fef36db33cb..7fb8dd8545257eb78fe89a0621879d1ff919040f 100644 (file)
             }
         }
         0x6: decode TOPCODE_12_11 {
-            0x0: WarnUnimpl::stm(); // also stmia, stmea
-            0x1: WarnUnimpl::ldm(); // also ldmia, ldmea
+            0x0, 0x1: Thumb16MacroMem::thumb16MacroMem();
             default: decode TOPCODE_11_8 {
                 0xe: WarnUnimpl::undefined(); // permanently undefined
                 0xf: WarnUnimpl::svc(); // formerly swi
index 95b7ccd6a9b1d26d70c35a457771d2441566838e..98505be840c59821587f90c47bc790e09a4f9e00 100644 (file)
@@ -43,3 +43,16 @@ def format ArmMacroMem() {{
                       PSRUSER, WRITEBACK, LOADOP, machInst.regList);
     '''
 }};
+
+def format Thumb16MacroMem() {{
+    decode_block = '''
+    {
+        const IntRegIndex rn = (IntRegIndex)(uint32_t)bits(machInst, 10, 8);
+        const bool load = (bits(machInst, 11) == 1);
+        const uint32_t regList = bits(machInst, 7, 0);
+        const bool writeback = (!load || bits(regList, rn) == 0);
+        return new LdmStm(machInst, rn, true, true, false,
+                          writeback, load, regList);
+    }
+    '''
+}};