LLVM API Documentation

MBlazeSubtarget.h
Go to the documentation of this file.
00001 //===-- MBlazeSubtarget.h - Define Subtarget for the MBlaze ----*- C++ -*--===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the MBlaze specific subclass of TargetSubtargetInfo.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef MBLAZESUBTARGET_H
00015 #define MBLAZESUBTARGET_H
00016 
00017 #include "llvm/MC/MCInstrItineraries.h"
00018 #include "llvm/Target/TargetSubtargetInfo.h"
00019 #include <string>
00020 
00021 #define GET_SUBTARGETINFO_HEADER
00022 #include "MBlazeGenSubtargetInfo.inc"
00023 
00024 namespace llvm {
00025 class StringRef;
00026 
00027 class MBlazeSubtarget : public MBlazeGenSubtargetInfo {
00028 
00029 protected:
00030   bool HasBarrel;
00031   bool HasDiv;
00032   bool HasMul;
00033   bool HasPatCmp;
00034   bool HasFPU;
00035   bool HasMul64;
00036   bool HasSqrt;
00037   bool HasItin;
00038 
00039   InstrItineraryData InstrItins;
00040 
00041 public:
00042 
00043   /// This constructor initializes the data members to match that
00044   /// of the specified triple.
00045   MBlazeSubtarget(const std::string &TT, const std::string &CPU,
00046                   const std::string &FS);
00047 
00048   /// ParseSubtargetFeatures - Parses features string setting specified
00049   /// subtarget options.  Definition of function is auto generated by tblgen.
00050   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
00051 
00052   /// Compute the number of maximum number of issues per cycle for the
00053   /// MBlaze scheduling itineraries.
00054   void computeIssueWidth();
00055 
00056   /// enablePostRAScheduler - True at 'More' optimization.
00057   bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
00058                              TargetSubtargetInfo::AntiDepBreakMode& Mode,
00059                              RegClassVector& CriticalPathRCs) const;
00060 
00061   /// getInstrItins - Return the instruction itineraies based on subtarget.
00062   const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
00063 
00064   bool hasItin()   const { return HasItin; }
00065   bool hasPCMP()   const { return HasPatCmp; }
00066   bool hasFPU()    const { return HasFPU; }
00067   bool hasSqrt()   const { return HasSqrt; }
00068   bool hasMul()    const { return HasMul; }
00069   bool hasMul64()  const { return HasMul64; }
00070   bool hasDiv()    const { return HasDiv; }
00071   bool hasBarrel() const { return HasBarrel; }
00072 };
00073 } // End llvm namespace
00074 
00075 #endif