32 #define DEBUG_TYPE "asm-printer" 35 #define PRINT_ALIAS_INSTR 36 #include "X86GenAsmWriter.inc" 56 if (MI->
getOpcode() == X86::CALLpcrel32 &&
66 else if (MI->
getOpcode() == X86::DATA16_PREFIX &&
83 }
else if (Op.
isImm()) {
94 if (
CommentStream && !HasCustomInstComment && (Imm > 255 || Imm < -256)) {
96 if (Imm == (int16_t)(Imm))
98 else if (Imm == (int32_t)(Imm))
104 assert(Op.
isExpr() &&
"unknown operand kind in printOperand");
105 O <<
markup(
"<imm:") <<
'$';
122 if (DispSpec.
isImm()) {
123 int64_t DispVal = DispSpec.
getImm();
124 if (DispVal || (!IndexReg.
getReg() && !BaseReg.
getReg()))
127 assert(DispSpec.
isExpr() &&
"non-immediate displacement for LEA?");
141 O <<
',' <<
markup(
"<imm:") << ScaleVal
185 if (DispSpec.
isImm()) {
188 assert(DispSpec.
isExpr() &&
"non-immediate displacement?");
void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
static const char * getRegisterName(unsigned RegNo)
This class represents lattice values for constants.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
const FeatureBitset & getFeatureBits() const
void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS)
void printInstruction(const MCInst *MI, raw_ostream &OS)
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 printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
void printOptionalSegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &OS)
void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O)
printPCRelImm - This is used to print an immediate value that ends up being encoded as a pc-relative ...
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
StringRef markup(StringRef s) const
Utility functions to make adding mark ups simpler.
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS) override
void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &OS)
void printInstFlags(const MCInst *MI, raw_ostream &O)
const MCOperand & getOperand(unsigned i) const
void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &OS)
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
void printSrcIdx(const MCInst *MI, unsigned Op, raw_ostream &O)
Generic base class for all target subtargets.
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...
bool printAliasInstr(const MCInst *MI, raw_ostream &OS)
void printDstIdx(const MCInst *MI, unsigned Op, raw_ostream &O)
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.