40 return Value & 0xfffc;
43 return Value & 0x3fffffc;
45 return Value & 0xffff;
47 return Value & 0xfffc;
86 unsigned getNumFixupKinds()
const override {
95 {
"fixup_ppc_br24abs", 6, 24, 0 },
96 {
"fixup_ppc_brcond14abs", 16, 14, 0 },
97 {
"fixup_ppc_half16", 0, 16, 0 },
98 {
"fixup_ppc_half16ds", 0, 14, 0 },
99 {
"fixup_ppc_nofixup", 0, 0, 0 }
105 {
"fixup_ppc_br24abs", 2, 24, 0 },
106 {
"fixup_ppc_brcond14abs", 2, 14, 0 },
107 {
"fixup_ppc_half16", 0, 16, 0 },
108 {
"fixup_ppc_half16ds", 2, 14, 0 },
109 {
"fixup_ppc_nofixup", 0, 0, 0 }
124 uint64_t
Value,
bool IsResolved,
135 for (
unsigned i = 0; i != NumBytes; ++i) {
137 Data[Offset + i] |= uint8_t((Value >> (Idx * 8)) & 0xff);
142 const MCValue &Target)
override {
143 switch ((
unsigned)Fixup.
getKind()) {
154 if (
const auto *S = dyn_cast<MCSymbolELF>(&A->getSymbol())) {
158 unsigned Other = S->getOther() << 2;
167 bool mayNeedRelaxation(
const MCInst &Inst,
173 bool fixupNeedsRelaxation(
const MCFixup &Fixup,
182 MCInst &Res)
const override {
187 bool writeNopData(
raw_ostream &OS, uint64_t Count)
const override {
188 uint64_t NumNops = Count / 4;
189 for (uint64_t i = 0; i != NumNops; ++i)
190 support::endian::write<uint32_t>(OS, 0x60000000, Endian);
203 class DarwinPPCAsmBackend :
public PPCAsmBackend {
206 : PPCAsmBackend(T, TT) {}
208 std::unique_ptr<MCObjectTargetWriter>
209 createObjectTargetWriter()
const override {
218 class ELFPPCAsmBackend :
public PPCAsmBackend {
220 ELFPPCAsmBackend(
const Target &
T,
const Triple &
TT) : PPCAsmBackend(T, TT) {}
222 std::unique_ptr<MCObjectTargetWriter>
223 createObjectTargetWriter()
const override {
232 class XCOFFPPCAsmBackend :
public PPCAsmBackend {
235 : PPCAsmBackend(T, TT) {}
237 std::unique_ptr<MCObjectTargetWriter>
238 createObjectTargetWriter()
const override {
247 if (Name ==
"R_PPC64_NONE")
250 if (Name ==
"R_PPC_NONE")
262 return new DarwinPPCAsmBackend(T, TT);
265 return new XCOFFPPCAsmBackend(T, TT);
267 return new ELFPPCAsmBackend(T, TT);
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
This class represents lattice values for constants.
This represents an "assembler immediate".
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
14-bit absolute relocation for conditional branches.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
const Triple & getTargetTriple() const
Is this fixup kind PCrelative? This is used by the assembler backend to evaluate fixup values in a ta...
A 16-bit fixup corresponding to lo16(_foo) or ha16(_foo) for instrs like 'li' or 'addis'.
std::unique_ptr< MCObjectTargetWriter > createPPCMachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct a PPC Mach-O object writer.
24-bit absolute relocation for direct branches like 'ba' and 'bla'.
Encapsulates the layout of an assembly file at a particular point in time.
std::unique_ptr< MCObjectTargetWriter > createPPCELFObjectWriter(bool Is64Bit, uint8_t OSABI)
Construct an PPC ELF object writer.
Not a true fixup, but ties a symbol to a call to __tls_get_addr for the TLS general and local dynamic...
Represent a reference to a symbol from inside an expression.
static unsigned getFixupKindNumBytes(unsigned Kind)
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...
unsigned const MachineRegisterInfo * MRI
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
bool isLittleEndian() const
Tests whether the target triple is little endian.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
const MCSymbolRefExpr * getSymA() const
MCAsmBackend * createPPCAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
uint32_t getOffset() const
bool isPPC64() const
Tests whether the target is 64-bit PowerPC (little and big endian).
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
PowerPC TLS Dynamic Call Fixup
virtual Optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
Target - Wrapper for Target specific information.
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
A 14-bit fixup corresponding to lo16(_foo) with implied 2 zero bits for instrs like 'std'...
std::unique_ptr< MCObjectTargetWriter > createPPCXCOFFObjectWriter(bool Is64Bit)
Construct a PPC XCOFF object writer.
bool isArch64Bit() const
Test whether the architecture is 64-bit.
Generic base class for all target subtargets.
Target independent information on a fixup kind.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Generic interface to target specific assembler backends.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
static uint64_t adjustFixupValue(unsigned Kind, uint64_t Value)
14-bit PC relative relocation for conditional branches.
MCFixupKind getKind() const