Repository navigation
rdna2spirv: s_movreld_b32, s_movreld_b64 and s_movrelsd_2_b32 (relative SGPR writes), measured on RDNA2 - #2796
evilclanker9000 wants to merge 6 commits into
Conversation
…ve SGPR writes) The three raised Unsupported; s_movrels_* was done. They are dynamic stores into the SGPR array at D + M0 (movrelsd_2: D + M0[25:16], source S0 + M0[9:0]); the translator forgets its translate-time SGPR knowledge there, refuses when an SGPR holds a lane mask, and a wave64 graphics shader using them is tier C. Measured on RDNA2 with int_hw_probe (salu_movreld, 7 cases, translator and GPU agree). GPU fixture ps_movreld, semantic test and design.md row. AI-assisted.
# Conflicts: # docs/design.md
|
Hardware Verification: PASS with a minor test-runner finding. AI-assisted review. Validated against:
Results:
Minor Finding:
Zero game data used. |
|
Tested 3b1d188 on Apple M2 (Mac14,3), macOS 26.4 (25E246), MoltenVK 1.4.2 (direct), subgroup 4..32, llvm-mc 23.1.6, Python 3.13.18: pass.
Build note: the full build fails on AppleClang 17 at vk_pipeline_check.cpp (known AI-assisted. |
|
Rechecked in real wave64 with the hw_oracle fix in #2961: same words. AI-assisted. |
|
Tested The two scalar-relative semantic suites passed on Linux, including the distinctions between a selected destination and untouched registers. AI-assisted, synthetic inputs only. |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 3b1d188 on AMD Radeon RX 7900 XTX (RDNA3, Navi 31; native wave32 and wave64), AMD driver 26.11.2, Vulkan 1.4.359, Windows 11: pass.
Tools: llvm-mc 21.1.8 (WSL), Vulkan SDK 1.4.363.0, MSVC 14.44. |
|
Tested on the merge with current The rule is right: the SOP1 forms and index fields match the ISA row and the Non-blocking gaps: the Also, the PR text says Approve. AI-assisted review, no game files, no GPU. |
runtime/test/shaders/check.py scripts/run_gpu_tests.py tests/semantic/regen_fixtures.py AI-assisted.
docs/design.md AI-assisted.
|
Tested 3974100 (a re-test at the new head) on AMD Radeon RX 9070 XT (RADV GFX1201, wave32/64) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.
No game files. AI-assisted. |
docs/design.md runtime/test/shaders/check.py scripts/run_gpu_tests.py AI-assisted.
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 451fca7 merged with main d974c88 on native Windows (Python 3.13.1, llvm-mc 23.1.6) and with main 98fa503 on Linux (Python 3.12.16): pass. Windows: the 18 test files tests/semantic/test_salu_movreld.py, test_salu_movrels.py, test_value_semantics.py, test_wave64_halves*.py, test_int_hw_probe.py, test_run_gpu_tests.py, test_shader_checks.py, the rdna2spirv and docs tests: 18/18 ok. Linux: 17/18; the one failure, tests/test_wave64_halves_fixtures.py (pytest, needs llvm-mc: ModuleNotFoundError for conftest under -I), fails the same way on main. run_gpu_tests.py ps_movreld 1/1 (4096/4096 pixels exact) on RTX 4080 SUPER and on the UHD 770 selected with VK_LOADER_DRIVERS_DISABLE=nv and LEONIDA_VK_DEVICE=Intel (tools/vk_subgroup_info.py under the same variables prints |
docs/design.md tools/int_hw_probe.py AI-assisted.
|
Tested 531890c on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: pass.
No runtime C++ changes in this PR; tested from the PR worktree against the existing main runtime build. AI-assisted (OpenCode). |
|
Tested
No game files. AI-assisted (Claude Code). |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-SALU-MOVRELD, #2516 (comment)
What and why
s_movreld_b32,s_movreld_b64ands_movrelsd_2_b32(relative SGPR writes through M0) raisedUnsupported; the reads,s_movrels_*, are done. They are the form LLVM uses to write a uniform array element at a run-time index. A probe of several hundred RDNA2 forms through the translator showed these as the ALU forms left that no open PR or claim covers.s_movreld_b32:SGPR[D + M0] = S0(SGPR, inline constant or literal source);s_movreld_b64: the pair atD + M0, both halves read first;s_movrelsd_2_b32:SGPR[D + M0[25:16]] = SGPR[S0 + M0[9:0]], other M0 bits ignored. SCC and M0 are not written.%sgprarray (index wraps to the 128 slots, ass_movrels). Because the target is known only at run time, the translator drops every translate-time belief about SGPR contents (sgpr_imm, descriptor lookups, value tokens). It refuses (Unsupported) when an SGPR holds a lane mask at that point, since the store could land on it. A wave64 graphics shader that uses the ops is tier C (unmodelled-op) inwave64_halves.py.tools/int_hw_probe.pygets asalu_movreldgroup (7 cases: M0 = 0, 2, 3, the literal source, the b64 pair,movrelsd_2with M0[25:16] and M0[9:0], and with the ignored M0 bits set, SCC 0 and 1). On the Radeon (gfx1036, wave32 and wave64) the hardware gives the ISA text's values and--oracle bothshows the translator matching on all 7.ps_movreld.asm: a self-checking pixel test (each check is ans_cmp_eq_u32on a register, one bit per check; the header derives the check counts and the four words by hand), registered incheck.pyandrun_gpu_tests.pyand as a semantic fixture, withtests/semantic/test_salu_movreld.py(plain-Python ISA model, the exported SGPRs after each op, an index past 127, the stale-literal case, operand forms that stay refused) and a design.md row.Tested
python -I tools/int_hw_probe.py --oracle both --group salu_movreldon AMD Radeon (gfx1036): 7 cases, 7 match, 0 divergence, 0 wave32/64 diff.run_gpu_tests.py --filter ps_movreld: 4096/4096 pixels exact on NVIDIA GeForce RTX 5080 (driver 616.92) and AMD Radeon RDNA2 iGPU (driver 26.10.1); device line confirmed for both. On main the shader does not translate.ps_movreldfail on both GPUs (got 0x402e7e79, 0x400c8861, 0x4fffffff, 0x40000006) and five semantic tests; not clearingsgpr_immfailstest_literal_knowledge_is_dropped(v_lshlrev_b32 shifts by the stale 4 instead of 8).python -m unittest discover -s tests/semantic,regen_fixtures.py --check,tests/test_shader_checks.py,pytest tests/test_wave64_halves_fixtures.py tests/test_int_hw_probe.py: OK.tests/test_docs_design_rows.pyfails the same way on main (duplicate rows already there).Checklist
docs/design.md, with how it was confirmed.AI-assisted.