LLVM API Documentation
00001 //===- MipsSubtarget.cpp - Mips Subtarget Information -----------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file implements the Mips specific subclass of TargetSubtarget. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #include "MipsSubtarget.h" 00015 #include "Mips.h" 00016 #include "MipsGenSubtarget.inc" 00017 using namespace llvm; 00018 00019 MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &FS, 00020 bool little) : 00021 MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false), 00022 IsFP64bit(false), IsGP64bit(false), HasVFPU(false), IsLinux(true), 00023 HasSEInReg(false), HasCondMov(false), HasMulDivAdd(false), HasMinMax(false), 00024 HasSwap(false), HasBitCount(false) 00025 { 00026 std::string CPU = "mips1"; 00027 MipsArchVersion = Mips1; 00028 00029 // Parse features string. 00030 ParseSubtargetFeatures(FS, CPU); 00031 00032 // Is the target system Linux ? 00033 if (TT.find("linux") == std::string::npos) 00034 IsLinux = false; 00035 00036 // When only the target triple is specified and is 00037 // a allegrex target, set the features. We also match 00038 // big and little endian allegrex cores (dont really 00039 // know if a big one exists) 00040 if (TT.find("mipsallegrex") != std::string::npos || 00041 TT.find("psp") != std::string::npos) { 00042 MipsABI = EABI; 00043 IsSingleFloat = true; 00044 MipsArchVersion = Mips2; 00045 HasVFPU = true; // Enables Allegrex Vector FPU (not supported yet) 00046 HasSEInReg = true; 00047 HasBitCount = true; 00048 HasSwap = true; 00049 HasCondMov = true; 00050 } 00051 }