pan/bi: Add PAN_SCHED_* flags
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 3 Mar 2020 02:53:13 +0000 (21:53 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 5 Mar 2020 14:35:38 +0000 (14:35 +0000)
Class (mostly) determines scheduling options.

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

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

index c1acd379d223f062ff9383b7154a143b093c91d2..cf3e774efd860c4023b9eb62f43c558a51fd5ff2 100644 (file)
 #include "compiler.h"
 
 unsigned bi_class_props[BI_NUM_CLASSES] = {
-        [BI_ADD]               = BI_GENERIC | BI_MODS,
-        [BI_ATEST]             = 0,
-        [BI_BRANCH]            = 0,
-        [BI_CMP]               = BI_GENERIC | BI_MODS,
-        [BI_BLEND]             = 0,
-        [BI_BITWISE]           = BI_GENERIC,
-        [BI_CONVERT]           = 0,
-        [BI_CSEL]              = 0,
-        [BI_DISCARD]           = 0,
-        [BI_FMA]               = BI_ROUNDMODE,
-        [BI_FREXP]             = 0,
-        [BI_LOAD]              = 0,
-        [BI_LOAD_ATTR]                 = 0,
-        [BI_LOAD_VAR]          = 0,
-        [BI_LOAD_VAR_ADDRESS]  = 0,
-        [BI_MINMAX]            = BI_GENERIC,
-        [BI_MOV]               = BI_MODS,
-        [BI_SHIFT]             = 0,
-        [BI_STORE]             = 0,
-        [BI_STORE_VAR]                 = 0,
-        [BI_SPECIAL]           = 0,
-        [BI_TEX]               = 0,
-        [BI_ROUND]             = BI_GENERIC | BI_ROUNDMODE,
+        [BI_ADD]               = BI_GENERIC | BI_MODS | BI_SCHED_ALL,
+        [BI_ATEST]             = BI_SCHED_ADD,
+        [BI_BRANCH]            = BI_SCHED_ADD,
+        [BI_CMP]               = BI_GENERIC | BI_MODS | BI_SCHED_ALL,
+        [BI_BLEND]             = BI_ADD,
+        [BI_BITWISE]           = BI_GENERIC | BI_SCHED_ALL,
+        [BI_CONVERT]           = BI_SCHED_ALL,
+        [BI_CSEL]              = BI_SCHED_FMA,
+        [BI_DISCARD]           = BI_SCHED_ADD,
+        [BI_FMA]               = BI_ROUNDMODE | BI_SCHED_FMA,
+        [BI_FREXP]             = BI_SCHED_ALL,
+        [BI_LOAD]              = BI_SCHED_ADD,
+        [BI_LOAD_ATTR]                 = BI_SCHED_ADD,
+        [BI_LOAD_VAR]          = BI_SCHED_ADD,
+        [BI_LOAD_VAR_ADDRESS]  = BI_SCHED_ADD,
+        [BI_MINMAX]            = BI_GENERIC | BI_SCHED_ALL,
+        [BI_MOV]               = BI_MODS | BI_SCHED_ALL,
+        [BI_SHIFT]             = BI_SCHED_ALL,
+        [BI_STORE]             = BI_SCHED_ADD,
+        [BI_STORE_VAR]                 = BI_SCHED_ADD,
+        [BI_SPECIAL]           = BI_SCHED_ALL,
+        [BI_TEX]               = BI_SCHED_ADD,
+        [BI_ROUND]             = BI_GENERIC | BI_ROUNDMODE | BI_SCHED_ALL,
 };
index e37c03c52f6cd01f79f236e190d97f7c9fcfb8e1..9f56ed2dcfafb2f4e9659118c43d0f3327e7da3e 100644 (file)
@@ -86,6 +86,15 @@ extern unsigned bi_class_props[BI_NUM_CLASSES];
 /* Accepts a bifrost_roundmode */
 #define BI_ROUNDMODE (1 << 2)
 
+/* Can be scheduled to FMA */
+#define BI_SCHED_FMA (1 << 3)
+
+/* Can be scheduled to ADD */
+#define BI_SCHED_ADD (1 << 4)
+
+/* Most ALU ops can do either, actually */
+#define BI_SCHED_ALL (BI_SCHED_FMA | BI_SCHED_ADD)
+
 /* It can't get any worse than csel4... can it? */
 #define BIR_SRC_COUNT 4