mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1647] [MERGED] rdna2spirv: translate v_cmpx in DPP form (SHADER-VOPCX-DPP) #1660
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1660
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1647
Author: @OreoFR
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:shader-vopcx-dpp📝 Commits (4)
c5f1807rdna2spirv: translate v_cmpx in DPP form (SHADER-VOPCX-DPP)d7f26f5wave64_halves, rdna2spirv: a DPP v_cmpx is an EXEC write, and the restore pass recovers it (SHADER-VOPCX-DPP review)c2771d4rdna2spirv, docs: the DPP compare refusal cites the RDNA3 measurement of unwritten lanes (SHADER-VOPCX-DPP review)0df3712tests: the v_cmpx DPP recovery test calls restore_vcc_tuples, main's name for the pass (SHADER-VOPCX-DPP)📊 Changes
10 files changed (+218 additions, -51 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
runtime/test/shaders/check.py(+3 -1)➕
runtime/test/shaders/cs_dpp_cmpx.asm(+24 -0)📝
scripts/run_gpu_tests.py(+3 -2)➕
tests/semantic/fixtures/disasm/cs_dpp_cmpx.s(+15 -0)📝
tests/semantic/test_dpp_compare.py(+120 -32)📝
tests/semantic/test_library_compute_forms.py(+10 -0)📝
tests/semantic/test_wave64_halves.py(+20 -0)📝
tools/rdna2spirv.py(+14 -13)📝
tools/wave64_halves.py(+8 -2)📄 Description
Claimed in the coordination issue as: SHADER-VOPCX-DPP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155122672)
Depends on: #1375
#1375 makes
tests/test_translate.pytake the newcs_dpp_cmpx.asmas text, as it doescs_dpp_cmp.asmfrom #957: without it, both stop at llvm-mc's "dpp variant of this instruction is not supported".What and why
Gen.dpp_insnrefused everyv_cmpxin DPP form (DPP on v_cmpx,tools/rdna2spirv.py). In the #1592 census of the pipeline library's graphics programs, that refusal accounts for 78 of the 344 programs that don't translate, all pixel shaders. Rain156 listed it as one of the remaining causes in #1608.This extends #957's DPP VOPC compare to
v_cmpx. The lane selection is the same, and the result goes to EXEC as for a plainv_cmpx: a lane that was off stays off.v_cmpxprints no destination, so its src0 is the first operand. The same forms as forv_cmpare taken, those where every lane writes its bit:row_maskandbank_mask0xF, plusbound_ctrl:1or DPP8. Any other form is still refused withDPP compare with lanes that keep their mask bit. The disassemblers already print the form (tools/shader_disasm.pywith_vopc_dpp,tools/rdna2_decode.py), so the change is in the translator only.All 113 instructions in those 78 programs have the same form:
v_cmpx_gt_f32_dpp vN, -vM quad_perm:[2,3,0,1] row_mask:0xf bank_mask:0xf bound_ctrl:1 fi:1. That compares against the lane two above or below in the quad, with src1 negated.tools/rdna2spirv.py: the src0 index follows the compare kind. Nothing else indpp_insnchanges.docs/design.md: the "DPP on a VOPC compare" row coversv_cmpx, with the count and the GPU check.tests/semantic/test_dpp_compare.py:v_cmpx_gt_f32,v_cmpx_lt_u32andv_cmpx_eq_u32over the written forms and the game's form, with a lane off and with src1 negated;fa 02 28 7c 01 4e 4c ff).runtime/test/shaders/cs_dpp_cmpx.asm, with its translator fixture: a GPU test of the game's form, with and without the negated src1.Tested
--wave64-emulate, listings from llvm-mc 23.1.6; with llvm-mc 21 far more programs stop earlier at undecodable words, and quartz-heron-58 measured 14 new programs there), translated again with this branch. Before: 0 translated. After: 78 translated, 78 pass spirv-val. The other 266 are refused as before:v_interp_p2_f16242,s_getpc_b6418 (#1632), no shader container 6. The 18,493 programs that already translated contain nov_cmpxin DPP form, since it was refused, so their output is unchanged.python -I scripts/run_gpu_tests.py --filter cs_dpp: 10/11 pass withcs_dpp_cmpx=1 1 0 0 3 3 2 2(cs_dpp_w64skipped: no 64-wide subgroup). WithLEONIDA_W64_EMULATE=1, 11/11 pass.tests/semantic/test_dpp_compare.py: 13 tests pass, including thellvm-mclisting test (LLVM 23).regen_fixtures.py --checkis clean.scripts/run_semantic_tests.py tests/semantic: 487 files, 6,283 tests, 0 failed.GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 591.59 (32.0.15.9159), Windows 11
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.