diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2011-12-13 03:09:05 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2011-12-13 03:09:05 +0000 |
commit | 044a784fa586cf92bb712c6dc54f925f539e19d1 (patch) | |
tree | d634b12b3ed144c2ab380eb5560ac8774e87374a /lib/Target/Mips/MipsAsmPrinter.cpp | |
parent | f3315cf65f9574cd1e4e784d2860c943cfa65ce9 (diff) | |
download | llvm-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.cpp | 16 |
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); |