Commit 06fcea4c authored by Justin Lebar's avatar Justin Lebar
Browse files

[NVPTX] Compute approx sqrt as 1/rsqrt(x) rather than x*rsqrt(x).

x*rsqrt(x) returns NaN for x == 0, whereas 1/rsqrt(x) returns 0, as
desired.

Verified that the particular nvptx approximate instructions here do in
fact return 0 for x = 0.

llvm-svn: 293713
parent d9953d9d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment