Move sqrt and cbrt simplifications to match.pd
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 8 Oct 2015 16:54:37 +0000 (16:54 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 8 Oct 2015 16:54:37 +0000 (16:54 +0000)
commit4835c97845294868e600ab765385b5c0b95157f5
tree19778f9222f6c9f4a0ef4c2ad38bf8ab576baaf5
parent68e57f040c6330eb853551622d458a67d6f9e572
Move sqrt and cbrt simplifications to match.pd

This patch moves the sqrt and cbrt simplification rules to match.pd.
builtins.c now only does the constant folding.

Bootstrapped & regression-tested on x86_64-linux-gnu.

gcc/
* builtins.c (fold_builtin_sqrt, fold_builtin_cbrt): Delete.
(fold_builtin_1): Update accordingly.  Handle constant arguments here.
* match.pd: Add rules previously handled by fold_builtin_sqrt
and fold_builtin_cbrt.

gcc/testsuite/
* gcc.dg/builtins-47.c: Test the optimized dump instead.

From-SVN: r228616
gcc/ChangeLog
gcc/builtins.c
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtins-47.c