Swap the order of imm and idx field for rri addrmode in order to make handling of rri and ri addrmodes common
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75937 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
index 025119c..20814d0 100644
--- a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
+++ b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
@@ -208,10 +208,10 @@
void SystemZAsmPrinter::printRRIAddrOperand(const MachineInstr *MI, int OpNum,
const char* Modifier) {
const MachineOperand &Base = MI->getOperand(OpNum);
- const MachineOperand &Index = MI->getOperand(OpNum+1);
+ const MachineOperand &Index = MI->getOperand(OpNum+2);
// Print displacement operand.
- printOperand(MI, OpNum+2);
+ printOperand(MI, OpNum+1);
// Print base operand (if any)
if (Base.getReg()) {
@@ -219,7 +219,7 @@
printOperand(MI, OpNum);
if (Index.getReg()) {
O << ',';
- printOperand(MI, OpNum+1);
+ printOperand(MI, OpNum+2);
}
O << ')';
} else