Merge pull request #2111 from Rot127/arm-pop-alias

Add pop alias instruction for `t2LDR_POST`
This commit is contained in:
Wu ChenXu 2023-07-22 23:17:12 +08:00 committed by GitHub
commit 8b6c3e2a56
2 changed files with 21 additions and 3 deletions

View File

@ -212,9 +212,9 @@ static void printInst(MCInst *MI, SStream *O, void *info)
break;
case ARM_LDR_POST_IMM:
if (MCOperand_getReg(MCInst_getOperand(MI, (2))) == ARM_SP &&
ARM_AM_getAM2Offset(MCOperand_getImm(
MCInst_getOperand(MI, (4)))) == 4) {
if ((MCOperand_getReg(MCInst_getOperand(MI, (2))) == ARM_SP) &&
((ARM_AM_getAM2Offset(MCOperand_getImm(
MCInst_getOperand(MI, (4)))) == 4))) {
SStream_concat0(O, "pop");
printPredicateOperand(MI, 5, O);
SStream_concat0(O, " {");
@ -223,6 +223,18 @@ static void printInst(MCInst *MI, SStream *O, void *info)
return;
} else
break;
case ARM_t2LDR_POST:
if ((MCOperand_getReg(MCInst_getOperand(MI, (2))) == ARM_SP) &&
(Opcode == ARM_t2LDR_POST &&
(MCOperand_getImm(MCInst_getOperand(MI, (3))) == 4))) {
SStream_concat0(O, "pop");
printPredicateOperand(MI, 4, O);
SStream_concat0(O, " {");
printOperand(MI, 0, O);
SStream_concat0(O, "}");
return;
} else
break;
// A8.6.355 VPUSH
case ARM_VSTMSDB_UPD:

View File

@ -365,6 +365,12 @@ static void ARM_add_not_defined_ops(MCInst *MI)
MCOperand_getImm(MCInst_getOperand(MI, (4)))) == 4)
MI->flat_insn->id = ARM_INS_POP;
break;
case ARM_t2LDR_POST:
if ((MCOperand_getReg(MCInst_getOperand(MI, (2))) == ARM_SP) &&
(Opcode == ARM_t2LDR_POST &&
(MCOperand_getImm(MCInst_getOperand(MI, (3))) == 4)))
MI->flat_insn->id = ARM_INS_POP;
break;
case ARM_VSTMSDB_UPD:
case ARM_VSTMDDB_UPD:
if (MCOperand_getReg(MCInst_getOperand(MI, (0))) == ARM_SP)