diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-07-21 13:34:06 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-07-21 13:34:06 +0200 |
| commit | 607bb28677cf546d98c8862695599af5cc5ca071 (patch) | |
| tree | 2b2a2b8e2445cc15bc7c4d18cf1eed04168d9934 /src | |
| parent | 36e5fb50ecfe4a152782c42cf49ce9d14ffc46ea (diff) | |
| download | box64-607bb28677cf546d98c8862695599af5cc5ca071.tar.gz box64-607bb28677cf546d98c8862695599af5cc5ca071.zip | |
Fixed status of C2 x87 flags after sin, cos, sincos and tan function ([DYNAREC] too) (thank @icecream95 for the debugging on box86)
Diffstat (limited to 'src')
| -rwxr-xr-x | src/dynarec/dynarec_arm64_functions.c | 4 | ||||
| -rw-r--r-- | src/emu/x64rund9.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/dynarec/dynarec_arm64_functions.c b/src/dynarec/dynarec_arm64_functions.c index 5a0e1796..12947c94 100755 --- a/src/dynarec/dynarec_arm64_functions.c +++ b/src/dynarec/dynarec_arm64_functions.c @@ -52,6 +52,7 @@ void arm_fyl2x(x64emu_t* emu) void arm_ftan(x64emu_t* emu) { ST0.d = tan(ST0.d); + emu->sw.f.F87_C2 = 0; } void arm_fpatan(x64emu_t* emu) { @@ -80,6 +81,7 @@ void arm_fyl2xp1(x64emu_t* emu) void arm_fsincos(x64emu_t* emu) { sincos(ST1.d, &ST1.d, &ST0.d); + emu->sw.f.F87_C2 = 0; } void arm_frndint(x64emu_t* emu) { @@ -93,10 +95,12 @@ void arm_fscale(x64emu_t* emu) void arm_fsin(x64emu_t* emu) { ST0.d = sin(ST0.d); + emu->sw.f.F87_C2 = 0; } void arm_fcos(x64emu_t* emu) { ST0.d = cos(ST0.d); + emu->sw.f.F87_C2 = 0; } void arm_fbld(x64emu_t* emu, uint8_t* ed) diff --git a/src/emu/x64rund9.c b/src/emu/x64rund9.c index 1a892b25..ee255400 100644 --- a/src/emu/x64rund9.c +++ b/src/emu/x64rund9.c @@ -185,6 +185,7 @@ int RunD9(x64emu_t *emu, rex_t rex) case 0xFB: /* FSINCOS */ fpu_do_push(emu); sincos(ST1.d, &ST1.d, &ST0.d); + emu->sw.f.F87_C2 = 0; break; case 0xFC: /* FRNDINT */ ST0.d = fpu_round(emu, ST0.d); @@ -196,9 +197,11 @@ int RunD9(x64emu_t *emu, rex_t rex) break; case 0xFE: /* FSIN */ ST0.d = sin(ST0.d); + emu->sw.f.F87_C2 = 0; break; case 0xFF: /* FCOS */ ST0.d = cos(ST0.d); + emu->sw.f.F87_C2 = 0; break; |