about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-04-13 22:55:06 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-04-13 22:55:16 +0200
commit34f7571269581bd9393f30eeaab3f46d59cb30dd (patch)
tree6608fe956e85347269dc3f902994b16e73c5b4a1 /src/emu
parentdc9144f8f4b15f74c987e0fb0970a501001a03d0 (diff)
downloadbox64-34f7571269581bd9393f30eeaab3f46d59cb30dd.tar.gz
box64-34f7571269581bd9393f30eeaab3f46d59cb30dd.zip
[DYNAREC] Added option to force x87 to use double (ported from box86)
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/x64runf20f.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/emu/x64runf20f.c b/src/emu/x64runf20f.c
index c441ee27..3ecf43ef 100644
--- a/src/emu/x64runf20f.c
+++ b/src/emu/x64runf20f.c
@@ -32,6 +32,9 @@ int RunF20F(x64emu_t *emu, rex_t rex)
     reg64_t *oped, *opgd;

     sse_regs_t *opex, *opgx, eax1;

     mmx87_regs_t *opgm;

+    #ifndef NOALIGN

+    int is_nan;

+    #endif

 

     opcode = F8;

 

@@ -172,7 +175,14 @@ int RunF20F(x64emu_t *emu, rex_t rex)
         nextop = F8;

         GETEX(0);

         GETGX;

+        #ifndef NOALIGN

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

+        #endif

         GX->d[0] /= EX->d[0];

+        #ifndef NOALIGN

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

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

+        #endif

         break;

     case 0x5F:  /* MAXSD Gx, Ex */

         nextop = F8;