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]

Re: Simplify floating point conversions


Jan Hubicka <jh@suse.cz> writes:

> Hi,
> this patch makes us to simplify some of the floating point operations to
> narrower mode when conversions are present.  This include
> +,-,/,*,abs,neg,sqrt/sin/cos/exp.
> I believe it is IEEE safe, but some expert would be welcome.

It's not safe, except for 'abs' and 'neg'.  For example,
(float)sqrt(2.0 * FLT_MAX) != sqrtf(2.0 * FLT_MAX).
I think it would be OK for -ffast-math, though.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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