Repository navigation
Recompiler: legacy FMA with a zero product returns +0 for c = -0 (#679) - #720
dadnotdaddy wants to merge 1 commit into
Conversation
…-dev#679) v_fma_legacy_f32 / v_fmac_legacy_f32 with a zero factor (inf and NaN included) add c to a +0 product, so c = -0 gives +0. The fma_legacy helper returned c. The zero is cleared on the bits, as DXC folds select(c == 0.0f, 0.0f, c) back to c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing in favour of #670; the bit-based version and its test are suggested there. |
|
Test run of Tested
Review: Returning Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Independent test report on Tested
Not tested
AI use
|
Fixes #679. With a zero factor,
fma_legacyreturnedc; the hardware returnsc + (+0), so c = -0 gave -0 instead of +0. The helper now returnsasfloat(select(c == 0.0f, 0u, asuint(c))): on the bits, so DXC can't fold it back toc(the approach the issue suggests).Test:
gpu_fma_legacy_with_a_zero_factor_adds_plus_zero, VOP3 and VOP2 forms, c = -0 with 05, -05, 5*-0, 0inf, -0NaN, plus pass-through cases. Fails on main (lane 0 returns 0x80000000), passes with the fix on an RTX 2070 SUPER;cargo test --workspacepasses.Overlaps draft #670 (same bug,
preciseadd instead of bits, bundled with an XAsync change); this is the fix alone.AI-assisted (Claude Code).