From: Toni Wilen Date: Sat, 18 Dec 2021 17:45:33 +0000 (+0200) Subject: JIT indirect/safe mode MOVEM.W bug fix. X-Git-Tag: 4910~47 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=33e2150233c11cb8d41711800c67a72fdb8a33ea;p=francis%2Fwinuae.git JIT indirect/safe mode MOVEM.W bug fix. --- diff --git a/include/memory.h b/include/memory.h index 2b16f907..c7520a25 100644 --- a/include/memory.h +++ b/include/memory.h @@ -15,6 +15,7 @@ extern void a1000_reset(void); #ifdef JIT extern int special_mem; +extern int special_mem_default; extern int jit_n_addr_unsafe; #endif diff --git a/jit/compemu.h b/jit/compemu.h index 70f76dcd..93fd4e87 100644 --- a/jit/compemu.h +++ b/jit/compemu.h @@ -524,9 +524,6 @@ extern void compile_block(cpu_history* pc_hist, int blocklen, int totcyles); #define MAXCYCLES (1000 * CYCLE_UNIT) #define scaled_cycles(x) (currprefs.m68k_speed<0?(((x)/SCALE)?(((x)/SCALE>i)&1) {\n"); switch (table68k[opcode].size) { case sz_long: @@ -981,7 +985,7 @@ genmovemle(uae_u16 opcode) default: assert(0); } } else { /* Pre-decrement */ - comprintf("\tfor (i=0;i<16;i++) {\n" + comprintf("\tfor (i=0;i<16 && mask;i++) {\n" "\t\tif ((mask>>i)&1) {\n"); switch (table68k[opcode].size) { case sz_long: @@ -1002,7 +1006,6 @@ genmovemle(uae_u16 opcode) } } - comprintf("\t\t}\n"); comprintf("\t}\n"); if (table68k[opcode].dmode == Apdi) { @@ -1013,7 +1016,7 @@ genmovemle(uae_u16 opcode) if (table68k[opcode].dmode != Apdi) { comprintf("\tmov_l_rr(tmp,srca);\n"); - comprintf("\tfor (i=0;i<16;i++) {\n" + comprintf("\tfor (i=0;i<16 && mask;i++) {\n" "\t\tif ((mask>>i)&1) {\n"); switch (table68k[opcode].size) { case sz_long: @@ -1027,7 +1030,7 @@ genmovemle(uae_u16 opcode) default: assert(0); } } else { /* Pre-decrement */ - comprintf("\tfor (i=0;i<16;i++) {\n" + comprintf("\tfor (i=0;i<16 && mask;i++) {\n" "\t\tif ((mask>>i)&1) {\n"); switch (table68k[opcode].size) { case sz_long: @@ -1042,7 +1045,6 @@ genmovemle(uae_u16 opcode) } } - comprintf("\t\t}\n"); comprintf("\t}\n"); if (table68k[opcode].dmode == Apdi) { @@ -1841,7 +1843,7 @@ gen_opcode(unsigned int opcode) break; case i_MVMEL: -#ifdef DISABLE_I_MVEL +#ifdef DISABLE_I_MVMEL failure; #endif genmovemel(opcode); diff --git a/memory.cpp b/memory.cpp index 686347fe..fa8ac212 100644 --- a/memory.cpp +++ b/memory.cpp @@ -47,7 +47,7 @@ bool canbang; static bool rom_write_enabled; #ifdef JIT /* Set by each memory handler that does not simply access real memory. */ -int special_mem; +int special_mem, special_mem_default; /* do not use get_n_addr */ int jit_n_addr_unsafe; #endif diff --git a/newcpu.cpp b/newcpu.cpp index 4c286c69..f7d50ed2 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -5269,7 +5269,7 @@ void execute_normal(void) /* Take note: This is the do-it-normal loop */ r->opcode = get_jit_opcode(); - special_mem = DISTRUST_CONSISTENT_MEM; + special_mem = special_mem_default; pc_hist[blocklen].location = (uae_u16*)r->pc_p; (*cpufunctbl[r->opcode])(r->opcode);