llvmpipe: use vpkswss when dst is signed
authorOded Gabbay <oded.gabbay@gmail.com>
Sun, 17 Jan 2016 20:15:40 +0000 (22:15 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Mon, 18 Jan 2016 07:45:25 +0000 (09:45 +0200)
commit679a654a77f392cc9f8e2b51222b277bd1783ae5
tree4c1d4d02f07eb9bc7dabd56a6a87eb0371953d64
parent119bef954379ebb35faf182b0b665becacddab76
llvmpipe: use vpkswss when dst is signed

This patch fixes a bug when building a pack instruction.

For POWER (altivec), in case the destination is signed and the
src width is 32, we need to use vpkswss. The original code used vpkuwus,
which emits an unsigned result.

This fixes the following piglit tests on ppc64le:
- spec@arb_color_buffer_float@gl_rgba8-drawpixels
- shaders@glsl-fs-fogscale

I've also corrected some coding style issues in the function.

v2: Returned else statements to vmware style

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_pack.c