Fix JIT for 68020/68030 emulation mode.

This commit is contained in:
gbeauche 2007-06-15 08:09:01 +00:00
parent 3f535d30da
commit b05833a86b
2 changed files with 13 additions and 7 deletions

View File

@ -5122,9 +5122,9 @@ bool compiler_use_jit(void)
return false; return false;
} }
// FIXME: there are currently problems with JIT compilation and anything below a 68040 // Enable JIT for 68020+ emulation only
if (CPUType < 4) { if (CPUType < 2) {
write_log("<JIT compiler> : 68040 emulation is required instead of 680%d0. Disabling JIT.\n", CPUType); write_log("<JIT compiler> : JIT is not supported in 680%d0 emulation mode, disabling.\n", CPUType);
return false; return false;
} }

View File

@ -2251,6 +2251,11 @@ static void generate_one_opcode (int rp)
return; return;
if (opcode_next_clev[rp] != cpu_level) { if (opcode_next_clev[rp] != cpu_level) {
if (table68k[opcode].flagdead == 0)
/* force to the "ff" variant since the instruction doesn't set at all the condition codes */
fprintf (stblfile, "{ CPUFUNC_FF(op_%lx_%d), 0, %ld }, /* %s */\n", opcode, opcode_last_postfix[rp],
opcode, lookuptab[i].name);
else
fprintf (stblfile, "{ CPUFUNC(op_%lx_%d), 0, %ld }, /* %s */\n", opcode, opcode_last_postfix[rp], fprintf (stblfile, "{ CPUFUNC(op_%lx_%d), 0, %ld }, /* %s */\n", opcode, opcode_last_postfix[rp],
opcode, lookuptab[i].name); opcode, lookuptab[i].name);
return; return;
@ -2264,8 +2269,6 @@ static void generate_one_opcode (int rp)
fprintf (headerfile, "extern cpuop_func op_%lx_%d_nf;\n", opcode, postfix); fprintf (headerfile, "extern cpuop_func op_%lx_%d_nf;\n", opcode, postfix);
fprintf (headerfile, "extern cpuop_func op_%lx_%d_ff;\n", opcode, postfix); fprintf (headerfile, "extern cpuop_func op_%lx_%d_ff;\n", opcode, postfix);
printf ("void REGPARAM2 CPUFUNC(op_%lx_%d)(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, lookuptab[i].name);
printf ("\tcpuop_begin();\n");
/* gb-- The "nf" variant for an instruction that doesn't set the condition /* gb-- The "nf" variant for an instruction that doesn't set the condition
codes at all is the same as the "ff" variant, so we don't need the "nf" codes at all is the same as the "ff" variant, so we don't need the "nf"
@ -2274,6 +2277,9 @@ static void generate_one_opcode (int rp)
if (table68k[opcode].flagdead == 0) if (table68k[opcode].flagdead == 0)
printf ("#ifndef NOFLAGS\n"); printf ("#ifndef NOFLAGS\n");
printf ("void REGPARAM2 CPUFUNC(op_%lx_%d)(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, lookuptab[i].name);
printf ("\tcpuop_begin();\n");
switch (table68k[opcode].stype) { switch (table68k[opcode].stype) {
case 0: smsk = 7; break; case 0: smsk = 7; break;
case 1: smsk = 255; break; case 1: smsk = 255; break;
@ -2393,10 +2399,10 @@ static void generate_one_opcode (int rp)
gen_opcode (opcode); gen_opcode (opcode);
if (need_endlabel) if (need_endlabel)
printf ("%s: ;\n", endlabelstr); printf ("%s: ;\n", endlabelstr);
if (table68k[opcode].flagdead == 0)
printf ("\n#endif\n");
printf ("\tcpuop_end();\n"); printf ("\tcpuop_end();\n");
printf ("}\n"); printf ("}\n");
if (table68k[opcode].flagdead == 0)
printf ("\n#endif\n");
opcode_next_clev[rp] = next_cpu_level; opcode_next_clev[rp] = next_cpu_level;
opcode_last_postfix[rp] = postfix; opcode_last_postfix[rp] = postfix;
} }