On Tue, Mar 16, 2010 at 4:11 PM, Dominique Dhumieres <domi...@lps.ens.fr> wrote:
> In the block "Handle constant exponents." in gcc/builtins.c, the condition
> !optimize_size has been replaced with optimize_insn_for_speed_p () between
> gcc 4.3 and 4.4, but I have not been able to find when and why.
> Does anybody remembers the when and why?
>
> This change make the optimization sensitive to PR40106 and unless it has
> compeling reasons it should be reverted in this piece of code.
>
> My second question is why using optimize_size? I think it would be better
> to define an upper bound instead of POWI_MAX_MULTS that depends on the kind
> of optimisation. I cannot see any situation in which sqrt(a) would not be
> better that pow(a,0.5) for speed, size, and accuracy.
pow (a, 0.5) is always expanded to sqrt(a).  It is when we require
additional multiplications, pow (a, n) -> sqrt (a) * a**(n/2), that
optimize_insn_for_speed_p () is checked.

Richard.

> TIA
>
> Dominique
>
>

Reply via email to