mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #1983] rdna2spirv: preserve %vcc_hi on plain-data s_mov_b64 from vcc and support null operands (SHADER-MOV64-VCC-DATA-AND-NULL) #1990
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1990
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1983
Author: @ShotTechOp
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/mov64-vcc-data-and-null📝 Commits (1)
8ad6efcrdna2spirv: fix plain-data VCC source and null operands in Gen.mov64📊 Changes
3 files changed (+173 additions, -4 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
tests/semantic/test_mov64_vcc_data_and_null.py(+158 -0)📝
tools/rdna2spirv.py(+14 -3)📄 Description
Claimed in #1608 as
SHADER-MOV64-VCC-DATA-AND-NULL.What and why
In
Gen.mov64()(tools/rdna2spirv.py),s_mov_b64had two gaps:s_mov_b64 s[D:D+1], vccwhenvccholds plain 64-bit scalar data:mov64()unconditionally duplicated%vccinto both halves (lo = hi = OpLoad %uint %vcc), assumingvccalways held a per-lane mask.vccholds plain 64-bit scalar data (not self.holds_lane_mask(s), e.g. written vias_mov_b32 vcc_lo, ...; s_mov_b32 vcc_hi, ...),s_mov_b64 s[6:7], vccsilently overwrotes7with%vccinstead of%vcc_hi.nullsource / destination rejected:s_mov_b64 s[6:7], nullraisedUnsupported("s_mov_b64 source")instead of writing(0, 0), ands_mov_b64 null, <src>raisedUnsupported("s_mov_b64 destination")instead of validating the source and discarding the write (matchings_not_b64/dst64_data(..., allow_null=True)).Changes
tools/rdna2spirv.py:Gen.mov64(), checkself.holds_lane_mask(s)whensisvcc: keeplo = hi = OpLoad %uint %vccfor lane masks, and load both%vccand%vcc_hiwhenvccholds plain scalar data.nullas a source ((0, 0), also seedingsgpr_immwith0) and as a discard destination (after validating the source operand).docs/design.md:s_mov_b64nulland plain-datavcccontract in theNull mask sourcerow.tests/semantic/test_mov64_vcc_data_and_null.py:s_mov_b64 s[6:7], vccwith plain 64-bit data in both wave64 and FSPX wave32,vcctransitioning from a lane mask to plain data,s_mov_b64 s[6:7], null,s_mov_b64 null, <valid>+ invalid source rejection, and a real lane-maskvcccontrol.Verification
spirv_mini_interp; no GPU, LLVM, or SPIRV-Tools installed locally).python -I tests/semantic/test_mov64_vcc_data_and_null.py -vpython -m unittest discover -s tests/semantic -p test_salu64_bitwise_data.pypython -m unittest discover -s tests/semantic -p test_fspx_wave_size.pypython -m unittest discover -s tests/semantic -p test_salu_b32_lane_masks.pypython -m unittest discover -s tests -p "test_docs_*.py"python -I tests/test_text_write_line_endings.pypython -m compileall -q tools/rdna2spirv.py tests/semantic/test_mov64_vcc_data_and_null.pypython -I scripts/check_no_game_data.py tools/rdna2spirv.py docs/design.md tests/semantic/test_mov64_vcc_data_and_null.pygit diff --checkorigin/main(tools/rdna2spirv.pyatfe15534):tests/semantic/test_mov64_vcc_data_and_null.pyfails onorigin/mainacross all 3 bug tests (s_mov_b64 s[6:7], vccreturns[lo, lo]instead of[lo, hi]across all 12 wave64/wave32/transition subtests, ands_mov_b64 s[6:7], nullraisesUnsupported: s_mov_b64 source), while the lane-mask control passes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.