about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-06-03 15:20:46 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-06-03 15:21:33 +0200
commit1336ddfad70607906180391a74cf9e61ece43ced (patch)
tree43828c6db3e6985e55bcbbcafce9c844bd52fed8 /src
parentf3617f720b2ea67ece8dd5c44b566b3f0639636d (diff)
downloadbox64-1336ddfad70607906180391a74cf9e61ece43ced.tar.gz
box64-1336ddfad70607906180391a74cf9e61ece43ced.zip
Fixed special case with FSCALE ocpode ([DYNAREC] too)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dynarec/dynarec_arm64_functions.c3
-rw-r--r--src/emu/x64rund9.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/dynarec/dynarec_arm64_functions.c b/src/dynarec/dynarec_arm64_functions.c
index f9b051e3..0751ae71 100755
--- a/src/dynarec/dynarec_arm64_functions.c
+++ b/src/dynarec/dynarec_arm64_functions.c
@@ -86,7 +86,8 @@ void arm_frndint(x64emu_t* emu)
 }
 void arm_fscale(x64emu_t* emu)
 {
-    ST0.d *= exp2(trunc(ST1.d));
+    if(ST0.d!=0.0)
+        ST0.d *= exp2(trunc(ST1.d));
 }
 void arm_fsin(x64emu_t* emu)
 {
diff --git a/src/emu/x64rund9.c b/src/emu/x64rund9.c
index b7f2df5f..1a892b25 100644
--- a/src/emu/x64rund9.c
+++ b/src/emu/x64rund9.c
@@ -191,7 +191,8 @@ int RunD9(x64emu_t *emu, rex_t rex)
             break;

         case 0xFD:  /* FSCALE */

             // this could probably be done by just altering the exponant part of the float...

-            ST0.d *= exp2(trunc(ST1.d));

+            if(ST0.d!=0.0)

+                ST0.d *= exp2(trunc(ST1.d));

             break;

         case 0xFE:  /* FSIN */

             ST0.d = sin(ST0.d);