Repository navigation
Conversation
v_swaprel_b32 exchanged the fixed VDST with VGPR[SRC0 + M0] and switched on all of M0. The RDNA 2 ISA (VOP1 opcode 104) gives each side its own index, as for v_movrelsd_2_b32: addr_src = SRC0 + M0[9:0]; addr_dst = VDST + M0[25:16] with the example m0 = (20 << 16) | 10, `v_swaprel_b32 v5, v7` swapping v25 and v17 (also table 25 in section 6.6). With a non-zero M0[25:16] no case matched, so XCL wrote 0 to VDST and left both registers alone. Both indices now use the bounded switches v_movrelsd_2_b32 uses; both old values are still read before either write, and the writes stay EXEC-gated. gpu_v_swaprel_b32 gains m0 = (2 << 16) | 3 with `v_swaprel_b32 v5, v10` (swaps v7 and v13, v5 untouched) and an M0 with bits set outside the two fields; both fail on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test run of Tested
Review: Separate indices for the two sides ( Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Independent native Windows NVIDIA RTX 5080 (wave32) + D3D12 debug layer build/test run and code review at head Code Review
Tested
Not tested
AI use: Antigravity (Gemini 4 Neon reviewed the diff; Gemini 4 Hydrogen ran the RTX 5080 workspace tests) drafted this report. |
|
Hardware check of Tested
Regression run PR ( Not tested
AI use
|
|
2| |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
merge-check claim |
|
merge-check |
|
merge-check claim |
|
merge-check claim |
|
merge-check claim Withdrawn: the checking tool was stopped mid-run before it could post a check, so this claim is released. The head is unchanged and nobody has lost work - anyone may take it. |
|
merge-check |
|
merge-check |
|
No open or merged PR changes AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
v_swaprel_b32exchanged the fixedVDSTwithVGPR[SRC0 + M0]and switched on all of M0. The RDNA 2 ISA gives each side its own index (VOP1 opcode 104):addr_src = SRC0 + M0.u[9:0],addr_dst = DST + M0.u[25:16], thentmp = VGPR[addr_dst]; VGPR[addr_dst] = VGPR[addr_src]; VGPR[addr_src] = tmp, with the examplem0 = (20 << 16) | 10,v_swaprel_b32 v5, v7swapping v25 and v17. Section 6.6 (table 25) also uses separate fields for source and destination; it prints the low field as M0[7:0], and this PR follows the opcode table's M0[9:0], asv_movrelsd_2_b32already does. LLVM defines the instruction (VOP1Instructions.td,Uses = [M0]) but no compiler I know of emits it.On
main, withm0 = (2 << 16) | 3, no case ofswitch (m0)matched. XCL wrote 0 to v5 and left v7 and v13 alone, where the ISA swaps v7 and v13 and leaves v5 untouched. The existing test only used m0 = 3 and m0 = 1, where both readings agree.What is in it
crates/xcl/src/gpu/recomp/emit.rs:swaprelreads and writes both sides through the bounded switches thatmovreluses forv_movrelsd_2_b32(m0 & 0x3FF,(m0 >> 16) & 0x3FF). Both old values are still read before either write, so an overlapping pair is a no-op, and the writes stay EXEC-gated as for any VOP1 write.crates/xcl/src/gpu/recomp/tests.rs:gpu_v_swaprel_b32getsm0 = (2 << 16) | 3,v_swaprel_b32 v5, v10(swaps v7 and v13, v5 untouched), andm0 = 0xFC01FC02,v_swaprel_b32 v16, v20(bits outside the two fields ignored: swaps v17 and v22).v_swaprel_b32_uses_the_m0_relative_switchchecks the two index expressions in the HLSL.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on 4db1a2a: 704 passed, 0 failed, 41 ignoredgpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64)main(d5442d2) without theemit.rschange.gpu_v_swaprel_b32fails at lane 0 withv5 = 0, expected 2000 (untouched), andv_swaprel_b32_uses_the_m0_relative_switchfails on the oldswitch (m0). Both pass with the change.upper_lanes::tests::swaprel_writes_any_registerpasses before and after.Regression run
From eizispark's run (#803 (comment)), thanks:
main:
PR:
Not tested
v_swaprel_b32with a non-zero M0[25:16]. Low impact: neither LLVM nor ACO emits the instruction.AI use
🤖 Generated with Claude Code