pan/midgard: Extend choose_instruction for scalar units
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sat, 28 Sep 2019 13:48:43 +0000 (09:48 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 30 Sep 2019 12:40:13 +0000 (08:40 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_schedule.c

index 64359729cc067be6d3fa5a368e366b38bd9d3aa1..dfc02f1c33710aa8ad1157db22ad459a740c199d 100644 (file)
@@ -393,6 +393,7 @@ mir_choose_instruction(
         bool alu = tag == TAG_ALU_4;
         unsigned unit = predicate->unit;
         bool branch = alu && (unit == ALU_ENAB_BR_COMPACT);
+        bool scalar = (unit != ~0) && (unit & UNITS_SCALAR);
 
         /* Iterate to find the best instruction satisfying the predicate */
         unsigned i;
@@ -427,6 +428,9 @@ mir_choose_instruction(
                 if (branch && !instructions[i]->compact_branch)
                         continue;
 
+                if (alu && scalar && !mir_is_scalar(instructions[i]))
+                        continue;
+
                 if (alu && !mir_adjust_constants(instructions[i], predicate, false))
                         continue;