startup: lower s_cselect_b32 into vcc_lo and exec_lo in gfx2hlsl #2113
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2121"
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 denn0x on 2026-11-25T00:53:44Z.
Part of #1723
In wave32,
vcc_loandexec_lohold the whole lane mask, and the generic scalar path intools/startup/gfx2hlsl.pyalready writes them asvccandexec.s_cselect_b32goes through a separate select path that assumed an SGPR destination, sos_cselect_b32 vcc_lo, -1, 0stopped the translation with aTypeErrorinstead of a lowering or anUnsupportedrefusal.Now:
vcc_loandexec_loget the lane's bit of the selected word; anexec_lowrite clearsexec_known.m0destinations are lowered as before.Unsupportedmessage.New test
tests/startup_gfx2hlsl_cselect_mask_check.py, registered asstartup_gfx2hlsl_cselect_mask_controlsinCMakeLists.txt,AGENTS.mdand the Python job, and described indocs/experiments.md. It decodes synthetic SOP2 words and evaluates the emitted select for both SCC values with the restricted evaluator ofstartup_gfx2hlsl_bit_alu_check.py. Negative control: the select with its& 1removed gives a differentvcc.Verification (branch head
3dc861e2onmain246a875d, Windows 11 Pro 10.0.26300, Python 3.13):python -B tests/startup_gfx2hlsl_cselect_mask_check.py-> exit 0 (cselect mask: vcc_lo and exec_lo are the lane mask; SGPR and m0 unchanged; null refused). Onmainthe same test fails withTypeError: 'NoneType' object is not subscriptable.tests/startup_gfx2hlsl_*_check.py,tests/startup_translator_check.py,tests/docs_links_check.pyandtests/startup_tools_lint_check.py tools/startup-> 33 scripts, all exit 0.git diff --check main..HEAD-> clean.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T01:21:41Z.
I merged main after #2116 and kept both this scalar select fixture and #2122's mask-overwrite fixture in Linux and CTest. The select, mask-overwrite, scalar arity and SOPK checks and docs links all pass together on Windows. The fixture evaluates emitted HLSL; this update does not add a GPU draw.