blob: 2255b2809be2a6dc517f38c30d09967ab458982b [file] [log] [blame]
Wesley Pecka70f28c2010-02-23 19:15:24 +00001//=====-- 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:
Wesley Pecka70f28c2010-02-23 19:15:24 +000027 bool HasBarrel;
28 bool HasDiv;
29 bool HasMul;
Wesley Pecka70f28c2010-02-23 19:15:24 +000030 bool HasPatCmp;
31 bool HasFPU;
Wesley Pecka70f28c2010-02-23 19:15:24 +000032 bool HasMul64;
33 bool HasSqrt;
Wesley Peck3d820ba2011-04-11 22:31:52 +000034 bool HasItin;
Wesley Pecka70f28c2010-02-23 19:15:24 +000035
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
Wesley Peck3d820ba2011-04-11 22:31:52 +000049 /// 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; }
Wesley Pecka70f28c2010-02-23 19:15:24 +000063 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; }
Wesley Pecka70f28c2010-02-23 19:15:24 +000069};
70} // End llvm namespace
71
72#endif