summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
diff options
context:
space:
mode:
authorZoran Jovanovic <zoran.jovanovic@imgtec.com>2014-11-19 16:44:02 +0000
committerZoran Jovanovic <zoran.jovanovic@imgtec.com>2014-11-19 16:44:02 +0000
commita4c4b5fc0160fb1c3d550f17732690eeb96a3702 (patch)
treeae25f48b126c74dd27f6072f6f06f1a2d6ecafde /llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
parentb7e06becd96151e2fdee5b37b93df2001b90a221 (diff)
downloadbcm5719-llvm-a4c4b5fc0160fb1c3d550f17732690eeb96a3702.tar.gz
bcm5719-llvm-a4c4b5fc0160fb1c3d550f17732690eeb96a3702.zip
[mips][micromips] Implement SWM32 and LWM32 instructions
Differential Revision: http://reviews.llvm.org/D5519 llvm-svn: 222367
Diffstat (limited to 'llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp')
-rw-r--r--llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
index 8c797517e31..ab6b22562ce 100644
--- a/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
+++ b/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
@@ -225,6 +225,18 @@ printMemOperand(const MCInst *MI, int opNum, raw_ostream &O) {
// Load/Store memory operands -- imm($reg)
// If PIC target the target is loaded as the
// pattern lw $25,%call16($28)
+
+ // opNum can be invalid if instruction had reglist as operand.
+ // MemOperand is always last operand of instruction (base + offset).
+ switch (MI->getOpcode()) {
+ default:
+ break;
+ case Mips::SWM32_MM:
+ case Mips::LWM32_MM:
+ opNum = MI->getNumOperands() - 2;
+ break;
+ }
+
printOperand(MI, opNum+1, O);
O << "(";
printOperand(MI, opNum, O);
@@ -324,3 +336,13 @@ void MipsInstPrinter::printSaveRestore(const MCInst *MI, raw_ostream &O) {
}
}
+void MipsInstPrinter::
+printRegisterList(const MCInst *MI, int opNum, raw_ostream &O) {
+ // - 2 because register List is always first operand of instruction and it is
+ // always followed by memory operand (base + offset).
+ for (int i = opNum, e = MI->getNumOperands() - 2; i != e; ++i) {
+ if (i != opNum)
+ O << ", ";
+ printRegName(O, MI->getOperand(i).getReg());
+ }
+}
OpenPOWER on IntegriCloud