aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-22 00:44:05 +0000
committerChris Lattner <sabre@nondot.org>2009-12-22 00:44:05 +0000
commitffc0574a12fb2c8cc1b76dfebf21bccd879f5de2 (patch)
tree354690ee0bf3084c36bda87296cf4ea077ce0038 /lib/Target/X86
parentd0283fa69f81a48ec98643ae155706bd201b897e (diff)
downloadexternal_llvm-ffc0574a12fb2c8cc1b76dfebf21bccd879f5de2.zip
external_llvm-ffc0574a12fb2c8cc1b76dfebf21bccd879f5de2.tar.gz
external_llvm-ffc0574a12fb2c8cc1b76dfebf21bccd879f5de2.tar.bz2
print pcrel immediates as signed values instead of unsigned so that we
get things like this out of the disassembler: 0x100000ecb: callq -96 instead of: 0x100000ecb: callq 4294967200 rdar://7491123 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
index 8ec5b62..c74b97a 100644
--- a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
@@ -45,12 +45,14 @@ void X86ATTInstPrinter::printSSECC(const MCInst *MI, unsigned Op) {
}
/// print_pcrel_imm - This is used to print an immediate value that ends up
-/// being encoded as a pc-relative value. These print slightly differently, for
-/// example, a $ is not emitted.
+/// being encoded as a pc-relative value (e.g. for jumps and calls). These
+/// print slightly differently than normal immediates. For example, a $ is not
+/// emitted.
void X86ATTInstPrinter::print_pcrel_imm(const MCInst *MI, unsigned OpNo) {
const MCOperand &Op = MI->getOperand(OpNo);
if (Op.isImm())
- O << Op.getImm();
+ // Print this as a signed 32-bit value.
+ O << (int)Op.getImm();
else {
assert(Op.isExpr() && "unknown pcrel immediate operand");
Op.getExpr()->print(O, &MAI);