26 BPFAsmBackend(
bool IsLittleEndian)
28 ~BPFAsmBackend()
override =
default;
32 uint64_t
Value,
bool IsResolved)
const override;
37 bool fixupNeedsRelaxation(
const MCFixup &Fixup, uint64_t
Value,
43 unsigned getNumFixupKinds()
const override {
return 1; }
45 bool mayNeedRelaxation(
const MCInst &Inst)
const override {
return false; }
48 MCInst &Res)
const override {}
50 bool writeNopData(uint64_t Count,
MCObjectWriter *OW)
const override;
55 bool BPFAsmBackend::writeNopData(uint64_t Count,
MCObjectWriter *OW)
const {
59 for (uint64_t i = 0; i < Count; i += 8)
68 bool IsResolved)
const {
74 for (
unsigned i = 0; i !=
Size; ++i) {
75 unsigned Idx = IsLittleEndian ? i : Size - i - 1;
76 Data[Fixup.
getOffset() + Idx] = uint8_t(Value >> (i * 8));
80 Value = (uint16_t)((Value - 8) / 8);
82 Data[Fixup.
getOffset() + 2] = Value & 0xFF;
86 Data[Fixup.
getOffset() + 3] = Value & 0xFF;
99 return new BPFAsmBackend(
true);
106 return new BPFAsmBackend(
false);
void write64(uint64_t Value)
This represents an "assembler immediate".
MCObjectWriter * createBPFELFObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI, bool IsLittleEndian)
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.
MCAsmBackend * createBPFAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, const MCTargetOptions &Options)
A four-byte section relative fixup.
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...
unsigned const MachineRegisterInfo * MRI
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
MCFixupKind getKind() const
Triple - Helper class for working with autoconf configuration names.
MCAsmBackend * createBPFbeAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, const MCTargetOptions &Options)
A two-byte pc relative fixup.
Target - Wrapper for Target specific information.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
A eight-byte section relative fixup.
MCSubtargetInfo - Generic base class for all target subtargets.
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.
StringRef - Represent a constant reference to a string, i.e.