diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2012-11-22 13:42:45 -0600 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2012-11-29 11:54:10 +0000 |
commit | 86902b513469635bb0bc027db0500e2f4d6c498d (patch) | |
tree | e32786edebf3383248ef7aaec84ee07a0aee7d5e /src/gallium/auxiliary | |
parent | 29ba79b2c929ea23b45fa065fe7c9f8fd400210c (diff) | |
download | external_mesa3d-86902b513469635bb0bc027db0500e2f4d6c498d.zip external_mesa3d-86902b513469635bb0bc027db0500e2f4d6c498d.tar.gz external_mesa3d-86902b513469635bb0bc027db0500e2f4d6c498d.tar.bz2 |
gallivm: Fix vector constant for shuffle
This patch fixes the vector constant generation used for vector shuffle
for big-endian machines.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_pack.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_pack.c b/src/gallium/auxiliary/gallivm/lp_bld_pack.c index f46c080..9eb9ab0 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_pack.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_pack.c @@ -129,7 +129,8 @@ lp_build_const_unpack_shuffle_half(struct gallivm_state *gallivm, } /** - * Build shuffle vectors that match PACKxx instructions. + * Build shuffle vectors that match PACKxx (SSE) instructions or + * VPERM (Altivec). */ static LLVMValueRef lp_build_const_pack_shuffle(struct gallivm_state *gallivm, unsigned n) @@ -140,7 +141,11 @@ lp_build_const_pack_shuffle(struct gallivm_state *gallivm, unsigned n) assert(n <= LP_MAX_VECTOR_LENGTH); for(i = 0; i < n; ++i) +#ifdef PIPE_ARCH_LITTLE_ENDIAN elems[i] = lp_build_const_int32(gallivm, 2*i); +#else + elems[i] = lp_build_const_int32(gallivm, 2*i+1); +#endif return LLVMConstVector(elems, n); } |