about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
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 */