diff options
| author | ptitSeb <seebastien.chev@gmail.com> | 2023-10-22 11:35:24 +0200 |
|---|---|---|
| committer | ptitSeb <seebastien.chev@gmail.com> | 2023-10-22 11:35:24 +0200 |
| commit | 59b51cccfc19ced50c19c7e6bf578cb3dd9fd3f5 (patch) | |
| tree | dfbfbe3f966d29198d9765c9d56c042e47f0cb33 /src | |
| parent | a83091bc3b9e84a9471aeadfef40b501b0399988 (diff) | |
| download | box64-59b51cccfc19ced50c19c7e6bf578cb3dd9fd3f5.tar.gz box64-59b51cccfc19ced50c19c7e6bf578cb3dd9fd3f5.zip | |
[ARM64] More unaligned improvments
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/x64runf0.c | 35 | ||||
| -rw-r--r-- | src/main.c | 4 |
2 files changed, 27 insertions, 12 deletions
diff --git a/src/emu/x64runf0.c b/src/emu/x64runf0.c index e0225f57..9e6426f4 100644 --- a/src/emu/x64runf0.c +++ b/src/emu/x64runf0.c @@ -330,16 +330,31 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr) } } while(tmp32s); else { - do { - tmp32u = native_lock_read_d(ED); - cmp32(emu, R_EAX, tmp32u); - if(ACCESS_FLAG(F_ZF)) { - tmp32s = native_lock_write_d(ED, GD->dword[0]); - } else { - R_EAX = tmp32u; - tmp32s = 0; - } - } while(tmp32s); + if(((uintptr_t)ED)&3) { + do { + tmp32u = ED->q[0] & ~0xffLL; + tmp32u |= native_lock_read_b(ED); + cmp64(emu, R_RAX, tmp32u); + if(ACCESS_FLAG(F_ZF)) { + tmp32s = native_lock_write_b(ED, GD->dword[0]&0xff); + if(!tmp32s) + ED->dword[0] = GD->dword[0]; + } else { + R_EAX = tmp32u; + tmp32s = 0; + } + } while(tmp32s); + } else + do { + tmp32u = native_lock_read_d(ED); + cmp32(emu, R_EAX, tmp32u); + if(ACCESS_FLAG(F_ZF)) { + tmp32s = native_lock_write_d(ED, GD->dword[0]); + } else { + R_EAX = tmp32u; + tmp32s = 0; + } + } while(tmp32s); emu->regs[_AX].dword[1] = 0; if(MODREG) ED->dword[1] = 0; diff --git a/src/main.c b/src/main.c index 346556aa..bc4a12e4 100644 --- a/src/main.c +++ b/src/main.c @@ -507,8 +507,8 @@ void LoadLogEnv() #ifdef DYNAREC #ifdef ARM64 // unaligned atomic (with restriction) is supported in hardware - if(arm64_uscat) - box64_dynarec_aligned_atomics = 1; + /*if(arm64_uscat) + box64_dynarec_aligned_atomics = 1;*/ // the unaligned support is not good enough for x86 emulation, so diabling #endif p = getenv("BOX64_DYNAREC_DUMP"); if(p) { |