aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanak@gmail.com>2011-09-09 20:45:50 +0000
committerAkira Hatanaka <ahatanak@gmail.com>2011-09-09 20:45:50 +0000
commit8ddf6531b88937dec35bf2bb3a55245b1af9cbf5 (patch)
treeb02f180f3b69779d7e4915457516d4c04c34c8b7 /lib/Target/Mips
parent8ffad56f8eb41c73ecf40d1aa473819eb6915c12 (diff)
downloadexternal_llvm-8ddf6531b88937dec35bf2bb3a55245b1af9cbf5.zip
external_llvm-8ddf6531b88937dec35bf2bb3a55245b1af9cbf5.tar.gz
external_llvm-8ddf6531b88937dec35bf2bb3a55245b1af9cbf5.tar.bz2
Drop support for Mips1 and Mips2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139405 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r--lib/Target/Mips/Mips.td11
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp18
-rw-r--r--lib/Target/Mips/MipsDelaySlotFiller.cpp4
-rw-r--r--lib/Target/Mips/MipsInstrFPU.td3
-rw-r--r--lib/Target/Mips/MipsInstrInfo.td4
-rw-r--r--lib/Target/Mips/MipsMCInstLower.cpp44
-rw-r--r--lib/Target/Mips/MipsMCInstLower.h4
-rw-r--r--lib/Target/Mips/MipsSubtarget.cpp2
-rw-r--r--lib/Target/Mips/MipsSubtarget.h3
9 files changed, 6 insertions, 87 deletions
diff --git a/lib/Target/Mips/Mips.td b/lib/Target/Mips/Mips.td
index 5d27878..d55d7af 100644
--- a/lib/Target/Mips/Mips.td
+++ b/lib/Target/Mips/Mips.td
@@ -54,10 +54,6 @@ def FeatureSwap : SubtargetFeature<"swap", "HasSwap", "true",
"Enable 'byte/half swap' instructions.">;
def FeatureBitCount : SubtargetFeature<"bitcount", "HasBitCount", "true",
"Enable 'count leading bits' instructions.">;
-def FeatureMips1 : SubtargetFeature<"mips1", "MipsArchVersion", "Mips1",
- "Mips1 ISA Support">;
-def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
- "Mips2 ISA Support">;
def FeatureMips32 : SubtargetFeature<"mips32", "MipsArchVersion", "Mips32",
"Mips32 ISA Support",
[FeatureCondMov, FeatureBitCount]>;
@@ -72,13 +68,6 @@ def FeatureMips32r2 : SubtargetFeature<"mips32r2", "MipsArchVersion",
class Proc<string Name, list<SubtargetFeature> Features>
: Processor<Name, MipsGenericItineraries, Features>;
-def : Proc<"mips1", [FeatureMips1]>;
-def : Proc<"r2000", [FeatureMips1]>;
-def : Proc<"r3000", [FeatureMips1]>;
-
-def : Proc<"mips2", [FeatureMips2]>;
-def : Proc<"r6000", [FeatureMips2]>;
-
def : Proc<"mips32r1", [FeatureMips32]>;
def : Proc<"4ke", [FeatureMips32r2]>;
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index c617918..51fd13d 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -36,7 +36,6 @@
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/TargetRegistry.h"
@@ -56,23 +55,6 @@ void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
MipsMCInstLower MCInstLowering(Mang, *MF, *this);
unsigned Opc = MI->getOpcode();
-
- // If target is Mips1, expand double precision load/store to two single
- // precision loads/stores (and delay slot if MI is a load).
- if (Subtarget->isMips1() && (Opc == Mips::LDC1 || Opc == Mips::SDC1)) {
- SmallVector<MCInst, 4> MCInsts;
- const unsigned* SubReg =
- TM.getRegisterInfo()->getSubRegisters(MI->getOperand(0).getReg());
- MCInstLowering.LowerMips1F64LoadStore(MI, Opc, MCInsts,
- Subtarget->isLittle(), SubReg);
-
- for (SmallVector<MCInst, 4>::iterator I = MCInsts.begin();
- I != MCInsts.end(); ++I)
- OutStreamer.EmitInstruction(*I);
-
- return;
- }
-
MCInst TmpInst0;
MCInstLowering.Lower(MI, TmpInst0);
diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp
index c3a6211..1a4ef0c 100644
--- a/lib/Target/Mips/MipsDelaySlotFiller.cpp
+++ b/lib/Target/Mips/MipsDelaySlotFiller.cpp
@@ -60,9 +60,7 @@ runOnMachineBasicBlock(MachineBasicBlock &MBB)
bool Changed = false;
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I) {
const MCInstrDesc& MCid = I->getDesc();
- if (MCid.hasDelaySlot() &&
- (TM.getSubtarget<MipsSubtarget>().isMips1() ||
- MCid.isCall() || MCid.isBranch() || MCid.isReturn())) {
+ if (MCid.hasDelaySlot()) {
MachineBasicBlock::iterator J = I;
++J;
BuildMI(MBB, J, I->getDebugLoc(), TII->get(Mips::NOP));
diff --git a/lib/Target/Mips/MipsInstrFPU.td b/lib/Target/Mips/MipsInstrFPU.td
index 24e95ae..4846b2e 100644
--- a/lib/Target/Mips/MipsInstrFPU.td
+++ b/lib/Target/Mips/MipsInstrFPU.td
@@ -58,7 +58,6 @@ let PrintMethod = "printFCCOperand" in
def In32BitMode : Predicate<"!Subtarget.isFP64bit()">;
def IsSingleFloat : Predicate<"Subtarget.isSingleFloat()">;
def IsNotSingleFloat : Predicate<"!Subtarget.isSingleFloat()">;
-def IsNotMipsI : Predicate<"!Subtarget.isMips1()">;
//===----------------------------------------------------------------------===//
// Instruction Class Templates
@@ -254,7 +253,7 @@ def MIPS_FCOND_LE : PatLeaf<(i32 14)>;
def MIPS_FCOND_NGT : PatLeaf<(i32 15)>;
/// Floating Point Compare
-let hasDelaySlot = 1, Defs=[FCR31] in {
+let Defs=[FCR31] in {
def FCMP_S32 : FCC<0x0, (outs), (ins FGR32:$fs, FGR32:$ft, condcode:$cc),
"c.$cc.s\t$fs, $ft",
[(MipsFPCmp FGR32:$fs, FGR32:$ft, imm:$cc)]>;
diff --git a/lib/Target/Mips/MipsInstrInfo.td b/lib/Target/Mips/MipsInstrInfo.td
index f9cc58b..ccf2307 100644
--- a/lib/Target/Mips/MipsInstrInfo.td
+++ b/lib/Target/Mips/MipsInstrInfo.td
@@ -273,7 +273,7 @@ class LoadUpper<bits<6> op, string instr_asm>:
[], IIAlu>;
// Memory Load/Store
-let canFoldAsLoad = 1, hasDelaySlot = 1 in
+let canFoldAsLoad = 1 in
class LoadM<bits<6> op, string instr_asm, PatFrag OpNode>:
FI<op, (outs CPURegs:$dst), (ins mem:$addr),
!strconcat(instr_asm, "\t$dst, $addr"),
@@ -571,7 +571,7 @@ def SYNC : MipsInst<(outs), (ins i32imm:$stype), "sync $stype",
}
/// Load-linked, Store-conditional
-let mayLoad = 1, hasDelaySlot = 1 in
+let mayLoad = 1 in
def LL : FI<0x30, (outs CPURegs:$dst), (ins mem:$addr),
"ll\t$dst, $addr", [], IILoad>;
let mayStore = 1, Constraints = "$src = $dst" in
diff --git a/lib/Target/Mips/MipsMCInstLower.cpp b/lib/Target/Mips/MipsMCInstLower.cpp
index 58e1844..16ec41e 100644
--- a/lib/Target/Mips/MipsMCInstLower.cpp
+++ b/lib/Target/Mips/MipsMCInstLower.cpp
@@ -83,50 +83,6 @@ MCOperand MipsMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
Ctx));
}
-// If target is Mips1, expand double precision load/store to two single
-// precision loads/stores.
-//
-// ldc1 $f0, lo($CPI0_0)($5) gets expanded to the following two instructions:
-// (little endian)
-// lwc1 $f0, lo($CPI0_0)($5) and
-// lwc1 $f1, lo($CPI0_0+4)($5)
-// (big endian)
-// lwc1 $f1, lo($CPI0_0)($5) and
-// lwc1 $f0, lo($CPI0_0+4)($5)
-void MipsMCInstLower::LowerMips1F64LoadStore(const MachineInstr *MI,
- unsigned Opc,
- SmallVector<MCInst, 4>& MCInsts,
- bool isLittle,
- const unsigned *SubReg) const {
- MCInst InstLo, InstHi, DelaySlot;
- unsigned SingleOpc = (Opc == Mips::LDC1 ? Mips::LWC1 : Mips::SWC1);
- unsigned RegLo = isLittle ? *SubReg : *(SubReg + 1);
- unsigned RegHi = isLittle ? *(SubReg + 1) : *SubReg;
- const MachineOperand &MO1 = MI->getOperand(1);
- const MachineOperand &MO2 = MI->getOperand(2);
-
- InstLo.setOpcode(SingleOpc);
- InstLo.addOperand(MCOperand::CreateReg(RegLo));
- InstLo.addOperand(LowerOperand(MO1));
- InstLo.addOperand(LowerOperand(MO2));
- MCInsts.push_back(InstLo);
-
- InstHi.setOpcode(SingleOpc);
- InstHi.addOperand(MCOperand::CreateReg(RegHi));
- InstHi.addOperand(LowerOperand(MO1));
- if (MO2.isImm())// The offset of addr operand is an immediate: e.g. 0($sp)
- InstHi.addOperand(MCOperand::CreateImm(MO2.getImm() + 4));
- else// Otherwise, the offset must be a symbol: e.g. lo($CPI0_0)($5)
- InstHi.addOperand(LowerSymbolOperand(MO2, MO2.getType(), 4));
- MCInsts.push_back(InstHi);
-
- // Need to insert a NOP in LWC1's delay slot.
- if (SingleOpc == Mips::LWC1) {
- DelaySlot.setOpcode(Mips::NOP);
- MCInsts.push_back(DelaySlot);
- }
-}
-
MCOperand MipsMCInstLower::LowerOperand(const MachineOperand& MO) const {
MachineOperandType MOTy = MO.getType();
diff --git a/lib/Target/Mips/MipsMCInstLower.h b/lib/Target/Mips/MipsMCInstLower.h
index 545a442..223f23a 100644
--- a/lib/Target/Mips/MipsMCInstLower.h
+++ b/lib/Target/Mips/MipsMCInstLower.h
@@ -9,7 +9,6 @@
#ifndef MIPSMCINSTLOWER_H
#define MIPSMCINSTLOWER_H
-#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/Support/Compiler.h"
@@ -35,9 +34,6 @@ public:
MipsMCInstLower(Mangler *mang, const MachineFunction &MF,
MipsAsmPrinter &asmprinter);
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
- void LowerMips1F64LoadStore(const MachineInstr *MI, unsigned Opc,
- SmallVector<MCInst, 4>& MCInsts,
- bool isLittle, const unsigned *SubReg) const;
private:
MCOperand LowerSymbolOperand(const MachineOperand &MO,
MachineOperandType MOTy, unsigned Offset) const;
diff --git a/lib/Target/Mips/MipsSubtarget.cpp b/lib/Target/Mips/MipsSubtarget.cpp
index 1d3b61f..3bb5011 100644
--- a/lib/Target/Mips/MipsSubtarget.cpp
+++ b/lib/Target/Mips/MipsSubtarget.cpp
@@ -24,7 +24,7 @@ using namespace llvm;
MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
const std::string &FS, bool little) :
MipsGenSubtargetInfo(TT, CPU, FS),
- MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false),
+ MipsArchVersion(Mips32), MipsABI(O32), IsLittle(little), IsSingleFloat(false),
IsFP64bit(false), IsGP64bit(false), HasVFPU(false), IsLinux(true),
HasSEInReg(false), HasCondMov(false), HasMulDivAdd(false), HasMinMax(false),
HasSwap(false), HasBitCount(false)
diff --git a/lib/Target/Mips/MipsSubtarget.h b/lib/Target/Mips/MipsSubtarget.h
index 533d4af..3733bec 100644
--- a/lib/Target/Mips/MipsSubtarget.h
+++ b/lib/Target/Mips/MipsSubtarget.h
@@ -34,7 +34,7 @@ public:
protected:
enum MipsArchEnum {
- Mips1, Mips2, Mips3, Mips4, Mips32, Mips32r2
+ Mips32, Mips32r2
};
// Mips architecture version
@@ -102,7 +102,6 @@ public:
/// subtarget options. Definition of function is auto generated by tblgen.
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
- bool isMips1() const { return MipsArchVersion == Mips1; }
bool isMips32() const { return MipsArchVersion >= Mips32; }
bool isMips32r2() const { return MipsArchVersion == Mips32r2; }