EERec: Don't load in skip case of SW[LR]

This commit is contained in:
TellowKrinkle 2021-09-18 02:46:16 -05:00 committed by refractionpcsx2
parent 23578e963f
commit 0d7f141279
1 changed files with 74 additions and 62 deletions

View File

@ -318,8 +318,6 @@ void recLWR()
// edi = bit offset in word // edi = bit offset in word
xMOV(calleeSavedReg1d, arg1regd); xMOV(calleeSavedReg1d, arg1regd);
xAND(calleeSavedReg1d, 3);
xSHL(calleeSavedReg1d, 3);
xAND(arg1regd, ~3); xAND(arg1regd, ~3);
vtlb_DynGenRead32(32, false); vtlb_DynGenRead32(32, false);
@ -327,6 +325,9 @@ void recLWR()
if (!_Rt_) if (!_Rt_)
return; return;
xAND(calleeSavedReg1d, 3);
xForwardJE8 nomask;
xSHL(calleeSavedReg1d, 3);
// mask off bytes loaded // mask off bytes loaded
xMOV(ecx, 24); xMOV(ecx, 24);
xSUB(ecx, calleeSavedReg1d); xSUB(ecx, calleeSavedReg1d);
@ -339,12 +340,10 @@ void recLWR()
xSHR(eax, cl); xSHR(eax, cl);
xOR(ptr32[&cpuRegs.GPR.r[_Rt_].UL[0]], eax); xOR(ptr32[&cpuRegs.GPR.r[_Rt_].UL[0]], eax);
xCMP(ecx, 0); xForwardJump8 end;
xForwardJump8 nosignextend(Jcc_NotEqual); nomask.SetTarget();
// if ((addr & 3) == 0) eeSignExtendTo(_Rt_);
xCDQ(); end.SetTarget();
xMOV(ptr32[&cpuRegs.GPR.r[_Rt_].UL[1]], edx);
nosignextend.SetTarget();
#else #else
iFlushCall(FLUSH_INTERPRETER); iFlushCall(FLUSH_INTERPRETER);
_deleteEEreg(_Rs_, 1); _deleteEEreg(_Rs_, 1);
@ -368,10 +367,12 @@ void recSWL()
// edi = bit offset in word // edi = bit offset in word
xMOV(calleeSavedReg1d, arg1regd); xMOV(calleeSavedReg1d, arg1regd);
xAND(arg1regd, ~3);
xAND(calleeSavedReg1d, 3); xAND(calleeSavedReg1d, 3);
xCMP(calleeSavedReg1d, 3);
xForwardJE8 skip;
xSHL(calleeSavedReg1d, 3); xSHL(calleeSavedReg1d, 3);
xAND(arg1regd, ~3);
vtlb_DynGenRead32(32, false); vtlb_DynGenRead32(32, false);
// mask read -> arg2 // mask read -> arg2
@ -395,6 +396,11 @@ void recSWL()
xADD(arg1regd, _Imm_); xADD(arg1regd, _Imm_);
xAND(arg1regd, ~3); xAND(arg1regd, ~3);
xForwardJump8 end;
skip.SetTarget();
_eeMoveGPRtoR(arg2regd, _Rt_);
end.SetTarget();
vtlb_DynGenWrite(32); vtlb_DynGenWrite(32);
#else #else
iFlushCall(FLUSH_INTERPRETER); iFlushCall(FLUSH_INTERPRETER);
@ -418,10 +424,11 @@ void recSWR()
// edi = bit offset in word // edi = bit offset in word
xMOV(calleeSavedReg1d, arg1regd); xMOV(calleeSavedReg1d, arg1regd);
xAND(arg1regd, ~3);
xAND(calleeSavedReg1d, 3); xAND(calleeSavedReg1d, 3);
xForwardJE8 skip;
xSHL(calleeSavedReg1d, 3); xSHL(calleeSavedReg1d, 3);
xAND(arg1regd, ~3);
vtlb_DynGenRead32(32, false); vtlb_DynGenRead32(32, false);
// mask read -> edx // mask read -> edx
@ -445,6 +452,11 @@ void recSWR()
xADD(arg1regd, _Imm_); xADD(arg1regd, _Imm_);
xAND(arg1regd, ~3); xAND(arg1regd, ~3);
xForwardJump8 end;
skip.SetTarget();
_eeMoveGPRtoR(arg2regd, _Rt_);
end.SetTarget();
vtlb_DynGenWrite(32); vtlb_DynGenWrite(32);
#else #else
iFlushCall(FLUSH_INTERPRETER); iFlushCall(FLUSH_INTERPRETER);
@ -717,7 +729,7 @@ void recSDL()
xAND(arg1regd, ~0x07); xAND(arg1regd, ~0x07);
xAND(calleeSavedReg1d, 0x7); xAND(calleeSavedReg1d, 0x7);
xCMP(calleeSavedReg1d, 7); xCMP(calleeSavedReg1d, 7);
xForwardJE32 skip; xForwardJE8 skip;
xADD(calleeSavedReg1d, 1); xADD(calleeSavedReg1d, 1);
int t2reg = vtlb_DynGenRead64(64, -1); int t2reg = vtlb_DynGenRead64(64, -1);
int rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ); int rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ);
@ -790,7 +802,7 @@ void recSDR()
xMOV(calleeSavedReg1d, arg1regd); xMOV(calleeSavedReg1d, arg1regd);
xAND(arg1regd, ~0x07); xAND(arg1regd, ~0x07);
xAND(calleeSavedReg1d, 0x7); xAND(calleeSavedReg1d, 0x7);
xForwardJE32 skip; xForwardJE8 skip;
int t2reg = vtlb_DynGenRead64(64, -1); int t2reg = vtlb_DynGenRead64(64, -1);
int rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ); int rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ);