about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-04-01 10:45:53 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-04-01 10:45:53 +0200
commit5cd8176478bfba8b321a25e2ac849af7f2f93c82 (patch)
treebb2c08562ce5752c8da1c175e5c519417964e983 /src
parentea0ee7c7aa8bc6f6fa2abcc98936ac53b629e30c (diff)
downloadbox64-5cd8176478bfba8b321a25e2ac849af7f2f93c82.tar.gz
box64-5cd8176478bfba8b321a25e2ac849af7f2f93c82.zip
More coverage for test17, and added NaN handling to 66 0F 7C opcode
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run660f.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c
index ada264d0..c8613dda 100644
--- a/src/emu/x64run660f.c
+++ b/src/emu/x64run660f.c
@@ -1244,11 +1244,25 @@ int Run660F(x64emu_t *emu, rex_t rex)
         nextop = F8;

         GETEX(0);

         GETGX;

+        #ifndef NOALIGN

+        is_nan = isnan(GX->d[0]) || isnan(GX->d[1]);

+        #endif

         GX->d[0] += GX->d[1];

+        #ifndef NOALIGN

+        if(!is_nan && isnan(GX->d[0]))

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

+        #endif

         if(EX==GX) {

             GX->d[1] = GX->d[0];

         } else {

+            #ifndef NOALIGN

+            is_nan = isnan(EX->d[0]) || isnan(EX->d[1]);

+            #endif

             GX->d[1] = EX->d[0] + EX->d[1];

+            #ifndef NOALIGN

+            if(!is_nan && isnan(GX->d[1]))

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

+            #endif

         }

         break;