1 //=====-- MipsSubtarget.h - Define Subtarget for the Mips -----*- 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 declares the Mips specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSSUBTARGET_H
15 #define MIPSSUBTARGET_H
17 #include "llvm/Target/TargetSubtarget.h"
18 #include "llvm/Target/TargetMachine.h"
25 class MipsSubtarget : public TargetSubtarget {
30 Mips1, Mips2, Mips3, Mips4, Mips32, Mips32r2
37 // Mips architecture version
38 MipsArchEnum MipsArchVersion;
40 // Mips supported ABIs
43 // IsLittle - The target is Little Endian
46 // IsSingleFloat - The target only supports single precision float
47 // point operations. This enable the target to use all 32 32-bit
48 // float point registers instead of only using even ones.
51 // IsFP64bit - The target processor has 64-bit float point registers.
54 // IsFP64bit - General-purpose registers are 64 bits wide
57 // HasAllegrexVFPU - Allegrex processor has a vector float point unit.
60 // IsAllegrex - The target processor is a Allegrex core.
63 InstrItineraryData InstrItins;
67 /// Only O32 and EABI supported right now.
68 bool isABI_EABI() const { return MipsABI == EABI; }
69 bool isABI_O32() const { return MipsABI == O32; }
71 /// This constructor initializes the data members to match that
72 /// of the specified module.
73 MipsSubtarget(const TargetMachine &TM, const Module &M,
74 const std::string &FS, bool little);
76 /// ParseSubtargetFeatures - Parses features string setting specified
77 /// subtarget options. Definition of function is auto generated by tblgen.
78 void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
80 bool hasMips2Ops() const { return MipsArchVersion >= Mips2; }
82 bool isLittle() const { return IsLittle; }
83 bool isFP64bit() const { return IsFP64bit; };
84 bool isGP64bit() const { return IsGP64bit; };
85 bool isGP32bit() const { return !IsGP64bit; };
86 bool isSingleFloat() const { return IsSingleFloat; };
87 bool isNotSingleFloat() const { return !IsSingleFloat; };
88 bool hasAllegrexVFPU() const { return HasAllegrexVFPU; };
89 bool isAllegrex() const { return IsAllegrex; };
92 } // End llvm namespace