diff options
author | 2014-07-03 20:48:11 +0000 | |
---|---|---|
committer | 2014-07-02 20:50:08 +0000 | |
commit | 3ee86bcbbc29f17b0243954a52dcda96b09411e0 (patch) | |
tree | 4e469788e93abd12b89e50a79582e6b16c2d1498 /disassembler/disassembler_x86.cc | |
parent | aa079560f65a89ec83591f61ae3a39341f00509e (diff) | |
parent | 5192cbb12856b12620dc346758605baaa1469ced (diff) |
Merge "Load 64 bit constant into GPR by single instruction for 64bit mode"
Diffstat (limited to 'disassembler/disassembler_x86.cc')
-rw-r--r-- | disassembler/disassembler_x86.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc index 1d8cf9b4cd..1021789908 100644 --- a/disassembler/disassembler_x86.cc +++ b/disassembler/disassembler_x86.cc @@ -21,6 +21,7 @@ #include "base/logging.h" #include "base/stringprintf.h" #include "thread.h" +#include <inttypes.h> namespace art { namespace x86 { @@ -914,6 +915,12 @@ DISASSEMBLER_ENTRY(cmp, reg_in_opcode = true; break; case 0xB8: case 0xB9: case 0xBA: case 0xBB: case 0xBC: case 0xBD: case 0xBE: case 0xBF: + if (rex == 0x48) { + opcode << "movabsq"; + immediate_bytes = 8; + reg_in_opcode = true; + break; + } opcode << "mov"; immediate_bytes = 4; reg_in_opcode = true; @@ -1144,8 +1151,7 @@ DISASSEMBLER_ENTRY(cmp, if (immediate_bytes == 1) { args << StringPrintf("%d", *reinterpret_cast<const int8_t*>(instr)); instr++; - } else { - CHECK_EQ(immediate_bytes, 4u); + } else if (immediate_bytes == 4) { if (prefix[2] == 0x66) { // Operand size override from 32-bit to 16-bit. args << StringPrintf("%d", *reinterpret_cast<const int16_t*>(instr)); instr += 2; @@ -1153,6 +1159,10 @@ DISASSEMBLER_ENTRY(cmp, args << StringPrintf("%d", *reinterpret_cast<const int32_t*>(instr)); instr += 4; } + } else { + CHECK_EQ(immediate_bytes, 8u); + args << StringPrintf("%" PRId64, *reinterpret_cast<const int64_t*>(instr)); + instr += 8; } } else if (branch_bytes > 0) { DCHECK(!has_modrm); |