1 //=====-- MBlazeSubtarget.h - Define Subtarget for the MBlaze -*- 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 MBlaze specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #ifndef MBLAZESUBTARGET_H
15 #define MBLAZESUBTARGET_H
17 #include "llvm/Target/TargetSubtarget.h"
18 #include "llvm/Target/TargetMachine.h"
24 class MBlazeSubtarget
: public TargetSubtarget
{
29 V400
, V500
, V600
, V700
, V710
32 // MBlaze architecture version
33 MBlazeArchEnum MBlazeArchVersion
;
51 InstrItineraryData InstrItins
;
55 /// This constructor initializes the data members to match that
56 /// of the specified triple.
57 MBlazeSubtarget(const std::string
&TT
, const std::string
&FS
);
59 /// ParseSubtargetFeatures - Parses features string setting specified
60 /// subtarget options. Definition of function is auto generated by tblgen.
61 std::string
ParseSubtargetFeatures(const std::string
&FS
,
62 const std::string
&CPU
);
64 bool hasFPU() const { return HasFPU
; }
65 bool hasSqrt() const { return HasSqrt
; }
66 bool hasMul() const { return HasMul
; }
67 bool hasMul64() const { return HasMul64
; }
68 bool hasDiv() const { return HasDiv
; }
69 bool hasBarrel() const { return HasBarrel
; }
71 bool isV400() const { return MBlazeArchVersion
== V400
; }
72 bool isV500() const { return MBlazeArchVersion
== V500
; }
73 bool isV600() const { return MBlazeArchVersion
== V600
; }
74 bool isV700() const { return MBlazeArchVersion
== V700
; }
75 bool isV710() const { return MBlazeArchVersion
== V710
; }
77 } // End llvm namespace