This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize x+x+x+x+x+x as 6.0*x with -ffast-math.
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 4 Aug 2003 15:02:45 -0700
- Subject: Re: [PATCH] Optimize x+x+x+x+x+x as 6.0*x with -ffast-math.
- References: <Pine.LNX.4.44.0307311412360.2603-100000@www.eyesopen.com> <Pine.LNX.4.44.0308031259270.31325-100000@www.eyesopen.com>
On Sun, Aug 03, 2003 at 01:17:26PM -0600, Roger Sayle wrote:
> * fold-const.c (fold <PLUS_EXPR>): Transform x+x into x*2.0.
> Optimize x*c+x and x+x*c into x*(c+1) and x*c1+x*c2 into x*(c1+c2)
> for floating point expressions with -ffast-math.
> (fold <MULT_EXPR>): Don't transform x*2.0 into x+x.
> * expmed.c (expand_mult): Wrap long line. Expand x*2.0 as x+x.
>
> * gcc.dg/20030803-1.c: New test case.
Ok.
r~