]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
[APFloat][ADT] Fix sign handling logic for FMA results that truncate to zero.
authorLang Hames <lhames@gmail.com>
Sun, 4 Jan 2015 01:20:55 +0000 (01:20 +0000)
committerLang Hames <lhames@gmail.com>
Sun, 4 Jan 2015 01:20:55 +0000 (01:20 +0000)
commita46dd583d61720b5f874b2cbbb8c359ae0dc51f6
treeae08c67c9a16c9a325d8f41caf09fc722500d47e
parentb19a485253ea38cda5dfc45c0e1f6e6a7d1d8b8d
[APFloat][ADT] Fix sign handling logic for FMA results that truncate to zero.

This patch adds a check for underflow when truncating results back to lower
precision at the end of an FMA. The additional sign handling logic in
APFloat::fusedMultiplyAdd should only be performed when the result of the
addition step of the FMA (in full precision) is exactly zero, not when the
result underflows to zero.

Unit tests for this case and related signed zero FMA results are included.

Fixes <rdar://problem/18925551>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225123 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/APFloat.cpp
unittests/ADT/APFloatTest.cpp