forked from OSchip/llvm-project
parent
1257cd8fd8
commit
e99014d471
|
@ -166,15 +166,14 @@ void X86ATTInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
|
||||||
printRegName(O, Op.getReg());
|
printRegName(O, Op.getReg());
|
||||||
} else if (Op.isImm()) {
|
} else if (Op.isImm()) {
|
||||||
// Print X86 immediates as signed values.
|
// Print X86 immediates as signed values.
|
||||||
O << markup("<imm:") << '$' << formatImm((int64_t)Op.getImm())
|
int64_t Imm = Op.getImm();
|
||||||
<< markup(">");
|
O << markup("<imm:") << '$' << formatImm(Imm) << markup(">");
|
||||||
|
|
||||||
// If there are no instruction-specific comments, add a comment clarifying
|
// If there are no instruction-specific comments, add a comment clarifying
|
||||||
// the hex value of the immediate operand when it isn't in the range
|
// the hex value of the immediate operand when it isn't in the range
|
||||||
// [-256,255].
|
// [-256,255].
|
||||||
if (CommentStream && !HasCustomInstComment &&
|
if (CommentStream && !HasCustomInstComment && (Imm > 255 || Imm < -256))
|
||||||
(Op.getImm() > 255 || Op.getImm() < -256))
|
*CommentStream << format("imm = 0x%" PRIX64 "\n", (uint64_t)Imm);
|
||||||
*CommentStream << format("imm = 0x%" PRIX64 "\n", (uint64_t)Op.getImm());
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
assert(Op.isExpr() && "unknown operand kind in printOperand");
|
assert(Op.isExpr() && "unknown operand kind in printOperand");
|
||||||
|
|
Loading…
Reference in New Issue