36 return (
Value >> 2) & 0x3fffffff;
39 return (
Value >> 2) & 0x3fffff;
42 return (
Value >> 2) & 0x7ffff;
48 unsigned d16hi = (
Value >> 16) & 0x3;
49 unsigned d16lo = (
Value >> 2) & 0x3fff;
50 return (d16hi << 20) | d16lo;
54 return (~
Value >> 10) & 0x3fffff;
63 return (
Value >> 10) & 0x3fffff;
67 return Value & 0x1fff;
70 return (
Value & 0x3ff) | 0x1c00;
81 return (
Value >> 22) & 0x3fffff;
84 return (
Value >> 12) & 0x3ff;
90 return (
Value >> 42) & 0x3fffff;
93 return (
Value >> 32) & 0x3ff;
99 assert(
Value == 0 &&
"Sparc TLS relocs expect zero Value");
142 Is64Bit(STI.getTargetTriple().isArch64Bit()),
143 IsV8Plus(STI.hasFeature(Sparc::FeatureV8Plus)) {}
152#define ELF_RELOC(X, Y) .Case(#X, Y)
153#include "llvm/BinaryFormat/ELFRelocs/Sparc.def"
155 .
Case(
"BFD_RELOC_NONE", ELF::R_SPARC_NONE)
156 .
Case(
"BFD_RELOC_8", ELF::R_SPARC_8)
157 .
Case(
"BFD_RELOC_16", ELF::R_SPARC_16)
158 .
Case(
"BFD_RELOC_32", ELF::R_SPARC_32)
159 .
Case(
"BFD_RELOC_64", ELF::R_SPARC_64)
173 {
"fixup_sparc_13", 19, 13, 0 },
174 {
"fixup_sparc_hi22", 10, 22, 0 },
175 {
"fixup_sparc_lo10", 22, 10, 0 },
176 {
"fixup_sparc_h44", 10, 22, 0 },
177 {
"fixup_sparc_m44", 22, 10, 0 },
178 {
"fixup_sparc_l44", 20, 12, 0 },
179 {
"fixup_sparc_hh", 10, 22, 0 },
180 {
"fixup_sparc_hm", 22, 10, 0 },
181 {
"fixup_sparc_lm", 10, 22, 0 },
184 {
"fixup_sparc_got22", 10, 22, 0 },
185 {
"fixup_sparc_got10", 22, 10, 0 },
186 {
"fixup_sparc_got13", 19, 13, 0 },
188 {
"fixup_sparc_tls_gd_hi22", 10, 22, 0 },
189 {
"fixup_sparc_tls_gd_lo10", 22, 10, 0 },
190 {
"fixup_sparc_tls_gd_add", 0, 0, 0 },
191 {
"fixup_sparc_tls_gd_call", 0, 0, 0 },
192 {
"fixup_sparc_tls_ldm_hi22", 10, 22, 0 },
193 {
"fixup_sparc_tls_ldm_lo10", 22, 10, 0 },
194 {
"fixup_sparc_tls_ldm_add", 0, 0, 0 },
195 {
"fixup_sparc_tls_ldm_call", 0, 0, 0 },
196 {
"fixup_sparc_tls_ldo_hix22", 10, 22, 0 },
197 {
"fixup_sparc_tls_ldo_lox10", 22, 10, 0 },
198 {
"fixup_sparc_tls_ldo_add", 0, 0, 0 },
199 {
"fixup_sparc_tls_ie_hi22", 10, 22, 0 },
200 {
"fixup_sparc_tls_ie_lo10", 22, 10, 0 },
201 {
"fixup_sparc_tls_ie_ld", 0, 0, 0 },
202 {
"fixup_sparc_tls_ie_ldx", 0, 0, 0 },
203 {
"fixup_sparc_tls_ie_add", 0, 0, 0 },
204 {
"fixup_sparc_tls_le_hix22", 0, 0, 0 },
205 {
"fixup_sparc_tls_le_lox10", 0, 0, 0 },
206 {
"fixup_sparc_hix22", 10, 22, 0 },
207 {
"fixup_sparc_lox10", 19, 13, 0 },
208 {
"fixup_sparc_gotdata_hix22", 0, 0, 0 },
209 {
"fixup_sparc_gotdata_lox10", 0, 0, 0 },
210 {
"fixup_sparc_gotdata_op", 0, 0, 0 },
219 {
"fixup_sparc_13", 0, 13, 0 },
220 {
"fixup_sparc_hi22", 0, 22, 0 },
221 {
"fixup_sparc_lo10", 0, 10, 0 },
222 {
"fixup_sparc_h44", 0, 22, 0 },
223 {
"fixup_sparc_m44", 0, 10, 0 },
224 {
"fixup_sparc_l44", 0, 12, 0 },
225 {
"fixup_sparc_hh", 0, 22, 0 },
226 {
"fixup_sparc_hm", 0, 10, 0 },
227 {
"fixup_sparc_lm", 0, 22, 0 },
230 {
"fixup_sparc_got22", 0, 22, 0 },
231 {
"fixup_sparc_got10", 0, 10, 0 },
232 {
"fixup_sparc_got13", 0, 13, 0 },
234 {
"fixup_sparc_tls_gd_hi22", 0, 22, 0 },
235 {
"fixup_sparc_tls_gd_lo10", 0, 10, 0 },
236 {
"fixup_sparc_tls_gd_add", 0, 0, 0 },
237 {
"fixup_sparc_tls_gd_call", 0, 0, 0 },
238 {
"fixup_sparc_tls_ldm_hi22", 0, 22, 0 },
239 {
"fixup_sparc_tls_ldm_lo10", 0, 10, 0 },
240 {
"fixup_sparc_tls_ldm_add", 0, 0, 0 },
241 {
"fixup_sparc_tls_ldm_call", 0, 0, 0 },
242 {
"fixup_sparc_tls_ldo_hix22", 0, 22, 0 },
243 {
"fixup_sparc_tls_ldo_lox10", 0, 10, 0 },
244 {
"fixup_sparc_tls_ldo_add", 0, 0, 0 },
245 {
"fixup_sparc_tls_ie_hi22", 0, 22, 0 },
246 {
"fixup_sparc_tls_ie_lo10", 0, 10, 0 },
247 {
"fixup_sparc_tls_ie_ld", 0, 0, 0 },
248 {
"fixup_sparc_tls_ie_ldx", 0, 0, 0 },
249 {
"fixup_sparc_tls_ie_add", 0, 0, 0 },
250 {
"fixup_sparc_tls_le_hix22", 0, 0, 0 },
251 {
"fixup_sparc_tls_le_lox10", 0, 0, 0 },
252 {
"fixup_sparc_hix22", 0, 22, 0 },
253 {
"fixup_sparc_lox10", 0, 13, 0 },
254 {
"fixup_sparc_gotdata_hix22", 0, 0, 0 },
255 {
"fixup_sparc_gotdata_lox10", 0, 0, 0 },
256 {
"fixup_sparc_gotdata_op", 0, 0, 0 },
284 if (
Target.getSymA()->getSymbol().isTemporary())
324 for (
uint64_t i = 0; i != NumNops; ++i)
325 support::endian::write<uint32_t>(
OS, 0x01000000, Endian);
331 class ELFSparcAsmBackend :
public SparcAsmBackend {
335 : SparcAsmBackend(STI), OSType(OSType) {}
352 for (
unsigned i = 0; i != NumBytes; ++i) {
359 std::unique_ptr<MCObjectTargetWriter>
360 createObjectTargetWriter()
const override {
unsigned const MachineRegisterInfo * MRI
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static unsigned adjustFixupValue(unsigned Kind, uint64_t Value)
static unsigned getFixupKindNumBytes(unsigned Kind)
getFixupKindNumBytes - The number of bytes the fixup may change.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Generic interface to target specific assembler backends.
virtual bool writeNopData(raw_ostream &OS, uint64_t Count, const MCSubtargetInfo *STI) const =0
Write an (optimal) nop sequence of Count bytes to the given output.
virtual void relaxInstruction(MCInst &Inst, const MCSubtargetInfo &STI) const
Relax the instruction in the given fragment to the next wider instruction.
virtual bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target, const MCSubtargetInfo *STI)
Hook to check if a relocation is needed for some target specific reason.
virtual unsigned getNumFixupKinds() const =0
Get the number of target specific fixup kinds.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
virtual std::optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
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...
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
This represents an "assembler immediate".
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Target - Wrapper for Target specific information.
OSType getOS() const
Get the parsed operating system type of this triple.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ fixup_sparc_lo10
fixup_sparc_lo10 - 10-bit fixup corresponding to lo(foo)
@ fixup_sparc_br16
fixup_sparc_bpr - 16-bit fixup for bpr
@ fixup_sparc_lm
fixup_sparc_lm - 22-bit fixup corresponding to lm(foo)
@ fixup_sparc_lox10
13-bit fixup corresponding to lox(foo)
@ fixup_sparc_hi22
fixup_sparc_hi22 - 22-bit fixup corresponding to hi(foo) for sethi
@ fixup_sparc_tls_gd_call
@ fixup_sparc_tls_ldo_lox10
@ fixup_sparc_tls_ldm_add
@ fixup_sparc_tls_le_hix22
@ fixup_sparc_m44
fixup_sparc_m44 - 10-bit fixup corresponding to m44(foo)
@ fixup_sparc_tls_ie_hi22
@ fixup_sparc_gotdata_hix22
22-bit fixup corresponding to gdop_hix22(foo)
@ fixup_sparc_hh
fixup_sparc_hh - 22-bit fixup corresponding to hh(foo)
@ fixup_sparc_got10
fixup_sparc_got10 - 10-bit fixup corresponding to got10(foo)
@ fixup_sparc_tls_le_lox10
@ fixup_sparc_got13
fixup_sparc_got13 - 13-bit fixup corresponding to got13(foo)
@ fixup_sparc_tls_ldo_hix22
@ fixup_sparc_tls_ldo_add
@ fixup_sparc_gotdata_op
32-bit fixup corresponding to gdop(foo)
@ fixup_sparc_tls_gd_hi22
fixups for Thread Local Storage
@ fixup_sparc_br19
fixup_sparc_br19 - 19-bit PC relative relocation for branches on icc/xcc
@ fixup_sparc_13
fixup_sparc_13 - 13-bit fixup
@ fixup_sparc_hix22
22-bit fixup corresponding to hix(foo)
@ fixup_sparc_tls_gd_lo10
@ fixup_sparc_got22
fixup_sparc_got22 - 22-bit fixup corresponding to got22(foo)
@ fixup_sparc_h44
fixup_sparc_h44 - 22-bit fixup corresponding to h44(foo)
@ fixup_sparc_tls_ldm_lo10
@ fixup_sparc_tls_ldm_call
@ fixup_sparc_tls_ie_lo10
@ fixup_sparc_pc22
fixup_sparc_pc22 - 22-bit fixup corresponding to pc22(foo)
@ fixup_sparc_tls_ldm_hi22
@ fixup_sparc_br22
fixup_sparc_br22 - 22-bit PC relative relocation for branches
@ fixup_sparc_l44
fixup_sparc_l44 - 12-bit fixup corresponding to l44(foo)
@ fixup_sparc_gotdata_lox10
13-bit fixup corresponding to gdop_lox10(foo)
@ fixup_sparc_pc10
fixup_sparc_pc10 - 10-bit fixup corresponding to pc10(foo)
@ fixup_sparc_hm
fixup_sparc_hm - 10-bit fixup corresponding to hm(foo)
@ fixup_sparc_wplt30
fixup_sparc_wplt30
Error applyFixup(LinkGraph &G, Block &B, const Edge &E, const ArmConfig &ArmCfg)
Apply fixup expression for edge to block content.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createSparcELFObjectWriter(bool Is64Bit, bool IsV8Plus, uint8_t OSABI)
MCFixupKind
Extensible enumeration to represent the type of a fixup.
@ FirstLiteralRelocationKind
The range [FirstLiteralRelocationKind, MaxTargetFixupKind) is used for relocations coming from ....
@ FK_Data_8
A eight-byte fixup.
@ FK_Data_1
A one-byte fixup.
@ FK_Data_4
A four-byte fixup.
@ FK_Data_2
A two-byte fixup.
MCAsmBackend * createSparcAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Target independent information on a fixup kind.
@ FKF_IsPCRel
Is this fixup kind PCrelative? This is used by the assembler backend to evaluate fixup values in a ta...