From: Frode Solheim Date: Fri, 18 Sep 2015 21:36:41 +0000 (+0200) Subject: JIT: USE_JIT_FPU always on, use currprefs.compfpu properly at runtime X-Git-Tag: 3200~62^2~6 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=2efd70522b378a29b3b70a3349d8e9d01cb324e3;p=francis%2Fwinuae.git JIT: USE_JIT_FPU always on, use currprefs.compfpu properly at runtime --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 9ed00a7f..b7c86a1f 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -1401,7 +1401,9 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write_bool (f, _T("comp_constjump"), p->comp_constjump); cfgfile_write_bool (f, _T("comp_oldsegv"), p->comp_oldsegv); cfgfile_write_str (f, _T("comp_flushmode"), flushmode[p->comp_hardflush]); +#ifdef USE_JIT_FPU cfgfile_write_bool (f, _T("compfpu"), p->compfpu); +#endif cfgfile_write_bool (f, _T("comp_midopt"), p->comp_midopt); cfgfile_write_bool (f, _T("comp_lowopt"), p->comp_lowopt); cfgfile_write_bool (f, _T("avoid_cmov"), p->avoid_cmov); @@ -4277,7 +4279,9 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || cfgfile_yesno (option, value, _T("comp_constjump"), &p->comp_constjump) || cfgfile_yesno (option, value, _T("comp_oldsegv"), &p->comp_oldsegv) || cfgfile_yesno (option, value, _T("compforcesettings"), &dummybool) +#ifdef USE_JIT_FPU || cfgfile_yesno (option, value, _T("compfpu"), &p->compfpu) +#endif || cfgfile_yesno (option, value, _T("comp_midopt"), &p->comp_midopt) || cfgfile_yesno (option, value, _T("comp_lowopt"), &p->comp_lowopt) || cfgfile_yesno (option, value, _T("rtg_nocustom"), &p->picasso96_nocustom) @@ -6022,7 +6026,11 @@ void default_prefs (struct uae_prefs *p, int type) p->comp_hardflush = 0; p->comp_constjump = 1; p->comp_oldsegv = 0; +#ifdef USE_JIT_FPU p->compfpu = 1; +#else + p->compfpu = 0; +#endif p->cachesize = 0; p->avoid_cmov = 0; p->comp_midopt = 0; diff --git a/jit/compemu.h b/jit/compemu.h index d1f568a8..d42b6b6b 100644 --- a/jit/compemu.h +++ b/jit/compemu.h @@ -40,10 +40,8 @@ typedef uae_u64 uintptr; #else typedef uae_u32 uintptr; #endif +/* FIXME: cpummu.cpp also checks for USE_JIT, possibly others */ #define USE_JIT -#ifdef CPU_i386 -#define USE_JIT_FPU -#endif #endif #ifdef USE_JIT diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 6f547da9..3fdb2f8d 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -257,7 +257,15 @@ static uae_u32 cache_size = 0; // Size of total cache allocated for compiled #endif static uae_u32 current_cache_size = 0; // Cache grows upwards: how much has been consumed already static bool lazy_flush = true; // Flag: lazy translation cache invalidation -static bool avoid_fpu = true; // Flag: compile FPU instructions ? +#ifdef UAE +#ifdef USE_JIT_FPU +#define avoid_fpu (!currprefs.compfpu) +#else +#define avoid_fpu (true) +#endif +#else +static bool avoid_fpu = true; // Flag: compile FPU instructions ? +#endif static bool have_cmov = false; // target has CMOV instructions ? static bool have_lahf_lm = true; // target has LAHF supported in long mode ? static bool have_rat_stall = true; // target has partial register stalls ? @@ -3960,13 +3968,6 @@ void build_comp(void) prop[cft_map(tbl[i].opcode)].is_addx = isaddx; bool uses_fpu = (tbl[i].specific & COMP_OPCODE_USES_FPU) != 0; -#ifdef UAE -#ifdef USE_JIT_FPU - avoid_fpu = false; -#else - avoid_fpu = true; -#endif -#endif if (uses_fpu && avoid_fpu) compfunctbl[cft_map(tbl[i].opcode)] = NULL; else diff --git a/od-win32/sysconfig.h b/od-win32/sysconfig.h index 0d3999ec..fb78fe54 100644 --- a/od-win32/sysconfig.h +++ b/od-win32/sysconfig.h @@ -30,6 +30,7 @@ #define UAE_FILESYS_THREADS #define AUTOCONFIG /* autoconfig support, fast ram, harddrives etc.. */ #define JIT /* JIT compiler support */ +#define USE_JIT_FPU #define NATMEM_OFFSET natmem_offset #define USE_NORMAL_CALLING_CONVENTION 0 #define USE_X86_FPUCW 1