2012-03-17 17:39:20 +08:00
|
|
|
//===-- HexagonMCTargetDesc.cpp - Hexagon Target Descriptions -------------===//
|
2011-12-16 06:29:08 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2012-03-17 17:28:37 +08:00
|
|
|
// This file provides Hexagon specific target descriptions.
|
2011-12-16 06:29:08 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "MCTargetDesc/HexagonMCTargetDesc.h"
|
2016-12-17 09:29:35 +08:00
|
|
|
#include "Hexagon.h"
|
2016-12-17 09:09:05 +08:00
|
|
|
#include "HexagonTargetStreamer.h"
|
2014-11-21 05:56:35 +08:00
|
|
|
#include "MCTargetDesc/HexagonInstPrinter.h"
|
2016-12-17 09:09:05 +08:00
|
|
|
#include "MCTargetDesc/HexagonMCAsmInfo.h"
|
|
|
|
#include "MCTargetDesc/HexagonMCELFStreamer.h"
|
2016-12-17 09:17:18 +08:00
|
|
|
#include "MCTargetDesc/HexagonMCInstrInfo.h"
|
2016-12-17 09:09:05 +08:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2017-06-07 11:48:56 +08:00
|
|
|
#include "llvm/BinaryFormat/ELF.h"
|
2015-06-17 11:06:16 +08:00
|
|
|
#include "llvm/MC/MCContext.h"
|
2016-12-17 09:09:05 +08:00
|
|
|
#include "llvm/MC/MCDwarf.h"
|
2014-11-07 01:05:51 +08:00
|
|
|
#include "llvm/MC/MCELFStreamer.h"
|
2017-02-07 03:35:46 +08:00
|
|
|
#include "llvm/MC/MCInstrAnalysis.h"
|
2011-12-16 06:29:08 +08:00
|
|
|
#include "llvm/MC/MCInstrInfo.h"
|
|
|
|
#include "llvm/MC/MCRegisterInfo.h"
|
2013-02-21 00:13:27 +08:00
|
|
|
#include "llvm/MC/MCStreamer.h"
|
2011-12-16 06:29:08 +08:00
|
|
|
#include "llvm/MC/MCSubtargetInfo.h"
|
2012-02-05 15:21:30 +08:00
|
|
|
#include "llvm/Support/ErrorHandling.h"
|
2011-12-16 06:29:08 +08:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2016-12-17 09:09:05 +08:00
|
|
|
#include <cassert>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <new>
|
|
|
|
#include <string>
|
2011-12-16 06:29:08 +08:00
|
|
|
|
2014-04-22 10:03:14 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
2011-12-16 06:29:08 +08:00
|
|
|
#define GET_INSTRINFO_MC_DESC
|
|
|
|
#include "HexagonGenInstrInfo.inc"
|
|
|
|
|
|
|
|
#define GET_SUBTARGETINFO_MC_DESC
|
|
|
|
#include "HexagonGenSubtargetInfo.inc"
|
|
|
|
|
|
|
|
#define GET_REGINFO_MC_DESC
|
|
|
|
#include "HexagonGenRegisterInfo.inc"
|
|
|
|
|
2015-11-09 12:07:48 +08:00
|
|
|
cl::opt<bool> llvm::HexagonDisableCompound
|
|
|
|
("mno-compound",
|
|
|
|
cl::desc("Disable looking for compound instructions for Hexagon"));
|
|
|
|
|
|
|
|
cl::opt<bool> llvm::HexagonDisableDuplex
|
|
|
|
("mno-pairing",
|
|
|
|
cl::desc("Disable looking for duplex instructions for Hexagon"));
|
|
|
|
|
2016-04-21 05:17:40 +08:00
|
|
|
static cl::opt<bool> HexagonV4ArchVariant("mv4", cl::Hidden, cl::init(false),
|
|
|
|
cl::desc("Build for Hexagon V4"));
|
|
|
|
|
|
|
|
static cl::opt<bool> HexagonV5ArchVariant("mv5", cl::Hidden, cl::init(false),
|
|
|
|
cl::desc("Build for Hexagon V5"));
|
|
|
|
|
|
|
|
static cl::opt<bool> HexagonV55ArchVariant("mv55", cl::Hidden, cl::init(false),
|
|
|
|
cl::desc("Build for Hexagon V55"));
|
|
|
|
|
|
|
|
static cl::opt<bool> HexagonV60ArchVariant("mv60", cl::Hidden, cl::init(false),
|
|
|
|
cl::desc("Build for Hexagon V60"));
|
|
|
|
|
2017-02-11 07:46:45 +08:00
|
|
|
static cl::opt<bool> HexagonV62ArchVariant("mv62", cl::Hidden, cl::init(false),
|
|
|
|
cl::desc("Build for Hexagon V62"));
|
|
|
|
|
2017-03-10 01:05:11 +08:00
|
|
|
static cl::opt<bool> EnableHVX("mhvx", cl::Hidden, cl::init(false),
|
|
|
|
cl::desc("Enable Hexagon Vector Extension (HVX)"));
|
|
|
|
|
2016-04-21 05:17:40 +08:00
|
|
|
static StringRef DefaultArch = "hexagonv60";
|
|
|
|
|
|
|
|
static StringRef HexagonGetArchVariant() {
|
|
|
|
if (HexagonV4ArchVariant)
|
|
|
|
return "hexagonv4";
|
|
|
|
if (HexagonV5ArchVariant)
|
|
|
|
return "hexagonv5";
|
|
|
|
if (HexagonV55ArchVariant)
|
|
|
|
return "hexagonv55";
|
|
|
|
if (HexagonV60ArchVariant)
|
|
|
|
return "hexagonv60";
|
2017-02-11 07:46:45 +08:00
|
|
|
if (HexagonV62ArchVariant)
|
|
|
|
return "hexagonv62";
|
2016-04-21 05:17:40 +08:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2016-08-19 22:09:47 +08:00
|
|
|
StringRef Hexagon_MC::selectHexagonCPU(const Triple &TT, StringRef CPU) {
|
2016-04-21 05:17:40 +08:00
|
|
|
StringRef ArchV = HexagonGetArchVariant();
|
|
|
|
if (!ArchV.empty() && !CPU.empty()) {
|
|
|
|
if (ArchV != CPU)
|
|
|
|
report_fatal_error("conflicting architectures specified.");
|
|
|
|
return CPU;
|
|
|
|
}
|
|
|
|
if (ArchV.empty()) {
|
|
|
|
if (CPU.empty())
|
|
|
|
CPU = DefaultArch;
|
|
|
|
return CPU;
|
|
|
|
}
|
|
|
|
return ArchV;
|
2015-12-14 23:03:54 +08:00
|
|
|
}
|
|
|
|
|
2017-02-11 19:06:55 +08:00
|
|
|
unsigned llvm::HexagonGetLastSlot() { return HexagonItinerariesV4FU::SLOT3; }
|
2011-12-16 06:29:08 +08:00
|
|
|
|
2015-06-19 04:43:50 +08:00
|
|
|
namespace {
|
2016-12-17 09:09:05 +08:00
|
|
|
|
2015-06-19 04:43:50 +08:00
|
|
|
class HexagonTargetAsmStreamer : public HexagonTargetStreamer {
|
|
|
|
public:
|
|
|
|
HexagonTargetAsmStreamer(MCStreamer &S,
|
2017-02-07 03:35:46 +08:00
|
|
|
formatted_raw_ostream &OS,
|
|
|
|
bool isVerboseAsm,
|
|
|
|
MCInstPrinter &IP)
|
2015-06-19 05:03:13 +08:00
|
|
|
: HexagonTargetStreamer(S) {}
|
2016-12-17 09:09:05 +08:00
|
|
|
|
2015-06-19 04:43:50 +08:00
|
|
|
void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS,
|
|
|
|
const MCInst &Inst, const MCSubtargetInfo &STI) override {
|
|
|
|
assert(HexagonMCInstrInfo::isBundle(Inst));
|
|
|
|
assert(HexagonMCInstrInfo::bundleSize(Inst) <= HEXAGON_PACKET_SIZE);
|
|
|
|
std::string Buffer;
|
|
|
|
{
|
|
|
|
raw_string_ostream TempStream(Buffer);
|
|
|
|
InstPrinter.printInst(&Inst, TempStream, "", STI);
|
|
|
|
}
|
|
|
|
StringRef Contents(Buffer);
|
|
|
|
auto PacketBundle = Contents.rsplit('\n');
|
|
|
|
auto HeadTail = PacketBundle.first.split('\n');
|
2015-11-10 08:22:00 +08:00
|
|
|
StringRef Separator = "\n";
|
|
|
|
StringRef Indent = "\t\t";
|
|
|
|
OS << "\t{\n";
|
|
|
|
while (!HeadTail.first.empty()) {
|
|
|
|
StringRef InstTxt;
|
2015-06-19 04:43:50 +08:00
|
|
|
auto Duplex = HeadTail.first.split('\v');
|
2015-11-10 08:22:00 +08:00
|
|
|
if (!Duplex.second.empty()) {
|
|
|
|
OS << Indent << Duplex.first << Separator;
|
|
|
|
InstTxt = Duplex.second;
|
|
|
|
} else if (!HeadTail.first.trim().startswith("immext")) {
|
|
|
|
InstTxt = Duplex.first;
|
2015-06-19 04:43:50 +08:00
|
|
|
}
|
2015-11-10 08:22:00 +08:00
|
|
|
if (!InstTxt.empty())
|
|
|
|
OS << Indent << InstTxt << Separator;
|
2015-06-19 04:43:50 +08:00
|
|
|
HeadTail = HeadTail.second.split('\n');
|
|
|
|
}
|
2015-11-10 08:22:00 +08:00
|
|
|
OS << "\t}" << PacketBundle.second;
|
2015-06-19 04:43:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-06-17 11:06:16 +08:00
|
|
|
class HexagonTargetELFStreamer : public HexagonTargetStreamer {
|
|
|
|
public:
|
2017-02-07 03:35:46 +08:00
|
|
|
MCELFStreamer &getStreamer() {
|
|
|
|
return static_cast<MCELFStreamer &>(Streamer);
|
|
|
|
}
|
2015-06-17 11:06:16 +08:00
|
|
|
HexagonTargetELFStreamer(MCStreamer &S, MCSubtargetInfo const &STI)
|
|
|
|
: HexagonTargetStreamer(S) {
|
2017-02-07 03:35:46 +08:00
|
|
|
MCAssembler &MCA = getStreamer().getAssembler();
|
|
|
|
MCA.setELFHeaderEFlags(Hexagon_MC::GetELFFlags(STI));
|
2015-06-17 11:06:16 +08:00
|
|
|
}
|
2016-12-17 09:09:05 +08:00
|
|
|
|
|
|
|
|
2015-06-17 11:06:16 +08:00
|
|
|
void EmitCommonSymbolSorted(MCSymbol *Symbol, uint64_t Size,
|
|
|
|
unsigned ByteAlignment,
|
|
|
|
unsigned AccessSize) override {
|
|
|
|
HexagonMCELFStreamer &HexagonELFStreamer =
|
|
|
|
static_cast<HexagonMCELFStreamer &>(getStreamer());
|
|
|
|
HexagonELFStreamer.HexagonMCEmitCommonSymbol(Symbol, Size, ByteAlignment,
|
|
|
|
AccessSize);
|
|
|
|
}
|
2016-12-17 09:09:05 +08:00
|
|
|
|
2015-06-17 11:06:16 +08:00
|
|
|
void EmitLocalCommonSymbolSorted(MCSymbol *Symbol, uint64_t Size,
|
|
|
|
unsigned ByteAlignment,
|
|
|
|
unsigned AccessSize) override {
|
|
|
|
HexagonMCELFStreamer &HexagonELFStreamer =
|
|
|
|
static_cast<HexagonMCELFStreamer &>(getStreamer());
|
|
|
|
HexagonELFStreamer.HexagonMCEmitLocalCommonSymbol(
|
|
|
|
Symbol, Size, ByteAlignment, AccessSize);
|
|
|
|
}
|
|
|
|
};
|
2016-12-17 09:09:05 +08:00
|
|
|
|
|
|
|
} // end anonymous namespace
|
2015-06-17 11:06:16 +08:00
|
|
|
|
2017-02-07 03:35:46 +08:00
|
|
|
llvm::MCInstrInfo *llvm::createHexagonMCInstrInfo() {
|
|
|
|
MCInstrInfo *X = new MCInstrInfo();
|
|
|
|
InitHexagonMCInstrInfo(X);
|
|
|
|
return X;
|
|
|
|
}
|
|
|
|
|
|
|
|
static MCRegisterInfo *createHexagonMCRegisterInfo(const Triple &TT) {
|
|
|
|
MCRegisterInfo *X = new MCRegisterInfo();
|
|
|
|
InitHexagonMCRegisterInfo(X, Hexagon::R31);
|
|
|
|
return X;
|
|
|
|
}
|
|
|
|
|
2013-05-13 09:16:13 +08:00
|
|
|
static MCAsmInfo *createHexagonMCAsmInfo(const MCRegisterInfo &MRI,
|
2015-09-16 00:17:27 +08:00
|
|
|
const Triple &TT) {
|
2013-05-11 02:16:59 +08:00
|
|
|
MCAsmInfo *MAI = new HexagonMCAsmInfo(TT);
|
2011-12-16 06:29:08 +08:00
|
|
|
|
|
|
|
// VirtualFP = (R30 + #0).
|
2014-10-03 21:18:11 +08:00
|
|
|
MCCFIInstruction Inst =
|
2017-02-07 03:35:46 +08:00
|
|
|
MCCFIInstruction::createDefCfa(nullptr,
|
|
|
|
MRI.getDwarfRegNum(Hexagon::R30, true), 0);
|
2013-05-13 09:16:13 +08:00
|
|
|
MAI->addInitialFrameState(Inst);
|
2011-12-16 06:29:08 +08:00
|
|
|
|
|
|
|
return MAI;
|
|
|
|
}
|
|
|
|
|
2015-09-16 00:17:27 +08:00
|
|
|
static MCInstPrinter *createHexagonMCInstPrinter(const Triple &T,
|
2015-03-31 08:10:04 +08:00
|
|
|
unsigned SyntaxVariant,
|
2014-10-16 02:27:40 +08:00
|
|
|
const MCAsmInfo &MAI,
|
|
|
|
const MCInstrInfo &MII,
|
2017-02-07 03:35:46 +08:00
|
|
|
const MCRegisterInfo &MRI)
|
|
|
|
{
|
2015-04-10 03:20:37 +08:00
|
|
|
if (SyntaxVariant == 0)
|
2017-02-07 03:35:46 +08:00
|
|
|
return new HexagonInstPrinter(MAI, MII, MRI);
|
2015-04-10 03:20:37 +08:00
|
|
|
else
|
2015-06-17 11:06:16 +08:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-02-07 03:35:46 +08:00
|
|
|
static MCTargetStreamer *
|
|
|
|
createMCAsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS,
|
|
|
|
MCInstPrinter *IP, bool IsVerboseAsm) {
|
|
|
|
return new HexagonTargetAsmStreamer(S, OS, IsVerboseAsm, *IP);
|
2015-06-19 04:43:50 +08:00
|
|
|
}
|
|
|
|
|
2017-02-07 03:35:46 +08:00
|
|
|
static MCStreamer *createMCStreamer(Triple const &T,
|
|
|
|
MCContext &Context,
|
|
|
|
MCAsmBackend &MAB,
|
|
|
|
raw_pwrite_stream &OS,
|
|
|
|
MCCodeEmitter *Emitter,
|
|
|
|
bool RelaxAll) {
|
|
|
|
return createHexagonELFStreamer(T, Context, MAB, OS, Emitter);
|
2015-06-17 11:06:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static MCTargetStreamer *
|
2017-02-07 03:35:46 +08:00
|
|
|
createHexagonObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
|
2015-06-17 11:06:16 +08:00
|
|
|
return new HexagonTargetELFStreamer(S, STI);
|
2014-10-16 02:27:40 +08:00
|
|
|
}
|
2011-12-16 06:29:08 +08:00
|
|
|
|
2017-02-07 03:35:46 +08:00
|
|
|
static void LLVM_ATTRIBUTE_UNUSED clearFeature(MCSubtargetInfo* STI, uint64_t F) {
|
|
|
|
uint64_t FB = STI->getFeatureBits().to_ullong();
|
|
|
|
if (FB & (1ULL << F))
|
|
|
|
STI->ToggleFeature(F);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool LLVM_ATTRIBUTE_UNUSED checkFeature(MCSubtargetInfo* STI, uint64_t F) {
|
|
|
|
uint64_t FB = STI->getFeatureBits().to_ullong();
|
|
|
|
return (FB & (1ULL << F)) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
StringRef Hexagon_MC::ParseHexagonTriple(const Triple &TT, StringRef CPU) {
|
|
|
|
StringRef CPUName = Hexagon_MC::selectHexagonCPU(TT, CPU);
|
|
|
|
StringRef FS = "";
|
2017-03-10 01:05:11 +08:00
|
|
|
if (EnableHVX) {
|
|
|
|
if (CPUName.equals_lower("hexagonv60") ||
|
|
|
|
CPUName.equals_lower("hexagonv62"))
|
|
|
|
FS = "+hvx";
|
|
|
|
}
|
2017-02-07 03:35:46 +08:00
|
|
|
return FS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool isCPUValid(std::string CPU)
|
|
|
|
{
|
|
|
|
std::vector<std::string> table
|
|
|
|
{
|
|
|
|
"hexagonv4",
|
|
|
|
"hexagonv5",
|
|
|
|
"hexagonv55",
|
|
|
|
"hexagonv60",
|
2017-02-11 07:46:45 +08:00
|
|
|
"hexagonv62",
|
2017-02-07 03:35:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return std::find(table.begin(), table.end(), CPU) != table.end();
|
|
|
|
}
|
|
|
|
|
|
|
|
MCSubtargetInfo *Hexagon_MC::createHexagonMCSubtargetInfo(const Triple &TT,
|
|
|
|
StringRef CPU,
|
|
|
|
StringRef FS) {
|
|
|
|
StringRef ArchFS = (FS.size()) ? FS : Hexagon_MC::ParseHexagonTriple(TT, CPU);
|
|
|
|
StringRef CPUName = Hexagon_MC::selectHexagonCPU(TT, CPU);
|
2017-02-11 07:46:45 +08:00
|
|
|
if (!isCPUValid(CPUName.str())) {
|
|
|
|
errs() << "error: invalid CPU \"" << CPUName.str().c_str()
|
|
|
|
<< "\" specified\n";
|
2017-02-07 03:35:46 +08:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
MCSubtargetInfo *X = createHexagonMCSubtargetInfoImpl(TT, CPUName, ArchFS);
|
|
|
|
if (X->getFeatureBits()[Hexagon::ExtensionHVXDbl]) {
|
|
|
|
llvm::FeatureBitset Features = X->getFeatureBits();
|
|
|
|
X->setFeatureBits(Features.set(Hexagon::ExtensionHVX));
|
|
|
|
}
|
|
|
|
return X;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned Hexagon_MC::GetELFFlags(const MCSubtargetInfo &STI) {
|
|
|
|
static std::map<StringRef,unsigned> ElfFlags = {
|
|
|
|
{"hexagonv4", ELF::EF_HEXAGON_MACH_V4},
|
|
|
|
{"hexagonv5", ELF::EF_HEXAGON_MACH_V5},
|
|
|
|
{"hexagonv55", ELF::EF_HEXAGON_MACH_V55},
|
|
|
|
{"hexagonv60", ELF::EF_HEXAGON_MACH_V60},
|
2017-02-11 07:46:45 +08:00
|
|
|
{"hexagonv62", ELF::EF_HEXAGON_MACH_V62},
|
2017-02-07 03:35:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
auto F = ElfFlags.find(STI.getCPU());
|
|
|
|
assert(F != ElfFlags.end() && "Unrecognized Architecture");
|
|
|
|
return F->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
class HexagonMCInstrAnalysis : public MCInstrAnalysis {
|
|
|
|
public:
|
|
|
|
HexagonMCInstrAnalysis(MCInstrInfo const *Info) : MCInstrAnalysis(Info) {}
|
|
|
|
|
|
|
|
bool isUnconditionalBranch(MCInst const &Inst) const override {
|
|
|
|
//assert(!HexagonMCInstrInfo::isBundle(Inst));
|
|
|
|
return MCInstrAnalysis::isUnconditionalBranch(Inst);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isConditionalBranch(MCInst const &Inst) const override {
|
|
|
|
//assert(!HexagonMCInstrInfo::isBundle(Inst));
|
|
|
|
return MCInstrAnalysis::isConditionalBranch(Inst);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool evaluateBranch(MCInst const &Inst, uint64_t Addr,
|
|
|
|
uint64_t Size, uint64_t &Target) const override {
|
|
|
|
//assert(!HexagonMCInstrInfo::isBundle(Inst));
|
|
|
|
if(!HexagonMCInstrInfo::isExtendable(*Info, Inst))
|
|
|
|
return false;
|
|
|
|
auto const &Extended(HexagonMCInstrInfo::getExtendableOperand(*Info, Inst));
|
|
|
|
assert(Extended.isExpr());
|
|
|
|
int64_t Value;
|
|
|
|
if(!Extended.getExpr()->evaluateAsAbsolute(Value))
|
|
|
|
return false;
|
|
|
|
Target = Value;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
static MCInstrAnalysis *createHexagonMCInstrAnalysis(const MCInstrInfo *Info) {
|
|
|
|
return new HexagonMCInstrAnalysis(Info);
|
|
|
|
}
|
|
|
|
|
2011-12-16 06:29:08 +08:00
|
|
|
// Force static initialization.
|
|
|
|
extern "C" void LLVMInitializeHexagonTargetMC() {
|
|
|
|
// Register the MC asm info.
|
2016-10-10 07:00:34 +08:00
|
|
|
RegisterMCAsmInfoFn X(getTheHexagonTarget(), createHexagonMCAsmInfo);
|
2011-12-16 06:29:08 +08:00
|
|
|
|
|
|
|
// Register the MC instruction info.
|
2016-10-10 07:00:34 +08:00
|
|
|
TargetRegistry::RegisterMCInstrInfo(getTheHexagonTarget(),
|
2014-10-03 21:18:11 +08:00
|
|
|
createHexagonMCInstrInfo);
|
2011-12-16 06:29:08 +08:00
|
|
|
|
|
|
|
// Register the MC register info.
|
2016-10-10 07:00:34 +08:00
|
|
|
TargetRegistry::RegisterMCRegInfo(getTheHexagonTarget(),
|
2011-12-16 06:29:08 +08:00
|
|
|
createHexagonMCRegisterInfo);
|
|
|
|
|
|
|
|
// Register the MC subtarget info.
|
2016-10-10 07:00:34 +08:00
|
|
|
TargetRegistry::RegisterMCSubtargetInfo(getTheHexagonTarget(),
|
2017-02-07 03:35:46 +08:00
|
|
|
Hexagon_MC::createHexagonMCSubtargetInfo);
|
2014-10-03 21:18:11 +08:00
|
|
|
|
|
|
|
// Register the MC Code Emitter
|
2016-10-10 07:00:34 +08:00
|
|
|
TargetRegistry::RegisterMCCodeEmitter(getTheHexagonTarget(),
|
2014-10-03 21:18:11 +08:00
|
|
|
createHexagonMCCodeEmitter);
|
2014-10-16 02:27:40 +08:00
|
|
|
|
2015-06-04 01:34:16 +08:00
|
|
|
// Register the asm backend
|
2016-10-10 07:00:34 +08:00
|
|
|
TargetRegistry::RegisterMCAsmBackend(getTheHexagonTarget(),
|
2015-06-04 01:34:16 +08:00
|
|
|
createHexagonAsmBackend);
|
|
|
|
|
2017-02-07 03:35:46 +08:00
|
|
|
|
|
|
|
// Register the MC instruction analyzer.
|
|
|
|
TargetRegistry::RegisterMCInstrAnalysis(getTheHexagonTarget(),
|
|
|
|
createHexagonMCInstrAnalysis);
|
|
|
|
|
2015-06-17 11:06:16 +08:00
|
|
|
// Register the obj streamer
|
2017-02-07 03:35:46 +08:00
|
|
|
TargetRegistry::RegisterELFStreamer(getTheHexagonTarget(),
|
|
|
|
createMCStreamer);
|
|
|
|
|
|
|
|
// Register the obj target streamer
|
|
|
|
TargetRegistry::RegisterObjectTargetStreamer(getTheHexagonTarget(),
|
|
|
|
createHexagonObjectTargetStreamer);
|
2015-06-17 11:06:16 +08:00
|
|
|
|
2015-06-19 04:43:50 +08:00
|
|
|
// Register the asm streamer
|
2016-10-10 07:00:34 +08:00
|
|
|
TargetRegistry::RegisterAsmTargetStreamer(getTheHexagonTarget(),
|
2015-06-19 04:43:50 +08:00
|
|
|
createMCAsmTargetStreamer);
|
|
|
|
|
2014-10-16 02:27:40 +08:00
|
|
|
// Register the MC Inst Printer
|
2016-10-10 07:00:34 +08:00
|
|
|
TargetRegistry::RegisterMCInstPrinter(getTheHexagonTarget(),
|
2014-10-16 02:27:40 +08:00
|
|
|
createHexagonMCInstPrinter);
|
2011-12-16 06:29:08 +08:00
|
|
|
}
|