Sink SubtargetFeature and TargetInstrItineraries (renamed MCInstrItineraries) into MC.
[oota-llvm.git] / lib / Target / MBlaze / MBlazeSubtarget.h
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 TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef MBLAZESUBTARGET_H
15 #define MBLAZESUBTARGET_H
16
17 #include "llvm/Target/TargetSubtarget.h"
18 #include "llvm/MC/MCInstrItineraries.h"
19 #include <string>
20
21 namespace llvm {
22
23 class MBlazeSubtarget : public TargetSubtarget {
24
25 protected:
26   bool HasBarrel;
27   bool HasDiv;
28   bool HasMul;
29   bool HasPatCmp;
30   bool HasFPU;
31   bool HasMul64;
32   bool HasSqrt;
33   bool HasItin;
34
35   InstrItineraryData InstrItins;
36
37 public:
38
39   /// This constructor initializes the data members to match that
40   /// of the specified triple.
41   MBlazeSubtarget(const std::string &TT, const std::string &FS);
42
43   /// ParseSubtargetFeatures - Parses features string setting specified
44   /// subtarget options.  Definition of function is auto generated by tblgen.
45   std::string ParseSubtargetFeatures(const std::string &FS,
46                                      const std::string &CPU);
47
48   /// Compute the number of maximum number of issues per cycle for the
49   /// MBlaze scheduling itineraries.
50   void computeIssueWidth();
51
52   /// enablePostRAScheduler - True at 'More' optimization.
53   bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
54                              TargetSubtarget::AntiDepBreakMode& Mode,
55                              RegClassVector& CriticalPathRCs) const;
56
57   /// getInstrItins - Return the instruction itineraies based on subtarget.
58   const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
59
60   bool hasItin()   const { return HasItin; }
61   bool hasPCMP()   const { return HasPatCmp; }
62   bool hasFPU()    const { return HasFPU; }
63   bool hasSqrt()   const { return HasSqrt; }
64   bool hasMul()    const { return HasMul; }
65   bool hasMul64()  const { return HasMul64; }
66   bool hasDiv()    const { return HasDiv; }
67   bool hasBarrel() const { return HasBarrel; }
68 };
69 } // End llvm namespace
70
71 #endif