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: [PATCH] Perform constant folding of math builtins


 > From: Roger Sayle <roger at eyesopen dot com> 
 > 
 > On Mon, 26 Aug 2002, Kaveh R. Ghazi wrote:
 > > > Nice set of transformations, though.
 > > Thanks, want to implement any of them? :-)
 > 
 > I'm more than happy to code up all of them! :>  However, I'll probably
 > implement the more primitive case:
 > 
 > x/pow(y,p) = x*pow(y,-p)
 > 
 > which when combined with pow(x,p)*pow(x,q) = pow(x,p+q), would provide
 > the pow(x,p)/pow(x,q) = pow(x,p-q) case that you list explicitly.

Yes I noticed that you did the same for exp.  Good thinking.


 > > Being is stage3 is no reason to stop improving GCC.
 > > See: http://gcc.gnu.org/ml/gcc/2002-08/msg01575.html
 > 
 > I already have a number of patches on hold until after stage 3, so
 > shelving these patches with the rest is no great hardship.  I'm sure
 > there are plenty of PRs that I can look into between now and then.
 > Roger

Certainly fix PRs if you can.

		--Kaveh

PS: I thought of another pow case to fold :-)

pow (0.0, x) = (x == 0.0) ? 1.0 : 0.0
or perhaps ->  ((double)(x == 0.0))

(I'm not sure which is better or if there's any difference.)

--
Kaveh R. Ghazi			Director of Systems Architecture
ghazi@caip.rutgers.edu		Qwest Solutions


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