[Mesa-dev] [PATCH 22/30] pan/midgard: Extend choose_instruction for scalar units

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


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

diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c
index e71f65f6004..094451ceb9d 100644
--- a/src/panfrost/midgard/midgard_schedule.c
+++ b/src/panfrost/midgard/midgard_schedule.c
@@ -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;
 
-- 
2.23.0



More information about the mesa-dev mailing list