Mesa (main): gallivm: handle fisfinite/fisnormal

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 6 05:17:31 UTC 2021


Module: Mesa
Branch: main
Commit: 78b4e417d44016cdb5df7dbfc3b1ea28219e6fd4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=78b4e417d44016cdb5df7dbfc3b1ea28219e6fd4

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Aug  6 07:22:59 2021 +1000

gallivm: handle fisfinite/fisnormal

lower one, do the other.

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

---

 src/gallium/auxiliary/gallivm/lp_bld_nir.c      | 3 +++
 src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt | 2 --
 src/gallium/drivers/llvmpipe/lp_screen.c        | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index fd62f2f8c63..47466b6bb0e 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -673,6 +673,9 @@ static LLVMValueRef do_alu_action(struct lp_build_nir_context *bld_base,
          result = LLVMBuildTrunc(builder, result, bld_base->uint_bld.vec_type, "");
       break;
    }
+   case nir_op_fisfinite32:
+      result = lp_build_isfinite(get_flt_bld(bld_base, src_bit_size[0]), src[0]);
+      break;
    case nir_op_flog2:
       result = lp_build_log2_safe(&bld_base->base, src[0]);
       break;
diff --git a/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt b/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt
index 44fc9081f54..dbbcbcde0e1 100644
--- a/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt
+++ b/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt
@@ -53,8 +53,6 @@ program/execute/atomic_int64_xor-global-return: skip
 program/execute/atomic_int64_xor-local: skip
 program/execute/builtin/builtin-char-popcount-1.2.generated: skip
 program/execute/builtin/builtin-float-cos-1.0.generated: timeout
-program/execute/builtin/builtin-float-isfinite-1.0.generated: crash
-program/execute/builtin/builtin-float-isnormal-1.0.generated: crash
 program/execute/builtin/builtin-float-ldexp-1.0.generated: fail
 program/execute/builtin/builtin-float-sin-1.0.generated: timeout
 program/execute/builtin/builtin-float-sincos-1.0.generated: timeout
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 5e8c8239725..2f7fe5df52a 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -600,6 +600,7 @@ static const struct nir_shader_compiler_options gallivm_nir_options = {
    .lower_vector_cmp = true,
    .lower_device_index_to_zero = true,
    .support_16bit_alu = true,
+   .lower_fisnormal = true,
 };
 
 static void



More information about the mesa-commit mailing list