34 #define GET_INSTRINFO_MC_DESC
35 #include "PPCGenInstrInfo.inc"
37 #define GET_SUBTARGETINFO_MC_DESC
38 #include "PPCGenSubtargetInfo.inc"
40 #define GET_REGINFO_MC_DESC
41 #include "PPCGenRegisterInfo.inc"
49 InitPPCMCInstrInfo(X);
56 unsigned Flavour = isPPC64 ? 0 : 1;
57 unsigned RA = isPPC64 ? PPC::LR8 : PPC::LR;
60 InitPPCMCRegisterInfo(X, RA, Flavour, Flavour);
66 return createPPCMCSubtargetInfoImpl(TT, CPU, FS);
81 unsigned Reg = isPPC64 ? PPC::X1 : PPC::R1;
105 void emitTCEntry(
const MCSymbol &S)
override {
112 void emitMachine(
StringRef CPU)
override {
113 OS <<
"\t.machine " << CPU <<
'\n';
115 void emitAbiVersion(
int AbiVersion)
override {
116 OS <<
"\t.abiversion " << AbiVersion <<
'\n';
119 const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
121 OS <<
"\t.localentry\t";
124 LocalOffset->
print(OS, MAI);
135 void emitTCEntry(
const MCSymbol &S)
override {
138 Streamer.EmitSymbolValue(&S, 8);
140 void emitMachine(
StringRef CPU)
override {
144 void emitAbiVersion(
int AbiVersion)
override {
155 if (!LocalOffset->evaluateAsAbsolute(Res, MCA))
174 auto *
Symbol = cast<MCSymbolELF>(S);
179 const auto &RhsSym = cast<MCSymbolELF>(
181 unsigned Other =
Symbol->getOther();
191 void emitTCEntry(
const MCSymbol &S)
override {
194 void emitMachine(
StringRef CPU)
override {
198 void emitAbiVersion(
int AbiVersion)
override {
211 return new PPCTargetAsmStreamer(S, OS);
218 return new PPCTargetELFStreamer(S);
219 return new PPCTargetMachOStreamer(S);
223 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
struct fuzzer::@269 Flags
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)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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 GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
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.
static MCRegisterInfo * createPPCMCRegisterInfo(const Triple &TT)
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)