This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Simplify floating point conversions
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 05 Nov 2002 11:13:52 -0800
- Subject: Re: Simplify floating point conversions
- References: <20021105171400.GX14655@kam.mff.cuni.cz>
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>