shader: accept the gfx10 SOPK waitcnt forms with null in pixel_aot #777
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!777
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/777/head"
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?
@JB2WIN on GitHub · 2026-11-23 02:22 UTC · original
JB2WIN:shader/sopk-waitcnt→main· +147 −2 · 6 files · 1 commits · merged 2026-11-23 03:00 UTCChange
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
@JB2WIN on GitHub · 2026-11-23 02:36 UTC · original
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.