This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Perform constant folding of math builtins
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: roger at eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Aug 2002 11:27:58 -0400 (EDT)
- Subject: Re: [PATCH] Perform constant folding of math builtins
- References: <Pine.LNX.4.33.0208251925340.26698-100000@www.eyesopen.com>
> From: Roger Sayle <roger at eyesopen dot com>
>
> The following patch implements the following optimizations:
>
> sqrt(0.0) = 0.0
> sqrt(1.0) = 1.0
> log(1.0) = 0.0
> exp(0.0) = 1.0
Why just these cases, can't you fold all calls where the argument is
constant? (Ditto for the trig functions?)
--Kaveh
--
Kaveh R. Ghazi Director of Systems Architecture
ghazi@caip.rutgers.edu Qwest Solutions