shader: lower the exact SDWA cndmask select #3671
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!3671
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3669"
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?
@lambirou on GitHub · 2026-11-30 22:56 UTC · original
lambirou:shader/cndmask-sdwa→main· +397 −4 · 7 files · 1 commits · closed without mergingProblem
v_cndmask_b32_sdwais stillunobservedfor gfx1013 and gfx1030. Its VOP2 form has an implicitvcc/vcc_lomask and nosrc2; the existing SDWA path only handled the non-SDWA select or refused the form.The open #3607 also contains this form as part of a four-form binary16 patch. Its review requested changes because its lowering emitted
condition ? src0 : src1, the reverse ofVCC ? src1 : src0, and its reference repeated that inversion. This branch isolates the corrected select only.Change
tools/pixel_aot.pylowers exactlyv_cndmask_b32_sdwa vD, src0, src1, vcc[_lo] dst_sel:... dst_unused:... src0_sel:... src1_sel:...using the existingsdwa_sourceandsdwa_desthelpers. The selected src1 field is chosen when the tracked VCC bit is set and the selected src0 field otherwise; destination placement usesUNUSED_PADorUNUSED_PRESERVEover a tracked old destination.This slice refuses
sext(),UNUSED_SEXT, SGPR/literal sources, non-vccmasks, untracked masks,clamp/float modifiers, missing or extra SDWA fields, out-of-range VGPRs, sample read/write overlaps and a non-entry EXEC mask. The scanner accepts the same exact shape.The fixture
draw-sdwa-cndmaskhas four programs and three runtime rows covering everydst_selandsrc0_sel/src1_selfield, PAD/PRESERVE, a plain-v_cndmask_b32_e32tie, signed/high-bit words and distinct high/low halves. Its eleven mutations each mismatch on both adapters;check_sdwa_cndmask_formspins exactly("SDWA", "v_cndmask_b32_sdwa").Coordination
The cndmask portion of #3607 is the same source form. If #3607 is amended with this correction first, this PR is redundant and should be dropped; otherwise #3607 should remove its cndmask portion before merging both.
Verification
dev: passed, 3,546/3,546 Ninja steps.pixel_aot_sdwa_cndmask_hardware: passed, 18.41 s.pixel_aot_sdwa_cndmask_warp: passed, 7.77 s.1414:008c, driver10.0.26100.10068. Hardware: AMD Radeon RX 9060 XT1002:7590, driver32.0.32029.2010, Windows 11 build26300, D3D12 debug layer unavailable, DXC1.8.2502.11.pixel_aot_check.py: passed;form_coverage_check.py:form coverage checks passed;rdna2_tools_check.py: 162 tests OK with 19 LLVM-dependent skips; docs and bidi checks passed.Limits
No console measurement or title run. Only VGPR sources are modeled;
sext()andUNUSED_SEXTare deliberately refused. The fixture measures translated HLSL on WARP and one physical RDNA 4 adapter, not native RDNA 2 behavior.AI-assisted.
@lambirou on GitHub · 2026-11-30 23:10 UTC · original
The corrected cndmask lowering is folded into #3607 at
b7c0c70f: VCC selects src1 and otherwise src0, the reference and plain-e32 tie are fixed, and the VGPR-only/refusals and fixtures are in #3607. #3607 is green on run 46533421137. Closing this standalone duplicate without merging.github-bot referenced this pull request2026-12-01 08:29:38 +00:00
Pull request closed