Mesa (master): pan/mdg: Factor out unit check

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 17 13:12:06 UTC 2020


Module: Mesa
Branch: master
Commit: bc356abea31b4727dd1363d9a3a2017135b05bd0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc356abea31b4727dd1363d9a3a2017135b05bd0

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Fri Jun 12 17:08:19 2020 -0400

pan/mdg: Factor out unit check

We'd like to do something a bit more complicated.

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

---

 src/panfrost/midgard/midgard_schedule.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c
index 9dee152c5e4..5a12d11045e 100644
--- a/src/panfrost/midgard/midgard_schedule.c
+++ b/src/panfrost/midgard/midgard_schedule.c
@@ -508,6 +508,15 @@ mir_pipeline_count(midgard_instruction *ins)
         return DIV_ROUND_UP(bytecount, 16);
 }
 
+static unsigned
+mir_has_unit(midgard_instruction *ins, unsigned unit)
+{
+        if (alu_opcode_props[ins->alu.op].props & unit)
+                return true;
+
+        return false;
+}
+
 static midgard_instruction *
 mir_choose_instruction(
                 midgard_instruction **instructions,
@@ -554,7 +563,7 @@ 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))
+                if (alu && !branch && !(mir_has_unit(instructions[i], unit)))
                         continue;
 
                 if (branch && !instructions[i]->compact_branch)



More information about the mesa-commit mailing list