Mesa (master): bifrost: Add support for nir_op_inot

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 28 02:16:47 UTC 2020


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

Author: Chris Forbes <chrisforbes at google.com>
Date:   Sun Jul 26 11:37:42 2020 -0700

bifrost: Add support for nir_op_inot

Signed-off-by: Chris Forbes <chrisforbes at google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6091>

---

 src/panfrost/bifrost/bifrost_compile.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index bee11a440bb..2aef98fde6d 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -515,6 +515,7 @@ bi_class_for_nir_alu(nir_op op)
         case nir_op_iand:
         case nir_op_ior:
         case nir_op_ixor:
+        case nir_op_inot:
                 return BI_BITWISE;
 
         BI_CASE_CMP(nir_op_flt)
@@ -801,6 +802,12 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
         case nir_op_isub:
                 alu.op.imath = BI_IMATH_SUB;
                 break;
+        case nir_op_inot:
+                /* no dedicated bitwise not, but we can invert sources. convert to ~a | 0 */
+                alu.op.bitwise = BI_BITWISE_OR;
+                alu.bitwise.src_invert[0] = true;
+                alu.src[1] = BIR_INDEX_ZERO;
+                break;
         case nir_op_fmax:
         case nir_op_imax:
         case nir_op_umax:



More information about the mesa-commit mailing list