Shaders: xcl disasm prints SMEM offsets, glc and dlc as LLVM does (#664) #716
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!716
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/716/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@milas6669 on GitHub · 2026-11-24 04:01 UTC · original
milas6669:disasm-smem→main· +46 −3 · 1 files · 1 commits · merged 2026-11-25 01:17 UTCxcl 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 #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 #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
@lordon1a on GitHub · 2026-11-24 04:07 UTC · original
Independent test report on
1e181b7:Tested
616.64, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200),rustc 1.100.0(x86_64-pc-windows-gnullvm), debug buildcargo test -p xcl --lib gpu::rdna2::tests -- --nocapture0.31s(smem_text_matches_llvmok)Not tested
AI use
1e181b7in a detached worktree, audited the diff, ran the test suite, and posted this report.@MesshM on GitHub · 2026-11-24 04:07 UTC · original
Test run of
1e181b7f009d9bf912b7586fecca7844c1f641a7on AMD RDNA4. I merged it onto currentmainf4ce27clocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 702 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 661 passed, 0 failed, 21 ignoredSKIPPED;smem_text_matches_llvmpasses.Review: With
SOFFSET= 125 (null) the immediate is the offset and prints as, 0x…or, nullwhen 0; with an SGPR offset it addsoffset:only when the immediate is not 0;glc/dlcfollow. That is LLVM's text, ands_memtime(noSOFFSEToperand) no longer gets an offset. I found nothing to change.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.