diff options
author | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-10-24 22:05:34 +0000 |
---|---|---|
committer | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-10-24 22:05:34 +0000 |
commit | 0863c161e9431eec93c6c6e318748019dfb4fed2 (patch) | |
tree | ac401a0d38ee7aed9edcef1956abc7665a4a26b0 /llvm/lib/Target/Sparc/EmitAssembly.cpp | |
parent | f9e623e1f9e4f5df3184772d5bd194664ae06832 (diff) | |
download | bcm5719-llvm-0863c161e9431eec93c6c6e318748019dfb4fed2.tar.gz bcm5719-llvm-0863c161e9431eec93c6c6e318748019dfb4fed2.zip |
Fixed load syntax in EmitAssembly
Fixed cpReg2Mem (store) operand oreder in SparcRegInfo.cpp
llvm-svn: 984
Diffstat (limited to 'llvm/lib/Target/Sparc/EmitAssembly.cpp')
-rw-r--r-- | llvm/lib/Target/Sparc/EmitAssembly.cpp | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/llvm/lib/Target/Sparc/EmitAssembly.cpp b/llvm/lib/Target/Sparc/EmitAssembly.cpp index aadc790210c..59cd52ab84c 100644 --- a/llvm/lib/Target/Sparc/EmitAssembly.cpp +++ b/llvm/lib/Target/Sparc/EmitAssembly.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; |