From: notaz Date: Sun, 18 Sep 2011 19:02:37 +0000 (+0300) Subject: drc: handle $ra access in JALR DS too X-Git-Tag: r10~46 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5910d5d428756a21abeffe9c10db3163c7b8b76;p=pcsx_rearmed.git drc: handle $ra access in JALR DS too or at least try to.. --- diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 573d0cdb..1d884547 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -690,9 +690,9 @@ void lsn(u_char hsn[], int i, int *preferred_reg) hsn[RHASH]=1; hsn[RHTBL]=1; } - // due to the way JAL is currently done we need DS not to evict $ra - if(i>0&&itype[i-1]==UJUMP&&rt1[i-1]==31) { - hsn[31]=0; + // due to the way JAL(R) is currently done we need DS not to evict $ra + if(i>0&&(itype[i-1]==RJUMP||itype[i-1]!=UJUMP)&&rt1[i-1]!=0) { + hsn[rt1[i-1]]=0; } // Coprocessor load/store needs FTEMP, even if not declared if(itype[i]==C1LS||itype[i]==C2LS) { @@ -5249,15 +5249,6 @@ void rjump_assemble(int i,struct regstat *i_regs) if(rh>=0) do_preload_rhash(rh); } #endif - ds_assemble(i+1,i_regs); - uint64_t bc_unneeded=branch_regs[i].u; - uint64_t bc_unneeded_upper=branch_regs[i].uu; - bc_unneeded|=1|(1LL<>16)^return_address)&0xFFFF]); #endif } + ds_assemble(i+1,i_regs); + uint64_t bc_unneeded=branch_regs[i].u; + uint64_t bc_unneeded_upper=branch_regs[i].uu; + bc_unneeded|=1|(1LL<