Mesa (master): gallivm: fix find lsb

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 23 04:12:02 UTC 2020


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jan 20 14:56:36 2020 +1000

gallivm: fix find lsb

the GLSL return value is different than the llvm intrinsic.

Fixes arb gpu shader5 tests

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3528>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3528>

---

 src/gallium/auxiliary/gallivm/lp_bld_bitarit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c b/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c
index eee3cba2fb5..97e5a137e89 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_bitarit.c
@@ -276,7 +276,8 @@ lp_build_cttz(struct lp_build_context *bld, LLVMValueRef a)
 
    LLVMValueRef undef_val = LLVMConstNull(LLVMInt1TypeInContext(bld->gallivm->context));
    result = lp_build_intrinsic_binary(builder, intr_str, bld->vec_type, a, undef_val);
-   return result;
+   return LLVMBuildSelect(builder, LLVMBuildICmp(builder, LLVMIntEQ, a, bld->zero, ""),
+			  lp_build_const_int_vec(bld->gallivm, bld->type, -1), result, "");
 }
 
 LLVMValueRef



More information about the mesa-commit mailing list