shader: decode VOPC DPP16 and lower v_cmp quad swaps in the pixel path #3385
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!3385
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3383"
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?
@tedin7 on GitHub · 2026-11-28 17:24 UTC · original
tedin7:upprs-interp→main· +101 −4 · 4 files · 4 commits · draftPart of #870
What this unblocks: pixel shaders that compare a value read through a quad swap (
v_cmp_*_dppwith quad_perm) against the lane's own value, which the disassembler left undecoded and gfx2hlsl refused.What changed:
tools/disasm_rdna2.py: decode VOPC DPP16 (32-bit float/integer compares) with its controls, masks, bound_ctrl, fi and neg/abs modifiers; invalid controls and 64-bit/class forms stay<unsupported DPP16>.tests/rdna2_tools_check.pycovers the new decode.tools/startup/gfx2hlsl.py:dpp_comparelowersv_cmp_*_dpp(VCC result, VGPR src0) with the existing whole-quad-EXEC proof: the swapped src0 goes to the hidden DPP temp register, the plain compare reads it, src1 stays the lane's own register.tests/startup_gfx2hlsl_dpp_quad_swap_check.py: newcmpfixture (three swaps,v_cmp_lt_u32_dpp+v_cndmask_b32) drawn on WARP/hardware against a CPU reference, with mutants (wrong neighbour, no exchange, reversed compare) and dropped-swap rejections. The existingstartup_gfx2hlsl_dpp_quad_swap_*tests carry it.Verification:
python3 -B tests/rdna2_tools_check.py,python3 -B tests/startup_gfx2hlsl_dpp_quad_swap_check.py, and the otherstartup_gfx2hlsl_dpp_*_check.pyscripts: pass.75473295a:x2w_pipe.py win2025 3383 --host aws-1 --keep-release --force --targets offscreen_check --regex '^(startup_gfx2hlsl_dpp_quad_swap|rdna2_tools_check)': dev 4/4 and release 4/4 passed (controls, warp, hardware,rdna2_tools_check).dpp_comparereads src0 without the quad exchange),x2w_pipe.py win2025 3383 --host aws-1 --patch <mutant> --skip-release --regex '^startup_gfx2hlsl_dpp_quad_swap':_controls,_warpand_hardwareall fail (0/3).Draft until an independent peer review and the Win2025 WARP gate pass.
Thanks to @Makto94 for the testing that found this.
AI-assisted; commands listed were executed locally.
@KelboLive on GitHub · 2026-11-28 20:34 UTC · original · approved these changes
LGTM — clean RDNA 2 decode and GFX10 lowering.
Adds
_decode_vopc_dpp16to disasm_rdna2.py for 8-byte VOPC DPP16 instructions (VCC/EXEC results). gfx2hlsl.py gainsdpp_comparemethod for VOPC compare DPP16 with quad swaps: src0 goes through the hidden temp register, src1 stays the lane's own register, result lands in VCC. DPP_COMPARE regex filters matching opcodes. Test fixture covers X/Y/diagonal swaps with mutation coverage. Disassembler test adds DPP16 decode cases.Ready to land.
@KelboLive on GitHub · 2026-11-28 21:57 UTC · original · approved these changes
LGTM — clean RDNA 2 decode and GFX10 lowering.
Adds
_decode_vopc_dpp16to disasm_rdna2.py for 8-byte VOPC DPP16 instructions (VCC/EXEC results). gfx2hlsl.py gainsdpp_comparemethod for VOPC compare DPP16 with quad swaps: src0 goes through the hidden temp register, src1 stays the lane's own register, result lands in VCC. DPP_COMPARE regex filters matching opcodes. Test fixture covers X/Y/diagonal swaps with mutation coverage. Disassembler test adds DPP16 decode cases.Ready to land.
@tedin7 on GitHub · 2026-11-28 21:58 UTC · original
CI fix on the draft:
Assemble and translate gfx1013 fixturesfailed because LLVM's assembler has no DPP variant of VOPC ("dpp variant of this instruction is not supported"), so thecmpfixture could not be reassembled. Pushed4cd15cc38(origin/main merged, no force push): thecmpfixture now reassembles everything except its threev_cmp_lt_u32_dpplines, and those words are checked throughdisasm_rdna2(must decode to exactly the expectedv_cmp_lt_u32_dpp ... quad_permtext). A mutant that shifts the control field invopc_dppfails the decoder cases.Verification:
python3 tests/startup_gfx2hlsl_dpp_quad_swap_check.py binary <llvm-mc>-> PASS.4cd15cc38:x2w_pipe.py win2025 3383 --regex '^(startup_gfx2hlsl_dpp_quad_swap|rdna2_tools_check)'-> 4/4 passed.Staying Draft: @KelboLive the test file changed after your approval of
75473295; could you re-check the head? Then I will mark it Ready.AI-assisted; commands listed were executed locally.
github-bot referenced this pull request2026-11-28 23:15:39 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.