CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:11 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Delete duplicates.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libm/src/namespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.21 src/lib/libm/src/namespace.h:1.22
--- src/lib/libm/src/namespace.h:1.21	Sun Jun  9 13:33:03 2024
+++ src/lib/libm/src/namespace.h	Sun Jun  9 13:33:11 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.21 2024/06/09 13:33:03 riastradh Exp $ */
+/* $NetBSD: namespace.h,v 1.22 2024/06/09 13:33:11 riastradh Exp $ */
 
 #define acoshl _acoshl
 #define acosl _acosl
@@ -25,7 +25,6 @@
 #define cosh _cosh
 #define coshf _coshf
 #define coshl _coshl
-#define coshl _coshl
 #define cosl _cosl
 #define cospi _cospi
 #define cospif _cospif
@@ -86,7 +85,6 @@
 #define sinh _sinh
 #define sinhf _sinhf
 #define sinhl _sinhl
-#define sinhl _sinhl
 #define sinl _sinl
 #define sinpi _sinpi
 #define sinpif _sinpif



CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:11 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Delete duplicates.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libm/src/namespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:03 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Sort.

No functional change intended.

Grouping vaguely by functionality makes this painful to update.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libm/src/namespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.20 src/lib/libm/src/namespace.h:1.21
--- src/lib/libm/src/namespace.h:1.20	Wed May  8 01:40:27 2024
+++ src/lib/libm/src/namespace.h	Sun Jun  9 13:33:03 2024
@@ -1,109 +1,47 @@
-/* $NetBSD: namespace.h,v 1.20 2024/05/08 01:40:27 riastradh Exp $ */
+/* $NetBSD: namespace.h,v 1.21 2024/06/09 13:33:03 riastradh Exp $ */
 
-#define atan2 _atan2
-#define atan2f _atan2f
-#define atan2l _atan2l
-#define hypot _hypot
-#define hypotf _hypotf
-#define hypotl _hypotl
-
-#define exp _exp
-#define expf _expf
-#define expl _expl
-#define expm1l _expm1l
-#define log _log
-#define logf _logf
-#define logl _logl
-
-#define sin _sin
-#define sinf _sinf
-#define cos _cos
-#define cosf _cosf
-#define tan _tan
-#define tanf _tanf
-
-#define finite _finite
-#define finitef _finitef
-
-#define sincos _sincos
-#define sincosf _sincosf
-#define sincosl _sincosl
-#define sinh _sinh
-#define sinhf _sinhf
-#define sinhl _sinhl
-#define cosh _cosh
-#define coshf _coshf
-#define coshl _coshl
+#define acoshl _acoshl
+#define acosl _acosl
 #define asin _asin
 #define asinf _asinf
+#define asinhl _asinhl
 #define asinl _asinl
-
-#define remquo _remquo
-#define remquof _remquof
-#define remquol _remquol
-
+#define atan2 _atan2
+#define atan2f _atan2f
+#define atan2l _atan2l
+#define atanhl _atanhl
+#define atanl _atanl
 #define casin _casin
 #define casinf _casinf
 #define casinl _casinl
 #define catan _catan
 #define catanf _catanf
 #define catanl _catanl
-
-#define scalbn _scalbn
-#define scalbnf _scalbnf
-#define scalbnl _scalbnl
-#define scalbln _scalbln
-#define scalblnf _scalblnf
-#define scalblnl _scalblnl
-
-#define copysignl _copysignl
-#define sqrtl _sqrtl
 #define cbrtl _cbrtl
 #define ceill _ceill
-#define floorl _floorl
-#define roundl _roundl
-#define fmodl _fmodl
-#define modfl _modfl
-#define truncl _truncl
-
-#define exp2l _exp2l
-#define cosl _cosl
-#define sinl _sinl
-#define tanl _tanl
-#define powl _powl
+#define copysignl _copysignl
+#define cos _cos
+#define cosf _cosf
+#define cosh _cosh
+#define coshf _coshf
 #define coshl _coshl
-#define sinhl _sinhl
-#define acosl _acosl
-#define atanl _atanl
-#define asinhl _asinhl
-#define acoshl _acoshl
-#define tanhl _tanhl
-#define atanhl _atanhl
-#define log10l _log10l
-#define log1pl _log1pl
-#define log2l _log2l
-
+#define coshl _coshl
+#define cosl _cosl
 #define cospi _cospi
 #define cospif _cospif
 #define cospil _cospil
-
-#define sinpi _sinpi
-#define sinpif _sinpif
-#define sinpil _sinpil
-
-#define tanpi _tanpi
-#define tanpif _tanpif
-#define tanpil _tanpil
-
-#define erfl _erfl
 #define erfcl _erfcl
-
-#define lgammal _lgammal
-#define lgammal_r _lgammal_r
-#define tgammal _tgammal
-
+#define erfl _erfl
+#define exp _exp
+#define exp2l _exp2l
+#define expf _expf
+#define expl _expl
+#define expm1l _expm1l
 #define feclearexcept _feclearexcept
+#define fedisableexcept _fedisableexcept
+#define feenableexcept _feenableexcept
 #define fegetenv _fegetenv
+#define fegetexcept _fegetexcept
 #define fegetexceptflag _fegetexceptflag
 #define fegetround _fegetround
 #define feholdexcept _feholdexcept
@@ -113,7 +51,53 @@
 #define fesetround _fesetround
 #define fetestexcept _fetestexcept
 #define feupdateenv _feupdateenv
-
-#define fedisableexcept _fedisableexcept
-#define feenableexcept _feenableexcept
-#define fegetexcept _fegetexcept
+#define finite _finite
+#define finitef _finitef
+#define floorl _floorl
+#define fmodl _fmodl
+#define hypot _hypot
+#define hypotf _hypotf
+#define hypotl _hypotl
+#define lgammal _lgammal
+#define lgammal_r _lgammal_r
+#define log _log
+#define log10l _log10l
+#define log1pl _log1pl
+#define log2l _log2l
+#define logf _logf
+#define logl _logl
+#define modfl _modfl
+#define powl _powl
+#define remquo _remquo
+#define remquof _remquof
+#define remquol _remquol
+#define roundl _roundl
+#define scalbln _scalbln
+#define scalblnf _scalblnf
+#define scalblnl _scalblnl
+#define scalbn _scalbn
+#define scalbnf _scalbnf
+#define scalbnl _scalbnl
+#define sin _sin
+#define sincos _sincos
+#define sincosf _sincosf
+#define sincosl _sincosl
+#define sinf _sinf
+#define sinh _sinh
+#define sinhf _sinhf
+#define sinhl _sinhl
+#define sinhl _sinhl
+#define sinl _sinl
+#define sinpi _sinpi
+#define sinpif _sinpif
+#define sinpil _sinpil
+#define sqrtl _sqrtl
+#define tan _tan
+#define tanf _tanf
+#define tanhl _tanhl
+#define tanl _tanl
+#define tanpi _tanpi
+#define tanpif 

CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:03 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Sort.

No functional change intended.

Grouping vaguely by functionality makes this painful to update.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libm/src/namespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 01:58:52 UTC 2024

Removed Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: ldbl_dummy.c is no longer needed -- nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/lib/libm/src/ldbl_dummy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 01:58:52 UTC 2024

Removed Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: ldbl_dummy.c is no longer needed -- nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/lib/libm/src/ldbl_dummy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-05-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May  5 22:10:06 UTC 2024

Modified Files:
src/lib/libm/src: s_nextafter.c

Log Message:
libm: If long double is double, nexttowardl is nextafter.

