Repository navigation
rdna2spirv: a scalar instruction cannot name a VGPR (62 of 143 SALU ops took v8 as destination) - #9408
rdna2spirv: a scalar instruction cannot name a VGPR (62 of 143 SALU ops took v8 as destination)#9408Vonsek wants to merge 3 commits into
Conversation
…OP2/SOPK ops took v8 as the destination)
…urce; VGPR pairs, SMEM and branches too
…GPR, with the corpus count
|
Tested 47a9eb8 on Linux x86_64 (WSL2), Python 3.14, no GPU: pass. Ran test_salu_no_vgpr (4 OK; 7 failures on main's rdna2spirv.py), the full semantic suite (448 files, 5961 tests; only the two known failures test_image_atomics_guard and test_image_store_d16), test_docs_repo_paths, compileall and check_no_game_data. Not checked: the 26,503-listing corpus count, spirv-val, GPU. AI-assisted (Claude Code). |
|
Windows check of The file I did not run the rest of |
|
Tested
AI-assisted (Claude Code). |
|
Tested
Pass. AI-assisted (Claude Code). |
EGEN-SALU-DST-CHECK (Vonsek2), claim. Scalar twin of #9190 (independent: neither needs the other).
What and why
The scalar ALU and the scalar memory unit read and write SGPRs, constants and special registers only. No SOP1, SOP2, SOPK, SOPC, SOPP or SMEM operand is a VGPR, so
s_add_u32 v8, s1, s2ands_mov_b32 s8, v1cannot be encoded.Gen._insnaccepted a VGPR destination on 62 of the 143 SOP1/SOP2/SOPK ops inrdna2_isa_tablesand wrote the result into the vector register file. It now raisesUnsupportedfor anys_*instruction with a VGPR operand, in one place at the top of_insn. The check sits after the no-op handling, sos_waitcnt vmcnt(0)(a counter, not a register) is unaffected.Commits
tests/semantic/test_salu_no_vgpr.py.docs/design.mdcontract row, since a new translator rule needs one, with the corpus count.Test
python -I -m unittest discover -s tests/semantic -p test_salu_no_vgpr.py(4 tests, 0.05 s):main867d922: 7 failures (the destination and source sweeps list the ops that were not refused; the pair/SMEM/branch lines are accepted);op v8, s1, s2andop s8, v1, s2/op s8, s1, v2to a freshGen, requiresUnsupportedmentioning VGPR, and checks that SGPR forms (s_mov_b32 s8, s1,s_mov_b64 s[8:9], s[2:3], a literal operand) still translate.Whole
tests/semanticthroughscripts/run_semantic_tests.py: the only failures aretest_image_atomics_guardandtest_image_store_d16, which fail on unmodifiedmaintoo (stale after #4473 and #6805; #7284, #7608 and #7916 fix them).Corpus, my own 1.0.2.1 copy, counts only: none of the 13,547,471 scalar instructions in the 26,503 listings names a VGPR in any operand, and
--shard 11/64(414 listings) translates and passesspirv-val414 of 414.python -I tests/test_docs_repo_paths.py: OK.tests/test_docs_design_rows.pyfails onmainalready (repeated rows indocs/README.md), not on the new row. No GPU needed.Notes
SDSTas first operand for the SOPK compares (s_cmpk_*); they are covered by the same rule.AI-assisted.