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 OS <<
"\t.machine " << CPU <<
'\n';
119 OS <<
"\t.abiversion " << AbiVersion <<
'\n';
125 OS <<
"\t.localentry\t";
128 LocalOffset->
print(OS, MAI);
164 if (!LocalOffset->evaluateAsAbsolute(Res, MCA))
184 auto *
Symbol = cast<MCSymbolELF>(S);
189 const auto &RhsSym = cast<MCSymbolELF>(
226 return new PPCTargetAsmStreamer(S, OS);
233 return new PPCTargetELFStreamer(S);
234 return new PPCTargetMachOStreamer(S);
238 unsigned SyntaxVariant,
const MCAsmInfo * getAsmInfo() const
void setELFHeaderEFlags(unsigned Flags)
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Compute iterated dominance frontiers using a linear time algorithm.
void EmitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false)
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols.
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 ...
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Target specific streamer interface.
Target & getThePPC32Target()
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)
const Triple & getTargetTriple() const
SI optimize exec mask operations pre RA
MCContext & getContext() const
static int64_t decodePPC64LocalEntryOffset(unsigned Other)
~PPCTargetStreamer() override
Base class for the full range of assembler expressions which are needed for parsing.
Represent a reference to a symbol from inside an expression.
int getDwarfRegNum(unsigned RegNum, bool isEH) const
Map a target register to an equivalent dwarf register number.
static unsigned encodePPC64LocalEntryOffset(int64_t Offset)
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
void addInitialFrameState(const MCCFIInstruction &Inst)
virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset)=0
Target & getThePPC64Target()
unsigned getOther() const
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.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
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)
virtual void emitAbiVersion(int AbiVersion)=0
Interface to description of machine instruction set.
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
MCAsmBackend * createPPCAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
static MCInstPrinter * createPPCMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
unsigned getELFHeaderEFlags() const
ELF e_header flags.
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.
MCStreamer & getStreamer()
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()
static MCRegisterInfo * createPPCMCRegisterInfo(const Triple &TT)
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
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.
StringRef getName() const
getName - Get the symbol name.
PPCTargetStreamer(MCStreamer &S)
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
LLVM Value Representation.
virtual void emitTCEntry(const MCSymbol &S)=0
StringRef - Represent a constant reference to a string, i.e.
virtual void emitMachine(StringRef CPU)=0
static MCTargetStreamer * createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
MCCodeEmitter * createPPCMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.