ARM: Decode the usad8 and usada8 instructions.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:07 +0000 (12:58 -0500)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 2 Jun 2010 17:58:07 +0000 (12:58 -0500)
src/arch/arm/isa/decoder/arm.isa
src/arch/arm/isa/formats/data.isa
src/arch/arm/isa/formats/mult.isa

index be3a8787aa34a8b24ceba520e00999e1bc4cbc30..fe8e1ed2e02b7040aa648acc5b86f1b77956cd09 100644 (file)
@@ -120,10 +120,7 @@ format DataOp {
             0x1: ArmPackUnpackSatReverse::armPackUnpackSatReverse();
             0x2: ArmSignedMultiplies::armSignedMultiplies();
             0x3: decode MEDIA_OPCODE {
-                0x18: decode RN {
-                    0xf: WarnUnimpl::usada8();
-                    default: WarnUnimpl::usad8();
-                }
+                0x18: ArmUsad::armUsad();
             }
         }
     }
index 2efd9c18f77b4d57e587e1bdf654e8fb7938b874..7679aa355dfca3509b93ec95b3181f19b5148340 100644 (file)
 //
 // Authors: Gabe Black
 
+def format ArmUsad() {{
+    decode_block = '''
+    {
+        const IntRegIndex rd = (IntRegIndex)(uint32_t)bits(machInst, 19, 16);
+        const IntRegIndex rn = (IntRegIndex)(uint32_t)bits(machInst, 3, 0);
+        const IntRegIndex rm = (IntRegIndex)(uint32_t)bits(machInst, 11, 8);
+        const IntRegIndex ra = (IntRegIndex)(uint32_t)bits(machInst, 15, 12);
+        if (ra == 0xf) {
+            return new Usad8(machInst, rd, rn, rm);
+        } else {
+            return new Usada8(machInst, rd, rn, rm, ra);
+        }
+    }
+    '''
+}};
+
 def format ArmDataProcReg() {{
     pclr = '''
         return new %(className)ssRegPclr(machInst, %(dest)s,
index 653abefdb6c9fd3f976ceff11d645af24fa00985..bd101374a6e82efd5d645ee1e173f1ac980fb08c 100644 (file)
@@ -267,9 +267,9 @@ def format Thumb32MulMulAccAndAbsDiff() {{
             if (op2 != 0x0) {
                 return new Unknown(machInst);
             } else if (ra == 0xf) {
-                return new WarnUnimplemented("usada8", machInst);
+                return new Usad8(machInst, rd, rn, rm);
             } else {
-                return new WarnUnimplemented("usad8", machInst);
+                return new Usada8(machInst, rd, rn, rm, ra);
             }
         }
     }