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 TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef MBLAZESUBTARGET_H
15 #define MBLAZESUBTARGET_H
17 #include "llvm/Target/TargetSubtargetInfo.h"
18 #include "llvm/MC/MCInstrItineraries.h"
21 #define GET_SUBTARGETINFO_HEADER
22 #include "MBlazeGenSubtargetInfo.inc"
26 class MBlazeSubtarget : public MBlazeGenSubtargetInfo {
38 InstrItineraryData InstrItins;
42 /// This constructor initializes the data members to match that
43 /// of the specified triple.
44 MBlazeSubtarget(const std::string &TT, const std::string &CPU,
45 const std::string &FS);
47 /// ParseSubtargetFeatures - Parses features string setting specified
48 /// subtarget options. Definition of function is auto generated by tblgen.
49 void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
51 /// Compute the number of maximum number of issues per cycle for the
52 /// MBlaze scheduling itineraries.
53 void computeIssueWidth();
55 /// enablePostRAScheduler - True at 'More' optimization.
56 bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
57 TargetSubtargetInfo::AntiDepBreakMode& Mode,
58 RegClassVector& CriticalPathRCs) const;
60 /// getInstrItins - Return the instruction itineraies based on subtarget.
61 const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
63 bool hasItin() const { return HasItin; }
64 bool hasPCMP() const { return HasPatCmp; }
65 bool hasFPU() const { return HasFPU; }
66 bool hasSqrt() const { return HasSqrt; }
67 bool hasMul() const { return HasMul; }
68 bool hasMul64() const { return HasMul64; }
69 bool hasDiv() const { return HasDiv; }
70 bool hasBarrel() const { return HasBarrel; }
72 } // End llvm namespace