long double nexttowardl(long double, long double);
double nextafter(double, double);


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libm/src/s_nextafter.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_nextafter.c
diff -u src/lib/libm/src/s_nextafter.c:1.16 src/lib/libm/src/s_nextafter.c:1.17
--- src/lib/libm/src/s_nextafter.c:1.16	Wed Aug 16 11:22:52 2017
+++ src/lib/libm/src/s_nextafter.c	Sun May  5 22:10:06 2024
@@ -12,7 +12,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_nextafter.c,v 1.16 2017/08/16 11:22:52 he Exp $");
+__RCSID("$NetBSD: s_nextafter.c,v 1.17 2024/05/05 22:10:06 riastradh Exp $");
 #endif
 
 /* IEEE functions
@@ -28,6 +28,7 @@ __RCSID("$NetBSD: s_nextafter.c,v 1.16 2
 #ifndef __HAVE_LONG_DOUBLE
 __strong_alias(nextafterl, nextafter)
 __strong_alias(nexttoward, nextafter)
+__strong_alias(nexttowardl, nextafter)
 #endif
 
 double



CVS commit: src/lib/libm/src

2024-05-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May  5 22:10:06 UTC 2024

Modified Files:
src/lib/libm/src: s_nextafter.c

Log Message:
libm: If long double is double, nexttowardl is nextafter.

long double nexttowardl(long double, long double);
double nextafter(double, double);


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libm/src/s_nextafter.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-05-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May  5 14:06:47 UTC 2024

Modified Files:
src/lib/libm/src: s_nexttowardf.c

Log Message:
libm/s_nexttowardf.c: Handle __HAVE_LONG_DOUBLE, LDBL_IMPLICIT_NBIT.

We should arrange to just have LDBL_NBIT unconditionally defined in the
appropriate MD header file, and make LDBL_IMPLICIT_NBIT an alias for
LDBL_NBIT==0.  But for now this will do.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/s_nexttowardf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_nexttowardf.c
diff -u src/lib/libm/src/s_nexttowardf.c:1.4 src/lib/libm/src/s_nexttowardf.c:1.5
--- src/lib/libm/src/s_nexttowardf.c:1.4	Sun May  5 11:38:03 2024
+++ src/lib/libm/src/s_nexttowardf.c	Sun May  5 14:06:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_nexttowardf.c,v 1.4 2024/05/05 11:38:03 riastradh Exp $	*/
+/*	$NetBSD: s_nexttowardf.c,v 1.5 2024/05/05 14:06:47 riastradh Exp $	*/
 
 /*
  * 
@@ -15,7 +15,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_nexttowardf.c,v 1.3 2011/02/10 07:38:38 das Exp $");
 #else
-__RCSID("$NetBSD: s_nexttowardf.c,v 1.4 2024/05/05 11:38:03 riastradh Exp $");
+__RCSID("$NetBSD: s_nexttowardf.c,v 1.5 2024/05/05 14:06:47 riastradh Exp $");
 #endif
 
 #include 
@@ -42,6 +42,14 @@ __RCSID("$NetBSD: s_nexttowardf.c,v 1.4 
 #define	LDBL_NBIT	0
 #endif
 
+/*
+ * XXX We should arrange to define LDBL_NBIT unconditionally in the
+ * appropriate MD header file.
+ */
+#ifdef LDBL_IMPLICIT_NBIT
+#define	LDBL_NBIT	0
+#endif
+
 float
 nexttowardf(float x, long double y)
 {



CVS commit: src/lib/libm/src

2024-05-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May  5 14:06:47 UTC 2024

Modified Files:
src/lib/libm/src: s_nexttowardf.c

Log Message:
libm/s_nexttowardf.c: Handle __HAVE_LONG_DOUBLE, LDBL_IMPLICIT_NBIT.

We should arrange to just have LDBL_NBIT unconditionally defined in the
appropriate MD header file, and make LDBL_IMPLICIT_NBIT an alias for
LDBL_NBIT==0.  But for now this will do.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/s_nexttowardf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-05-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May  5 11:38:03 UTC 2024

Modified Files:
src/lib/libm/src: s_nexttowardf.c

Log Message:
libm: Make s_nexttowardf.c work when long double is double.

Seems likely that there are other parts of libm which would benefit
from being defined unconditionally in terms of ieee_ext_u, with
ieee_ext_u as an alias for ieee_double_u, in this scenario.  But I
haven't gone looking yet.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_nexttowardf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-05-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May  5 11:38:03 UTC 2024

Modified Files:
src/lib/libm/src: s_nexttowardf.c

Log Message:
libm: Make s_nexttowardf.c work when long double is double.

Seems likely that there are other parts of libm which would benefit
from being defined unconditionally in terms of ieee_ext_u, with
ieee_ext_u as an alias for ieee_double_u, in this scenario.  But I
haven't gone looking yet.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_nexttowardf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_nexttowardf.c
diff -u src/lib/libm/src/s_nexttowardf.c:1.3 src/lib/libm/src/s_nexttowardf.c:1.4
--- src/lib/libm/src/s_nexttowardf.c:1.3	Sat Feb  9 23:14:44 2013
+++ src/lib/libm/src/s_nexttowardf.c	Sun May  5 11:38:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_nexttowardf.c,v 1.3 2013/02/09 23:14:44 christos Exp $	*/
+/*	$NetBSD: s_nexttowardf.c,v 1.4 2024/05/05 11:38:03 riastradh Exp $	*/
 
 /*
  * 
@@ -15,7 +15,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_nexttowardf.c,v 1.3 2011/02/10 07:38:38 das Exp $");
 #else
-__RCSID("$NetBSD: s_nexttowardf.c,v 1.3 2013/02/09 23:14:44 christos Exp $");
+__RCSID("$NetBSD: s_nexttowardf.c,v 1.4 2024/05/05 11:38:03 riastradh Exp $");
 #endif
 
 #include 
@@ -25,7 +25,23 @@ __RCSID("$NetBSD: s_nexttowardf.c,v 1.3 
 #include "math.h"
 #include "math_private.h"
 
-#ifdef EXT_EXP_INFNAN
+/*
+ * On ports where long double is just double, reuse the ieee_double_u
+ * union as if it were ieee_ext_u -- broken-down components of (long)
+ * double values.
+ */
+#ifndef __HAVE_LONG_DOUBLE
+#define	ieee_ext_u	ieee_double_u
+#define	extu_ld		dblu_d
+#define	extu_ext	dblu_dbl
+#define	ext_sign	dbl_sign
+#define	ext_exp		dbl_exp
+#define	ext_frach	dbl_frach
+#define	ext_fracl	dbl_fracl
+#define	EXT_EXP_INFNAN	DBL_EXP_INFNAN
+#define	LDBL_NBIT	0
+#endif
+
 float
 nexttowardf(float x, long double y)
 {
@@ -38,7 +54,7 @@ nexttowardf(float x, long double y)
 
 	memset(, 0, sizeof(uy));
 	uy.extu_ld = y;
-	uy.extu_ext.ext_frach &= ~0x8000;
+	uy.extu_ext.ext_frach &= ~LDBL_NBIT;
 
 	if((ix>0x7f80) ||
 	   (uy.extu_ext.ext_exp == EXT_EXP_INFNAN &&
@@ -66,4 +82,3 @@ nexttowardf(float x, long double y)
 	SET_FLOAT_WORD(x,hx);
 	return x;
 }
-#endif



CVS commit: src/lib/libm/src

2024-05-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May  4 19:21:51 UTC 2024

Modified Files:
src/lib/libm/src: s_rintl.c

Log Message:
s_rintl.c: Reduce FreeBSD diff and fix on ld128 platforms.

EXT_FRACBITS, the number of bits in the _binary encoding_ that stores
the trailing significand field, is never 113.  In IEEE 754 binary128,
it is 112, even though there are 113 bits of precision in the set of
floating-point numbers -- the leading 1 bit is implicit in binary128.
So ld128 platforms like aarch64 and sparc64 were skipping the real
definition and just defining rintl as an alias for rint, which is
wrong.

In contrast, LDBL_MANT_DIG, the number of bits of precision in the set
of floating-point numbers (p, in IEEE 754 parlance), is 113 in IEEE 754
binary128.  This is also the constant used in FreeBSD libm anyway.  So
let's just use that instead of trying to translate it to our private
EXT_FRACBITS (not defined in FreeBSD) with a fencepos terror.  And
delete the buggy rintl=rint alias.

PR lib/58054


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_rintl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_rintl.c
diff -u src/lib/libm/src/s_rintl.c:1.6 src/lib/libm/src/s_rintl.c:1.7
--- src/lib/libm/src/s_rintl.c:1.6	Tue Apr  2 18:39:51 2024
+++ src/lib/libm/src/s_rintl.c	Sat May  4 19:21:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $	*/
+/*	$NetBSD: s_rintl.c,v 1.7 2024/05/04 19:21:51 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 David Schultz 
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_rintl.c,v 1.5 2008/02/22 11:59:05 bde Exp $");
 #else
-__RCSID("$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $");
+__RCSID("$NetBSD: s_rintl.c,v 1.7 2024/05/04 19:21:51 riastradh Exp $");
 #endif
 
 #include 
@@ -39,20 +39,17 @@ __RCSID("$NetBSD: s_rintl.c,v 1.6 2024/0
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __HAVE_LONG_DOUBLE
+#define	BIAS	(LDBL_MAX_EXP - 1)
 
-# if EXT_FRACBITS == 64 || EXT_FRACBITS == 113 && LDBL_MAX_EXP == 0x4000
-
-#  define BIAS (LDBL_MAX_EXP - 1)
 static const float
 shift[2] = {
-#  if EXT_FRACBITS == 64
+#if LDBL_MANT_DIG == 64
 	0x1.0p63, -0x1.0p63
-#  elif EXT_FRACBITS == 113
+#elif LDBL_MANT_DIG == 113
 	0x1.0p112, -0x1.0p112
-#  else
-#   error "Unsupported long double format"
-#  endif
+#else
+#error "Unsupported long double format"
+#endif
 };
 static const float zero[2] = { 0.0, -0.0 };
 
@@ -64,12 +61,11 @@ rintl(long double x)
 	int ex, sign;
 
 	u.extu_ld = x;
-	u.extu_ext.ext_frach &= ~0x8000;
 	expsign = GET_EXPSIGN();
 	ex = expsign & 0x7fff;
 
-	if (ex >= BIAS + EXT_FRACBITS - 1) {
-		if (ex == BIAS + EXT_FRACBITS)
+	if (ex >= BIAS + LDBL_MANT_DIG - 1) {
+		if (ex == BIAS + LDBL_MAX_EXP)
 			return (x + x);	/* Inf, NaN, or unsupported format */
 		return (x);		/* finite and already an integer */
 	}
@@ -94,13 +90,3 @@ rintl(long double x)
 
 	return (x);
 }
-# else
-
-long double
-rintl(long double x)
-{
-	return rint(x);
-}
-
-# endif
-#endif /* __HAVE_LONG_DOUBLE */



CVS commit: src/lib/libm/src

2024-05-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May  4 19:21:51 UTC 2024

Modified Files:
src/lib/libm/src: s_rintl.c

Log Message:
s_rintl.c: Reduce FreeBSD diff and fix on ld128 platforms.

EXT_FRACBITS, the number of bits in the _binary encoding_ that stores
the trailing significand field, is never 113.  In IEEE 754 binary128,
it is 112, even though there are 113 bits of precision in the set of
floating-point numbers -- the leading 1 bit is implicit in binary128.
So ld128 platforms like aarch64 and sparc64 were skipping the real
definition and just defining rintl as an alias for rint, which is
wrong.

In contrast, LDBL_MANT_DIG, the number of bits of precision in the set
of floating-point numbers (p, in IEEE 754 parlance), is 113 in IEEE 754
binary128.  This is also the constant used in FreeBSD libm anyway.  So
let's just use that instead of trying to translate it to our private
EXT_FRACBITS (not defined in FreeBSD) with a fencepos terror.  And
delete the buggy rintl=rint alias.

PR lib/58054


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_rintl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 14:54:51 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
need  for i386.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_cbrtl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_cbrtl.c
diff -u src/lib/libm/src/s_cbrtl.c:1.2 src/lib/libm/src/s_cbrtl.c:1.3
--- src/lib/libm/src/s_cbrtl.c:1.2	Tue Apr  2 21:51:01 2024
+++ src/lib/libm/src/s_cbrtl.c	Wed Apr  3 10:54:50 2024
@@ -14,10 +14,11 @@
  * and David A. Schultz.
  */
 #include 
-__RCSID("$NetBSD: s_cbrtl.c,v 1.2 2024/04/03 01:51:01 christos Exp $");
+__RCSID("$NetBSD: s_cbrtl.c,v 1.3 2024/04/03 14:54:50 christos Exp $");
 
 
 #include "namespace.h"
+#include 
 #include 
 #include 
 



CVS commit: src/lib/libm/src

2024-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 14:54:51 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
need  for i386.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_cbrtl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-04-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Apr  3 04:40:23 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
For i386, if ft[sg]etprec() are to be used, ensure there's a
prototype for them in scope (so include )

Might fix the i386 build.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libm/src/math_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/math_private.h
diff -u src/lib/libm/src/math_private.h:1.31 src/lib/libm/src/math_private.h:1.32
--- src/lib/libm/src/math_private.h:1.31	Tue Jan 23 15:45:07 2024
+++ src/lib/libm/src/math_private.h	Wed Apr  3 04:40:23 2024
@@ -11,7 +11,7 @@
 
 /*
  * from: @(#)fdlibm.h 5.1 93/09/24
- * $NetBSD: math_private.h,v 1.31 2024/01/23 15:45:07 christos Exp $
+ * $NetBSD: math_private.h,v 1.32 2024/04/03 04:40:23 kre Exp $
  */
 
 #ifndef _MATH_PRIVATE_H_
@@ -348,6 +348,9 @@ do {\
 
 /* Support switching the mode to FP_PE if necessary. */
 #if defined(__i386__) && !defined(NO_FPSETPREC)
+
+#include 
+
 #define	ENTERI() ENTERIT(long double)
 #define	ENTERIT(returntype)			\
 	returntype __retval;			\



CVS commit: src/lib/libm/src

2024-04-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Apr  3 04:40:23 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
For i386, if ft[sg]etprec() are to be used, ensure there's a
prototype for them in scope (so include )

Might fix the i386 build.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libm/src/math_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 01:51:02 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
reduce diff with FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_cbrtl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_cbrtl.c
diff -u src/lib/libm/src/s_cbrtl.c:1.1 src/lib/libm/src/s_cbrtl.c:1.2
--- src/lib/libm/src/s_cbrtl.c:1.1	Tue Nov 19 14:24:34 2013
+++ src/lib/libm/src/s_cbrtl.c	Tue Apr  2 21:51:01 2024
@@ -13,12 +13,9 @@
  * written by Steven G. Kargl with input from Bruce D. Evans
  * and David A. Schultz.
  */
-
 #include 
-__RCSID("$NetBSD: s_cbrtl.c,v 1.1 2013/11/19 19:24:34 joerg Exp $");
-#if 0
-__FBSDID("$FreeBSD: head/lib/msun/src/s_cbrtl.c 238924 2012-07-30 21:58:28Z kargl $");
-#endif
+__RCSID("$NetBSD: s_cbrtl.c,v 1.2 2024/04/03 01:51:01 christos Exp $");
+
 
 #include "namespace.h"
 #include 
@@ -30,44 +27,48 @@ __FBSDID("$FreeBSD: head/lib/msun/src/s_
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(cbrtl, _cbrtl)
 
+#define	BIAS	(LDBL_MAX_EXP - 1)
+
 static const unsigned
 B1 = 709958130;	/* B1 = (127-127.0/3-0.03306235651)*2**23 */
 
 long double
 cbrtl(long double x)
 {
-	union ieee_ext_u ux, vx;
+	union ieee_ext_u u, v;
 	long double r, s, t, w;
 	double dr, dt, dx;
 	float ft, fx;
 	uint32_t hx;
+	uint16_t expsign;
 	int k;
 
-	ux.extu_ld = x;
-
+	u.extu_ld = x;
+	expsign = GET_EXPSIGN();
+	k = expsign & 0x7fff;
 
 	/*
 	 * If x = +-Inf, then cbrt(x) = +-Inf.
 	 * If x = NaN, then cbrt(x) = NaN.
 	 */
-	if (ux.extu_exp == EXT_EXP_INFNAN)
+	if (k == BIAS + LDBL_MAX_EXP)
 		return (x + x);
-	if ((ux.extu_frach | ux.extu_fracl | ux.extu_exp) == 0)
-		return (x);
 
-	vx.extu_ld = 1;
-	vx.extu_ext.ext_sign = ux.extu_ext.ext_sign;
-	ux.extu_ext.ext_sign = 0;
-	if (ux.extu_exp == 0) {
+	ENTERI();
+	if (k == 0) {
+		/* If x = +-0, then cbrt(x) = +-0. */
+		if ((u.extu_frach | u.extu_fracl) == 0)
+			RETURNI(x);
 		/* Adjust subnormal numbers. */
-		ux.extu_ld *= 0x1.0p514;
-		k = ux.extu_exp - EXT_EXP_BIAS - 514;
-	} else {
-		k = ux.extu_exp - EXT_EXP_BIAS;
-	}
+		u.extu_ld *= 0x1.0p514;
+		k = u.extu_exp;
+		k -= BIAS + 514;
+ 	} else
+		k -= BIAS;
+	SET_EXPSIGN(, BIAS);
+	v.extu_ld = 1; 
 
-	ux.extu_exp = EXT_EXP_BIAS;
-	x = ux.extu_ld;
+	x = u.extu_ld;
 	switch (k % 3) {
 	case 1:
 	case -2:
@@ -80,7 +81,7 @@ cbrtl(long double x)
 		k -= 2;
 		break;
 	}
-	vx.extu_exp = EXT_EXP_BIAS + k / 3;
+	SET_EXPSIGN(, (expsign & 0x8000) | (BIAS + k / 3));
 
 	/*
 	 * The following is the guts of s_cbrtf, with the handling of
@@ -136,10 +137,9 @@ cbrtl(long double x)
 	r=x/s;/* error <= 0.5 ulps; |r| < |t| */
 	w=t+t;/* t+t is exact */
 	r=(r-t)/(w+r);			/* r-t is exact; w+r ~= 3*t */
-	t=t+t*r;			/* error <= 0.5 + 0.5/3 + epsilon */
+	t=t+t*r;			/* error <= (0.5 + 0.5/3) * ulp */
 
-	t *= vx.extu_ld;
-	return t;
+	t *= v.extu_ld;
+	RETURNI(t);
 }
-
 #endif /* __HAVE_LONG_DOUBLE */



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 01:51:02 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
reduce diff with FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_cbrtl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:40:50 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
undo accidental commit.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_fabsl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_fabsl.c
diff -u src/lib/libm/src/s_fabsl.c:1.7 src/lib/libm/src/s_fabsl.c:1.8
--- src/lib/libm/src/s_fabsl.c:1.7	Tue Apr  2 14:39:51 2024
+++ src/lib/libm/src/s_fabsl.c	Tue Apr  2 14:40:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $	*/
+/*	$NetBSD: s_fabsl.c,v 1.8 2024/04/02 18:40:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $");
+__RCSID("$NetBSD: s_fabsl.c,v 1.8 2024/04/02 18:40:50 christos Exp $");
 
 #include 
 #include 
@@ -47,6 +47,7 @@ fabsl(long double x)
 	return (ux.extu_ld);
 }
 #else
+#if 0
 /* defined in libc */
 long double
 fabsl(long double x)
@@ -54,3 +55,4 @@ fabsl(long double x)
 	return fabs(x);
 }
 #endif
+#endif



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:40:50 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
undo accidental commit.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_fabsl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:39:51 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c s_rintl.c

Log Message:
PR/58054: Martin Husemann: fix bug in expsign extraction and only use the
code for the floating point formats where it works (does not work for 112
bit mantisa in sparc64)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_fabsl.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_rintl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:39:51 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c s_rintl.c

Log Message:
PR/58054: Martin Husemann: fix bug in expsign extraction and only use the
code for the floating point formats where it works (does not work for 112
bit mantisa in sparc64)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_fabsl.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_rintl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_fabsl.c
diff -u src/lib/libm/src/s_fabsl.c:1.6 src/lib/libm/src/s_fabsl.c:1.7
--- src/lib/libm/src/s_fabsl.c:1.6	Sun Feb 25 14:26:33 2024
+++ src/lib/libm/src/s_fabsl.c	Tue Apr  2 14:39:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fabsl.c,v 1.6 2024/02/25 19:26:33 christos Exp $	*/
+/*	$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: s_fabsl.c,v 1.6 2024/02/25 19:26:33 christos Exp $");
+__RCSID("$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $");
 
 #include 
 #include 
@@ -47,7 +47,6 @@ fabsl(long double x)
 	return (ux.extu_ld);
 }
 #else
-#if 0
 /* defined in libc */
 long double
 fabsl(long double x)
@@ -55,4 +54,3 @@ fabsl(long double x)
 	return fabs(x);
 }
 #endif
-#endif

Index: src/lib/libm/src/s_rintl.c
diff -u src/lib/libm/src/s_rintl.c:1.5 src/lib/libm/src/s_rintl.c:1.6
--- src/lib/libm/src/s_rintl.c:1.5	Wed Aug 21 09:04:44 2013
+++ src/lib/libm/src/s_rintl.c	Tue Apr  2 14:39:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_rintl.c,v 1.5 2013/08/21 13:04:44 martin Exp $	*/
+/*	$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 David Schultz 
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_rintl.c,v 1.5 2008/02/22 11:59:05 bde Exp $");
 #else
-__RCSID("$NetBSD: s_rintl.c,v 1.5 2013/08/21 13:04:44 martin Exp $");
+__RCSID("$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $");
 #endif
 
 #include 
@@ -40,17 +40,19 @@ __RCSID("$NetBSD: s_rintl.c,v 1.5 2013/0
 #include "math_private.h"
 
 #ifdef __HAVE_LONG_DOUBLE
+
+# if EXT_FRACBITS == 64 || EXT_FRACBITS == 113 && LDBL_MAX_EXP == 0x4000
+
+#  define BIAS (LDBL_MAX_EXP - 1)
 static const float
 shift[2] = {
-#if EXT_FRACBITS == 64
+#  if EXT_FRACBITS == 64
 	0x1.0p63, -0x1.0p63
-#elif EXT_FRACBITS == 113
+#  elif EXT_FRACBITS == 113
 	0x1.0p112, -0x1.0p112
-#elif EXT_FRACBITS == 112
-	0x1.0p111, -0x1.0p111
-#else
-#error "Unsupported long double format"
-#endif
+#  else
+#   error "Unsupported long double format"
+#  endif
 };
 static const float zero[2] = { 0.0, -0.0 };
 
@@ -63,11 +65,11 @@ rintl(long double x)
 
 	u.extu_ld = x;
 	u.extu_ext.ext_frach &= ~0x8000;
-	expsign = u.extu_ext.ext_sign;
+	expsign = GET_EXPSIGN();
 	ex = expsign & 0x7fff;
 
-	if (ex >= EXT_EXP_BIAS + EXT_FRACBITS - 1) {
-		if (ex == EXT_EXP_BIAS + EXT_FRACBITS)
+	if (ex >= BIAS + EXT_FRACBITS - 1) {
+		if (ex == BIAS + EXT_FRACBITS)
 			return (x + x);	/* Inf, NaN, or unsupported format */
 		return (x);		/* finite and already an integer */
 	}
