summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorOded Gabbay <[email protected]>2016-01-17 14:25:32 +0200
committerOded Gabbay <[email protected]>2016-01-17 21:07:27 +0200
commit529aa8249a29577f160e1f289472b0da7241b90f (patch)
tree7efed8d807afdb0029120ba0ce6b55964c29f749 /src/gallium/auxiliary/util
parent02ac91d717036be0c8390b99860d37ff390c50e2 (diff)
llvmpipe: fix arguments order given to vec_andc
This patch fixes a classic "confuse the enemy" bug. _mm_andnot_si128 (SSE) and vec_andc (VMX) do the same operation, but the arguments are opposite. _mm_andnot_si128 performs "r = (~a) & b" while vec_andc performs "r = a & (~b)" To make sure this error won't return in another place, I added a wrapper function, vec_andnot_si128, in u_pwr8.h, which makes the swap inside. Signed-off-by: Oded Gabbay <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_pwr8.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_pwr8.h b/src/gallium/auxiliary/util/u_pwr8.h
index 1eca6d6df2c..ffd9f923142 100644
--- a/src/gallium/auxiliary/util/u_pwr8.h
+++ b/src/gallium/auxiliary/util/u_pwr8.h
@@ -153,6 +153,12 @@ vec_mullo_epi32 (__m128i a, __m128i b)
return v;
}
+static inline __m128i
+vec_andnot_si128 (__m128i a, __m128i b)
+{
+ return vec_andc (b, a);
+}
+
static inline void
transpose4_epi32(const __m128i * restrict a,
const __m128i * restrict b,