direct compute: accept clamp on SDWA v_cvt_f32_f16 #3184

Closed
opened 2026-11-27 20:40:54 +00:00 by github-bot · 0 comments
Owner

@⁠Leyukaka on GitHub · 2026-11-27 20:39 UTC · original

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.

**@⁠Leyukaka** on GitHub · 2026-11-27 20:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3182) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 20:40:54 +00:00
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#3184
No description provided.