From 70fb5712e58083592a1cbb8ac7d6d5ac8b190589 Mon Sep 17 00:00:00 2001 From: Eladash Date: Thu, 30 Jul 2020 20:03:22 +0300 Subject: [PATCH] PPU interpreters: Fix VMAXFP NaN and signed zeroes handling --- rpcs3/Emu/Cell/PPUInterpreter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp index dac0e2f0dd..8cbf05f988 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -988,7 +988,10 @@ bool ppu_interpreter_precise::VMADDFP(ppu_thread& ppu, ppu_opcode_t op) bool ppu_interpreter::VMAXFP(ppu_thread& ppu, ppu_opcode_t op) { - ppu.vr[op.vd] = vec_handle_denormal(ppu, vec_handle_nan(_mm_max_ps(ppu.vr[op.va].vf, ppu.vr[op.vb].vf))); + const auto a = ppu.vr[op.va]; + const auto b = ppu.vr[op.vb]; + const auto result = _mm_and_ps(_mm_max_ps(a.vf, b.vf), _mm_max_ps(b.vf, a.vf)); + ppu.vr[op.vd] = vec_handle_denormal(ppu, vec_handle_nan(v128::fromF(result), a, b)); return true; }