Mesa (master): llmvpipe: improve mm_mullo_epi32

Keith Whitwell keithw at kemper.freedesktop.org
Tue Oct 12 13:17:33 UTC 2010


Module: Mesa
Branch: master
Commit: e3ec0fdd546259005c9ed2bf7b05cead2ab95b43
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3ec0fdd546259005c9ed2bf7b05cead2ab95b43

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Oct 12 14:15:59 2010 +0100

llmvpipe: improve mm_mullo_epi32

Apply Jose's suggestions for a small but measurable improvement in
isosurf.

---

 src/gallium/drivers/llvmpipe/lp_rast_tri.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
index 19b0bd6..c3eefb7 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
@@ -321,8 +321,8 @@ transpose4_epi32(const __m128i * restrict a,
  */
 static INLINE __m128i mm_mullo_epi32(const __m128i a, const __m128i b)
 {
-   __m128i a4   = _mm_srli_si128(a, 4);  /* shift by one dword */
-   __m128i b4   = _mm_srli_si128(b, 4);  /* shift by one dword */
+   __m128i a4   = _mm_srli_epi64(a, 32);  /* shift by one dword */
+   __m128i b4   = _mm_srli_epi64(b, 32);  /* shift by one dword */
    __m128i ba   = _mm_mul_epu32(b, a);   /* multply dwords 0, 2 */
    __m128i b4a4 = _mm_mul_epu32(b4, a4); /* multiply dwords 1, 3 */
 
@@ -336,8 +336,7 @@ static INLINE __m128i mm_mullo_epi32(const __m128i a, const __m128i b)
 #else
    __m128i mask            = _mm_setr_epi32(~0,0,~0,0);
    __m128i ba_mask         = _mm_and_si128(ba, mask);
-   __m128i b4a4_mask       = _mm_and_si128(b4a4, mask);
-   __m128i b4a4_mask_shift = _mm_slli_si128(b4a4_mask, 4);
+   __m128i b4a4_mask_shift = _mm_slli_epi64(b4a4, 32);
    __m128i result          = _mm_or_si128(ba_mask, b4a4_mask_shift);
 #endif
 




More information about the mesa-commit mailing list