From: kub Date: Wed, 8 Jul 2020 18:48:16 +0000 (+0200) Subject: sh2 drc, fix for x86_64 backend X-Git-Tag: v2.00~719 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1426b7569edccd4f5f7512a9ce4a9c2c7066fac7;p=picodrive.git sh2 drc, fix for x86_64 backend --- diff --git a/cpu/drc/emit_x86.c b/cpu/drc/emit_x86.c index 7006beff..60b2b6a2 100644 --- a/cpu/drc/emit_x86.c +++ b/cpu/drc/emit_x86.c @@ -915,8 +915,10 @@ enum { xAX = 0, xCX, xDX, xBX, xSP, xBP, xSI, xDI, // x86-64,i386 common #define emith_call_cond(cond, ptr) \ emith_call(ptr) -#define emith_call_reg(r) \ - EMIT_OP_MODRM(0xff, 3, 2, r) +#define emith_call_reg(r) do { \ + EMIT_REX_IF(0, 0, r); \ + EMIT_OP_MODRM(0xff, 3, 2, (r)&7); \ +} while (0) #define emith_call_ctx(offs) do { \ EMIT_OP_MODRM(0xff, 2, 2, CONTEXT_REG); \ @@ -934,8 +936,10 @@ enum { xAX = 0, xCX, xDX, xBX, xSP, xBP, xSI, xDI, // x86-64,i386 common emith_deref_modrm(0x03, 0, r, xSP); /* add r, [xsp] */ \ } while (0) -#define emith_jump_reg(r) \ - EMIT_OP_MODRM(0xff, 3, 4, r) +#define emith_jump_reg(r) do { \ + EMIT_REX_IF(0, 0, r); \ + EMIT_OP_MODRM(0xff, 3, 4, (r)&7); \ +} while (0) #define emith_jump_ctx(offs) do { \ EMIT_OP_MODRM(0xff, 2, 4, CONTEXT_REG); \