From b8dbd64267cc8dc2543a1e235d751b61947f1ed7 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 8 May 2024 13:51:37 -0700 Subject: [PATCH] intel/brw: Fix commas when dumping instructions Some commas were being skipped, according to history as an attempt to elide BAD_FILEs, but we still print them, so be consistent. Also for instructions without any sources, the trailing comma was always being printed. Fix that too. Example of instruction output before the change halt_target(8) (null):UD, send(8) (mlen: 1) (EOT) (null):UD, 0u, 0u, g126:UD(null):UD NoMask and after it halt_target(8) (null):UD send(8) (mlen: 1) (EOT) (null):UD, 0u, 0u, g126:UD, (null):UD NoMask Reviewed-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_fs.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index ae6d5a886cf..3571baa423b 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -2565,9 +2565,11 @@ fs_visitor::dump_instruction_to_file(const fs_inst *inst, FILE *file) const if (inst->dst.stride != 1) fprintf(file, "<%u>", inst->dst.stride); - fprintf(file, ":%s, ", brw_reg_type_to_letters(inst->dst.type)); + fprintf(file, ":%s", brw_reg_type_to_letters(inst->dst.type)); for (int i = 0; i < inst->sources; i++) { + fprintf(file, ", "); + if (inst->src[i].negate) fprintf(file, "-"); if (inst->src[i].abs) @@ -2687,9 +2689,6 @@ fs_visitor::dump_instruction_to_file(const fs_inst *inst, FILE *file) const fprintf(file, ":%s", brw_reg_type_to_letters(inst->src[i].type)); } - - if (i < inst->sources - 1 && inst->src[i + 1].file != BAD_FILE) - fprintf(file, ", "); } fprintf(file, " ");