Move cexp simplifications to match.pd
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Oct 2015 09:18:30 +0000 (09:18 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Oct 2015 09:18:30 +0000 (09:18 +0000)
commit5e324b84c621f685e23e8ba620aa93cff30068e4
treee79ab049985d601289566c278b52580210cc2ad4
parentd97142b0deb4b75fc0e39a20c53d1034ad3ed389
Move cexp simplifications to match.pd

This required reinstating support for captures in the result
of a simplification.  That part (genmatch.c) is by Richard B.

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

gcc/
2015-10-20  Richard Sandiford  <richard.sandiford@arm.com>
    Richard Biener  <rguenther@suse.de>

* genmatch.c (dt_simplify::gen): Skip captures that are
part of the result.
(parser::parse_expr): Allow captures in results too.
* builtins.c (fold_builtin_cexp): Delete.
(fold_builtin_1): Handle constant cexp arguments here.
* match.pd: Fold cexp(x+yi) to exp(x) * cexpi(y).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229308 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtins.c
gcc/genmatch.c
gcc/match.pd