llvmpipe: fix arguments order given to vec_andc
authorOded Gabbay <oded.gabbay@gmail.com>
Sun, 17 Jan 2016 12:25:32 +0000 (14:25 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Sun, 17 Jan 2016 19:07:27 +0000 (21:07 +0200)
commit529aa8249a29577f160e1f289472b0da7241b90f
tree7efed8d807afdb0029120ba0ce6b55964c29f749
parent02ac91d717036be0c8390b99860d37ff390c50e2
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 <oded.gabbay@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/util/u_pwr8.h
src/gallium/drivers/llvmpipe/lp_setup_tri.c