shader: lower v_cvt_f16_u16, v_cvt_f16_i16, v_cvt_u16_f16 and v_cvt_i16_f16 in the direct compute path #3148

Closed
opened 2026-11-27 18:22:34 +00:00 by legacy-code-archaeologist · 0 comments
legacy-code-archaeologist commented 2026-11-27 18:22:34 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-27T18:22:34Z.


Taking the four binary16 <-> 16-bit integer VOP1/VOP3 conversion instructions in the direct C++ compute path (Refs #2935):

  • v_cvt_f16_u16, v_cvt_f16_i16 (round-to-nearest-even via packed_half_rne, optional VOP3 clamp saturating binary16 to [0.0, 1.0])
  • v_cvt_u16_f16, v_cvt_i16_f16 (truncate toward zero, saturate to [0, 65535] / [-32768, 32767], NaN -> 0, VOP3 abs/neg)

Both VOP1 and VOP3A forms preserve D[31:16], check the default binary16 rounding/denormal MODE contract, refuse unsupported DPP/SDWA/op_sel/omod/modifiers, and will be verified with native_compute_ir_dump (ir), compile_dxil (controls), and native_store_replay (hardware, expected skip 77 on Quadro M1000M).

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6652325650 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3148). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-27T18:22:34Z. --- Taking the four binary16 <-> 16-bit integer VOP1/VOP3 conversion instructions in the direct C++ compute path (Refs #2935): - `v_cvt_f16_u16`, `v_cvt_f16_i16` (round-to-nearest-even via `packed_half_rne`, optional VOP3 `clamp` saturating binary16 to `[0.0, 1.0]`) - `v_cvt_u16_f16`, `v_cvt_i16_f16` (truncate toward zero, saturate to `[0, 65535]` / `[-32768, 32767]`, `NaN -> 0`, VOP3 `abs`/`neg`) Both VOP1 and VOP3A forms preserve `D[31:16]`, check the default binary16 rounding/denormal MODE contract, refuse unsupported DPP/SDWA/`op_sel`/`omod`/modifiers, and will be verified with `native_compute_ir_dump` (`ir`), `compile_dxil` (`controls`), and `native_store_replay` (`hardware`, expected skip `77` on Quadro M1000M). 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#3148
No description provided.