diff options
author | Danylo Piliaiev <danylo.piliaiev@globallogic.com> | 2019-06-03 14:55:23 +0300 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-09-02 10:33:29 +0000 |
commit | bc4a127d6e10318d48fa8b540b9c1ff7d62c8d29 (patch) | |
tree | 5d20b3e88bf22058e24f57c663c7ca1fac590c10 /src/intel/common/gen_disasm.c | |
parent | 6cbd4764cd93d5b103778a223651084eaeda64f8 (diff) |
intel/disasm: Label support in shader disassembly for UIP/JIP
Shader instructions which use UIP/JIP now get formatted with a label
in addition with immediate value, labels have "LABEL%d" format.
v2: - Consider brw_jump_scale when calculating label's offset
From: "Lonnberg, Toni" <toni.lonnberg@intel.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4245>
Diffstat (limited to 'src/intel/common/gen_disasm.c')
-rw-r--r-- | src/intel/common/gen_disasm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/intel/common/gen_disasm.c b/src/intel/common/gen_disasm.c index 656613cd931..375f2c37764 100644 --- a/src/intel/common/gen_disasm.c +++ b/src/intel/common/gen_disasm.c @@ -84,6 +84,10 @@ gen_disasm_disassemble(struct gen_disasm *disasm, const void *assembly, brw_validate_instructions(devinfo, assembly, start, end, disasm_info); + void *mem_ctx = ralloc_context(NULL); + const struct brw_label *root_label = + brw_label_assembly(devinfo, assembly, start, end, mem_ctx); + foreach_list_typed(struct inst_group, group, link, &disasm_info->group_list) { struct exec_node *next_node = exec_node_get_next(&group->link); @@ -96,13 +100,15 @@ gen_disasm_disassemble(struct gen_disasm *disasm, const void *assembly, int start_offset = group->offset; int end_offset = next->offset; - brw_disassemble(devinfo, assembly, start_offset, end_offset, out); + brw_disassemble(devinfo, assembly, start_offset, end_offset, + root_label, out); if (group->error) { fputs(group->error, out); } } + ralloc_free(mem_ctx); ralloc_free(disasm_info); } |