24#define DEBUG_TYPE "asm-printer"
53 }
else if (MO.
isImm())
74 assert(isUInt<N>(
Value) &&
"Invalid uimm argument");
86 int64_t
Value =
MI->getOperand(OpNum).getImm();
93 printUImmOperand<1>(
MI, OpNum, O);
98 printUImmOperand<2>(
MI, OpNum, O);
103 printUImmOperand<3>(
MI, OpNum, O);
108 printUImmOperand<4>(
MI, OpNum, O);
113 printSImmOperand<8>(
MI, OpNum, O);
118 printUImmOperand<8>(
MI, OpNum, O);
123 printUImmOperand<12>(
MI, OpNum, O);
128 printSImmOperand<16>(
MI, OpNum, O);
133 printUImmOperand<16>(
MI, OpNum, O);
138 printSImmOperand<32>(
MI, OpNum, O);
143 printUImmOperand<32>(
MI, OpNum, O);
148 printUImmOperand<48>(
MI, OpNum, O);
169 int64_t TargetAddress;
170 if (BranchTarget && BranchTarget->evaluateAsAbsolute(TargetAddress)) {
185 if ((
unsigned)OpNum + 1 <
MI->getNumOperands()) {
216 MI->getOperand(OpNum + 2).getReg(), O);
221 unsigned Base =
MI->getOperand(OpNum).getReg();
222 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
235 unsigned Base =
MI->getOperand(OpNum).getReg();
236 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
237 unsigned Length =
MI->getOperand(OpNum + 2).getReg();
251 MI->getOperand(OpNum + 2).getReg(), O);
257 MI->getOperand(OpNum + 2).getReg(), O);
262 static const char *
const CondNames[] = {
"o",
"h",
"nle",
"l",
"nhe",
263 "lh",
"ne",
"e",
"nlh",
"he",
264 "nl",
"le",
"nh",
"no"};
265 uint64_t Imm =
MI->getOperand(OpNum).getImm();
266 assert(Imm > 0 && Imm < 15 &&
"Invalid condition");
267 O << CondNames[Imm - 1];
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This class is intended to be used as a base class for asm properties and features specific to the tar...
void printExpr(raw_ostream &, const MCExpr &) const
WithMarkup markup(raw_ostream &OS, Markup M)
format_object< int64_t > formatHex(int64_t Value) const
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
bool PrintBranchImmAsAddress
If true, a branch immediate (e.g.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent operands of the MCInst class.
MCRegister getReg() const
Returns the register number.
const MCExpr * getExpr() const
Wrapper class representing physical registers. Should be passed by value.
Represent a reference to a symbol from inside an expression.
const MCSymbol & getSymbol() const
uint16_t getSpecifier() const
StringRef getName() const
getName - Get the symbol name.
void printUImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU2ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU3ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printBDXAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printBDVAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU4ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printSImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printPCRelOperand(const MCInst *MI, uint64_t Address, int OpNum, raw_ostream &O)
void printS8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printBDLAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O)
void printPCRelTLSOperand(const MCInst *MI, uint64_t Address, int OpNum, raw_ostream &O)
void printRegName(raw_ostream &O, MCRegister Reg) override
Print the assembler register name.
virtual void printFormattedRegName(const MCAsmInfo *MAI, MCRegister Reg, raw_ostream &O)
void printLXAAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU12ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printBDAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU1ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU48ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printAddress(const MCAsmInfo *MAI, MCRegister Base, const MCOperand &DispMO, MCRegister Index, raw_ostream &O)
void printCond4Operand(const MCInst *MI, int OpNum, raw_ostream &O)
void printBDRAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printS32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printS16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printU16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
LLVM Value Representation.
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.