34 return (Value >> 2) & 0x3fffffff;
37 return (Value >> 2) & 0x3fffff;
40 return (Value >> 2) & 0x7ffff;
43 return (Value >> 2) & 0xc000;
46 return (Value >> 2) & 0x3fff;
54 return (Value >> 10) & 0x3fffff;
66 return (~Value >> 10) & 0x3fffff;
70 return (~(~Value & 0x3ff)) & 0x1fff;
73 return (Value >> 22) & 0x3fffff;
76 return (Value >> 12) & 0x3ff;
82 return (Value >> 42) & 0x3fffff;
85 return (Value >> 32) & 0x3ff;
107 SparcAsmBackend(
const Target &
T)
112 unsigned getNumFixupKinds()
const override {
124 {
"fixup_sparc_hi22", 10, 22, 0 },
125 {
"fixup_sparc_lo10", 22, 10, 0 },
126 {
"fixup_sparc_h44", 10, 22, 0 },
127 {
"fixup_sparc_m44", 22, 10, 0 },
128 {
"fixup_sparc_l44", 20, 12, 0 },
129 {
"fixup_sparc_hh", 10, 22, 0 },
130 {
"fixup_sparc_hm", 22, 10, 0 },
133 {
"fixup_sparc_got22", 10, 22, 0 },
134 {
"fixup_sparc_got10", 22, 10, 0 },
136 {
"fixup_sparc_tls_gd_hi22", 10, 22, 0 },
137 {
"fixup_sparc_tls_gd_lo10", 22, 10, 0 },
138 {
"fixup_sparc_tls_gd_add", 0, 0, 0 },
139 {
"fixup_sparc_tls_gd_call", 0, 0, 0 },
140 {
"fixup_sparc_tls_ldm_hi22", 10, 22, 0 },
141 {
"fixup_sparc_tls_ldm_lo10", 22, 10, 0 },
142 {
"fixup_sparc_tls_ldm_add", 0, 0, 0 },
143 {
"fixup_sparc_tls_ldm_call", 0, 0, 0 },
144 {
"fixup_sparc_tls_ldo_hix22", 10, 22, 0 },
145 {
"fixup_sparc_tls_ldo_lox10", 22, 10, 0 },
146 {
"fixup_sparc_tls_ldo_add", 0, 0, 0 },
147 {
"fixup_sparc_tls_ie_hi22", 10, 22, 0 },
148 {
"fixup_sparc_tls_ie_lo10", 22, 10, 0 },
149 {
"fixup_sparc_tls_ie_ld", 0, 0, 0 },
150 {
"fixup_sparc_tls_ie_ldx", 0, 0, 0 },
151 {
"fixup_sparc_tls_ie_add", 0, 0, 0 },
152 {
"fixup_sparc_tls_le_hix22", 0, 0, 0 },
153 {
"fixup_sparc_tls_le_lox10", 0, 0, 0 }
163 {
"fixup_sparc_hi22", 0, 22, 0 },
164 {
"fixup_sparc_lo10", 0, 10, 0 },
165 {
"fixup_sparc_h44", 0, 22, 0 },
166 {
"fixup_sparc_m44", 0, 10, 0 },
167 {
"fixup_sparc_l44", 0, 12, 0 },
168 {
"fixup_sparc_hh", 0, 22, 0 },
169 {
"fixup_sparc_hm", 0, 10, 0 },
172 {
"fixup_sparc_got22", 0, 22, 0 },
173 {
"fixup_sparc_got10", 0, 10, 0 },
175 {
"fixup_sparc_tls_gd_hi22", 0, 22, 0 },
176 {
"fixup_sparc_tls_gd_lo10", 0, 10, 0 },
177 {
"fixup_sparc_tls_gd_add", 0, 0, 0 },
178 {
"fixup_sparc_tls_gd_call", 0, 0, 0 },
179 {
"fixup_sparc_tls_ldm_hi22", 0, 22, 0 },
180 {
"fixup_sparc_tls_ldm_lo10", 0, 10, 0 },
181 {
"fixup_sparc_tls_ldm_add", 0, 0, 0 },
182 {
"fixup_sparc_tls_ldm_call", 0, 0, 0 },
183 {
"fixup_sparc_tls_ldo_hix22", 0, 22, 0 },
184 {
"fixup_sparc_tls_ldo_lox10", 0, 10, 0 },
185 {
"fixup_sparc_tls_ldo_add", 0, 0, 0 },
186 {
"fixup_sparc_tls_ie_hi22", 0, 22, 0 },
187 {
"fixup_sparc_tls_ie_lo10", 0, 10, 0 },
188 {
"fixup_sparc_tls_ie_ld", 0, 0, 0 },
189 {
"fixup_sparc_tls_ie_ldx", 0, 0, 0 },
190 {
"fixup_sparc_tls_ie_add", 0, 0, 0 },
191 {
"fixup_sparc_tls_le_hix22", 0, 0, 0 },
192 {
"fixup_sparc_tls_le_lox10", 0, 0, 0 }
209 bool &IsResolved)
override {
236 bool mayNeedRelaxation(
const MCInst &Inst)
const override {
243 bool fixupNeedsRelaxation(
const MCFixup &Fixup,
251 void relaxInstruction(
const MCInst &Inst,
MCInst &Res)
const override {
256 bool writeNopData(uint64_t Count,
MCObjectWriter *OW)
const override {
261 uint64_t NumNops = Count / 4;
262 for (uint64_t i = 0; i != NumNops; ++i)
269 class ELFSparcAsmBackend :
public SparcAsmBackend {
273 SparcAsmBackend(T), OSType(OSType) { }
275 void applyFixup(
const MCFixup &Fixup,
char *
Data,
unsigned DataSize,
276 uint64_t Value,
bool IsPCRel)
const override {
286 for (
unsigned i = 0; i != 4; ++i) {
287 unsigned Idx = IsLittleEndian ? i : 3 - i;
288 Data[Offset + Idx] |= uint8_t((Value >> (i * 8)) & 0xff);
303 return new ELFSparcAsmBackend(T, TT.
getOS());
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
fixup_sparc_got22 - 22-bit fixup corresponding to got22(foo)
const MCSymbol & getSymbol() const
This represents an "assembler immediate".
fixup_sparc_m44 - 10-bit fixup corresponding to m44(foo)
Defines the object file and target independent interfaces used by the assembler backend to write nati...
MCObjectWriter * createSparcELFObjectWriter(raw_pwrite_stream &OS, bool Is64Bit, bool IsLIttleEndian, uint8_t OSABI)
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...
Encapsulates the layout of an assembly file at a particular point in time.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
fixup_sparc_got10 - 10-bit fixup corresponding to got10(foo)
MCAsmBackend * createSparcAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU)
static StringRef getName(Value *V)
fixup_sparc_hm - 10-bit fixup corresponding to hm(foo)
uint32_t getOffset() const
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...
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
void write32(uint32_t Value)
fixup_sparc_hh - 22-bit fixup corresponding to hh(foo)
MCFixupKind
Extensible enumeration to represent the type of a fixup.
fixup_sparc_l44 - 12-bit fixup corresponding to l44(foo)
MCFixupKind getKind() const
fixup_sparc_bpr - 16-bit fixup for bpr
static unsigned adjustFixupValue(unsigned Kind, uint64_t Value)
Triple - Helper class for working with autoconf configuration names.
PowerPC TLS Dynamic Call Fixup
fixup_sparc_lo10 - 10-bit fixup corresponding to lo(foo)
const MCSymbolRefExpr * getSymA() const
Target - Wrapper for Target specific information.
fixup_sparc_pc22 - 22-bit fixup corresponding to pc22(foo)
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
Target independent information on a fixup kind.
An abstract base class for streams implementations that also support a pwrite operation.
fixup_sparc_br22 - 22-bit PC relative relocation for branches
const ARM::ArchExtKind Kind
LLVM Value Representation.
Generic interface to target specific assembler backends.
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
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
fixup_sparc_h44 - 22-bit fixup corresponding to h44(foo)
fixup_sparc_pc10 - 10-bit fixup corresponding to pc10(foo)