]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
JIT FPU fix.
authorToni Wilen <twilen@winuae.net>
Tue, 13 Jun 2017 15:57:19 +0000 (18:57 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 13 Jun 2017 15:57:19 +0000 (18:57 +0300)
fpp.cpp
fpp_native.cpp

diff --git a/fpp.cpp b/fpp.cpp
index 8e8c12c103f79d86ac579952be3793249ada7b64..9b12106b8dc054eb7c818221de1cdd9355a3f430 100644 (file)
--- a/fpp.cpp
+++ b/fpp.cpp
@@ -609,6 +609,20 @@ static void fpsr_get_quotient(uae_u64 *quot, uae_u8 *sign)
 
 uae_u32 fpp_get_fpsr (void)
 {
+#ifdef JIT
+       if (currprefs.compfpu) {
+               regs.fpsr &= 0x00fffff8; // clear cc
+               if (fpp_is_nan (&regs.fp_result)) {
+                       regs.fpsr |= FPSR_CC_NAN;
+               } else if (fpp_is_zero(&regs.fp_result)) {
+                       regs.fpsr |= FPSR_CC_Z;
+               } else if (fpp_is_infinity (&regs.fp_result)) {
+                       regs.fpsr |= FPSR_CC_I;
+               }
+               if (fpp_is_neg(&regs.fp_result))
+                       regs.fpsr |= FPSR_CC_N;
+       }
+#endif
        return regs.fpsr;
 }
 
index 39f13f7a403a6ea70c8063d65fcbf2c453a657db..c393af0e588a34df4ff2caf76ac74b1f444c9a85 100644 (file)
@@ -164,7 +164,7 @@ static void native_set_fpucw(uae_u32 m68k_cw)
 /* Functions for setting host/library modes and getting status */
 static void fp_set_mode(uae_u32 mode_control)
 {
-       if (mode_control == fpu_mode_control)
+       if (mode_control == fpu_mode_control && !currprefs.compfpu)
                return;
     switch(mode_control & FPCR_ROUNDING_PRECISION) {
         case FPCR_PRECISION_EXTENDED: // X