aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/SparcV9/SparcV9AsmPrinter.cpp')
-rw-r--r--lib/Target/SparcV9/SparcV9AsmPrinter.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
index aadc790210..59cd52ab84 100644
--- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
+++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
@@ -182,10 +182,47 @@ void SparcAsmPrinter::emitMachineInst(const MachineInstr *MI) {
printOperand(MI->getOperand(1));
Out << endl;
return;
-
+
default: break;
}
+ if( Target.getInstrInfo().isLoad(Opcode) ) { // if Load
+ assert(MI->getNumOperands() == 3 && "Loads must have 3 operands");
+ Out << "[";
+ printOperand(MI->getOperand(0));
+
+ const MachineOperand& ImmOp = MI->getOperand(1);
+ if( ImmOp.getImmedValue() >= 0)
+ Out << "+";
+ printOperand(ImmOp);
+ Out << "]";
+ Out << ", ";
+
+ printOperand(MI->getOperand(2));
+ Out << endl;
+ return;
+
+ }
+
+ if( Target.getInstrInfo().isStore(Opcode) ) { // if Store
+ assert(MI->getNumOperands() == 3 && "Stores must have 3 operands");
+ printOperand(MI->getOperand(0));
+ Out << ", ";
+ Out << "[";
+ printOperand(MI->getOperand(1));
+
+ const MachineOperand& ImmOp = MI->getOperand(2);
+ if( ImmOp.getImmedValue() >= 0)
+ Out << "+";
+ printOperand(ImmOp);
+ Out << "]";
+ Out << endl;
+ return;
+
+ }
+
+
+
unsigned Mask = getOperandMask(Opcode);
bool NeedComma = false;