From 627872ef7f8be877cc8c64f0b424827a43ed8ef7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 28 May 2020 12:53:22 -0400 Subject: [PATCH] pan/bi: Add branch constant field to IR The offsets used for branches need some extra bits twiddled, so add a field to the clause to indicate this is happening. This is not ambiguous since a clause can only have a single branch. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_print.c | 3 +++ src/panfrost/bifrost/compiler.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index 681075c..7b8164e 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -479,6 +479,9 @@ bi_print_clause(bi_clause *clause, FILE *fp) for (unsigned i = 0; i < clause->constant_count; ++i) fprintf(fp, "%" PRIx64 " ", clause->constants[i]); + if (clause->branch_constant) + fprintf(fp, "*"); + fprintf(fp, "\n"); } } diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index b1f7887..fb95c6d 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -376,6 +376,12 @@ typedef struct { uint64_t constants[8]; unsigned constant_count; + /* Branches encode a constant offset relative to the program counter + * with some magic flags. By convention, if there is a branch, its + * constant will be last. Set this flag to indicate this is required. + */ + bool branch_constant; + /* What type of high latency instruction is here, basically */ unsigned clause_type; } bi_clause; -- 2.7.4