Fix the issue that r143552 was trying to address the _right_ way. One-register lists are legal on LDM/STM instructions, but we should not print the PUSH/POP aliases when they appear. This fixes round tripping on this instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2011-11-02 18:03:14 +00:00
parent dba9a17f9a
commit 81550dc0a8
2 changed files with 10 additions and 2 deletions

View File

@ -101,7 +101,9 @@ void ARMInstPrinter::printInst(const MCInst *MI, raw_ostream &O,
// A8.6.123 PUSH // A8.6.123 PUSH
if ((Opcode == ARM::STMDB_UPD || Opcode == ARM::t2STMDB_UPD) && if ((Opcode == ARM::STMDB_UPD || Opcode == ARM::t2STMDB_UPD) &&
MI->getOperand(0).getReg() == ARM::SP) { MI->getOperand(0).getReg() == ARM::SP &&
MI->getNumOperands() > 5) {
// Should only print PUSH if there are at least two registers in the list.
O << '\t' << "push"; O << '\t' << "push";
printPredicateOperand(MI, 2, O); printPredicateOperand(MI, 2, O);
if (Opcode == ARM::t2STMDB_UPD) if (Opcode == ARM::t2STMDB_UPD)
@ -122,7 +124,9 @@ void ARMInstPrinter::printInst(const MCInst *MI, raw_ostream &O,
// A8.6.122 POP // A8.6.122 POP
if ((Opcode == ARM::LDMIA_UPD || Opcode == ARM::t2LDMIA_UPD) && if ((Opcode == ARM::LDMIA_UPD || Opcode == ARM::t2LDMIA_UPD) &&
MI->getOperand(0).getReg() == ARM::SP) { MI->getOperand(0).getReg() == ARM::SP &&
MI->getNumOperands() > 5) {
// Should only print POP if there are at least two registers in the list.
O << '\t' << "pop"; O << '\t' << "pop";
printPredicateOperand(MI, 2, O); printPredicateOperand(MI, 2, O);
if (Opcode == ARM::t2LDMIA_UPD) if (Opcode == ARM::t2LDMIA_UPD)

View File

@ -317,3 +317,7 @@
# CHECK: stc2l p0, c0, [r2], #-96 # CHECK: stc2l p0, c0, [r2], #-96
0x18 0x0 0x62 0xfc 0x18 0x0 0x62 0xfc
# CHECK: ldmgt sp!, {r9}
0x00 0x02 0xbd 0xc8