Repository navigation
Shaders: xcl disasm prints DPP controls, masks and source modifiers - #791
Conversation
An SDWA instruction's text stopped at its registers: which byte or word each source is read from and the result written to, sext / neg / abs on the sources, clamp and the output modifier were left out, a second source with its S bit set was printed as a VGPR, and a compare that writes an SGPR instead of VCC did not show it. The decoder and the recompiler have all of these; only the printed line dropped them (the same gap as xcl-dev#664, in the encodings that issue does not list). The text follows LLVM's: all 2816 lines of its gfx10 SDWA tests in tests/data/llvm-amdgpu now read the same (none did), apart from the implicit vcc operands that the plain forms leave out too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A DPP instruction's text stopped at its registers too: the control that says which lane each lane's first source comes from (quad_perm, row_shl / shr / ror, row_mirror, row_half_mirror, row_share, row_xmask), the row and bank masks, bound_ctrl, fi, the sources' neg / abs and the DPP8 lane selects were left out, so `v_mov_b32_dpp v5, v1` stood for every one of them. The recompiler reads all of these; only the printed line dropped them. The text follows LLVM's: all 2229 lines of its gfx10 DPP16 and DPP8 tests in tests/data/llvm-amdgpu now read the same (none did), apart from the implicit vcc operands and the `_dpp8` suffix this disassembler has. A control RDNA2 has no name for is printed as `dpp_ctrl:<number>`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Test run of Tested
Review: Disassembler text only. I found nothing to change. Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Regression runs for this PR's head main: this PR: Tested
Not tested
Report written with Claude Code (Claude Opus 5.5) from runs on this machine. |
|
Hardware check of Tested
Regression run PR ( Not tested
AI use
|
|
Thanks @eizispark: both blocks are now in Regression run, credited. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Stacked on the SDWA PR #790; only the top commit (ec0aa67) belongs here.
xcl disasmprints a DPP instruction as its registers only:v_mov_b32_dpp v5, v1stands for every lane permutation there is. Left out: the control that says which lane each lane's first source comes from (quad_perm:[…],row_shl/row_shr/row_ror,row_mirror,row_half_mirror,row_share,row_xmask),row_mask/bank_mask,bound_ctrl,fi, the sources' neg / abs, and the eight lane selects of DPP8. The recompiler reads all of these (emit.rs,upper_lanes.rs); only the printed line drops them. Same kind of gap as #664, in an encoding that issue and its PRs (#687, #706, #716) do not cover; I found no issue or PR for it.What is in it
crates/xcl/src/gpu/rdna2.rs:dpp_source(-v1,|v1|),dpp_modifiers(DPP16: control,row_mask,bank_mask,bound_ctrl:1,fi:1; DPP8:dpp8:[…],fi:1), in LLVM's words and order, called fromoperand_text/format.llvm_gfx10_dpp_textcompares the whole line with LLVM's for all 2229 DPP lines oftests/data/llvm-amdgpu(2117 DPP16 ingfx10_vop1_dpp16.txt/gfx10_vop2_dpp16.txt, 112 DPP8 ingfx10_vop1_dpp8.txt);sdwa_and_dpp_src0gets the new tail and a control without a name.vcc/vcc_looperands stay out, as in the plain forms; DPP8 keeps this disassembler's_dpp8suffix (LLVM:_dpp); a control RDNA2 has no name for (wave_*,row_bcastof older GPUs, the unassigned ones) is printed asdpp_ctrl:<number>, where LLVM prints a comment.The text also goes into the
// pc: …comment lines of the translated HLSL, so the HLSL of a program with DPP instructions changes in its comments (no code line changes).Tested
cargo test -p xcl --lib gpu::rdna2: 12 passed, 0 failed. With the tests on the parent commit'sformat: 2 failed –llvm_gfx10_dpp_text"2229 of [2117, 112] DPP lines differ from LLVM's",sdwa_and_dpp_src0.cargo test --workspace --no-fail-fast -- --test-threads=4on ec0aa67: 704 passed, 0 failed, 41 ignored (xcl lib: 663 passed, 0 failed, 21 ignored), from a clean build of the workspace crates.no wave64:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Regression run
Run by @eizispark on an AMD Radeon RX 9070 XT (posted in this PR's comments; we have no retail title here).
main:
PR:
Not tested
XCL_SAMPLE_*data: the game-data tests passed without running.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_statereturn early.dpp_ctrl:<number>form has no LLVM line to compare with.AI use
xcl disasmwith the LLVM test lines in the repository, wrote the code, the tests and this description, and ran the tests.🤖 Generated with Claude Code