34 #define GET_INSTRINFO_MC_DESC 35 #define GET_INSTRINFO_MC_HELPERS 36 #include "AArch64GenInstrInfo.inc" 38 #define GET_SUBTARGETINFO_MC_DESC 39 #include "AArch64GenSubtargetInfo.inc" 41 #define GET_REGINFO_MC_DESC 42 #include "AArch64GenRegisterInfo.inc" 46 InitAArch64MCInstrInfo(X);
55 return createAArch64MCSubtargetInfoImpl(TT, CPU, FS);
59 for (
unsigned Reg = AArch64::NoRegister + 1;
60 Reg < AArch64::NUM_TARGET_REGS; ++
Reg) {
68 InitAArch64MCRegisterInfo(X, AArch64::LR);
96 unsigned SyntaxVariant,
100 if (SyntaxVariant == 0)
102 if (SyntaxVariant == 1)
109 std::unique_ptr<MCAsmBackend> &&TAB,
110 std::unique_ptr<MCObjectWriter> &&OW,
111 std::unique_ptr<MCCodeEmitter> &&Emitter,
114 std::move(Emitter), RelaxAll);
118 std::unique_ptr<MCAsmBackend> &&TAB,
119 std::unique_ptr<MCObjectWriter> &&OW,
120 std::unique_ptr<MCCodeEmitter> &&Emitter,
122 bool DWARFMustBeAtTheEnd) {
124 std::move(Emitter), RelaxAll, DWARFMustBeAtTheEnd,
130 std::unique_ptr<MCObjectWriter> &&OW,
131 std::unique_ptr<MCCodeEmitter> &&Emitter,
bool RelaxAll,
132 bool IncrementalLinkerCompatible) {
134 std::move(Emitter), RelaxAll,
135 IncrementalLinkerCompatible);
144 bool evaluateBranch(
const MCInst &Inst, uint64_t Addr, uint64_t
Size,
145 uint64_t &
Target)
const override {
160 std::vector<std::pair<uint64_t, uint64_t>>
162 uint64_t GotPltSectionVA,
163 const Triple &TargetTriple)
const override {
165 std::vector<std::pair<uint64_t, uint64_t>> Result;
166 for (uint64_t Byte = 0, End = PltContents.
size(); Byte + 7 < End;
170 if ((Insn & 0x9f000000) != 0x90000000)
172 uint64_t Imm = (((PltSectionVA + Byte) >> 12) << 12) +
173 (((Insn >> 29) & 3) << 12) + (((Insn >> 5) & 0x3ffff) << 14);
176 if (Insn2 >> 22 == 0x3e5) {
177 Imm += ((Insn2 >> 10) & 0xfff) << 3;
178 Result.push_back(std::make_pair(PltSectionVA + Byte, Imm));
189 return new AArch64MCInstrAnalysis(Info);
Target & getTheAArch64beTarget()
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static MCInstrAnalysis * createAArch64InstrAnalysis(const MCInstrInfo *Info)
This class represents lattice values for constants.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Target & getTheAArch64leTarget()
static void RegisterMCInstrAnalysis(Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
RegisterMCInstrAnalysis - Register a MCInstrAnalysis implementation for the given target...
MCWinCOFFStreamer * createAArch64WinCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
static MCInstrInfo * createAArch64MCInstrInfo()
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
MCAsmBackend * createAArch64leAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
int getDwarfRegNum(unsigned RegNum, bool isEH) const
Map a target register to an equivalent dwarf register number.
Target & getTheARM64Target()
static void RegisterCOFFStreamer(Target &T, Target::COFFStreamerCtorTy Fn)
Context object for machine code objects.
void addInitialFrameState(const MCCFIInstruction &Inst)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
static MCSubtargetInfo * createAArch64MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
MCELFStreamer * createAArch64ELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter, bool RelaxAll)
Instances of this class represent a single low-level machine instruction.
Analysis containing CSE Info
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
Streaming machine code generation interface.
unsigned const MachineRegisterInfo * MRI
static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it...
static MCRegisterInfo * createAArch64MCRegisterInfo(const Triple &Triple)
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
static void RegisterMachOStreamer(Target &T, Target::MachOStreamerCtorTy Fn)
size_t size() const
size - Get the array size.
MCStreamer * createELFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
static MCAsmInfo * createAArch64MCAsmInfo(const MCRegisterInfo &MRI, const Triple &TheTriple)
Interface to description of machine instruction set.
unsigned getNumOperands() const
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
static MCInstPrinter * createAArch64MCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target...
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
Triple - Helper class for working with autoconf configuration names.
MCTargetStreamer * createAArch64ObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
MCCodeEmitter * createAArch64MCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
const MCOperand & getOperand(unsigned i) const
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Target - Wrapper for Target specific information.
static MCStreamer * createWinCOFFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
MCAsmBackend * createAArch64beAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
void initLLVMToCVRegMapping(MCRegisterInfo *MRI)
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
uint16_t getEncodingValue(unsigned RegNo) const
Returns the encoding for RegNo.
void mapLLVMRegToCVReg(unsigned LLVMReg, int CVReg)
MCTargetStreamer * createAArch64AsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
uint32_t read32le(const void *P)
Generic base class for all target subtargets.
static void RegisterELFStreamer(Target &T, Target::ELFStreamerCtorTy Fn)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
StringRef - Represent a constant reference to a string, i.e.
MCStreamer * createMachOStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll, bool DWARFMustBeAtTheEnd, bool LabelSections=false)
unsigned getOpcode() const
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
void LLVMInitializeAArch64TargetMC()