35 return (Value >> 2) & 0x3fffffff;
38 return (Value >> 2) & 0x3fffff;
41 return (Value >> 2) & 0x7ffff;
44 return (Value >> 2) & 0xc000;
47 return (Value >> 2) & 0x3fff;
55 return (Value >> 10) & 0x3fffff;
59 return Value & 0x1fff;
70 return (Value >> 22) & 0x3fffff;
73 return (Value >> 12) & 0x3ff;
79 return (Value >> 42) & 0x3fffff;
82 return (Value >> 32) & 0x3ff;
88 assert(Value == 0 &&
"Sparc TLS relocs expect zero Value");
124 SparcAsmBackend(
const Target &
T)
129 unsigned getNumFixupKinds()
const override {
141 {
"fixup_sparc_13", 19, 13, 0 },
142 {
"fixup_sparc_hi22", 10, 22, 0 },
143 {
"fixup_sparc_lo10", 22, 10, 0 },
144 {
"fixup_sparc_h44", 10, 22, 0 },
145 {
"fixup_sparc_m44", 22, 10, 0 },
146 {
"fixup_sparc_l44", 20, 12, 0 },
147 {
"fixup_sparc_hh", 10, 22, 0 },
148 {
"fixup_sparc_hm", 22, 10, 0 },
151 {
"fixup_sparc_got22", 10, 22, 0 },
152 {
"fixup_sparc_got10", 22, 10, 0 },
153 {
"fixup_sparc_got13", 19, 13, 0 },
155 {
"fixup_sparc_tls_gd_hi22", 10, 22, 0 },
156 {
"fixup_sparc_tls_gd_lo10", 22, 10, 0 },
157 {
"fixup_sparc_tls_gd_add", 0, 0, 0 },
158 {
"fixup_sparc_tls_gd_call", 0, 0, 0 },
159 {
"fixup_sparc_tls_ldm_hi22", 10, 22, 0 },
160 {
"fixup_sparc_tls_ldm_lo10", 22, 10, 0 },
161 {
"fixup_sparc_tls_ldm_add", 0, 0, 0 },
162 {
"fixup_sparc_tls_ldm_call", 0, 0, 0 },
163 {
"fixup_sparc_tls_ldo_hix22", 10, 22, 0 },
164 {
"fixup_sparc_tls_ldo_lox10", 22, 10, 0 },
165 {
"fixup_sparc_tls_ldo_add", 0, 0, 0 },
166 {
"fixup_sparc_tls_ie_hi22", 10, 22, 0 },
167 {
"fixup_sparc_tls_ie_lo10", 22, 10, 0 },
168 {
"fixup_sparc_tls_ie_ld", 0, 0, 0 },
169 {
"fixup_sparc_tls_ie_ldx", 0, 0, 0 },
170 {
"fixup_sparc_tls_ie_add", 0, 0, 0 },
171 {
"fixup_sparc_tls_le_hix22", 0, 0, 0 },
172 {
"fixup_sparc_tls_le_lox10", 0, 0, 0 }
182 {
"fixup_sparc_13", 0, 13, 0 },
183 {
"fixup_sparc_hi22", 0, 22, 0 },
184 {
"fixup_sparc_lo10", 0, 10, 0 },
185 {
"fixup_sparc_h44", 0, 22, 0 },
186 {
"fixup_sparc_m44", 0, 10, 0 },
187 {
"fixup_sparc_l44", 0, 12, 0 },
188 {
"fixup_sparc_hh", 0, 22, 0 },
189 {
"fixup_sparc_hm", 0, 10, 0 },
192 {
"fixup_sparc_got22", 0, 22, 0 },
193 {
"fixup_sparc_got10", 0, 10, 0 },
194 {
"fixup_sparc_got13", 0, 13, 0 },
196 {
"fixup_sparc_tls_gd_hi22", 0, 22, 0 },
197 {
"fixup_sparc_tls_gd_lo10", 0, 10, 0 },
198 {
"fixup_sparc_tls_gd_add", 0, 0, 0 },
199 {
"fixup_sparc_tls_gd_call", 0, 0, 0 },
200 {
"fixup_sparc_tls_ldm_hi22", 0, 22, 0 },
201 {
"fixup_sparc_tls_ldm_lo10", 0, 10, 0 },
202 {
"fixup_sparc_tls_ldm_add", 0, 0, 0 },
203 {
"fixup_sparc_tls_ldm_call", 0, 0, 0 },
204 {
"fixup_sparc_tls_ldo_hix22", 0, 22, 0 },
205 {
"fixup_sparc_tls_ldo_lox10", 0, 10, 0 },
206 {
"fixup_sparc_tls_ldo_add", 0, 0, 0 },
207 {
"fixup_sparc_tls_ie_hi22", 0, 22, 0 },
208 {
"fixup_sparc_tls_ie_lo10", 0, 10, 0 },
209 {
"fixup_sparc_tls_ie_ld", 0, 0, 0 },
210 {
"fixup_sparc_tls_ie_ldx", 0, 0, 0 },
211 {
"fixup_sparc_tls_ie_add", 0, 0, 0 },
212 {
"fixup_sparc_tls_le_hix22", 0, 0, 0 },
213 {
"fixup_sparc_tls_le_lox10", 0, 0, 0 }
258 bool mayNeedRelaxation(
const MCInst &Inst,
266 bool fixupNeedsRelaxation(
const MCFixup &Fixup,
275 MCInst &Res)
const override {
280 bool writeNopData(
raw_ostream &OS, uint64_t Count)
const override {
285 uint64_t NumNops = Count / 4;
286 for (uint64_t i = 0; i != NumNops; ++i)
287 support::endian::write<uint32_t>(OS, 0x01000000, Endian);
293 class ELFSparcAsmBackend :
public SparcAsmBackend {
297 SparcAsmBackend(T), OSType(OSType) { }
301 uint64_t
Value,
bool IsResolved,
312 for (
unsigned i = 0; i != NumBytes; ++i) {
314 Data[Offset + Idx] |= uint8_t((Value >> (i * 8)) & 0xff);
318 std::unique_ptr<MCObjectTargetWriter>
319 createObjectTargetWriter()
const override {
fixup_sparc_got22 - 22-bit fixup corresponding to got22(foo)
fixup_sparc_13 - 13-bit fixup
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.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
static unsigned getFixupKindNumBytes(unsigned Kind)
getFixupKindNumBytes - The number of bytes the fixup may change.
fixup_sparc_m44 - 10-bit fixup corresponding to m44(foo)
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.
Encapsulates the layout of an assembly file at a particular point in time.
fixup_sparc_got10 - 10-bit fixup corresponding to got10(foo)
std::unique_ptr< MCObjectTargetWriter > createSparcELFObjectWriter(bool Is64Bit, uint8_t OSABI)
fixup_sparc_hm - 10-bit fixup corresponding to hm(foo)
Instances of this class represent a single low-level machine instruction.
fixup_sparc_br19 - 19-bit PC relative relocation for branches on icc/xcc
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
MCAsmBackend * createSparcAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
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...
fixup_sparc_hh - 22-bit fixup corresponding to hh(foo)
MCFixupKind
Extensible enumeration to represent the type of a fixup.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
const MCSymbolRefExpr * getSymA() const
uint32_t getOffset() const
fixup_sparc_l44 - 12-bit fixup corresponding to l44(foo)
fixup_sparc_bpr - 16-bit fixup for bpr
static unsigned adjustFixupValue(unsigned Kind, uint64_t Value)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
PowerPC TLS Dynamic Call Fixup
fixup_sparc_lo10 - 10-bit fixup corresponding to lo(foo)
fixup_sparc_got13 - 13-bit fixup corresponding to got13(foo)
const MCSymbol & getSymbol() const
Target - Wrapper for Target specific information.
fixup_sparc_pc22 - 22-bit fixup corresponding to pc22(foo)
Generic base class for all target subtargets.
Target independent information on a fixup kind.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
fixup_sparc_br22 - 22-bit PC relative relocation for branches
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.
fixups for Thread Local Storage
fixup_sparc_hi22 - 22-bit fixup corresponding to hi(foo) for sethi
fixup_sparc_h44 - 22-bit fixup corresponding to h44(foo)
MCFixupKind getKind() const
fixup_sparc_pc10 - 10-bit fixup corresponding to pc10(foo)