From fa4bb09cf042dc0f30297082f55bc37f35c0f5f5 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Wed, 7 Apr 2004 04:29:03 +0000 Subject: [PATCH] Fix bug in printing loads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12741 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcAsmPrinter.cpp | 8 ++++---- lib/Target/SparcV8/SparcV8AsmPrinter.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp index 71a797105ff..e6b0a98f034 100644 --- a/lib/Target/Sparc/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/SparcAsmPrinter.cpp @@ -467,12 +467,12 @@ void V8Printer::printMachineInstruction(const MachineInstr *MI) { O << Desc.Name << " "; // Printing memory instructions is a special case. - // for loads: op %base, offset, %dest --> op [%base + offset], %dest - // for stores: op %src, %base, offset --> op %src, [%base + offset] + // for loads: %dest = op %base, offset --> op [%base + offset], %dest + // for stores: op %src, %base, offset --> op %src, [%base + offset] if (isLoadInstruction (MI)) { - printBaseOffsetPair (MI, 0); + printBaseOffsetPair (MI, 1); O << ", "; - printOperand (MI->getOperand (2)); + printOperand (MI->getOperand (0)); O << "\n"; return; } else if (isStoreInstruction (MI)) { diff --git a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp index 71a797105ff..e6b0a98f034 100644 --- a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp +++ b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp @@ -467,12 +467,12 @@ void V8Printer::printMachineInstruction(const MachineInstr *MI) { O << Desc.Name << " "; // Printing memory instructions is a special case. - // for loads: op %base, offset, %dest --> op [%base + offset], %dest - // for stores: op %src, %base, offset --> op %src, [%base + offset] + // for loads: %dest = op %base, offset --> op [%base + offset], %dest + // for stores: op %src, %base, offset --> op %src, [%base + offset] if (isLoadInstruction (MI)) { - printBaseOffsetPair (MI, 0); + printBaseOffsetPair (MI, 1); O << ", "; - printOperand (MI->getOperand (2)); + printOperand (MI->getOperand (0)); O << "\n"; return; } else if (isStoreInstruction (MI)) { -- 2.34.1