@@ -87,9 +89,18 @@ rintl(long double x)
 	 * If the result is +-0, then it must have the same sign as x, but
 	 * the above calculation doesn't always give this.  Fix up the sign.
 	 */
-	if (ex < EXT_EXP_BIAS && x == 0.0L)
+	if (ex < BIAS && x == 0.0L)
 		return (zero[sign]);
 
 	return (x);
 }
-#endif
+# else
+
+long double
+rintl(long double x)
+{
+	return rint(x);
+}
+
+# endif
+#endif /* __HAVE_LONG_DOUBLE */



CVS commit: src/lib/libm/src

2024-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 19:26:34 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
fabsl is defined in libc...


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_fabsl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_fabsl.c
diff -u src/lib/libm/src/s_fabsl.c:1.5 src/lib/libm/src/s_fabsl.c:1.6
--- src/lib/libm/src/s_fabsl.c:1.5	Sat Feb 24 10:16:53 2024
+++ src/lib/libm/src/s_fabsl.c	Sun Feb 25 14:26:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fabsl.c,v 1.5 2024/02/24 15:16:53 christos Exp $	*/
+/*	$NetBSD: s_fabsl.c,v 1.6 2024/02/25 19:26:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: s_fabsl.c,v 1.5 2024/02/24 15:16:53 christos Exp $");
+__RCSID("$NetBSD: s_fabsl.c,v 1.6 2024/02/25 19:26:33 christos Exp $");
 
 #include 
 #include 
@@ -47,9 +47,12 @@ fabsl(long double x)
 	return (ux.extu_ld);
 }
 #else
+#if 0
+/* defined in libc */
 long double
 fabsl(long double x)
 {
 	return fabs(x);
 }
 #endif
+#endif



CVS commit: src/lib/libm/src

2024-02-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 25 19:26:34 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
fabsl is defined in libc...


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_fabsl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Feb 24 19:32:09 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h s_atanl.c s_remquo.c s_remquof.c
s_remquol.c

Log Message:
fix some fallout from 32-bit fixes for long double functions.

apply namespace.h to remqou*.  add missing weak aliases for some of them,
and normalise checkf for __weak_alias().

now libm.so seems to only have libc undefined symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libm/src/namespace.h
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_remquol.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_remquo.c \
src/lib/libm/src/s_remquof.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.18 src/lib/libm/src/namespace.h:1.19
--- src/lib/libm/src/namespace.h:1.18	Sun Jan 21 18:53:18 2024
+++ src/lib/libm/src/namespace.h	Sat Feb 24 19:32:09 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.18 2024/01/21 18:53:18 christos Exp $ */
+/* $NetBSD: namespace.h,v 1.19 2024/02/24 19:32:09 mrg Exp $ */
 
 #define atan2 _atan2
 #define atan2f _atan2f
@@ -37,6 +37,10 @@
 #define asinf _asinf
 #define asinl _asinl
 
+#define remquo _remquo
+#define remquof _remquof
+#define remquol _remquol
+
 #define casin _casin
 #define casinf _casinf
 #define casinl _casinl

Index: src/lib/libm/src/s_atanl.c
diff -u src/lib/libm/src/s_atanl.c:1.4 src/lib/libm/src/s_atanl.c:1.5
--- src/lib/libm/src/s_atanl.c:1.4	Sat Feb 24 15:16:53 2024
+++ src/lib/libm/src/s_atanl.c	Sat Feb 24 19:32:09 2024
@@ -19,7 +19,9 @@
 #include "math.h"
 #include "math_private.h"
 
+#ifdef __weak_alias
 __weak_alias(atanl, _atanl)
+#endif
 
 #ifdef __HAVE_LONG_DOUBLE
 
Index: src/lib/libm/src/s_remquol.c
diff -u src/lib/libm/src/s_remquol.c:1.4 src/lib/libm/src/s_remquol.c:1.5
--- src/lib/libm/src/s_remquol.c:1.4	Sat Feb 24 15:16:53 2024
+++ src/lib/libm/src/s_remquol.c	Sat Feb 24 19:32:09 2024
@@ -10,6 +10,9 @@
  */
 
 #include 
+
+#include "namespace.h"
+
 #include 
 #include 
 #include 

Index: src/lib/libm/src/s_remquo.c
diff -u src/lib/libm/src/s_remquo.c:1.1 src/lib/libm/src/s_remquo.c:1.2
--- src/lib/libm/src/s_remquo.c:1.1	Sun Feb  6 01:53:38 2011
+++ src/lib/libm/src/s_remquo.c	Sat Feb 24 19:32:09 2024
@@ -12,11 +12,17 @@
 
 #include 
 
+#include "namespace.h"
+
 #include 
 
 #include "math.h"
 #include "math_private.h"
 
