[PATCH] Returns NaN for sqrt with negative fp argument

Jiangning Liu liujiangning1 at gmail.com
Mon Jun 9 18:45:27 PDT 2014


Hi,

IEEE-754 standard requires to return NaN for sqrt with negative fp value
argument, while llvm now is returning fp zero instead. This patch is to fix
this issue and spec2006/483.xanlancbmk can pass with -ffast-math for
AArch64 target, but the fix itself is a general one rather than target
specific.

Also, sqrt in glibc behaves like this, and clang is defining __GNUC__, so
it means we need to keep compatibility with GCC around this as well.

Thanks,
-Jiangning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140610/9f234eb8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Generate-NaN-for-sqrt-with-negative-arg.patch
Type: text/x-patch
Size: 4097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140610/9f234eb8/attachment.bin>


More information about the llvm-commits mailing list