53 uint64_t
Value,
bool IsResolved,
56 std::unique_ptr<MCObjectTargetWriter>
57 createObjectTargetWriter()
const override;
60 bool fixupNeedsRelaxation(
const MCFixup & , uint64_t ,
68 unsigned getNumFixupKinds()
const override {
72 bool mayNeedRelaxation(
const MCInst & ,
77 void relaxInstruction(
const MCInst & ,
79 MCInst & )
const override {}
81 bool writeNopData(
raw_ostream &OS, uint64_t Count)
const override;
84 bool LanaiAsmBackend::writeNopData(
raw_ostream &OS, uint64_t Count)
const {
88 for (uint64_t i = 0; i < Count; i += 4)
89 OS.
write(
"\x15\0\0\0", 4);
108 unsigned NumBytes = (getFixupKindInfo(Kind).TargetSize + 7) / 8;
109 unsigned FullSize = 4;
115 for (
unsigned i = 0; i != NumBytes; ++i) {
116 unsigned Idx = (FullSize - 1 - i);
117 CurVal |=
static_cast<uint64_t
>(
static_cast<uint8_t
>(Data[Offset + Idx]))
122 (
static_cast<uint64_t
>(-1) >> (64 - getFixupKindInfo(Kind).TargetSize));
123 CurVal |= Value &
Mask;
126 for (
unsigned i = 0; i != NumBytes; ++i) {
127 unsigned Idx = (FullSize - 1 - i);
128 Data[Offset + Idx] =
static_cast<uint8_t
>((CurVal >> (i * 8)) & 0xff);
132 std::unique_ptr<MCObjectTargetWriter>
133 LanaiAsmBackend::createObjectTargetWriter()
const {
150 {
"FIXUP_LANAI_NONE", 0, 32, 0},
151 {
"FIXUP_LANAI_21", 16, 16 , 0},
152 {
"FIXUP_LANAI_21_F", 16, 16 , 0},
153 {
"FIXUP_LANAI_25", 7, 25, 0},
154 {
"FIXUP_LANAI_32", 0, 32, 0},
155 {
"FIXUP_LANAI_HI16", 16, 16, 0},
156 {
"FIXUP_LANAI_LO16", 16, 16, 0}};
176 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)