41 #define GET_INSTRINFO_MC_DESC
42 #include "PPCGenInstrInfo.inc"
44 #define GET_SUBTARGETINFO_MC_DESC
45 #include "PPCGenSubtargetInfo.inc"
47 #define GET_REGINFO_MC_DESC
48 #include "PPCGenRegisterInfo.inc"
57 InitPPCMCInstrInfo(X);
64 unsigned Flavour = isPPC64 ? 0 : 1;
65 unsigned RA = isPPC64 ? PPC::LR8 : PPC::LR;
68 InitPPCMCRegisterInfo(X, RA, Flavour, Flavour);
74 return createPPCMCSubtargetInfoImpl(TT, CPU, FS);
89 unsigned Reg = isPPC64 ? PPC::X1 : PPC::R1;
115 void emitTCEntry(
const MCSymbol &S)
override {
123 void emitMachine(
StringRef CPU)
override {
124 OS <<
"\t.machine " << CPU <<
'\n';
127 void emitAbiVersion(
int AbiVersion)
override {
128 OS <<
"\t.abiversion " << AbiVersion <<
'\n';
132 const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
134 OS <<
"\t.localentry\t";
137 LocalOffset->
print(OS, MAI);
150 void emitTCEntry(
const MCSymbol &S)
override {
153 Streamer.EmitSymbolValue(&S, 8);
156 void emitMachine(
StringRef CPU)
override {
161 void emitAbiVersion(
int AbiVersion)
override {
173 if (!LocalOffset->evaluateAsAbsolute(Res, MCA))
193 auto *
Symbol = cast<MCSymbolELF>(S);
198 const auto &RhsSym = cast<MCSymbolELF>(
200 unsigned Other =
Symbol->getOther();
211 void emitTCEntry(
const MCSymbol &S)
override {
215 void emitMachine(
StringRef CPU)
override {
220 void emitAbiVersion(
int AbiVersion)
override {
235 return new PPCTargetAsmStreamer(S, OS);
242 return new PPCTargetELFStreamer(S);
243 return new PPCTargetMachOStreamer(S);
247 unsigned SyntaxVariant,
MCAsmBackend * createPPCAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, const MCTargetOptions &Options)
void setELFHeaderEFlags(unsigned Flags)
int getDwarfRegNum(unsigned RegNum, bool isEH) const
Map a target register to an equivalent dwarf register number.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
static MCAsmInfo * createPPCMCAsmInfo(const MCRegisterInfo &MRI, const Triple &TheTriple)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Target specific streamer interface.
Target & getThePPC32Target()
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
unsigned getELFHeaderEFlags() const
ELF e_header flags.
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
static void adjustCodeGenOpts(const Triple &TT, Reloc::Model RM, CodeModel::Model &CM)
static int64_t decodePPC64LocalEntryOffset(unsigned Other)
~PPCTargetStreamer() override
Base class for the full range of assembler expressions which are needed for parsing.
Reg
All possible values of the reg field in the ModR/M byte.
Represent a reference to a symbol from inside an expression.
static unsigned encodePPC64LocalEntryOffset(int64_t Offset)
void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
void addInitialFrameState(const MCCFIInstruction &Inst)
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Target & getThePPC64Target()
void LLVMInitializePowerPCTargetMC()
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
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...
void setOther(unsigned Other)
unsigned getOther() const
Interface to description of machine instruction set.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static void registerMCAdjustCodeGenOpts(Target &T, Target::MCAdjustCodeGenOptsFnTy Fn)
static MCInstPrinter * createPPCMCInstPrinter(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)
static MCInstrInfo * createPPCMCInstrInfo()
static MCSubtargetInfo * createPPCMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Triple - Helper class for working with autoconf configuration names.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
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.
Target & getThePPC64LETarget()
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
llvm_unreachable("Unknown RegBank!")
static MCRegisterInfo * createPPCMCRegisterInfo(const Triple &TT)
static std::vector< std::string > Flags
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
StringRef getName() const
getName - Get the symbol name.
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
MCSubtargetInfo - Generic base class for all target subtargets.
static MCTargetStreamer * createAsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
References to labels and assigned expressions.
const Triple & getTargetTriple() const
getTargetTriple - Return the target triple string.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
PPCTargetStreamer(MCStreamer &S)
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
static MCTargetStreamer * createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
MCCodeEmitter * createPPCMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)