diff --git a/pcsx2/x86/iMMI.cpp b/pcsx2/x86/iMMI.cpp index 378674ee5a..3bd2a94889 100644 --- a/pcsx2/x86/iMMI.cpp +++ b/pcsx2/x86/iMMI.cpp @@ -1472,11 +1472,11 @@ void recQFSRV() //Console.WriteLn("recQFSRV()"); if (_Rs_ == _Rt_ + 1) { + _flushEEreg(_Rs_); + _flushEEreg(_Rt_); int info = eeRecompileCodeXMM(XMMINFO_WRITED); xMOV(eax, ptr32[&cpuRegs.sa]); - _deleteGPRtoXMMreg(_Rs_, 1); - _deleteGPRtoXMMreg(_Rt_, 1); xMOVDQU(xRegisterSSE(EEREC_D), ptr32[eax + &cpuRegs.GPR.r[_Rt_]]); return; } diff --git a/pcsx2/x86/iR5900.h b/pcsx2/x86/iR5900.h index 17dddd0972..88fbfbb502 100644 --- a/pcsx2/x86/iR5900.h +++ b/pcsx2/x86/iR5900.h @@ -119,6 +119,8 @@ void _eeOnWriteReg(int reg, int signext); // if 0, only flushes if not an xmm reg (used when overwriting lower 64bits of reg) void _deleteEEreg(int reg, int flush); +void _flushEEreg(int reg); + // allocates memory on the instruction size and returns the pointer u32* recGetImm64(u32 hi, u32 lo); diff --git a/pcsx2/x86/ix86-32/iR5900Templates.cpp b/pcsx2/x86/ix86-32/iR5900Templates.cpp index 5e44973ce9..8594af481b 100644 --- a/pcsx2/x86/ix86-32/iR5900Templates.cpp +++ b/pcsx2/x86/ix86-32/iR5900Templates.cpp @@ -51,6 +51,17 @@ void _deleteEEreg(int reg, int flush) _deleteMMXreg(MMX_GPR+reg, flush ? 0 : 2); } +void _flushEEreg(int reg) +{ + if (!reg) return; + if (GPR_IS_CONST1(reg)) { + _flushConstReg(reg); + return; + } + _deleteGPRtoXMMreg(reg, 1); + _deleteMMXreg(MMX_GPR + reg, 1); +} + // if not mmx, then xmm int eeProcessHILO(int reg, int mode, int mmx) {