diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-04-29 10:09:16 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-04-29 10:09:16 +0200 |
| commit | 464d868af5439ea9f6e6e0db2d97b62add8e219b (patch) | |
| tree | 48bf1816e874a783ce86da5a44d668ce216e5b62 /src | |
| parent | 34a6e81f72f8ec276bea8d440ec6d36239daa354 (diff) | |
| download | box64-464d868af5439ea9f6e6e0db2d97b62add8e219b.tar.gz box64-464d868af5439ea9f6e6e0db2d97b62add8e219b.zip | |
Small improvment on x87 interpreter
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/x64rundb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emu/x64rundb.c b/src/emu/x64rundb.c index c406e367..ad5952bb 100644 --- a/src/emu/x64rundb.c +++ b/src/emu/x64rundb.c @@ -140,7 +140,7 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 1: /* FISTTP Ed, ST0 */ GETE4(0); - if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, (double)(int32_t)0x80000000) || !isfinite(ST0.d)) + if(isgreater(ST0.d, (double)0x7fffffff) || isless(ST0.d, -(double)0x80000000U) || !isfinite(ST0.d)) ED->sdword[0] = 0x80000000; else ED->sdword[0] = ST0.d; @@ -148,7 +148,7 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 2: /* FIST Ed, ST0 */ GETE4(0); - if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, (double)(int32_t)0x80000000) || !isfinite(ST0.d)) + if(isgreater(ST0.d, (double)0x7fffffff) || isless(ST0.d, -(double)0x80000000U) || !isfinite(ST0.d)) ED->sdword[0] = 0x80000000; else { volatile int32_t tmp = fpu_round(emu, ST0.d); // tmp to avoid BUS ERROR @@ -157,7 +157,7 @@ uintptr_t RunDB(x64emu_t *emu, rex_t rex, uintptr_t addr) break; case 3: /* FISTP Ed, ST0 */ GETE4(0); - if(isgreater(ST0.d, (double)(int32_t)0x7fffffff) || isless(ST0.d, (double)(int32_t)0x80000000) || !isfinite(ST0.d)) + if(isgreater(ST0.d, (double)0x7fffffff) || isless(ST0.d, -(double)0x80000000U) || !isfinite(ST0.d)) ED->sdword[0] = 0x80000000; else { volatile int32_t tmp = fpu_round(emu, ST0.d); // tmp to avoid BUS ERROR |