+#ifdef __weak_alias
+__weak_alias(remquo, _remquo)
+#endif
+
 static const double Zero[] = {0.0, -0.0,};
 
 /*
Index: src/lib/libm/src/s_remquof.c
diff -u src/lib/libm/src/s_remquof.c:1.1 src/lib/libm/src/s_remquof.c:1.2
--- src/lib/libm/src/s_remquof.c:1.1	Sun Feb  6 01:53:38 2011
+++ src/lib/libm/src/s_remquof.c	Sat Feb 24 19:32:09 2024
@@ -12,9 +12,15 @@
 
 #include 
 
+#include "namespace.h"
+
 #include "math.h"
 #include "math_private.h"
 
+#ifdef __weak_alias
+__weak_alias(remquof, _remquof)
+#endif
+
 static const float Zero[] = {0.0, -0.0,};
 
 /*



CVS commit: src/lib/libm/src

2024-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Feb 24 19:32:09 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h s_atanl.c s_remquo.c s_remquof.c
s_remquol.c

Log Message:
fix some fallout from 32-bit fixes for long double functions.

apply namespace.h to remqou*.  add missing weak aliases for some of them,
and normalise checkf for __weak_alias().

now libm.so seems to only have libc undefined symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libm/src/namespace.h
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_remquol.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_remquo.c \
src/lib/libm/src/s_remquof.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 24 15:16:53 UTC 2024

Modified Files:
src/lib/libm/src: b_tgammal.c e_acoshl.c e_acosl.c e_asinl.c e_atanhl.c
s_asinhl.c s_atanl.c s_cospil.c s_erfl.c s_exp2l.c s_fabsl.c
s_llrintl.c s_logl.c s_lrintl.c s_nearbyint.c s_remquol.c
s_sincosl.c s_sinpil.c s_tanhl.c s_tanpil.c

Log Message:
add missing symbols for non long double architectures.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/b_tgammal.c \
src/lib/libm/src/e_acoshl.c src/lib/libm/src/e_acosl.c \
src/lib/libm/src/e_asinl.c src/lib/libm/src/e_atanhl.c \
src/lib/libm/src/s_asinhl.c src/lib/libm/src/s_cospil.c \
src/lib/libm/src/s_erfl.c src/lib/libm/src/s_exp2l.c \
src/lib/libm/src/s_sincosl.c src/lib/libm/src/s_sinpil.c \
src/lib/libm/src/s_tanhl.c src/lib/libm/src/s_tanpil.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_llrintl.c src/lib/libm/src/s_logl.c \
src/lib/libm/src/s_lrintl.c src/lib/libm/src/s_remquol.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/s_fabsl.c \
src/lib/libm/src/s_nearbyint.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/b_tgammal.c
diff -u src/lib/libm/src/b_tgammal.c:1.2 src/lib/libm/src/b_tgammal.c:1.3
--- src/lib/libm/src/b_tgammal.c:1.2	Tue Jan 23 10:45:07 2024
+++ src/lib/libm/src/b_tgammal.c	Sat Feb 24 10:16:53 2024
@@ -1,4 +1,4 @@
-/* 	$NetBSD: b_tgammal.c,v 1.2 2024/01/23 15:45:07 christos Exp $	*/
+/* 	$NetBSD: b_tgammal.c,v 1.3 2024/02/24 15:16:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: b_tgammal.c,v 1.2 2024/01/23 15:45:07 christos Exp $");
+__RCSID("$NetBSD: b_tgammal.c,v 1.3 2024/02/24 15:16:53 christos Exp $");
 #endif
 
 #include "namespace.h"
@@ -38,13 +38,12 @@ __RCSID("$NetBSD: b_tgammal.c,v 1.2 2024
 #include 
 #include 
 
-
-#ifdef __HAVE_LONG_DOUBLE
-
 #ifdef __weak_alias
 __weak_alias(tgammal,_tgammal)
 #endif
 
+#ifdef __HAVE_LONG_DOUBLE
+
 #if LDBL_MANT_DIG == 64
 #include "../ld80/b_tgammal.c"
 #elif LDBL_MANT_DIG == 113
@@ -55,8 +54,10 @@ __weak_alias(tgammal,_tgammal)
 
 #else
 
-#ifdef __weak_alias
-__weak_alias(tgammal, tgamma)
-#endif
+long double 
+tgammal(long double x)
+{  
+	return tgamma(x);
+}
 
 #endif
Index: src/lib/libm/src/e_acoshl.c
diff -u src/lib/libm/src/e_acoshl.c:1.2 src/lib/libm/src/e_acoshl.c:1.3
--- src/lib/libm/src/e_acoshl.c:1.2	Sat Jan 27 00:50:42 2024
+++ src/lib/libm/src/e_acoshl.c	Sat Feb 24 10:16:53 2024
@@ -22,9 +22,10 @@
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __HAVE_LONG_DOUBLE
 __weak_alias(acoshl, _acoshl)
 
+#ifdef __HAVE_LONG_DOUBLE
+
 /*
  * See e_acosh.c for complete comments.
  *
@@ -92,6 +93,9 @@ acoshl(long double x)
 	}
 }
 #else
-
-__weak_alias(acoshl, acosh)
+long double
+acoshl(long double x)
+{
+	return acosh(x);
+}
 #endif
Index: src/lib/libm/src/e_acosl.c
diff -u src/lib/libm/src/e_acosl.c:1.2 src/lib/libm/src/e_acosl.c:1.3
--- src/lib/libm/src/e_acosl.c:1.2	Sat Jan 27 00:50:42 2024
+++ src/lib/libm/src/e_acosl.c	Sat Feb 24 10:16:53 2024
@@ -24,9 +24,10 @@
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __HAVE_LONG_DOUBLE
 __weak_alias(acosl, _acosl)
 
+#ifdef __HAVE_LONG_DOUBLE
+
 #if LDBL_MANT_DIG == 64
 #include "../ld80/invtrig.h"
 #elif LDBL_MANT_DIG == 113
@@ -99,5 +100,9 @@ acosl(long double x)
 	}
 }
 #else
-__weak_alias(acosl, acos)
+long double
+acosl(long double x)
+{
+	return acos(x);
+}
 #endif
Index: src/lib/libm/src/e_asinl.c
diff -u src/lib/libm/src/e_asinl.c:1.2 src/lib/libm/src/e_asinl.c:1.3
--- src/lib/libm/src/e_asinl.c:1.2	Sat Jan 27 00:50:42 2024
+++ src/lib/libm/src/e_asinl.c	Sat Feb 24 10:16:53 2024
@@ -24,10 +24,10 @@
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __HAVE_LONG_DOUBLE
-
 __weak_alias(asinl, _asinl)
 
+#ifdef __HAVE_LONG_DOUBLE
+
 #if LDBL_MANT_DIG == 64
 #include "../ld80/invtrig.h"
 #elif LDBL_MANT_DIG == 113
@@ -90,5 +90,9 @@ asinl(long double x)
 	if(expsign>0) return t; else return -t;
 }
 #else
-__weak_alias(asinl, _asin)
+long double
+asinl(long double x)
+{
+	return asin(x);
+}
 #endif
Index: src/lib/libm/src/e_atanhl.c
diff -u src/lib/libm/src/e_atanhl.c:1.2 src/lib/libm/src/e_atanhl.c:1.3
--- src/lib/libm/src/e_atanhl.c:1.2	Sat Jan 27 00:50:42 2024
+++ src/lib/libm/src/e_atanhl.c	Sat Feb 24 10:16:53 2024
@@ -22,8 +22,9 @@
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __HAVE_LONG_DOUBLE
 __weak_alias(atanhl, _atanhl)
+
+#ifdef __HAVE_LONG_DOUBLE
 /*
  * See e_atanh.c for complete comments.
  *
@@ -76,5 +77,9 @@ atanhl(long double x)
 	RETURNI((hx & 0x8000) == 0 ? t : -t);
 }
 #else
-__weak_alias(atanhl, atanh)
+long double
+atanhl(long double x)
+{
+	return atanh(x);
+}
 #endif
Index: src/lib/libm/src/s_asinhl.c

CVS commit: src/lib/libm/src

2024-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 24 15:16:53 UTC 2024

Modified Files:
src/lib/libm/src: b_tgammal.c e_acoshl.c e_acosl.c e_asinl.c e_atanhl.c
s_asinhl.c s_atanl.c s_cospil.c s_erfl.c s_exp2l.c s_fabsl.c
s_llrintl.c s_logl.c s_lrintl.c s_nearbyint.c s_remquol.c
s_sincosl.c s_sinpil.c s_tanhl.c s_tanpil.c

Log Message:
add missing symbols for non long double architectures.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/b_tgammal.c \
src/lib/libm/src/e_acoshl.c src/lib/libm/src/e_acosl.c \
src/lib/libm/src/e_asinl.c src/lib/libm/src/e_atanhl.c \
src/lib/libm/src/s_asinhl.c src/lib/libm/src/s_cospil.c \
src/lib/libm/src/s_erfl.c src/lib/libm/src/s_exp2l.c \
src/lib/libm/src/s_sincosl.c src/lib/libm/src/s_sinpil.c \
src/lib/libm/src/s_tanhl.c src/lib/libm/src/s_tanpil.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_llrintl.c src/lib/libm/src/s_logl.c \
src/lib/libm/src/s_lrintl.c src/lib/libm/src/s_remquol.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/s_fabsl.c \
src/lib/libm/src/s_nearbyint.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 23 13:42:01 UTC 2024

Modified Files:
src/lib/libm/src: s_tanl.c

Log Message:
fix the 32 bit tanl symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_tanl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_tanl.c
diff -u src/lib/libm/src/s_tanl.c:1.1 src/lib/libm/src/s_tanl.c:1.2
--- src/lib/libm/src/s_tanl.c:1.1	Sun Jan 21 13:53:19 2024
+++ src/lib/libm/src/s_tanl.c	Fri Feb 23 08:42:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_tanl.c,v 1.1 2024/01/21 18:53:19 christos Exp $	*/
+/*	$NetBSD: s_tanl.c,v 1.2 2024/02/23 13:42:01 christos Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: s_tanl.c,v 1.1 2024/01/21 18:53:19 christos Exp $");
+__RCSID("$NetBSD: s_tanl.c,v 1.2 2024/02/23 13:42:01 christos Exp $");
 
 /*
  * Limited testing on pseudorandom numbers drawn within [0:4e8] shows
@@ -45,12 +45,12 @@ __RCSID("$NetBSD: s_tanl.c,v 1.1 2024/01
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __HAVE_LONG_DOUBLE
-
 #ifdef __weak_alias
 __weak_alias(tanl, _tanl)
 #endif
 
+#ifdef __HAVE_LONG_DOUBLE
+
 #if LDBL_MANT_DIG == 64
 #include "../ld80/e_rem_pio2l.h"
 #include "../ld80/k_tanl.c"
@@ -109,8 +109,10 @@ tanl(long double x)
 
 #else
 
-#ifdef __weak_alias
-__weak_alias(tanl, tan)
-#endif
+long double
+tanl(long double x)
+{
+	return tan(x);
+}
 
 #endif



CVS commit: src/lib/libm/src

2024-02-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 23 13:42:01 UTC 2024

Modified Files:
src/lib/libm/src: s_tanl.c

Log Message:
fix the 32 bit tanl symbol.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_tanl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-01-26 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Jan 27 05:50:42 UTC 2024

Modified Files:
src/lib/libm/src: e_acoshl.c e_acosl.c e_asinl.c e_atanhl.c e_coshl.c
s_asinhl.c s_logl.c s_tanhl.c

Log Message:
Enable asinl, acosl, logl, coshl, tanhl, atanhl, asinhl and acoshl

* Fix pkgsrc/math/py-numpy and pkgsrc/graphics/py-matplotlib, for example.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/e_acoshl.c \
src/lib/libm/src/e_acosl.c src/lib/libm/src/e_asinl.c \
src/lib/libm/src/e_atanhl.c src/lib/libm/src/e_coshl.c \
src/lib/libm/src/s_asinhl.c src/lib/libm/src/s_tanhl.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_logl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-01-26 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Jan 27 05:50:42 UTC 2024

Modified Files:
src/lib/libm/src: e_acoshl.c e_acosl.c e_asinl.c e_atanhl.c e_coshl.c
s_asinhl.c s_logl.c s_tanhl.c

Log Message:
Enable asinl, acosl, logl, coshl, tanhl, atanhl, asinhl and acoshl

* Fix pkgsrc/math/py-numpy and pkgsrc/graphics/py-matplotlib, for example.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/e_acoshl.c \
src/lib/libm/src/e_acosl.c src/lib/libm/src/e_asinl.c \
src/lib/libm/src/e_atanhl.c src/lib/libm/src/e_coshl.c \
src/lib/libm/src/s_asinhl.c src/lib/libm/src/s_tanhl.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_logl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/e_acoshl.c
diff -u src/lib/libm/src/e_acoshl.c:1.1 src/lib/libm/src/e_acoshl.c:1.2
--- src/lib/libm/src/e_acoshl.c:1.1	Sun Jan 21 18:53:17 2024
+++ src/lib/libm/src/e_acoshl.c	Sat Jan 27 05:50:42 2024
@@ -16,6 +16,12 @@
 
 #include "namespace.h"
 
+#include 
+#include 
+
+#include "math.h"
+#include "math_private.h"
+
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(acoshl, _acoshl)
 
@@ -26,14 +32,10 @@ __weak_alias(acoshl, _acoshl)
  * Bruce D. Evans.
  */
 
-#include 
 #ifdef __i386__
 #include 
 #endif
 
-#include "math.h"
-#include "math_private.h"
-
 /* EXP_LARGE is the threshold above which we use acosh(x) ~= log(2x). */
 #if LDBL_MANT_DIG == 64
 #define	EXP_LARGE	34
Index: src/lib/libm/src/e_acosl.c
diff -u src/lib/libm/src/e_acosl.c:1.1 src/lib/libm/src/e_acosl.c:1.2
--- src/lib/libm/src/e_acosl.c:1.1	Sun Jan 21 18:53:17 2024
+++ src/lib/libm/src/e_acosl.c	Sat Jan 27 05:50:42 2024
@@ -19,6 +19,10 @@
 #include "namespace.h"
 
 #include 
+#include 
+
+#include "math.h"
+#include "math_private.h"
 
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(acosl, _acosl)
@@ -30,8 +34,6 @@ __weak_alias(acosl, _acosl)
 #else
 #error "Unsupported long double format"
 #endif
