2012-02-18 13:03:15 +01:00
|
|
|
//===-- MBlazeSubtarget.h - Define Subtarget for the MBlaze ----*- C++ -*--===//
|
2010-02-23 20:15:24 +01:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2011-07-01 23:01:15 +02:00
|
|
|
// This file declares the MBlaze specific subclass of TargetSubtargetInfo.
|
2010-02-23 20:15:24 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef MBLAZESUBTARGET_H
|
|
|
|
#define MBLAZESUBTARGET_H
|
|
|
|
|
2011-07-01 23:01:15 +02:00
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2011-06-29 03:14:12 +02:00
|
|
|
#include "llvm/MC/MCInstrItineraries.h"
|
2010-02-23 20:15:24 +01:00
|
|
|
#include <string>
|
|
|
|
|
2011-07-01 22:45:01 +02:00
|
|
|
#define GET_SUBTARGETINFO_HEADER
|
2011-07-02 00:36:09 +02:00
|
|
|
#include "MBlazeGenSubtargetInfo.inc"
|
2011-07-01 22:45:01 +02:00
|
|
|
|
2010-02-23 20:15:24 +01:00
|
|
|
namespace llvm {
|
2011-07-07 09:07:08 +02:00
|
|
|
class StringRef;
|
2010-02-23 20:15:24 +01:00
|
|
|
|
2011-07-01 22:45:01 +02:00
|
|
|
class MBlazeSubtarget : public MBlazeGenSubtargetInfo {
|
2010-02-23 20:15:24 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool HasBarrel;
|
|
|
|
bool HasDiv;
|
|
|
|
bool HasMul;
|
|
|
|
bool HasPatCmp;
|
|
|
|
bool HasFPU;
|
|
|
|
bool HasMul64;
|
|
|
|
bool HasSqrt;
|
2011-04-12 00:31:52 +02:00
|
|
|
bool HasItin;
|
2010-02-23 20:15:24 +01:00
|
|
|
|
|
|
|
InstrItineraryData InstrItins;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/// This constructor initializes the data members to match that
|
|
|
|
/// of the specified triple.
|
2011-06-30 03:53:36 +02:00
|
|
|
MBlazeSubtarget(const std::string &TT, const std::string &CPU,
|
|
|
|
const std::string &FS);
|
2010-02-23 20:15:24 +01:00
|
|
|
|
|
|
|
/// ParseSubtargetFeatures - Parses features string setting specified
|
|
|
|
/// subtarget options. Definition of function is auto generated by tblgen.
|
2011-07-07 09:07:08 +02:00
|
|
|
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
|
2010-02-23 20:15:24 +01:00
|
|
|
|
2011-04-12 00:31:52 +02:00
|
|
|
/// Compute the number of maximum number of issues per cycle for the
|
|
|
|
/// MBlaze scheduling itineraries.
|
|
|
|
void computeIssueWidth();
|
|
|
|
|
|
|
|
/// enablePostRAScheduler - True at 'More' optimization.
|
|
|
|
bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
|
2011-07-01 23:01:15 +02:00
|
|
|
TargetSubtargetInfo::AntiDepBreakMode& Mode,
|
2011-04-12 00:31:52 +02:00
|
|
|
RegClassVector& CriticalPathRCs) const;
|
|
|
|
|
|
|
|
/// getInstrItins - Return the instruction itineraies based on subtarget.
|
|
|
|
const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
|
|
|
|
|
|
|
|
bool hasItin() const { return HasItin; }
|
|
|
|
bool hasPCMP() const { return HasPatCmp; }
|
2010-02-23 20:15:24 +01:00
|
|
|
bool hasFPU() const { return HasFPU; }
|
|
|
|
bool hasSqrt() const { return HasSqrt; }
|
|
|
|
bool hasMul() const { return HasMul; }
|
|
|
|
bool hasMul64() const { return HasMul64; }
|
|
|
|
bool hasDiv() const { return HasDiv; }
|
|
|
|
bool hasBarrel() const { return HasBarrel; }
|
|
|
|
};
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|