This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH, i386]: Convert 1.0/sqrtf (x) into rsqrtf even without -mrecip
Richard Guenther wrote:
The patch was bootstrapped and regression tested on x86_64-linux {,
-m32}. I think that there is a rationale to commit the patch to SVN, but
I would like to hear other opinions on this matter.
I think this is reasonable under -funsafe-math-optimizations. I recall this
way of evaluating 1.0/sqrtf(a) will be of slightly less precision, correct?
(2ulp rather than .0ulp if I recall correctly)
And unlike the case of converting sqrtf() there is no problem with special
values, even for a == 0.0?
There is a problem for a = 0.0, where current implementation of rsqrt
(a) returns 0.0. This is the reason, why this transformation is valid
for -ffinite-math-only. While this can IMHO be tolerated for
-ffast-math, returning NaN for sqrt(0.0) is not tolerable and fixup code
has to be introduced into x86 implementation.
Uros.