-#include "math.h"
-#include "math_private.h"
 
 #ifdef LDBL_IMPLICIT_NBIT
 #define	LDBL_NBIT	0
Index: src/lib/libm/src/e_asinl.c
diff -u src/lib/libm/src/e_asinl.c:1.1 src/lib/libm/src/e_asinl.c:1.2
--- src/lib/libm/src/e_asinl.c:1.1	Sun Jan 21 18:53:17 2024
+++ src/lib/libm/src/e_asinl.c	Sat Jan 27 05:50:42 2024
@@ -19,6 +19,10 @@
 
 #include "namespace.h"
 #include 
+#include 
+
+#include "math.h"
+#include "math_private.h"
 
 #ifdef __HAVE_LONG_DOUBLE
 
@@ -31,8 +35,6 @@ __weak_alias(asinl, _asinl)
 #else
 #error "Unsupported long double format"
 #endif
-#include "math.h"
-#include "math_private.h"
 
 #ifdef LDBL_IMPLICIT_NBIT
 #define	LDBL_NBIT	0
Index: src/lib/libm/src/e_atanhl.c
diff -u src/lib/libm/src/e_atanhl.c:1.1 src/lib/libm/src/e_atanhl.c:1.2
--- src/lib/libm/src/e_atanhl.c:1.1	Sun Jan 21 18:53:17 2024
+++ src/lib/libm/src/e_atanhl.c	Sat Jan 27 05:50:42 2024
@@ -17,6 +17,10 @@
 #include "namespace.h"
 
 #include 
+#include 
+
+#include "math.h"
+#include "math_private.h"
 
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(atanhl, _atanhl)
@@ -31,9 +35,6 @@ __weak_alias(atanhl, _atanhl)
 #include 
 #endif
 
-#include "math.h"
-#include "math_private.h"
-
 /* EXP_TINY is the threshold below which we use atanh(x) ~= x. */
 #if LDBL_MANT_DIG == 64
 #define	EXP_TINY	-34
Index: src/lib/libm/src/e_coshl.c
diff -u src/lib/libm/src/e_coshl.c:1.1 src/lib/libm/src/e_coshl.c:1.2
--- src/lib/libm/src/e_coshl.c:1.1	Sun Jan 21 18:53:17 2024
+++ src/lib/libm/src/e_coshl.c	Sat Jan 27 05:50:42 2024
@@ -24,6 +24,7 @@
 __weak_alias(coshl, _coshl)
 
 #ifdef __HAVE_LONG_DOUBLE
+#error SHOULD STOP HERE!!!
 
 #ifdef __i386__
 #include 
Index: src/lib/libm/src/s_asinhl.c
diff -u src/lib/libm/src/s_asinhl.c:1.1 src/lib/libm/src/s_asinhl.c:1.2
--- src/lib/libm/src/s_asinhl.c:1.1	Sun Jan 21 18:53:18 2024
+++ src/lib/libm/src/s_asinhl.c	Sat Jan 27 05:50:42 2024
@@ -16,6 +16,10 @@
 #include "namespace.h"
 
 #include 
+#include 
+
+#include "math.h"
+#include "math_private.h"
 
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(asinhl, _asinhl)
@@ -31,9 +35,6 @@ __weak_alias(asinhl, _asinhl)
 #include 
 #endif
 
-#include "math.h"
-#include "math_private.h"
-
 /* EXP_LARGE is the threshold above which we use asinh(x) ~= log(2x). */
 /* EXP_TINY is the threshold below which we use asinh(x) ~= x. */
 #if LDBL_MANT_DIG == 64
Index: src/lib/libm/src/s_tanhl.c
diff -u src/lib/libm/src/s_tanhl.c:1.1 src/lib/libm/src/s_tanhl.c:1.2
--- src/lib/libm/src/s_tanhl.c:1.1	Sun Jan 21 18:53:19 2024
+++ src/lib/libm/src/s_tanhl.c	Sat Jan 27 05:50:42 2024
@@ -15,6 +15,10 @@
 
 #include "namespace.h"
 #include 
+#include 
+
+#include "math.h"
+#include "math_private.h"
 
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(tanhl, _tanhl)
@@ -28,8 +32,6 @@ __weak_alias(tanhl, _tanhl)
 #include 
 #endif
 
-#include "math.h"
-#include "math_private.h"
 #if LDBL_MANT_DIG == 64
 #include "../ld80/k_expl.h"
 #elif LDBL_MANT_DIG == 113

Index: src/lib/libm/src/s_logl.c
diff -u 

CVS commit: src/lib/libm/src

2024-01-26 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri Jan 26 12:32:49 UTC 2024

Modified Files:
src/lib/libm/src: s_sinl.c

Log Message:
Fix inverted logic for weak alias

* Fix gfortran from pkgsrc/lang/gcc10 and pkgsrc/math/coinmp, for example.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_sinl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_sinl.c
diff -u src/lib/libm/src/s_sinl.c:1.1 src/lib/libm/src/s_sinl.c:1.2
--- src/lib/libm/src/s_sinl.c:1.1	Sun Jan 21 18:53:19 2024
+++ src/lib/libm/src/s_sinl.c	Fri Jan 26 12:32:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_sinl.c,v 1.1 2024/01/21 18:53:19 christos Exp $	*/
+/*	$NetBSD: s_sinl.c,v 1.2 2024/01/26 12:32:49 ryoon Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: s_sinl.c,v 1.1 2024/01/21 18:53:19 christos Exp $");
+__RCSID("$NetBSD: s_sinl.c,v 1.2 2024/01/26 12:32:49 ryoon Exp $");
 
 #include "namespace.h"
 #include 
@@ -37,7 +37,7 @@ __RCSID("$NetBSD: s_sinl.c,v 1.1 2024/01
 #include 
 #endif
 
-#ifndef __weak_alias
+#ifdef __weak_alias
 __weak_alias(sinl, _sinl)
 #endif
 



CVS commit: src/lib/libm/src

2024-01-26 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri Jan 26 12:32:49 UTC 2024

Modified Files:
src/lib/libm/src: s_sinl.c

Log Message:
Fix inverted logic for weak alias

* Fix gfortran from pkgsrc/lang/gcc10 and pkgsrc/math/coinmp, for example.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_sinl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 23 15:45:07 UTC 2024

Modified Files:
src/lib/libm/src: b_tgammal.c e_atan2l.c e_lgammal_r.c math_private.h
s_atanl.c s_cospil.c s_erfl.c s_exp2l.c s_expl.c s_logl.c
s_remquol.c s_sinpil.c s_tanpil.c

Log Message:
move inclusion of  to the ieee source files instead of
including it in math_private.h which is also used by the vax which is not ieee.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/b_tgammal.c \
src/lib/libm/src/e_atan2l.c src/lib/libm/src/e_lgammal_r.c \
src/lib/libm/src/s_cospil.c src/lib/libm/src/s_erfl.c \
src/lib/libm/src/s_exp2l.c src/lib/libm/src/s_expl.c \
src/lib/libm/src/s_logl.c src/lib/libm/src/s_sinpil.c \
src/lib/libm/src/s_tanpil.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libm/src/math_private.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_remquol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2024-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 23 15:45:07 UTC 2024

Modified Files:
src/lib/libm/src: b_tgammal.c e_atan2l.c e_lgammal_r.c math_private.h
s_atanl.c s_cospil.c s_erfl.c s_exp2l.c s_expl.c s_logl.c
s_remquol.c s_sinpil.c s_tanpil.c

Log Message:
move inclusion of  to the ieee source files instead of
including it in math_private.h which is also used by the vax which is not ieee.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/b_tgammal.c \
src/lib/libm/src/e_atan2l.c src/lib/libm/src/e_lgammal_r.c \
src/lib/libm/src/s_cospil.c src/lib/libm/src/s_erfl.c \
src/lib/libm/src/s_exp2l.c src/lib/libm/src/s_expl.c \
src/lib/libm/src/s_logl.c src/lib/libm/src/s_sinpil.c \
src/lib/libm/src/s_tanpil.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libm/src/math_private.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_atanl.c \
src/lib/libm/src/s_remquol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/b_tgammal.c
diff -u src/lib/libm/src/b_tgammal.c:1.1 src/lib/libm/src/b_tgammal.c:1.2
--- src/lib/libm/src/b_tgammal.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/src/b_tgammal.c	Tue Jan 23 10:45:07 2024
@@ -1,4 +1,4 @@
-/* 	$NetBSD: b_tgammal.c,v 1.1 2024/01/21 18:53:17 christos Exp $	*/
+/* 	$NetBSD: b_tgammal.c,v 1.2 2024/01/23 15:45:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: b_tgammal.c,v 1.1 2024/01/21 18:53:17 christos Exp $");
+__RCSID("$NetBSD: b_tgammal.c,v 1.2 2024/01/23 15:45:07 christos Exp $");
 #endif
 
 #include "namespace.h"
 #include "math.h"
 #include 
+#include 
 
 
 #ifdef __HAVE_LONG_DOUBLE
Index: src/lib/libm/src/e_atan2l.c
diff -u src/lib/libm/src/e_atan2l.c:1.1 src/lib/libm/src/e_atan2l.c:1.2
--- src/lib/libm/src/e_atan2l.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/src/e_atan2l.c	Tue Jan 23 10:45:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: e_atan2l.c,v 1.1 2024/01/21 18:53:17 christos Exp $	*/
+/*	$NetBSD: e_atan2l.c,v 1.2 2024/01/23 15:45:07 christos Exp $	*/
 /* @(#)e_atan2.c 1.3 95/01/18 */
 /* FreeBSD: head/lib/msun/src/e_atan2.c 176451 2008-02-22 02:30:36Z das */
 /*
@@ -14,7 +14,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: e_atan2l.c,v 1.1 2024/01/21 18:53:17 christos Exp $");
+__RCSID("$NetBSD: e_atan2l.c,v 1.2 2024/01/23 15:45:07 christos Exp $");
 
 /*
  * See comments in e_atan2.c.
@@ -28,6 +28,7 @@ __weak_alias(atan2l, _atan2l)
 #endif
 
 #include 
+#include 
 
 #include "math.h"
 #include "math_private.h"
Index: src/lib/libm/src/e_lgammal_r.c
diff -u src/lib/libm/src/e_lgammal_r.c:1.1 src/lib/libm/src/e_lgammal_r.c:1.2
--- src/lib/libm/src/e_lgammal_r.c:1.1	Sun Jan 21 13:53:18 2024
+++ src/lib/libm/src/e_lgammal_r.c	Tue Jan 23 10:45:07 2024
@@ -1,4 +1,4 @@
-/* 	$NetBSD: e_lgammal_r.c,v 1.1 2024/01/21 18:53:18 christos Exp $	*/
+/* 	$NetBSD: e_lgammal_r.c,v 1.2 2024/01/23 15:45:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: e_lgammal_r.c,v 1.1 2024/01/21 18:53:18 christos Exp $");
+__RCSID("$NetBSD: e_lgammal_r.c,v 1.2 2024/01/23 15:45:07 christos Exp $");
 #endif
 
 #include "namespace.h"
 #include "math.h"
 #include 
+#include 
 
 #ifdef __weak_alias
 __weak_alias(lgammal_r,_lgammal_r)
Index: src/lib/libm/src/s_cospil.c
diff -u src/lib/libm/src/s_cospil.c:1.1 src/lib/libm/src/s_cospil.c:1.2
--- src/lib/libm/src/s_cospil.c:1.1	Sun Jan 21 13:53:18 2024
+++ src/lib/libm/src/s_cospil.c	Tue Jan 23 10:45:07 2024
@@ -1,4 +1,4 @@
-/* 	$NetBSD: s_cospil.c,v 1.1 2024/01/21 18:53:18 christos Exp $	*/
+/* 	$NetBSD: s_cospil.c,v 1.2 2024/01/23 15:45:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_cospil.c,v 1.1 2024/01/21 18:53:18 christos Exp $");
+__RCSID("$NetBSD: s_cospil.c,v 1.2 2024/01/23 15:45:07 christos Exp $");
 #endif
 
 #include "namespace.h"
 #include "math.h"
 #include 
+#include 
 
 
 #ifdef __HAVE_LONG_DOUBLE
Index: src/lib/libm/src/s_erfl.c
diff -u src/lib/libm/src/s_erfl.c:1.1 src/lib/libm/src/s_erfl.c:1.2
--- src/lib/libm/src/s_erfl.c:1.1	Sun Jan 21 13:53:18 2024
+++ src/lib/libm/src/s_erfl.c	Tue Jan 23 10:45:07 2024
@@ -1,4 +1,4 @@
-/* 	$NetBSD: s_erfl.c,v 1.1 2024/01/21 18:53:18 christos Exp $	*/
+/* 	$NetBSD: s_erfl.c,v 1.2 2024/01/23 15:45:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_erfl.c,v 1.1 2024/01/21 18:53:18 christos Exp $");
+__RCSID("$NetBSD: s_erfl.c,v 1.2 2024/01/23 15:45:07 christos Exp $");
 #endif
 
 #include "namespace.h"
 #include 

CVS commit: src/lib/libm/src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:26:18 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
Simply an overly complex way of saying "0 or 1" into a cleaner version.

While here add a commment about how the __i386__ magic LD80C macro
might no longer work on all other arch's as well (if someone can verify
that it still does, or can fix it so that it still works on i386, but
also works everywhere else, then please remove that XXX comment.
The issue I am (perhaps imagining) is the (uint32_t) cast.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libm/src/math_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/math_private.h
diff -u src/lib/libm/src/math_private.h:1.29 src/lib/libm/src/math_private.h:1.30
--- src/lib/libm/src/math_private.h:1.29	Mon Jan 22 12:15:19 2024
+++ src/lib/libm/src/math_private.h	Mon Jan 22 14:26:18 2024
@@ -11,7 +11,7 @@
 
 /*
  * from: @(#)fdlibm.h 5.1 93/09/24
- * $NetBSD: math_private.h,v 1.29 2024/01/22 12:15:19 kre Exp $
+ * $NetBSD: math_private.h,v 1.30 2024/01/22 14:26:18 kre Exp $
  */
 
 #ifndef _MATH_PRIVATE_H_
