direct compute: vcc_lo / vcc_hi as wave32 SMEM offsets and destinations #3171

Closed
opened 2026-11-27 20:16:07 +00:00 by Leyukaka · 0 comments
Leyukaka commented 2026-11-27 20:16:07 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T20:16:07Z.


Part of #2935 (instruction coverage). Target branch main. I am taking it.

Gap. In wave32, vcc_lo (s106) and vcc_hi (s107) are ordinary scalar data. Captured wave32 programs use them as the SGPR offset of s_load_dwordx8 and s_buffer_load_dword (x1, x2, x4, x16), and load into vcc_lo/vcc_hi. Direct compute refuses both with "unsupported scalar memory addressing".

Measured on a local capture of 2,689 compute requests (counts and instruction shape only), with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests on main 6057071b (the commits since then do not touch gfx1013_compute_native.cpp or gfx1013_direct_compute.inl):

  • 59 requests stop first there.
  • With the change, all 59 pass it:
    • 51 then stop at "direct resource-heap load requires the selected GPU slot and its view type";
    • 8 stop at the SDWA v_cmp_class mask written to vcc_hi, which #3157 handles.

Plan:

  • In wave32 compute, accept s106 and s107 as the SMEM offset, numeric like any other SGPR offset.
  • Accept destination ranges up to s107.
  • Wave64, graphics, and ranges past s107 stay refused.

The change adds the same wave64 parameter to decode() as #3157, so whichever lands second gets a small textual conflict that keeps both.

Tests: a hardware readback of loads with vcc_lo and vcc_hi offsets and a load into vcc_hi, plus compile controls for the refusals.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6653841691 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3171). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T20:16:07Z. --- Part of #2935 (instruction coverage). Target branch `main`. I am taking it. **Gap.** In wave32, `vcc_lo` (s106) and `vcc_hi` (s107) are ordinary scalar data. Captured wave32 programs use them as the SGPR offset of `s_load_dwordx8` and `s_buffer_load_dword` (x1, x2, x4, x16), and load into `vcc_lo`/`vcc_hi`. Direct compute refuses both with "unsupported scalar memory addressing". **Measured** on a local capture of 2,689 compute requests (counts and instruction shape only), with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests` on `main` `6057071b` (the commits since then do not touch `gfx1013_compute_native.cpp` or `gfx1013_direct_compute.inl`): - 59 requests stop first there. - With the change, all 59 pass it: - 51 then stop at "direct resource-heap load requires the selected GPU slot and its view type"; - 8 stop at the SDWA `v_cmp_class` mask written to `vcc_hi`, which #3157 handles. **Plan:** - In wave32 compute, accept s106 and s107 as the SMEM offset, numeric like any other SGPR offset. - Accept destination ranges up to s107. - Wave64, graphics, and ranges past s107 stay refused. The change adds the same `wave64` parameter to `decode()` as #3157, so whichever lands second gets a small textual conflict that keeps both. **Tests:** a hardware readback of loads with `vcc_lo` and `vcc_hi` offsets and a load into `vcc_hi`, plus compile controls for the refusals. AI-assisted.
Sign in to join this conversation.
No labels
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.

Reference
R0Y00/Xbox2Windows#3171
No description provided.