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