shader: accept the gfx10 SOPK waitcnt forms with null in pixel_aot #771
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/777"
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 JB2WIN on 2026-11-23T02:22:28Z.
Change
tools/pixel_aot.pynow accepts the gfx10 SOPK wait forms when the SGPR operand isnull.s_waitcnt_vmcnt null, Kvmcnt(K)token ofs_waitcnt: the existing token code runs unchanged.s_waitcnt_lgkmcnt null, Klgkmcnt(K)token.s_waitcnt_vscnt null, Kpixel_aotlowers no vector memory stores, so nothing is outstanding on the store counter.null:nullreads as 0, so the count is the immediate. A real SGPR operand is refused ("only null is modelled") because its runtime value is not tracked.Kmust be 0..63, the gfx10 six-bit counter field. LLVM 15 also assembles larger simm16 values such as0xffff, andpixel_aotrefuses them.s_waitcntforms.s_waitcnt_vmcnt null, 0x0is[0x00,0x00,0x7d,0xbc],s_waitcnt_lgkmcnt null, 0x0is[0x00,0x00,0x7d,0xbd]ands_waitcnt_vscnt null, 0x0is[0x00,0x00,0xfd,0xbb].nullforms withK0..63 are supported. The SGPR form stays unsupported.AI-assisted (Claude Code).
Verification
Environment: Windows 11 10.0.26200.9974, NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP 10.0.26100.9818. Head is rebased on
761e323.s_waitcnt vmcnt(0)withs_waitcnt_vmcnt null, 0x0in a sampled program lowers to byte-identical HLSL.s_waitcnt lgkmcnt(0)withs_waitcnt_lgkmcnt null, 0x0in a scalar-load program.null, 0x1with two outstanding samples behaves likevmcnt(1).s_waitcnt_vscnt null, 0x0can be inserted at any position before the export. The HLSL is identical once temporaries are renumbered by first appearance, and byte-identical directly before the export.0x40,0xffff, a missing operand, and the forms after the export.Unsupported instruction 16: s_waitcnt_vmcnt null, 0x0.ctest --preset dev --no-tests=error: 338/338 passed. Skipped:bvh_wave64_hardware,bvh_wave64_warpandwave_shuffle_warp.tests/pixel_aot_check.py binarywith LLVM 15.0.7 exits 0, including a fixture with all three forms.llvm-mcruns locally through aclang -cc1asshim.form_coverage_check.py(three SOPK forms covered,s_waitcnt_depctrands_waitcnt_expcntnot),rdna2_tools_check.py,pso_readiness_check.pyanddocs_links_check.pypass.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-23T02:36:54Z.
Source note on the
null-only scope: LLVM 15.0.7SIInsertWaitcnts.cppcreates these instructions only withSGPR_NULL(L1296-L1297, L1812-L1813), and it asserts that operand for an existingS_WAITCNT_VSCNT(L866).SOPInstructions.td(SOPK_WAITCNT, L933-944) types the operand asSReg_32:$sdst, s16imm:$simm16but does not define how a non-null SGPR combines with the count. That is why this PR refuses the SGPR form.