79 Value = (int64_t)Value / 4;
89 Value = (int64_t)Value / 4;
91 if (!isInt<19>(Value)) {
110 Value = ((Value + 0x8000) >> 16) & 0xffff;
115 Value = ((Value + 0x80008000LL) >> 32) & 0xffff;
120 Value = ((Value + 0x800080008000LL) >> 48) & 0xffff;
128 Value = (int64_t) Value / 2;
130 if (!isInt<7>(Value)) {
138 Value = (int64_t) Value / 2;
140 if (!isInt<10>(Value)) {
148 Value = (int64_t)Value / 2;
157 Value = (int64_t)Value / 8;
159 if (!isInt<18>(Value)) {
170 Value = (int64_t)Value / 8;
172 if (!isInt<18>(Value)) {
179 Value = (int64_t) Value / 4;
181 if (!isInt<21>(Value)) {
188 Value = (int64_t) Value / 4;
190 if (!isInt<26>(Value)) {
197 Value = (int64_t)Value / 2;
199 if (!isInt<26>(Value)) {
206 Value = (int64_t)Value / 2;
208 if (!isInt<21>(Value)) {
218 std::unique_ptr<MCObjectTargetWriter>
235 assert(i <= 3 &&
"Index out of range!");
237 return (1 - i / 2) * 2 + i % 2;
262 switch ((
unsigned)
Kind) {
283 for (
unsigned i = 0; i != NumBytes; ++i) {
286 : (FullSize - 1 - i);
287 CurVal |= (uint64_t)((uint8_t)Data[Offset + Idx]) << (i*8);
290 uint64_t
Mask = ((uint64_t)(-1) >>
292 CurVal |= Value &
Mask;
295 for (
unsigned i = 0; i != NumBytes; ++i) {
298 : (FullSize - 1 - i);
299 Data[Offset + Idx] = (uint8_t)((CurVal >> (i*8)) & 0xff);
329 .
Case(
"R_MICROMIPS_TLS_GOTTPREL",
331 .
Case(
"R_MICROMIPS_TLS_DTPREL_HI16",
333 .
Case(
"R_MICROMIPS_TLS_DTPREL_LO16",
337 .
Case(
"R_MICROMIPS_TLS_TPREL_HI16",
339 .
Case(
"R_MICROMIPS_TLS_TPREL_LO16",
351 {
"fixup_Mips_NONE", 0, 0, 0 },
352 {
"fixup_Mips_16", 0, 16, 0 },
353 {
"fixup_Mips_32", 0, 32, 0 },
354 {
"fixup_Mips_REL32", 0, 32, 0 },
355 {
"fixup_Mips_26", 0, 26, 0 },
356 {
"fixup_Mips_HI16", 0, 16, 0 },
357 {
"fixup_Mips_LO16", 0, 16, 0 },
358 {
"fixup_Mips_GPREL16", 0, 16, 0 },
359 {
"fixup_Mips_LITERAL", 0, 16, 0 },
360 {
"fixup_Mips_GOT", 0, 16, 0 },
362 {
"fixup_Mips_CALL16", 0, 16, 0 },
363 {
"fixup_Mips_GPREL32", 0, 32, 0 },
364 {
"fixup_Mips_SHIFT5", 6, 5, 0 },
365 {
"fixup_Mips_SHIFT6", 6, 5, 0 },
366 {
"fixup_Mips_64", 0, 64, 0 },
367 {
"fixup_Mips_TLSGD", 0, 16, 0 },
368 {
"fixup_Mips_GOTTPREL", 0, 16, 0 },
369 {
"fixup_Mips_TPREL_HI", 0, 16, 0 },
370 {
"fixup_Mips_TPREL_LO", 0, 16, 0 },
371 {
"fixup_Mips_TLSLDM", 0, 16, 0 },
372 {
"fixup_Mips_DTPREL_HI", 0, 16, 0 },
373 {
"fixup_Mips_DTPREL_LO", 0, 16, 0 },
375 {
"fixup_Mips_GPOFF_HI", 0, 16, 0 },
376 {
"fixup_MICROMIPS_GPOFF_HI",0, 16, 0 },
377 {
"fixup_Mips_GPOFF_LO", 0, 16, 0 },
378 {
"fixup_MICROMIPS_GPOFF_LO",0, 16, 0 },
379 {
"fixup_Mips_GOT_PAGE", 0, 16, 0 },
380 {
"fixup_Mips_GOT_OFST", 0, 16, 0 },
381 {
"fixup_Mips_GOT_DISP", 0, 16, 0 },
382 {
"fixup_Mips_HIGHER", 0, 16, 0 },
383 {
"fixup_MICROMIPS_HIGHER", 0, 16, 0 },
384 {
"fixup_Mips_HIGHEST", 0, 16, 0 },
385 {
"fixup_MICROMIPS_HIGHEST", 0, 16, 0 },
386 {
"fixup_Mips_GOT_HI16", 0, 16, 0 },
387 {
"fixup_Mips_GOT_LO16", 0, 16, 0 },
388 {
"fixup_Mips_CALL_HI16", 0, 16, 0 },
389 {
"fixup_Mips_CALL_LO16", 0, 16, 0 },
396 {
"fixup_MICROMIPS_26_S1", 0, 26, 0 },
397 {
"fixup_MICROMIPS_HI16", 0, 16, 0 },
398 {
"fixup_MICROMIPS_LO16", 0, 16, 0 },
399 {
"fixup_MICROMIPS_GOT16", 0, 16, 0 },
407 {
"fixup_MICROMIPS_CALL16", 0, 16, 0 },
408 {
"fixup_MICROMIPS_GOT_DISP", 0, 16, 0 },
409 {
"fixup_MICROMIPS_GOT_PAGE", 0, 16, 0 },
410 {
"fixup_MICROMIPS_GOT_OFST", 0, 16, 0 },
411 {
"fixup_MICROMIPS_TLS_GD", 0, 16, 0 },
412 {
"fixup_MICROMIPS_TLS_LDM", 0, 16, 0 },
413 {
"fixup_MICROMIPS_TLS_DTPREL_HI16", 0, 16, 0 },
414 {
"fixup_MICROMIPS_TLS_DTPREL_LO16", 0, 16, 0 },
415 {
"fixup_MICROMIPS_GOTTPREL", 0, 16, 0 },
416 {
"fixup_MICROMIPS_TLS_TPREL_HI16", 0, 16, 0 },
417 {
"fixup_MICROMIPS_TLS_TPREL_LO16", 0, 16, 0 },
418 {
"fixup_Mips_SUB", 0, 64, 0 },
419 {
"fixup_MICROMIPS_SUB", 0, 64, 0 }
422 "Not all MIPS little endian fixup kinds added!");
429 {
"fixup_Mips_NONE", 0, 0, 0 },
430 {
"fixup_Mips_16", 16, 16, 0 },
431 {
"fixup_Mips_32", 0, 32, 0 },
432 {
"fixup_Mips_REL32", 0, 32, 0 },
433 {
"fixup_Mips_26", 6, 26, 0 },
434 {
"fixup_Mips_HI16", 16, 16, 0 },
435 {
"fixup_Mips_LO16", 16, 16, 0 },
436 {
"fixup_Mips_GPREL16", 16, 16, 0 },
437 {
"fixup_Mips_LITERAL", 16, 16, 0 },
438 {
"fixup_Mips_GOT", 16, 16, 0 },
440 {
"fixup_Mips_CALL16", 16, 16, 0 },
441 {
"fixup_Mips_GPREL32", 0, 32, 0 },
442 {
"fixup_Mips_SHIFT5", 21, 5, 0 },
443 {
"fixup_Mips_SHIFT6", 21, 5, 0 },
444 {
"fixup_Mips_64", 0, 64, 0 },
445 {
"fixup_Mips_TLSGD", 16, 16, 0 },
446 {
"fixup_Mips_GOTTPREL", 16, 16, 0 },
447 {
"fixup_Mips_TPREL_HI", 16, 16, 0 },
448 {
"fixup_Mips_TPREL_LO", 16, 16, 0 },
449 {
"fixup_Mips_TLSLDM", 16, 16, 0 },
450 {
"fixup_Mips_DTPREL_HI", 16, 16, 0 },
451 {
"fixup_Mips_DTPREL_LO", 16, 16, 0 },
453 {
"fixup_Mips_GPOFF_HI", 16, 16, 0 },
454 {
"fixup_MICROMIPS_GPOFF_HI", 16, 16, 0 },
455 {
"fixup_Mips_GPOFF_LO", 16, 16, 0 },
456 {
"fixup_MICROMIPS_GPOFF_LO", 16, 16, 0 },
457 {
"fixup_Mips_GOT_PAGE", 16, 16, 0 },
458 {
"fixup_Mips_GOT_OFST", 16, 16, 0 },
459 {
"fixup_Mips_GOT_DISP", 16, 16, 0 },
460 {
"fixup_Mips_HIGHER", 16, 16, 0 },
461 {
"fixup_MICROMIPS_HIGHER", 16, 16, 0 },
462 {
"fixup_Mips_HIGHEST", 16, 16, 0 },
463 {
"fixup_MICROMIPS_HIGHEST",16, 16, 0 },
464 {
"fixup_Mips_GOT_HI16", 16, 16, 0 },
465 {
"fixup_Mips_GOT_LO16", 16, 16, 0 },
466 {
"fixup_Mips_CALL_HI16", 16, 16, 0 },
467 {
"fixup_Mips_CALL_LO16", 16, 16, 0 },
474 {
"fixup_MICROMIPS_26_S1", 6, 26, 0 },
475 {
"fixup_MICROMIPS_HI16", 16, 16, 0 },
476 {
"fixup_MICROMIPS_LO16", 16, 16, 0 },
477 {
"fixup_MICROMIPS_GOT16", 16, 16, 0 },
485 {
"fixup_MICROMIPS_CALL16", 16, 16, 0 },
486 {
"fixup_MICROMIPS_GOT_DISP", 16, 16, 0 },
487 {
"fixup_MICROMIPS_GOT_PAGE", 16, 16, 0 },
488 {
"fixup_MICROMIPS_GOT_OFST", 16, 16, 0 },
489 {
"fixup_MICROMIPS_TLS_GD", 16, 16, 0 },
490 {
"fixup_MICROMIPS_TLS_LDM", 16, 16, 0 },
491 {
"fixup_MICROMIPS_TLS_DTPREL_HI16", 16, 16, 0 },
492 {
"fixup_MICROMIPS_TLS_DTPREL_LO16", 16, 16, 0 },
493 {
"fixup_MICROMIPS_GOTTPREL", 16, 16, 0 },
494 {
"fixup_MICROMIPS_TLS_TPREL_HI16", 16, 16, 0 },
495 {
"fixup_MICROMIPS_TLS_TPREL_LO16", 16, 16, 0 },
496 {
"fixup_Mips_SUB", 0, 64, 0 },
497 {
"fixup_MICROMIPS_SUB", 0, 64, 0 }
500 "Not all MIPS big endian fixup kinds added!");
static bool needsMMLEByteOrder(unsigned Kind)
A eight-byte dtp relative fixup.
void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target, MutableArrayRef< char > Data, uint64_t Value, bool IsResolved, const MCSubtargetInfo *STI) const override
ApplyFixup - Apply the Value for given Fixup into the provided data fragment, at the offset specified...
Compute iterated dominance frontiers using a linear time algorithm.
This represents an "assembler immediate".
const support::endianness Endian
std::unique_ptr< MCObjectTargetWriter > createMipsELFObjectWriter(const Triple &TT, bool IsN32)
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
constexpr bool isInt< 16 >(int64_t x)
bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target) override
Hook to check if a relocation is needed for some target specific reason.
static Lanai::Fixups FixupKind(const MCExpr *Expr)
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...
MCContext & getContext() const
const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const override
Get information on a fixup kind.
A four-byte tp relative fixup.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
unsigned getNumFixupKinds() const override
Get the number of target specific fixup kinds.
MCAsmBackend * createMipsAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Context object for machine code objects.
MipsAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, bool N32)
A four-byte gp relative fixup.
std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const override
LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L, const Twine &Msg)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
A switch()-like statement whose cases are string literals.
A four-byte dtp relative fixup.
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.
bool writeNopData(raw_ostream &OS, uint64_t Count) const override
WriteNopData - Write an (optimal) nop sequence of Count bytes to the given output.
void reportError(SMLoc L, const Twine &Msg)
uint32_t getOffset() const
A eight-byte tp relative fixup.
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
virtual Optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
unsigned TargetSize
The number of bits written by this fixup.
Target - Wrapper for Target specific information.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
Generic base class for all target subtargets.
Optional< MCFixupKind > getFixupKind(StringRef Name) const override
Map a relocation name used in .reloc to a fixup kind.
Target independent information on a fixup kind.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Generic interface to target specific assembler backends.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
This class implements an extremely fast bulk output stream that can only output to a stream...
static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value, MCContext &Ctx)
StringRef - Represent a constant reference to a string, i.e.
static unsigned calculateMMLEIndex(unsigned i)
MCFixupKind getKind() const