[PATCH] D28928: [ValueTracking] Implement SignBitMustBeZero correctly for sqrt.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 18:32:55 PST 2017

jlebar updated this revision to Diff 85087.
jlebar added a comment.
Herald added a subscriber: wdng.

Update based on my understanding of what fabs really means, see https://llvm.org/bugs/show_bug.cgi?id=31702#c1.

Basically, I had my "assumption directions" wrong.  IEEE 754 says the sign bit
of NaNs is unspecified, but the behavior of fabs on a NaN is to unset the sign
bit unconditionally.  Therefore the correct thing is to assume that any NaN we
get has the sign bit set to 1!  IOW the NaN sign bit is "might be anything",
not "undefined, we can pretend it's whatever we want."



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28928.85087.patch
Type: text/x-patch
Size: 4004 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170120/e8652274/attachment.bin>

More information about the llvm-commits mailing list