CPU: Copy entire value for zero shift cases

Shortcut, and avoids tainting the Z.
pull/3754/head
Stenzek 3 months ago
parent c1a9d78e7a
commit c20a5c7524
No known key found for this signature in database

@ -1617,8 +1617,15 @@ void CPU::PGXP::CPU_SLLV(Instruction instr, u32 rtVal, u32 rsVal)
ALWAYS_INLINE_RELEASE void CPU::PGXP::CPU_SRx(Instruction instr, u32 rtVal, u32 sh, bool sign, bool is_variable) ALWAYS_INLINE_RELEASE void CPU::PGXP::CPU_SRx(Instruction instr, u32 rtVal, u32 sh, bool sign, bool is_variable)
{ {
const u32 rdVal = sign ? static_cast<u32>(static_cast<s32>(rtVal) >> sh) : (rtVal >> sh);
PGXPValue& prtVal = ValidateAndGetRtValue(instr, rtVal); PGXPValue& prtVal = ValidateAndGetRtValue(instr, rtVal);
PGXPValue& prdVal = GetRdValue(instr);
if (sh == 0)
{
prdVal = prtVal;
return;
}
const u32 rdVal = sign ? static_cast<u32>(static_cast<s32>(rtVal) >> sh) : (rtVal >> sh);
double x = prtVal.x; double x = prtVal.x;
double y = sign ? prtVal.y : f16Unsign(prtVal.y); double y = sign ? prtVal.y : f16Unsign(prtVal.y);
@ -1658,7 +1665,6 @@ ALWAYS_INLINE_RELEASE void CPU::PGXP::CPU_SRx(Instruction instr, u32 rtVal, u32
else else
y = y / static_cast<double>(1 << sh); y = y / static_cast<double>(1 << sh);
PGXPValue& prdVal = GetRdValue(instr);
// Use low precision/rounded values when we're not shifting an entire component, // Use low precision/rounded values when we're not shifting an entire component,
// and it's not originally from a 3D value. Too many false positives in P2/etc. // and it's not originally from a 3D value. Too many false positives in P2/etc.

Loading…
Cancel
Save