[Mesa-dev] [PATCH 14/30] pan/midgard: Implement predicate->unit

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Sat Sep 28 19:02:19 UTC 2019


This allows ALUs to select for each unit of the bundle separately.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
 src/panfrost/midgard/midgard_schedule.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c
index 4c72844679c..eae73868e2a 100644
--- a/src/panfrost/midgard/midgard_schedule.c
+++ b/src/panfrost/midgard/midgard_schedule.c
@@ -885,6 +885,9 @@ mir_choose_instruction(
 {
         /* Parse the predicate */
         unsigned tag = predicate->tag;
+        bool alu = tag == TAG_ALU_4;
+        unsigned unit = predicate->unit;
+        bool branch = alu && (unit == ALU_ENAB_BR_COMPACT);
 
         /* Iterate to find the best instruction satisfying the predicate */
         unsigned i;
@@ -899,6 +902,12 @@ mir_choose_instruction(
                 if (predicate->exclude != ~0 && instructions[i]->dest == predicate->exclude)
                         continue;
 
+                if (alu && !branch && !(alu_opcode_props[instructions[i]->alu.op].props & unit))
+                        continue;
+
+                if (branch && !instructions[i]->compact_branch)
+                        continue;
+
                 /* Simulate in-order scheduling */
                 if ((signed) i < best_index)
                         continue;
-- 
2.23.0



More information about the mesa-dev mailing list