diff options
Diffstat (limited to 'src/dynarec/dynarec_native.c')
| -rw-r--r-- | src/dynarec/dynarec_native.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c index c92f251f..17ad5a02 100644 --- a/src/dynarec/dynarec_native.c +++ b/src/dynarec/dynarec_native.c @@ -444,87 +444,6 @@ static int updateNeed(dynarec_native_t* dyn, int ninst, uint8_t need) { return ninst; } -static void updateYmm0s(dynarec_native_t* dyn, int ninst, int max_ninst_reached) { - int can_incr = ninst == max_ninst_reached; // Are we the top-level call? - int ok = 1; - while ((can_incr || ok) && ninst<dyn->size) { - //if(dyn->need_dump) dynarec_log(LOG_NONE, "update ninst=%d (%d): can_incr=%d\n", ninst, max_ninst_reached, can_incr); - uint16_t new_purge_ymm, new_ymm0_in, new_ymm0_out; - - if (dyn->insts[ninst].pred_sz && dyn->insts[ninst].x64.alive) { - // The union of the empty set is empty (0), the intersection is the universe (-1) - // The first instruction is the entry point, which has a virtual pred with ymm0_out = 0 - // Similarly, float barriers reset ymm0s - uint16_t ymm0_union = 0; - uint16_t ymm0_inter = (ninst && !(dyn->insts[ninst].x64.barrier & BARRIER_FLOAT)) ? ((uint16_t)-1) : (uint16_t)0; - for (int i = 0; i < dyn->insts[ninst].pred_sz; ++i) { - int pred = dyn->insts[ninst].pred[i]; - //if(dyn->need_dump) dynarec_log(LOG_NONE, "\twith pred[%d] = %d", i, pred); - if (pred >= max_ninst_reached) { - //if(dyn->need_dump) dynarec_log(LOG_NONE, " (skipped)\n"); - continue; - } - - int pred_out = dyn->insts[pred].x64.has_callret ? 0 : dyn->insts[pred].ymm0_out; - //if(dyn->need_dump) dynarec_log(LOG_NONE, " ~> %04X\n", pred_out); - ymm0_union |= pred_out; - ymm0_inter &= pred_out; - } - //if(dyn->need_dump) dynarec_log(LOG_NONE, "\t=> %04X,%04X\n", ymm0_union, ymm0_inter); - // Notice the default values yield something coherent here (if all pred are after ninst) - new_purge_ymm = ymm0_union & ~ymm0_inter; - new_ymm0_in = ymm0_inter; - new_ymm0_out = (ymm0_inter | dyn->insts[ninst].ymm0_add) & ~dyn->insts[ninst].ymm0_sub; - - if ((dyn->insts[ninst].purge_ymm != new_purge_ymm) || (dyn->insts[ninst].ymm0_in != new_ymm0_in) || (dyn->insts[ninst].ymm0_out != new_ymm0_out)) { - // Need to update self and next(s) - dyn->insts[ninst].purge_ymm = new_purge_ymm; - dyn->insts[ninst].ymm0_in = new_ymm0_in; - dyn->insts[ninst].ymm0_out = new_ymm0_out; - - if (can_incr) { - // We always have ninst == max_ninst_reached when can_incr == 1 - ++max_ninst_reached; - } else { - // We need to stop here if the opcode has no "real" next or if we reached the ninst of the toplevel - ok = (max_ninst_reached - 1 != ninst) && dyn->insts[ninst].x64.has_next && !dyn->insts[ninst].x64.has_callret; - } - - int jmp = (dyn->insts[ninst].x64.jmp)?dyn->insts[ninst].x64.jmp_insts:-1; - if((jmp!=-1) && (jmp < max_ninst_reached)) { - //if(dyn->need_dump) dynarec_log(LOG_NONE, "\t! jump to %d\n", jmp); - // The jump goes before the last instruction reached, update the destination - // If this is the top level call, this means the jump goes backward (jmp != ninst) - // Otherwise, since we don't update all instructions, we may miss the update (don't use jmp < ninst) - updateYmm0s(dyn, jmp, max_ninst_reached); - } - } else { - if (can_incr) { - // We always have ninst == max_ninst_reached when can_incr == 1 - ++max_ninst_reached; - - // Also update jumps to before (they are skipped otherwise) - int jmp = (dyn->insts[ninst].x64.jmp)?dyn->insts[ninst].x64.jmp_insts:-1; - if((jmp!=-1) && (jmp < max_ninst_reached)) { - //if(dyn->need_dump) dynarec_log(LOG_NONE, "\t! jump to %d\n", jmp); - updateYmm0s(dyn, jmp, max_ninst_reached); - } - } else { - // We didn't update anything, we can leave - ok = 0; - } - } - } else if (can_incr) { - // We always have ninst == max_ninst_reached when can_incr == 1 - ++max_ninst_reached; - } else { - // We didn't update anything, we can leave - ok = 0; - } - ++ninst; - } -} - void* current_helper = NULL; static int static_jmps[MAX_INSTS+2]; static uintptr_t static_next[MAX_INSTS+2]; @@ -779,7 +698,6 @@ dynablock_t* FillBlock64(uintptr_t addr, int alternate, int is32bits, int inst_m int ii = i; while(ii<helper.size && !helper.insts[ii].pred_sz) { fpu_reset_ninst(&helper, ii); - helper.insts[ii].ymm0_in = helper.insts[ii].ymm0_sub = helper.insts[ii].ymm0_add = helper.insts[ii].ymm0_out = helper.insts[ii].purge_ymm = 0; RAZ_SPECIFIC(&helper, ii); ++ii; } @@ -796,7 +714,6 @@ dynablock_t* FillBlock64(uintptr_t addr, int alternate, int is32bits, int inst_m CancelBlock64(0); return CreateEmptyBlock(addr, is32bits, is_new); } - updateYmm0s(&helper, 0, 0); UPDATE_SPECIFICS(&helper); // check for still valid close loop for(int ii=0; ii<helper.jmp_sz && !helper.always_test; ++ii) { |