mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 18:40:13 +01:00
pan/mdg: Add a macro for printing instruction source information
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5065>
This commit is contained in:
parent
dc8bffe999
commit
5f5a973709
1 changed files with 12 additions and 21 deletions
|
|
@ -272,6 +272,13 @@ mir_print_embedded_constant(midgard_instruction *ins, unsigned src_idx)
|
|||
printf(")");
|
||||
}
|
||||
|
||||
#define PRINT_SRC(ins, c) \
|
||||
do { mir_print_index(ins->src[c]); \
|
||||
if (ins->src[c] != ~0 && ins->src_types[c] != nir_type_invalid) { \
|
||||
pan_print_alu_type(ins->src_types[c], stdout); \
|
||||
mir_print_swizzle(ins->swizzle[c], ins->src_types[c]); \
|
||||
} } while (0)
|
||||
|
||||
void
|
||||
mir_print_instruction(midgard_instruction *ins)
|
||||
{
|
||||
|
|
@ -363,37 +370,21 @@ mir_print_instruction(midgard_instruction *ins)
|
|||
|
||||
if (ins->src[0] == r_constant)
|
||||
mir_print_embedded_constant(ins, 0);
|
||||
else {
|
||||
mir_print_index(ins->src[0]);
|
||||
else
|
||||
PRINT_SRC(ins, 0);
|
||||
|
||||
if (ins->src[0] != ~0) {
|
||||
pan_print_alu_type(ins->src_types[0], stdout);
|
||||
mir_print_swizzle(ins->swizzle[0], ins->src_types[0]);
|
||||
}
|
||||
}
|
||||
printf(", ");
|
||||
|
||||
if (ins->has_inline_constant)
|
||||
printf("#%d", ins->inline_constant);
|
||||
else if (ins->src[1] == r_constant)
|
||||
mir_print_embedded_constant(ins, 1);
|
||||
else {
|
||||
mir_print_index(ins->src[1]);
|
||||
|
||||
if (ins->src[1] != ~0) {
|
||||
pan_print_alu_type(ins->src_types[1], stdout);
|
||||
mir_print_swizzle(ins->swizzle[1], ins->src_types[1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
PRINT_SRC(ins, 1);
|
||||
|
||||
for (unsigned c = 2; c <= 3; ++c) {
|
||||
printf(", ");
|
||||
mir_print_index(ins->src[c]);
|
||||
|
||||
if (ins->src[c] != ~0) {
|
||||
pan_print_alu_type(ins->src_types[c], stdout);
|
||||
mir_print_swizzle(ins->swizzle[c], ins->src_types[c]);
|
||||
}
|
||||
PRINT_SRC(ins, c);
|
||||
}
|
||||
|
||||
if (ins->no_spill)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue