From: Toni Wilen Date: Sun, 6 Nov 2022 17:02:39 +0000 (+0200) Subject: Reduce unnecessary do_specialties() calls X-Git-Tag: 41000~81 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6297402e49ae4269f9e801514e2acc4db8c93a82;p=francis%2Fwinuae.git Reduce unnecessary do_specialties() calls --- diff --git a/newcpu.cpp b/newcpu.cpp index 60d1432a..0c537e17 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2397,7 +2397,7 @@ static void MakeFromSR_x(int t0trace) regs.ipl[0] = 0; } } else { - if (regs.ipl[0] <= regs.intmask && regs.ipl_pin > newimask) { + if (regs.ipl_pin <= regs.intmask && regs.ipl_pin > newimask) { set_special(SPCFLAG_INT); } } @@ -2882,7 +2882,9 @@ kludge_me_do: return; } #ifdef JIT - set_special (SPCFLAG_END_COMPILE); + if (currprefs.cachesize) { + set_special(SPCFLAG_END_COMPILE); + } #endif exception_check_trace(nr); } @@ -3192,7 +3194,9 @@ static void Exception_normal (int nr) } m68k_setpc (newpc); #ifdef JIT - set_special (SPCFLAG_END_COMPILE); + if (currprefs.cachesize) { + set_special(SPCFLAG_END_COMPILE); + } #endif exception_check_trace (nr); return; @@ -3346,7 +3350,9 @@ kludge_me_do: m68k_setpc (newpc); cache_default_data &= ~CACHE_DISABLE_ALLOCATE; #ifdef JIT - set_special (SPCFLAG_END_COMPILE); + if (currprefs.cachesize) { + set_special(SPCFLAG_END_COMPILE); + } #endif branch_stack_push(currpc, nextpc); regs.ipl_pin = intlev(); @@ -4526,10 +4532,12 @@ void doint(void) } return; } - if (currprefs.cpu_compatible && currprefs.cpu_model < 68020) - set_special (SPCFLAG_INT); - else - set_special (SPCFLAG_DOINT); + if (regs.ipl_pin > regs.intmask) { + if (currprefs.cpu_compatible && currprefs.cpu_model < 68020) + set_special(SPCFLAG_INT); + else + set_special(SPCFLAG_DOINT); + } } static void check_debugger(void) @@ -4622,7 +4630,9 @@ static int do_specialties (int cycles) do_copper(); #ifdef JIT - unset_special(SPCFLAG_END_COMPILE); /* has done its job */ + if (currprefs.cachesize) { + unset_special(SPCFLAG_END_COMPILE); + } #endif while ((regs.spcflags & SPCFLAG_BLTNASTY) && dmaen (DMA_BLITTER) && cycles > 0 && ((currprefs.waiting_blits && currprefs.cpu_model >= 68020) || !currprefs.blitter_cycle_exact)) { @@ -5042,7 +5052,9 @@ static int do_specialties_thread(void) return 1; #ifdef JIT - unset_special(SPCFLAG_END_COMPILE); /* has done its job */ + if (currprefs.cachesize) { + unset_special(SPCFLAG_END_COMPILE); + } #endif if (regs.spcflags & SPCFLAG_DOTRACE)