132 |
|
} |
133 |
|
#endif |
134 |
|
|
135 |
+ |
#if ! USE_PUSH_POP |
136 |
+ |
static void (*m68k_do_compile_execute)(void) = NULL; |
137 |
+ |
#endif |
138 |
+ |
|
139 |
|
static compop_func *compfunctbl[65536]; |
140 |
|
static compop_func *nfcompfunctbl[65536]; |
141 |
|
static cpuop_func *nfcpufunctbl[65536]; |
6000 |
|
} |
6001 |
|
vm_protect(popallspace, POPALLSPACE_SIZE, VM_PAGE_READ | VM_PAGE_WRITE); |
6002 |
|
|
6003 |
+ |
int stack_space = STACK_OFFSET; |
6004 |
+ |
for (i=0;i<N_REGS;i++) { |
6005 |
+ |
if (need_to_preserve[i]) |
6006 |
+ |
stack_space += sizeof(void *); |
6007 |
+ |
} |
6008 |
+ |
stack_space %= STACK_ALIGN; |
6009 |
+ |
if (stack_space) |
6010 |
+ |
stack_space = STACK_ALIGN - stack_space; |
6011 |
+ |
|
6012 |
|
current_compile_p=popallspace; |
6013 |
|
set_target(current_compile_p); |
6014 |
|
#if USE_PUSH_POP |
6018 |
|
*/ |
6019 |
|
align_target(align_jumps); |
6020 |
|
popall_do_nothing=get_target(); |
6021 |
+ |
raw_inc_sp(stack_space); |
6022 |
|
for (i=0;i<N_REGS;i++) { |
6023 |
|
if (need_to_preserve[i]) |
6024 |
|
raw_pop_l_r(i); |
6027 |
|
|
6028 |
|
align_target(align_jumps); |
6029 |
|
popall_execute_normal=get_target(); |
6030 |
+ |
raw_inc_sp(stack_space); |
6031 |
|
for (i=0;i<N_REGS;i++) { |
6032 |
|
if (need_to_preserve[i]) |
6033 |
|
raw_pop_l_r(i); |
6036 |
|
|
6037 |
|
align_target(align_jumps); |
6038 |
|
popall_cache_miss=get_target(); |
6039 |
+ |
raw_inc_sp(stack_space); |
6040 |
|
for (i=0;i<N_REGS;i++) { |
6041 |
|
if (need_to_preserve[i]) |
6042 |
|
raw_pop_l_r(i); |
6045 |
|
|
6046 |
|
align_target(align_jumps); |
6047 |
|
popall_recompile_block=get_target(); |
6048 |
+ |
raw_inc_sp(stack_space); |
6049 |
|
for (i=0;i<N_REGS;i++) { |
6050 |
|
if (need_to_preserve[i]) |
6051 |
|
raw_pop_l_r(i); |
6054 |
|
|
6055 |
|
align_target(align_jumps); |
6056 |
|
popall_exec_nostats=get_target(); |
6057 |
+ |
raw_inc_sp(stack_space); |
6058 |
|
for (i=0;i<N_REGS;i++) { |
6059 |
|
if (need_to_preserve[i]) |
6060 |
|
raw_pop_l_r(i); |
6063 |
|
|
6064 |
|
align_target(align_jumps); |
6065 |
|
popall_check_checksum=get_target(); |
6066 |
+ |
raw_inc_sp(stack_space); |
6067 |
|
for (i=0;i<N_REGS;i++) { |
6068 |
|
if (need_to_preserve[i]) |
6069 |
|
raw_pop_l_r(i); |
6090 |
|
raw_push_l_r(i); |
6091 |
|
} |
6092 |
|
#endif |
6093 |
+ |
raw_dec_sp(stack_space); |
6094 |
|
r=REG_PC_TMP; |
6095 |
|
raw_mov_l_rm(r,(uintptr)®s.pc_p); |
6096 |
|
raw_and_l_ri(r,TAGMASK); |
6097 |
|
raw_jmp_m_indexed((uintptr)cache_tags,r,SIZEOF_VOID_P); |
6098 |
|
|
6099 |
< |
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY) |
6099 |
> |
#if ! USE_PUSH_POP |
6100 |
|
align_target(align_jumps); |
6101 |
< |
m68k_compile_execute = (void (*)(void))get_target(); |
6101 |
> |
m68k_do_compile_execute = (void (*)(void))get_target(); |
6102 |
|
for (i=N_REGS;i--;) { |
6103 |
|
if (need_to_preserve[i]) |
6104 |
|
raw_push_l_r(i); |
6105 |
|
} |
6106 |
+ |
raw_dec_sp(stack_space); |
6107 |
|
align_target(align_loops); |
6108 |
|
uae_u32 dispatch_loop = (uintptr)get_target(); |
6109 |
|
r=REG_PC_TMP; |
6120 |
|
raw_cmp_b_mi((uintptr)&quit_program,0); |
6121 |
|
raw_jcc_b_oponly(NATIVE_CC_EQ); |
6122 |
|
emit_byte(dispatch_loop-((uintptr)get_target()+1)); |
6123 |
+ |
raw_inc_sp(stack_space); |
6124 |
|
for (i=0;i<N_REGS;i++) { |
6125 |
|
if (need_to_preserve[i]) |
6126 |
|
raw_pop_l_r(i); |
7125 |
|
|
7126 |
|
typedef void (*compiled_handler)(void); |
7127 |
|
|
7128 |
< |
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY) |
7107 |
< |
void (*m68k_compile_execute)(void) = NULL; |
7108 |
< |
#else |
7128 |
> |
#if USE_PUSH_POP |
7129 |
|
void m68k_do_compile_execute(void) |
7130 |
|
{ |
7131 |
|
for (;;) { |
7138 |
|
} |
7139 |
|
} |
7140 |
|
#endif |
7141 |
+ |
|
7142 |
+ |
void m68k_compile_execute (void) |
7143 |
+ |
{ |
7144 |
+ |
for (;;) { |
7145 |
+ |
if (quit_program) |
7146 |
+ |
break; |
7147 |
+ |
m68k_do_compile_execute(); |
7148 |
+ |
} |
7149 |
+ |
} |