23#define DEBUG_TYPE "asm-printer"
26#define PRINT_ALIAS_INSTR
27#include "MSP430GenAsmWriter.inc"
41void MSP430InstPrinter::printPCRelImmOperand(
const MCInst *
MI,
unsigned OpNo,
45 int64_t Imm =
Op.getImm() * 2 + 2;
51 assert(
Op.isExpr() &&
"unknown pcrel immediate operand");
56void MSP430InstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
58 assert((Modifier ==
nullptr || Modifier[0] == 0) &&
"No modifiers supported");
62 }
else if (
Op.isImm()) {
63 O <<
'#' <<
Op.getImm();
65 assert(
Op.isExpr() &&
"unknown operand kind in printOperand");
71void MSP430InstPrinter::printSrcMemOperand(
const MCInst *
MI,
unsigned OpNo,
73 const char *Modifier) {
85 if (
Base.getReg() == MSP430::SR)
91 assert(Disp.
isImm() &&
"Expected immediate in displacement field");
96 if ((
Base.getReg() != MSP430::SR) &&
97 (
Base.getReg() != MSP430::PC))
101void MSP430InstPrinter::printIndRegOperand(
const MCInst *
MI,
unsigned OpNo,
107void MSP430InstPrinter::printPostIndRegOperand(
const MCInst *
MI,
unsigned OpNo,
113void MSP430InstPrinter::printCCOperand(
const MCInst *
MI,
unsigned OpNo,
115 unsigned CC =
MI->getOperand(OpNo).getImm();
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
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
Wrapper class representing physical registers. Should be passed by value.
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)
void printRegName(raw_ostream &O, MCRegister Reg) const override
Print the assembler register name.
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.