[LLVMdev] [PATCH] R600/SI: Embed disassembly in ELF object
Jay Cornwall
jay at jcornwall.me
Wed Oct 9 18:06:42 PDT 2013
Hi,
This patch adds R600/SI disassembly text to compiled object files, when
a code dump is requested, to assist debugging in Mesa clients.
Here's an example of the output in a Mesa client with a corresponding
patch and RADEON_DUMP_SHADERS set:
Shader Disassembly:
S_WQM_B64 EXEC, EXEC ; BEFE0A7E
S_MOV_B32 M0, SGPR6 ; BEFC0306
V_INTERP_MOV_F32 VGPR0, P0, 3, 0, [M0] ; C8020302
V_INTERP_MOV_F32 VGPR1, P0, 2, 0, [M0] ; C8060202
V_INTERP_MOV_F32 VGPR2, P0, 1, 0, [M0] ; C80A0102
V_INTERP_MOV_F32 VGPR3, P0, 0, 0, [M0] ; C80E0002
EXP 15, 0, 0, 1, 1, VGPR3, VGPR2, VGPR1, VGPR0 ; F800180F 00010203
S_ENDPGM ; BF810000
A less verbose disassembler is included in Mesa for pre-SI clients, so
the patch does not embed disassembly for NI or earlier targets.
Disassembling during compilation is preferred, as it avoids the overhead
of a second LLVM invocation. Further, the SILowerControlFlow pass
modifies the input LLVM IR, which makes a second invocation for
disassembly fail.
An example patch to Mesa to test functionality is available here:
https://gist.github.com/anonymous/6911363
--
Jay Cornwall
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-r600-gcn-disassembly-in-elf.patch
Type: text/x-diff
Size: 6340 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131009/0a583660/attachment.patch>
More information about the llvm-dev
mailing list