From: kub Date: Thu, 20 Jun 2024 18:14:15 +0000 (+0200) Subject: sh2 drc, minor fix for x86 backend X-Git-Tag: v2.00~29 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e948a120ed66f5d3f80fb9f4688eb3d959685c0d;p=picodrive.git sh2 drc, minor fix for x86 backend --- diff --git a/cpu/drc/emit_x86.c b/cpu/drc/emit_x86.c index 628adbdd..33fc8e6e 100644 --- a/cpu/drc/emit_x86.c +++ b/cpu/drc/emit_x86.c @@ -934,11 +934,12 @@ enum { xAX = 0, xCX, xDX, xBX, xSP, xBP, xSI, xDI, // x86-64,i386 common #define emith_call_reg(r) do { \ EMIT_REX_IF(0, 0, r); \ - EMIT_OP_MODRM(0xff, 3, 2, (r)&7); \ + EMIT_OP_MODRM64(0xff, 3, 2, r); \ } while (0) #define emith_abicall_ctx(offs) do { \ - EMIT_OP_MODRM(0xff, 2, 2, CONTEXT_REG); \ + EMIT_REX_IF(0, 0, CONTEXT_REG); \ + EMIT_OP_MODRM64(0xff, 2, 2, CONTEXT_REG); \ EMIT(offs, u32); \ } while (0) @@ -955,11 +956,12 @@ enum { xAX = 0, xCX, xDX, xBX, xSP, xBP, xSI, xDI, // x86-64,i386 common #define emith_jump_reg(r) do { \ EMIT_REX_IF(0, 0, r); \ - EMIT_OP_MODRM(0xff, 3, 4, (r)&7); \ + EMIT_OP_MODRM64(0xff, 3, 4, r); \ } while (0) #define emith_jump_ctx(offs) do { \ - EMIT_OP_MODRM(0xff, 2, 4, CONTEXT_REG); \ + EMIT_REX_IF(0, 0, CONTEXT_REG); \ + EMIT_OP_MODRM64(0xff, 2, 4, CONTEXT_REG); \ EMIT(offs, u32); \ } while (0)