pan/mdg: Fix partial execution mode names

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>
This commit is contained in:
Alyssa Rosenzweig
2022-02-12 16:43:36 -05:00
committed by Marge Bot
parent 7e703e4428
commit 6fc81f163e
3 changed files with 24 additions and 19 deletions

View 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);

View 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;

View 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);