compute: accept VCC as destination and source in s_andn2_wrexec_b64 and s_andn1_wrexec_b64 #3421
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3421"
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 Ammmae0x on 2026-11-29T00:24:14Z.
Refs #3224, #2935
Accept VCC (106) as destination and as S0 source in s_andn2_wrexec_b64 and s_andn1_wrexec_b64 in the direct C++ compute path.
Linux verification (this host cannot run Windows CTest or compile_dxil):
Windows verification (compile_dxil, native CTest) still pending.
Windows Verification (
d4d353d2)Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T04:26:23Z.
Review: APPROVED
Approve
d4d353d2. Reviewed by reading the diff and the cited sources; nothing built or run here.src/gfx1013_direct_compute.inl:3892(same line onmain): the wrexec guard now accepts 106 as destination and as S0. 106 decodes as thevccpair for 64-bit operands (tools/disasm_rdna2.py:81-93), ands_andn1_wrexec_b64/s_andn2_wrexec_b64areEXEC = ~S0 & EXEC/EXEC = S0 & ~EXEC,D = EXEC(docs/experiments/native-saveexec-wrexec.md:26,combine_scalar_mask:3877-3880).pair_high(:243-251) already reads 107 for 106. The odd check still refuses 105/107, and 124, 126 and inline/literal sources are still refused.a(:3806),ah(:3896) and both EXEC words (:3898-3901) are loaded before the writes at:3907-3909. Forvcc, vccthe only overlap is 107, which is read first.transfer()(src/gfx1013_compute_native.cpp:769-776) already clears the destination pair and both EXEC words for*_wrexec_b64, anduses_scc_afterlists both ops (src/gfx1013_direct_compute.inl:2738).main,tests/native_saveexec_wrexec_check.py:295andtests/native_wrexec64_check.py:90asserted the VCC-source refusal. The PR retargets both to a primedm0, which fails the same guard with the same message. No other test asserts that refusal.tests/native_wrexec64_vcc_check.py:133-148check out (for exampleSRC_A & ~EXEC_A = (0x84, 0x80000020)and~SRC_A & EXEC_A = (0x12, 0x8), plus the zero and high-word-only rows). The incoming SCC is primed to the opposite value, and the destination starts as a sentinel except in the in-place rows._controls(compile or message mismatch). Two mutants survive because no case covers them: acceptingexecas the source and acceptingm0as the destination.prpreset filter (CMakePresets.json:51) has none of them, and thedevctest line excludes_hardware$(.github/workflows/windows.yml:498). The evidence is the author's run in the PR body (7/7 at this head, including the 3_hardwaresuites).git merge-treeagainstmain(212d4b5f) is clean.Non-blocking:
m0as destination, for example(64, init + [sop1(ANDN2_WREXEC_B64, M0, 22), END], error)inrefused_programs()(:163). Without it a guard that also exempts 124 fori.dstpasses every test and writes 124/125._controlsonly checks forand i32,xor i32andicmp ne i32(:191).active()(src/gfx1013_direct_compute.inl:148-152) emitsandandicmp nefor every store, and both ops emit thexor, so these checks cannot tell andn1 from andn2; only_hardwarecan. The 5 "reference mutants" (:202-210) mutate the Python reference, not the C++.vcc inplacerows (:139-140) the only register shared by the reads and the writes is 107, andhiis computed from it, so no reordering of the lowering changes their result. They catch a missing write, like thevcc dstrows, and nothing more.s_andn2_wrexec_b64in the narrow wave64 model (:3889, a wave64 request of at most 32 threads), and no VCC case covers it: every new row uses 64 threads. In that modelwrite_ballotstores only the low word of a VCC destination (:235-236), the same limitation SGPR pairs already have (src/gfx1013_compute_native.cpp:1840-1843). One 32-thread VCC row would cover it.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-29T08:26:02Z.
Review: COMMENTED
Reviewed
d4d353d229dd0e38c2b7fb83b7b03596992bd6cb:Running the targeted tests on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) failed in both Debug and Release:
ctest --preset dev -R '^(native_wrexec64|native_saveexec_wrexec)' --parallel 2 --no-tests=error --output-on-failure: 5/6 passed, 1 failed (native_wrexec64_vcc_controls,native_wrexec64_vcc_hardware,native_wrexec64,native_saveexec_wrexec_ir, andnative_saveexec_wrexec_controlspassed;native_saveexec_wrexec_hardwarefailed withAssertionError: ('w32_andn1_z', [(265, '0x69696969', '0xa5'), ...])).ctest --preset release -R '^(native_wrexec64|native_saveexec_wrexec)' --parallel 2 --no-tests=error --output-on-failure: 5/6 passed, 1 failed (same failure innative_saveexec_wrexec_hardware).AI-assisted; commands listed were executed locally.