direct compute: accept clamp on SDWA v_cvt_f32_f16 #3182

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

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


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

Gap. Direct compute refuses the SDWA form v_cvt_f32_f16_sdwa vD, vS clamp dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 with "unsupported SDWA destination modifier". The SDWA decoder allows clamp only for ops in its float ALU or conversion lists, and v_cvt_f32_f16 is in neither.

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, baseline main 6057071b, change on a5dad843 (the commits in between do not touch the two native source files):

  • 3 requests stop first there.
  • With the change, all 3 pass it: 2 stop next at "numeric SCC from a symbolic descriptor field" and 1 at "unbound numeric SGPR".
  • No request that compiled before stops compiling.

Plan:

  • Accept clamp on the SDWA form only, with the integer clamp v_ldexp uses: a set sign bit or NaN gives +0, and values above 1.0 give 1.0. dx.op saturate may keep -0 or flush a denormal depending on the float mode.
  • omod and the other SDWA modifiers stay refused.

Tests: a hardware readback from both halves for negative, above-one, NaN, -0.0, denormal and in-range inputs.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6654134241 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3182). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T20:39:52Z. --- Part of #2935 (instruction coverage). Target branch `main`. I am taking it. **Gap.** Direct compute refuses the SDWA form `v_cvt_f32_f16_sdwa vD, vS clamp dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1` with "unsupported SDWA destination modifier". The SDWA decoder allows clamp only for ops in its float ALU or conversion lists, and `v_cvt_f32_f16` is in neither. **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`, baseline `main` `6057071b`, change on `a5dad843` (the commits in between do not touch the two native source files): - 3 requests stop first there. - With the change, all 3 pass it: 2 stop next at "numeric SCC from a symbolic descriptor field" and 1 at "unbound numeric SGPR". - No request that compiled before stops compiling. **Plan:** - Accept clamp on the SDWA form only, with the integer clamp `v_ldexp` uses: a set sign bit or NaN gives +0, and values above 1.0 give 1.0. `dx.op` saturate may keep -0 or flush a denormal depending on the float mode. - omod and the other SDWA modifiers stay refused. **Tests:** a hardware readback from both halves for negative, above-one, NaN, -0.0, denormal and in-range inputs. 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#3182
No description provided.