1: decode OPCODE_7 {
0x0: decode MISC_OPCODE {
0x0: ArmMsrMrs::armMsrMrs();
- 0x1: decode OPCODE {
- 0x9: ArmBx::armBx();
- 0xb: PredOp::clz({{
- Rd = ((Rm == 0) ? 32 : (31 - findMsbSet(Rm)));
- }});
- }
+ 0x1: ArmBxClz::armBxClz();
0x2: decode OPCODE {
0x9: WarnUnimpl::bxj();
}
'''
}};
-def format ArmBx() {{
+def format ArmBxClz() {{
decode_block = '''
- return new BxReg(machInst, (IntRegIndex)(uint32_t)bits(machInst, 3, 0),
- (ConditionCode)(uint32_t)machInst.condCode);
+ {
+ const IntRegIndex rm = (IntRegIndex)(uint32_t)bits(machInst, 3, 0);
+ const IntRegIndex rd = (IntRegIndex)(uint32_t)bits(machInst, 15, 12);
+ if (OPCODE == 0x9) {
+ return new BxReg(machInst, rm,
+ (ConditionCode)(uint32_t)machInst.condCode);
+ } else if (OPCODE == 0xb) {
+ return new Clz(machInst, rd, rm);
+ } else {
+ return new Unknown(machInst);
+ }
+ }
'''
}};
clzCode = '''
Dest = (Op1 == 0) ? 32 : (31 - findMsbSet(Op1));
'''
- clzIop = InstObjParams("clz", "ClzInst", "RevOp",
+ clzIop = InstObjParams("clz", "Clz", "RevOp",
{ "code": clzCode,
"predicate_test": predicateTest }, [])
header_output += RevOpDeclare.subst(clzIop)