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"
17 #include "llvm/Module.h"
20 MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M,
21 const std::string &FS, bool little) :
22 MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false),
23 IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasSEInReg(false)
25 std::string CPU = "mips1";
27 // Parse features string.
28 ParseSubtargetFeatures(FS, CPU);
30 // When only the target triple is specified and is
31 // a allegrex target, set the features. We also match
32 // big and little endian allegrex cores (dont really
33 // know if a big one exists)
34 const std::string& TT = M.getTargetTriple();
35 if (TT.find("mipsallegrex") != std::string::npos) {
38 MipsArchVersion = Mips2;
39 HasVFPU = true; // Enables Allegrex Vector FPU (not supported yet)