Repository navigation
feat(shader): implement v_movrelsd_b32, v_movrelsd_2_b32, v_swap_b32 and v_swaprel_b32 - #325
Merged
Conversation
This was referenced Oct 2, 2026
Merged
Merged
…and v_swaprel_b32 v_movrelsd moves VGPR[src + M0] to VGPR[dst + M0]. The _2 form and v_swaprel take the source offset from M0[9:0] and the destination offset from M0[25:16]; v_swaprel and v_swap exchange the two registers. They reuse the select-over-registers lowering of v_movrels/v_movreld, now shared as readRelativeVector/writeRelativeVector. Co-Authored-By: Claude <noreply@anthropic.com>
adriadam10
force-pushed
the
feat/relative-indexing
branch
from
October 3, 2026 09:44
acb82e7 to
1b7e0e4
Compare
SP4C3B4R-8
pushed a commit
to SP4C3B4R-8/AnyPS5
that referenced
this pull request
Oct 6, 2026
Takes the 13 gate-batch PRs that merged upstream (boykopovar#319 boykopovar#329 boykopovar#330 boykopovar#331 boykopovar#325 boykopovar#435 boykopovar#471 boykopovar#294 boykopovar#376 boykopovar#404 boykopovar#394 boykopovar#401 boykopovar#446) in place of astrobot's local versions, as integ/gate-batch cab0eab had them: boykopovar#294 and boykopovar#376 in astrobot's depth model (DepthTarget, state.depth), boykopovar#394 with the thick mip tails, boykopovar#401 over astrobot's slab pool, boykopovar#471 keeping the settled single-lane path. Also takes the rest of main since a818bee (boykopovar#532 boykopovar#340 boykopovar#486 boykopovar#484 boykopovar#316 boykopovar#243 boykopovar#334 boykopovar#434 boykopovar#437 boykopovar#470 boykopovar#373 boykopovar#452 boykopovar#455 and our upstreamed PRs, where astrobot keeps its later revisions and env switches). Resolution notes: relinker converter/matcher/tests are upstream's (boykopovar#432 decoder covers VEX RIP-relative followers); RecompileResult gains boykopovar#316's hostSubgroupSize (set from request.target.subgroupSize); shader disk cache format 9; boykopovar#452's scissor message; upstream's later live-stack and memory-copy decode tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mgp3oZvembQziVNE2xARQK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Four VOP1 relative-move/swap opcodes threw
VOP1 opcode is not supported. The ISA sweep found them. This PR implements them:v_movrelsd_b32(VOP1/VOP3 0x44)VGPR[D + M0] = VGPR[S0 + M0]v_movrelsd_2_b32(VOP1/VOP3 0x48)VGPR[D + M0[25:16]] = VGPR[S0 + M0[9:0]]v_swaprel_b32(VOP1 0x68)VGPR[D + M0[25:16]]andVGPR[S0 + M0[9:0]]v_swap_b32(VOP1 0x65)VGPR[D]andVGPR[S0]The split forms use 10-bit fields: with
M0 = 0xfc03fc02the offsets are 3 and 2. A plainv_movrelsduses the whole M0, so withM0 = 0x00020002it writes nothing.The lowering is the existing one from
v_movrels/v_movreld: a select over every VGPR the program references at or past the base. It is now factored intoreadRelativeVector/writeRelativeVectorand shared by the six opcodes. The embedded-vertex-fetch scan treats the new relative writes likev_movreld(it forgets every tracked lane), and treatsv_swap_b32as writing both registers.Not changed: an out-of-range relative read returns 0 on hardware (past the allocated VGPRs). Here it keeps the base register's value, as
v_movrelsalready does. That depends on the VGPR allocation, which the recompiler doesn't model.Test
agc_driver_relative_indexing: 11 results × 32 lanes, captured on the RDNA2 GPU (ROCm HSA, raw kernels). It covers each opcode, high M0 bits ignored by the split forms, an out-of-range full-M0 write,v_swaprelwith both offsets on the same register, and the VOP3 form.Tested
Linux, full ctest (99) passes.
swapped_2 is 0x00001000, expected 0x00001002.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)