shader: lower RDNA2 scalar comparison instructions #494
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!494
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/494/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?
@agilesh08 on GitHub · 2026-11-22 07:39 UTC · original
agilesh08:feat/shader-sopc-comparisons→main· +121 −6 · 5 files · 1 commits · merged 2026-11-22 08:11 UTC## Change
Lowers 18 RDNA2 SOPC comparison and bit-test instructions in
tools/pixel_aot.pyacrossgfx1013andgfx1030:s_cmp_eq_i32,s_cmp_lg_i32,s_cmp_gt_i32,s_cmp_ge_i32,s_cmp_lt_i32,s_cmp_le_i32(casting via HLSLasint).s_cmp_eq_u32,s_cmp_lg_u32,s_cmp_gt_u32,s_cmp_ge_u32,s_cmp_lt_u32,s_cmp_le_u32.s_cmp_eq_u64,s_cmp_lg_u64(evaluating both low and high dwords across even-aligned SGPR pairs).s_bitcmp0_b32,s_bitcmp1_b32(masking bysrc1 & 31u).s_bitcmp0_b64,s_bitcmp1_b64(selecting low or high dword via bit 5 and testing bit index).Updates SCC tracking so subsequent
s_cmov_b64selects correctly, rejects out-of-range registers (s106), unaligned pairs (s[65:66]), and unsupported comparison types (s_cmp_gt_u64,s_cmp_eq_i64).Verification
python -B tests/rdna2_tools_check.py: 28 passed on Windows (includingtest_sopc_opcode_table_synthetic_forms).python -B tests/pixel_aot_check.py: passed on Windows (asserts all 18 forms inACCEPTED, verifies generated HLSL expressions, rejects out-of-range registers and unaligned pairs).python -B tests/form_coverage_check.py: passed on Windows (asserts all 18 SOPC forms map into bothdocs/coverage/gfx1013.tsvanddocs/coverage/rdna2.tsv).git -c core.whitespace=cr-at-eol diff --check: 0 errors.dxc.exe; DXBC compilation and D3D12/WARP offscreen readback run in GitHub Actions CI (windows.yml).Evidence and follow-up
Adds unit test
sopc_group()intests/pixel_aot_check.pyandtest_sopc_opcode_table_synthetic_formsintests/rdna2_tools_check.py. No copyrighted assets or external shader binaries are included.Assisted by AI.
Checklist
@R0Y00 on GitHub · 2026-11-22 08:11 UTC · original · approved these changes
Reviewed
13249f8. Independently translated each of the 18 SOPC forms, consumed its SCC with s_cmov_b64, compiled the result with DXC and checked the exported pixels with offscreen_check on WARP. Four constant sets per instruction (72 draws) matched the CPU reference, including signed versus unsigned ordering, a differing high dword and bit indices beyond 31. This measures the new operations separately so a later SCC writer cannot mask an earlier one.