mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 19:34:39 +01:00
FpCondFromReg's meta is "_G", so the register is in src1 - which is where every native backend, PropagateConstants and ReorderLoadStore read it. But IRInterpret read it from dest, and Comp_VecDo3 wrote it to dest to match. The other emitter passes (0, MIPS_REG_ZERO), so both fields are zero there and the disagreement stayed hidden. The result was that vsge/vslt, which save fpcond to IRTEMP_0 and restore it afterwards, restored r0 (always zero) on the native IR JITs instead of the saved value, losing any c.cond.s result live across them. Fixed both the emitter and the interpreter to use src1. Vec4Pack31To8's SSE2 path computed (v >> 24) << 1, which is (v >> 23) with bit 23 forced to zero - the scalar and NEON paths both do (v >> 23) & 0xFF. Shift left first instead. The pspautotests inputs all happen to have bit 23 clear after the clamp, so this wasn't caught. Also: - Evaluate() didn't mask constant-folded shift amounts to 5 bits, though the neighbouring one-immediate path does. - ApplyMemoryValidation only invalidated its address-check cache for ops with a 'G' destination, while Interpret and CallReplacement can write any GPR - both are barriers, so drop the whole cache when we see one. - ReduceVec4Flush indexed isVec4 with (src2 & 3) instead of (src2 & ~3) for Vec4Scale; a missed optimization rather than a miscompile. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>