the various ConstantExpr::get*Ty methods existed to work with issues around
[llvm/stm8.git] / lib / Target / MBlaze / MBlazeSubtarget.h
blob43b0197ad5aad25dceaf1256054f015a286037b6
1 //=====-- MBlazeSubtarget.h - Define Subtarget for the MBlaze -*- C++ -*--====//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
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"
19 #include <string>
21 #define GET_SUBTARGETINFO_HEADER
22 #include "MBlazeGenSubtargetInfo.inc"
24 namespace llvm {
25 class StringRef;
27 class MBlazeSubtarget : public MBlazeGenSubtargetInfo {
29 protected:
30 bool HasBarrel;
31 bool HasDiv;
32 bool HasMul;
33 bool HasPatCmp;
34 bool HasFPU;
35 bool HasMul64;
36 bool HasSqrt;
37 bool HasItin;
39 InstrItineraryData InstrItins;
41 public:
43 /// This constructor initializes the data members to match that
44 /// of the specified triple.
45 MBlazeSubtarget(const std::string &TT, const std::string &CPU,
46 const std::string &FS);
48 /// ParseSubtargetFeatures - Parses features string setting specified
49 /// subtarget options. Definition of function is auto generated by tblgen.
50 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
52 /// Compute the number of maximum number of issues per cycle for the
53 /// MBlaze scheduling itineraries.
54 void computeIssueWidth();
56 /// enablePostRAScheduler - True at 'More' optimization.
57 bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
58 TargetSubtargetInfo::AntiDepBreakMode& Mode,
59 RegClassVector& CriticalPathRCs) const;
61 /// getInstrItins - Return the instruction itineraies based on subtarget.
62 const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
64 bool hasItin() const { return HasItin; }
65 bool hasPCMP() const { return HasPatCmp; }
66 bool hasFPU() const { return HasFPU; }
67 bool hasSqrt() const { return HasSqrt; }
68 bool hasMul() const { return HasMul; }
69 bool hasMul64() const { return HasMul64; }
70 bool hasDiv() const { return HasDiv; }
71 bool hasBarrel() const { return HasBarrel; }
73 } // End llvm namespace
75 #endif