This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Converting floor to rint


> Jan Hubicka <jh@suse.cz> writes:
> 
> | > On Wed, Nov 06, 2002 at 06:54:41PM +0100, Jan Hubicka wrote:
> | > > +      For fast math it would be safe probably to convert (float)sqrt(x)
> | > > +      into sqrt((float)x), but in strict mode the argument can overflow.  */
> | > 
> | > I don't believe this to be true.
> | 
> | What you don't believe?
> 
> Likew RTH, I, skeptical that your assertion is right.
> 
> | That in ffast-math we can do the transformation?
> 
> Do we really need to do that transformation?  That is is there any
> real evidence that it brings any real benefit?
> I would be reluctant to include it even in -funsafe-math.

On the related note.  How bad would you consider converting
floor(x) into rint(x-0.5) in the fast-math mode?
That transformation would do a miracles for i386, where rint is faster
than floor by quite a lot and should suffice for 3D application in
reliablility.  I can imagine it to fail only for very large numbers...

Honza
> 
> -- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]