shader: lower s_cselect_b64 in pixel_aot #625

Merged
lambirou merged 1 commit from upstream-pr/631 into main 2026-11-22 17:23:46 +00:00
lambirou commented 2026-11-22 16:38:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-22T16:38:06Z.


Change

Lower s_cselect_b64 in pixel_aot using the scalar ALU profile from #279. A tracked SCC selects both dwords from the same source and is preserved for subsequent instructions. Both operands are read before updating the aligned numeric SGPR pair, including when the destination aliases a source.

Verification

Tested 0fe68a2 on Windows 11 build 26300. WARP 10.0.26100.10068 and AMD Radeon RX 9060 XT driver 32.0.32029.2010 ran with the D3D12 debug layer unavailable.

ctest --preset dev --no-tests=error -R '^pixel_aot(_.*)?_warp$|^pixel_aot_blend_scalar_hardware$' --output-on-failure --output-junit "$PWD/out/s-cselect-b64-final.xml"
.\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py
.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py
.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py
$llvm = (Resolve-Path 'out/llvm-check/ucrt64/bin').Path
$env:Path = "$llvm;$env:Path"
.\out\pe-env\Scripts\python.exe -B tests/pixel_aot_check.py binary (Join-Path $llvm 'llvm-mc.exe') (Join-Path $llvm 'llvm-objcopy.exe') (Join-Path $llvm 'libLLVM-23.dll')
git diff --check

CTest passed all 12 checks, including 11 WARP tests and the scalar draw on Radeon, with zero skips. The Python checks and LLVM 23.1.5 binary round-trip passed.

Evidence

The source-built MIT fixture reads back four unsigned words. Both dwords of the selected pair reach the first two channels. A following select between 0 and -1 exposes SCC in the other channels. Swapping the first select's inputs produces the expected mismatch for all three inputs on both adapters. Rejection cases exercise untracked SCC, invalid pairs, EXEC operands, and pending scalar loads.

The scoped pixel_aot_blend_scalar measurement adds one SOP2 form, from 139 to 140 of 1,968 in gfx1013 and from 135 to 136 of 1,863 in the gfx1030 reference. Both adapters produced identical coverage records.

Checklist

  • One reviewable behavior.
  • Reproduction commands and observed results included.
  • Negative control and operand rejection covered.
  • Experiment documentation updated.
  • Source-built inputs only.

AI-assisted implementation and test preparation. The reported checks were run locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6544916769 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/631). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-22T16:38:06Z. --- ## Change Lower `s_cselect_b64` in `pixel_aot` using the scalar ALU profile from #279. A tracked SCC selects both dwords from the same source and is preserved for subsequent instructions. Both operands are read before updating the aligned numeric SGPR pair, including when the destination aliases a source. ## Verification Tested `0fe68a2` on Windows 11 build 26300. WARP `10.0.26100.10068` and AMD Radeon RX 9060 XT driver `32.0.32029.2010` ran with the D3D12 debug layer unavailable. ```powershell ctest --preset dev --no-tests=error -R '^pixel_aot(_.*)?_warp$|^pixel_aot_blend_scalar_hardware$' --output-on-failure --output-junit "$PWD/out/s-cselect-b64-final.xml" .\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py $llvm = (Resolve-Path 'out/llvm-check/ucrt64/bin').Path $env:Path = "$llvm;$env:Path" .\out\pe-env\Scripts\python.exe -B tests/pixel_aot_check.py binary (Join-Path $llvm 'llvm-mc.exe') (Join-Path $llvm 'llvm-objcopy.exe') (Join-Path $llvm 'libLLVM-23.dll') git diff --check ``` CTest passed all 12 checks, including 11 WARP tests and the scalar draw on Radeon, with zero skips. The Python checks and LLVM 23.1.5 binary round-trip passed. ## Evidence The source-built MIT fixture reads back four unsigned words. Both dwords of the selected pair reach the first two channels. A following select between `0` and `-1` exposes SCC in the other channels. Swapping the first select's inputs produces the expected mismatch for all three inputs on both adapters. Rejection cases exercise untracked SCC, invalid pairs, EXEC operands, and pending scalar loads. The scoped `pixel_aot_blend_scalar` measurement adds one SOP2 form, from 139 to 140 of 1,968 in gfx1013 and from 135 to 136 of 1,863 in the gfx1030 reference. Both adapters produced identical coverage records. ## Checklist - [x] One reviewable behavior. - [x] Reproduction commands and observed results included. - [x] Negative control and operand rejection covered. - [x] Experiment documentation updated. - [x] Source-built inputs only. AI-assisted implementation and test preparation. The reported checks were run locally.
upstream-sync closed this pull request 2026-11-24 06:44:03 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!625
No description provided.