54 uint64_t
Value,
bool IsResolved)
const override;
59 bool fixupNeedsRelaxation(
const MCFixup & , uint64_t ,
67 unsigned getNumFixupKinds()
const override {
71 bool mayNeedRelaxation(
const MCInst & )
const override {
75 void relaxInstruction(
const MCInst & ,
77 MCInst & )
const override {}
79 bool writeNopData(uint64_t Count,
MCObjectWriter *OW)
const override;
82 bool LanaiAsmBackend::writeNopData(uint64_t Count,
MCObjectWriter *OW)
const {
86 for (uint64_t i = 0; i < Count; i += 4)
105 unsigned NumBytes = (getFixupKindInfo(Kind).TargetSize + 7) / 8;
106 unsigned FullSize = 4;
112 for (
unsigned i = 0; i != NumBytes; ++i) {
113 unsigned Idx = (FullSize - 1 - i);
114 CurVal |=
static_cast<uint64_t
>(
static_cast<uint8_t
>(Data[Offset + Idx]))
119 (
static_cast<uint64_t
>(-1) >> (64 - getFixupKindInfo(Kind).TargetSize));
120 CurVal |= Value &
Mask;
123 for (
unsigned i = 0; i != NumBytes; ++i) {
124 unsigned Idx = (FullSize - 1 - i);
125 Data[Offset + Idx] =
static_cast<uint8_t
>((CurVal >> (i * 8)) & 0xff);
136 LanaiAsmBackend::getFixupKindInfo(
MCFixupKind Kind)
const {
148 {
"FIXUP_LANAI_NONE", 0, 32, 0},
149 {
"FIXUP_LANAI_21", 16, 16 , 0},
150 {
"FIXUP_LANAI_21_F", 16, 16 , 0},
151 {
"FIXUP_LANAI_25", 7, 25, 0},
152 {
"FIXUP_LANAI_32", 0, 32, 0},
153 {
"FIXUP_LANAI_HI16", 16, 16, 0},
154 {
"FIXUP_LANAI_LO16", 16, 16, 0}};
173 return new LanaiAsmBackend(T, TT.
getOS());
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
This represents an "assembler immediate".
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Encapsulates the layout of an assembly file at a particular point in time.
MCObjectWriter * createLanaiELFObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI)
uint32_t getOffset() const
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...
void write32(uint32_t Value)
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.
MCAsmBackend * createLanaiAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TheTriple, StringRef CPU, const MCTargetOptions &Options)
MCFixupKind getKind() const
Triple - Helper class for working with autoconf configuration names.
static unsigned adjustFixupValue(unsigned Kind, uint64_t Value)
Target - Wrapper for Target specific information.
llvm_unreachable("Unknown RegBank!")
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
MCSubtargetInfo - Generic base class for all target subtargets.
Target independent information on a fixup kind.
An abstract base class for streams implementations that also support a pwrite operation.
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.
StringRef - Represent a constant reference to a string, i.e.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.