27 switch (
unsigned(Kind)) {
32 return (int64_t)Value / 2;
45 SystemZMCAsmBackend(uint8_t osABI)
49 unsigned getNumFixupKinds()
const override {
53 void applyFixup(
const MCFixup &Fixup,
char *Data,
unsigned DataSize,
54 uint64_t
Value,
bool IsPCRel)
const override;
55 bool mayNeedRelaxation(
const MCInst &Inst)
const override {
58 bool fixupNeedsRelaxation(
const MCFixup &Fixup, uint64_t
Value,
64 MCInst &Res)
const override {
67 bool writeNopData(uint64_t Count,
MCObjectWriter *OW)
const override;
81 {
"FK_390_TLS_CALL", 0, 0, 0 }
92 void SystemZMCAsmBackend::applyFixup(
const MCFixup &Fixup,
char *Data,
93 unsigned DataSize, uint64_t
Value,
97 unsigned BitSize = getFixupKindInfo(Kind).TargetSize;
98 unsigned Size = (BitSize + 7) / 8;
100 assert(Offset + Size <= DataSize &&
"Invalid fixup offset!");
105 Value &= ((uint64_t)1 << BitSize) - 1;
106 unsigned ShiftValue = (Size * 8) - 8;
107 for (
unsigned I = 0;
I != Size; ++
I) {
108 Data[Offset +
I] |= uint8_t(Value >> ShiftValue);
113 bool SystemZMCAsmBackend::writeNopData(uint64_t Count,
115 for (uint64_t
I = 0;
I != Count; ++
I)
125 return new SystemZMCAsmBackend(OSABI);
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
MCAsmBackend * createSystemZMCAsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU, const MCTargetOptions &Options)
Defines the object file and target independent interfaces used by the assembler backend to write nati...
void write8(uint8_t Value)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Is this fixup kind PCrelative? This is used by the assembler backend to evaluate fixup values in a ta...
Encapsulates the layout of an assembly file at a particular point in time.
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
MCFixupKind
Extensible enumeration to represent the type of a fixup.
MCObjectWriter * createSystemZObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI)
MCFixupKind getKind() 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.
Target - Wrapper for Target specific information.
static uint64_t extractBitsForFixup(MCFixupKind Kind, uint64_t Value)
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.
StringRef - Represent a constant reference to a string, i.e.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.