1 //===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the Mips specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #include "MipsSubtarget.h"
16 #include "MipsGenSubtarget.inc"
19 MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
20 const std::string &FS, bool little) :
21 MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false),
22 IsFP64bit(false), IsGP64bit(false), HasVFPU(false), IsLinux(true),
23 HasSEInReg(false), HasCondMov(false), HasMulDivAdd(false), HasMinMax(false),
24 HasSwap(false), HasBitCount(false)
26 std::string CPUName = CPU;
29 MipsArchVersion = Mips1;
31 // Parse features string.
32 ParseSubtargetFeatures(FS, CPUName);
34 // Is the target system Linux ?
35 if (TT.find("linux") == std::string::npos)
38 // When only the target triple is specified and is
39 // a allegrex target, set the features. We also match
40 // big and little endian allegrex cores (dont really
41 // know if a big one exists)
42 if (TT.find("mipsallegrex") != std::string::npos ||
43 TT.find("psp") != std::string::npos) {
46 MipsArchVersion = Mips2;
47 HasVFPU = true; // Enables Allegrex Vector FPU (not supported yet)