mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-04 18:25:27 +02:00
This makes SSE2 version match the (correctly-rounded) scalar reference (which the current version doesn't: see https://godbolt.org/z/hK5938jda). The new implementation uses the same idea as mentioned in https://github.com/hrydgard/ppsspp/pull/20870#issuecomment-3413134437 It may be a bit slower than current implementation (which simply truncates?), but correctness/consistency is probably worth it. The difference is slight (by 1 in RGB color channels), but observable in synthetic examples (in particular the current implementation darkens completely opaque parts, including `0xFFFFFFFF` -> `0xFFFEFEFE`, and, more strikingly,`0xFF010101` -> `0xFF000000`). This doesn't touch NEON part at all (so "vibe-coded" comment stays for now), but it shouldn't be too hard to port.