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
{
36 InstrItineraryData InstrItins
;
40 /// This constructor initializes the data members to match that
41 /// of the specified triple.
42 MBlazeSubtarget(const std::string
&TT
, const std::string
&FS
);
44 /// ParseSubtargetFeatures - Parses features string setting specified
45 /// subtarget options. Definition of function is auto generated by tblgen.
46 std::string
ParseSubtargetFeatures(const std::string
&FS
,
47 const std::string
&CPU
);
49 /// Compute the number of maximum number of issues per cycle for the
50 /// MBlaze scheduling itineraries.
51 void computeIssueWidth();
53 /// enablePostRAScheduler - True at 'More' optimization.
54 bool enablePostRAScheduler(CodeGenOpt::Level OptLevel
,
55 TargetSubtarget::AntiDepBreakMode
& Mode
,
56 RegClassVector
& CriticalPathRCs
) const;
58 /// getInstrItins - Return the instruction itineraies based on subtarget.
59 const InstrItineraryData
&getInstrItineraryData() const { return InstrItins
; }
61 bool hasItin() const { return HasItin
; }
62 bool hasPCMP() const { return HasPatCmp
; }
63 bool hasFPU() const { return HasFPU
; }
64 bool hasSqrt() const { return HasSqrt
; }
65 bool hasMul() const { return HasMul
; }
66 bool hasMul64() const { return HasMul64
; }
67 bool hasDiv() const { return HasDiv
; }
68 bool hasBarrel() const { return HasBarrel
; }
70 } // End llvm namespace