From a22779866ace907559573d5ee578e4917c250e81 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 2 Oct 2020 15:13:29 -0400 Subject: [PATCH] pan/bi: Pass flow_control through directly More than just a single bool! Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/bi_pack.c | 2 +- src/panfrost/bifrost/bi_print.c | 3 +-- src/panfrost/bifrost/bi_schedule.c | 5 +++-- src/panfrost/bifrost/compiler.h | 7 ++----- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 500566d..86217f4 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -47,7 +47,7 @@ bi_pack_header(bi_clause *clause, bi_clause *next_1, bi_clause *next_2, bool is_ struct bifrost_header header = { .flow_control = (next_1 == NULL) ? BIFROST_FLOW_END : - (clause->back_to_back ? BIFROST_FLOW_NBTB : BIFROST_FLOW_NBTB_UNCONDITIONAL), + clause->flow_control, .terminate_discarded_threads = is_fragment, .next_clause_prefetch = clause->next_clause_prefetch, .staging_barrier = clause->staging_barrier, diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index c3195dc..527f506 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -409,8 +409,7 @@ bi_print_clause(bi_clause *clause, FILE *fp) fprintf(fp, ")"); } - if (!clause->back_to_back) - fprintf(fp, " nbb"); + fprintf(fp, " %s", bi_flow_control_name(clause->flow_control)); if (!clause->next_clause_prefetch) fprintf(fp, " no_prefetch"); diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index c29fc6a..32d1e1d 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -221,7 +221,7 @@ bi_schedule(bi_context *ctx) last_id = u->scoreboard_id; /* Let's be optimistic, we'll fix up later */ - u->back_to_back = true; + u->flow_control = BIFROST_FLOW_NBTB; u->constant_count = 1; u->constants[0] = ins->constant.u64; @@ -246,7 +246,8 @@ bi_schedule(bi_context *ctx) if (!list_is_empty(&bblock->clauses)) { bi_clause *last_clause = list_last_entry(&bblock->clauses, bi_clause, link); - last_clause->back_to_back = bi_back_to_back(bblock); + if (!bi_back_to_back(bblock)) + last_clause->flow_control = BIFROST_FLOW_NBTB_UNCONDITIONAL; } bblock->scheduled = true; diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 788aaaa..6b81d85 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -395,11 +395,8 @@ typedef struct { unsigned scoreboard_id; uint8_t dependencies; - /* Back-to-back corresponds directly to the back-to-back bit. Branch - * conditional corresponds to the branch conditional bit except that in - * the emitted code it's always set if back-to-bit is, whereas we use - * the actual value (without back-to-back so to speak) internally */ - bool back_to_back; + /* See ISA header for description */ + enum bifrost_flow flow_control; /* Can we prefetch the next clause? Usually it makes sense, except for * clauses ending in unconditional branches */ -- 2.7.4