shader: lower s_brev_b32 in pixel_aot #758
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/764"
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 JB2WIN on 2026-11-23T01:32:05Z.
Change
tools/pixel_aot.pynow lowers SOP1s_brev_b32 sD, S0through theSCALARtable asreversebits(S0), without an SCC write. This follows the documenteds_brev_b64convention ("preserve SCC") and its existingreversebitslowering. The scanner and PSO-readiness checks pick the form up from the table.check_controlslisteds_brev_b32 s62, s44among the neighbouring forms the lowerer does not implement. That form is now supported, so the probe is nows_brev_b32 s62, v12, which is still refused because the source is a VGPR. Positive coverage is in the new tests.s106, pair operands, untracked SGPRs, and reads or writes of pending scalar loads.AI-assisted (Claude Code).
Verification
Environment: Windows 11 10.0.26200.9974, NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP 10.0.26100.9818, with the D3D12 debug layer enabled. Head is rebased on current
main.draw-brev(pixel_aot_brev_{hardware,warp}):s_cmp_eq_u32 s44, s45, thens_brev_b32on a register and on a literal, thens_cselect_b32on that SCC, then a seconds_brev_b32.0,0xffffffff,0x80000000,1,0xaaaaaaaa,0x12345678and0x55555555, with both SCC outcomes. Readback is full width against an independent Python bit loop.reversebitsreplaced by a complement;s_not_b32inserted before the select, which is caught only by the select lane;s_not_b32.NONZEROas the SCC expression, the static SCC check fails.ctest --preset dev --no-tests=error -R "^pixel_aot_brev_": 2/2 passed (4.5 s hardware, 1.6 s WARP)ctest --preset dev --no-tests=error: 333/333 passed, skipsbvh_wave64_hardware,bvh_wave64_warp,wave_shuffle_warp(same as onmain)tests/pixel_aot_check.py binarywith LLVM 15.0.7: exit 0. This ran locally, withllvm-mcthrough aclang -cc1asshim.form_coverage_check.py,rdna2_tools_check.py,pso_readiness_check.pyanddocs_links_check.pypass.s_brev_b64convention and lowering. I could not check against the RDNA 2 ISA PDF.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-23T02:36:19Z.
Semantics source: LLVM 15.0.7
SOPInstructions.tddefinesS_BREV_B32with the pattern(set i32:$sdst, (UniformUnaryFrag<bitreverse> i32:$src0)). It sits outside everylet Defs = [SCC]block, andS_NOT_B32/S_WQM_B32are inside one (L209-219). So LLVM treatss_brev_b32as a bit reverse that does not write SCC, which is what this PR lowers and what the select lane checks.