From 02f56f5ca59506d7d81a302511f59cb8d122e764 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Sat, 29 Dec 2012 22:11:28 -0800 Subject: Fix encoding of movsx instruction when used with new (i.e. r9-r15) registers. This fixes the indexed addressing modes when used with a word-wide index register --- gen_x86.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gen_x86.c') diff --git a/gen_x86.c b/gen_x86.c index ebc06d6..bd4c2a4 100644 --- a/gen_x86.c +++ b/gen_x86.c @@ -962,11 +962,11 @@ uint8_t * movsx_rr(uint8_t * out, uint8_t src, uint8_t dst, uint8_t src_size, ui *out |= REX_QUAD; } if (src >= R8) { - *out |= REX_REG_FIELD; + *out |= REX_RM_FIELD; src -= (R8 - X86_R8); } if (dst >= R8) { - *out |= REX_RM_FIELD; + *out |= REX_REG_FIELD; dst -= (R8 - X86_R8); } out++; @@ -992,11 +992,11 @@ uint8_t * movsx_rdisp8r(uint8_t * out, uint8_t src, int8_t disp, uint8_t dst, ui *out |= REX_QUAD; } if (src >= R8) { - *out |= REX_REG_FIELD; + *out |= REX_RM_FIELD; src -= (R8 - X86_R8); } if (dst >= R8) { - *out |= REX_RM_FIELD; + *out |= REX_REG_FIELD; dst -= (R8 - X86_R8); } out++; -- cgit v1.2.3