From c20a5c75246c576d8824c08602d20e070444e75f Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 13 Jun 2026 16:33:43 +1000 Subject: [PATCH] CPU: Copy entire value for zero shift cases Shortcut, and avoids tainting the Z. --- src/core/cpu_pgxp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/cpu_pgxp.cpp b/src/core/cpu_pgxp.cpp index 57e0f12ec..2f597d56e 100644 --- a/src/core/cpu_pgxp.cpp +++ b/src/core/cpu_pgxp.cpp @@ -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) { - const u32 rdVal = sign ? static_cast(static_cast(rtVal) >> sh) : (rtVal >> sh); PGXPValue& prtVal = ValidateAndGetRtValue(instr, rtVal); + PGXPValue& prdVal = GetRdValue(instr); + if (sh == 0) + { + prdVal = prtVal; + return; + } + + const u32 rdVal = sign ? static_cast(static_cast(rtVal) >> sh) : (rtVal >> sh); double x = prtVal.x; 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 y = y / static_cast(1 << sh); - PGXPValue& prdVal = GetRdValue(instr); // 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.