28 #define DEBUG_TYPE "asm-printer" 30 #include "ARCGenAsmWriter.inc" 107 if (
const auto *CE = dyn_cast<MCConstantExpr>(Expr)) {
113 if (
const auto *BE = dyn_cast<MCBinaryExpr>(Expr)) {
116 assert(SRE && CE &&
"Binary expression must be sym+const.");
117 Offset = CE->getValue();
120 assert(SRE &&
"Unexpected MCExpr type.");
135 void ARCInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNum,
148 assert(Op.
isExpr() &&
"unknown operand kind in printOperand");
152 void ARCInstPrinter::printMemOperandRI(
const MCInst *MI,
unsigned OpNum,
156 assert(base.
isReg() &&
"Base should be register.");
157 assert(offset.
isImm() &&
"Offset should be immediate.");
159 O <<
"," << offset.
getImm();
162 void ARCInstPrinter::printPredicateOperand(
const MCInst *MI,
unsigned OpNum,
166 assert(Op.
isImm() &&
"Predicate operand is immediate.");
170 void ARCInstPrinter::printBRCCPredicateOperand(
const MCInst *MI,
unsigned OpNum,
173 assert(Op.
isImm() &&
"Predicate operand is immediate.");
Compute iterated dominance frontiers using a linear time algorithm.
VariantKind getKind() const
void printInstruction(const MCInst *MI, raw_ostream &O)
static const char * ARCBRCondCodeToString(ARCCC::BRCondCode BRCC)
Base class for the full range of assembler expressions which are needed for parsing.
static const char * ARCCondCodeToString(ARCCC::CondCode CC)
Represent a reference to a symbol from inside an expression.
unsigned getReg() const
Returns the register number.
raw_ostream & write_hex(unsigned long long N)
Output N in hexadecimal, without any prefix or padding.
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
static const char * getRegisterName(unsigned RegNo)
This class is intended to be used as a base class for asm properties and features specific to the tar...
This file contains the declaration of the ARCInstPrinter class, which is used to print ARC MCInst to ...
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static void printExpr(const MCExpr *Expr, const MCAsmInfo *MAI, raw_ostream &OS)
const MCSymbol & getSymbol() const
const MCOperand & getOperand(unsigned i) const
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
Generic base class for all target subtargets.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
LLVM_NODISCARD std::string lower() const
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.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.