pan/mdg: Fix partial execution mode names
authorAlyssa Rosenzweig <alyssa@collabora.com>
Sat, 12 Feb 2022 21:43:36 +0000 (16:43 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 23 Feb 2022 12:56:30 +0000 (12:56 +0000)
cont -> skip, last -> kill, and fix the special case handling. It's just an
enum. Makes the disassembly easier to read and closer to Bifrost.

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

src/panfrost/midgard/disassemble.c
src/panfrost/midgard/midgard.h
src/panfrost/midgard/midgard_emit.c

index 738b00a..8437e0e 100644 (file)
@@ -1717,6 +1717,17 @@ derivative_mode(enum mali_derivative_mode mode)
         }
 }
 
+static const char *
+partial_exection_mode(enum midgard_partial_execution mode)
+{
+        switch (mode) {
+        case MIDGARD_PARTIAL_EXECUTION_NONE: return "";
+        case MIDGARD_PARTIAL_EXECUTION_SKIP: return ".skip";
+        case MIDGARD_PARTIAL_EXECUTION_KILL: return ".kill";
+        default: return ".reserved";
+        }
+}
+
 static void
 print_texture_word(disassemble_context *ctx, FILE *fp, uint32_t *word,
                    unsigned tabs, unsigned in_reg_base, unsigned out_reg_base)
@@ -1746,12 +1757,7 @@ print_texture_word(disassemble_context *ctx, FILE *fp, uint32_t *word,
         print_texture_format(fp, texture->format);
 
         /* Instruction "modifiers" parallel the ALU instructions. */
-
-        if (texture->cont)
-                fprintf(fp, ".cont");
-
-        if (texture->last)
-                fprintf(fp, ".last");
+        fputs(partial_exection_mode(texture->exec), fp);
 
         if (texture->out_of_order)
                 fprintf(fp, ".ooo%u", texture->out_of_order);
index f6d721c..d7715c6 100644 (file)
@@ -871,6 +871,12 @@ enum mali_derivative_mode {
         TEXTURE_DFDY = 1,
 };
 
+enum midgard_partial_execution {
+        MIDGARD_PARTIAL_EXECUTION_SKIP = 1,
+        MIDGARD_PARTIAL_EXECUTION_KILL = 2,
+        MIDGARD_PARTIAL_EXECUTION_NONE = 3
+};
+
 typedef struct
 __attribute__((__packed__))
 {
@@ -879,14 +885,7 @@ __attribute__((__packed__))
 
         enum mali_texture_op op  : 4;
         unsigned mode : 4;
-
-        /* A little obscure, but last is set for the last texture operation in
-         * a shader. cont appears to just be last's opposite (?). Yeah, I know,
-         * kind of funky.. BiOpen thinks it could do with memory hinting, or
-         * tile locking? */
-
-        unsigned cont  : 1;
-        unsigned last  : 1;
+        enum midgard_partial_execution exec : 2;
 
         unsigned format : 2;
 
index 58bcfd1..1d4b117 100644 (file)
@@ -1019,10 +1019,10 @@ emit_binary_bundle(compiler_context *ctx,
 
                 ins->texture.type = bundle->tag;
                 ins->texture.next_type = next_tag;
+                ins->texture.exec = MIDGARD_PARTIAL_EXECUTION_NONE; /* default */
 
                 /* Nothing else to pack for barriers */
                 if (ins->op == midgard_tex_op_barrier) {
-                        ins->texture.cont = ins->texture.last = 1;
                         ins->texture.op = ins->op;
                         util_dynarray_append(emission, midgard_texture_word, ins->texture);
                         return;
@@ -1052,10 +1052,10 @@ emit_binary_bundle(compiler_context *ctx,
                 ins->texture.outmod = ins->outmod;
 
                 if (mir_op_computes_derivatives(ctx->stage, ins->op)) {
-                        ins->texture.cont = !ins->helper_terminate;
-                        ins->texture.last = ins->helper_terminate || ins->helper_execute;
-                } else {
-                        ins->texture.cont = ins->texture.last = 1;
+                        if (ins->helper_terminate)
+                                ins->texture.exec = MIDGARD_PARTIAL_EXECUTION_KILL;
+                        else if (!ins->helper_execute)
+                                ins->texture.exec = MIDGARD_PARTIAL_EXECUTION_SKIP;
                 }
 
                 midgard_texture_word texture = texture_word_from_instr(ins);