Mesa (master): gallivm: (trivial) fix copy/paste bug with big endian code

Roland Scheidegger sroland at kemper.freedesktop.org
Wed Jan 18 15:31:16 UTC 2017


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

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Wed Jan 18 16:30:50 2017 +0100

gallivm: (trivial) fix copy/paste bug with big endian code

8bd67a35c50e68c21aed043de11e095c284d151a introduced using undefined variable
on big endian archs due to copy/paste bug.
(compile hack tested only)

---

 src/gallium/auxiliary/gallivm/lp_bld_gather.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_gather.c b/src/gallium/auxiliary/gallivm/lp_bld_gather.c
index 7654ba0..2d1fb65 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_gather.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_gather.c
@@ -227,11 +227,13 @@ lp_build_gather_elem_vec(struct gallivm_state *gallivm,
           * with src_width >= 32 here?
           */
       } else {
+         LLVMTypeRef dst_elem_type = lp_build_vec_type(gallivm, dst_type);
+
          /*
           * Only valid if src_ptr_type is int type...
           */
-         res = LLVMBuildZExt(gallivm->builder, res,
-                             lp_build_vec_type(gallivm, dst_type), "");
+         res = LLVMBuildZExt(gallivm->builder, res, dst_elem_type, "");
+
          if (vector_justify) {
 #ifdef PIPE_ARCH_BIG_ENDIAN
          res = LLVMBuildShl(gallivm->builder, res,




More information about the mesa-commit mailing list