reintroduce support for Mips "small" section handling. This is
[oota-llvm.git] / lib / Target / Mips / MipsSubtarget.cpp
1 //===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the Mips specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "MipsSubtarget.h"
15 #include "Mips.h"
16 #include "MipsGenSubtarget.inc"
17 using namespace llvm;
18
19 MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &FS,
20                              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)
25 {
26   std::string CPU = "mips1";
27   MipsArchVersion = Mips1;
28
29   // Parse features string.
30   ParseSubtargetFeatures(FS, CPU);
31
32   // Is the target system Linux ?
33   if (TT.find("linux") == std::string::npos)
34     IsLinux = false;
35
36   // When only the target triple is specified and is 
37   // a allegrex target, set the features. We also match
38   // big and little endian allegrex cores (dont really
39   // know if a big one exists)
40   if (TT.find("mipsallegrex") != std::string::npos ||
41       TT.find("psp") != std::string::npos) {
42     MipsABI = EABI;
43     IsSingleFloat = true;
44     MipsArchVersion = Mips2;
45     HasVFPU = true; // Enables Allegrex Vector FPU (not supported yet)
46     HasSEInReg = true;
47     HasBitCount = true;
48     HasSwap = true;
49     HasCondMov = true;
50   }
51 }