builtins.c (expand_builtin): Use expand_builtin_pow to expand calls for pow...
authorRoger Sayle <roger@eyesopen.com>
Tue, 24 Jun 2003 02:20:12 +0000 (02:20 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 24 Jun 2003 02:20:12 +0000 (02:20 +0000)
commit2082e02f4146963ac678935af25c65430210f350
treee544613227ec08f4df55e0c085a0efa4b3b4352b
parente4048ffc3f1f29dbde9393a895bac67aa6e62948
builtins.c (expand_builtin): Use expand_builtin_pow to expand calls for pow...

* builtins.c (expand_builtin): Use expand_builtin_pow to expand
calls for pow, powf, powl and their __builtin_ variants.
(expand_builtin_pow): If the second argument is a constant
integer and compiling with -ffast-math, use expand_powi to
generate RTL if powi_cost is less than POWI_MAX_MULTS.
(powi_cost): New function to return the number of multiplications
necessary to evaluate an Nth power, for integer constant N.
(expand_powi): New function to expand the RTL for evaluating
the Nth power of a floating point value, for integer constant N.

* doc/tm.texi (POWI_MAX_MULTS): Document new target macro.

* gcc.dg/builtins-24.c: New test case.

From-SVN: r68401
gcc/ChangeLog
gcc/builtins.c
gcc/doc/tm.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtins-24.c [new file with mode: 0644]