mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
sh2 drc: fix i386 regression
This commit is contained in:
parent
a0f5ba4067
commit
c3ebe082d3
1 changed files with 9 additions and 5 deletions
|
@ -1682,6 +1682,7 @@ static void rcache_clean_vreg(int x)
|
||||||
if (guest_regs[r].flags & (GRF_STATIC|GRF_PINNED)) {
|
if (guest_regs[r].flags & (GRF_STATIC|GRF_PINNED)) {
|
||||||
if (guest_regs[r].vreg != guest_regs[r].sreg &&
|
if (guest_regs[r].vreg != guest_regs[r].sreg &&
|
||||||
!cache_regs[guest_regs[r].sreg].locked &&
|
!cache_regs[guest_regs[r].sreg].locked &&
|
||||||
|
(~rcache_regs_discard & (1 << r)) &&
|
||||||
!(rns & cache_regs[guest_regs[r].sreg].gregs)) {
|
!(rns & cache_regs[guest_regs[r].sreg].gregs)) {
|
||||||
// statically mapped reg not in its sreg. move back to sreg
|
// statically mapped reg not in its sreg. move back to sreg
|
||||||
rcache_evict_vreg(guest_regs[r].sreg);
|
rcache_evict_vreg(guest_regs[r].sreg);
|
||||||
|
@ -1820,6 +1821,8 @@ static int rcache_allocate_nontemp(void)
|
||||||
static int rcache_allocate_temp(void)
|
static int rcache_allocate_temp(void)
|
||||||
{
|
{
|
||||||
int x = rcache_allocate(-1, 1);
|
int x = rcache_allocate(-1, 1);
|
||||||
|
if (x < 0)
|
||||||
|
x = rcache_allocate(0, 0);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3404,16 +3407,16 @@ static void REGPARM(2) *sh2_translate(SH2 *sh2, int tcache_id)
|
||||||
// regs needed in the next few instructions
|
// regs needed in the next few instructions
|
||||||
if (v <= 4)
|
if (v <= 4)
|
||||||
soon = late;
|
soon = late;
|
||||||
} else {
|
} else
|
||||||
// upcoming rcache_flush, start writing back unused dirty stuff
|
|
||||||
rcache_set_usage_discard(write & ~(late|soon|opd[0].source));
|
|
||||||
rcache_clean_masked(rcache_dirty_mask() & ~(write|opd[0].dest));
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
rcache_set_usage_now(opd[0].source); // current insn
|
rcache_set_usage_now(opd[0].source); // current insn
|
||||||
rcache_set_usage_soon(soon); // insns 1-4
|
rcache_set_usage_soon(soon); // insns 1-4
|
||||||
rcache_set_usage_late(late & ~soon); // insns 5-9
|
rcache_set_usage_late(late & ~soon); // insns 5-9
|
||||||
|
rcache_set_usage_discard(write & ~(late|soon|opd[0].source));
|
||||||
|
if (v <= 9)
|
||||||
|
// upcoming rcache_flush, start writing back unused dirty stuff
|
||||||
|
rcache_clean_masked(rcache_dirty_mask() & ~(write|opd[0].dest));
|
||||||
|
|
||||||
switch (opd->op)
|
switch (opd->op)
|
||||||
{
|
{
|
||||||
|
@ -3826,6 +3829,7 @@ static void REGPARM(2) *sh2_translate(SH2 *sh2, int tcache_id)
|
||||||
emith_tpop_carry(sr, 0);
|
emith_tpop_carry(sr, 0);
|
||||||
emith_adcf_r_r_r(tmp2, tmp, tmp);
|
emith_adcf_r_r_r(tmp2, tmp, tmp);
|
||||||
emith_tpush_carry(sr, 0); // keep Q1 in T for now
|
emith_tpush_carry(sr, 0); // keep Q1 in T for now
|
||||||
|
rcache_free(tmp);
|
||||||
tmp4 = rcache_get_tmp();
|
tmp4 = rcache_get_tmp();
|
||||||
emith_and_r_r_imm(tmp4, sr, M);
|
emith_and_r_r_imm(tmp4, sr, M);
|
||||||
emith_eor_r_r_lsr(sr, tmp4, M_SHIFT - Q_SHIFT); // Q ^= M
|
emith_eor_r_r_lsr(sr, tmp4, M_SHIFT - Q_SHIFT); // Q ^= M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue