summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2018-02-07 12:36:33 +0000
committerSimon Atanasyan <simon@atanasyan.com>2018-02-07 12:36:33 +0000
commit737bec38d0bd6ced5639169c1445791327911e01 (patch)
treea2fc82bbc005dd4d7d802e62bee462562a7b5f56 /llvm/lib
parent7deda4f5af5e7167b37ec935dc7099231c90ae54 (diff)
downloadbcm5719-llvm-737bec38d0bd6ced5639169c1445791327911e01.tar.gz
bcm5719-llvm-737bec38d0bd6ced5639169c1445791327911e01.zip
[mips] Handle 'M' and 'L' operand codes for memory operands
Both operand codes now work the same way in case of register or memory operands. It print high-order or low-order word in a double-word register or memory location. llvm-svn: 324476
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/MipsAsmPrinter.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
index f9de78dc281..7953a36442d 100644
--- a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -576,17 +576,27 @@ bool MipsAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
assert(OffsetMO.isImm() && "Unexpected offset for inline asm memory operand.");
int Offset = OffsetMO.getImm();
- // Currently we are expecting either no ExtraCode or 'D'
+ // Currently we are expecting either no ExtraCode or 'D','M','L'.
if (ExtraCode) {
- if (ExtraCode[0] == 'D')
+ switch (ExtraCode[0]) {
+ case 'D':
Offset += 4;
- else
+ break;
+ case 'M':
+ if (Subtarget->isLittle())
+ Offset += 4;
+ break;
+ case 'L':
+ if (!Subtarget->isLittle())
+ Offset += 4;
+ break;
+ default:
return true; // Unknown modifier.
- // FIXME: M = high order bits
- // FIXME: L = low order bits
+ }
}
- O << Offset << "($" << MipsInstPrinter::getRegisterName(BaseMO.getReg()) << ")";
+ O << Offset << "($" << MipsInstPrinter::getRegisterName(BaseMO.getReg())
+ << ")";
return false;
}
OpenPOWER on IntegriCloud