From 47b8e2a98330c7381f973007436ba7faa8de27ec Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 17 Feb 2024 15:14:26 +0100 Subject: [INTERPRETER] Added a few unaligned path for some F0 math opcodes --- src/emu/x64runf0.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/emu/x64runf0.c b/src/emu/x64runf0.c index 77691a67..20552e2e 100644 --- a/src/emu/x64runf0.c +++ b/src/emu/x64runf0.c @@ -75,6 +75,25 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; \ GETED(0); \ GETGD; \ + if(((uintptr_t)ED)&(3<q[0]; \ + tmp64u = OP##64(emu, tmp64u, GD->q[0]); \ + } while (native_lock_write_b(ED, tmp8u)); \ + ED->q[0] = tmp64u; \ + } else { \ + do { \ + tmp8u = native_lock_read_b(ED); \ + tmp32u = ED->dword[0]; \ + tmp32u = OP##32(emu, tmp32u, GD->dword[0]); \ + } while (native_lock_write_b(ED, tmp8u)); \ + ED->dword[0] = tmp32u; \ + if(MODREG) \ + ED->dword[1] = 0; \ + } \ + } else { \ if(rex.w) { \ do { \ tmp64u = native_lock_read_dd(ED); \ @@ -88,6 +107,7 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) if(MODREG) \ ED->dword[1] = 0; \ } \ + } \ break; \ case B+2: \ nextop = F8; \ @@ -119,15 +139,15 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) nextop = F8; \ GETEB(0); \ GETGB; \ - pthread_mutex_lock(&my_context->mutex_lock); \ + pthread_mutex_lock(&my_context->mutex_lock); \ EB->byte[0] = OP##8(emu, EB->byte[0], GB); \ - pthread_mutex_unlock(&my_context->mutex_lock); \ + pthread_mutex_unlock(&my_context->mutex_lock); \ break; \ case B+1: \ nextop = F8; \ GETED(0); \ GETGD; \ - pthread_mutex_lock(&my_context->mutex_lock); \ + pthread_mutex_lock(&my_context->mutex_lock); \ if(rex.w) \ ED->q[0] = OP##64(emu, ED->q[0], GD->q[0]); \ else \ -- cgit 1.4.1