#ifndef MBLAZESUBTARGET_H
#define MBLAZESUBTARGET_H
#include "llvm/Target/TargetSubtarget.h"
#include "llvm/Target/TargetMachine.h"
#include <string>
namespace llvm {
class MBlazeSubtarget : public TargetSubtarget {
protected:
enum MBlazeArchEnum {
V400, V500, V600, V700, V710
};
MBlazeArchEnum MBlazeArchVersion;
bool HasPipe3;
bool HasBarrel;
bool HasDiv;
bool HasMul;
bool HasFSL;
bool HasEFSL;
bool HasMSRSet;
bool HasException;
bool HasPatCmp;
bool HasFPU;
bool HasESR;
bool HasPVR;
bool HasMul64;
bool HasSqrt;
bool HasMMU;
InstrItineraryData InstrItins;
public:
MBlazeSubtarget(const std::string &TT, const std::string &FS);
std::string ParseSubtargetFeatures(const std::string &FS,
const std::string &CPU);
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; }
bool isV400() const { return MBlazeArchVersion == V400; }
bool isV500() const { return MBlazeArchVersion == V500; }
bool isV600() const { return MBlazeArchVersion == V600; }
bool isV700() const { return MBlazeArchVersion == V700; }
bool isV710() const { return MBlazeArchVersion == V710; }
};
}
#endif