39#define DEBUG_TYPE "asm-printer"
41#define PRINT_ALIAS_INSTR
42#include "M68kGenAsmWriter.inc"
57void M68kInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
66 printImmediate(
MI, OpNo, O);
70 assert(MO.
isExpr() &&
"Unknown operand kind in printOperand");
74void M68kInstPrinter::printImmediate(
const MCInst *
MI,
unsigned opNum,
86void M68kInstPrinter::printMoveMask(
const MCInst *
MI,
unsigned opNum,
88 unsigned Mask =
MI->getOperand(opNum).getImm();
89 assert((Mask & 0xFFFF) == Mask &&
"Mask is always 16 bits");
107 for (
int s = 0; s < 16; s += 8) {
108 HalfMask = (
Mask >> s) & 0xFF;
111 if (s != 0 && (Mask & 0xFF) && HalfMask)
114 for (
int i = 0; HalfMask; ++i) {
115 if ((HalfMask >> i) & 0b1) {
116 HalfMask ^= 0b1 << i;
121 while ((HalfMask >> (j + 1)) & 0b1)
122 HalfMask ^= 0b1 << ++
j;
139void M68kInstPrinter::printDisp(
const MCInst *
MI,
unsigned opNum,
146 assert(
Op.isExpr() &&
"Unknown operand kind in printOperand");
151void M68kInstPrinter::printAbsMem(
const MCInst *
MI,
unsigned opNum,
160 assert(MO.
isImm() &&
"absolute memory addressing needs an immediate");
This file contains small standalone helper functions and enum definitions for the M68k target useful ...
This file contains declarations for an M68k MCInst printer.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class represents an Operation in the Expression.
bool print(raw_ostream &OS, DIDumpOptions DumpOpts, const DWARFExpression *Expr, DWARFUnit *U) const
bool printAliasInstr(const MCInst *MI, uint64_t Address, raw_ostream &OS)
void printRegName(raw_ostream &OS, MCRegister Reg) override
Print the assembler register name.
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
static const char * getRegisterName(MCRegister Reg)
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent operands of the MCInst class.
MCRegister getReg() const
Returns the register number.
const MCExpr * getExpr() const
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
StringRef - Represent a constant reference to a string, i.e.
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.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
static unsigned getMaskedSpillRegister(unsigned order)
Reg
All possible values of the reg field in the ModR/M byte.
This is an optimization pass for GlobalISel generic memory operations.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.