ARM: Decode the usad8 and usada8 instructions.

This commit is contained in:
Gabe Black
2010-06-02 12:58:07 -05:00
parent 8f566e5ee3
commit 00baeb742d
3 changed files with 19 additions and 6 deletions

View 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();
}
}
}

View File

@@ -35,6 +35,22 @@
//
// 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,

View 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);
}
}
}