diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-04-30 15:22:01 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-04-30 15:22:01 +0200 |
| commit | ab70523b39eacac818efb8f8bacaf4d515eb98de (patch) | |
| tree | 81850dd7984fda485ac7f391d882b53cf7f824a3 /src | |
| parent | f0859e64620807e2eb0660aa7d73395ab7ce4ab5 (diff) | |
| download | box64-ab70523b39eacac818efb8f8bacaf4d515eb98de.tar.gz box64-ab70523b39eacac818efb8f8bacaf4d515eb98de.zip | |
[INTERP] Improve NAN handling on SQRTPS opcode
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/x64run660f.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c index a55a7328..7232c0c5 100644 --- a/src/emu/x64run660f.c +++ b/src/emu/x64run660f.c @@ -1287,8 +1287,10 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr) GETEX(0); GETGX; for (int i=0; i<2; ++i) { - if(EX->d[i]<0.0) // on x86, default nan are negative - GX->d[i] = -NAN; // but input NAN are not touched (so sqrt(+nan) -> +nan) + if(EX->d[i]<0.0) // on x86, default nan are negative + GX->d[i] = -NAN; // but input NAN are not touched (so sqrt(+nan) -> +nan) + else if(isnan(EX->d[i])) + GX->d[i] = EX->d[i]; else GX->d[i] = sqrt(EX->d[i]); } |