Source-Changes-HG archive

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

[src/netbsd-7]: src Pull up following revision(s) (requested by joerg in tick...



details:   https://anonhg.NetBSD.org/src/rev/1ff9774c385d
branches:  netbsd-7
changeset: 799369:1ff9774c385d
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon May 25 09:05:25 2015 +0000

description:
Pull up following revision(s) (requested by joerg in ticket #790):
        sys/arch/powerpc/include/math.h: revision 1.5
        lib/libm/src/namespace.h: revision 1.13
        lib/libm/arch/vax/n_support.S: revision 1.10
        lib/libm/src/s_copysignl.c: revision 1.3
        lib/libm/src/s_copysignl.c: revision 1.4
        lib/libm/src/s_copysignl.c: revision 1.5
        sys/arch/powerpc/include/ieee.h: revision 1.6
        lib/libm/src/s_copysign.c: revision 1.12
        lib/libm/src/s_copysign.c: revision 1.13
- Support copysignl on PowerPC.
- Define copysignl on !long double platforms. Be consistent in the use of
  weak aliases.
- copysignl is also needed for PowerPC's double-double format, so special
  case that. Functional support was added earlier, but not enabled.

diffstat:

 lib/libm/arch/vax/n_support.S   |   5 +++--
 lib/libm/src/namespace.h        |   3 ++-
 lib/libm/src/s_copysign.c       |   7 ++++++-
 lib/libm/src/s_copysignl.c      |  25 +++++++++++++++++++++++--
 sys/arch/powerpc/include/ieee.h |   7 ++++++-
 sys/arch/powerpc/include/math.h |   3 ++-
 6 files changed, 42 insertions(+), 8 deletions(-)

diffs (135 lines):

diff -r b975c71d974a -r 1ff9774c385d lib/libm/arch/vax/n_support.S
--- a/lib/libm/arch/vax/n_support.S     Sun May 24 11:16:19 2015 +0000
+++ b/lib/libm/arch/vax/n_support.S     Mon May 25 09:05:25 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_support.S,v 1.9 2014/03/15 14:12:56 martin Exp $     */
+/*     $NetBSD: n_support.S,v 1.9.4.1 2015/05/25 09:05:25 msaitoh Exp $        */
 /*
  * Copyright (c) 1985, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,8 @@
 #include <machine/asm.h>
 
 WEAK_ALIAS(logbl,logb)
-WEAK_ALIAS(copysignl, copysign)
+WEAK_ALIAS(copysignl, _copysignl)
+WEAK_ALIAS(_copysignl, copysign)
 
        .text
 _sccsid:
diff -r b975c71d974a -r 1ff9774c385d lib/libm/src/namespace.h
--- a/lib/libm/src/namespace.h  Sun May 24 11:16:19 2015 +0000
+++ b/lib/libm/src/namespace.h  Mon May 25 09:05:25 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.11 2014/06/16 12:54:43 joerg Exp $ */
+/* $NetBSD: namespace.h,v 1.11.2.1 2015/05/25 09:05:25 msaitoh Exp $ */
 
 #define atan2 _atan2
 #define atan2f _atan2f
@@ -46,6 +46,7 @@
 #define scalblnf _scalblnf
 #define scalblnl _scalblnl
 
+#define copysignl _copysignl
 #define sqrtl _sqrtl
 #define cbrtl _cbrtl
 #define ceill _ceill
diff -r b975c71d974a -r 1ff9774c385d lib/libm/src/s_copysign.c
--- a/lib/libm/src/s_copysign.c Sun May 24 11:16:19 2015 +0000
+++ b/lib/libm/src/s_copysign.c Mon May 25 09:05:25 2015 +0000
@@ -12,7 +12,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_copysign.c,v 1.11 2002/05/26 22:01:54 wiz Exp $");
+__RCSID("$NetBSD: s_copysign.c,v 1.11.74.1 2015/05/25 09:05:25 msaitoh Exp $");
 #endif
 
 /*
@@ -24,6 +24,11 @@
 #include "math.h"
 #include "math_private.h"
 
+#if !defined(__HAVE_LONG_DOUBLE) && !defined(__HAVE_IBM_LONGDOUBLE)
+__strong_alias(_copysignl, copysign)
+__weak_alias(copysignl, copysign)
+#endif
+
 double
 copysign(double x, double y)
 {
diff -r b975c71d974a -r 1ff9774c385d lib/libm/src/s_copysignl.c
--- a/lib/libm/src/s_copysignl.c        Sun May 24 11:16:19 2015 +0000
+++ b/lib/libm/src/s_copysignl.c        Mon May 25 09:05:25 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: s_copysignl.c,v 1.2 2010/09/17 20:39:39 christos Exp $ */
+/*     $NetBSD: s_copysignl.c,v 1.2.24.1 2015/05/25 09:05:25 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,11 +26,18 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: s_copysignl.c,v 1.2 2010/09/17 20:39:39 christos Exp $");
+__RCSID("$NetBSD: s_copysignl.c,v 1.2.24.1 2015/05/25 09:05:25 msaitoh Exp $");
+#include "namespace.h"
 
 #include <math.h>
 #include <machine/ieee.h>
 
+#if defined(__HAVE_LONG_DOUBLE) || defined(__HAVE_IBM_LONGDOUBLE)
+
+#ifdef __weak_alias
+__weak_alias(copysignl, _copysignl)
+#endif
+
 /*
  * copysignl(long double x, long double y)
  * This function returns a value with the magnitude of x and the sign of y.
@@ -48,4 +55,18 @@
 
        return (ux.extu_ld);
 }
+#elif defined(__HAVE_IBM_LONGDOUBLE)
+long double
+copysignl(long double x, long double y)
+{
+       union ldbl_u ux, uy;
+
+       ux.ldblu_ld = x;
+       uy.ldblu_ld = y;
+       ux.ldblu_d[0] = copysign(ux.ldblu_d[0], uy.ldblu_d[0]);
+       ux.ldblu_d[1] = copysign(ux.ldblu_d[1], uy.ldblu_d[1]);
+
+       return ux.ldblu_ld;
+}
 #endif
+#endif /* __HAVE_LONG_DOUBLE || __HAVE_IBM_LONGDOUBLE */
diff -r b975c71d974a -r 1ff9774c385d sys/arch/powerpc/include/ieee.h
--- a/sys/arch/powerpc/include/ieee.h   Sun May 24 11:16:19 2015 +0000
+++ b/sys/arch/powerpc/include/ieee.h   Mon May 25 09:05:25 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee.h,v 1.5 2005/12/11 12:18:43 christos Exp $        */
+/*     $NetBSD: ieee.h,v 1.5.140.1 2015/05/25 09:05:25 msaitoh Exp $   */
 
 #include <sys/ieee754.h>
 
@@ -11,3 +11,8 @@
 #define        SNG_QUIETNAN    (1 << 22)
 #define        DBL_QUIETNAN    (1 << 19)
 #endif
+
+union ldbl_u {
+       long double     ldblu_ld;
+       double          ldblu_d[2];
+};
diff -r b975c71d974a -r 1ff9774c385d sys/arch/powerpc/include/math.h
--- a/sys/arch/powerpc/include/math.h   Sun May 24 11:16:19 2015 +0000
+++ b/sys/arch/powerpc/include/math.h   Mon May 25 09:05:25 2015 +0000
@@ -1,3 +1,4 @@
-/*     $NetBSD: math.h,v 1.4 2002/02/19 13:08:15 simonb Exp $  */
+/*     $NetBSD: math.h,v 1.4.184.1 2015/05/25 09:05:25 msaitoh Exp $   */
 
 #define        __HAVE_NANF
+#define __HAVE_IBM_LONGDOUBLE  /* Uses double-double as long double */



Home | Main Index | Thread Index | Old Index