Add simple sign-stripping cases to match.pd
commita15183ebb8e553d7cb4e33c7f5dd546303126010
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Oct 2015 09:49:13 +0000 (21 09:49 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Oct 2015 09:49:13 +0000 (21 09:49 +0000)
treee80a9f5011fa7ceae0d53ca58e953a84f6c350b4
parent77d2eb6ba37540a98008132a9c85bdaf7245b926
Add simple sign-stripping cases to match.pd

This patch makes sure that, for every simplification that uses
fold_strip_sign_ops, there are associated match.pd rules for the
leaf sign ops, i.e. abs, negate and copysign.  A follow-on patch
will add a pass to handle more complex cases.

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

gcc/
* match.pd: Add rules to simplify ccos, ccosh, hypot, copysign
and x*x in cases where the operands are sign ops.  Extend these
rules to handle copysign as a sign op (including for cos, cosh
and pow, which already treated negate and abs as sign ops).

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