Repository navigation
Conversation
EXEC = SCC ? S0 : EXEC, S0 read as a lane mask (mask_src), as s_cselect_b64 into EXEC does. 32-bit forms into exec_lo of a wave32, s_cmov_b64 into exec; wave64 exec_lo / exec_hi stay Unsupported (half writes, ItsNotRexed#663). Covers LLVM's init.exec.from.input prologue (s_bfm_b64 exec; s_cmp_eq_u32 n, 64; s_cmov_b64 exec, -1). GPU fixtures cs_w32_cmov_exec / cs_w64_cmov_exec, semantic test CmovIntoExec, design.md row. AI-assisted.
|
Docs: the new Heads-up: #2913 rewrites the same row (it removes the duplicate at line 335), so whichever lands second needs a rebase on that line. Checked: |
|
Tested 62d3981 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.
Build note: the full build fails on AppleClang 17 at vk_pipeline_check.cpp:567 (BUILD-822, fix in open PR #2927); all GPU binaries built, so both runs are valid. Head fetched unchanged into a separate worktree; no rebase/edit/push. Synthetic shaders and counts only; no game files. AI-assisted. |
|
Tested 62d3981 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. The PR's diff applied cleanly to
|
|
Independently tested
Selected each GPU with |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 62d3981 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 Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): No problems found. ctest on the RTX 4080 SUPER: 129/129 passed. Intel UHD 770 ctest: only the two known base failures, d3d12_descriptor (fixed by #2948) and d3d12_subgroup (fixed by #2934). |
|
Tested
The AI-assisted (ZCode agent): builds and runs executed by a coding agent on this machine. |
runtime/test/shaders/check.py scripts/run_gpu_tests.py AI-assisted.
|
Tested I added a
Results:
The merge with my stack conflicts only in the GPU test lists ( |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-SCMOV-EXEC, #2716 (comment)
What and why
s_cmov_b32/s_cmovk_i32intoexec_loands_cmov_b64intoexecraisedUnsupported("destination"). The RDNA2 ISA defines them like any other destination: EXEC = SCC ? S0 : EXEC, with SCC read and not written. LLVM emitss_cmov_b64 exec, -1in thellvm.amdgcn.init.exec.from.inputprologue (s_bfm_b64 exec, n, 0; s_cmp_eq_u32 n, 64; s_cmov_b64 exec, -1).Change (
tools/rdna2spirv.py): an EXEC destination of these ops reads S0 throughGen.mask_src. A constant or a data SGPR gives lane L its bit L. In the 64-bit form, an inline constant is sign-extended and lanes 32-63 read the high SGPR of a pair. A v_cmp mask is used unchanged. The result is selected against this lane's active bit, the same ways_cselect_b64into EXEC already works.exec_loof a wave32, ands_cmov_b64intoexec.Unsupported:exec_loof a wave64 andexec_hi, which would be half writes (Translator: wave64 32-bit ops on one half of EXEC/VCC (FUZZ-8) #663 covers those);s_cmov_b64into VCC or a lane-mask SGPR pair.tests/semantic/test_salu_cmov_b64.pyno longer listsexecamong the rejected destinations.New contract row in
docs/design.md.Tested
Windows 11, LLVM
llvm-mc,VK_LOADER_LAYERS_DISABLE=~implicit~, one GPU at a time,python -I scripts/run_gpu_tests.py --filter cmov_exec:cs_w32_cmov_execcs_w64_cmov_exec32 8 1032 19 2056 6 258 440 64 8 5419 2056 1084 64 8194LEONIDA_W64_EMULATE=1, same words (SKIP without, no 64-wide subgroup)runtime/test/shaders/cs_w32_cmov_exec.asmandcs_w64_cmov_exec.asm, 8 cases each. Each header gives the expected words, derived by hand from the ISA. The wave64 file includes both outcomes of the init-exec prologue: n = 40 keeps lanes 0-39, and n = 64 wrapss_bfm_b64to no lanes, so the cmov turns all 64 on.check.py,run_gpu_tests.pyandregen_fixtures.py.CmovIntoExecintest_value_semantics.pyruns every lane and checks the words against a plain-Python model of the masks.CmovIntoExecerrors onmainwithUnsupported: s_cmov_b32 destinationandUnsupported: s_cmov_b64 destination.OpSelectoperands (EXEC = SCC ? EXEC : S0).CmovIntoExecfails, and on the Radeon both GPU tests fail (8 32 32 32 3 1032 4294967040 1032and64 4294967040 8 4 64 4294967040 4294967040 16). Then I reverted it.python -m unittest discover -s tests/semantic,python tests/semantic/regen_fixtures.py --check(clean),python -I tests/test_shader_checks.py, andpytest tests/test_docs_design_rows.py tests/test_run_gpu_tests.py.AI-assisted.
Checklist
docs/design.md, with how it was confirmed.