Skip to content

Flush subnormal inputs and results for RDNA2 legacy fused multiply-add - #1

Open
MichaelSmithAI wants to merge 2 commits into
Dufftwt:fix/rdna2-fused-legacy-fmafrom
MichaelSmithAI:flush-legacy-fma-subnormals
Open

MichaelSmithAI wants to merge 2 commits into
Dufftwt:fix/rdna2-fused-legacy-fmafrom
MichaelSmithAI:flush-legacy-fma-subnormals

Conversation

@MichaelSmithAI

@MichaelSmithAI MichaelSmithAI commented Nov 24, 2026 •

Copy link
Copy Markdown

Lyrnc’s RDNA2 measurements found that both legacy fused multiply-add instructions flush subnormal inputs and results in both FP32 denormal modes. This follow-up to Marvisak#284 clears subnormal magnitudes with integer operations before the existing zero-factor handling and after the result selection. It preserves the sign bit when flushing. Ordinary FMA and the separate legacy multiply keep their existing lowering.

The Windows readback fixture exercises both opcodes, each factor and the addend, positive and negative subnormal results, and the minimum normal value. The fixture type-checked for Windows. All 57 Linux shader library tests passed, and Microsoft DXV accepted source-built shaders for both instructions.

The published fixture passed for both opcodes on an RTX 4090 through Wine and vkd3d-proton. A separate nine-case comparison per opcode checked signed underflow and the minimum normal value. All 18 words matched expected values on both this change and the parent lowering. This adapter therefore confirms the output but exhibits no before/after gain on these inputs. Both adapter selections used the same physical GPU. Windows-native readback of this change remains pending. The hardware differential numbers in the linked report were measured on the parent branch. AI-assisted implementation, testing and review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant