mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #1990] rdna2spirv: keep plain-data VCC sources on the 64-bit data path in is_mask_op and src64_data (SHADER-SALU64-VCC-DATA-SRC) #1997
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#1997
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/1990
Author: @ShotTechOp
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/salu64-vcc-data-src📝 Commits (1)
74031f0rdna2spirv: keep plain-data VCC sources on the 64-bit data path📊 Changes
3 files changed (+264 additions, -4 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
tests/semantic/test_salu64_vcc_data_src.py(+257 -0)📝
tools/rdna2spirv.py(+6 -3)📄 Description
Claimed in #1608 as
SHADER-SALU64-VCC-DATA-SRC.What and why
Gen.is_mask_opintools/rdna2spirv.pypreviously returnedTrueunconditionally whenever an operand wasvcc,vcc_lo, orvcc_hi, even whenlane_masks.pyprovedvccholds plain scalar data (for example afters_mov_b32 vcc_lo, .../s_mov_b32 vcc_hi, ...).Gen.holds_lane_maskalready returnsTrueunconditionally forexec/exec_lo/exec_hiand returnsTrueforvcc/vcc_lo/vcc_hionly whenvccactually holds a lane mask ("vcc" in self.cur_masks).vccbranch inis_mask_op:s_not_b64,s_{and,or,xor,andn2,orn2,nand,nor,xnor}_b64, ands_cselect_b64with a plain-datavccsource took the per-lane mask path, dropping%vcc_hiand the high dword of the paired SGPR, duplicating the low 32-bit word into both destination dwords, and votingSCCacross the wave instead of testing(D.lo | D.hi) != 0.s_cmov_b64,s_quadmask_b32/s_quadmask_b64, ands_bitreplicate_b64_b32falsely rejected plain-datavcc/vcc_looperands as lane masks.Gen.src64_dataalso rejected plain-datavccoperands withUnsupported("<op> source"). Adding anot self.holds_lane_mask(s)branch to load(%vcc, %vcc_hi)fixes allsrc64_dataconsumers while keeping lane-maskvccsources rejected asUnsupported.64-bit scalar bitwise opscontract row indocs/design.md.Testing
tests/semantic/test_salu64_vcc_data_src.py— covers all 9 64-bit bitwise ops in both operand orders (s_and_b64..s_xnor_b64,s_not_b64) with high-word-only non-zero SCC checks,s_cselect_b64,s_cmov_b64,s_quadmask_b64,s_bitreplicate_b64_b32, mask-to-data VCC overwrite, and lane-mask VCC preservation/rejection controls.origin/main(fe15534):tests/semantic/test_salu64_vcc_data_src.pyfails onorigin/main(proving both silent miscompilation of the high dword / SCC in the bitwise +s_cselect_b64ops and falseUnsupportederrors ins_cmov_b64/s_quadmask_b64/s_bitreplicate_b64_b32).python -I tests/semantic/test_salu64_vcc_data_src.py -vpython -m unittest discover -s tests/semantic -p test_salu64_bitwise_data.pypython -m unittest discover -s tests/semantic -p test_scselect_b64_data.pypython -m unittest discover -s tests/semantic -p test_salu_cmov_b64.pypython -m unittest discover -s tests/semantic -p test_salu_quadmask_bitreplicate.pypython -m unittest discover -s tests/semantic -p test_lane_mask_bitreplicate_flbit.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_salu64_vcc_data_src.pypython -I scripts/check_no_game_data.py tools/rdna2spirv.py docs/design.md tests/semantic/test_salu64_vcc_data_src.py🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.