30 #define GET_REGINFO_MC_DESC
31 #include "ARMGenRegisterInfo.inc"
43 Info =
"deprecated since v7, use 'isb'";
50 Info =
"deprecated since v7, use 'dsb'";
58 Info =
"deprecated since v7, use 'dmb'";
69 Info =
"applying IT instruction to more than one subsequent instruction is deprecated";
76 #define GET_INSTRINFO_MC_DESC
77 #include "ARMGenInstrInfo.inc"
79 #define GET_SUBTARGETINFO_MC_DESC
80 #include "ARMGenSubtargetInfo.inc"
88 unsigned Len = TT.
size();
93 if (Len >= 5 && TT.
substr(0, 4) ==
"armv")
95 else if (Len >= 6 && TT.
substr(0, 5) ==
"thumb") {
97 if (Len >= 7 && TT[5] ==
'v')
101 bool NoCPU = CPU ==
"generic" || CPU.
empty();
102 std::string ARMArchFeature;
104 unsigned SubVer = TT[Idx];
109 ARMArchFeature =
"+v8,+db,+fp-armv8,+neon,+t2dsp,+mp,+hwdiv,+hwdiv-arm,+trustzone,+t2xtpk,+crypto,+crc";
112 ARMArchFeature =
"+v8";
113 }
else if (SubVer ==
'7') {
114 if (Len >= Idx+2 && TT[Idx+1] ==
'm') {
118 ARMArchFeature =
"+v7,+noarm,+db,+hwdiv,+mclass";
121 ARMArchFeature =
"+v7";
122 }
else if (Len >= Idx+3 && TT[Idx+1] ==
'e'&& TT[Idx+2] ==
'm') {
126 ARMArchFeature =
"+v7,+noarm,+db,+hwdiv,+t2dsp,t2xtpk,+mclass";
129 ARMArchFeature =
"+v7";
130 }
else if (Len >= Idx+2 && TT[Idx+1] ==
's') {
134 ARMArchFeature =
"+v7,+swift,+neon,+db,+t2dsp,+t2xtpk";
137 ARMArchFeature =
"+v7";
145 ARMArchFeature =
"+v7,+neon,+db,+t2dsp,+t2xtpk";
148 ARMArchFeature =
"+v7";
150 }
else if (SubVer ==
'6') {
151 if (Len >= Idx+3 && TT[Idx+1] ==
't' && TT[Idx+2] ==
'2')
152 ARMArchFeature =
"+v6t2";
153 else if (Len >= Idx+2 && TT[Idx+1] ==
'm') {
157 ARMArchFeature =
"+v6m,+noarm,+mclass";
159 ARMArchFeature =
"+v6";
161 ARMArchFeature =
"+v6";
162 }
else if (SubVer ==
'5') {
163 if (Len >= Idx+3 && TT[Idx+1] ==
't' && TT[Idx+2] ==
'e')
164 ARMArchFeature =
"+v5te";
166 ARMArchFeature =
"+v5t";
167 }
else if (SubVer ==
'4' && Len >= Idx+2 && TT[Idx+1] ==
't')
168 ARMArchFeature =
"+v4t";
172 if (ARMArchFeature.empty())
173 ARMArchFeature =
"+thumb-mode";
175 ARMArchFeature +=
",+thumb-mode";
179 if (ARMArchFeature.empty())
180 ARMArchFeature =
"+nacl-trap";
182 ARMArchFeature +=
",+nacl-trap";
185 return ARMArchFeature;
193 ArchFS = ArchFS +
"," + FS.
str();
199 InitARMMCSubtargetInfo(X, TT, CPU, ArchFS);
205 InitARMMCInstrInfo(X);
211 InitARMMCRegisterInfo(X, ARM::LR, 0, 0, ARM::PC);
258 unsigned SyntaxVariant,
263 if (SyntaxVariant == 0)
283 virtual bool isUnconditionalBranch(
const MCInst &Inst)
const {
290 virtual bool isConditionalBranch(
const MCInst &Inst)
const {
297 bool evaluateBranch(
const MCInst &Inst, uint64_t Addr,
298 uint64_t Size, uint64_t &
Target)
const {
313 return new ARMMCInstrAnalysis(Info);
size_t size() const
size - Get the string size.
MCStreamer * createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, bool isVerboseAsm, bool useLoc, bool useCFI, bool useDwarfDirectory, MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst)
static MCAsmInfo * createARMMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT)
static void RegisterMCInstrAnalysis(Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
static MCInstrInfo * createARMMCInstrInfo()
MCRelocationInfo * createARMMachORelocationInfo(MCContext &Ctx)
createARMMachORelocationInfo - Construct ARM Mach-O relocation info.
StringRef substr(size_t Start, size_t N=npos) const
std::string str() const
str - Get the contents as an std::string.
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
void LLVMInitializeARMTargetMC()
bool isOSWindows() const
Tests whether the OS is Windows.
MCCodeEmitter * createARMMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, const MCSubtargetInfo &STI, MCContext &Ctx)
MCStreamer * createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *CE, bool RelaxAll=false)
#define llvm_unreachable(msg)
bool isEnvironmentMachO() const
Tests whether the environment is MachO.
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
void InitMCCodeGenInfo(Reloc::Model RM=Reloc::Default, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default)
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
static MCRelocationInfo * createARMMCRelocationInfo(StringRef TT, MCContext &Ctx)
virtual bool isUnconditionalBranch(const MCInst &Inst) const
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
static MCInstPrinter * createARMMCInstPrinter(const Target &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI, const MCSubtargetInfo &STI)
static void RegisterMCObjectStreamer(Target &T, Target::MCObjectStreamerCtorTy Fn)
MCCodeEmitter - Generic instruction encoding interface.
static void RegisterAsmStreamer(Target &T, Target::AsmStreamerCtorTy Fn)
static MCStreamer * createMCStreamer(const Target &T, StringRef TT, MCContext &Ctx, MCAsmBackend &MAB, raw_ostream &OS, MCCodeEmitter *Emitter, bool RelaxAll, bool NoExecStack)
Create MCExprs from relocations found in an object file.
static void RegisterMCCodeGenInfo(Target &T, Target::MCCodeGenInfoCtorFnTy Fn)
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
std::string ParseARMTriple(StringRef TT, StringRef CPU)
static bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI, std::string &Info)
MCRelocationInfo * createMCRelocationInfo(StringRef TT, MCContext &Ctx)
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X or iOS).
static MCCodeGenInfo * createARMMCCodeGenInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
uint64_t getFeatureBits() const
virtual bool isConditionalBranch(const MCInst &Inst) const
MCSubtargetInfo * createARMMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS)
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
unsigned getOpcode() const
static bool getITDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI, std::string &Info)
MCAsmBackend * createARMAsmBackend(const Target &T, const MCRegisterInfo &MRI, StringRef TT, StringRef CPU)
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
static MCRegisterInfo * createARMMCRegisterInfo(StringRef Triple)
MCELFStreamer * createARMELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *Emitter, bool RelaxAll, bool NoExecStack, bool IsThumb)
static MCInstrAnalysis * createARMMCInstrAnalysis(const MCInstrInfo *Info)
MCAsmBackend - Generic interface to target specific assembler backends.
cl::opt< bool > RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, ""relax all fixups in the emitted object file"))
static void RegisterMCRelocationInfo(Target &T, Target::MCRelocationInfoCtorTy Fn)
const MCRegisterInfo & MRI
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")
const MCOperand & getOperand(unsigned i) const
bool empty() const
empty - Check if the string is empty.