42 #define GET_INSTRINFO_MC_DESC 43 #include "PPCGenInstrInfo.inc" 45 #define GET_SUBTARGETINFO_MC_DESC 46 #include "PPCGenSubtargetInfo.inc" 48 #define GET_REGINFO_MC_DESC 49 #include "PPCGenRegisterInfo.inc" 58 InitPPCMCInstrInfo(X);
65 unsigned Flavour = isPPC64 ? 0 : 1;
66 unsigned RA = isPPC64 ? PPC::LR8 : PPC::LR;
69 InitPPCMCRegisterInfo(X, RA, Flavour, Flavour);
75 return createPPCMCSubtargetInfoImpl(TT, CPU, FS);
90 unsigned Reg = isPPC64 ? PPC::X1 : PPC::R1;
116 OS <<
"\t.machine " << CPU <<
'\n';
120 OS <<
"\t.abiversion " << AbiVersion <<
'\n';
126 OS <<
"\t.localentry\t";
129 LocalOffset->
print(OS, MAI);
165 if (!LocalOffset->evaluateAsAbsolute(Res, MCA))
185 auto *
Symbol = cast<MCSymbolELF>(S);
189 if (copyLocalEntry(
Symbol, Value))
190 UpdateOther.insert(
Symbol);
192 UpdateOther.erase(
Symbol);
196 for (
auto *Sym : UpdateOther)
197 copyLocalEntry(Sym, Sym->getVariableValue());
207 const auto &RhsSym = cast<MCSymbolELF>(
Ref->getSymbol());
244 return new PPCTargetAsmStreamer(S, OS);
251 return new PPCTargetELFStreamer(S);
252 return new PPCTargetMachOStreamer(S);
256 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.
This class represents lattice values for constants.
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.
The access may reference the value stored in memory.
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()
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()
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
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)
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
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.