This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, i386]: Rewrite x87 sqrt patterns
On 11/22/06, Michael Matz <email@example.com> wrote:
> > The i386 sqrt patterns doesn't truncate the result of fsqrt x87
> > instruction.
> And neither do add, sub. mult, or div. What's special about sqrt that
> it deserves this treatement?
Right. If you _really_ want to fix x87 you'll have to explicitely
truncate every intermediate result, just like -ffloat-store. I guess
nobody wants that, so why do it for sqrt?
Because there is a difference between returned results when sqrt() is
implemented as a builtin function or when it is implemented as a
library call. This is similar to the problems of __builtin_fmod() vs
fmod() library call on x87.
So, is it tolerable to substitute sqrt() call with a __builtin_sqrt()
that returns "different" results? If it is, could __builtin_fmod()
also return different results than fmod()?