41#define DEBUG_TYPE "M68k-asm-backend"
46 bool Allows32BitBranch;
52 .
CasesLower(
"m68020",
"m68030",
"m68040",
true)
64 void relaxInstruction(
MCInst &Inst,
70 unsigned getMinimumNopSize()
const override {
return 2; }
92 "Value does not fit in the Fixup field");
95 for (
unsigned i = 0; i !=
Size; ++i)
96 Data[i] = uint8_t(
static_cast<int64_t
>(
Value) >> ((
Size - i - 1) * 8));
184 const MCSubtargetInfo &STI)
const {
191bool M68kAsmBackend::fixupNeedsRelaxation(
const MCFixup &
Fixup,
192 uint64_t UnsignedValue)
const {
193 int64_t
Value =
static_cast<int64_t
>(UnsignedValue);
202 bool FixupFieldTooSmall =
false;
204 FixupFieldTooSmall =
true;
206 FixupFieldTooSmall =
true;
212 bool ZeroDisplacementNeedsFixup =
Value == 0 && KindLog2Size == 0;
214 return ZeroDisplacementNeedsFixup || FixupFieldTooSmall;
219void M68kAsmBackend::relaxInstruction(MCInst &Inst,
220 const MCSubtargetInfo &STI)
const {
226bool M68kAsmBackend::writeNopData(raw_ostream &OS, uint64_t
Count,
227 const MCSubtargetInfo *STI)
const {
232 uint64_t NumNops =
Count / 2;
233 for (uint64_t i = 0; i != NumNops; ++i) {
242class M68kELFAsmBackend :
public M68kAsmBackend {
245 M68kELFAsmBackend(
const Target &
T,
const MCSubtargetInfo &STI, uint8_t OSABI)
246 : M68kAsmBackend(
T, STI), OSABI(OSABI) {}
248 std::unique_ptr<MCObjectTargetWriter>
249 createObjectTargetWriter()
const override {
262 return new M68kELFAsmBackend(
T, STI, OSABI);
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static unsigned getRelaxedOpcodeBranch(unsigned Op)
cc—Carry clear GE—Greater than or equal LS—Lower or same PL—Plus CS—Carry set GT—Greater than LT—Less...
static unsigned getRelaxedOpcode(unsigned Opcode)
This file contains small standalone helper functions and enum definitions for the M68k target useful ...
This file contains M68k specific fixup entries.
mir Rename Register Operands
PowerPC TLS Dynamic Call Fixup
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Generic interface to target specific assembler backends.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Instances of this class represent a single low-level machine instruction.
unsigned getOpcode() const
void setOpcode(unsigned Op)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
A switch()-like statement whose cases are string literals.
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, T Value)
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
OSType getOS() const
Get the parsed operating system type of this triple.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
static unsigned getFixupKindLog2Size(unsigned Kind)
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
std::unique_ptr< MCObjectTargetWriter > createM68kELFObjectWriter(uint8_t OSABI)
Construct an M68k ELF object writer.
MCAsmBackend * createM68kAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
FunctionAddr VTableAddr Count
FunctionAddr VTableAddr uintptr_t uintptr_t Data
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.