[all-commits] [llvm/llvm-project] a43296: [AMDGPU] Fix sign of zero in fpround(fmul) -> V_{M...
Dmitry Sidorov via All-commits
all-commits at lists.llvm.org
Thu Aug 6 17:52:07 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a43296488ed34006f3201a258e712ae01fe63214
https://github.com/llvm/llvm-project/commit/a43296488ed34006f3201a258e712ae01fe63214
Author: Dmitry Sidorov <Dmitry.Sidorov at amd.com>
Date: 2026-08-07 (Fri, 07 Aug 2026)
Changed paths:
M llvm/lib/Target/AMDGPU/VOP3PInstructions.td
M llvm/test/CodeGen/AMDGPU/llvm.log.ll
M llvm/test/CodeGen/AMDGPU/llvm.log10.ll
M llvm/test/CodeGen/AMDGPU/mad-mix-lo-bf16.ll
M llvm/test/CodeGen/AMDGPU/mad-mix-lo.ll
Log Message:
-----------
[AMDGPU] Fix sign of zero in fpround(fmul) -> V_{MAD,FMA}_MIX{LO,HI} (#214544)
The isel patterns lowering `fptrunc (fmul float %a, %b)` to a mix
instruction passed +0.0 as the FMA addend. Under round-to-nearest fma(a,
b, +0.0) is +0.0 whenever a * b is -0.0, so the sign of zero was lost:
on gfx90a, `(half)(-1.0f * 0.0f)` returned +0.0.
Use a -0.0 addend instead, which is the correct multiplicative identity
for an FMA and is what the f32 sibling pattern in MadFmaMixFP32Pats has
always done.
Verified on gfx90a: (half)(-1.0f * 0.0f) now returns 0x8000.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list