mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:22:51 +01:00
[PR #1632] rdna2spirv: support vcc and null destinations on s_getpc_b64 and reject odd pairs #1647
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#1647
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/1632
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:feat/s-getpc-b64-destinations📝 Commits (2)
3966cb6rdna2spirv: support vcc, 2-slot slist, and null destinations on s_getpc_b6439f3139rdna2spirv: reject odd SGPR pairs on s_getpc_b64 and add dual-disassembler raw-byte test📊 Changes
5 files changed (+720 additions, -17 deletions)
View changed files
📝
docs/design.md(+1 -0)➕
tests/semantic/test_s_getpc_destinations.py(+640 -0)📝
tools/lane_masks.py(+3 -0)📝
tools/rdna2spirv.py(+66 -13)📝
tools/wave64_emulate_opt.py(+10 -4)📄 Description
Item ID:
SHADER-GETPC-DESTINATIONSClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154632603
Addresses the
s_getpc_b64 destinationsitem from https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154337920 and review feedback on odd-aligned pairs ([s105,vcc_lo],s[1:2]).Summary
tools/rdna2spirv.py(s_getpc_b64lowering): accept even-aligned 2-SGPR pairs (s[0:1]..s[104:105]),vcc(s[106:107]->%vcc/%vcc_hi), andnull(sdst=125, discarded without settinguses_codebase, while still requiring; encoding:bytes). Keep odd-aligned SGPR pairs (s[1:2],s[105:106]) andslist([s105,vcc_lo]from raw SDST 105)Unsupportedper AMD RDNA 2 ISA §§3.2 and 3.6.3 so both disassembler paths agree in refusing them.tools/rdna2spirv.py(translatewave-size detection): excludes_getpc_b64,s_setpc_b64, ands_swappc_b64fromcode_w64since PC is 64-bit in wave32 too.tools/rdna2spirv.py(Gen.global_address): acceptvccas a 64-bitsaddr(refusing an emulated wave64 lane-mask pointer, matchings_load_*).tools/rdna2spirv.py(fold_far_branches): folds_getpc_b64..s_setpc_b64far branches using even-aligned 2-SGPR pairs orvcc(leaving odd pairs unfolded).tools/lane_masks.py: clear wave32vcc_himask state whens_getpc_b64 vcc/s_load_dwordx2 vcc/s_buffer_load_dwordx2 vccwrites raw 64-bit data intovcc.tools/wave64_emulate_opt.py: marks_getpc_b64 vccas raw VCC data inmark_vcc_data_moves()and preserve raw-VCC tracking acrosss_add_u32/s_addc_u32/s_sub_u32/s_subb_u32updates tovcc_lo/vcc_hi.docs/design.md: document thes_getpc_b64destination contract row.tests/semantic/test_s_getpc_destinations.py: 12 synthetic semantic tests across wave32, wave64, and--wave64-emulate, including raw-byte regressions covering bothtools/rdna2_decode.pyand the LLVM +check_printed_encodingspath (plus livellvm-mcwhen installed).Verification
python3 -W error -I tests/semantic/test_s_getpc_destinations.py -v: 12 passed, 0 failed (0.942s).main(42537e7b6): 14 failed, 25 errors; against prior PR head3966cb6a1: 17 failed (confirming odd-pair/raw-byte regressions catch the old acceptance).python3 -I scripts/run_semantic_tests.py tests/semantic: 488 files, 6291 tests, 0 files failed (132s).python3 -m pytest tests/test_shader_meta.py tests/test_rdna2_decode.py tests/test_pc_tail_ubo.py -q: 48 passed, 8 skipped, 653 subtests passed.python3 -m compileall -q tools tests,python3 -I tests/test_text_write_line_endings.py,python3 -I scripts/check_no_game_data.py: all pass.s[104:105],vcc, andnullin wave32 and emulated wave64.AI-assisted: yes
GPUs tested: none locally (CPU interpreter + synthetic fixtures only;
vcc/null/s[104:105]checked on RTX 4090 by @ecox982745 in review; no game data)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.