Mesa (master): gallivm: handle 16-bit input in i2b32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 20 08:19:44 UTC 2021


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Apr 12 16:20:06 2021 +0200

gallivm: handle 16-bit input in i2b32

Fixes: dac8cb981f4 ("gallivm/nir: allow 8/16-bit conversion and comparison.")
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10185>

---

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

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index c1581ba6a84..38afac47de6 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -206,7 +206,9 @@ static LLVMValueRef int_to_bool32(struct lp_build_nir_context *bld_base,
    LLVMBuilderRef builder = bld_base->base.gallivm->builder;
    struct lp_build_context *int_bld = get_int_bld(bld_base, is_unsigned, src_bit_size);
    LLVMValueRef result = lp_build_compare(bld_base->base.gallivm, int_bld->type, PIPE_FUNC_NOTEQUAL, val, int_bld->zero);
-   if (src_bit_size == 64)
+   if (src_bit_size == 16)
+      result = LLVMBuildSExt(builder, result, bld_base->int_bld.vec_type, "");
+   else if (src_bit_size == 64)
       result = LLVMBuildTrunc(builder, result, bld_base->int_bld.vec_type, "");
    return result;
 }



More information about the mesa-commit mailing list