Repository navigation
Shaders: xcl disasm prints SMEM offsets, glc and dlc as LLVM does (#664) - #716
Conversation
…l-dev#664) format() appended `, 0x<offset>` to every SMEM instruction, even one with an SGPR offset (the offset was then `, 0x0`) or no offset at all (s_memtime), and never printed glc / dlc. Now `s_load_dword s5, s[2:3], 0x64` (SOFFSET = null: the immediate is the offset, `null` when it is 0), `s0 offset:0x12345` (SGPR offset, then the immediate when not 0), then glc and dlc. Instructions with no offset operand print neither. The new test compares the 174 SMEM lines of tests/data/llvm-amdgpu/gfx10_smem.txt that RDNA2 decodes (the rest are gfx10.1-only) with LLVM's text, plus the word from the issue. The text also appears in the translated HLSL's comments, so the DXIL cache misses once. Part of xcl-dev#664 (part 4, the last). Assisted-by: Claude Code (Claude Sonnet 5.5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Independent test report on Tested
Not tested
AI use
|
|
Test run of Tested
Review: With 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. |
xcl disasmappended, 0x<offset>to every SMEM instruction (also, 0x0after an SGPR offset, and ons_memtime, which has none) and never printed glc / dlc, so the text differed from the instruction that runs. Now it prints what LLVM does:s_load_dword s5, s[2:3], 0x64(SOFFSET = null: the immediate is the offset;nullwhen it is 0),s0 offset:0x12345(SGPR offset, then the immediate when not 0), thenglc/dlc.Part of #664 (part 4, the last). Independent of #687 and #706: it merges with both without conflicts.
What is in it
crates/xcl/src/gpu/rdna2.rs: theENC_SMEMarm offormat(), only for instructions with an SOFFSET operandsmem_text_matches_llvm: the 174 SMEM lines oftests/data/llvm-amdgpu/gfx10_smem.txtthat RDNA2 decodes (the other 251 are gfx10.1-only and do not decode) match LLVM's text, plus the word from xcl disasm drops VOP3/VOP3P modifiers, EXP targets and VINTRP attributes from its text #664 (s_load_dwordx8 null, s[68:69], vcc_lo offset:0xf50a7 glc dlc)Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on this commit: 702 passed, 0 failed, 41 ignored (three D3D12.X tests fail in some runs on a clean main too; see Shaders: xcl disasm prints VOP3 / VOP3P source and output modifiers (#664) #687)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)Regression run
main (f4ce27c):
this PR (1e181b7):
Not tested
rdna2.rs; I did not check the two togetherAI use