23#define DEBUG_TYPE "asm-printer"
26#define PRINT_ALIAS_INSTR
27#include "MSP430GenAsmWriter.inc"
37void MSP430InstPrinter::printPCRelImmOperand(
const MCInst *
MI,
unsigned OpNo,
41 int64_t Imm = Op.getImm() * 2 + 2;
47 assert(Op.isExpr() &&
"unknown pcrel immediate operand");
48 Op.getExpr()->print(O, &
MAI);
52void MSP430InstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
54 assert((Modifier ==
nullptr || Modifier[0] == 0) &&
"No modifiers supported");
58 }
else if (
Op.isImm()) {
59 O <<
'#' <<
Op.getImm();
61 assert(
Op.isExpr() &&
"unknown operand kind in printOperand");
63 Op.getExpr()->print(O, &
MAI);
67void MSP430InstPrinter::printSrcMemOperand(
const MCInst *
MI,
unsigned OpNo,
69 const char *Modifier) {
81 if (
Base.getReg() == MSP430::SR)
87 assert(Disp.
isImm() &&
"Expected immediate in displacement field");
92 if ((
Base.getReg() != MSP430::SR) &&
93 (
Base.getReg() != MSP430::PC))
97void MSP430InstPrinter::printIndRegOperand(
const MCInst *
MI,
unsigned OpNo,
103void MSP430InstPrinter::printPostIndRegOperand(
const MCInst *
MI,
unsigned OpNo,
109void MSP430InstPrinter::printCCOperand(
const MCInst *
MI,
unsigned OpNo,
111 unsigned CC =
MI->getOperand(OpNo).getImm();
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
const MCExpr * getExpr() const
Generic base class for all target subtargets.
static const char * getRegisterName(MCRegister Reg)
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)
bool printAliasInstr(const MCInst *MI, uint64_t Address, raw_ostream &O)
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.
This is an optimization pass for GlobalISel generic memory operations.