CPU/PGXP: Eliminate extra copy in SLT/SLTU

This commit is contained in:
Stenzek 2024-08-20 18:35:49 +10:00
parent 8629efc39c
commit a764954977
No known key found for this signature in database
1 changed files with 18 additions and 20 deletions

View File

@ -1093,16 +1093,15 @@ void CPU::PGXP::CPU_SLT(Instruction instr, u32 rsVal, u32 rtVal)
// Rd = Rs < Rt (signed) // Rd = Rs < Rt (signed)
PGXP_value& prsVal = ValidateAndGetRsValue(instr, rsVal); PGXP_value& prsVal = ValidateAndGetRsValue(instr, rsVal);
PGXP_value& prtVal = ValidateAndGetRtValue(instr, rtVal); PGXP_value& prtVal = ValidateAndGetRtValue(instr, rtVal);
PGXP_value& prdVal = GetRdValue(instr);
PGXP_value ret = prsVal; prdVal.x = (prsVal.GetValidY(rsVal) < prtVal.GetValidY(rtVal) ||
ret.x = (prsVal.GetValidY(rsVal) < prtVal.GetValidY(rtVal) ||
f16Unsign(prsVal.GetValidX(rsVal)) < f16Unsign(prtVal.GetValidX(rtVal))) ? f16Unsign(prsVal.GetValidX(rsVal)) < f16Unsign(prtVal.GetValidX(rtVal))) ?
1.f : 1.0f :
0.f; 0.0f;
ret.y = 0.f; prdVal.y = 0.0f;
ret.flags |= VALID_TAINTED_Z | VALID_X | VALID_Y; prdVal.z = prsVal.z;
ret.value = BoolToUInt32(static_cast<s32>(rsVal) < static_cast<s32>(rtVal)); prdVal.flags = prsVal.flags | VALID_TAINTED_Z | VALID_X | VALID_Y;
GetRdValue(instr) = ret; prdVal.value = BoolToUInt32(static_cast<s32>(rsVal) < static_cast<s32>(rtVal));
} }
void CPU::PGXP::CPU_SLTU(Instruction instr, u32 rsVal, u32 rtVal) void CPU::PGXP::CPU_SLTU(Instruction instr, u32 rsVal, u32 rtVal)
@ -1112,16 +1111,15 @@ void CPU::PGXP::CPU_SLTU(Instruction instr, u32 rsVal, u32 rtVal)
// Rd = Rs < Rt (unsigned) // Rd = Rs < Rt (unsigned)
PGXP_value& prsVal = ValidateAndGetRsValue(instr, rsVal); PGXP_value& prsVal = ValidateAndGetRsValue(instr, rsVal);
PGXP_value& prtVal = ValidateAndGetRtValue(instr, rtVal); PGXP_value& prtVal = ValidateAndGetRtValue(instr, rtVal);
PGXP_value& prdVal = GetRdValue(instr);
PGXP_value ret = prsVal; prdVal.x = (f16Unsign(prsVal.GetValidY(rsVal)) < f16Unsign(prtVal.GetValidY(rtVal)) ||
ret.x = (f16Unsign(prsVal.GetValidY(rsVal)) < f16Unsign(prtVal.GetValidY(rtVal)) ||
f16Unsign(prsVal.GetValidX(rsVal)) < f16Unsign(prtVal.GetValidX(rtVal))) ? f16Unsign(prsVal.GetValidX(rsVal)) < f16Unsign(prtVal.GetValidX(rtVal))) ?
1.f : 1.0f :
0.f; 0.0f;
ret.y = 0.f; prdVal.y = 0.0f;
ret.flags |= VALID_TAINTED_Z | VALID_X | VALID_Y; prdVal.z = prsVal.z;
ret.value = BoolToUInt32(rsVal < rtVal); prdVal.flags = prsVal.flags | VALID_TAINTED_Z | VALID_X | VALID_Y;
GetRdValue(instr) = ret; prdVal.value = BoolToUInt32(rsVal < rtVal);
} }
//////////////////////////////////// ////////////////////////////////////