Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/lib/libm Pullup the following revisions, requested by chr...
details: https://anonhg.NetBSD.org/src/rev/e627191d3194
branches: netbsd-7
changeset: 798424:e627191d3194
user: martin <martin%NetBSD.org@localhost>
date: Mon Oct 13 19:34:58 2014 +0000
description:
Pullup the following revisions, requested by christos in #138:
src/lib/libm/Makefile 1.165-1.166
src/lib/libm/shlib_version 1.14
src/lib/libm/arch/vax/n_atan2.S 1.9
src/lib/libm/arch/vax/n_cabs.S 1.7
src/lib/libm/arch/vax/n_sincos.S 1.9
src/lib/libm/arch/vax/n_sqrt.S 1.10-1.11
src/lib/libm/complex/Makefile.inc 1.5-1.8
src/lib/libm/complex/cabsl.c 1.1
src/lib/libm/complex/cacoshl.c 1.1
src/lib/libm/complex/cacosl.c 1.1
src/lib/libm/complex/cargl.c 1.1
src/lib/libm/complex/casinhl.c 1.1
src/lib/libm/complex/casinl.c 1.1
src/lib/libm/complex/catanhl.c 1.1
src/lib/libm/complex/catanl.c 1.1
src/lib/libm/complex/ccoshl.c 1.1
src/lib/libm/complex/ccosl.c 1.1
src/lib/libm/complex/cephes_subrl.c 1.1
src/lib/libm/complex/cephes_subrl.h 1.1
src/lib/libm/complex/cexpl.c 1.1
src/lib/libm/complex/clogl.c 1.1
src/lib/libm/complex/cpowl.c 1.1
src/lib/libm/complex/cprojl.c 1.7
src/lib/libm/complex/csinhl.c 1.1
src/lib/libm/complex/csinl.c 1.1
src/lib/libm/complex/csqrtl.c 1.1
src/lib/libm/complex/ctanhl.c 1.1
src/lib/libm/complex/ctanl.c 1.1
src/lib/libm/man/acosh.3 1.17
src/lib/libm/man/asinh.3 1.17
src/lib/libm/man/atanh.3 1.17
src/lib/libm/noieee_src/n_atan2.c 1.7
src/lib/libm/noieee_src/n_cosh.c 1.9
src/lib/libm/noieee_src/n_exp.c 1.9
src/lib/libm/noieee_src/n_log.c 1.8
src/lib/libm/noieee_src/n_pow.c 1.10-1.11
src/lib/libm/noieee_src/n_sincos.c 1.7
src/lib/libm/noieee_src/n_sinh.c 1.8
Import the missing complex support routines from FreeBSD so we can
enable C++ 2011 mode for libstc++.
diffstat:
lib/libm/Makefile | 22 ++++-
lib/libm/arch/vax/n_atan2.S | 3 +-
lib/libm/arch/vax/n_cabs.S | 4 +-
lib/libm/arch/vax/n_sincos.S | 10 ++-
lib/libm/arch/vax/n_sqrt.S | 3 +-
lib/libm/complex/Makefile.inc | 35 +++-------
lib/libm/complex/cabsl.c | 16 ++++
lib/libm/complex/cacoshl.c | 45 +++++++++++++
lib/libm/complex/cacosl.c | 45 +++++++++++++
lib/libm/complex/cargl.c | 16 ++++
lib/libm/complex/casinhl.c | 42 +++++++++++++
lib/libm/complex/casinl.c | 120 +++++++++++++++++++++++++++++++++++++
lib/libm/complex/catanhl.c | 42 +++++++++++++
lib/libm/complex/catanl.c | 80 ++++++++++++++++++++++++
lib/libm/complex/ccoshl.c | 46 ++++++++++++++
lib/libm/complex/ccosl.c | 46 ++++++++++++++
lib/libm/complex/cephes_subrl.c | 129 ++++++++++++++++++++++++++++++++++++++++
lib/libm/complex/cephes_subrl.h | 9 ++
lib/libm/complex/cexpl.c | 47 ++++++++++++++
lib/libm/complex/clogl.c | 47 ++++++++++++++
lib/libm/complex/cpowl.c | 57 +++++++++++++++++
lib/libm/complex/cprojl.c | 6 +-
lib/libm/complex/csinhl.c | 46 ++++++++++++++
lib/libm/complex/csinl.c | 46 ++++++++++++++
lib/libm/complex/csqrtl.c | 114 +++++++++++++++++++++++++++++++++++
lib/libm/complex/ctanhl.c | 48 ++++++++++++++
lib/libm/complex/ctanl.c | 59 ++++++++++++++++++
lib/libm/man/acosh.3 | 12 +-
lib/libm/man/asinh.3 | 12 +-
lib/libm/man/atanh.3 | 12 +-
lib/libm/noieee_src/n_atan2.c | 6 +-
lib/libm/noieee_src/n_cosh.c | 3 +-
lib/libm/noieee_src/n_exp.c | 3 +-
lib/libm/noieee_src/n_log.c | 3 +-
lib/libm/noieee_src/n_pow.c | 15 ++--
lib/libm/noieee_src/n_sincos.c | 7 +-
lib/libm/noieee_src/n_sinh.c | 3 +-
lib/libm/shlib_version | 4 +-
38 files changed, 1192 insertions(+), 71 deletions(-)
diffs (truncated from 1630 to 300 lines):
diff -r cd0eecdc902a -r e627191d3194 lib/libm/Makefile
--- a/lib/libm/Makefile Mon Oct 13 19:00:16 2014 +0000
+++ b/lib/libm/Makefile Mon Oct 13 19:34:58 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.164 2014/08/11 08:20:57 mrg Exp $
+# $NetBSD: Makefile,v 1.164.2.1 2014/10/13 19:34:58 martin Exp $
#
# @(#)Makefile 5.1beta 93/09/24
#
@@ -66,17 +66,14 @@
ARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
COPTS+= -mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
.elif (${LIBC_MACHINE_CPU} == "arm")
-.PATH: ${.CURDIR}/arch/arm
+.PATH.c: ${.CURDIR}/arch/arm
COMMON_SRCS+= fenv.c s_nexttowardf.c \
s_nearbyint.c s_rintl.c
COPTS.e_sqrtl.c += -DHAVE_FENV_H
COPTS.fenv.c+= -mfpu=vfp
.if (${MKSOFTFLOAT} == "no")
+.PATH.S: ${.CURDIR}/arch/arm
ARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
-.else
-.for i in e_sqrt.o e_sqrtf.o lrint.o lrintf.o s_fabsf.o s_fma.o s_fmaf.o
-${i} ${i:.o=.po} ${i:.o=.pico} ${i:.o=.go} ${i:.o=.ln}: ${i:.o=.c}
-.endfor
.endif
.elif (${LIBC_MACHINE_ARCH} == "sparc")
.PATH: ${.CURDIR}/arch/sparc
@@ -150,6 +147,19 @@
# and emulation code isn't written yet.
ARCH_SRCS = n_scalbn.S
WARNS?=5
+.elif (${LIBC_MACHINE_CPU} == "riscv")
+.PATH: ${.CURDIR}/arch/riscv
+
+COMMON_SRCS += fenv.c
+
+.if ${MKSOFTFLOAT} == "no"
+ARCH_SRCS = e_sqrt.S e_sqrtf.S
+ARCH_SRCS += s_copysign.S s_copysignf.S
+ARCH_SRCS += s_fabs.S s_fabsf.S
+ARCH_SRCS += s_fma.S s_fmaf.S
+ARCH_SRCS += s_fmax.S s_fmaxf.S
+ARCH_SRCS += s_fmin.S s_fminf.S
+.endif
.endif
WARNS?=5
diff -r cd0eecdc902a -r e627191d3194 lib/libm/arch/vax/n_atan2.S
--- a/lib/libm/arch/vax/n_atan2.S Mon Oct 13 19:00:16 2014 +0000
+++ b/lib/libm/arch/vax/n_atan2.S Mon Oct 13 19:34:58 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_atan2.S,v 1.8 2008/03/20 18:49:39 mhitch Exp $ */
+/* $NetBSD: n_atan2.S,v 1.8.42.1 2014/10/13 19:34:58 martin Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -84,6 +84,7 @@
#ifdef WEAK_ALIAS
WEAK_ALIAS(atan2, _atan2)
+WEAK_ALIAS(_atan2l, _atan2)
#endif
ENTRY(_atan2, 0x0fc0)
diff -r cd0eecdc902a -r e627191d3194 lib/libm/arch/vax/n_cabs.S
--- a/lib/libm/arch/vax/n_cabs.S Mon Oct 13 19:00:16 2014 +0000
+++ b/lib/libm/arch/vax/n_cabs.S Mon Oct 13 19:34:58 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_cabs.S,v 1.6 2008/03/20 16:41:26 mhitch Exp $ */
+/* $NetBSD: n_cabs.S,v 1.6.42.1 2014/10/13 19:34:58 martin Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -55,6 +55,8 @@
#ifdef WEAK_ALIAS
WEAK_ALIAS(hypot, _hypot)
+WEAK_ALIAS(hypotl, _hypot)
+WEAK_ALIAS(_hypotl, _hypot)
#endif
ALTENTRY(cabs)
diff -r cd0eecdc902a -r e627191d3194 lib/libm/arch/vax/n_sincos.S
--- a/lib/libm/arch/vax/n_sincos.S Mon Oct 13 19:00:16 2014 +0000
+++ b/lib/libm/arch/vax/n_sincos.S Mon Oct 13 19:34:58 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_sincos.S,v 1.8 2003/08/07 16:44:45 agc Exp $ */
+/* $NetBSD: n_sincos.S,v 1.8.74.1 2014/10/13 19:34:58 martin Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -52,6 +52,10 @@
cvtdf %r0,%r0
ret
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(_sinl, sin)
+#endif
+
ENTRY(sin, 0xfc0)
movq 4(%ap),%r0
bicw3 $0x807f,%r0,%r2
@@ -87,6 +91,10 @@
cvtdf %r0,%r0
ret
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(_cosl, cos)
+#endif
+
ENTRY(cos, 0x0fc0)
movq 4(%ap),%r0
bicw3 $0x7f,%r0,%r2
diff -r cd0eecdc902a -r e627191d3194 lib/libm/arch/vax/n_sqrt.S
--- a/lib/libm/arch/vax/n_sqrt.S Mon Oct 13 19:00:16 2014 +0000
+++ b/lib/libm/arch/vax/n_sqrt.S Mon Oct 13 19:34:58 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: n_sqrt.S,v 1.9 2014/03/06 11:00:17 martin Exp $ */
+/* $NetBSD: n_sqrt.S,v 1.9.4.1 2014/10/13 19:34:58 martin Exp $ */
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
@@ -33,6 +33,7 @@
#include <machine/asm.h>
#ifdef WEAK_ALIAS
+WEAK_ALIAS(_sqrtl, sqrt)
WEAK_ALIAS(sqrtl, sqrt)
#endif
diff -r cd0eecdc902a -r e627191d3194 lib/libm/complex/Makefile.inc
--- a/lib/libm/complex/Makefile.inc Mon Oct 13 19:00:16 2014 +0000
+++ b/lib/libm/complex/Makefile.inc Mon Oct 13 19:34:58 2014 +0000
@@ -1,29 +1,14 @@
-# $NetBSD: Makefile.inc,v 1.4 2011/03/18 00:57:22 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.4.22.1 2014/10/13 19:34:58 martin Exp $
.PATH: ${.CURDIR}/complex
-SRCS+= cabs.c cabsf.c carg.c cargf.c
-SRCS+= creal.c crealf.c creall.c cimag.c cimagf.c cimagl.c
-SRCS+= conj.c conjf.c conjl.c
-SRCS+= csqrt.c cexp.c clog.c cpow.c
-SRCS+= cephes_subr.c csin.c ccos.c ctan.c csinh.c ccosh.c ctanh.c
-SRCS+= casin.c cacos.c catan.c casinh.c cacosh.c catanh.c
-SRCS+= csqrtf.c cexpf.c clogf.c cpowf.c
-SRCS+= cephes_subrf.c csinf.c ccosf.c ctanf.c csinhf.c ccoshf.c ctanhf.c
-SRCS+= casinf.c cacosf.c catanf.c casinhf.c cacoshf.c catanhf.c
-SRCS+= cproj.c cprojf.c cprojl.c
+COMPLEX_SRCS = cabs.c cacos.c cacosh.c carg.c casin.c casinh.c catan.c \
+ ccos.c ccosh.c cephes_subr.c cexp.c clog.c conj.c cpow.c cproj.c \
+ cimag.c creal.c csin.c csinh.c csqrt.c ctan.c ctanh.c catanh.c
-MAN+= cabs.3 cacos.3 cacosh.3 carg.3 casin.3 casinh.3 catan.3 catanh.3
-MAN+= ccos.3 ccosh.3 cexp.3 cimag.3 clog.3 conj.3 cpow.3 cproj.3 creal.3
-MAN+= csin.3 csinh.3 csqrt.3 ctan.3 ctanh.3
-
-MLINKS+= cabs.3 cabsf.3 cacos.3 cacosf.3 cacosh.3 cacoshf.3
-MLINKS+= carg.3 cargf.3 casin.3 casinf.3 casinh.3 casinhf.3
-MLINKS+= catan.3 catanf.3 catanh.3 catanhf.3 ccos.3 ccosf.3
-MLINKS+= ccosh.3 ccoshf.3 cexp.3 cexpf.3
-MLINKS+= cimag.3 cimagf.3 cimag.3 cimagl.3
-MLINKS+= clog.3 clogf.3 conj.3 conjf.3 conj.3 conjl.3 cpow.3 cpowf.3
-MLINKS+= cproj.3 cprojf.3 cproj.3 cprojl.3
-MLINKS+= creal.3 crealf.3 creal.3 creall.3
-MLINKS+= csin.3 csinf.3 csinh.3 csinhf.3
-MLINKS+= csqrt.3 csqrtf.3 ctan.3 ctanf.3 ctanh.3 ctanhf.3
+.for i in ${COMPLEX_SRCS}
+SRCS+= $i ${i:S/.c/f.c/} ${i:S/.c/l.c/}
+MAN+= ${i:Ncephes_*:S/.c/.3/}
+MLINKS+= ${i:Ncephes_*:S/.c/.3/} ${i:Ncephes_*:S/.c/f.3/}
+MLINKS+= ${i:Ncephes_*:S/.c/.3/} ${i:Ncephes_*:S/.c/l.3/}
+.endfor
diff -r cd0eecdc902a -r e627191d3194 lib/libm/complex/cabsl.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/complex/cabsl.c Mon Oct 13 19:34:58 2014 +0000
@@ -0,0 +1,16 @@
+/* $NetBSD: cabsl.c,v 1.1.2.2 2014/10/13 19:34:58 martin Exp $ */
+
+/*
+ * Public domain.
+ */
+
+#include "../src/namespace.h"
+#include <complex.h>
+#include <math.h>
+
+long double
+cabsl(long double complex z)
+{
+
+ return hypotl(__real__ z, __imag__ z);
+}
diff -r cd0eecdc902a -r e627191d3194 lib/libm/complex/cacoshl.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/complex/cacoshl.c Mon Oct 13 19:34:58 2014 +0000
@@ -0,0 +1,45 @@
+/* $NetBSD: cacoshl.c,v 1.1.2.2 2014/10/13 19:34:58 martin Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <complex.h>
+
+long double complex
+cacoshl(long double complex z)
+{
+ long double complex w;
+
+#if 0 /* does not give the principal value */
+ w = I * cacosl(z);
+#else
+ w = clogl(z + csqrtl(z + 1) * csqrtl(z - 1));
+#endif
+ return w;
+}
diff -r cd0eecdc902a -r e627191d3194 lib/libm/complex/cacosl.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/complex/cacosl.c Mon Oct 13 19:34:58 2014 +0000
@@ -0,0 +1,45 @@
+/* $NetBSD: cacosl.c,v 1.1.2.2 2014/10/13 19:34:58 martin Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "../src/namespace.h"
+#include <complex.h>
+#include <math.h>
+#include "cephes_subrl.h"
+
+long double complex
+cacosl(long double complex z)
+{
+ long double complex w;
+
+ w = casinl(z);
+ w = (M_PI_2L - creall(w)) - cimagl(w) * I;
+ return w;
+}
diff -r cd0eecdc902a -r e627191d3194 lib/libm/complex/cargl.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libm/complex/cargl.c Mon Oct 13 19:34:58 2014 +0000
@@ -0,0 +1,16 @@
+/* $NetBSD: cargl.c,v 1.1.2.2 2014/10/13 19:34:58 martin Exp $ */
+
+/*
Home |
Main Index |
Thread Index |
Old Index