54 uint64_t
Value,
bool IsResolved,
57 std::unique_ptr<MCObjectTargetWriter>
58 createObjectTargetWriter()
const override;
61 bool fixupNeedsRelaxation(
const MCFixup & , uint64_t ,
69 unsigned getNumFixupKinds()
const override {
73 bool mayNeedRelaxation(
const MCInst & ,
78 void relaxInstruction(
const MCInst & ,
80 MCInst & )
const override {}
82 bool writeNopData(
raw_ostream &OS, uint64_t Count)
const override;
85 bool LanaiAsmBackend::writeNopData(
raw_ostream &OS, uint64_t Count)
const {
89 for (uint64_t i = 0; i < Count; i += 4)
90 OS.
write(
"\x15\0\0\0", 4);
109 unsigned NumBytes = (getFixupKindInfo(Kind).TargetSize + 7) / 8;
110 unsigned FullSize = 4;
116 for (
unsigned i = 0; i != NumBytes; ++i) {
117 unsigned Idx = (FullSize - 1 - i);
118 CurVal |=
static_cast<uint64_t
>(
static_cast<uint8_t
>(Data[Offset + Idx]))
123 (
static_cast<uint64_t
>(-1) >> (64 - getFixupKindInfo(Kind).TargetSize));
124 CurVal |= Value &
Mask;
127 for (
unsigned i = 0; i != NumBytes; ++i) {
128 unsigned Idx = (FullSize - 1 - i);
129 Data[Offset + Idx] =
static_cast<uint8_t
>((CurVal >> (i * 8)) & 0xff);
133 std::unique_ptr<MCObjectTargetWriter>
134 LanaiAsmBackend::createObjectTargetWriter()
const {
151 {
"FIXUP_LANAI_NONE", 0, 32, 0},
152 {
"FIXUP_LANAI_21", 16, 16 , 0},
153 {
"FIXUP_LANAI_21_F", 16, 16 , 0},
154 {
"FIXUP_LANAI_25", 7, 25, 0},
155 {
"FIXUP_LANAI_32", 0, 32, 0},
156 {
"FIXUP_LANAI_HI16", 16, 16, 0},
157 {
"FIXUP_LANAI_LO16", 16, 16, 0}};
177 return new LanaiAsmBackend(T, TT.
getOS());
This class represents lattice values for constants.
This represents an "assembler immediate".
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
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.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
const Triple & getTargetTriple() const
Encapsulates the layout of an assembly file at a particular point in time.
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...
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.
std::unique_ptr< MCObjectTargetWriter > createLanaiELFObjectWriter(uint8_t OSABI)
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.
raw_ostream & write(unsigned char C)
PowerPC TLS Dynamic Call Fixup
static unsigned adjustFixupValue(unsigned Kind, uint64_t Value)
Target - Wrapper for Target specific information.
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.
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...
MCFixupKind getKind() const
MCAsmBackend * createLanaiAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)