shader: lower the scalar s_movrel* moves in pixel_aot #1887
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1894"
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 legacy-code-archaeologist on 2026-11-24T20:26:37Z.
Refs #1882. I built this before the issue had a maintainer reply; if you want the scope narrowed, I'll adjust.
What
tools/pixel_aot.pylowers the five SOP1 relative moves:s_movrels_b32,s_movrels_b64,s_movreld_b32,s_movreld_b64ands_movrelsd_2_b32. LLVM 15 decodes them identically for gfx1013 and gfx1030, for examplebe942e28ass_movrels_b32 s20, s40.m0split of the vector forms.s_movrelsreadsSGPR[src + m0],s_movreldwritesSGPR[dst + m0], ands_movrelsd_2_b32reads withm0[9:0]and writes withm0[25:16]._b64moves a pair, withm0counted in dwords.m0: the move is ans_movfrom or to the indexed SGPR. The tracked value (constant, expression, descriptor or pointer word) and its bit mask carry over.m0with a proven bit mask:s_movreld, each reachable destination keeps its old value unless selected.m0;m0;_b64pair base that could be odd: a static odd offset, or a dynamic mask that allows bit 0.Evidence
SMOVREL_BODY(tests/pixel_aot_check.py) moves cbuffer-indexed words with each form, static and dynamic, and exports weighted sums. On the twoDPP_MOVREL_SETSthese are 60, 67, 805, 193 and 80, 63, 244, 165, from an independent list reference.pixel_mismatchrequired):m0replaced by 0, separately fors_movrels_b32,s_movreld_b32ands_movreld_b64;s_movrelsd_2_b32.s_movrels_b64 s[72:73], s[16:17](m0 = 4) translates exactly like twos_mov_b32.s_movrelsd_2within one bank, a pair shifted inside one bank, and an odd overlapping pair, which is refused.s_movreldwhose source lies in its own destination bank: the generated selects must write the source's old value.s_buffer_loadand itss_waitcnt.Windows 11 Pro 26100.9168, DXC 10.0.26100, debug layer unavailable, commit
cc98d047onb80058f0:Other runs:
ctest --preset dev -E '_hardware$'before the review fixes: 818/818.pixel_aot_smovrel,_swapreland_plain_movreldraws pass;tests/form_coverage_check.pyandtests/rdna2_tools_check.pypass.tools/form_coverage.py --gaps gfx1030no longer lists the five forms.LLVM 15 round trip, run locally afterwards:
tests/pixel_aot_check.py binarypasses with LLVM 15.0.7.llvm-mcis clang 15.0.7's integrated assembler (clang -cc1as), withllvm-objcopyandLLVM-C.dllfrom the same build.SMOVREL_BODYoperand changed to a VGPR (s_movrels_b32 s71, v60), the run fails withinvalid operand for instruction.tests/rdna2_tools_check.pywithLLVM_LIB/LLVM_MC/LLVM_OBJCOPYset: 148 tests OK, 1 skipped.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:32:02Z.
Review: COMMENTED
Review of head
cc98d04713(TIER_D_ISOLATED_SHADER_OPS: CMakeLists.txt, tools/pixel_aot.py, tests/pixel_aot_check.py, docs/experiments.md). No P1, no P2.Commands executed locally (Linux), all rc=0:
Windows Server 2025 (Build 26100, MSVC 14.44, WARP), x2w_pipe win2025 1894 --targets offscreen_check --regex pixel_aot_smovrel:
Mutations of the lowering logic in tools/pixel_aot.py (reverted with git checkout):
Notes: the new scalar relative moves refuse unbounded or non-numeric m0, indices past s105 and pending scalar loads; every source is read before any destination is written. The _b64 m0 units are from the RDNA 2 naming, as the PR body states.
AI-assisted; commands listed were executed locally.