mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
x86jit: Fix several cases of missing dirty checks.
This commit is contained in:
parent
acb711007f
commit
f63c165f64
2 changed files with 16 additions and 18 deletions
|
@ -242,7 +242,7 @@ void Jit::Comp_SV(MIPSOpcode op) {
|
|||
{
|
||||
gpr.Lock(rs);
|
||||
gpr.MapReg(rs, true, false);
|
||||
fpr.MapRegV(vt, MAP_NOINIT);
|
||||
fpr.MapRegV(vt, MAP_DIRTY | MAP_NOINIT);
|
||||
|
||||
JitSafeMem safe(this, rs, imm);
|
||||
safe.SetFar();
|
||||
|
@ -640,10 +640,11 @@ void Jit::Comp_VDot(MIPSOpcode op) {
|
|||
// Flush SIMD.
|
||||
fpr.SimpleRegsV(sregs, sz, 0);
|
||||
fpr.SimpleRegsV(tregs, sz, 0);
|
||||
fpr.SimpleRegsV(dregs, V_Single, MAP_DIRTY | MAP_NOINIT);
|
||||
|
||||
X64Reg tempxreg = XMM0;
|
||||
if (IsOverlapSafe(dregs[0], 0, n, sregs, n, tregs)) {
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_NOINIT);
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_DIRTY | MAP_NOINIT);
|
||||
tempxreg = fpr.VX(dregs[0]);
|
||||
}
|
||||
|
||||
|
@ -659,7 +660,7 @@ void Jit::Comp_VDot(MIPSOpcode op) {
|
|||
}
|
||||
|
||||
if (!fpr.V(dregs[0]).IsSimpleReg(tempxreg)) {
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_NOINIT);
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_DIRTY | MAP_NOINIT);
|
||||
MOVSS(fpr.V(dregs[0]), tempxreg);
|
||||
}
|
||||
|
||||
|
@ -686,11 +687,12 @@ void Jit::Comp_VHdp(MIPSOpcode op) {
|
|||
// Flush SIMD.
|
||||
fpr.SimpleRegsV(sregs, sz, 0);
|
||||
fpr.SimpleRegsV(tregs, sz, 0);
|
||||
fpr.SimpleRegsV(dregs, V_Single, MAP_DIRTY | MAP_NOINIT);
|
||||
|
||||
X64Reg tempxreg = XMM0;
|
||||
if (IsOverlapSafe(dregs[0], 0, n, sregs, n, tregs))
|
||||
{
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_NOINIT);
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_DIRTY | MAP_NOINIT);
|
||||
tempxreg = fpr.VX(dregs[0]);
|
||||
}
|
||||
|
||||
|
@ -710,7 +712,7 @@ void Jit::Comp_VHdp(MIPSOpcode op) {
|
|||
}
|
||||
|
||||
if (!fpr.V(dregs[0]).IsSimpleReg(tempxreg)) {
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_NOINIT);
|
||||
fpr.MapRegsV(dregs, V_Single, MAP_DIRTY | MAP_NOINIT);
|
||||
MOVSS(fpr.V(dregs[0]), tempxreg);
|
||||
}
|
||||
|
||||
|
@ -1722,6 +1724,7 @@ void Jit::Comp_Vf2i(MIPSOpcode op) {
|
|||
|
||||
// Flush SIMD.
|
||||
fpr.SimpleRegsV(sregs, sz, 0);
|
||||
fpr.SimpleRegsV(dregs, sz, MAP_DIRTY | MAP_NOINIT);
|
||||
|
||||
u8 tempregs[4];
|
||||
for (int i = 0; i < n; ++i) {
|
||||
|
@ -2251,7 +2254,7 @@ void Jit::Comp_Vmfvc(MIPSOpcode op) {
|
|||
int vs = _VS;
|
||||
int imm = op & 0xFF;
|
||||
if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) {
|
||||
fpr.MapRegV(vs, 0);
|
||||
fpr.MapRegV(vs, MAP_DIRTY | MAP_NOINIT);
|
||||
if (imm - 128 == VFPU_CTRL_CC) {
|
||||
gpr.MapReg(MIPS_REG_VFPUCC, true, false);
|
||||
MOVD_xmm(fpr.VX(vs), gpr.R(MIPS_REG_VFPUCC));
|
||||
|
|
|
@ -214,10 +214,8 @@ bool FPURegCache::TryMapRegsVS(const u8 *v, VectorSize vsz, int flags) {
|
|||
// This way V/VS can warn about improper usage properly.
|
||||
MapRegV(v[0], flags);
|
||||
vregs[v[0]].lane = 1;
|
||||
// TODO: Currently all non-simd regs are dirty.
|
||||
xregs[VSX(v[0])].dirty = true;
|
||||
//if ((flags & MAP_DIRTY) != 0)
|
||||
// xregs[VSX(v[0])].dirty = true;
|
||||
if ((flags & MAP_DIRTY) != 0)
|
||||
xregs[VSX(v[0])].dirty = true;
|
||||
Invariant();
|
||||
return true;
|
||||
}
|
||||
|
@ -238,14 +236,11 @@ bool FPURegCache::TryMapRegsVS(const u8 *v, VectorSize vsz, int flags) {
|
|||
// Clear the xreg it was in before.
|
||||
X64Reg oldXReg = vr.location.GetSimpleReg();
|
||||
xregs[oldXReg].mipsReg = -1;
|
||||
// TODO: Do this instead, once dirtying is handled well throughout?
|
||||
//if (xregs[oldXReg].dirty) {
|
||||
// // Inherit the "dirtiness" (ultimately set below for all regs.)
|
||||
// dirty = true;
|
||||
// xregs[oldXReg].dirty = false;
|
||||
//}
|
||||
// All non-simd regs are currently always dirty. Ought to be fixed.
|
||||
dirty = true;
|
||||
if (xregs[oldXReg].dirty) {
|
||||
// Inherit the "dirtiness" (ultimately set below for all regs.)
|
||||
dirty = true;
|
||||
xregs[oldXReg].dirty = false;
|
||||
}
|
||||
}
|
||||
xregs[xr].mipsRegs[i] = v[i] + 32;
|
||||
vr.location = newloc;
|
||||
|
|
Loading…
Add table
Reference in a new issue