diff options
author | Michael Meissner <meissner@linux.vnet.ibm.com> | 2017-11-13 19:06:49 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2017-11-13 19:06:49 +0000 |
commit | 4119b2eb4417054c98e0960a5dbe91284bdacdbf (patch) | |
tree | 118315af01a76320ec6758771f1b65ef8a2940bb /gcc/match.pd | |
parent | 2a28a7523fb1c401ecd9a3a0548e3eb807ff9c2e (diff) | |
download | gcc-4119b2eb4417054c98e0960a5dbe91284bdacdbf.zip gcc-4119b2eb4417054c98e0960a5dbe91284bdacdbf.tar.gz gcc-4119b2eb4417054c98e0960a5dbe91284bdacdbf.tar.bz2 |
match.pd: Convert fminf<N>...
[gcc]
2017-11-13 Michael Meissner <meissner@linux.vnet.ibm.com>
* match.pd: Convert fminf<N>, fminf<N>x, fmax<N>, and fmax<N>x
into the min/max operations for _Float<N> and _Float<N>X types.
[gcc/testsuite]
2017-11-13 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/float128-minmax.c: New test.
From-SVN: r254702
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 4d56847..2557f08 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1803,7 +1803,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) /* Simplifications of MIN_EXPR, MAX_EXPR, fmin() and fmax(). */ -(for minmax (min max FMIN FMAX) +(for minmax (min max FMIN FMIN_FN FMAX FMAX_FN) (simplify (minmax @0 @0) @0)) @@ -1881,7 +1881,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) && TYPE_PRECISION (TREE_TYPE (@0)) > TYPE_PRECISION (type)) (minmax @1 (convert @2))))) -(for minmax (FMIN FMAX) +(for minmax (FMIN FMIN_FN FMAX FMAX_FN) /* If either argument is NaN, return the other one. Avoid the transformation if we get (and honor) a signalling NaN. */ (simplify @@ -1899,11 +1899,17 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (FMIN @0 @1) (min @0 @1)) (simplify + (FMIN_FN @0 @1) + (min @0 @1)) + (simplify (FMAX @0 @1) + (max @0 @1)) + (simplify + (FMAX_FN @0 @1) (max @0 @1))) /* min (-A, -B) -> -max (A, B) */ -(for minmax (min max FMIN FMAX) - maxmin (max min FMAX FMIN) +(for minmax (min max FMIN FMIN_FN FMAX FMAX_FN) + maxmin (max min FMAX FMAX_FN FMIN FMAX_FN) (simplify (minmax (negate:s@2 @0) (negate:s@3 @1)) (if (FLOAT_TYPE_P (TREE_TYPE (@0)) |