Don't print [%reg + 0], just print [%reg]
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 7 Apr 2004 17:33:56 +0000 (17:33 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 7 Apr 2004 17:33:56 +0000 (17:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12759 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/SparcV8/SparcV8AsmPrinter.cpp

index e6b0a98f0341018e75fcf6e9b29fdbf47b9779a5..06e11b0057a2e2395d60f3d2349ba0ce5f255359 100644 (file)
@@ -452,8 +452,10 @@ void V8Printer::printBaseOffsetPair (const MachineInstr *MI, int i) {
   assert (MI->getOperand (i + 1).isImmediate()
     && "2nd half of base-offset pair must be immediate-value machine operand");
   int Val = (int) MI->getOperand (i + 1).getImmedValue ();
-  O << ((Val >= 0) ? " + " : " - ");
-  O << ((Val >= 0) ? Val : -Val);
+  if (Val != 0) {
+    O << ((Val >= 0) ? " + " : " - ");
+    O << ((Val >= 0) ? Val : -Val);
+  }
   O << "]";
 }
 
index e6b0a98f0341018e75fcf6e9b29fdbf47b9779a5..06e11b0057a2e2395d60f3d2349ba0ce5f255359 100644 (file)
@@ -452,8 +452,10 @@ void V8Printer::printBaseOffsetPair (const MachineInstr *MI, int i) {
   assert (MI->getOperand (i + 1).isImmediate()
     && "2nd half of base-offset pair must be immediate-value machine operand");
   int Val = (int) MI->getOperand (i + 1).getImmedValue ();
-  O << ((Val >= 0) ? " + " : " - ");
-  O << ((Val >= 0) ? Val : -Val);
+  if (Val != 0) {
+    O << ((Val >= 0) ? " + " : " - ");
+    O << ((Val >= 0) ? Val : -Val);
+  }
   O << "]";
 }