27 #define DEBUG_TYPE "asm-printer" 29 #include "ARCGenAsmWriter.inc" 33 LLVM_DEBUG(
dbgs() <<
"Unknown condition code passed: " << cc <<
"\n");
34 return "{unknown-cc}";
112 if (
const auto *CE = dyn_cast<MCConstantExpr>(Expr)) {
118 if (
const auto *BE = dyn_cast<MCBinaryExpr>(Expr)) {
121 assert(SRE && CE &&
"Binary expression must be sym+const.");
122 Offset = CE->getValue();
125 assert(SRE &&
"Unexpected MCExpr type.");
140 void ARCInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNum,
153 assert(Op.
isExpr() &&
"unknown operand kind in printOperand");
157 void ARCInstPrinter::printMemOperandRI(
const MCInst *MI,
unsigned OpNum,
161 assert(base.
isReg() &&
"Base should be register.");
162 assert(offset.
isImm() &&
"Offset should be immediate.");
164 O <<
"," << offset.
getImm();
167 void ARCInstPrinter::printPredicateOperand(
const MCInst *MI,
unsigned OpNum,
171 assert(Op.
isImm() &&
"Predicate operand is immediate.");
175 void ARCInstPrinter::printBRCCPredicateOperand(
const MCInst *MI,
unsigned OpNum,
178 assert(Op.
isImm() &&
"Predicate operand is immediate.");
This class represents lattice values for constants.
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 ...
static const char * BadConditionCode(T cc)
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
static void printExpr(const MCExpr *Expr, const MCAsmInfo *MAI, raw_ostream &OS)
const MCSymbol & getSymbol() const
const MCOperand & getOperand(unsigned i) const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
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.