Commit 4119b2eb by Michael Meissner Committed by Michael Meissner

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
parent 2a28a752
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.
2017-11-13 Eric Botcazou <ebotcazou@adacore.com> 2017-11-13 Eric Botcazou <ebotcazou@adacore.com>
PR lto/81351 PR lto/81351
...@@ -1803,7 +1803,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) ...@@ -1803,7 +1803,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* Simplifications of MIN_EXPR, MAX_EXPR, fmin() and fmax(). */ /* 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 (simplify
(minmax @0 @0) (minmax @0 @0)
@0)) @0))
...@@ -1881,7 +1881,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) ...@@ -1881,7 +1881,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& TYPE_PRECISION (TREE_TYPE (@0)) > TYPE_PRECISION (type)) && TYPE_PRECISION (TREE_TYPE (@0)) > TYPE_PRECISION (type))
(minmax @1 (convert @2))))) (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 /* If either argument is NaN, return the other one. Avoid the
transformation if we get (and honor) a signalling NaN. */ transformation if we get (and honor) a signalling NaN. */
(simplify (simplify
...@@ -1899,11 +1899,17 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) ...@@ -1899,11 +1899,17 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(FMIN @0 @1) (FMIN @0 @1)
(min @0 @1)) (min @0 @1))
(simplify (simplify
(FMIN_FN @0 @1)
(min @0 @1))
(simplify
(FMAX @0 @1) (FMAX @0 @1)
(max @0 @1))
(simplify
(FMAX_FN @0 @1)
(max @0 @1))) (max @0 @1)))
/* min (-A, -B) -> -max (A, B) */ /* min (-A, -B) -> -max (A, B) */
(for minmax (min max FMIN FMAX) (for minmax (min max FMIN FMIN_FN FMAX FMAX_FN)
maxmin (max min FMAX FMIN) maxmin (max min FMAX FMAX_FN FMIN FMAX_FN)
(simplify (simplify
(minmax (negate:s@2 @0) (negate:s@3 @1)) (minmax (negate:s@2 @0) (negate:s@3 @1))
(if (FLOAT_TYPE_P (TREE_TYPE (@0)) (if (FLOAT_TYPE_P (TREE_TYPE (@0))
......
2017-11-13 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/float128-minmax.c: New test.
2017-11-13 Christophe Lyon <christophe.lyon@linaro.org> 2017-11-13 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/arm/pr67989.C: Add -Wno-return-type to * gcc.target/arm/pr67989.C: Add -Wno-return-type to
......
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-options "-mpower9-vector -O2 -ffast-math" } */
#ifndef TYPE
#define TYPE _Float128
#endif
/* Test that the fminf128/fmaxf128 functions generate if/then/else and not a
call. */
TYPE f128_min (TYPE a, TYPE b) { return __builtin_fminf128 (a, b); }
TYPE f128_max (TYPE a, TYPE b) { return __builtin_fmaxf128 (a, b); }
/* { dg-final { scan-assembler {\mxscmpuqp\M} } } */
/* { dg-final { scan-assembler-not {\mbl\M} } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment