pixel_aot: lower v_madak_f32 and v_madmk_f32 #584

Closed
opened 2026-11-22 14:29:47 +00:00 by JB2WIN · 0 comments
JB2WIN commented 2026-11-22 14:29:47 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-22T14:29:47Z.


tools/pixel_aot.py lowers the fused literal forms v_fmaak_f32 / v_fmamk_f32 (with fma), but the non-fused VOP2 literal forms v_madak_f32 (S0·S1 + K) and v_madmk_f32 (S0·K + S1) are still rejected. #274 noted them as not covered. Both appear in docs/coverage/gfx1013.tsv.

I'm taking this, unless someone already has it in progress. Plan:

  • Lower both next to the fmaak/fmamk branch, with the same operand rules (K must be a 32-bit hex literal in the documented position, entry mask, no write over an outstanding sample).
  • Use the existing non-fused mad32 helper that v_mad_f32 / v_mac_f32 already use (ALU table "mad"), so they get the same multiply-then-add rounding and denormal handling.
  • Add static checks and draws mirroring the fmaak/fmamk fixtures, including a row where fused and non-fused results differ, so that a lowering through fma gives pixel_mismatch.
  • Add rejection rows for a register in the K position and for e64/DPP/SDWA spellings.
  • Extend the LLVM 15 round-trip fixture, the scanner and the docs.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6543570193 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/590). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-22T14:29:47Z. --- `tools/pixel_aot.py` lowers the fused literal forms `v_fmaak_f32` / `v_fmamk_f32` (with `fma`), but the non-fused VOP2 literal forms `v_madak_f32` (S0·S1 + K) and `v_madmk_f32` (S0·K + S1) are still rejected. #274 noted them as not covered. Both appear in `docs/coverage/gfx1013.tsv`. I'm taking this, unless someone already has it in progress. Plan: - Lower both next to the fmaak/fmamk branch, with the same operand rules (K must be a 32-bit hex literal in the documented position, entry mask, no write over an outstanding sample). - Use the existing non-fused `mad32` helper that `v_mad_f32` / `v_mac_f32` already use (ALU table `"mad"`), so they get the same multiply-then-add rounding and denormal handling. - Add static checks and draws mirroring the fmaak/fmamk fixtures, including a row where fused and non-fused results differ, so that a lowering through `fma` gives `pixel_mismatch`. - Add rejection rows for a register in the K position and for e64/DPP/SDWA spellings. - Extend the LLVM 15 round-trip fixture, the scanner and the docs. 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#584
No description provided.