Move hypot folds to match.pd
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 27 Oct 2015 09:29:40 +0000 (09:29 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 27 Oct 2015 09:29:40 +0000 (09:29 +0000)
commit4d7836c4361c5ae2f703c03e789ac0c533dd80be
tree77a20b470231501dd40126c4597a20cc52530819
parent4aecfe19869d2ba26ac4e4a967eb0b0cbf9b0114
Move hypot folds to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_hypot): Delete.
(fold_builtin_2): Handle constant hypot arguments here.
* match.pd: Fold hypot(x, 0) and hypot(0, x) to x.  Canonicalize
hypot(x, x) to fabs(x)*sqrt(2).

From-SVN: r229407
gcc/ChangeLog
gcc/builtins.c
gcc/match.pd