compute: accept VCC destination and VCC/EXEC sources in s_quadmask_b64 #3408
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!3408
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3406"
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-28 22:31 UTC · original
Ammmae0x:compute/s-quadmask-b64-vcc-exec→main· +216 −2 · 4 files · 1 commits · merged 2026-11-29 08:42 UTCChange
Accept
VCC(s106) as the destination andVCC(s106) /EXEC(s126)as the 64-bit
S0source ins_quadmask_b64in the direct C++ compute path(
src/gfx1013_direct_compute.inl), so the standard 64-lane quadmaskoperations
s_quadmask_b64 sD, exec,s_quadmask_b64 vcc, execands_quadmask_b64 sD, vccno longer refuse.(i.dst & 1) || (i.dst > 104 && i.dst != 106)—VCCaccepted alongside aligned SGPR pairs;
EXEC(126),M0(124) andodd SGPRs still refused with
invalid s_quadmask_b64 destination.s0_pairnow also acceptss0 == 106 || s0 == 126; thehandler already reads
lo = operand32(i, s0)andhi = operand32(i, s0 + 1)before writing
i.dst/i.dst + 1, so in-places_quadmask_b64 vcc, vccis safe with no restructuring.
SCC = (out_lo != 0)is unchanged. OddSGPRs (
23) andM0(124) still refused withinvalid s_quadmask_b64 source.Refs #3226, #2935
Verification
Commit under test:
d578e06ed5851677ad688f0718d208dd192e81c6(
compute: accept VCC destination and VCC/EXEC sources in s_quadmask_b64),branch
compute/s-quadmask-b64-vcc-execfromorigin/main0614f68c.Linux (this host cannot run Windows CTest,
compile_dxilor DXC):/tmp/qm_harness.py, not in the repo): decodes everycase program with
tools/disasm_rdna2.pyand cross-checks the referenceagainst an independent per-lane brute-force quadmask:
harness OK: 12 cases x wave32/wave64, references, encodings, SCC priming and s0_pair guard all match(run on copies in
/tmp, never in the worktree): M1 all-bits reference,M2 dropped EXEC restore, M3 plane 1 storing
dstinstead ofdst + 1,M4 SCC primed to the expected value, M5 C++ guard dropping
s0 == 106 || s0 == 126— 5/5 killed. Note: M3 survived the first harness version,which checked store offsets but not which register each store reads; the
harness was strengthened to verify the vmove-to-store mapping, and M3 is
now killed.
/tmp/pe-env/bin/python -B tests/form_coverage_check.py—form coverage checks passed/tmp/pe-env/bin/python -B tests/docs_links_check.py—Checked 160 Markdown files and 682 links./tmp/pe-env/bin/python -B tests/bidi_controls_check.py—Checked 2582 tracked source, script and build/CI files: no bidirectional controls.py_compileon both touched test files — pass. The guard expressioncompiles clean under
g++ -std=c++20 -Wall -Wextra(accepts dst 0/104/106and s0 0/104/106/126/125/128/208/255; refuses dst 23/105/124/126/127 and
s0 23/105/124).
Windows verification is still pending (see the
WIN-VERIFYtag below):cmake --build --preset dev --target compile_dxil native_store_replayandctest --preset dev --no-tests=error -R '^(native_s_quadmask_vcc_exec_|native_s_quadmask_)' -V,including
native_s_quadmask_vcc_exec_hardwareon a real adapter (exit 77is a skip, not a pass).
Evidence and follow-up
tests/native_s_quadmask_vcc_exec_check.py(+tests/cmake/native_s_quadmask_vcc_exec.cmake): 12 cases in wave64 plusthe mixed-EXEC and in-place-VCC cases in wave32 — 14 hardware dispatches
total.
EXECsources (zero, low-only, high-only, mixed, all-ones),VCCsources (zero, low-only, high-only, mixed),
VCCas destination fromEXECand in-place fromVCC; each case primes SCC opposite to theexpected
SCC = (out_lo != 0)so the quadmask must write SCC itself, andverifies
dst + 1 == 0. Negative controls refuseEXECas destination,M0as destination/source and odd SGPR23as destination/source, and4 reference mutants (all-bits, ignore-hi, swapped halves, SCC-always-zero)
each differ from the reference.
EXECmay be narrowed by the source pair, so the fixture restoresEXECto all ones before the vector stores (as in the
s_not_b64template); inwave32 this widens
EXEC_HIto all ones, which only enables lanes that donot exist.
tests/native_s_quadmask_check.pyneeded no change: it has noVCC/EXEC refusal for
s_quadmask_b64(only odd dst/src).gfx2hlsltext translator still refusess_quadmask_b64with theseoperands; that is a separate translator, out of this task's scope.
docs/experiments/native-s-quadmask.mddocuments the new destination andsources plus the new test.
Checklist
AI-assisted.
Windows Verification (
d578e06e)26100, MSVC 19.50.35727.0, adapterNVIDIA GeForce RTX 4050 Laptop GPU(driver32.0.15.9186,XBOX2WINDOWS_ADAPTER=NVIDIA), D3D12 debug layer off, commitd578e06ed5851677ad688f0718d208dd192e81c6.cmake --build --preset dev --target compile_dxil native_store_replay-> exit0cmake --build --preset release --target compile_dxil native_store_replay-> exit0ctest --preset dev --no-tests=error -R '^(native_s_quadmask_vcc_exec_|native_s_quadmask_)' --output-on-failure->4/4passed (0skips)ctest --preset release --no-tests=error -R '^(native_s_quadmask_vcc_exec_|native_s_quadmask_)' --output-on-failure->4/4passed (0skips).\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py->form coverage checks passed(exit0).\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py->Self-test passed. Checked 160 Markdown files and 682 links.(exit0).\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py->Self-test passed. Checked 2584 tracked source, script and build/CI files: no bidirectional controls.(exit0)@Leyukaka on GitHub · 2026-11-29 03:48 UTC · original · approved these changes
Reviewed
d578e06eby reading the diff; nothing built or run here. Approve.src/gfx1013_direct_compute.inl:3683: VCC (106) is accepted as thes_quadmask_b64destination.:3686: VCC or EXEC (126) is accepted as the 64-bitS0pair. The high word comes fromoperand32(i, s0 + 1)at:3693(107/127, accepted at:180-184).loandhiare read at:3690-3693, before the writes at:3697-3698, so in-placevcc, vccis safe. EXEC as destination,m0and odd registers stay refused. The handler body is otherwise unchanged (tools/disasm_rdna2.py:210,docs/experiments.md:8310).main(212d4b5f) the only tests asserting these two refusal messages are the odd dst/src cases attests/native_s_quadmask_check.py:100-101, still refused. Thegfx2hlslquadmask refusals belong to a separate translator.tests/native_s_quadmask_vcc_exec_check.py:147-155) mutate the Python reference, not the C++. A wrong high word for VCC/EXEC would be caught only by_hardware;_controlschecks compilation and the 5 refusals.prpreset filter (CMakePresets.json:51) has nonative_s_quadmask_*. The non-PR job runs thedevpreset with-E '_hardware$'(.github/workflows/windows.yml:498), so the_hardwareevidence is the author's run reported in the description.ctest -R '^native_s_quadmask_vcc_exec_'line indocs/experiments/native-s-quadmask.mdis redundant;-R '^native_s_quadmask_'already matches the new tests.