[PATCH] More constant folding of pow.
Richard Henderson
rth@redhat.com
Thu Apr 3 02:25:00 GMT 2003
On Wed, Apr 02, 2003 at 01:33:41PM -0700, Roger Sayle wrote:
> * builtins.c (fold_builtin): Constant fold expressions as x*0.5
> instead of x/2.0. Optimize sqrt(pow(x,y)) as pow(x,y*0.5),
> log(pow(x,y)) as y*log(x), pow(exp(x),y) as exp(x*y),
> pow(sqrt(x),y) as pow(x,y*0.5) and pow(pow(x,y),z) as pow(x,y*z).
> Delete function scope "fcode" variable to avoid shadowing.
Ok.
> * gcc.dg/builtins-9.c: New test case.
I guess this is ok. Can you do better to check the
optimization applied?
r~
More information about the Gcc-patches
mailing list