aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Sparc
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-04-07 17:33:56 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-04-07 17:33:56 +0000
commit8005ed3bd7c9190e3e1bb474317b9fc4639e716a (patch)
tree0ee9e5a8ea3bd7ae333d8e066ffc5984f4de3cdd /lib/Target/Sparc
parentf3334ebbe3b707ed14c1736ff86d2e5ac26298f7 (diff)
Don't print [%reg + 0], just print [%reg]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r--lib/Target/Sparc/SparcAsmPrinter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp
index e6b0a98f03..06e11b0057 100644
--- a/lib/Target/Sparc/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/SparcAsmPrinter.cpp
@@ -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 << "]";
}