summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/Mips16InstrInfo.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-12-08 16:51:52 +0000
committerReed Kotler <rkotler@mips.com>2013-12-08 16:51:52 +0000
commitc9ea75ee5bcf6a9ced5852b7662f1400a9be8d16 (patch)
treec321731e3293b1bcde6922fec6bb3c9d04d9353d /lib/Target/Mips/Mips16InstrInfo.cpp
parent7c4342e90b929a1301261147ea23e60e1ea02f6c (diff)
downloadllvm-c9ea75ee5bcf6a9ced5852b7662f1400a9be8d16.tar.gz
llvm-c9ea75ee5bcf6a9ced5852b7662f1400a9be8d16.tar.bz2
llvm-c9ea75ee5bcf6a9ced5852b7662f1400a9be8d16.tar.xz
Cleaning up of prologue/epilogue code for Mips16. First step
here is to make save/restore into variable number of argument instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/Mips16InstrInfo.cpp')
-rw-r--r--lib/Target/Mips/Mips16InstrInfo.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Target/Mips/Mips16InstrInfo.cpp b/lib/Target/Mips/Mips16InstrInfo.cpp
index c53db0e60a..05658106bb 100644
--- a/lib/Target/Mips/Mips16InstrInfo.cpp
+++ b/lib/Target/Mips/Mips16InstrInfo.cpp
@@ -182,12 +182,17 @@ void Mips16InstrInfo::makeFrame(unsigned SP, int64_t FrameSize,
DebugLoc DL = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
if (!NeverUseSaveRestore) {
if (isUInt<11>(FrameSize))
- BuildMI(MBB, I, DL, get(Mips::SaveRaF16)).addImm(FrameSize);
+ //BuildMI(MBB, I, DL, get(Mips::SaveRaF16)).addImm(FrameSize);
+ BuildMI(MBB, I, DL, get(Mips::SaveX16)).addReg(Mips::RA).
+ addReg(Mips::S0).
+ addReg(Mips::S1).addReg(Mips::S2).addImm(FrameSize);
else {
int Base = 2040; // should create template function like isUInt that
// returns largest possible n bit unsigned integer
int64_t Remainder = FrameSize - Base;
- BuildMI(MBB, I, DL, get(Mips::SaveRaF16)). addImm(Base);
+ BuildMI(MBB, I, DL, get(Mips::SaveX16)).addReg(Mips::RA).
+ addReg(Mips::S0).
+ addReg(Mips::S1).addReg(Mips::S2).addImm(Base);
if (isInt<16>(-Remainder))
BuildAddiuSpImm(MBB, I, -Remainder);
else
@@ -224,7 +229,9 @@ void Mips16InstrInfo::restoreFrame(unsigned SP, int64_t FrameSize,
DebugLoc DL = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
if (!NeverUseSaveRestore) {
if (isUInt<11>(FrameSize))
- BuildMI(MBB, I, DL, get(Mips::RestoreRaF16)).addImm(FrameSize);
+ BuildMI(MBB, I, DL, get(Mips::RestoreX16)).addReg(Mips::RA).
+ addReg(Mips::S0).
+ addReg(Mips::S1).addReg(Mips::S2).addImm(FrameSize);
else {
int Base = 2040; // should create template function like isUInt that
// returns largest possible n bit unsigned integer
@@ -233,7 +240,9 @@ void Mips16InstrInfo::restoreFrame(unsigned SP, int64_t FrameSize,
BuildAddiuSpImm(MBB, I, Remainder);
else
adjustStackPtrBig(SP, Remainder, MBB, I, Mips::A0, Mips::A1);
- BuildMI(MBB, I, DL, get(Mips::RestoreRaF16)). addImm(Base);
+ BuildMI(MBB, I, DL, get(Mips::RestoreX16)).addReg(Mips::RA).
+ addReg(Mips::S0).
+ addReg(Mips::S1).addReg(Mips::S2).addImm(Base);
}
}
else {