agx: Print instructions as "dest = src"

This makes the dataflow easier to read, especially with splits and
collects (which take variable numbers of sources/destinations).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18804>
This commit is contained in:
Alyssa Rosenzweig 2022-09-23 16:40:39 -04:00 committed by Marge Bot
parent 72a1e1f33f
commit 6c95572ef0

View file

@ -108,19 +108,10 @@ agx_print_instr(agx_instr *I, FILE *fp)
{
assert(I->op < AGX_NUM_OPCODES);
struct agx_opcode_info info = agx_opcodes_info[I->op];
fprintf(fp, " %s", info.name);
if (I->saturate)
fprintf(fp, ".sat");
if (I->last)
fprintf(fp, ".last");
fprintf(fp, " ");
bool print_comma = false;
fprintf(fp, " ");
agx_foreach_dest(I, d) {
if (print_comma)
fprintf(fp, ", ");
@ -130,6 +121,21 @@ agx_print_instr(agx_instr *I, FILE *fp)
agx_print_index(I->dest[d], false, fp);
}
if (I->nr_dests) {
fprintf(fp, " = ");
print_comma = false;
}
fprintf(fp, "%s", info.name);
if (I->saturate)
fprintf(fp, ".sat");
if (I->last)
fprintf(fp, ".last");
fprintf(fp, " ");
agx_foreach_src(I, s) {
if (print_comma)
fprintf(fp, ", ");