From a64bb4a0ec8ea4d112b1547ddd5ad03f2ee8c5b4 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 23 Feb 2018 16:00:42 +0300 Subject: [PATCH] facepalm: _mm_andnot is ~A&B not A&~B as the name would suggest --- rpcs3/Emu/RSX/Common/ProgramStateCache.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Common/ProgramStateCache.h b/rpcs3/Emu/RSX/Common/ProgramStateCache.h index 27a1eb9e1f..3fb7689384 100644 --- a/rpcs3/Emu/RSX/Common/ProgramStateCache.h +++ b/rpcs3/Emu/RSX/Common/ProgramStateCache.h @@ -348,7 +348,8 @@ public: else if (sanitize) { //Lower NaNs to 0 - _mm_stream_si128((__m128i*)dst, (__m128i&)_mm_andnot_ps((__m128&)shuffled_vector, _mm_cmpunord_ps((__m128&)shuffled_vector, _mm_set1_ps(1.f)))); + const auto mask = _mm_cmpunord_ps((__m128&)shuffled_vector, _mm_set1_ps(1.f)); + _mm_stream_si128((__m128i*)dst, (__m128i&)_mm_andnot_ps(mask, (__m128&)shuffled_vector)); } else {