about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-03-31 09:11:54 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-03-31 09:11:54 +0200
commit3623cb9785a1c7b593ebc65c42c23a4db981ada4 (patch)
tree1f2a376d8eb416f2e0a9577ffc126241dad8e592 /src
parent3f641c2b67ae210caa6ebe7a6e4253038dada6a5 (diff)
downloadbox64-3623cb9785a1c7b593ebc65c42c23a4db981ada4.tar.gz
box64-3623cb9785a1c7b593ebc65c42c23a4db981ada4.zip
Improved test17 (sse), and fixed NAN bordercase for PSQRTPD opcode
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run660f.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c
index 148c99eb..09354192 100644
--- a/src/emu/x64run660f.c
+++ b/src/emu/x64run660f.c
@@ -794,8 +794,14 @@ int Run660F(x64emu_t *emu, rex_t rex)
         nextop = F8;

         GETEX(0);

         GETGX;

-        GX->d[0] = sqrt(EX->d[0]);

-        GX->d[1] = sqrt(EX->d[1]);

+        for (int i=0; i<2; ++i) {

+            #ifndef NOALIGN

+            if(EX->d[i]<0.0) // on x86, default nan are negative

+                GX->d[i] = -NAN;

+            else

+            #endif

+            GX->d[i] = sqrt(EX->d[i]);

+        }

         break;

 

     case 0x54:                      /* ANDPD Gx, Ex */