rdna2spirv: accept vcc (s[106:107]) as 64-bit base pointer in s_load_dword* (SHADER-SLOAD-VCC-BASE) #647
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!647
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/sload-vcc-base"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: SHADER-SLOAD-VCC-BASE
AI-assisted.
What and why
In RDNA2 SMEM
s_load_dword*,SBASEencodes a 2-SGPR-aligned 64-bit pointer (sbase * 2). WhenVCCis dead, the compiler allocatessbase = 53(s[106:107]=vcc, i.e.{vcc_lo, vcc_hi}), emitting instructions such ass_load_dwordx4 s[12:15], vcc, 0x0.Gen.scalar_loadintools/rdna2spirv.pypreviously accepted onlysgprandslistbase operands, raisingUnsupported: s_load_dwordx4 operands sgpr vcc(ands_load_dwordx8 operands sgpr vcc,s_load_dwordx4 operands slist vcc) on 79 pipeline-library compute shaders.base["k"] == "special" and base["t"] == "vcc"as["vcc_lo", "vcc_hi"]inGen.scalar_load(load_slotalready loads%vcc/%vcc_hi).s_buffer_load*still requires a 4-dword V# (len(base_slots) != 4) and continues to reject 2-dwordvcc.OLD-10062, which recoversSGPR > 105tuple encodings): together with #596 / high-SGPR tuple decoding, this brings the 2,684-shader pipeline library compute corpus to 2,684 / 2,684 (100.0%) translated andspirv-val-valid under--wave64-emulate.Testing & Verification
python -m unittest discover -s tests/semantic -p test_sload_vcc_base.py -v(3/3 OK, includingspirv-as+spirv-valvalidation)python -m unittest discover -s tests/semantic -p test_scalar_mem_smem.py(44/44 OK)python -I tests/test_text_write_line_endings.py(3/3 OK)--wave64-emulate+spirv-val): all 79 / 79 previously failingvcc-base library compute shaders (72s_load_dwordx4 sgpr, vcc, 6s_load_dwordx8 sgpr, vcc, 1s_load_dwordx4 slist, vcc) now translate and passspirv-val(bringing library CS from 2,605 → 2,684 / 2,684).python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_sload_vcc_base.py docs/design.mdexited 0.Checked
70a5945con Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmaind42773d07:tests/semantic/test_sload_vcc_base.py: 3 tests OK at this head; againstmain's translator it fails (1 failure, 7 errors), the first beingAssertionError: 's_buffer_load without V#' not found in 's_buffer_load_dword operands sgpr vcc', so the test does exercise the new path.cs_smem_sload_negstill passes (1/1) on MoltenVK 1.4.2 with binaries frommain. I cannot claim that fixture reaches the vcc-as-base path; it is a regression check only.llvm-mc 23.1.6. Synthetic fixtures only, no game data. AI-assisted.
Independent check: the patch is correct, but the branch no longer merges cleanly.
Applied to a clean worktree at
main2d73c242f,git apply --checkfails ondocs/design.md:275(the hunk's context has moved), so the pull request isSTALEas it stands.At your own head
70a5945c(detached worktree, Linux, CPython 3.14.7, synthetic fixtures, no game files):So only a rebase onto current
mainis needed — nothing in the translator change or the new test needs to change. This is a second, independent data point next to the macOS check above.Rebased onto current \main\ (\d0da7dade, resolving the \docs/design.md\ hunk context drift noted by @Poussistar) and added two \spirv_mini_interp\ value-execution tests per @qhukz13's review:
Thanks — confirmed on a4c00f4f4:
test_sload_vcc_base.pypasses, and the half-swap mutation (["vcc_hi", "vcc_lo"]) that survived before now fails it (2 failures), as does readingvcc_lofor both halves (8). The address is pinned now.