cpp-migration: lower v_mad_f32, v_mad_legacy_f32, v_mac_f32 and v_mac_legacy_f32 in the direct C++ compute path #3005
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#3005
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@legacy-code-archaeologist on GitHub · 2026-11-27 04:13 UTC · original
Target branch
cpp-migration. Part of #2935 (instruction coverage: f32 ALU). I am taking this; please say if you already have it locally and I will drop it.Gap: the direct compute path lowers the fused
v_fma_f32family (DXILFMad) but refuses the unfused multiply-adds.v_mad_f32andv_mad_legacy_f32fail withdirect DXIL lowering for <name>in the per-opcode VOP3 probe of #2985 (cpp-migration05438d65). The VOP2 accumulatorsv_mac_f32andv_mac_legacy_f32have no lowering either.gfx2hlsl.pylowers all four throughmad32(a, b, c, legacy), which matchespixel_aot:Plan:
Lower the same sequence with plain
fmul/fadd, which carry no fast-math flags, so no contraction is allowed. The flush is an integer mask on the sign bit.v_mac_*reads the destination as its addend.Fixture: a source-built dispatch against a CPU reference, with:
References that fuse, skip the flush, or treat the legacy form like the plain one must differ.
AI-assisted.