intel/brw: Print SWSB information when dumping instructions

These were only being shown before as part of disassemble.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29738>
This commit is contained in:
Caio Oliveira 2024-06-14 13:19:58 -07:00
parent cdd604583f
commit b59ea3d63f
3 changed files with 48 additions and 11 deletions

View file

@ -2712,6 +2712,12 @@ fs_visitor::dump_instruction_to_file(const fs_inst *inst, FILE *file, const brw:
if (inst->has_no_mask_send_params)
fprintf(file, "NoMaskParams ");
if (inst->sched.pipe != TGL_PIPE_NONE) {
fprintf(file, "{ ");
brw_print_swsb(file, devinfo, inst->sched);
fprintf(file, " } ");
}
fprintf(file, "\n");
}
@ -4588,3 +4594,30 @@ namespace brw {
inst->conditional_mod = BRW_CONDITIONAL_NZ;
}
}
void
brw_print_swsb(FILE *f, const struct intel_device_info *devinfo, const tgl_swsb swsb)
{
if (swsb.pipe == TGL_PIPE_NONE)
return;
if (swsb.regdist) {
fprintf(f, "%s@%d",
(devinfo && devinfo->verx10 < 125 ? "" :
swsb.pipe == TGL_PIPE_FLOAT ? "F" :
swsb.pipe == TGL_PIPE_INT ? "I" :
swsb.pipe == TGL_PIPE_LONG ? "L" :
swsb.pipe == TGL_PIPE_ALL ? "A" :
swsb.pipe == TGL_PIPE_MATH ? "M" : "" ),
swsb.regdist);
}
if (swsb.mode) {
if (swsb.regdist)
fprintf(f, " ");
fprintf(f, "$%d%s", swsb.sbid,
(swsb.mode & TGL_SBID_SET ? "" :
swsb.mode & TGL_SBID_DST ? ".dst" : ".src"));
}
}

View file

@ -504,6 +504,8 @@ public:
int iteration, int pass_num) const;
};
void brw_print_swsb(FILE *f, const struct intel_device_info *devinfo, const tgl_swsb swsb);
/**
* Return the flag register used in fragment shaders to keep track of live
* samples. On Gfx7+ we use f1.0-f1.1 to allow discard jumps in SIMD32

View file

@ -130,18 +130,20 @@ bool operator ==(const tgl_swsb &a, const tgl_swsb &b)
}
std::ostream &operator<<(std::ostream &os, const tgl_swsb &swsb) {
if (swsb.regdist)
os << "@" << swsb.regdist;
char *buf;
size_t len;
FILE *f = open_memstream(&buf, &len);
if (swsb.mode) {
if (swsb.regdist)
os << " ";
os << "$" << swsb.sbid;
if (swsb.mode & TGL_SBID_DST)
os << ".dst";
if (swsb.mode & TGL_SBID_SRC)
os << ".src";
}
/* Because we don't have a devinfo to pass here, for TGL we'll see
* F@1 annotations instead of @1 since the float pipe is the only one
* used there.
*/
brw_print_swsb(f, NULL, swsb);
fflush(f);
fclose(f);
os << buf;
free(buf);
return os;
}