pan/bi: Pass flow_control through directly
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 2 Oct 2020 19:13:29 +0000 (15:13 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sat, 10 Oct 2020 20:53:12 +0000 (16:53 -0400)
More than just a single bool!

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7081>

src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/bi_schedule.c
src/panfrost/bifrost/compiler.h

index 500566d..86217f4 100644 (file)
@@ -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,
index c3195dc..527f506 100644 (file)
@@ -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");
index c29fc6a..32d1e1d 100644 (file)
@@ -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;
index 788aaaa..6b81d85 100644 (file)
@@ -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 */