Mesa (master): pan/bit: Interpret IMATH

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 4 19:01:44 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon May  4 14:29:03 2020 -0400

pan/bit: Interpret IMATH

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>

---

 src/panfrost/bifrost/test/bi_interpret.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/bifrost/test/bi_interpret.c b/src/panfrost/bifrost/test/bi_interpret.c
index 6a7fa694342..1285787ef27 100644
--- a/src/panfrost/bifrost/test/bi_interpret.c
+++ b/src/panfrost/bifrost/test/bi_interpret.c
@@ -185,6 +185,7 @@ bit_write(struct bit_state *s, unsigned index, nir_alu_type T, bit_t value, bool
         bit_make_int(name, expr) \
         
 bit_make_poly(add, a + b);
+bit_make_int(sub, a - b);
 bit_make_float(fma, (a * b) + c);
 bit_make_poly(mov, a);
 bit_make_poly(min, MIN2(a, b));
@@ -525,8 +526,18 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA)
 
                 break;
         }
-        case BI_IMATH:
-                unreachable("Unsupported op");
+
+        case BI_IMATH: {
+                if (ins->op.imath == BI_IMATH_ADD) {
+                        bint(bit_i64add, bit_i32add, bit_i16add, bit_i8add);
+                } else if (ins->op.imath == BI_IMATH_SUB) {
+                        bint(bit_i64sub, bit_i32sub, bit_i16sub, bit_i8sub);
+                } else {
+                        unreachable("Unsupported op");
+                }
+
+                break;
+        }
 
         case BI_MINMAX: {
                 if (ins->op.minmax == BI_MINMAX_MIN) {



More information about the mesa-commit mailing list