shader: lower gfx1013 SOP1 s_abs_i32, s_cmov_b32 and s_bitset ops in pixel_aot #574
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!574
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/574/head"
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?
@Neoplayer on GitHub · 2026-11-22 13:17 UTC · original
Neoplayer:shader/sop1-scalar-ops→main· +127 −2 · 3 files · 2 commits · merged 2026-11-22 14:30 UTCChange
Lower four 32-bit scalar
SOP1instructions (s_abs_i32,s_cmov_b32,s_bitset0_b32,s_bitset1_b32) intools/pixel_aot.py, keeptools/scan_unsupported_shaders.pysynchronized, and add coverage and controls intests/pixel_aot_check.py.abs_i32toSCALAR((asint({0}) < 0 ? (0u - {0}) : {0}), settingscc = (result != 0u)soINT_MINwraps to0x80000000withscc = 1), and validatesgpr_name(dst)in theSCALARhandler so out-of-range SGPRs (s106+) are rejected cleanly.s_cmov_b32(scc ? src0 : dst, requiring trackedscc, validatingdstandsrc0viascalar_u32(), preservingscc).s_bitset0_b32ands_bitset1_b32(masking bit index& 31u, performing read-modify-write ondstviascalar_u32(), preservingscc)._check_two_exits()intools/pixel_aot.pyand syncSUPPORTED_INSTRUCTIONS_REGEXandKNOWN_RDNA2_BASE_OPCODESintools/scan_unsupported_shaders.py.tests/pixel_aot_check.py:must_rejectplaceholders_abs_i32 s62, s44with genuinely unsupporteds_quadmask_b32 s62, s44ands_bitset0_b64 s[62:63], s44.sop1_scalar_ops(),sop1_scalar_ops_reference(), andcheck_sop1_scalar_ops_draw()(integer_rt=True, wired intocheck_binary()andcheck_blend_and_scalar_draws()), exercising0, negative, positive, andINT_MINinputs fors_abs_i32, register and literal sources fors_cmov_b32,sccpreservation acrosss_cmov_b32/s_bitset*, 5-bit shift masking (35 & 31 == 3), and two draw mutation controls.Verification
Ran on macOS arm64 against Homebrew LLVM 15 (
llvm@1515.0.7):FORM_COVERAGE_RECORD=/tmp/x2w-cov-sop1.txt ./out/pe-env/bin/python -B tests/pixel_aot_check.py binary /opt/homebrew/opt/llvm@15/bin/llvm-mc /opt/homebrew/opt/llvm@15/bin/llvm-objcopy /opt/homebrew/opt/llvm@15/lib/libLLVM-15.dylib && grep -E '^s_(abs_i32|cmov_b32|bitset[01]_b32)$' /tmp/x2w-cov-sop1.txt | sort -us_abs_i32,s_bitset0_b32,s_bitset1_b32,s_cmov_b32) recorded.LLVM_LIB=/opt/homebrew/opt/llvm@15/lib/libLLVM-15.dylib LLVM_MC=/opt/homebrew/opt/llvm@15/bin/llvm-mc LLVM_OBJCOPY=/opt/homebrew/opt/llvm@15/bin/llvm-objcopy ./out/pe-env/bin/python -B tests/rdna2_tools_check.pyRan 41 tests in 0.424s — OK../out/pe-env/bin/python -B tests/bidi_controls_check.pyChecked 551 tracked source, script and build/CI files: no bidirectional controls.git diff --checkCould not run locally on macOS: DXC compilation and D3D12/WARP readback (
pixel_aot_blend_scalar_warp,check_sop1_scalar_ops_draw) require Windows/MSVC/DXC/D3D12; they will run in Windows CI.Evidence and follow-up
gfx1013) assembly lists assembled via LLVM 15llvm-mc.scc(s_and_b64 exec,s_wqm_b64 exec), uninitialized destination SGPRs, pendinglgkmcntreads/writes, unsupported VGPR/64-bit/s106/vcc_looperands, and two draw mutations (s_abs_i32->s_not_b32ands_bitset0_b32->s_bitset1_b32).Checklist
AI-assisted.