MBlazeSubtarget.h revision 3d820baf195973de23d6520d692acc6bfb43bfe9
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/Target/TargetMachine.h"
19
20#include <string>
21
22namespace llvm {
23
24class MBlazeSubtarget : public TargetSubtarget {
25
26protected:
27  bool HasBarrel;
28  bool HasDiv;
29  bool HasMul;
30  bool HasPatCmp;
31  bool HasFPU;
32  bool HasMul64;
33  bool HasSqrt;
34  bool HasItin;
35
36  InstrItineraryData InstrItins;
37
38public:
39
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);
43
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);
48
49  /// Compute the number of maximum number of issues per cycle for the
50  /// MBlaze scheduling itineraries.
51  void computeIssueWidth();
52
53  /// enablePostRAScheduler - True at 'More' optimization.
54  bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
55                             TargetSubtarget::AntiDepBreakMode& Mode,
56                             RegClassVector& CriticalPathRCs) const;
57
58  /// getInstrItins - Return the instruction itineraies based on subtarget.
59  const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
60
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; }
69};
70} // End llvm namespace
71
72#endif
73