shader: cover SOP1 and SOP2 scalar bit-search, bit-count, sign-extension and arithmetic operations #1282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1289"
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 agilesh08 on 2026-11-24T06:54:46Z.
Change
Covers 20 RDNA2 scalar ALU operations across the SOP1 and SOP2 encoding families in static verification controls (
check_controls), disassembler fixtures, and reference form-coverage assertions:s_bcnt0_i32_b32,s_bcnt0_i32_b64,s_bcnt1_i32_b32,s_bcnt1_i32_b64), first-bit search operations (s_ff0_i32_b32,s_ff0_i32_b64,s_ff1_i32_b32,s_ff1_i32_b64), leading-bit search operations (s_flbit_i32,s_flbit_i32_b32,s_flbit_i32_b64,s_flbit_i32_i64), sign-extension operations (s_sext_i32_i8,s_sext_i32_i16), and absolute value (s_abs_i32).s_pack_ll_b32_b16,s_pack_lh_b32_b16,s_pack_hh_b32_b16) and 32-bit high-half multiplications (s_mul_hi_i32,s_mul_hi_u32).Adds negative boundary controls in
tests/pixel_aot_check.pyverifying that invalid register classes (vector destinations), misaligned SGPR pairs (s[45:46]), and unsupported operand configurations raiseValueError. Adds disassembler test vectors fors_flbit_i32(001782be) ands_flbit_i32_i64(001882be) intests/rdna2_tools_check.py. Asserts coverage intests/form_coverage_check.pyagainst bothgfx1013.tsvandrdna2.tsv, and documents the suite with reproduction commands indocs/experiments.md.Verification
Ran all 37 platform-independent checks with Python 3.12:
Observed result:
ALL 37 CHECKS PASSED SUCCESSFULLY!(including 133 tests inrdna2_tools_check.py, 0 link errors across 16 docs, 0 bidirectional controls across 1,072 files).Verified clean merge against
upstream/main(3303f2a1):git merge-tree --write-tree upstream/main HEADexited 0.Whitespace check passed with 0 errors:
git -c core.whitespace=cr-at-eol diff --check upstream/main.Evidence and follow-up
The static controls in
check_controlsexercise synthetic programs lowering each scalar opcode through the pipeline. Negative controls assert that vector destinations, misaligned scalar pairs, and invalid operand shapes are refused.tests/form_coverage_check.pyasserts that without the accepted spellings, none of these forms count toward coverage.This patch expands scalar coverage in
docs/coverage/gfx1013.tsvanddocs/coverage/rdna2.tsv. Full GPU draw verification for these operations is already wired incheck_scalar_bit_count_draw,check_scalar_first_bit_draw,check_scalar_leading_bit_draw,check_sext_draw,check_scalar_pack_draw, andcheck_scalar_mul_hi_draw.Checklist
Assisted by AI.