summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavids <davids@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-25 17:12:28 +0000
committerdavids <davids@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-25 17:12:28 +0000
commit154294999927c90d4dcf881bcd76099604e5a91e (patch)
tree9f0d2aa8a0fe20a54db2718aaed1374f98424162
parentf6b304634e9e270241b68edf6b0dbac9f1456512 (diff)
downloadgcc-154294999927c90d4dcf881bcd76099604e5a91e.tar.gz
2015-11-25 David Sherwood <david.sherwood@arm.com>
* optabs.def: Add new optabs fmax_optab/fmin_optab. * internal-fn.def: Add new fmax/fmin internal functions. * doc/md.texi: Add fmin and fmax patterns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230888 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/doc/md.texi9
-rw-r--r--gcc/internal-fn.def2
-rw-r--r--gcc/optabs.def4
4 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b00bfb0b6b5..c5687e559d5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-25 David Sherwood <david.sherwood@arm.com>
+
+ * optabs.def: Add new optabs fmax_optab/fmin_optab.
+ * internal-fn.def: Add new fmax/fmin internal functions.
+ * doc/md.texi: Add fmin and fmax patterns.
+
2015-11-25 Jason Merrill <jason@redhat.com>
PR c++/68385
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index de1b58a985e..add8920ff47 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -4980,6 +4980,15 @@ Signed minimum and maximum operations. When used with floating point,
if both operands are zeros, or if either operand is @code{NaN}, then
it is unspecified which of the two operands is returned as the result.
+@cindex @code{fmin@var{m}3} instruction pattern
+@cindex @code{fmax@var{m}3} instruction pattern
+@item @samp{fmin@var{m}3}, @samp{fmax@var{m}3}
+IEEE-conformant minimum and maximum operations. If one operand is a quiet
+@code{NaN}, then the other operand is returned. If both operands are quiet
+@code{NaN}, then a quiet @code{NaN} is returned. In the case when gcc supports
+signalling @code{NaN} (-fsignaling-nans) an invalid floating point exception is
+raised and a quiet @code{NaN} is returned.
+
@cindex @code{reduc_smin_@var{m}} instruction pattern
@cindex @code{reduc_smax_@var{m}} instruction pattern
@item @samp{reduc_smin_@var{m}}, @samp{reduc_smax_@var{m}}
diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def
index 825dba11f24..dee9332c3d6 100644
--- a/gcc/internal-fn.def
+++ b/gcc/internal-fn.def
@@ -125,6 +125,8 @@ DEF_INTERNAL_FLT_FN (FMOD, ECF_CONST, fmod, binary)
DEF_INTERNAL_FLT_FN (POW, ECF_CONST, pow, binary)
DEF_INTERNAL_FLT_FN (REMAINDER, ECF_CONST, remainder, binary)
DEF_INTERNAL_FLT_FN (SCALB, ECF_CONST, scalb, binary)
+DEF_INTERNAL_FLT_FN (FMIN, ECF_CONST, fmin, binary)
+DEF_INTERNAL_FLT_FN (FMAX, ECF_CONST, fmax, binary)
/* FP scales. */
DEF_INTERNAL_FLT_FN (LDEXP, ECF_CONST, ldexp, binary)
diff --git a/gcc/optabs.def b/gcc/optabs.def
index c141a3ca6ff..20e4225d733 100644
--- a/gcc/optabs.def
+++ b/gcc/optabs.def
@@ -253,6 +253,10 @@ OPTAB_D (sin_optab, "sin$a2")
OPTAB_D (sincos_optab, "sincos$a3")
OPTAB_D (tan_optab, "tan$a2")
+/* C99 implementations of fmax/fmin. */
+OPTAB_D (fmax_optab, "fmax$a3")
+OPTAB_D (fmin_optab, "fmin$a3")
+
/* Vector reduction to a scalar. */
OPTAB_D (reduc_smax_scal_optab, "reduc_smax_scal_$a")
OPTAB_D (reduc_smin_scal_optab, "reduc_smin_scal_$a")