fold-const.c (fold_binary_loc): Move Convert A/B/C to A/(B*C) to match.pd.
authorNaveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
Thu, 12 Nov 2015 05:34:54 +0000 (05:34 +0000)
committerNaveen H.S <naveenh@gcc.gnu.org>
Thu, 12 Nov 2015 05:34:54 +0000 (05:34 +0000)
commit5711ac884b3d7992b44aa848e980cebe5b4b93d0
tree6d95b42299d95761df6ad4dfed0acf92443db35e
parentab68f865629684815e987810a3842ce98b1122c3
fold-const.c (fold_binary_loc): Move Convert A/B/C to A/(B*C) to match.pd.

2015-11-12  Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

* fold-const.c (fold_binary_loc) : Move Convert A/B/C to A/(B*C)
to match.pd.
Move Convert A/(B/C) to (A/B)*C to match.pd.
Move Convert C1/(X*C2) into (C1/C2)/X to match.pd.
Move Optimize (X & (-A)) / A where A is a power of 2, to
X >> log2(A) to match.pd.

* match.pd (rdiv (rdiv:s @0 @1) @2): New simplifier.
(rdiv @0 (rdiv:s @1 @2)): New simplifier.
(div (convert? (bit_and @0 INTEGER_CST@1)) INTEGER_CST@2):
New simplifier.
(rdiv REAL_CST@0 (mult @1 REAL_CST@2)): New simplifier.

From-SVN: r230204
gcc/ChangeLog
gcc/fold-const.c
gcc/match.pd