Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 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 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | class MBlazeSubtarget : public TargetSubtarget { |
| 25 | |
| 26 | protected: |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 27 | bool HasBarrel; |
| 28 | bool HasDiv; |
| 29 | bool HasMul; |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 30 | bool HasPatCmp; |
| 31 | bool HasFPU; |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 32 | bool HasMul64; |
| 33 | bool HasSqrt; |
Wesley Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 34 | bool HasItin; |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 35 | |
| 36 | InstrItineraryData InstrItins; |
| 37 | |
| 38 | public: |
| 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 Peck | 3d820ba | 2011-04-11 22:31:52 +0000 | [diff] [blame] | 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; } |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 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; } |
Wesley Peck | a70f28c | 2010-02-23 19:15:24 +0000 | [diff] [blame] | 69 | }; |
| 70 | } // End llvm namespace |
| 71 | |
| 72 | #endif |