pan/mdg: Print outmods when printing IR

In particular, this lets us distinguish mul_high from regular mul.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16798>
This commit is contained in:
Alyssa Rosenzweig 2022-05-31 09:18:46 -04:00
parent a099834b97
commit e596a0423b
4 changed files with 29 additions and 23 deletions

View File

@ -284,20 +284,6 @@ print_tex_reg(FILE *fp, unsigned reg, bool is_write)
}
static char *outmod_names_float[4] = {
"",
".clamp_0_inf",
".clamp_m1_1",
".clamp_0_1"
};
static char *outmod_names_int[4] = {
".ssat",
".usat",
".keeplo",
".keephi"
};
static char *srcmod_names_int[4] = {
".sext",
".zext",
@ -318,13 +304,6 @@ static char *index_format_names[4] = {
".s32"
};
static void
print_outmod(FILE *fp, unsigned outmod, bool is_int)
{
fprintf(fp, "%s", is_int ? outmod_names_int[outmod] :
outmod_names_float[outmod]);
}
static void
print_alu_outmod(FILE *fp, unsigned outmod, bool is_int, bool half)
{
@ -336,7 +315,7 @@ print_alu_outmod(FILE *fp, unsigned outmod, bool is_int, bool half)
if (!is_int && half)
fprintf(fp, ".shrink");
print_outmod(fp, outmod, is_int);
mir_print_outmod(fp, outmod, is_int);
}
/* arg == 0 (dest), arg == 1 (src1), arg == 2 (src2) */
@ -1771,7 +1750,7 @@ print_texture_word(disassemble_context *ctx, FILE *fp, uint32_t *word,
/* Output modifiers are only valid for float texture operations */
if (texture->sampler_type == MALI_SAMPLER_FLOAT)
print_outmod(fp, texture->outmod, false);
mir_print_outmod(fp, texture->outmod, false);
fprintf(fp, ", ");

View File

@ -435,4 +435,7 @@ mir_print_constant_component(FILE *fp, const midgard_constants *consts,
unsigned c, midgard_reg_mode reg_mode, bool half,
unsigned mod, midgard_alu_op op);
void
mir_print_outmod(FILE *fp, unsigned outmod, bool is_int);
#endif

View File

@ -220,6 +220,11 @@ mir_print_instruction(midgard_instruction *ins)
printf("%s.", mir_get_unit(ins->unit));
printf("%s", name ? name : "??");
if (!(midgard_is_integer_out_op(ins->op) && ins->outmod == midgard_outmod_keeplo)) {
mir_print_outmod(stdout, ins->outmod, midgard_is_integer_out_op(ins->op));
}
break;
}

View File

@ -155,4 +155,23 @@ mir_print_constant_component(FILE *fp, const midgard_constants *consts, unsigned
}
}
static char *outmod_names_float[4] = {
"",
".clamp_0_inf",
".clamp_m1_1",
".clamp_0_1"
};
static char *outmod_names_int[4] = {
".ssat",
".usat",
".keeplo",
".keephi"
};
void
mir_print_outmod(FILE *fp, unsigned outmod, bool is_int)
{
fprintf(fp, "%s", is_int ? outmod_names_int[outmod] :
outmod_names_float[outmod]);
}