From: Toni Wilen Date: Sun, 21 Feb 2016 12:00:58 +0000 (+0200) Subject: Force float precision. C-library functions are not guaranteed to do it. X-Git-Tag: 3300~72 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=16bd593a20367c5d01c33906bad127730e8bd41d;p=francis%2Fwinuae.git Force float precision. C-library functions are not guaranteed to do it. --- diff --git a/fpp.cpp b/fpp.cpp index 5ed4e9d7..1ef695c5 100644 --- a/fpp.cpp +++ b/fpp.cpp @@ -545,7 +545,7 @@ static inline void set_fpucw_softfloat(uae_u32 m68k_cw) * SSE2 registers. */ static uae_u16 x87_cw = 0; -static char *x87_fldcw_code = NULL; +static uae_u8 *x87_fldcw_code = NULL; typedef void (uae_cdecl *x87_fldcw_function)(void); static void init_fpucw_x87(void) @@ -553,9 +553,9 @@ static void init_fpucw_x87(void) if (x87_fldcw_code) { return; } - x87_fldcw_code = (char *) uae_vm_alloc( + x87_fldcw_code = (uae_u8 *) uae_vm_alloc( uae_vm_page_size(), UAE_VM_32BIT, UAE_VM_READ_WRITE_EXECUTE); - char *c = x87_fldcw_code; + uae_u8 *c = x87_fldcw_code; /* mov eax,0x0 */ *(c++) = 0xb8; *(c++) = 0x00; @@ -2692,7 +2692,7 @@ static bool arithmetic_fp(fptype src, int reg, int extra) return false; } // round to float? - if (sgl || (extra & 0x44) == 0x40) + if (sgl || (extra & 0x44) == 0x40 || ((regs.fpcr >> 6) & 3) == 1) fround (reg); MAKE_FPSR (®s.fp[reg].fp); return true;