30 #define DEBUG_TYPE "asm-printer" 32 #include "X86GenAsmWriter1.inc" 44 if (MI->
getOpcode() == X86::DATA16_PREFIX &&
63 }
else if (Op.
isImm()) {
66 assert(Op.
isExpr() &&
"unknown operand kind in printOperand");
84 bool NeedPlus =
false;
91 if (NeedPlus) O <<
" + ";
98 if (!DispSpec.
isImm()) {
99 if (NeedPlus) O <<
" + ";
100 assert(DispSpec.
isExpr() &&
"non-immediate displacement for LEA?");
103 int64_t DispVal = DispSpec.
getImm();
104 if (DispVal || (!IndexReg.
getReg() && !BaseReg.
getReg())) {
146 if (DispSpec.
isImm()) {
149 assert(DispSpec.
isExpr() &&
"non-immediate displacement?");
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) override
void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
This class represents lattice values for constants.
void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printInstruction(const MCInst *MI, raw_ostream &O)
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
const FeatureBitset & getFeatureBits() const
unsigned getReg() const
Returns the register number.
bool EmitAnyX86InstComments(const MCInst *MI, raw_ostream &OS, const MCInstrInfo &MCII)
EmitAnyX86InstComments - This function decodes x86 instructions and prints newline terminated strings...
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
void printOptionalSegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
static const char * getRegisterName(unsigned RegNo)
void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &O)
void printInstFlags(const MCInst *MI, raw_ostream &O)
const MCOperand & getOperand(unsigned i) const
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O)
void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS)
Generic base class for all target subtargets.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O)
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.
AddrSegmentReg - The operand # of the segment in the memory operand.
unsigned getOpcode() const
Instances of this class represent operands of the MCInst class.