24 #define DEBUG_TYPE "asm-printer" 27 #define PRINT_ALIAS_INSTR 28 #include "MSP430GenAsmWriter.inc" 37 void MSP430InstPrinter::printPCRelImmOperand(
const MCInst *
MI,
unsigned OpNo,
41 int64_t Imm = Op.
getImm() * 2 + 2;
47 assert(Op.
isExpr() &&
"unknown pcrel immediate operand");
52 void MSP430InstPrinter::printOperand(
const MCInst *MI,
unsigned OpNo,
54 assert((Modifier ==
nullptr || Modifier[0] == 0) &&
"No modifiers supported");
58 }
else if (Op.
isImm()) {
61 assert(Op.
isExpr() &&
"unknown operand kind in printOperand");
67 void 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))
97 void MSP430InstPrinter::printIndRegOperand(
const MCInst *MI,
unsigned OpNo,
103 void MSP430InstPrinter::printPostIndRegOperand(
const MCInst *MI,
unsigned OpNo,
109 void MSP430InstPrinter::printCCOperand(
const MCInst *MI,
unsigned OpNo,
bool printAliasInstr(const MCInst *MI, raw_ostream &O)
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
This class represents lattice values for constants.
static const char * getRegisterName(unsigned RegNo)
unsigned getReg() const
Returns the register number.
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const MCOperand & getOperand(unsigned i) const
void printInstruction(const MCInst *MI, raw_ostream &O)
Generic base class for all target subtargets.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
Instances of this class represent operands of the MCInst class.