74 |
|
cpuop_func *nfcpufunctbl[65536]; |
75 |
|
uae_u8* comp_pc_p; |
76 |
|
|
77 |
+ |
// From newcpu.cpp |
78 |
+ |
extern bool quit_program; |
79 |
+ |
|
80 |
|
// gb-- Extra data for Basilisk II/JIT |
81 |
|
#if JIT_DEBUG |
82 |
|
static bool JITDebug = false; // Enable runtime disassemblers through mon? |
5464 |
|
popall_recompile_block=(void *)recompile_block; |
5465 |
|
popall_do_nothing=(void *)do_nothing; |
5466 |
|
popall_check_checksum=(void *)check_checksum; |
5464 |
– |
pushall_call_handler=get_target(); |
5467 |
|
#endif |
5468 |
|
|
5469 |
|
/* And now, the code to do the matching pushes and then jump |
5479 |
|
raw_mov_l_rm(r,(uae_u32)®s.pc_p); |
5480 |
|
raw_and_l_ri(r,TAGMASK); |
5481 |
|
raw_jmp_m_indexed((uae_u32)cache_tags,r,4); |
5482 |
+ |
|
5483 |
+ |
#ifdef X86_ASSEMBLY |
5484 |
+ |
align_target(align_jumps); |
5485 |
+ |
m68k_compile_execute = (void (*)(void))get_target(); |
5486 |
+ |
for (i=N_REGS;i--;) { |
5487 |
+ |
if (need_to_preserve[i]) |
5488 |
+ |
raw_push_l_r(i); |
5489 |
+ |
} |
5490 |
+ |
align_target(align_loops); |
5491 |
+ |
uae_u32 dispatch_loop = (uae_u32)get_target(); |
5492 |
+ |
r=REG_PC_TMP; |
5493 |
+ |
raw_mov_l_rm(r,(uae_u32)®s.pc_p); |
5494 |
+ |
raw_and_l_ri(r,TAGMASK); |
5495 |
+ |
raw_call_m_indexed((uae_u32)cache_tags,r,4); |
5496 |
+ |
raw_cmp_l_mi((uae_u32)®s.spcflags,0); |
5497 |
+ |
raw_jcc_b_oponly(NATIVE_CC_EQ); |
5498 |
+ |
emit_byte(dispatch_loop-((uae_u32)get_target()+1)); |
5499 |
+ |
raw_call((uae_u32)m68k_do_specialties); |
5500 |
+ |
raw_test_l_rr(REG_RESULT,REG_RESULT); |
5501 |
+ |
raw_jcc_b_oponly(NATIVE_CC_EQ); |
5502 |
+ |
emit_byte(dispatch_loop-((uae_u32)get_target()+1)); |
5503 |
+ |
raw_cmp_b_mi((uae_u32)&quit_program,0); |
5504 |
+ |
raw_jcc_b_oponly(NATIVE_CC_EQ); |
5505 |
+ |
emit_byte(dispatch_loop-((uae_u32)get_target()+1)); |
5506 |
+ |
for (i=0;i<N_REGS;i++) { |
5507 |
+ |
if (need_to_preserve[i]) |
5508 |
+ |
raw_pop_l_r(i); |
5509 |
+ |
} |
5510 |
+ |
raw_ret(); |
5511 |
+ |
#endif |
5512 |
|
} |
5513 |
|
|
5514 |
|
static __inline__ void reset_lists(void) |
6271 |
|
{ |
6272 |
|
for (;;) { |
6273 |
|
uae_u32 opcode = GET_OPCODE; |
6242 |
– |
#ifdef X86_ASSEMBLY__disable |
6243 |
– |
__asm__ __volatile__("\tpushl %%ebp\n\tcall *%%ebx\n\tpopl %%ebp" /* FIXME */ |
6244 |
– |
: : "b" (cpufunctbl[opcode]), "a" (opcode) |
6245 |
– |
: "%edx", "%ecx", "%esi", "%edi", "%ebp", "memory", "cc"); |
6246 |
– |
#else |
6274 |
|
(*cpufunctbl[opcode])(opcode); |
6248 |
– |
#endif |
6275 |
|
if (end_block(opcode) || SPCFLAGS_TEST(SPCFLAG_ALL)) { |
6276 |
|
return; /* We will deal with the spcflags in the caller */ |
6277 |
|
} |
6296 |
|
#if FLIGHT_RECORDER |
6297 |
|
m68k_record_step(m68k_getpc()); |
6298 |
|
#endif |
6273 |
– |
#ifdef X86_ASSEMBLY__disable |
6274 |
– |
__asm__ __volatile__("\tpushl %%ebp\n\tcall *%%ebx\n\tpopl %%ebp" /* FIXME */ |
6275 |
– |
: : "b" (cpufunctbl[opcode]), "a" (opcode) |
6276 |
– |
: "%edx", "%ecx", "%esi", "%edi", "%ebp", "memory", "cc"); |
6277 |
– |
#else |
6299 |
|
(*cpufunctbl[opcode])(opcode); |
6279 |
– |
#endif |
6300 |
|
if (end_block(opcode) || SPCFLAGS_TEST(SPCFLAG_ALL) || blocklen>=MAXRUN) { |
6301 |
|
compile_block(pc_hist, blocklen); |
6302 |
|
return; /* We will deal with the spcflags in the caller */ |
6309 |
|
|
6310 |
|
typedef void (*compiled_handler)(void); |
6311 |
|
|
6312 |
+ |
#ifdef X86_ASSEMBLY |
6313 |
+ |
void (*m68k_compile_execute)(void) = NULL; |
6314 |
+ |
#else |
6315 |
|
void m68k_do_compile_execute(void) |
6316 |
|
{ |
6317 |
|
for (;;) { |
6295 |
– |
#ifdef X86_ASSEMBLY |
6296 |
– |
__asm__ __volatile__("\tpushl %%ebp\n\tcall *%%ebx\n\tpopl %%ebp" /* FIXME */ |
6297 |
– |
: : "b" (cache_tags[cacheline(regs.pc_p)].handler) |
6298 |
– |
: "%edx", "%ecx", "%eax", "%esi", "%edi", "%ebp", "memory", "cc"); |
6299 |
– |
#else |
6318 |
|
((compiled_handler)(pushall_call_handler))(); |
6301 |
– |
#endif |
6319 |
|
/* Whenever we return from that, we should check spcflags */ |
6320 |
|
if (SPCFLAGS_TEST(SPCFLAG_ALL)) { |
6321 |
|
if (m68k_do_specialties ()) |
6323 |
|
} |
6324 |
|
} |
6325 |
|
} |
6326 |
+ |
#endif |