39 return Value & 0xfffc;
42 return Value & 0x3fffffc;
44 return Value & 0xffff;
46 return Value & 0xfffc;
80 IsLittleEndian(isLittle) {}
82 unsigned getNumFixupKinds()
const override {
91 {
"fixup_ppc_br24abs", 6, 24, 0 },
92 {
"fixup_ppc_brcond14abs", 16, 14, 0 },
93 {
"fixup_ppc_half16", 0, 16, 0 },
94 {
"fixup_ppc_half16ds", 0, 14, 0 },
95 {
"fixup_ppc_nofixup", 0, 0, 0 }
101 {
"fixup_ppc_br24abs", 2, 24, 0 },
102 {
"fixup_ppc_brcond14abs", 2, 14, 0 },
103 {
"fixup_ppc_half16", 0, 16, 0 },
104 {
"fixup_ppc_half16ds", 2, 14, 0 },
105 {
"fixup_ppc_nofixup", 0, 0, 0 }
116 void applyFixup(
const MCFixup &Fixup,
char *Data,
unsigned DataSize,
117 uint64_t
Value,
bool IsPCRel)
const override {
127 for (
unsigned i = 0;
i != NumBytes; ++
i) {
128 unsigned Idx = IsLittleEndian ?
i : (NumBytes - 1 -
i);
129 Data[Offset +
i] |= uint8_t((Value >> (Idx * 8)) & 0xff);
136 bool &IsResolved)
override {
145 if (
const auto *S = dyn_cast<MCSymbolELF>(&
A->getSymbol())) {
149 unsigned Other = S->getOther() << 2;
158 bool mayNeedRelaxation(
const MCInst &Inst)
const override {
163 bool fixupNeedsRelaxation(
const MCFixup &Fixup,
172 MCInst &Res)
const override {
177 bool writeNopData(uint64_t Count,
MCObjectWriter *OW)
const override {
178 uint64_t NumNops = Count / 4;
179 for (uint64_t
i = 0;
i != NumNops; ++
i)
189 if (Name ==
"ppc64" || Name ==
"ppc64le")
return 8;
190 assert(Name ==
"ppc32" &&
"Unknown target name!");
195 return IsLittleEndian;
203 class DarwinPPCAsmBackend :
public PPCAsmBackend {
205 DarwinPPCAsmBackend(
const Target &
T) : PPCAsmBackend(T,
false) { }
217 class ELFPPCAsmBackend :
public PPCAsmBackend {
220 ELFPPCAsmBackend(
const Target &
T,
bool IsLittleEndian, uint8_t OSABI) :
221 PPCAsmBackend(T, IsLittleEndian), OSABI(OSABI) { }
236 return new DarwinPPCAsmBackend(T);
240 return new ELFPPCAsmBackend(T, IsLittleEndian, OSABI);
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
MCAsmBackend * createPPCAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, const MCTargetOptions &Options)
void WriteZeros(unsigned N)
This represents an "assembler immediate".
fixup_ppc_brcond14abs - 14-bit absolute relocation for conditional branches.
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Is this fixup kind PCrelative? This is used by the assembler backend to evaluate fixup values in a ta...
fixup_ppc_half16 - A 16-bit fixup corresponding to lo16(_foo) or ha16(_foo) for instrs like 'li' or '...
fixup_ppc_br24abs - 24-bit absolute relocation for direct branches like 'ba' and 'bla'.
Encapsulates the layout of an assembly file at a particular point in time.
fixup_ppc_nofixup - Not a true fixup, but ties a symbol to a call to __tls_get_addr for the TLS gener...
Represent a reference to a symbol from inside an expression.
MCObjectWriter * createPPCELFObjectWriter(raw_pwrite_stream &OS, bool Is64Bit, bool IsLittleEndian, uint8_t OSABI)
Construct an PPC ELF object writer.
Function Alias Analysis false
static unsigned getFixupKindNumBytes(unsigned Kind)
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
uint32_t getOffset() const
Instances of this class represent a single low-level machine instruction.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
void write32(uint32_t Value)
unsigned const MachineRegisterInfo * MRI
MCFixupKind
Extensible enumeration to represent the type of a fixup.
MCFixupKind getKind() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
MCObjectWriter * createPPCMachObjectWriter(raw_pwrite_stream &OS, bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct a PPC Mach-O object writer.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
const MCSymbolRefExpr * getSymA() const
Target - Wrapper for Target specific information.
fixup_ppc_half16ds - A 14-bit fixup corresponding to lo16(_foo) with implied 2 zero bits for instrs l...
MCSubtargetInfo - Generic base class for all target subtargets.
Target independent information on a fixup kind.
An abstract base class for streams implementations that also support a pwrite operation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Generic interface to target specific assembler backends.
StringRef - Represent a constant reference to a string, i.e.
static uint64_t adjustFixupValue(unsigned Kind, uint64_t Value)
fixup_ppc_brcond14 - 14-bit PC relative relocation for conditional branches.
static uint64_t getPointerSize(const Value *V, const DataLayout &DL, const TargetLibraryInfo &TLI)
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")