Teach the addressing mode stuff to fold "%lo" into 'ri' addressing modes,
[oota-llvm.git] / lib / Target / Sparc / SparcAsmPrinter.cpp
index 592588bdbe221f54445a9d0d1792b41dcb7792bc..ea4971c995e618477c319a22bfb70952ce3332cd 100644 (file)
@@ -186,7 +186,13 @@ void SparcV8AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
 void SparcV8AsmPrinter::printMemOperand(const MachineInstr *MI, int opNum) {
   printOperand(MI, opNum);
   O << "+";
-  printOperand(MI, opNum+1);
+  if (MI->getOperand(opNum+1).getType() == MachineOperand::MO_GlobalAddress) {
+    O << "%lo(";
+    printOperand(MI, opNum+1);
+    O << ")";
+  } else {
+    printOperand(MI, opNum+1);
+  }
 }