summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsAsmPrinter.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-12-13 03:09:05 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-12-13 03:09:05 +0000
commit044a784fa586cf92bb712c6dc54f925f539e19d1 (patch)
treed634b12b3ed144c2ab380eb5560ac8774e87374a /lib/Target/Mips/MipsAsmPrinter.cpp
parentf3315cf65f9574cd1e4e784d2860c943cfa65ce9 (diff)
downloadllvm-044a784fa586cf92bb712c6dc54f925f539e19d1.tar.gz
llvm-044a784fa586cf92bb712c6dc54f925f539e19d1.tar.bz2
llvm-044a784fa586cf92bb712c6dc54f925f539e19d1.tar.xz
Expand .cprestore directive to multiple instructions if the offset does not fit
in a 16-bit field. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsAsmPrinter.cpp')
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index cc25c4c7bd..a5505d3693 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -96,19 +96,17 @@ void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
if (!OutStreamer.hasRawTextSupport()) {
// Lower CPLOAD and CPRESTORE
- if (Opc == Mips::CPLOAD) {
+ if (Opc == Mips::CPLOAD)
MCInstLowering.LowerCPLOAD(MI, MCInsts);
- for (SmallVector<MCInst, 4>::iterator I = MCInsts.begin(); I
- != MCInsts.end(); ++I)
+ else if (Opc == Mips::CPRESTORE)
+ MCInstLowering.LowerCPRESTORE(MI, MCInsts);
+
+ if (!MCInsts.empty()) {
+ for (SmallVector<MCInst, 4>::iterator I = MCInsts.begin();
+ I != MCInsts.end(); ++I)
OutStreamer.EmitInstruction(*I);
return;
}
-
- if (Opc == Mips::CPRESTORE) {
- MCInstLowering.LowerCPRESTORE(MI, TmpInst0);
- OutStreamer.EmitInstruction(TmpInst0);
- return;
- }
}
OutStreamer.EmitInstruction(TmpInst0);