pan/bi: Add bi_print_clause
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 5 Mar 2020 13:10:02 +0000 (08:10 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 5 Mar 2020 14:35:38 +0000 (14:35 +0000)
Again for post-sched purposes.

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

src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/bi_print.h

index 69e6d5d9e122c6b5b13337d21744197779a268fa..c2113eb48a563b85546f2823895c02adff1b3449 100644 (file)
@@ -342,3 +342,46 @@ bi_print_bundle(bi_bundle *bundle, FILE *fp)
         }
 }
 
+void
+bi_print_clause(bi_clause *clause, FILE *fp)
+{
+        fprintf(fp, "\tid(%u)", clause->scoreboard_id);
+
+        if (clause->dependencies) {
+                fprintf(fp, ", next-wait(");
+
+                for (unsigned i = 0; i < 8; ++i) {
+                        if (clause->dependencies & (1 << i))
+                                fprintf(fp, "%u ", i);
+                }
+
+                fprintf(fp, ")");
+        }
+
+        if (!clause->back_to_back)
+                fprintf(fp, " nbb %s", clause->branch_conditional ? "branch-cond" : "branch-uncond");
+
+        if (clause->data_register_write_barrier)
+                fprintf(fp, " drwb");
+
+        fprintf(fp, "\n");
+
+        if (clause->instruction_count) {
+                assert(!clause->bundle_count);
+
+                for (unsigned i = 0; i < clause->instruction_count; ++i)
+                        bi_print_instruction(clause->instructions[i], fp);
+        } else {
+                assert(clause->bundle_count);
+
+                for (unsigned i = 0; i < clause->bundle_count; ++i)
+                        bi_print_bundle(&clause->bundles[i], fp);
+        }
+
+        if (clause->constant_count) {
+                for (unsigned i = 0; i < clause->constant_count; ++i)
+                        fprintf(fp, "%" PRIx64 " ", clause->constants[i]);
+
+                fprintf(fp, "\n");
+        }
+}
index e9b301a39d31259ad992c25a15838660c2d9f60a..fb7de0bc89d2fd1b2bfbe09f1db23a866ae66199 100644 (file)
@@ -40,5 +40,6 @@ const char * bi_ldst_type_name(enum bifrost_ldst_type type);
 
 void bi_print_instruction(bi_instruction *ins, FILE *fp);
 void bi_print_bundle(bi_bundle *bundle, FILE *fp);
+void bi_print_clause(bi_clause *clause, FILE *fp);
 
 #endif