From: Alyssa Rosenzweig Date: Thu, 5 Mar 2020 13:10:02 +0000 (-0500) Subject: pan/bi: Add bi_print_clause X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c316d1553bc27e9f64a14fcce147de96bea430e0;p=mesa.git pan/bi: Add bi_print_clause Again for post-sched purposes. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index 69e6d5d9e12..c2113eb48a5 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -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"); + } +} diff --git a/src/panfrost/bifrost/bi_print.h b/src/panfrost/bifrost/bi_print.h index e9b301a39d3..fb7de0bc89d 100644 --- a/src/panfrost/bifrost/bi_print.h +++ b/src/panfrost/bifrost/bi_print.h @@ -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