From a894000333a1a7dc772cf7e3252738b3d46b1dd2 Mon Sep 17 00:00:00 2001 From: rogerman Date: Sat, 20 Oct 2018 14:53:49 -0700 Subject: [PATCH] matrix.cpp Fix a bug with _Vec3_MultiplyByMatrix() returning an incorrect value on SSE4.1. --- desmume/src/matrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desmume/src/matrix.cpp b/desmume/src/matrix.cpp index c4c2349ab..16d5fc682 100755 --- a/desmume/src/matrix.cpp +++ b/desmume/src/matrix.cpp @@ -694,7 +694,7 @@ FORCEINLINE void _Vec3_MultiplyByMatrix(__m128i &outVec, outVecLo = _mm_srli_epi64(outVecLo, 12); outVecLo = _mm_shuffle_epi32(outVecLo, 0xD8); - __m128i outVecHi = _mm_add_epi64( _mm_mul_epi32(rowHi0, c0), _mm_add_epi64(_mm_mul_epi32(rowLo1, c1), _mm_mul_epi32(rowHi2, c2)) ); + __m128i outVecHi = _mm_add_epi64( _mm_mul_epi32(rowHi0, c0), _mm_add_epi64(_mm_mul_epi32(rowHi1, c1), _mm_mul_epi32(rowHi2, c2)) ); outVecHi = _mm_srli_epi64(outVecHi, 12); outVecHi = _mm_shuffle_epi32(outVecHi, 0x8D);