shader: lower v_fma_f16, v_fmac_f16, v_fmamk_f16 and v_fmaak_f16 in the direct C++ path #3186

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

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


Taking the four scalar binary16 FMA instructions in the direct C++ frontend (src/gfx1013_direct_compute.inl, Refs #2935):

  • v_fma_f16 (VOP3)
  • v_fmac_f16 (VOP2 / VOP3A)
  • v_fmamk_f16 (VOP2 + 32-bit literal K low 16 bits)
  • v_fmaak_f16 (VOP2 + 32-bit literal K low 16 bits)

Plan:

  • Implement single-rounded binary16 FMA in pure 32-bit integer DXIL IR (matching the fma16_rne algorithm in tools/pixel_aot.py so #2073 tie cases round once rather than double-rounding through binary32), preserving D[31:16], supporting VOP3 abs/neg/clamp, enforcing the default binary16 MODE contract via half_binary, and refusing unsupported DPP/SDWA/omod/op_sel/third-source modifiers.
  • Update the unlowered placeholder check in tests/native_f16_alu_check.py from v_fmac_f16 to v_pk_fmac_f16.
  • Verify 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:6654170336 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3186). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-27T20:42:34Z. --- Taking the four scalar binary16 FMA instructions in the direct C++ frontend (`src/gfx1013_direct_compute.inl`, Refs #2935): - `v_fma_f16` (VOP3) - `v_fmac_f16` (VOP2 / VOP3A) - `v_fmamk_f16` (VOP2 + 32-bit literal `K` low 16 bits) - `v_fmaak_f16` (VOP2 + 32-bit literal `K` low 16 bits) Plan: - Implement single-rounded binary16 FMA in pure 32-bit integer DXIL IR (matching the `fma16_rne` algorithm in `tools/pixel_aot.py` so #2073 tie cases round once rather than double-rounding through binary32), preserving `D[31:16]`, supporting VOP3 `abs`/`neg`/`clamp`, enforcing the default binary16 MODE contract via `half_binary`, and refusing unsupported DPP/SDWA/`omod`/`op_sel`/third-source modifiers. - Update the unlowered placeholder check in `tests/native_f16_alu_check.py` from `v_fmac_f16` to `v_pk_fmac_f16`. - Verify 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#3186
No description provided.