lower: lower v_permlanex16_b32 to waveReadLaneAt #1134
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1134"
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?
Imported from Marvisak/VIctory. Originally posted by bitzin-dev on 2026-11-24T16:06:14Z.
Implements lowering for RDNA2 VOP3 opcode
v_permlanex16_b32(Vector Permute Lane Extended 16, 32-bit).Background
In RDNA2,
v_permlanex16_b32gathers across adjacent 16-lane rows (row 0 <-> row 1, row 2 <-> row 3) using a 64-bit selector composed of scalar operands{s2, s1}. For each 16-lane row, lanei(0..15) extracts 4-bit nibblei:s1s2The target lane within the alternate row is
alt_row | pick, wherealt_row = (lane & !31) | ((lane & 16) ^ 16)andpick = (sel_word >> ((lane & 7) * 4)) & 15. The value is then read viawaveReadLaneAt.i32.Validation
victory translate --validate "D:\GTA 6\shaders.rpf"):deferred_tiled:CS_WaterTransmittanceOpticalDepthProcessing_44443e79_Wrapped Cs(at0xd00).dxil.dllincreased from 1,417 to 1,418 (+1).cargo test -p victory-shader).cargo xtask policypasses cleanly.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T16:29:02Z.
Review: COMMENTED
This implements only v_permlanex16_b32; #1014 covers both v_permlane16_b32 and v_permlanex16_b32 with equivalent math, plus the cross-lane guard-list entry this PR lacks, plus a lowering test. Suggest closing in favor of #1014 (or rebasing to just the delta if the author prefers the separate structure). Local verification: macOS arm64, rustc 1.98.1, PR head merged into main
ffe310e,cargo test -p <crate> --locked. Shader execution tests (valu_tests/host) are#[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. victory-shader: 96 passed, 0 failed on this head.Imported from Marvisak/VIctory. Originally posted by bitzin-dev on 2026-11-24T16:31:20Z.
Thanks for pointing that out, @catminou4! Didn't catch that #1014 was opened just about an hour before. It definitely makes sense to close this in favor of #1014 since it handles both
v_permlane16_b32andv_permlanex16_b32together with the cross-lane guard list check. Closing!Pull request closed