aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips/Mips16InstrInfo.h
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-02-08 03:57:41 +0000
committerReed Kotler <rkotler@mips.com>2013-02-08 03:57:41 +0000
commit61b97b8c1721ba45e5c10ca307ceebe1efdf72a9 (patch)
treea02cefffc029f07e95256f86a4c56c16f633a2d5 /lib/Target/Mips/Mips16InstrInfo.h
parentd2bcda7706cc2a6caf3b4b304b39a9649c703278 (diff)
downloadexternal_llvm-61b97b8c1721ba45e5c10ca307ceebe1efdf72a9.zip
external_llvm-61b97b8c1721ba45e5c10ca307ceebe1efdf72a9.tar.gz
external_llvm-61b97b8c1721ba45e5c10ca307ceebe1efdf72a9.tar.bz2
When Mips16 frames grow large, the immediate field may exceed the maximum
allowed size for the instruction. This code uses RegScavenger to fix this. We sometimes need 2 registers for Mips16 so we must handle things differently than how register scavenger is normally used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/Mips16InstrInfo.h')
-rw-r--r--lib/Target/Mips/Mips16InstrInfo.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Target/Mips/Mips16InstrInfo.h b/lib/Target/Mips/Mips16InstrInfo.h
index 3704e25..26a5a5e 100644
--- a/lib/Target/Mips/Mips16InstrInfo.h
+++ b/lib/Target/Mips/Mips16InstrInfo.h
@@ -77,12 +77,14 @@ public:
void adjustStackPtr(unsigned SP, int64_t Amount, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const;
- /// Emit a series of instructions to load an immediate. If NewImm is a
- /// non-NULL parameter, the last instruction is not emitted, but instead
- /// its immediate operand is returned in NewImm.
- unsigned loadImmediate(int64_t Imm, MachineBasicBlock &MBB,
+ /// Emit a series of instructions to load an immediate.
+ // This is to adjust some FrameReg. We return the new register to be used
+ // in place of FrameReg and the adjusted immediate field (&NewImm)
+ //
+ unsigned loadImmediate(unsigned FrameReg,
+ int64_t Imm, MachineBasicBlock &MBB,
MachineBasicBlock::iterator II, DebugLoc DL,
- unsigned *NewImm) const;
+ unsigned &NewImm) const;
private:
virtual unsigned GetAnalyzableBrOpc(unsigned Opc) const;