Mesa (main): pan/mdg: Only print 1 source for moves

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 1 19:43:04 UTC 2022


Module: Mesa
Branch: main
Commit: 520204ae1882834399ef1197cd8e67ef48c02861
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=520204ae1882834399ef1197cd8e67ef48c02861

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue May 31 08:43:33 2022 -0400

pan/mdg: Only print 1 source for moves

This makes the printed IR easier to read at a glance.

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

---

 src/panfrost/midgard/midgard_print.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c
index cac792ae8ac..a053b803d0a 100644
--- a/src/panfrost/midgard/midgard_print.c
+++ b/src/panfrost/midgard/midgard_print.c
@@ -264,12 +264,19 @@ mir_print_instruction(midgard_instruction *ins)
         bool is_alu = ins->type == TAG_ALU_4;
         unsigned r_constant = SSA_FIXED_REGISTER(REGISTER_CONSTANT);
 
-        if (ins->src[0] == r_constant && is_alu)
-                mir_print_embedded_constant(ins, 0);
-        else
-                mir_print_src(ins, 0);
+        if (is_alu && alu_opcode_props[ins->op].props & QUIRK_FLIPPED_R24) {
+                /* Moves (indicated by QUIRK_FLIPPED_R24) are 1-src, with their
+                 * one source in the second slot
+                 */
+                assert(ins->src[0] == ~0);
+        } else {
+                if (ins->src[0] == r_constant && is_alu)
+                        mir_print_embedded_constant(ins, 0);
+                else
+                        mir_print_src(ins, 0);
 
-        printf(", ");
+                printf(", ");
+        }
 
         if (ins->has_inline_constant)
                 printf("#%d", ins->inline_constant);



More information about the mesa-commit mailing list