ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/uae_cpu/compiler/compemu_support.cpp
(Generate patch)

Comparing BasiliskII/src/uae_cpu/compiler/compemu_support.cpp (file contents):
Revision 1.34 by gbeauche, 2005-06-11T06:43:24Z vs.
Revision 1.35 by gbeauche, 2006-01-15T22:42:51Z

# Line 132 | Line 132 | static int untranslated_compfn(const voi
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];
# Line 5996 | Line 6000 | static __inline__ void create_popalls(vo
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
# Line 6005 | Line 6018 | static __inline__ void create_popalls(vo
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);
# Line 6013 | Line 6027 | static __inline__ void create_popalls(vo
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);
# Line 6021 | Line 6036 | static __inline__ void create_popalls(vo
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);
# Line 6029 | Line 6045 | static __inline__ void create_popalls(vo
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);
# Line 6037 | Line 6054 | static __inline__ void create_popalls(vo
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);
# Line 6045 | Line 6063 | static __inline__ void create_popalls(vo
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);
# Line 6071 | Line 6090 | static __inline__ void create_popalls(vo
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)&regs.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;
# Line 6099 | Line 6120 | static __inline__ void create_popalls(vo
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);
# Line 7103 | Line 7125 | void execute_normal(void)
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 (;;) {
# Line 7118 | Line 7138 | void m68k_do_compile_execute(void)
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 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines