From: Frode Solheim Date: Sun, 6 Sep 2015 20:05:15 +0000 (+0200) Subject: JIT: match_states (harmless changes) X-Git-Tag: 3200~79^2~25 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=65f86b1f7bae72ebf02fa18b91c6985a10b9eada;p=francis%2Fwinuae.git JIT: match_states (harmless changes) --- diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 6fce90e2..b6529bc2 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -2433,11 +2433,6 @@ void init_comp(void) raw_fp_init(); } -static inline void match_states(smallstate* s) -{ - flush(1); -} - /* Only do this if you really mean it! The next call should be to init!*/ void flush(int save_regs) { @@ -3239,6 +3234,49 @@ static void check_checksum(void) } } +static inline void match_states(blockinfo* bi) +{ +#ifdef UAE + flush(1); +#else + int i; + smallstate* s=&(bi->env); + + if (bi->status==BI_NEED_CHECK) { + block_check_checksum(bi); + } + if (bi->status==BI_ACTIVE || + bi->status==BI_FINALIZING) { /* Deal with the *promises* the + block makes (about not using + certain vregs) */ + for (i=0;i<16;i++) { + if (s->virt[i]==L_UNNEEDED) { + D2(panicbug("unneeded reg %d at %p",i,target)); + COMPCALL(forget_about)(i); // FIXME + } + } + } + flush(1); + + /* And now deal with the *demands* the block makes */ + for (i=0;inat[i]; + if (v>=0) { + // printf("Loading reg %d into %d at %p\n",v,i,target); + readreg_specific(v,4,i); + // do_load_reg(i,v); + // setlock(i); + } + } + for (i=0;inat[i]; + if (v>=0) { + unlock2(i); + } + } +#endif +} + static inline void create_popalls(void) { @@ -4068,7 +4106,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) /* predicted outcome */ tbi=get_blockinfo_addr_new((void*)t1,1); - match_states(&(tbi->env)); + match_states(tbi); raw_sub_l_mi((uae_u32)&countdown,scaled_cycles(totcycles)); raw_jcc_l_oponly(9); tba=(uae_u32*)get_target(); @@ -4082,7 +4120,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) write_jmp_target(branchadd, (cpuop_func *)get_target()); live=tmp; /* Ouch again */ tbi=get_blockinfo_addr_new((void*)t2,1); - match_states(&(tbi->env)); + match_states(tbi); //flush(1); /* Can only get here if was_comp==1 */ raw_sub_l_mi((uae_u32)&countdown,scaled_cycles(totcycles)); @@ -4115,7 +4153,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) blockinfo* tbi; tbi=get_blockinfo_addr_new((void*)v,1); - match_states(&(tbi->env)); + match_states(tbi); raw_sub_l_mi((uae_u32)&countdown,scaled_cycles(totcycles)); raw_jcc_l_oponly(9);