[tree-ssa-math-opts] Expand pow (x, CONST) using square roots when possible
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 13 May 2015 15:26:14 +0000 (15:26 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 13 May 2015 15:26:14 +0000 (15:26 +0000)
commitb7dce216c7aabe73aae567e6565f44676246a518
treee2d5e277b402d4d751638756eee12266bbada3e9
parentda80c6b81f6162937acea26d014063f772ae1305
[tree-ssa-math-opts] Expand pow (x, CONST) using square roots when possible

* params.def (PARAM_MAX_POW_SQRT_DEPTH): New param.
* tree-ssa-math-opts.c: Include params.h
(pow_synth_sqrt_info): New struct.
(representable_as_half_series_p): New function.
(get_fn_chain): Likewise.
(print_nested_fn): Likewise.
(dump_fractional_sqrt_sequence): Likewise.
(dump_integer_part): Likewise.
(expand_pow_as_sqrts): Likewise.
(gimple_expand_builtin_pow): Use above to attempt to expand
pow as series of square roots.  Removed now unused variables.

* gcc.target/aarch64/pow-sqrt-synth-1.c: New test.
* gcc.dg/pow-sqrt.x: New file.
* gcc.dg/pow-sqrt-1.c: New test.
* gcc.dg/pow-sqrt-2.c: Likewise.
* gcc.dg/pow-sqrt-3.c: Likewise.

From-SVN: r223167
gcc/ChangeLog
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pow-sqrt-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pow-sqrt-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pow-sqrt-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pow-sqrt.x [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/pow-sqrt-synth-1.c [new file with mode: 0644]
gcc/tree-ssa-math-opts.c