aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsAsmPrinter.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-09-24 20:15:11 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-09-24 20:15:11 +0000
commitb42abebe36f1dfbd0c779fd1471618c42ed3fec5 (patch)
tree12bb433a9d14b80ee15662218d1fc472992fe555 /lib/Target/Mips/MipsAsmPrinter.cpp
parent128459b85b59530e511ea17b3cc3a5b8ee3e8bd4 (diff)
Added "LoadEffective" pattern to handle stack locations.
Fixed some comments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsAsmPrinter.cpp')
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index 11db54753c..254cc563c9 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -141,7 +141,7 @@ emitMaskDirective(MachineFunction &MF)
#endif
unsigned int Bitmask = getSavedRegsBitmask(false, MF);
- O << "\t.mask\t";
+ O << "\t.mask \t";
printHex32(Bitmask);
O << "," << Offset << "\n";
}
@@ -366,9 +366,16 @@ printOperand(const MachineInstr *MI, int opNum)
void MipsAsmPrinter::
printMemOperand(const MachineInstr *MI, int opNum, const char *Modifier)
{
- // lw/sw $reg, MemOperand
- // will turn into :
- // lw/sw $reg, imm($reg)
+ // when using stack locations for not load/store instructions
+ // print the same way as all normal 3 operand instructions.
+ if (Modifier && !strcmp(Modifier, "stackloc")) {
+ printOperand(MI, opNum+1);
+ O << ", ";
+ printOperand(MI, opNum);
+ return;
+ }
+
+ // Load/Store memory operands -- imm($reg)
printOperand(MI, opNum);
O << "(";
printOperand(MI, opNum+1);