pixel_aot: lower v_swaprel_b32 with the movrel m0 indexing #1795

Closed
opened 2026-11-26 23:33:57 +00:00 by github-bot · 3 comments
Owner

@⁠legacy-code-archaeologist on GitHub · 2026-11-24 18:47 UTC · original

Follow-up to #1739/#1785: v_swaprel_b32 is the last VOP1 relative-indexing form that pixel_aot refuses. It is in the gfx1013 and gfx1030 reference lists, VOP1 only, with no VOP3 form. LLVM 15 decodes 7e18d118 as v_swaprel_b32 v12, v24 for both targets.

Semantics (assumption, please correct):

  • It exchanges VGPR[vdst + m0[25:16]] and VGPR[vsrc + m0[9:0]], the same split as v_movrelsd_2_b32.
  • Both values are read before either write, so an equal pair is unchanged.
  • I have this from the RDNA 2 ISA naming and LLVM's definition (uses M0, untyped, no modifiers). I have not checked it against the ISA text locally, and I have no RDNA hardware to measure it on.

Proposed slice: lower it with the m0 machinery of #1785.

  • A static m0, or a dynamic m0 with proven-bounded bit masks, which becomes bounded conditional selects on both sides.
  • Read both reachable sides first, then write both.
  • Same refusals as the movrel forms:
    • unbounded or interp_base m0;
    • an index past v255;
    • an undefined indexed VGPR;
    • an outstanding sample;
    • a mask other than entry.

Fixture plan: two banks with distinct values on the two DPP_MOVREL_SETS, a static and a dynamic swap, an overlapping-bank swap and an equal-index swap. WARP and hardware draws.

Controls that must mismatch:

  • a one-way move instead of a swap;
  • swapped m0 halves;
  • a dynamic m0 that is ignored.

This builds on #1785. I'd open it as a PR on top of that branch, or after #1785 is merged.

**@⁠legacy-code-archaeologist** on GitHub · 2026-11-24 18:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/1795) Follow-up to #1739/#1785: `v_swaprel_b32` is the last VOP1 relative-indexing form that `pixel_aot` refuses. It is in the gfx1013 and gfx1030 reference lists, VOP1 only, with no VOP3 form. LLVM 15 decodes `7e18d118` as `v_swaprel_b32 v12, v24` for both targets. **Semantics (assumption, please correct):** - It exchanges `VGPR[vdst + m0[25:16]]` and `VGPR[vsrc + m0[9:0]]`, the same split as `v_movrelsd_2_b32`. - Both values are read before either write, so an equal pair is unchanged. - I have this from the RDNA 2 ISA naming and LLVM's definition (uses `M0`, untyped, no modifiers). I have not checked it against the ISA text locally, and I have no RDNA hardware to measure it on. **Proposed slice:** lower it with the `m0` machinery of #1785. - A static `m0`, or a dynamic `m0` with proven-bounded bit masks, which becomes bounded conditional selects on both sides. - Read both reachable sides first, then write both. - **Same refusals as the movrel forms:** - unbounded or `interp_base` `m0`; - an index past v255; - an undefined indexed VGPR; - an outstanding sample; - a mask other than entry. **Fixture plan:** two banks with distinct values on the two `DPP_MOVREL_SETS`, a static and a dynamic swap, an overlapping-bank swap and an equal-index swap. WARP and hardware draws. **Controls that must mismatch:** - a one-way move instead of a swap; - swapped `m0` halves; - a dynamic `m0` that is ignored. This builds on #1785. I'd open it as a PR on top of that branch, or after #1785 is merged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:33:57 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 01:42 UTC · original

Picking up v_swaprel_b32 lowering with movrel m0 indexing in pixel_aot, with Linux + Win2025 verification tests.

**@⁠tedin7** on GitHub · 2026-11-25 01:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/1795#issuecomment-7149860093) Picking up `v_swaprel_b32` lowering with `movrel` `m0` indexing in `pixel_aot`, with Linux + Win2025 verification tests.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 01:43 UTC · original

Update: v_swaprel_b32 with movrel m0 indexing appears already on main via #1844 (7a75c9ab) and #1875, so skipping — this issue can likely be closed.

**@⁠tedin7** on GitHub · 2026-11-25 01:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/1795#issuecomment-7149882164) Update: `v_swaprel_b32` with `movrel` `m0` indexing appears already on `main` via #1844 (`7a75c9ab`) and #1875, so skipping — this issue can likely be closed.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-25 01:47 UTC · original

The bounded static and dynamic swap landed in #1844, including overlapping and equal-register cases and GPU negative controls. #1875 added exact emitted-code checks for both sides of the exchange and the m0 halves. I reran the current pixel translator controls successfully. This closes the implementation slice. The exact indexing on native RDNA hardware remains unmeasured, as documented in #1844.

**@⁠R0Y00** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/1795#issuecomment-7149955788) The bounded static and dynamic swap landed in #1844, including overlapping and equal-register cases and GPU negative controls. #1875 added exact emitted-code checks for both sides of the exchange and the m0 halves. I reran the current pixel translator controls successfully. This closes the implementation slice. The exact indexing on native RDNA hardware remains unmeasured, as documented in #1844.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#1795
No description provided.