diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-01-30 02:35:32 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-01-30 02:35:32 +0000 |
| commit | cea117d2de0bfe422641e2ada4fef160e099a6b4 (patch) | |
| tree | c053fede929969535ad2a41bb3b5023c473df2f1 /lib/Target/ARM/ARMAsmPrinter.cpp | |
| parent | d1b2c1e88fe4a7728ca9739b0f1c6fd90a19c5fd (diff) | |
Change the operand orders to t_addrmode_s* to make it easier to morph
instructions that use these address modes to instructions that use
t_addrmode_sp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmPrinter.cpp')
| -rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 7e95c9c36a..b73c4109e5 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -523,7 +523,8 @@ void ARMAsmPrinter::printThumbAddrModeRI5Operand(const MachineInstr *MI, int Op, unsigned Scale) { const MachineOperand &MO1 = MI->getOperand(Op); - const MachineOperand &MO2 = MI->getOperand(Op+2); + const MachineOperand &MO2 = MI->getOperand(Op+1); + const MachineOperand &MO3 = MI->getOperand(Op+2); if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right. printOperand(MI, Op); @@ -531,7 +532,9 @@ ARMAsmPrinter::printThumbAddrModeRI5Operand(const MachineInstr *MI, int Op, } O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; - if (unsigned ImmOffs = MO2.getImm()) { + if (MO3.getReg()) + O << ", " << TM.getRegisterInfo()->get(MO3.getReg()).Name; + else if (unsigned ImmOffs = MO2.getImm()) { O << ", #" << ImmOffs; if (Scale > 1) O << " * " << Scale; @@ -541,24 +544,15 @@ ARMAsmPrinter::printThumbAddrModeRI5Operand(const MachineInstr *MI, int Op, void ARMAsmPrinter::printThumbAddrModeS1Operand(const MachineInstr *MI, int Op) { - if (MI->getOperand(Op+1).getReg()) - printThumbAddrModeRROperand(MI, Op); - else - printThumbAddrModeRI5Operand(MI, Op, 1); + printThumbAddrModeRI5Operand(MI, Op, 1); } void ARMAsmPrinter::printThumbAddrModeS2Operand(const MachineInstr *MI, int Op) { - if (MI->getOperand(Op+1).getReg()) - printThumbAddrModeRROperand(MI, Op); - else - printThumbAddrModeRI5Operand(MI, Op, 2); + printThumbAddrModeRI5Operand(MI, Op, 2); } void ARMAsmPrinter::printThumbAddrModeS4Operand(const MachineInstr *MI, int Op) { - if (MI->getOperand(Op+1).getReg()) - printThumbAddrModeRROperand(MI, Op); - else - printThumbAddrModeRI5Operand(MI, Op, 4); + printThumbAddrModeRI5Operand(MI, Op, 4); } void ARMAsmPrinter::printThumbAddrModeSPOperand(const MachineInstr *MI,int Op) { |
