[PATCH] D28508: [NVPTX] Implement NVPTXTargetLowering::getSqrtEstimate.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 23:49:33 PST 2017

jlebar added a comment.

In https://reviews.llvm.org/D28508#661351, @escha wrote:

> afaik, x * rsqrt(x) is wrong when x is zero (it gives NaN instead of 0). we use x * rsqrt(x) for our expansion, but we have to use an extra select_cc to handle the zero special case.

Gosh darnit, I even found this bug in something else a few weeks ago, and I completely forgot here.  I think I was distracted by a signed-zeroes nonissue (because we're already fast-math).

Thank you, will fix in the morning.



More information about the llvm-commits mailing list