@@ -321,9 +321,10 @@ do {\
 	.extu_fracl = (uint32_t)(__CONCAT(m, ULL)),			\
 	.extu_frach = __CONCAT(m, ULL) >> EXT_FRACLBITS,		\
 	.extu_exp = (0x3fff + (ex)),	\
-	.extu_sign = ((v) < 0 ? 0x8000 : 0) >> EXT_EXPBITS,		\
+	.extu_sign = ((v) < 0),		\
 }
 #else
+/**XXX: the following comment may no longer be true:  kre 20240122 **/
 /* The above works on non-i386 too, but we use this to check v. */
 #define	LD80C(m, ex, v)	{ .extu_ld = (v), }
 #endif



CVS commit: src/lib/libm/src

2024-01-22 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jan 22 14:26:18 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
Simply an overly complex way of saying "0 or 1" into a cleaner version.

While here add a commment about how the __i386__ magic LD80C macro
might no longer work on all other arch's as well (if someone can verify
that it still does, or can fix it so that it still works on i386, but
also works everywhere else, then please remove that XXX comment.
The issue I am (perhaps imagining) is the (uint32_t) cast.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libm/src/math_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2023-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  8 06:31:18 UTC 2023

Modified Files:
src/lib/libm/src: k_rem_pio2.c k_rem_pio2f.c

Log Message:
avoid uninitialised variable accesses.

if __kernel_rem_pio2() or __kernel_rem_pio2f() are called with "nx" less
than 2, the local variable fq[0] may be accessed uninitialised.

__kernel_rem_pio2() has direct calls with nx = 1, and __kernel_rem_pio2f()
is called with a value starting at 3, but may be decreased to less than 2,
implied by this code , if not actually avoided by the tx[] setup above:
nx = 3;
while(tx[nx-1]==zero) nx--; /* skip zero term */
n  =  __kernel_rem_pio2f(tx,y,e0,nx,2,two_over_pi);

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libm/src/k_rem_pio2.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/src/k_rem_pio2f.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/k_rem_pio2.c
diff -u src/lib/libm/src/k_rem_pio2.c:1.14 src/lib/libm/src/k_rem_pio2.c:1.15
--- src/lib/libm/src/k_rem_pio2.c:1.14	Wed Aug 24 13:51:19 2022
+++ src/lib/libm/src/k_rem_pio2.c	Tue Aug  8 06:31:17 2023
@@ -16,7 +16,7 @@
 __FBSDID("$FreeBSD: head/lib/msun/src/k_rem_pio2.c 342651 2018-12-31 15:43:06Z pfg $");
 #endif
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: k_rem_pio2.c,v 1.14 2022/08/24 13:51:19 christos Exp $");
+__RCSID("$NetBSD: k_rem_pio2.c,v 1.15 2023/08/08 06:31:17 mrg Exp $");
 #endif
 
 /*
@@ -302,6 +302,11 @@ __kernel_rem_pio2(double *x, double *y, 
 	int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
 	double z,fw,f[20],fq[20],q[20];
 
+/* if nx < 2, fq[0] may be accessed uninitialised */
+	if (nx < 2) {
+	fq[0] = 0;
+	}
+
 /* initialize jk*/
 	jk = init_jk[prec];
 	jp = jk;

Index: src/lib/libm/src/k_rem_pio2f.c
diff -u src/lib/libm/src/k_rem_pio2f.c:1.9 src/lib/libm/src/k_rem_pio2f.c:1.10
--- src/lib/libm/src/k_rem_pio2f.c:1.9	Thu Jun 22 12:43:43 2017
+++ src/lib/libm/src/k_rem_pio2f.c	Tue Aug  8 06:31:17 2023
@@ -15,7 +15,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: k_rem_pio2f.c,v 1.9 2017/06/22 12:43:43 maya Exp $");
+__RCSID("$NetBSD: k_rem_pio2f.c,v 1.10 2023/08/08 06:31:17 mrg Exp $");
 #endif
 
 #include "namespace.h"
