24#define DEBUG_TYPE "asm-printer"
53 }
else if (MO.
isImm())
86 int64_t
Value =
MI->getOperand(OpNum).getImm();
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...
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.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.