pan/midgard: Implement predicate->unit
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 27 Sep 2019 12:19:51 +0000 (08:19 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 30 Sep 2019 12:40:13 +0000 (08:40 -0400)
This allows ALUs to select for each unit of the bundle separately.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_schedule.c

index 4c72844679c034b67cd912f2f0989101a4c8cba6..eae73868e2adda816e197f97f4e512f651f9b80d 100644 (file)
@@ -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;