Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libm Imlementations of fmax, fmaxf, fmin and fminf libm ...



details:   https://anonhg.NetBSD.org/src/rev/2c27a44c4392
branches:  trunk
changeset: 760601:2c27a44c4392
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Jan 09 02:32:13 2011 +0000

description:
Imlementations of fmax, fmaxf, fmin and fminf libm functions for VAX.

diffstat:

 lib/libm/Makefile             |   5 +++--
 lib/libm/noieee_src/n_fmax.c  |  38 ++++++++++++++++++++++++++++++++++++++
 lib/libm/noieee_src/n_fmaxf.c |  38 ++++++++++++++++++++++++++++++++++++++
 lib/libm/noieee_src/n_fmin.c  |  38 ++++++++++++++++++++++++++++++++++++++
 lib/libm/noieee_src/n_fminf.c |  38 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 155 insertions(+), 2 deletions(-)

diffs (187 lines):

diff -r abbb7b0093f3 -r 2c27a44c4392 lib/libm/Makefile
--- a/lib/libm/Makefile Sun Jan 09 01:00:40 2011 +0000
+++ b/lib/libm/Makefile Sun Jan 09 02:32:13 2011 +0000
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.99 2010/12/09 22:52:59 abs Exp $
+#  $NetBSD: Makefile,v 1.100 2011/01/09 02:32:13 jakllsch Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -163,7 +163,8 @@
        n_lgamma.c n_j0.c n_j1.c n_jn.c n_log.c n_log10.c n_log1p.c \
        n_log__L.c n_pow.c n_sinh.c n_tanh.c \
        n_sincos.c n_tan.c \
-       n_round.c n_roundf.c n_lround.c n_lroundf.c
+       n_round.c n_roundf.c n_lround.c n_lroundf.c \
+       n_fmax.c n_fmaxf.c n_fmin.c n_fminf.c
 #      n_sqrt.c n_argred.c n_infnan.c n_atan2.c n_cabs.c n_cbrt.c n_support.c
 
 
diff -r abbb7b0093f3 -r 2c27a44c4392 lib/libm/noieee_src/n_fmax.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/noieee_src/n_fmax.c      Sun Jan 09 02:32:13 2011 +0000
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011 Jonathan A. Kollasch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBM_SCCS) && !defined(lint)
+__RCSID("$NetBSD: n_fmax.c,v 1.1 2011/01/09 02:32:13 jakllsch Exp $");
+#endif
+
+#include <math.h>
+
+double
+fmax(double x, double y)
+{
+       return x > y ? x : y;
+}
diff -r abbb7b0093f3 -r 2c27a44c4392 lib/libm/noieee_src/n_fmaxf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/noieee_src/n_fmaxf.c     Sun Jan 09 02:32:13 2011 +0000
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011 Jonathan A. Kollasch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBM_SCCS) && !defined(lint)
+__RCSID("$NetBSD: n_fmaxf.c,v 1.1 2011/01/09 02:32:13 jakllsch Exp $");
+#endif
+
+#include <math.h>
+
+float
+fmaxf(float x, float y)
+{
+       return x > y ? x : y;
+}
diff -r abbb7b0093f3 -r 2c27a44c4392 lib/libm/noieee_src/n_fmin.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/noieee_src/n_fmin.c      Sun Jan 09 02:32:13 2011 +0000
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011 Jonathan A. Kollasch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBM_SCCS) && !defined(lint)
+__RCSID("$NetBSD: n_fmin.c,v 1.1 2011/01/09 02:32:13 jakllsch Exp $");
+#endif
+
+#include <math.h>
+
+double
+fmin(double x, double y)
+{
+       return x < y ? x : y;
+}
diff -r abbb7b0093f3 -r 2c27a44c4392 lib/libm/noieee_src/n_fminf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/noieee_src/n_fminf.c     Sun Jan 09 02:32:13 2011 +0000
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011 Jonathan A. Kollasch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBM_SCCS) && !defined(lint)
+__RCSID("$NetBSD: n_fminf.c,v 1.1 2011/01/09 02:32:13 jakllsch Exp $");
+#endif
+
+#include <math.h>
+
+float
+fminf(float x, float y)
+{
+       return x < y ? x : y;
+}



Home | Main Index | Thread Index | Old Index