arm: alias LDR instruction with operands '[sp], 4' to POP. suggested by Pancake

_v3_old
Nguyen Anh Quynh 10 years ago
parent a2934a7b6a
commit 3caf837c9a
  1. 8
      arch/ARM/ARMInstPrinter.c

@ -469,8 +469,11 @@ void ARM_printInst(MCInst *MI, SStream *O, void *Info)
break;
case ARM_LDR_POST_IMM:
if (MCOperand_getReg(MCInst_getOperand(MI, 2)) == ARM_SP &&
MCOperand_getImm(MCInst_getOperand(MI, 4)) == 4) {
if (MCOperand_getReg(MCInst_getOperand(MI, 2)) == ARM_SP) {
MCOperand *MO2 = MCInst_getOperand(MI, 4);
if ((getAM2Op((unsigned int)MCOperand_getImm(MO2)) == ARM_AM_add &&
getAM2Offset((unsigned int)MCOperand_getImm(MO2)) == 4) ||
MCOperand_getImm(MO2) == 4) {
SStream_concat0(O, "pop");
MCInst_setOpcodePub(MI, ARM_INS_POP);
printPredicateOperand(MI, 5, O);
@ -484,6 +487,7 @@ void ARM_printInst(MCInst *MI, SStream *O, void *Info)
SStream_concat0(O, "}");
return;
}
}
break;
// A8.6.355 VPUSH

Loading…
Cancel
Save