shader: lower a forward s_cbranch_scc0/scc1 skip over vector ALU in pixel_aot #1433
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1440"
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 MasterDomino on 2026-11-24T11:33:24Z.
Refs #1413 (stage 1)
pixel_aotnow lowers one forwards_cbranch_scc0/s_cbranch_scc1on a tracked scalar compare that skips a block of per-lane vector ALU. This follows the scope R0Y00 approved on #1413.Behaviour (
tools/pixel_aot.py)scc<N>froms_cmp_*ors_bitcmp*. An SCC that comes from an ALU result (s_and_b32,s_add_u32, …) or is untracked rejects withUniform branch requires a tracked scalar compare.(offset, text)input. Plain strings, a backward or self target, and a target outside the program reject.REGION_ALU) ands_nop. Memory, sampling, exports, waits, EXEC writes, scalar and wave updates, nested branches and regions reject withInstruction cannot run in a uniform skip block. A branch inside a masked region is refused by the region gate. Wave64 entry mask only.sccfors_cbranch_scc0,!sccfors_cbranch_scc1. This reuses the masked-regionclose_regionmerge and definedness: a VGPR first written in the block is undefined afterwards, including at the target, until an unconditional write defines it.Tests
check_scc_skip_controls(runs intests/pixel_aot_check.pywith no arguments):s_bitcmp1_b32accepted;-1,-3and400refused;image_sample,s_buffer_load_dword,s_mov_b32,s_cmp, an EXEC copy,s_and_saveexec_b64,s_waitcnt,exp,v_readfirstlane_b32;s_cbranch_scc1refused, and the branch inside a masked region refused;check_scc_skip_draw, new modedraw-scc-skip, new CTestspixel_aot_scc_skip_{warp,hardware}:s_cmp_eq_u32 s47, 0+s_cbranch_scc1, ands_cmp_lg_u32 s47, 0+s_cbranch_scc0.v_mul_f32 v15, 0.5, v14after the target reads the merged v14.tests/form_coverage_check.py:s_cbranch_scc0/scc1move from the must-stay-rejected list to an asserted covered set. That list existed because nothing accepted them before.Results
Rebased on
92bd3362. Windows 11 26H2 (build 26300.9974),devpreset, DXC 1.8.2502.11, Python 3.13.1, LLVM 15.0.7.All 37 pure-Python checks listed in
AGENTS.mdpass.Negative control: with
tools/pixel_aot.pyrestored to main,check_scc_skip_controlsfails withUnsupported instruction 21: s_cbranch_scc1 2.Not measured
The shape counts on #1413 are layout only: 27,361 skip branches in 8,423 records. The scan's translator verdict still stops at unbound operands under the scanned inputs (#1314), so the number of records this unblocks is not measured. The draws pin the translator's model on desktop adapters; they are not evidence for gfx1013 hardware.
AI-assisted.
🤖 Generated with Claude Code