compute: lower s_andn2_wrexec_b64 for wave64 direct compute #3247
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3247"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T01:43:03Z.
Part of #2935, claimed in #3224 (item 2 of my third comment there). Target branch
main.Change (
src/gfx1013_direct_compute.inl): with the wave64 model from #3006, direct compute lowerss_andn2_wrexec_b64.EXEC = S0 & ~EXECover 64 bits and writes the new mask to EXEC and to the destination pair. SCC is set toEXEC != 0.S0 & ~EXEC) and the destination receiving the new mask matchop_s_andn2_wrexec_b64intools/startup/gfx2hlsl.py, which models it per lane.s_andn1_wrexec_b64stays refused: the repository has only its name and opcode (ISA table, disassembler), with no semantics to check against.Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on
main7364e6a9plus this commit.native_wrexec64_hardwarecovers wave64 requests with 64 and 128 threads, two groups each.s_andn2_wrexec_b64with a source pair whose high word is nonzero.main'scompile_dxil, the new test stops at "unsupported wave64 scalar operation".-R "native_wrexec64|native_wave64|native_salu|native_direct_container".Measured with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests,main7364e6a9against this commit.7364e6a9that bucket holds 8 of the 882: 4 compile, 2 move on ("invalid s_cselect_b64 source" and "unbound numeric SGPR"), and 2 stay.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T03:24:10Z.
Review: COMMENTED
Review of head
d397e49f(the PR's own change is the same as573c3b7c; the new head only merges currentmain).What I checked:
src/gfx1013_direct_compute.inl:s_andn2_wrexec_b64computesS0 & ~EXECover both words, writes that new mask to EXEC (126/127) and to the destination pair, and sets SCC toEXEC != 0. That matches the ISA description of the instruction (the result goes to both EXEC and the destination, unlike SAVEEXEC) andop_s_andn2_wrexec_b64intools/startup/gfx2hlsl.py.compute && wave64; other models keep the old refusal (a SOP1 op that is not SAVEEXEC still hitsunsupported wave64 scalar operation). Only aligned general SGPR pairs are accepted as source and destination, so VCC/EXEC/constants stay refused. The name is also added to the SCC-writer list used byuses_scc_after, next to its SAVEEXEC siblings.native_wrexec64_hardware: real D3D12 readback of per-lane stores under the new EXEC, both destination words and SCC, for 64 and 128 threads, plus the EXEC-to-zero case and three operand refusals. The expected words are written out by hand, not derived from the translator.Commands run:
python3 tests/docs_links_check.pyok,python3 tests/bidi_controls_check.pyok,git diff --check origin/main...HEADclean,python3 -m py_compile tests/native_wrexec64_check.pyok.-R '^native_(wrexec64_hardware|compute_clear|direct_container|descriptor_scc_warp)$': dev 4/4 passed, release 4/4 passed.native_wrexec64_hardwarefails (word 264, got0x80000012, want0x84).native_wrexec64_hardwarefails (word 9, lane stored under the old EXEC).Side note, not caused by this PR:
native_or_saveexec_hardware(wave32s_or_saveexec_b32, #3193) fails on WARP 1.0.22 at the 8-threadallcase, with the same assertion on currentmainwithout this change.No blocking findings. The receipt follows in a separate comment.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T03:24:20Z.
Win2025 WARP receipt for head
d397e49fafter updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
d397e49f459d5270ab8119c91d50b2325cf69915:--preset dev):cmake --build --preset dev --target compile_dxil native_store_replay -- -j 4):3.10s(configure0.00s)ctest --preset dev -R '^native_(wrexec64_hardware|compute_clear|direct_container|descriptor_scc_warp)$' --parallel 5 --no-tests=error --output-on-failure): 4/4 passed (14.45s:native_compute_clear0.31s,native_wrexec64_hardware0.80s,native_descriptor_scc_warp0.82s,native_direct_container13.95s)/O2(--preset release):cmake --build --preset release --target compile_dxil native_store_replay -- -j 4):5.61s(configure0.00s)ctest --preset release -R '^native_(wrexec64_hardware|compute_clear|direct_container|descriptor_scc_warp)$' --parallel 5 --no-tests=error --output-on-failure): 4/4 passed (12.99s:native_compute_clear0.25s,native_wrexec64_hardware0.68s,native_descriptor_scc_warp0.72s,native_direct_container12.52s)sccache: 4/5 hits; wall23.5stested:
d397e49fvia fetch (pull/3247/head, no patch)The new test
native_wrexec64_hardwareran on WARP (not skipped) in both legs.AI-assisted; commands listed were executed locally.