@@ -53,6 +53,11 @@ __kernel_rem_pio2f(float *x, float *y, i
 	int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
 	float z,fw,f[20],fq[20],q[20];
 
+/* if nx < 2, fq[0] may be accessed uninitialised */
+	if (nx < 2) {
+	fq[0] = 0;
+	}
+
 /* initialize jk*/
 	jk = init_jk[prec];
 	jp = jk;



CVS commit: src/lib/libm/src

2023-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug  8 06:31:18 UTC 2023

Modified Files:
src/lib/libm/src: k_rem_pio2.c k_rem_pio2f.c

Log Message:
avoid uninitialised variable accesses.

if __kernel_rem_pio2() or __kernel_rem_pio2f() are called with "nx" less
than 2, the local variable fq[0] may be accessed uninitialised.

__kernel_rem_pio2() has direct calls with nx = 1, and __kernel_rem_pio2f()
is called with a value starting at 3, but may be decreased to less than 2,
implied by this code , if not actually avoided by the tx[] setup above:
nx = 3;
while(tx[nx-1]==zero) nx--; /* skip zero term */
n  =  __kernel_rem_pio2f(tx,y,e0,nx,2,two_over_pi);

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libm/src/k_rem_pio2.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/src/k_rem_pio2f.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2023-08-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug  7 08:54:40 UTC 2023

Modified Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: Add dummy remainderl and remquol.

These are pretty bad -- these aren't transcendental functions; not
rocket science to make them correctly rounded -- but let's just make
sure they're available in libm for netbsd-10.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/ldbl_dummy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/ldbl_dummy.c
diff -u src/lib/libm/src/ldbl_dummy.c:1.3 src/lib/libm/src/ldbl_dummy.c:1.4
--- src/lib/libm/src/ldbl_dummy.c:1.3	Mon Mar 13 18:18:36 2023
+++ src/lib/libm/src/ldbl_dummy.c	Mon Aug  7 08:54:40 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ldbl_dummy.c,v 1.3 2023/03/13 18:18:36 riastradh Exp $ */
+/* $NetBSD: ldbl_dummy.c,v 1.4 2023/08/07 08:54:40 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ldbl_dummy.c,v 1.3 2023/03/13 18:18:36 riastradh Exp $");
+__RCSID("$NetBSD: ldbl_dummy.c,v 1.4 2023/08/07 08:54:40 riastradh Exp $");
 
 #include "namespace.h"
 #include 
@@ -222,3 +222,15 @@ tgammal(long double x)
 {
 	return tgamma(x);
 }
+
+long double
+remainderl(long double x, long double y)
+{
+	return remainder(x, y);
+}
+
+long double
+remquol(long double x, long double y, int *quo)
+{
+	return remquo(x, y, quo);
+}



CVS commit: src/lib/libm/src

2023-08-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug  7 08:54:40 UTC 2023

Modified Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: Add dummy remainderl and remquol.

These are pretty bad -- these aren't transcendental functions; not
rocket science to make them correctly rounded -- but let's just make
sure they're available in libm for netbsd-10.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/ldbl_dummy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



re: CVS commit: src/lib/libm/src

2023-03-15 Thread matthew green
"Taylor R Campbell" writes:
> Module Name:  src
> Committed By: riastradh
> Date: Mon Mar 13 18:18:36 UTC 2023
>
> Modified Files:
>   src/lib/libm/src: ldbl_dummy.c
>
> Log Message:
> libm: Fill in more dummy long double transcendental functions.
>
> This should cover everything from C99.

bump shlib minor?


.mrg.


CVS commit: src/lib/libm/src

2023-03-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Mar 14 05:49:03 UTC 2023

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
Add (newly added): expm1l log1pl log2l lgammal tgammal
so that the library gets the correct symbols defined in it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libm/src/namespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.16 src/lib/libm/src/namespace.h:1.17
--- src/lib/libm/src/namespace.h:1.16	Sat Aug 27 08:31:59 2022
+++ src/lib/libm/src/namespace.h	Tue Mar 14 05:49:03 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.16 2022/08/27 08:31:59 christos Exp $ */
+/* $NetBSD: namespace.h,v 1.17 2023/03/14 05:49:03 kre Exp $ */
 
 #define atan2 _atan2
 #define atan2f _atan2f
@@ -10,6 +10,7 @@
 #define exp _exp
 #define expf _expf
 #define expl _expl
+#define expm1l _expm1l
 #define log _log
 #define logf _logf
 #define logl _logl
@@ -73,9 +74,14 @@
 #define tanhl _tanhl
 #define atanhl _atanhl
 #define log10l _log10l
+#define log1pl _log1pl
+#define log2l _log2l
 
-#define erfl	_erfl
-#define erfcl	_erfcl
+#define erfl _erfl
+#define erfcl _erfcl
+
+#define lgammal _lgammal
+#define tgammal _tgammal
 
 #define feclearexcept _feclearexcept
 #define fegetenv _fegetenv



CVS commit: src/lib/libm/src

2023-03-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Mar 14 05:49:03 UTC 2023

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
Add (newly added): expm1l log1pl log2l lgammal tgammal
so that the library gets the correct symbols defined in it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libm/src/namespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2023-03-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar 13 18:26:32 UTC 2023

Modified Files:
src/lib/libm/src: s_llrintl.c s_lrintl.c

Log Message:
libm: Need  for __HAVE_LONG_DOUBLE.

Fixes missing definitions of lrintl, llrintl on various platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_llrintl.c \
src/lib/libm/src/s_lrintl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_llrintl.c
diff -u src/lib/libm/src/s_llrintl.c:1.2 src/lib/libm/src/s_llrintl.c:1.3
--- src/lib/libm/src/s_llrintl.c:1.2	Sun May  7 11:29:21 2017
+++ src/lib/libm/src/s_llrintl.c	Mon Mar 13 18:26:32 2023
@@ -2,9 +2,11 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/lib/msun/src/s_llrintl.c 175309 2008-01-14 02:12:07Z das $");
 #else
-__RCSID("$NetBSD: s_llrintl.c,v 1.2 2017/05/07 11:29:21 martin Exp $");
+__RCSID("$NetBSD: s_llrintl.c,v 1.3 2023/03/13 18:26:32 riastradh Exp $");
 #endif
 
+#include 
+
 #ifdef __HAVE_LONG_DOUBLE
 #define stype		long double
 #define	roundit		rintl
Index: src/lib/libm/src/s_lrintl.c
diff -u src/lib/libm/src/s_lrintl.c:1.2 src/lib/libm/src/s_lrintl.c:1.3
--- src/lib/libm/src/s_lrintl.c:1.2	Sun May  7 11:29:21 2017
+++ src/lib/libm/src/s_lrintl.c	Mon Mar 13 18:26:32 2023
@@ -2,9 +2,11 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/lib/msun/src/s_lrintl.c 175309 2008-01-14 02:12:07Z das $");
 #else
-__RCSID("$NetBSD: s_lrintl.c,v 1.2 2017/05/07 11:29:21 martin Exp $");
+__RCSID("$NetBSD: s_lrintl.c,v 1.3 2023/03/13 18:26:32 riastradh Exp $");
 #endif
 
+#include 
+
 #ifdef __HAVE_LONG_DOUBLE
 #define stype		long double
 #define	roundit		rintl



CVS commit: src/lib/libm/src

2023-03-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar 13 18:26:32 UTC 2023

Modified Files:
src/lib/libm/src: s_llrintl.c s_lrintl.c

Log Message:
libm: Need  for __HAVE_LONG_DOUBLE.

Fixes missing definitions of lrintl, llrintl on various platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_llrintl.c \
src/lib/libm/src/s_lrintl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2023-03-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar 13 18:18:36 UTC 2023

Modified Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: Fill in more dummy long double transcendental functions.

This should cover everything from C99.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/ldbl_dummy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/ldbl_dummy.c
diff -u src/lib/libm/src/ldbl_dummy.c:1.2 src/lib/libm/src/ldbl_dummy.c:1.3
--- src/lib/libm/src/ldbl_dummy.c:1.2	Thu Nov 13 21:43:27 2014
+++ src/lib/libm/src/ldbl_dummy.c	Mon Mar 13 18:18:36 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ldbl_dummy.c,v 1.2 2014/11/13 21:43:27 christos Exp $ */
+/* $NetBSD: ldbl_dummy.c,v 1.3 2023/03/13 18:18:36 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ldbl_dummy.c,v 1.2 2014/11/13 21:43:27 christos Exp $");
+__RCSID("$NetBSD: ldbl_dummy.c,v 1.3 2023/03/13 18:18:36 riastradh Exp $");
 
 #include "namespace.h"
 #include 
@@ -43,8 +43,11 @@ __weak_alias(atan2l, _atan2l)
 __weak_alias(hypotl, _hypotl)
 __weak_alias(logl, _logl)
 __weak_alias(log10l, _log10l)
+__weak_alias(log2l, _log2l)
+__weak_alias(log1pl, _log1pl)
 __weak_alias(expl, _expl)
 __weak_alias(exp2l, _exp2l)
+__weak_alias(expm1l, _expm1l)
 __weak_alias(powl, _powl)
 __weak_alias(cosl, _cosl)
 __weak_alias(sinl, _sinl)
@@ -60,6 +63,8 @@ __weak_alias(asinhl, _asinhl)
 __weak_alias(atanhl, _atanhl)
 __weak_alias(erfl, _erfl)
 __weak_alias(erfcl, _erfcl)
+__weak_alias(lgammal, _lgammal)
+__weak_alias(tgammal, _tgammal)
 
 long double
 atan2l(long double y, long double x)
@@ -86,6 +91,18 @@ log10l(long double x)
 }
 
 long double
+log2l(long double x)
+{
+	return log2(x);
+}
+
+long double
+log1pl(long double x)
+{
+	return log1p(x);
+}
+
+long double
 expl(long double x)
 {
 	return exp(x);
@@ -98,6 +115,12 @@ exp2l(long double x)
 }
 
 long double
+expm1l(long double x)
+{
+	return expm1(x);
+}
+
+long double
 powl(long double x, long double y)
 {
 	return pow(x, y);
@@ -187,3 +210,15 @@ erfcl(long double x)
 {
 	return erfc(x);
 }
+
+long double
+lgammal(long double x)
+{
+	return lgamma(x);
+}
+
+long double
+tgammal(long double x)
+{
+	return tgamma(x);
+}



CVS commit: src/lib/libm/src

2023-03-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar 13 18:18:36 UTC 2023

Modified Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: Fill in more dummy long double transcendental functions.

This should cover everything from C99.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/ldbl_dummy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2022-08-28 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Aug 28 21:24:09 UTC 2022

Modified Files:
src/lib/libm/src: s_rint.c

Log Message:
s_rint.c: weak-alias rintl -> rint for ports without __HAVE_LONG_DOUBLE.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/s_rint.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_rint.c
diff -u src/lib/libm/src/s_rint.c:1.12 src/lib/libm/src/s_rint.c:1.13
--- src/lib/libm/src/s_rint.c:1.12	Fri Apr 25 22:21:53 2008
+++ src/lib/libm/src/s_rint.c	Sun Aug 28 21:24:09 2022
@@ -12,7 +12,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_rint.c,v 1.12 2008/04/25 22:21:53 christos Exp $");
+__RCSID("$NetBSD: s_rint.c,v 1.13 2022/08/28 21:24:09 he Exp $");
 #endif
 
 /*
@@ -77,3 +77,7 @@ rint(double x)
 	w = TWO52[sx]+x;
 	return w-TWO52[sx];
 }
+
+#if !defined(__HAVE_LONG_DOUBLE)
+__weak_alias(rintl, rint)
+#endif



CVS commit: src/lib/libm/src

2022-08-28 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Aug 28 21:24:09 UTC 2022

Modified Files:
src/lib/libm/src: s_rint.c

Log Message:
s_rint.c: weak-alias rintl -> rint for ports without __HAVE_LONG_DOUBLE.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/s_rint.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2022-08-28 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Aug 28 16:07:58 UTC 2022

Modified Files:
src/lib/libm/src: s_sincos.c

Log Message:
s_sincos.c: use correct order of __weak_alias() arguments...


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_sincos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_sincos.c
diff -u src/lib/libm/src/s_sincos.c:1.3 src/lib/libm/src/s_sincos.c:1.4
--- src/lib/libm/src/s_sincos.c:1.3	Sun Aug 28 14:30:41 2022
+++ src/lib/libm/src/s_sincos.c	Sun Aug 28 16:07:58 2022
@@ -14,7 +14,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_sincos.c,v 1.3 2022/08/28 14:30:41 he Exp $");
+__RCSID("$NetBSD: s_sincos.c,v 1.4 2022/08/28 16:07:58 he Exp $");
 #endif
 #if 0
 __FBSDID("$FreeBSD: head/lib/msun/src/s_sincos.c 319047 2017-05-28 06:13:38Z mmel $");
@@ -86,5 +86,5 @@ sincos(double x, double *sn, double *cs)
 }
 
 #if !defined(__HAVE_LONG_DOUBLE)
-__weak_alias(sincos, sincosl);
+__weak_alias(sincosl, sincos);
 #endif



CVS commit: src/lib/libm/src

2022-08-28 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Aug 28 16:07:58 UTC 2022

Modified Files:
src/lib/libm/src: s_sincos.c

Log Message:
s_sincos.c: use correct order of __weak_alias() arguments...


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_sincos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2022-08-28 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Aug 28 14:30:41 UTC 2022

Modified Files:
src/lib/libm/src: s_sincos.c

Log Message:
s_sincos.c: use __weak_alias and not __weak_reference.

Fixes build on NetBSD/macppc, thanks to hint from riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_sincos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_sincos.c
diff -u src/lib/libm/src/s_sincos.c:1.2 src/lib/libm/src/s_sincos.c:1.3
--- src/lib/libm/src/s_sincos.c:1.2	Sun Aug 28 07:29:04 2022
+++ src/lib/libm/src/s_sincos.c	Sun Aug 28 14:30:41 2022
@@ -14,7 +14,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_sincos.c,v 1.2 2022/08/28 07:29:04 christos Exp $");
+__RCSID("$NetBSD: s_sincos.c,v 1.3 2022/08/28 14:30:41 he Exp $");
 #endif
 #if 0
 __FBSDID("$FreeBSD: head/lib/msun/src/s_sincos.c 319047 2017-05-28 06:13:38Z mmel $");
@@ -86,5 +86,5 @@ sincos(double x, double *sn, double *cs)
 }
 
 #if !defined(__HAVE_LONG_DOUBLE)
-__weak_reference(sincos, sincosl);
+__weak_alias(sincos, sincosl);
 #endif



CVS commit: src/lib/libm/src

2022-08-28 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Aug 28 14:30:41 UTC 2022

Modified Files:
src/lib/libm/src: s_sincos.c

Log Message:
s_sincos.c: use __weak_alias and not __weak_reference.

Fixes build on NetBSD/macppc, thanks to hint from riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_sincos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2022-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 07:29:05 UTC 2022

Modified Files:
src/lib/libm/src: s_sincos.c

Log Message:
only alias sincos to sincosl when we don't have long doubles


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_sincos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_sincos.c
diff -u src/lib/libm/src/s_sincos.c:1.1 src/lib/libm/src/s_sincos.c:1.2
--- src/lib/libm/src/s_sincos.c:1.1	Sat Aug 27 04:31:59 2022
+++ src/lib/libm/src/s_sincos.c	Sun Aug 28 03:29:04 2022
@@ -14,7 +14,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_sincos.c,v 1.1 2022/08/27 08:31:59 christos Exp $");
+__RCSID("$NetBSD: s_sincos.c,v 1.2 2022/08/28 07:29:04 christos Exp $");
 #endif
 #if 0
 __FBSDID("$FreeBSD: head/lib/msun/src/s_sincos.c 319047 2017-05-28 06:13:38Z mmel $");
@@ -85,6 +85,6 @@ sincos(double x, double *sn, double *cs)
 	}
 }
 
-#if (LDBL_MANT_DIG == 53)
+#if !defined(__HAVE_LONG_DOUBLE)
 __weak_reference(sincos, sincosl);
 #endif



CVS commit: src/lib/libm/src

2022-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 28 07:29:05 UTC 2022

Modified Files:
src/lib/libm/src: s_sincos.c

Log Message:
only alias sincos to sincosl when we don't have long doubles


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_sincos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2022-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 27 17:15:52 UTC 2022

Modified Files:
src/lib/libm/src: s_sincosl.c

Log Message:
tuck in k_sincosl.h include inside __HAVE_LONG_DOUBLE


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_sincosl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_sincosl.c
diff -u src/lib/libm/src/s_sincosl.c:1.1 src/lib/libm/src/s_sincosl.c:1.2
--- src/lib/libm/src/s_sincosl.c:1.1	Sat Aug 27 04:31:59 2022
+++ src/lib/libm/src/s_sincosl.c	Sat Aug 27 13:15:52 2022
@@ -31,7 +31,7 @@
 __FBSDID("$FreeBSD: head/lib/msun/src/s_sincosl.c 319047 2017-05-28 06:13:38Z mmel $");
 #endif
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_sincosl.c,v 1.1 2022/08/27 08:31:59 christos Exp $");
+__RCSID("$NetBSD: s_sincosl.c,v 1.2 2022/08/27 17:15:52 christos Exp $");
 #endif
 
 #include "namespace.h"
@@ -42,9 +42,11 @@ __RCSID("$NetBSD: s_sincosl.c,v 1.1 2022
 
 #include "math.h"
 #include "math_private.h"
-#include "k_sincosl.h"
 
 #ifdef __HAVE_LONG_DOUBLE
+
+#include "k_sincosl.h"
+
 #if LDBL_MANT_DIG == 64
 #include "../ld80/e_rem_pio2l.h"
 #elif LDBL_MANT_DIG == 113



CVS commit: src/lib/libm/src

2022-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 27 17:15:52 UTC 2022

Modified Files:
src/lib/libm/src: s_sincosl.c

Log Message:
tuck in k_sincosl.h include inside __HAVE_LONG_DOUBLE


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_sincosl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2022-08-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 24 13:51:19 UTC 2022

Modified Files:
src/lib/libm/src: e_rem_pio2.c k_rem_pio2.c math_private.h

Log Message:
sync with FreeBSD; bring some more inline functions.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/e_rem_pio2.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libm/src/k_rem_pio2.c
cvs rdiff -u -r1.24 -r1.25 src/lib/libm/src/math_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/e_rem_pio2.c
diff -u src/lib/libm/src/e_rem_pio2.c:1.11 src/lib/libm/src/e_rem_pio2.c:1.12
--- src/lib/libm/src/e_rem_pio2.c:1.11	Sun May 26 18:01:52 2002
+++ src/lib/libm/src/e_rem_pio2.c	Wed Aug 24 09:51:19 2022
@@ -12,7 +12,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: e_rem_pio2.c,v 1.11 2002/05/26 22:01:52 wiz Exp $");
+__RCSID("$NetBSD: e_rem_pio2.c,v 1.12 2022/08/24 13:51:19 christos Exp $");
 #endif
 
 /* __ieee754_rem_pio2(x,y)
@@ -24,23 +24,6 @@ __RCSID("$NetBSD: e_rem_pio2.c,v 1.11 20
 #include "math.h"
 #include "math_private.h"
 
-/*
- * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
- */
-static const int32_t two_over_pi[] = {
-0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62,
-0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A,
-0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129,
-0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41,
-0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8,
-0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF,
-0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5,
-0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08,
-0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3,
-0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880,
-0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B,
-};
-
 static const int32_t npio2_hw[] = {
 0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C,
 0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C,
@@ -163,7 +146,7 @@ __ieee754_rem_pio2(double x, double *y)
 	tx[2] = z;
 	nx = 3;
 	while(tx[nx-1]==zero) nx--;	/* skip zero term */
-	n  =  __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi);
+	n  =  __kernel_rem_pio2(tx,y,e0,nx,2);
 	if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;}
 	return n;
 }

