From 1336ddfad70607906180391a74cf9e61ece43ced Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 3 Jun 2021 15:20:46 +0200 Subject: Fixed special case with FSCALE ocpode ([DYNAREC] too) --- src/dynarec/dynarec_arm64_functions.c | 3 ++- src/emu/x64rund9.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit 1.4.1