40 return Value & 0xfffc;
43 return Value & 0x3fffffc;
45 return Value & 0xffff;
47 return Value & 0xfffc;
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 }
120 uint64_t
Value,
bool IsResolved,
131 for (
unsigned i = 0; i != NumBytes; ++i) {
133 Data[Offset + i] |= uint8_t((Value >> (Idx * 8)) & 0xff);
138 const MCValue &Target)
override {
148 if (
const auto *S = dyn_cast<MCSymbolELF>(&A->getSymbol())) {
152 unsigned Other = S->getOther() << 2;
161 bool mayNeedRelaxation(
const MCInst &Inst,
167 bool fixupNeedsRelaxation(
const MCFixup &Fixup,
176 MCInst &Res)
const override {
181 bool writeNopData(
raw_ostream &OS, uint64_t Count)
const override {
182 uint64_t NumNops = Count / 4;
183 for (uint64_t i = 0; i != NumNops; ++i)
184 support::endian::write<uint32_t>(OS, 0x60000000, Endian);
193 if (Name ==
"ppc64" || Name ==
"ppc64le")
return 8;
194 assert(Name ==
"ppc32" &&
"Unknown target name!");
203 class DarwinPPCAsmBackend :
public PPCAsmBackend {
207 std::unique_ptr<MCObjectTargetWriter>
208 createObjectTargetWriter()
const override {
217 class ELFPPCAsmBackend :
public PPCAsmBackend {
222 : PPCAsmBackend(T, Endian), OSABI(OSABI) {}
224 std::unique_ptr<MCObjectTargetWriter>
225 createObjectTargetWriter()
const override {
239 return new DarwinPPCAsmBackend(T);
243 return new ELFPPCAsmBackend(
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
This class represents lattice values for constants.
This represents an "assembler immediate".
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...
const char * getName() const
getName - Get the target name.
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.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
static uint64_t getPointerSize(const Value *V, const DataLayout &DL, const TargetLibraryInfo &TLI, const Function *F)
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...
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
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
PowerPC TLS Dynamic Call Fixup
Target - Wrapper for Target specific information.
A 14-bit fixup corresponding to lo16(_foo) with implied 2 zero bits for instrs like 'std'...
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