Index: src/lib/libm/src/k_rem_pio2.c
diff -u src/lib/libm/src/k_rem_pio2.c:1.13 src/lib/libm/src/k_rem_pio2.c:1.14
--- src/lib/libm/src/k_rem_pio2.c:1.13	Thu Jun 22 08:43:43 2017
+++ src/lib/libm/src/k_rem_pio2.c	Wed Aug 24 09:51:19 2022
@@ -1,9 +1,10 @@
-/* @(#)k_rem_pio2.c 5.1 93/09/24 */
+
+/* @(#)k_rem_pio2.c 1.3 95/01/18 */
 /*
  * 
  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
  * software is freely granted, provided that this notice
  * is preserved.
@@ -11,13 +12,16 @@
  */
 
 #include 
+#if 0
+__FBSDID("$FreeBSD: head/lib/msun/src/k_rem_pio2.c 342651 2018-12-31 15:43:06Z pfg $");
+#endif
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: k_rem_pio2.c,v 1.13 2017/06/22 12:43:43 maya Exp $");
+__RCSID("$NetBSD: k_rem_pio2.c,v 1.14 2022/08/24 13:51:19 christos Exp $");
 #endif
 
 /*
- * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
- * double x[],y[]; int e0,nx,prec; int ipio2[];
+ * __kernel_rem_pio2(x,y,e0,nx,prec)
+ * double x[],y[]; int e0,nx,prec;
  *
  * __kernel_rem_pio2 return the last three digits of N with
  *		y = x - N*pi/2
@@ -53,7 +57,7 @@ __RCSID("$NetBSD: k_rem_pio2.c,v 1.13 20
  *			64-bit  precision	2
  *			113-bit precision	3
  *		The actual value is the sum of them. Thus for 113-bit
- *		precison, one may have to do something like:
+ *		precision, one may have to do something like:
  *
  *		long double t,w,r_head, r_tail;
  *		t = (long double)y[2] + (long double)y[1];
@@ -61,7 +65,8 @@ __RCSID("$NetBSD: k_rem_pio2.c,v 1.13 20
  *		r_head = t+w;
  *		r_tail = w - (r_head - t);
  *
- *	e0	The exponent of x[0]
+ *	e0	The exponent of x[0]. Must be <= 16360 or you need to
+ *  expand the ipio2 table.
  *
  *	nx	dimension of x[]
  *
@@ -71,13 +76,6 @@ __RCSID("$NetBSD: k_rem_pio2.c,v 1.13 20
  *			2	64  bits (extended)
  *			3	113 bits (quad)
  *
- *	ipio2[]
- *		integer array, contains the (24*i)-th to (24*i+23)-th
- *		bit of 2/pi after binary point. The corresponding
- *		floating value is
- *
- *			ipio2[i] * 2^(-24(i+1)).
- *
  * External function:
  *	double scalbn(), floor();
  *
@@ -85,8 +83,13 @@ __RCSID("$NetBSD: k_rem_pio2.c,v 1.13 20
  * Here is the description of some local variables:
  *
  * 	jk	jk+1 is the initial number of terms of ipio2[] needed
- *		in the computation. The recommended 

CVS commit: src/lib/libm/src

2022-08-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 24 13:51:19 UTC 2022

Modified Files:
src/lib/libm/src: e_rem_pio2.c k_rem_pio2.c math_private.h

Log Message:
sync with FreeBSD; bring some more inline functions.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/e_rem_pio2.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libm/src/k_rem_pio2.c
cvs rdiff -u -r1.24 -r1.25 src/lib/libm/src/math_private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 04:22:50 UTC 2021

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
s/argumetn/argument/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_fabsl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_fabsl.c
diff -u src/lib/libm/src/s_fabsl.c:1.3 src/lib/libm/src/s_fabsl.c:1.4
--- src/lib/libm/src/s_fabsl.c:1.3	Fri Nov 29 22:16:10 2013
+++ src/lib/libm/src/s_fabsl.c	Sun Dec  5 04:22:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fabsl.c,v 1.3 2013/11/29 22:16:10 joerg Exp $	*/
+/*	$NetBSD: s_fabsl.c,v 1.4 2021/12/05 04:22:50 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,14 +26,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: s_fabsl.c,v 1.3 2013/11/29 22:16:10 joerg Exp $");
+__RCSID("$NetBSD: s_fabsl.c,v 1.4 2021/12/05 04:22:50 msaitoh Exp $");
 
 #include 
 #include 
 
 /*
  * fabsl(long double x)
- * This function returns the absolute value of its argumetn x, |x|.
+ * This function returns the absolute value of its argument x, |x|.
  */
 #ifdef __HAVE_LONG_DOUBLE
 long double



CVS commit: src/lib/libm/src

2021-12-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec  5 04:22:50 UTC 2021

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
s/argumetn/argument/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_fabsl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/lib/libm/src

2013-01-28 Thread Ryo ONODERA
Hi,

From: Matt Thomas m...@netbsd.org, Date: Mon, 28 Jan 2013 06:34:10 +

 Module Name:  src
 Committed By: matt
 Date: Mon Jan 28 06:34:09 UTC 2013
 
 Modified Files:
   src/lib/libm/src: s_scalbn.c s_scalbnf.c s_scalbnl.c
 
 Log Message:
 Deal with _LP64 properly.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.16 src/lib/libm/src/s_scalbn.c
 cvs rdiff -u -r1.9 -r1.10 src/lib/libm/src/s_scalbnf.c
 cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_scalbnl.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 

This commit lacks ;, and breaks build.

Index: s_scalbnl.c
===
RCS file: /cvsroot/src/lib/libm/src/s_scalbnl.c,v
retrieving revision 1.2
diff -u -r1.2 s_scalbnl.c
--- s_scalbnl.c 28 Jan 2013 06:34:09 -  1.2
+++ s_scalbnl.c 28 Jan 2013 10:55:45 -
@@ -61,7 +61,7 @@
 long double
 scalbnl(long double x, int n)
 {
-   return scalblnl(x, n)
+   return scalblnl(x, n);
 }
 #endif
 

--
Ryo ONODERA // ryo...@yk.rim.or.jp
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


CVS commit: src/lib/libm/src

2010-03-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Mar  8 01:05:20 UTC 2010

Modified Files:
src/lib/libm/src: s_fdim.c s_fmax.c s_fmaxf.c s_fmaxl.c s_fminf.c
s_fminl.c

Log Message:
Fix broken RCSID.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_fdim.c src/lib/libm/src/s_fmax.c \
src/lib/libm/src/s_fmaxf.c src/lib/libm/src/s_fmaxl.c \
src/lib/libm/src/s_fminf.c src/lib/libm/src/s_fminl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/src/s_fdim.c
diff -u src/lib/libm/src/s_fdim.c:1.1 src/lib/libm/src/s_fdim.c:1.2
--- src/lib/libm/src/s_fdim.c:1.1	Sun Oct  4 22:04:30 2009
+++ src/lib/libm/src/s_fdim.c	Mon Mar  8 01:05:20 2010
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID(NetBSD$);
+__RCSID($NetBSD: s_fdim.c,v 1.2 2010/03/08 01:05:20 snj Exp $);
 #ifdef notdef
 __FBSDID($FreeBSD: src/lib/msun/src/s_fdim.c,v 1.1 2004/06/30 07:04:01 das Exp $);
 #endif
Index: src/lib/libm/src/s_fmax.c
diff -u src/lib/libm/src/s_fmax.c:1.1 src/lib/libm/src/s_fmax.c:1.2
--- src/lib/libm/src/s_fmax.c:1.1	Sun Oct  4 22:04:30 2009
+++ src/lib/libm/src/s_fmax.c	Mon Mar  8 01:05:20 2010
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID(NetBSD$);
+__RCSID($NetBSD: s_fmax.c,v 1.2 2010/03/08 01:05:20 snj Exp $);
 #ifdef notdef
 __FBSDID($FreeBSD: src/lib/msun/src/s_fmax.c,v 1.1 2004/06/30 07:04:01 das Exp $);
 #endif
Index: src/lib/libm/src/s_fmaxf.c
diff -u src/lib/libm/src/s_fmaxf.c:1.1 src/lib/libm/src/s_fmaxf.c:1.2
--- src/lib/libm/src/s_fmaxf.c:1.1	Sun Oct  4 22:04:30 2009
+++ src/lib/libm/src/s_fmaxf.c	Mon Mar  8 01:05:20 2010
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID(NetBSD$);
+__RCSID($NetBSD: s_fmaxf.c,v 1.2 2010/03/08 01:05:20 snj Exp $);
 #ifdef notdef
 __FBSDID($FreeBSD: src/lib/msun/src/s_fmaxf.c,v 1.1 2004/06/30 07:04:01 das Exp $);
 #endif
Index: src/lib/libm/src/s_fmaxl.c
diff -u src/lib/libm/src/s_fmaxl.c:1.1 src/lib/libm/src/s_fmaxl.c:1.2
--- src/lib/libm/src/s_fmaxl.c:1.1	Sun Oct  4 22:04:30 2009
+++ src/lib/libm/src/s_fmaxl.c	Mon Mar  8 01:05:20 2010
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID(NetBSD$);
+__RCSID($NetBSD: s_fmaxl.c,v 1.2 2010/03/08 01:05:20 snj Exp $);
 #ifdef notdef
 __FBSDID($FreeBSD: src/lib/msun/src/s_fmaxl.c,v 1.1 2004/06/30 07:04:01 das Exp $);
 #endif
Index: src/lib/libm/src/s_fminf.c
diff -u src/lib/libm/src/s_fminf.c:1.1 src/lib/libm/src/s_fminf.c:1.2
--- src/lib/libm/src/s_fminf.c:1.1	Sun Oct  4 22:04:30 2009
+++ src/lib/libm/src/s_fminf.c	Mon Mar  8 01:05:20 2010
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID(NetBSD$);
+__RCSID($NetBSD: s_fminf.c,v 1.2 2010/03/08 01:05:20 snj Exp $);
 #ifdef notdef
 __FBSDID($FreeBSD: src/lib/msun/src/s_fminf.c,v 1.1 2004/06/30 07:04:01 das Exp $);
 #endif
Index: src/lib/libm/src/s_fminl.c
diff -u src/lib/libm/src/s_fminl.c:1.1 src/lib/libm/src/s_fminl.c:1.2
--- src/lib/libm/src/s_fminl.c:1.1	Sun Oct  4 22:04:30 2009
+++ src/lib/libm/src/s_fminl.c	Mon Mar  8 01:05:20 2010
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID(NetBSD$);
+__RCSID($NetBSD: s_fminl.c,v 1.2 2010/03/08 01:05:20 snj Exp $);
 #ifdef notdef
 __FBSDID($FreeBSD: src/lib/msun/src/s_fminl.c,v 1.1 2004/06/30 07:04:01 das Exp $);
 #endif



CVS commit: src/lib/libm/src

2010-03-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Mar  8 01:05:20 UTC 2010

Modified Files:
src/lib/libm/src: s_fdim.c s_fmax.c s_fmaxf.c s_fmaxl.c s_fminf.c
s_fminl.c

Log Message:
Fix broken RCSID.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_fdim.c src/lib/libm/src/s_fmax.c \
src/lib/libm/src/s_fmaxf.c src/lib/libm/src/s_fmaxl.c \
src/lib/libm/src/s_fminf.c src/lib/libm/src/s_fminl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2010-01-27 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Jan 27 20:23:53 UTC 2010

Modified Files:
src/lib/libm/src: k_standard.c

Log Message:
fix return values for atan2(+-0,+-0) in the POSIX case


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libm/src/k_standard.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2010-01-20 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Jan 20 16:49:43 UTC 2010

Modified Files:
src/lib/libm/src: k_standard.c

Log Message:
let the previous fix apply to acos rather than atan2,
and get rid of #ifdef vax


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libm/src/k_standard.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libm/src

2010-01-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 11 23:38:24 UTC 2010

Modified Files:
src/lib/libm/src: s_exp2.c

Log Message:
remove weak reference for now.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_exp2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.