Mesa (main): nir: add 32-bit bool of fisfinite

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


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Aug  2 20:38:27 2021 +1000

nir: add 32-bit bool of fisfinite

Add the bool lowering as well.

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12207>

---

 src/compiler/nir/nir_lower_bool_to_int32.c | 2 ++
 src/compiler/nir/nir_opcodes.py            | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/compiler/nir/nir_lower_bool_to_int32.c b/src/compiler/nir/nir_lower_bool_to_int32.c
index 7be54fb7185..c1afed492b8 100644
--- a/src/compiler/nir/nir_lower_bool_to_int32.c
+++ b/src/compiler/nir/nir_lower_bool_to_int32.c
@@ -103,6 +103,8 @@ lower_alu_instr(nir_alu_instr *alu)
 
    case nir_op_bcsel: alu->op = nir_op_b32csel; break;
 
+   case nir_op_fisfinite: alu->op = nir_op_fisfinite32; break;
+
    default:
       assert(alu->dest.dest.ssa.bit_size > 1);
       for (unsigned i = 0; i < op_info->num_inputs; i++)
diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index aa5f3914a81..e37419c9b8c 100644
--- a/src/compiler/nir/nir_opcodes.py
+++ b/src/compiler/nir/nir_opcodes.py
@@ -1245,6 +1245,7 @@ binop("umul24_relaxed", tuint32, _2src_commutative + associative, "src0 * src1")
 
 unop_convert("fisnormal", tbool1, tfloat, "isnormal(src0)")
 unop_convert("fisfinite", tbool1, tfloat, "isfinite(src0)")
+unop_convert("fisfinite32", tint32, tfloat, "isfinite(src0)")
 
 # vc4-specific opcodes
 



More information about the mesa-commit mailing list