This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] More constant folding of math built-ins (take 2)
- 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, Brad Lucier <lucier at math dot purdue dot edu>
- Date: Tue, 3 Jun 2003 12:22:08 -0700
- Subject: Re: [PATCH] More constant folding of math built-ins (take 2)
- References: <200305290357.h4T3vVSl027187@banach.math.purdue.edu> <Pine.LNX.4.44.0305290647100.26926-100000@www.eyesopen.com>
On Thu, May 29, 2003 at 07:09:25AM -0600, Roger Sayle wrote:
> * builtins.c (dconstpi, dconste): New mathematical constants.
> (init_builtin_dconsts): New function to initialize dconstpi
> and dconste.
> (fold_builtin): Optimize exp(1.0) = e. Evaluate exp(x) at
> compile time with -ffast-math when x is an integer constant.
> Optimize tan(0.0) = 0.0. Optimize atan(0.0) = 0.0,
> atan(1.0) = pi/4 and tan(atan(x)) = x with -ffast-math.
>
> * gcc.dg/builtins-2.c: Add tests for tan(atan(x)).
> * gcc.dg/builtins-3.c: Add tests for tan(0.0) and atan(0.0).
> * gcc.dg/builtins-7.c: Add tests for tan(atan(x)) == x.
> * gcc.dg/builtins-17.c: New test case.
> * gcc.dg/i386-387-4.c: New test case.
> * gcc.c-torture/execute/ieee/mzero4.c: New test case.
Ok.
r~