Move cexp simplifications to match.pd
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 26 Oct 2015 09:18:30 +0000 (09:18 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 26 Oct 2015 09:18:30 +0000 (09:18 +0000)
commit96285749d88e8bf954b7e977d43e5cb947357ce5
treee79ab049985d601289566c278b52580210cc2ad4
parent9df01367f2f481d91b4927669cec5dbf80f489a1
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).

Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r229308
gcc/ChangeLog
gcc/builtins.c
gcc/genmatch.c
gcc/match.pd