compute: accept VCC and EXEC as sources in s_cmov_b64 #3421
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3421
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3419"
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?
@Ammmae0x on GitHub · 2026-11-29 00:13 UTC · original
Ammmae0x:compute/salu-cmov64-vcc-exec→main· +252 −7 · 5 files · 1 commits · merged 2026-11-29 08:27 UTCAccept
VCC(106) andEXEC(126) as 64-bitS0sources ins_cmov_b64in the direct C++ compute path.Refs #3226, #2935
src/gfx1013_direct_compute.inl: thes_cmov_b64source guard now acceptss0 == 106 || s0 == 126alongside aligned SGPR pairs and integer/literal constants.M0(124), odd SGPRs, float inline constants, andEXEC(126) as a destination are still refused withinvalid s_cmov_b64 source/invalid s_cmov_b64 destination.old_lo/old_hiandnew_lo/new_hiare all read before either destination word is written, so in-places_cmov_b64 vcc, vccands_cmov_b64 vcc, execstay overlap-safe (pair_highalready handles106/126).tests/native_salu_cmov_check.py: the obsoleteVCC-source refusal was replaced with anM0-source refusal (thes0guard runs beforeoperand32, soM0triggersinvalid s_cmov_b64 sourcedirectly); the refusal count is unchanged.tests/native_salu_cmov64_vcc_exec_check.py+tests/cmake/native_salu_cmov64_vcc_exec.cmake: 12 hardware dispatches (wave64SCC=0/1into an SGPR pair and in place intovcc; wave32SCC=0/1into an SGPR pair and in place intovcc), each storing a result plane and a preserved-SCCplane. Controls compile thevcc,exec, and in-placeexec-into-vccforms (checkingselect i1), verify 8 invalid destination/source refusals, and check 5 reference mutants differ.EXECis restored to all ones before the vector readback stores.docs/experiments/native-direct-salu-cmov.md: documents the new sources, the overlap safety, and the new fixture.Linux checks (this host, no Windows/DXC/GPU):
py_compileon both touched Python files: passed.tests/form_coverage_check.py,tests/docs_links_check.py,tests/bidi_controls_check.py: all passed.check_mutants+M0refusal): passed./tmpcopies caught (reference ignoresinverted/swapped/clobber_scc; guard dropsVCC/EXEC);/tmpcopies cleaned up.Windows verification (compile_dxil, native CTest) still pending.
Windows Verification (
c49220b9)@Leyukaka on GitHub · 2026-11-29 04:15 UTC · original · approved these changes
Approve
c49220b9. Reviewed by reading the diff and the cited sources; nothing built or run here.src/gfx1013_direct_compute.inl:3426(same line onmain): thes_cmov_b64source guard now also accepts 106/126. This matches SOP1 decoding intools/disasm_rdna2.py(op0x06,:172; src0 is 64-bit for_b64ops,:2400-2402; 106 =vccand 126 =execas pairs,:81-93).pair_high(:243-251) already reads the high word from 107/127, the same paths_mov_b64uses (:3393). The destination guard is unchanged.old_lo,old_hi,new_loandnew_hi(:3433-3437) are loaded before both writes (:3438-3439). With aligned pairs the only possible overlap iss_cmov_b64 vcc, vcc.main,tests/native_salu_cmov_check.py:137asserts the VCC-source refusal. The PR retargets it tom0, which still fails the same guard with the same message._controlscompile, and acceptingm0, 107 or 127 changes the refusal message, so_controlscatches both. A swapped select, an inverted condition or a duplicated low word survives_controls, which only checks forselect i1; only_hardwarecatches them. The 5 "reference mutants" mutate the Python reference, not the C++.prpreset filter (CMakePresets.json:51) has nonative_salu_*tests, and the dev job excludes_hardware$(.github/workflows/windows.yml:498). The_hardwareevidence is therefore the author's run in the PR body (5/5 at this head).@@ -3423) changes a different hunk of the same file from #3414 (@@ -3563), #3406 (@@ -3639), #3408 (@@ -3680), #3409 (@@ -3700) and #3416 (@@ -3812).git merge-treeagainstmain(212d4b5f) is clean.Non-blocking:
vcc inplacecases (tests/native_salu_cmov64_vcc_exec_check.py:109-110, :119) have the destination and the source in the same register, soSCC=0andSCC=1give the same result. They show thatvcckeeps its two halves, not that the select is right. Theexec inplacecases areexecintovcc, not the same register.vcc-sourceSCC=0case into an SGPR pair (:117isSCC=1only); one more row would cover it.enable_execfor wave32 (:47) setsexec_hito 1 (ZERO + 1), probably meantZERO; harmless here.docs/experiments/native-direct-salu-cmov.md:21is not wrapped like the rest of the file.@tedin7 on GitHub · 2026-11-29 08:27 UTC · original · reviewed
Reviewed
c49220b9c9329ab8d2e48664ed4a5f0630a83add:src/gfx1013_direct_compute.inl: acceptss0 == 106(vcc) ands0 == 126(exec) as 64-bit sources ins_cmov_b64, readingold_lo/old_hiandnew_lo/new_hibefore writingD[0:1]so in-placevcc, vccandvcc, execpreserve original inputs.tests/native_salu_cmov64_vcc_exec_check.py+tests/cmake/native_salu_cmov64_vcc_exec.cmake+tests/native_salu_cmov_check.py: covers wave64 and wave32 dispatches,SCC = 0/1, in-placevcc, vccandvcc, exec, 8 invalid operand refusals, and 5 reference mutants.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
c49220b9c9329ab8d2e48664ed4a5f0630a83add:ctest --preset dev -R '^(native_salu_cmov64_vcc_exec_|native_salu_cmov_)' --parallel 5 --no-tests=error --output-on-failure: 5/5 passed (2.84s)ctest --preset release -R '^(native_salu_cmov64_vcc_exec_|native_salu_cmov_)' --parallel 5 --no-tests=error --output-on-failure: 5/5 passed (2.11s)AI-assisted; commands listed were executed locally.