From fba52f1b4bf753790c1d98265c4b0fabb54c7536 Mon Sep 17 00:00:00 2001 From: Vladimir Kostyukov Date: Tue, 15 Apr 2014 15:41:47 +0700 Subject: ART: Fixes an issue with REX prefix for instructions with no ModRM byte There are instructions (such as push, pop, mov) in the x86 ISA that encode first operands in their opcodes (opcode + reg). In order to enable an extended 64bit registers (R9-R15) a special prefix REX.B should be emitted before such instructions. This patch fixes the issue when REX.R prefix was emitted before instructions with no MorRM byte. So, the REX-prefix was simply ignored by CPU for those instructions whose operands are encoded in their opcodes. This patch makes the jni_compiler_test passed with JNI compiler enabled for x86_64 target. Change-Id: Ib84da1cf9f8ff96bd7afd4e0fc53078f3231f8ec Signed-off-by: Vladimir Kostyukov --- disassembler/disassembler_x86.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'disassembler') diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc index 68e77d4..1b96a2b 100644 --- a/disassembler/disassembler_x86.cc +++ b/disassembler/disassembler_x86.cc @@ -735,7 +735,7 @@ DISASSEMBLER_ENTRY(cmp, std::ostringstream args; if (reg_in_opcode) { DCHECK(!has_modrm); - DumpReg(args, rex, *instr & 0x7, false, prefix[2], GPR); + DumpBaseReg(args, rex, *instr & 0x7); } instr++; uint32_t address_bits = 0; -- cgit v1.1