direct compute: lower s_or_saveexec_b32 (wave32) #3158

Closed
opened 2026-11-27 19:04:49 +00:00 by Leyukaka · 0 comments
Leyukaka commented 2026-11-27 19:04:49 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T19:04:49Z.


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

Gap. The direct compute path lowers s_and_saveexec_b32, s_andn2_wrexec_b32 and s_or_saveexec_b64, but refuses s_or_saveexec_b32 with "direct DXIL lowering for s_or_saveexec_b32".

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 80668b97:

  • 4 requests stop first at this op, all wave32.
  • With my change for #3150 (descriptor spills, PR not opened yet), 37 do, all wave32 (.sa dword 4 bit 20, #2999). The form there is s_or_saveexec_b32 sN, -1: save EXEC, then enable every lane.

Plan: lower it like s_and_saveexec_b32 with OR: D = old EXEC, EXEC = old EXEC | S0, SCC = (EXEC != 0). EXEC is stored as computed, like s_or_saveexec_b64 and s_mov_b32 exec_lo: a lane runs only if its own bit is set.

Tests: a hardware readback against a CPU reference.

  • -1 after a partial EXEC: the re-enabled lanes write their result.
  • An SGPR mask.
  • The saved EXEC stored per lane.
  • SCC read through s_cselect.
  • A restore through s_mov_b32 exec_lo.

Measurement: the census and the run's requests, before and after.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6652902578 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3158). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T19:04:49Z. --- Part of #2935 (instruction coverage). Target branch `main`. I am taking it. **Gap.** The direct compute path lowers `s_and_saveexec_b32`, `s_andn2_wrexec_b32` and `s_or_saveexec_b64`, but refuses `s_or_saveexec_b32` with "direct DXIL lowering for s_or_saveexec_b32". **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` `80668b97`: - 4 requests stop first at this op, all wave32. - With my change for #3150 (descriptor spills, PR not opened yet), 37 do, all wave32 (`.sa` dword 4 bit 20, #2999). The form there is `s_or_saveexec_b32 sN, -1`: save EXEC, then enable every lane. **Plan:** lower it like `s_and_saveexec_b32` with OR: D = old EXEC, EXEC = old EXEC | S0, SCC = (EXEC != 0). EXEC is stored as computed, like `s_or_saveexec_b64` and `s_mov_b32 exec_lo`: a lane runs only if its own bit is set. **Tests:** a hardware readback against a CPU reference. - `-1` after a partial EXEC: the re-enabled lanes write their result. - An SGPR mask. - The saved EXEC stored per lane. - SCC read through `s_cselect`. - A restore through `s_mov_b32 exec_lo`. **Measurement:** the census and the run's requests, before and after. 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#3158
No description provided.