pan/bi: Add isub op
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 10 Mar 2020 12:03:20 +0000 (08:03 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 19:25:59 +0000 (19:25 +0000)
Can't be a regular ADD since there's no negate modifier for integers
(it's a different opcode entirely).

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

src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/bi_tables.c
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/compiler.h

index daccf91a98fb2cd67e5d04788023807dfaf3c9dc..06b4a034cfc00e7362cde318fae4d8ae2452545b 100644 (file)
@@ -120,6 +120,7 @@ bi_class_name(enum bi_class cl)
         case BI_DISCARD: return "discard";
         case BI_FMA: return "fma";
         case BI_FREXP: return "frexp";
+        case BI_ISUB: return "isub";
         case BI_LOAD: return "load";
         case BI_LOAD_UNIFORM: return "load_uniform";
         case BI_LOAD_ATTR: return "load_attr";
index 06430d0912bb31f349a63deb0a51bf063ba45cc4..e33b89aae55550b3f3ec7fe0eff26ec23ad67487 100644 (file)
@@ -38,6 +38,7 @@ unsigned bi_class_props[BI_NUM_CLASSES] = {
         [BI_DISCARD]           = BI_SCHED_HI_LATENCY,
         [BI_FMA]               = BI_ROUNDMODE | BI_SCHED_FMA,
         [BI_FREXP]             = BI_SCHED_ALL,
+        [BI_ISUB]              = BI_GENERIC | BI_SCHED_ALL,
         [BI_LOAD]              = BI_SCHED_HI_LATENCY,
         [BI_LOAD_UNIFORM]      = BI_SCHED_HI_LATENCY,
         [BI_LOAD_ATTR]                 = BI_SCHED_HI_LATENCY,
index 6fa982e50f4651cefe4d6e83e4875e266cd468db..97ef06946ac96804bbd0ad48fa3c99f871248ab0 100644 (file)
@@ -233,6 +233,8 @@ bi_class_for_nir_alu(nir_op op)
         case nir_op_fadd:
         case nir_op_fsub:
                 return BI_ADD;
+        case nir_op_isub:
+                return BI_ISUB;
 
         case nir_op_i2i8:
         case nir_op_i2i16:
index c1c8d695be37ddcfc43571d556aa38fbd42be626..ec1a6f3768cf544f00e85028d61b2a2be6c97c3b 100644 (file)
@@ -58,6 +58,7 @@ enum bi_class {
         BI_DISCARD,
         BI_FMA,
         BI_FREXP,
+        BI_ISUB,
         BI_LOAD,
         BI_LOAD_UNIFORM,
         BI_LOAD_ATTR,