shader: lower gfx1013 s_bfm_b32 in pixel_aot #595
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/601"
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-22T15:08:43Z.
Change
tools/pixel_aot.pynow lowerss_bfm_b32through theSCALARtable:((1u << (S0 & 31u)) - 1u) << (S1 & 31u), with no SCC write.s_bfm_b64was already lowered (SALU_HELPERS["s_bfm_b64"]); this follows its count-mask convention (& 63uthere). The scanner picks the form up from the table.S_BFM_B32for(shl (add (shl 1, a), -1), b)(SIInstructions.td,BFMPatterns). The 5-/6-bit count masking is the usual SOP2 convention and an assumption. I could not check it against the RDNA 2 ISA PDF, anddocs/experiments.mdsays so.s_bfm_b32 s70, 4, 8moves from the rejected to the supported list, ands_bfm_b32leavesrejected_formsintests/form_coverage_check.py. Five new rejections are added: VGPR source or destination, pair destination,s106, wrong operand count, and reads of pending scalar loads.Fixes #596. AI-assisted (Claude Code).
Verification
Windows 11 (10.0.26200.9974), NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP 10.0.26100.9818, head on
c8a3fd9.s_cselect_b32keeps selecting on the earlier compare, which shows SCC is unchanged. This is checked statically only, and the docs say so.check_bfm_drawin theblend-scalarmode. Channels: twos_bfm_b32results, pluss_bfm_b64lo/hi. Five word sets cover counts 0, 1, 31, 32, 33, 63 and 64, plus wrapping offsets. Generated-HLSL controls narrow the count mask to 4 bits, or swap count and offset; each givespixel_mismatch. Removing the mask entirely is not observable on the GPU, because DXIL masks shift amounts itself; the static check catches that case.ctest --preset dev --no-tests=error -R "^(pixel_aot_|rdna2_tools_check$|pso_readiness)"passed 22/22.pixel_aot_blend_scalar_hardwaretook 36.7 s (timeout 60 s).ctest --preset dev --no-tests=errorpassed 278/278, with skipsbvh_wave64_hardware,bvh_wave64_warpandwave_shuffle_warp.tests/pixel_aot_check.py binarywith LLVM 15.0.7 exited 0, run locally (fixturebfm_scalar_ops). The controls,form_coverage_check.py,docs_links_check.pyandrdna2_tools_check.pypass.Evidence and follow-up
blend-scalarmode (34.7 s on its own branch). If both land,pixel_aot_blend_scalar_hardwareon this RTX 3080 may get close to the 45 s budget the suite keeps under its 60 s timeout. Splitting one of them into its own mode would be the fix. I can do that in whichever PR lands second.🤖 Generated with Claude Code