pan/mdg: Only print 2 sources for ALU
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 31 May 2022 12:41:03 +0000 (08:41 -0400)
committerAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 1 Jun 2022 18:24:10 +0000 (14:24 -0400)
..and assert the other sources are null. The one place this might fail in the
future is for real FMA, but we don't support that for GL.

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

src/panfrost/midgard/midgard_print.c

index 2a43516..cac792a 100644 (file)
@@ -278,9 +278,15 @@ mir_print_instruction(midgard_instruction *ins)
         else
                 mir_print_src(ins, 1);
 
-        for (unsigned c = 2; c <= 3; ++c) {
-                printf(", ");
-                mir_print_src(ins, c);
+        if (is_alu) {
+                /* ALU ops are all 2-src */
+                assert(ins->src[2] == ~0);
+                assert(ins->src[3] == ~0);
+        } else {
+                for (unsigned c = 2; c <= 3; ++c) {
+                        printf(", ");
+                        mir_print_src(ins, c);
+                }
         }
 
         if (ins->no_spill)