summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-02-08 16:44:31 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-02-08 16:44:31 +0000
commit78be84cd747c2e3965bf6c2fd5f702d6ff2f5525 (patch)
treec070a60ef7c5371bef8b7a559442a6920b394c8e /libc/sysdeps/ieee754
parentde06548e980675e65a1e6d850bb8c3a3f7ec638d (diff)
downloadeglibc2-78be84cd747c2e3965bf6c2fd5f702d6ff2f5525.tar.gz
Merge changes between r16568 and r17050 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@17051 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754')
-rw-r--r--libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c19
-rw-r--r--libc/sysdeps/ieee754/dbl-64/k_tan.c11
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_copysign.c7
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_erf.c18
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_fabs.c7
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_finite.c7
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_floor.c11
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_frexp.c11
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_ilogb.c7
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_isnan.c7
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_log1p.c6
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_logb.c7
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_modf.c23
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_nearbyint.c11
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_scalbln.c40
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_scalbn.c40
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_tanh.c11
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c67
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c7
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c65
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c60
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c24
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_acoshf.c11
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_asinf.c11
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_rem_pio2f.c19
-rw-r--r--libc/sysdeps/ieee754/flt-32/k_cosf.c11
-rw-r--r--libc/sysdeps/ieee754/flt-32/k_rem_pio2f.c19
-rw-r--r--libc/sysdeps/ieee754/flt-32/k_sinf.c11
-rw-r--r--libc/sysdeps/ieee754/flt-32/k_tanf.c11
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_atanf.c25
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_copysignf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_cosf.c11
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_erff.c18
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_fabsf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_finitef.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_frexpf.c11
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_ilogbf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_isnanf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_logbf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_modff.c20
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_nextafterf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_scalblnf.c38
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_scalbnf.c38
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_sinf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_tanf.c7
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_tanhf.c11
-rw-r--r--libc/sysdeps/ieee754/k_standard.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_asinl.c10
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/k_tanl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_asinhl.c10
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_ceill.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_copysignl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_cosl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_erfl.c21
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_fabsl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_finitel.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_floorl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_frexpl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_ilogbl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_isnanl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_logbl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_modfl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_nexttowardf.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_rintl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_sinl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_tanhl.c10
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_tanl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/w_expl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c10
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c10
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c18
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/k_tanl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c21
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_ilogbl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_logbl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_modfl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_rintl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c15
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c15
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_asinl.c10
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_hypotl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_asinhl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_ceill.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_copysignl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_cosl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_erfl.c20
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_fabsl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_finitel.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_floorl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_frexpl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_ilogbl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_isnanl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_logbl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_modfl.c20
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_nearbyintl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c8
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_rintl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c38
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c38
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_sinl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_tanhl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_tanl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h10
-rw-r--r--libc/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c2
-rw-r--r--libc/sysdeps/ieee754/s_matherr.c13
132 files changed, 414 insertions, 1246 deletions
diff --git a/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index 911ff1fe3..53be066e0 100644
--- a/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c
+++ b/libc/sysdeps/ieee754/dbl-64/k_rem_pio2.c
@@ -133,17 +133,9 @@ static char rcsid[] = "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const int init_jk[] = {2,3,4,6}; /* initial value for jk */
-#else
-static int init_jk[] = {2,3,4,6};
-#endif
-#ifdef __STDC__
static const double PIo2[] = {
-#else
-static double PIo2[] = {
-#endif
1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */
7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */
5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */
@@ -154,22 +146,13 @@ static double PIo2[] = {
2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */
};
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
zero = 0.0,
one = 1.0,
two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
-#ifdef __STDC__
- int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
-#else
- int __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
- double x[], y[]; int e0,nx,prec; int32_t ipio2[];
-#endif
+int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
{
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];
diff --git a/libc/sysdeps/ieee754/dbl-64/k_tan.c b/libc/sysdeps/ieee754/dbl-64/k_tan.c
index 55dafb8eb..7ef4103bc 100644
--- a/libc/sysdeps/ieee754/dbl-64/k_tan.c
+++ b/libc/sysdeps/ieee754/dbl-64/k_tan.c
@@ -53,11 +53,7 @@ static char rcsid[] = "$NetBSD: k_tan.c,v 1.8 1995/05/10 20:46:37 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
pio4 = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */
pio4lo= 3.06161699786838301793e-17, /* 0x3C81A626, 0x33145C07 */
@@ -77,12 +73,7 @@ T[] = {
2.59073051863633712884e-05, /* 0x3EFB2A70, 0x74BF7AD4 */
};
-#ifdef __STDC__
- double __kernel_tan(double x, double y, int iy)
-#else
- double __kernel_tan(x, y, iy)
- double x,y; int iy;
-#endif
+double __kernel_tan(double x, double y, int iy)
{
double z,r,v,w,s,r1,r2,r3,v1,v2,v3,w2,w4;
int32_t ix,hx;
diff --git a/libc/sysdeps/ieee754/dbl-64/s_copysign.c b/libc/sysdeps/ieee754/dbl-64/s_copysign.c
index 5e35e6943..63f3bd3cc 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_copysign.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_copysign.c
@@ -23,12 +23,7 @@ static char rcsid[] = "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- double __copysign(double x, double y)
-#else
- double __copysign(x,y)
- double x,y;
-#endif
+double __copysign(double x, double y)
{
u_int32_t hx,hy;
GET_HIGH_WORD(hx,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/s_erf.c b/libc/sysdeps/ieee754/dbl-64/s_erf.c
index 94fb5c964..97d7e34ff 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_erf.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_erf.c
@@ -115,11 +115,7 @@ static char rcsid[] = "$NetBSD: s_erf.c,v 1.8 1995/05/10 20:47:05 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
tiny = 1e-300,
half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
@@ -194,12 +190,7 @@ sb[] = {0.0,3.03380607434824582924e+01, /* 0x403E568B, 0x261D5190 */
4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */
-2.24409524465858183362e+01}; /* 0xC03670E2, 0x42712D62 */
-#ifdef __STDC__
- double __erf(double x)
-#else
- double __erf(x)
- double x;
-#endif
+double __erf(double x)
{
int32_t hx,ix,i;
double R,S,P,Q,s,y,z,r;
@@ -307,12 +298,7 @@ strong_alias (__erf, __erfl)
weak_alias (__erf, erfl)
#endif
-#ifdef __STDC__
- double __erfc(double x)
-#else
- double __erfc(x)
- double x;
-#endif
+double __erfc(double x)
{
int32_t hx,ix;
double R,S,P,Q,s,y,z,r;
diff --git a/libc/sysdeps/ieee754/dbl-64/s_fabs.c b/libc/sysdeps/ieee754/dbl-64/s_fabs.c
index 1abe9432a..6dca1dec0 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_fabs.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_fabs.c
@@ -21,12 +21,7 @@ static char rcsid[] = "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- double __fabs(double x)
-#else
- double __fabs(x)
- double x;
-#endif
+double __fabs(double x)
{
u_int32_t high;
GET_HIGH_WORD(high,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/s_finite.c b/libc/sysdeps/ieee754/dbl-64/s_finite.c
index 2ca3bf245..cf3d8d891 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_finite.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_finite.c
@@ -23,12 +23,7 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $";
#include "math_private.h"
#undef __finite
-#ifdef __STDC__
- int __finite(double x)
-#else
- int __finite(x)
- double x;
-#endif
+int __finite(double x)
{
int32_t hx;
GET_HIGH_WORD(hx,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/s_floor.c b/libc/sysdeps/ieee754/dbl-64/s_floor.c
index 8b2038e69..139e2f5cb 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_floor.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_floor.c
@@ -22,18 +22,9 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double huge = 1.0e300;
-#else
-static double huge = 1.0e300;
-#endif
-#ifdef __STDC__
- double __floor(double x)
-#else
- double __floor(x)
- double x;
-#endif
+double __floor(double x)
{
int32_t i0,i1,j0;
u_int32_t i,j;
diff --git a/libc/sysdeps/ieee754/dbl-64/s_frexp.c b/libc/sysdeps/ieee754/dbl-64/s_frexp.c
index 7dbddfde0..e92727417 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_frexp.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_frexp.c
@@ -27,19 +27,10 @@ static char rcsid[] = "$NetBSD: s_frexp.c,v 1.9 1995/05/10 20:47:24 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */
-#ifdef __STDC__
- double __frexp(double x, int *eptr)
-#else
- double __frexp(x, eptr)
- double x; int *eptr;
-#endif
+double __frexp(double x, int *eptr)
{
int32_t hx, ix, lx;
EXTRACT_WORDS(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/s_ilogb.c b/libc/sysdeps/ieee754/dbl-64/s_ilogb.c
index 89a833781..a2395a10a 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_ilogb.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_ilogb.c
@@ -25,12 +25,7 @@ static char rcsid[] = "$NetBSD: s_ilogb.c,v 1.9 1995/05/10 20:47:28 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __ilogb(double x)
-#else
- int __ilogb(x)
- double x;
-#endif
+int __ilogb(double x)
{
int32_t hx,lx,ix;
diff --git a/libc/sysdeps/ieee754/dbl-64/s_isnan.c b/libc/sysdeps/ieee754/dbl-64/s_isnan.c
index 74e829160..c87eb69b1 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_isnan.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_isnan.c
@@ -23,12 +23,7 @@ static char rcsid[] = "$NetBSD: s_isnan.c,v 1.8 1995/05/10 20:47:36 jtc Exp $";
#include "math_private.h"
#undef __isnan
-#ifdef __STDC__
- int __isnan(double x)
-#else
- int __isnan(x)
- double x;
-#endif
+int __isnan(double x)
{
int32_t hx,lx;
EXTRACT_WORDS(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/s_log1p.c b/libc/sysdeps/ieee754/dbl-64/s_log1p.c
index dc79a02bb..f82048f20 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_log1p.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_log1p.c
@@ -106,11 +106,11 @@ __log1p(double x)
k = 1;
if (hx < 0x3FDA827A) { /* x < 0.41422 */
- if(ax>=0x3ff00000) { /* x <= -1.0 */
+ if(__builtin_expect(ax>=0x3ff00000, 0)) { /* x <= -1.0 */
if(x==-1.0) return -two54/(x-x);/* log1p(-1)=+inf */
else return (x-x)/(x-x); /* log1p(x<-1)=NaN */
}
- if(ax<0x3e200000) { /* |x| < 2**-29 */
+ if(__builtin_expect(ax<0x3e200000, 0)) { /* |x| < 2**-29 */
math_force_eval(two54+x); /* raise inexact */
if (ax<0x3c900000) /* |x| < 2**-54 */
return x;
@@ -120,7 +120,7 @@ __log1p(double x)
if(hx>0||hx<=((int32_t)0xbfd2bec3)) {
k=0;f=x;hu=1;} /* -0.2929<x<0.41422 */
}
- if (hx >= 0x7ff00000) return x+x;
+ else if (__builtin_expect(hx >= 0x7ff00000, 0)) return x+x;
if(k!=0) {
if(hx<0x43400000) {
u = 1.0+x;
diff --git a/libc/sysdeps/ieee754/dbl-64/s_logb.c b/libc/sysdeps/ieee754/dbl-64/s_logb.c
index 4668cf78f..46743c0cb 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_logb.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_logb.c
@@ -23,12 +23,7 @@ static char rcsid[] = "$NetBSD: s_logb.c,v 1.8 1995/05/10 20:47:50 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- double __logb(double x)
-#else
- double __logb(x)
- double x;
-#endif
+double __logb(double x)
{
int32_t lx,ix;
EXTRACT_WORDS(ix,lx,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/s_modf.c b/libc/sysdeps/ieee754/dbl-64/s_modf.c
index 7851f675a..a884de5d5 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_modf.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_modf.c
@@ -1,4 +1,3 @@
-/* @(#)s_modf.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -10,10 +9,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_modf.c,v 1.8 1995/05/10 20:47:55 jtc Exp $";
-#endif
-
/*
* modf(double x, double *iptr)
* return fraction part of x, and return x's integral part in *iptr.
@@ -27,18 +22,10 @@ static char rcsid[] = "$NetBSD: s_modf.c,v 1.8 1995/05/10 20:47:55 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double one = 1.0;
-#else
-static double one = 1.0;
-#endif
-#ifdef __STDC__
- double __modf(double x, double *iptr)
-#else
- double __modf(x, iptr)
- double x,*iptr;
-#endif
+double
+__modf(double x, double *iptr)
{
int32_t i0,i1,j0;
u_int32_t i;
@@ -46,7 +33,7 @@ static double one = 1.0;
j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */
if(j0<20) { /* integer part in high x */
if(j0<0) { /* |x|<1 */
- INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */
+ INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */
return x;
} else {
i = (0x000fffff)>>j0;
@@ -59,7 +46,7 @@ static double one = 1.0;
return x - *iptr;
}
}
- } else if (j0>51) { /* no fraction part */
+ } else if (__builtin_expect(j0>51, 0)) { /* no fraction part */
*iptr = x*one;
/* We must handle NaNs separately. */
if (j0 == 0x400 && ((i0 & 0xfffff) | i1))
@@ -73,7 +60,7 @@ static double one = 1.0;
INSERT_WORDS(x,i0&0x80000000,0); /* return +-0 */
return x;
} else {
- INSERT_WORDS(*iptr,i0,i1&(~i));
+ INSERT_WORDS(*iptr,i0,i1&(~i));
return x - *iptr;
}
}
diff --git a/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c b/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
index 71e14cfb6..184fa7017 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -28,22 +28,13 @@ static char rcsid[] = "$NetBSD: s_rint.c,v 1.8 1995/05/10 20:48:04 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
TWO52[2]={
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
};
-#ifdef __STDC__
- double __nearbyint(double x)
-#else
- double __nearbyint(x)
- double x;
-#endif
+double __nearbyint(double x)
{
fenv_t env;
int32_t i0,j0,sx;
diff --git a/libc/sysdeps/ieee754/dbl-64/s_scalbln.c b/libc/sysdeps/ieee754/dbl-64/s_scalbln.c
index aa6134f09..89174b47f 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_scalbln.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_scalbln.c
@@ -1,4 +1,3 @@
-/* @(#)s_scalbn.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -10,10 +9,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $";
-#endif
-
/*
* scalbn (double x, int n)
* scalbn(x,n) returns x* 2**n computed by exponent
@@ -24,44 +19,37 @@ static char rcsid[] = "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
huge = 1.0e+300,
tiny = 1.0e-300;
-#ifdef __STDC__
- double __scalbln (double x, long int n)
-#else
- double __scalbln (x,n)
- double x; long int n;
-#endif
+double
+__scalbln (double x, long int n)
{
int32_t k,hx,lx;
EXTRACT_WORDS(hx,lx,x);
- k = (hx&0x7ff00000)>>20; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
+ k = (hx&0x7ff00000)>>20; /* extract exponent */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
+ if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
x *= two54;
GET_HIGH_WORD(hx,x);
k = ((hx&0x7ff00000)>>20) - 54;
}
- if (k==0x7ff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0x7fe)
+ if (__builtin_expect(k==0x7ff, 0)) return x+x; /* NaN or Inf */
+ k = k+n;
+ if (__builtin_expect(n> 50000 || k > 0x7fe, 0))
return huge*__copysign(huge,x); /* overflow */
- if (n< -50000) return tiny*__copysign(tiny,x); /*underflow*/
- if (k > 0) /* normal result */
+ if (__builtin_expect(n< -50000, 0))
+ return tiny*__copysign(tiny,x); /*underflow*/
+ if (__builtin_expect(k > 0, 1)) /* normal result */
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
- if (k <= -54)
+ if (k <= -54)
return tiny*__copysign(tiny,x); /*underflow*/
- k += 54; /* subnormal result */
+ k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
- return x*twom54;
+ return x*twom54;
}
weak_alias (__scalbln, scalbln)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/sysdeps/ieee754/dbl-64/s_scalbn.c b/libc/sysdeps/ieee754/dbl-64/s_scalbn.c
index 3dbfe8fef..1e67dbe5e 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_scalbn.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_scalbn.c
@@ -1,4 +1,3 @@
-/* @(#)s_scalbn.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -10,10 +9,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $";
-#endif
-
/*
* scalbn (double x, int n)
* scalbn(x,n) returns x* 2**n computed by exponent
@@ -24,44 +19,37 @@ static char rcsid[] = "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
huge = 1.0e+300,
tiny = 1.0e-300;
-#ifdef __STDC__
- double __scalbn (double x, int n)
-#else
- double __scalbn (x,n)
- double x; int n;
-#endif
+double
+__scalbn (double x, int n)
{
int32_t k,hx,lx;
EXTRACT_WORDS(hx,lx,x);
- k = (hx&0x7ff00000)>>20; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
+ k = (hx&0x7ff00000)>>20; /* extract exponent */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
+ if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
x *= two54;
GET_HIGH_WORD(hx,x);
k = ((hx&0x7ff00000)>>20) - 54;
}
- if (k==0x7ff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0x7fe)
+ if (__builtin_expect(k==0x7ff, 0)) return x+x; /* NaN or Inf */
+ k = k+n;
+ if (__builtin_expect(n> 50000 || k > 0x7fe, 0))
return huge*__copysign(huge,x); /* overflow */
- if (n< -50000) return tiny*__copysign(tiny,x); /*underflow*/
- if (k > 0) /* normal result */
+ if (__builtin_expect(n< -50000, 0))
+ return tiny*__copysign(tiny,x); /*underflow*/
+ if (__builtin_expect(k > 0, 1)) /* normal result */
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
- if (k <= -54)
+ if (k <= -54)
return tiny*__copysign(tiny,x); /*underflow*/
- k += 54; /* subnormal result */
+ k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
- return x*twom54;
+ return x*twom54;
}
weak_alias (__scalbn, scalbn)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/sysdeps/ieee754/dbl-64/s_tanh.c b/libc/sysdeps/ieee754/dbl-64/s_tanh.c
index 944f96386..63ef4b88a 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_tanh.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_tanh.c
@@ -41,18 +41,9 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double one=1.0, two=2.0, tiny = 1.0e-300;
-#else
-static double one=1.0, two=2.0, tiny = 1.0e-300;
-#endif
-#ifdef __STDC__
- double __tanh(double x)
-#else
- double __tanh(x)
- double x;
-#endif
+double __tanh(double x)
{
double t,z;
int32_t jx,ix,lx;
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
new file mode 100644
index 000000000..83c28479d
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
@@ -0,0 +1,67 @@
+/* Optimized for 64-bit by Ulrich Drepper <drepper@gmail.com>, 2012 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/* __ieee754_acosh(x)
+ * Method :
+ * Based on
+ * acosh(x) = log [ x + sqrt(x*x-1) ]
+ * we have
+ * acosh(x) := log(x)+ln2, if x is large; else
+ * acosh(x) := log(2x-1/(sqrt(x*x-1)+x)) if x>2; else
+ * acosh(x) := log1p(t+sqrt(2.0*t+t*t)); where t=x-1.
+ *
+ * Special cases:
+ * acosh(x) is NaN with signal if x<1.
+ * acosh(NaN) is NaN without signal.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+static const double
+one = 1.0,
+ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
+
+double
+__ieee754_acosh (double x)
+{
+ int64_t hx;
+ EXTRACT_WORDS64 (hx, x);
+
+ if (hx > INT64_C (0x4000000000000000))
+ {
+ if (__builtin_expect (hx >= INT64_C (0x41b0000000000000), 0))
+ {
+ /* x > 2**28 */
+ if (hx >= INT64_C (0x7ff0000000000000))
+ /* x is inf of NaN */
+ return x + x;
+ else
+ return __ieee754_log (x) + ln2;/* acosh(huge)=log(2x) */
+ }
+
+ /* 2**28 > x > 2 */
+ double t = x * x;
+ return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one)));
+ }
+ else if (__builtin_expect (hx > INT64_C (0x3ff0000000000000), 1))
+ {
+ /* 1<x<2 */
+ double t = x - one;
+ return __log1p (t + __ieee754_sqrt (2.0 * t + t * t));
+ }
+ else if (__builtin_expect (hx == INT64_C (0x3ff0000000000000), 1))
+ return 0.0; /* acosh(1) = 0 */
+ else /* x < 1 */
+ return (x - x) / (x - x);
+}
+strong_alias (__ieee754_acosh, __acosh_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
index 65dc8934f..86d0ac8bb 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
@@ -19,12 +19,7 @@
#include "math_private.h"
#undef __isnan
-#ifdef __STDC__
- int __isnan(double x)
-#else
- int __isnan(x)
- double x;
-#endif
+int __isnan(double x)
{
int64_t hx;
EXTRACT_WORDS64(hx,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
new file mode 100644
index 000000000..0cba548ab
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
@@ -0,0 +1,65 @@
+/* Rewritten for 64-bit machines by Ulrich Drepper <drepper@gmail.com>. */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * modf(double x, double *iptr)
+ * return fraction part of x, and return x's integral part in *iptr.
+ * Method:
+ * Bit twiddling.
+ *
+ * Exception:
+ * No exception.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+static const double one = 1.0;
+
+double
+__modf(double x, double *iptr)
+{
+ int64_t i0;
+ int32_t j0;
+ EXTRACT_WORDS64(i0,x);
+ j0 = ((i0>>52)&0x7ff)-0x3ff; /* exponent of x */
+ if(j0<52) { /* integer part in x */
+ if(j0<0) { /* |x|<1 */
+ /* *iptr = +-0 */
+ INSERT_WORDS64(*iptr,i0&UINT64_C(0x8000000000000000));
+ return x;
+ } else {
+ uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
+ if((i0&i)==0) { /* x is integral */
+ *iptr = x;
+ /* return +-0 */
+ INSERT_WORDS64(x,i0&UINT64_C(0x8000000000000000));
+ return x;
+ } else {
+ INSERT_WORDS64(*iptr,i0&(~i));
+ return x - *iptr;
+ }
+ }
+ } else { /* no fraction part */
+ *iptr = x*one;
+ /* We must handle NaNs separately. */
+ if (j0 == 0x400 && (i0 & UINT64_C(0xfffffffffffff)))
+ return x*one;
+ INSERT_WORDS64(x,i0&UINT64_C(0x8000000000000000)); /* return +-0 */
+ return x;
+ }
+}
+weak_alias (__modf, modf)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__modf, __modfl)
+weak_alias (__modf, modfl)
+#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c
new file mode 100644
index 000000000..d6b97b548
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c
@@ -0,0 +1,60 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * scalbn (double x, int n)
+ * scalbn(x,n) returns x* 2**n computed by exponent
+ * manipulation rather than by actually performing an
+ * exponentiation or a multiplication.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+static const double
+two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
+twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
+huge = 1.0e+300,
+tiny = 1.0e-300;
+
+double
+__scalbln (double x, long int n)
+{
+ int64_t ix;
+ int64_t k;
+ EXTRACT_WORDS64(ix,x);
+ k = (ix >> 52) & 0x7ff; /* extract exponent */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
+ if ((ix & UINT64_C(0xfffffffffffff))==0) return x; /* +-0 */
+ x *= two54;
+ EXTRACT_WORDS64(ix,x);
+ k = ((ix >> 52) & 0x7ff) - 54;
+ }
+ if (__builtin_expect(k==0x7ff, 0)) return x+x; /* NaN or Inf */
+ k = k+n;
+ if (__builtin_expect(n> 50000 || k > 0x7fe, 0))
+ return huge*__copysign(huge,x); /* overflow */
+ if (__builtin_expect(n< -50000, 0))
+ return tiny*__copysign(tiny,x); /*underflow*/
+ if (__builtin_expect(k > 0, 1)) /* normal result */
+ {INSERT_WORDS64(x,(ix&UINT64_C(0x800fffffffffffff))|(k<<52));
+ return x;}
+ if (k <= -54)
+ return tiny*__copysign(tiny,x); /*underflow*/
+ k += 54; /* subnormal result */
+ INSERT_WORDS64(x,(ix&INT64_C(0x800fffffffffffff))|(k<<52));
+ return x*twom54;
+}
+weak_alias (__scalbln, scalbln)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__scalbln, __scalblnl)
+weak_alias (__scalbln, scalblnl)
+#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c
index 25cf3b169..7f0e21f64 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c
@@ -1,4 +1,3 @@
-/* @(#)s_scalbn.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -20,39 +19,32 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
huge = 1.0e+300,
tiny = 1.0e-300;
-#ifdef __STDC__
- double __scalbn (double x, int n)
-#else
- double __scalbn (x,n)
- double x; int n;
-#endif
+double
+__scalbn (double x, int n)
{
int64_t ix;
int64_t k;
EXTRACT_WORDS64(ix,x);
k = (ix >> 52) & 0x7ff; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
if ((ix & UINT64_C(0xfffffffffffff))==0) return x; /* +-0 */
x *= two54;
EXTRACT_WORDS64(ix,x);
k = ((ix >> 52) & 0x7ff) - 54;
}
- if (k==0x7ff) return x+x; /* NaN or Inf */
+ if (__builtin_expect(k==0x7ff, 0)) return x+x; /* NaN or Inf */
k = k+n;
- if (n> 50000 || k > 0x7fe)
+ if (__builtin_expect(n> 50000 || k > 0x7fe, 0))
return huge*__copysign(huge,x); /* overflow */
- if (n< -50000) return tiny*__copysign(tiny,x); /*underflow*/
- if (k > 0) /* normal result */
+ if (__builtin_expect(n< -50000, 0))
+ return tiny*__copysign(tiny,x); /*underflow*/
+ if (__builtin_expect(k > 0, 1)) /* normal result */
{INSERT_WORDS64(x,(ix&UINT64_C(0x800fffffffffffff))|(k<<52));
return x;}
if (k <= -54)
diff --git a/libc/sysdeps/ieee754/flt-32/e_acoshf.c b/libc/sysdeps/ieee754/flt-32/e_acoshf.c
index 777e0b9e3..5999b747a 100644
--- a/libc/sysdeps/ieee754/flt-32/e_acoshf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_acoshf.c
@@ -20,20 +20,11 @@ static char rcsid[] = "$NetBSD: e_acoshf.c,v 1.5 1995/05/12 04:57:20 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
one = 1.0,
ln2 = 6.9314718246e-01; /* 0x3f317218 */
-#ifdef __STDC__
- float __ieee754_acoshf(float x)
-#else
- float __ieee754_acoshf(x)
- float x;
-#endif
+float __ieee754_acoshf(float x)
{
float t;
int32_t hx;
diff --git a/libc/sysdeps/ieee754/flt-32/e_asinf.c b/libc/sysdeps/ieee754/flt-32/e_asinf.c
index 7296ba3e1..a420cb47a 100644
--- a/libc/sysdeps/ieee754/flt-32/e_asinf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_asinf.c
@@ -42,11 +42,7 @@ static char rcsid[] = "$NetBSD: e_asinf.c,v 1.5 1995/05/12 04:57:25 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
one = 1.0000000000e+00, /* 0x3F800000 */
huge = 1.000e+30,
@@ -63,12 +59,7 @@ p2 = 4.547037598e-2f,
p3 = 2.417951451e-2f,
p4 = 4.216630880e-2f;
-#ifdef __STDC__
- float __ieee754_asinf(float x)
-#else
- float __ieee754_asinf(x)
- float x;
-#endif
+float __ieee754_asinf(float x)
{
float t,w,p,q,c,r,s;
int32_t hx,ix;
diff --git a/libc/sysdeps/ieee754/flt-32/e_rem_pio2f.c b/libc/sysdeps/ieee754/flt-32/e_rem_pio2f.c
index 4b8c4466b..c2b9793df 100644
--- a/libc/sysdeps/ieee754/flt-32/e_rem_pio2f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_rem_pio2f.c
@@ -29,11 +29,7 @@ static char rcsid[] = "$NetBSD: e_rem_pio2f.c,v 1.5 1995/05/10 20:46:03 jtc Exp
/*
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
*/
-#ifdef __STDC__
static const int32_t two_over_pi[] = {
-#else
-static int32_t two_over_pi[] = {
-#endif
0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC,
0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62,
0x95, 0x99, 0x3C, 0x43, 0x90, 0x41, 0xFE, 0x51, 0x63,
@@ -60,11 +56,7 @@ static int32_t two_over_pi[] = {
/* This array is like the one in e_rem_pio2.c, but the numbers are
single precision and the last 8 bits are forced to 0. */
-#ifdef __STDC__
static const int32_t npio2_hw[] = {
-#else
-static int32_t npio2_hw[] = {
-#endif
0x3fc90f00, 0x40490f00, 0x4096cb00, 0x40c90f00, 0x40fb5300, 0x4116cb00,
0x412fed00, 0x41490f00, 0x41623100, 0x417b5300, 0x418a3a00, 0x4196cb00,
0x41a35c00, 0x41afed00, 0x41bc7e00, 0x41c90f00, 0x41d5a000, 0x41e23100,
@@ -83,11 +75,7 @@ static int32_t npio2_hw[] = {
* pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3)
*/
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
zero = 0.0000000000e+00, /* 0x00000000 */
half = 5.0000000000e-01, /* 0x3f000000 */
two8 = 2.5600000000e+02, /* 0x43800000 */
@@ -99,12 +87,7 @@ pio2_2t = 6.0770999344e-11, /* 0x2e85a308 */
pio2_3 = 6.0770943833e-11, /* 0x2e85a300 */
pio2_3t = 6.1232342629e-17; /* 0x248d3132 */
-#ifdef __STDC__
- int32_t __ieee754_rem_pio2f(float x, float *y)
-#else
- int32_t __ieee754_rem_pio2f(x,y)
- float x,y[];
-#endif
+int32_t __ieee754_rem_pio2f(float x, float *y)
{
float z,w,t,r,fn;
float tx[3];
diff --git a/libc/sysdeps/ieee754/flt-32/k_cosf.c b/libc/sysdeps/ieee754/flt-32/k_cosf.c
index b232cab11..81259470e 100644
--- a/libc/sysdeps/ieee754/flt-32/k_cosf.c
+++ b/libc/sysdeps/ieee754/flt-32/k_cosf.c
@@ -20,11 +20,7 @@ static char rcsid[] = "$NetBSD: k_cosf.c,v 1.4 1995/05/10 20:46:23 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
one = 1.0000000000e+00, /* 0x3f800000 */
C1 = 4.1666667908e-02, /* 0x3d2aaaab */
C2 = -1.3888889225e-03, /* 0xbab60b61 */
@@ -33,12 +29,7 @@ C4 = -2.7557314297e-07, /* 0xb493f27c */
C5 = 2.0875723372e-09, /* 0x310f74f6 */
C6 = -1.1359647598e-11; /* 0xad47d74e */
-#ifdef __STDC__
- float __kernel_cosf(float x, float y)
-#else
- float __kernel_cosf(x, y)
- float x,y;
-#endif
+float __kernel_cosf(float x, float y)
{
float a,hz,z,r,qx;
int32_t ix;
diff --git a/libc/sysdeps/ieee754/flt-32/k_rem_pio2f.c b/libc/sysdeps/ieee754/flt-32/k_rem_pio2f.c
index 2783480fc..395cc789f 100644
--- a/libc/sysdeps/ieee754/flt-32/k_rem_pio2f.c
+++ b/libc/sysdeps/ieee754/flt-32/k_rem_pio2f.c
@@ -23,17 +23,9 @@ static char rcsid[] = "$NetBSD: k_rem_pio2f.c,v 1.4 1995/05/10 20:46:28 jtc Exp
/* In the float version, the input parameter x contains 8 bit
integers, not 24 bit integers. 113 bit precision is not supported. */
-#ifdef __STDC__
static const int init_jk[] = {4,7,9}; /* initial value for jk */
-#else
-static int init_jk[] = {4,7,9};
-#endif
-#ifdef __STDC__
static const float PIo2[] = {
-#else
-static float PIo2[] = {
-#endif
1.5703125000e+00, /* 0x3fc90000 */
4.5776367188e-04, /* 0x39f00000 */
2.5987625122e-05, /* 0x37da0000 */
@@ -47,22 +39,13 @@ static float PIo2[] = {
6.3331015649e-25, /* 0x17440000 */
};
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
zero = 0.0,
one = 1.0,
two8 = 2.5600000000e+02, /* 0x43800000 */
twon8 = 3.9062500000e-03; /* 0x3b800000 */
-#ifdef __STDC__
- int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const int32_t *ipio2)
-#else
- int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2)
- float x[], y[]; int e0,nx,prec; int32_t ipio2[];
-#endif
+int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const int32_t *ipio2)
{
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];
diff --git a/libc/sysdeps/ieee754/flt-32/k_sinf.c b/libc/sysdeps/ieee754/flt-32/k_sinf.c
index 4fec15e83..572363d75 100644
--- a/libc/sysdeps/ieee754/flt-32/k_sinf.c
+++ b/libc/sysdeps/ieee754/flt-32/k_sinf.c
@@ -20,11 +20,7 @@ static char rcsid[] = "$NetBSD: k_sinf.c,v 1.4 1995/05/10 20:46:33 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
half = 5.0000000000e-01,/* 0x3f000000 */
S1 = -1.6666667163e-01, /* 0xbe2aaaab */
S2 = 8.3333337680e-03, /* 0x3c088889 */
@@ -33,12 +29,7 @@ S4 = 2.7557314297e-06, /* 0x3638ef1b */
S5 = -2.5050759689e-08, /* 0xb2d72f34 */
S6 = 1.5896910177e-10; /* 0x2f2ec9d3 */
-#ifdef __STDC__
- float __kernel_sinf(float x, float y, int iy)
-#else
- float __kernel_sinf(x, y, iy)
- float x,y; int iy; /* iy=0 if y is zero */
-#endif
+float __kernel_sinf(float x, float y, int iy)
{
float z,r,v;
int32_t ix;
diff --git a/libc/sysdeps/ieee754/flt-32/k_tanf.c b/libc/sysdeps/ieee754/flt-32/k_tanf.c
index eb1a67093..8b34811e4 100644
--- a/libc/sysdeps/ieee754/flt-32/k_tanf.c
+++ b/libc/sysdeps/ieee754/flt-32/k_tanf.c
@@ -19,11 +19,7 @@ static char rcsid[] = "$NetBSD: k_tanf.c,v 1.4 1995/05/10 20:46:39 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
one = 1.0000000000e+00, /* 0x3f800000 */
pio4 = 7.8539812565e-01, /* 0x3f490fda */
pio4lo= 3.7748947079e-08, /* 0x33222168 */
@@ -43,12 +39,7 @@ T[] = {
2.5907305826e-05, /* 0x37d95384 */
};
-#ifdef __STDC__
- float __kernel_tanf(float x, float y, int iy)
-#else
- float __kernel_tanf(x, y, iy)
- float x,y; int iy;
-#endif
+float __kernel_tanf(float x, float y, int iy)
{
float z,r,v,w,s;
int32_t ix,hx;
diff --git a/libc/sysdeps/ieee754/flt-32/s_atanf.c b/libc/sysdeps/ieee754/flt-32/s_atanf.c
index a68933fa6..8a3aa811b 100644
--- a/libc/sysdeps/ieee754/flt-32/s_atanf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_atanf.c
@@ -20,33 +20,21 @@ static char rcsid[] = "$NetBSD: s_atanf.c,v 1.4 1995/05/10 20:46:47 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float atanhi[] = {
-#else
-static float atanhi[] = {
-#endif
4.6364760399e-01, /* atan(0.5)hi 0x3eed6338 */
7.8539812565e-01, /* atan(1.0)hi 0x3f490fda */
9.8279368877e-01, /* atan(1.5)hi 0x3f7b985e */
1.5707962513e+00, /* atan(inf)hi 0x3fc90fda */
};
-#ifdef __STDC__
static const float atanlo[] = {
-#else
-static float atanlo[] = {
-#endif
5.0121582440e-09, /* atan(0.5)lo 0x31ac3769 */
3.7748947079e-08, /* atan(1.0)lo 0x33222168 */
3.4473217170e-08, /* atan(1.5)lo 0x33140fb4 */
7.5497894159e-08, /* atan(inf)lo 0x33a22168 */
};
-#ifdef __STDC__
static const float aT[] = {
-#else
-static float aT[] = {
-#endif
3.3333334327e-01, /* 0x3eaaaaaa */
-2.0000000298e-01, /* 0xbe4ccccd */
1.4285714924e-01, /* 0x3e124925 */
@@ -60,20 +48,11 @@ static float aT[] = {
1.6285819933e-02, /* 0x3c8569d7 */
};
-#ifdef __STDC__
- static const float
-#else
- static float
-#endif
+static const float
one = 1.0,
huge = 1.0e30;
-#ifdef __STDC__
- float __atanf(float x)
-#else
- float __atanf(x)
- float x;
-#endif
+float __atanf(float x)
{
float w,s1,s2,z;
int32_t ix,hx,id;
diff --git a/libc/sysdeps/ieee754/flt-32/s_copysignf.c b/libc/sysdeps/ieee754/flt-32/s_copysignf.c
index a4e84e539..3a7893d8a 100644
--- a/libc/sysdeps/ieee754/flt-32/s_copysignf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_copysignf.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: s_copysignf.c,v 1.4 1995/05/10 20:46:59 jtc Exp
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- float __copysignf(float x, float y)
-#else
- float __copysignf(x,y)
- float x,y;
-#endif
+float __copysignf(float x, float y)
{
u_int32_t ix,iy;
GET_FLOAT_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/flt-32/s_cosf.c b/libc/sysdeps/ieee754/flt-32/s_cosf.c
index 4f9f239f6..dfe576c7b 100644
--- a/libc/sysdeps/ieee754/flt-32/s_cosf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_cosf.c
@@ -21,18 +21,9 @@ static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float one=1.0;
-#else
-static float one=1.0;
-#endif
-#ifdef __STDC__
- float __cosf(float x)
-#else
- float __cosf(x)
- float x;
-#endif
+float __cosf(float x)
{
float y[2],z=0.0;
int32_t n,ix;
diff --git a/libc/sysdeps/ieee754/flt-32/s_erff.c b/libc/sysdeps/ieee754/flt-32/s_erff.c
index 774714cfd..576618309 100644
--- a/libc/sysdeps/ieee754/flt-32/s_erff.c
+++ b/libc/sysdeps/ieee754/flt-32/s_erff.c
@@ -20,11 +20,7 @@ static char rcsid[] = "$NetBSD: s_erff.c,v 1.4 1995/05/10 20:47:07 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
tiny = 1e-30,
half= 5.0000000000e-01, /* 0x3F000000 */
one = 1.0000000000e+00, /* 0x3F800000 */
@@ -99,12 +95,7 @@ sb5 = 2.5530502930e+03, /* 0x451f90ce */
sb6 = 4.7452853394e+02, /* 0x43ed43a7 */
sb7 = -2.2440952301e+01; /* 0xc1b38712 */
-#ifdef __STDC__
- float __erff(float x)
-#else
- float __erff(x)
- float x;
-#endif
+float __erff(float x)
{
int32_t hx,ix,i;
float R,S,P,Q,s,y,z,r;
@@ -157,12 +148,7 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */
}
weak_alias (__erff, erff)
-#ifdef __STDC__
- float __erfcf(float x)
-#else
- float __erfcf(x)
- float x;
-#endif
+float __erfcf(float x)
{
int32_t hx,ix;
float R,S,P,Q,s,y,z,r;
diff --git a/libc/sysdeps/ieee754/flt-32/s_fabsf.c b/libc/sysdeps/ieee754/flt-32/s_fabsf.c
index 6b1451379..b6a02da18 100644
--- a/libc/sysdeps/ieee754/flt-32/s_fabsf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_fabsf.c
@@ -24,12 +24,7 @@ static char rcsid[] = "$NetBSD: s_fabsf.c,v 1.4 1995/05/10 20:47:15 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- float __fabsf(float x)
-#else
- float __fabsf(x)
- float x;
-#endif
+float __fabsf(float x)
{
u_int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/flt-32/s_finitef.c b/libc/sysdeps/ieee754/flt-32/s_finitef.c
index 2df513be7..fe4f0525f 100644
--- a/libc/sysdeps/ieee754/flt-32/s_finitef.c
+++ b/libc/sysdeps/ieee754/flt-32/s_finitef.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: s_finitef.c,v 1.4 1995/05/10 20:47:18 jtc Exp $"
#include "math_private.h"
#undef __finitef
-#ifdef __STDC__
- int __finitef(float x)
-#else
- int __finitef(x)
- float x;
-#endif
+int __finitef(float x)
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/flt-32/s_frexpf.c b/libc/sysdeps/ieee754/flt-32/s_frexpf.c
index 7a4eb4cca..ba3777553 100644
--- a/libc/sysdeps/ieee754/flt-32/s_frexpf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_frexpf.c
@@ -20,19 +20,10 @@ static char rcsid[] = "$NetBSD: s_frexpf.c,v 1.5 1995/05/10 20:47:26 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
two25 = 3.3554432000e+07; /* 0x4c000000 */
-#ifdef __STDC__
- float __frexpf(float x, int *eptr)
-#else
- float __frexpf(x, eptr)
- float x; int *eptr;
-#endif
+float __frexpf(float x, int *eptr)
{
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
diff --git a/libc/sysdeps/ieee754/flt-32/s_ilogbf.c b/libc/sysdeps/ieee754/flt-32/s_ilogbf.c
index ea3dc13bc..74babe140 100644
--- a/libc/sysdeps/ieee754/flt-32/s_ilogbf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_ilogbf.c
@@ -21,12 +21,7 @@ static char rcsid[] = "$NetBSD: s_ilogbf.c,v 1.4 1995/05/10 20:47:31 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __ilogbf(float x)
-#else
- int __ilogbf(x)
- float x;
-#endif
+int __ilogbf(float x)
{
int32_t hx,ix;
diff --git a/libc/sysdeps/ieee754/flt-32/s_isnanf.c b/libc/sysdeps/ieee754/flt-32/s_isnanf.c
index 1b1b2475b..028b9bbb3 100644
--- a/libc/sysdeps/ieee754/flt-32/s_isnanf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_isnanf.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: s_isnanf.c,v 1.4 1995/05/10 20:47:38 jtc Exp $";
#include "math_private.h"
#undef __isnanf
-#ifdef __STDC__
- int __isnanf(float x)
-#else
- int __isnanf(x)
- float x;
-#endif
+int __isnanf(float x)
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/flt-32/s_logbf.c b/libc/sysdeps/ieee754/flt-32/s_logbf.c
index ade892a8f..6504eb6c6 100644
--- a/libc/sysdeps/ieee754/flt-32/s_logbf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_logbf.c
@@ -20,12 +20,7 @@ static char rcsid[] = "$NetBSD: s_logbf.c,v 1.4 1995/05/10 20:47:51 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- float __logbf(float x)
-#else
- float __logbf(x)
- float x;
-#endif
+float __logbf(float x)
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/flt-32/s_modff.c b/libc/sysdeps/ieee754/flt-32/s_modff.c
index e6c22b2ad..741b1c9b1 100644
--- a/libc/sysdeps/ieee754/flt-32/s_modff.c
+++ b/libc/sysdeps/ieee754/flt-32/s_modff.c
@@ -13,33 +13,21 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_modff.c,v 1.4 1995/05/10 20:47:56 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float one = 1.0;
-#else
-static float one = 1.0;
-#endif
-#ifdef __STDC__
- float __modff(float x, float *iptr)
-#else
- float __modff(x, iptr)
- float x,*iptr;
-#endif
+float
+__modff(float x, float *iptr)
{
int32_t i0,j0;
u_int32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f; /* exponent of x */
- if(j0<23) { /* integer part in x */
+ if(__builtin_expect(j0<23, 1)) { /* integer part in x */
if(j0<0) { /* |x|<1 */
- SET_FLOAT_WORD(*iptr,i0&0x80000000); /* *iptr = +-0 */
+ SET_FLOAT_WORD(*iptr,i0&0x80000000); /* *iptr = +-0 */
return x;
} else {
i = (0x007fffff)>>j0;
diff --git a/libc/sysdeps/ieee754/flt-32/s_nextafterf.c b/libc/sysdeps/ieee754/flt-32/s_nextafterf.c
index 600c14621..19da4246a 100644
--- a/libc/sysdeps/ieee754/flt-32/s_nextafterf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_nextafterf.c
@@ -21,12 +21,7 @@ static char rcsid[] = "$NetBSD: s_nextafterf.c,v 1.4 1995/05/10 20:48:01 jtc Exp
#include <math_private.h>
#include <float.h>
-#ifdef __STDC__
- float __nextafterf(float x, float y)
-#else
- float __nextafterf(x,y)
- float x,y;
-#endif
+float __nextafterf(float x, float y)
{
int32_t hx,hy,ix,iy;
diff --git a/libc/sysdeps/ieee754/flt-32/s_scalblnf.c b/libc/sysdeps/ieee754/flt-32/s_scalblnf.c
index 4ed48733c..5256c3259 100644
--- a/libc/sysdeps/ieee754/flt-32/s_scalblnf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_scalblnf.c
@@ -13,51 +13,39 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_scalbnf.c,v 1.4 1995/05/10 20:48:10 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
two25 = 3.355443200e+07, /* 0x4c000000 */
twom25 = 2.9802322388e-08, /* 0x33000000 */
huge = 1.0e+30,
tiny = 1.0e-30;
-#ifdef __STDC__
- float __scalblnf (float x, long int n)
-#else
- float __scalblnf (x,n)
- float x; long int n;
-#endif
+float
+__scalblnf (float x, long int n)
{
int32_t k,ix;
GET_FLOAT_WORD(ix,x);
- k = (ix&0x7f800000)>>23; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((ix&0x7fffffff)==0) return x; /* +-0 */
+ k = (ix&0x7f800000)>>23; /* extract exponent */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
+ if ((ix&0x7fffffff)==0) return x; /* +-0 */
x *= two25;
GET_FLOAT_WORD(ix,x);
k = ((ix&0x7f800000)>>23) - 25;
}
- if (k==0xff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0xfe)
+ if (__builtin_expect(k==0xff, 0)) return x+x; /* NaN or Inf */
+ k = k+n;
+ if (__builtin_expect(n> 50000 || k > 0xfe, 0))
return huge*copysignf(huge,x); /* overflow */
- if (n< -50000)
+ if (__builtin_expect(n< -50000, 0))
return tiny*copysignf(tiny,x); /*underflow*/
- if (k > 0) /* normal result */
+ if (__builtin_expect(k > 0, 1)) /* normal result */
{SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;}
- if (k <= -25)
+ if (k <= -25)
return tiny*copysignf(tiny,x); /*underflow*/
- k += 25; /* subnormal result */
+ k += 25; /* subnormal result */
SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23));
- return x*twom25;
+ return x*twom25;
}
weak_alias (__scalblnf, scalblnf)
diff --git a/libc/sysdeps/ieee754/flt-32/s_scalbnf.c b/libc/sysdeps/ieee754/flt-32/s_scalbnf.c
index 407cf607c..3be2925a0 100644
--- a/libc/sysdeps/ieee754/flt-32/s_scalbnf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_scalbnf.c
@@ -13,51 +13,39 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_scalbnf.c,v 1.4 1995/05/10 20:48:10 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
two25 = 3.355443200e+07, /* 0x4c000000 */
twom25 = 2.9802322388e-08, /* 0x33000000 */
huge = 1.0e+30,
tiny = 1.0e-30;
-#ifdef __STDC__
- float __scalbnf (float x, int n)
-#else
- float __scalbnf (x,n)
- float x; int n;
-#endif
+float
+__scalbnf (float x, int n)
{
int32_t k,ix;
GET_FLOAT_WORD(ix,x);
- k = (ix&0x7f800000)>>23; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((ix&0x7fffffff)==0) return x; /* +-0 */
+ k = (ix&0x7f800000)>>23; /* extract exponent */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
+ if ((ix&0x7fffffff)==0) return x; /* +-0 */
x *= two25;
GET_FLOAT_WORD(ix,x);
k = ((ix&0x7f800000)>>23) - 25;
}
- if (k==0xff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0xfe)
+ if (__builtin_expect(k==0xff, 0)) return x+x; /* NaN or Inf */
+ k = k+n;
+ if (__builtin_expect(n> 50000 || k > 0xfe, 0))
return huge*__copysignf(huge,x); /* overflow */
- if (n< -50000)
+ if (__builtin_expect(n< -50000, 0))
return tiny*__copysignf(tiny,x); /*underflow*/
- if (k > 0) /* normal result */
+ if (__builtin_expect(k > 0, 1)) /* normal result */
{SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;}
- if (k <= -25)
+ if (k <= -25)
return tiny*__copysignf(tiny,x); /*underflow*/
- k += 25; /* subnormal result */
+ k += 25; /* subnormal result */
SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23));
- return x*twom25;
+ return x*twom25;
}
weak_alias (__scalbnf, scalbnf)
diff --git a/libc/sysdeps/ieee754/flt-32/s_sinf.c b/libc/sysdeps/ieee754/flt-32/s_sinf.c
index 673e379f0..680fe07da 100644
--- a/libc/sysdeps/ieee754/flt-32/s_sinf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_sinf.c
@@ -21,12 +21,7 @@ static char rcsid[] = "$NetBSD: s_sinf.c,v 1.4 1995/05/10 20:48:16 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- float __sinf(float x)
-#else
- float __sinf(x)
- float x;
-#endif
+float __sinf(float x)
{
float y[2],z=0.0;
int32_t n, ix;
diff --git a/libc/sysdeps/ieee754/flt-32/s_tanf.c b/libc/sysdeps/ieee754/flt-32/s_tanf.c
index 4a852cb1f..b69f3f5f7 100644
--- a/libc/sysdeps/ieee754/flt-32/s_tanf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_tanf.c
@@ -21,12 +21,7 @@ static char rcsid[] = "$NetBSD: s_tanf.c,v 1.4 1995/05/10 20:48:20 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- float __tanf(float x)
-#else
- float __tanf(x)
- float x;
-#endif
+float __tanf(float x)
{
float y[2],z=0.0;
int32_t n, ix;
diff --git a/libc/sysdeps/ieee754/flt-32/s_tanhf.c b/libc/sysdeps/ieee754/flt-32/s_tanhf.c
index 2a0ca9f3d..a3a2cd3e5 100644
--- a/libc/sysdeps/ieee754/flt-32/s_tanhf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_tanhf.c
@@ -20,18 +20,9 @@ static char rcsid[] = "$NetBSD: s_tanhf.c,v 1.4 1995/05/10 20:48:24 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float one=1.0, two=2.0, tiny = 1.0e-30;
-#else
-static float one=1.0, two=2.0, tiny = 1.0e-30;
-#endif
-#ifdef __STDC__
- float __tanhf(float x)
-#else
- float __tanhf(x)
- float x;
-#endif
+float __tanhf(float x)
{
float t,z;
int32_t jx,ix;
diff --git a/libc/sysdeps/ieee754/k_standard.c b/libc/sysdeps/ieee754/k_standard.c
index 229c4981d..53b0775dd 100644
--- a/libc/sysdeps/ieee754/k_standard.c
+++ b/libc/sysdeps/ieee754/k_standard.c
@@ -32,7 +32,7 @@ static char rcsid[] = "$NetBSD: k_standard.c,v 1.6 1995/05/10 20:46:35 jtc Exp $
/* XXX gcc versions until now don't delay the 0.0/0.0 division until
runtime but produce NaN at copile time. This is wrong since the
exceptions are not set correctly. */
-#if 0 && defined __STDC__
+#if 0
static const double zero = 0.0; /* used as const */
#else
static double zero = 0.0; /* used as const */
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_asinl.c b/libc/sysdeps/ieee754/ldbl-128/e_asinl.c
index e82b03f6a..12791c929 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_asinl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_asinl.c
@@ -63,11 +63,7 @@
#include "math_private.h"
long double sqrtl (long double);
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
huge = 1.0e+4932L,
pio2_hi = 1.5707963267948966192313216916397514420986L,
@@ -132,14 +128,8 @@ static long double
-#ifdef __STDC__
long double
__ieee754_asinl (long double x)
-#else
-double
-__ieee754_asinl (x)
- long double x;
-#endif
{
long double t, w, p, q, c, r, s;
int32_t ix, sign, flag;
diff --git a/libc/sysdeps/ieee754/ldbl-128/k_tanl.c b/libc/sysdeps/ieee754/ldbl-128/k_tanl.c
index 3cb8ae309..a08a2393a 100644
--- a/libc/sysdeps/ieee754/ldbl-128/k_tanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/k_tanl.c
@@ -58,11 +58,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
pio4hi = 7.8539816339744830961566084581987569936977E-1L,
pio4lo = 2.1679525325309452561992610065108379921906E-35L,
@@ -85,15 +81,8 @@ static long double
/* 1.000000000000000000000000000000000000000E0 */
-#ifdef __STDC__
long double
__kernel_tanl (long double x, long double y, int iy)
-#else
-long double
-__kernel_tanl (x, y, iy)
- long double x, y;
- int iy;
-#endif
{
long double z, r, v, w, s;
int32_t ix, sign;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_asinhl.c b/libc/sysdeps/ieee754/ldbl-128/s_asinhl.c
index 98ad83040..0a8341384 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_asinhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_asinhl.c
@@ -32,23 +32,13 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
ln2 = 6.931471805599453094172321214581765681e-1L,
huge = 1.0e+4900L;
-#ifdef __STDC__
long double
__asinhl (long double x)
-#else
-long double
-__asinhl (x)
- long double x;
-#endif
{
long double t, w;
int32_t ix, sign;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_ceill.c b/libc/sysdeps/ieee754/ldbl-128/s_ceill.c
index 71f2fee91..fe1fc8382 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_ceill.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_ceill.c
@@ -29,18 +29,9 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double huge = 1.0e4930L;
-#else
-static long double huge = 1.0e4930L;
-#endif
-#ifdef __STDC__
- long double __ceill(long double x)
-#else
- long double __ceill(x)
- long double x;
-#endif
+long double __ceill(long double x)
{
int64_t i0,i1,j0;
u_int64_t i,j;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_copysignl.c b/libc/sysdeps/ieee754/ldbl-128/s_copysignl.c
index cece4f249..3426ccddf 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_copysignl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_copysignl.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __copysignl(long double x, long double y)
-#else
- long double __copysignl(x,y)
- long double x,y;
-#endif
+long double __copysignl(long double x, long double y)
{
u_int64_t hx,hy;
GET_LDOUBLE_MSW64(hx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_cosl.c b/libc/sysdeps/ieee754/ldbl-128/s_cosl.c
index ef61c3afd..ae26d359d 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -48,12 +48,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __cosl(long double x)
-#else
- long double __cosl(x)
- long double x;
-#endif
+long double __cosl(long double x)
{
long double y[2],z=0.0L;
int64_t n, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_erfl.c b/libc/sysdeps/ieee754/ldbl-128/s_erfl.c
index 03ede5d7d..971314e53 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_erfl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_erfl.c
@@ -139,11 +139,7 @@ deval (long double x, const long double *p, int n)
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
tiny = 1e-4931L,
half = 0.5L,
one = 1.0L,
@@ -757,14 +753,8 @@ static const long double RDr1[NRDr1 + 1] =
};
-#ifdef __STDC__
long double
__erfl (long double x)
-#else
-double
-__erfl (x)
- long double x;
-#endif
{
long double a, y, z;
int32_t i, ix, sign;
@@ -811,15 +801,8 @@ __erfl (x)
}
weak_alias (__erfl, erfl)
-#ifdef __STDC__
- long double
- __erfcl (long double x)
-#else
- long double
- __erfcl (x)
- double
- x;
-#endif
+long double
+__erfcl (long double x)
{
long double y, z, p, r;
int32_t i, ix, sign;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_fabsl.c b/libc/sysdeps/ieee754/ldbl-128/s_fabsl.c
index c0fd05af6..73de8f07c 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_fabsl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_fabsl.c
@@ -24,12 +24,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __fabsl(long double x)
-#else
- long double __fabsl(x)
- long double x;
-#endif
+long double __fabsl(long double x)
{
u_int64_t hx;
GET_LDOUBLE_MSW64(hx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_finitel.c b/libc/sysdeps/ieee754/ldbl-128/s_finitel.c
index e3b0a2b99..b78973589 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -25,12 +25,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __finitel(long double x)
-#else
- int __finitel(x)
- long double x;
-#endif
+int __finitel(long double x)
{
int64_t hx;
GET_LDOUBLE_MSW64(hx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_floorl.c b/libc/sysdeps/ieee754/ldbl-128/s_floorl.c
index 2a60a79fc..2799d1c7e 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_floorl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_floorl.c
@@ -29,18 +29,9 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double huge = 1.0e4930L;
-#else
-static long double huge = 1.0e4930L;
-#endif
-#ifdef __STDC__
- long double __floorl(long double x)
-#else
- long double __floorl(x)
- long double x;
-#endif
+long double __floorl(long double x)
{
int64_t i0,i1,j0;
u_int64_t i,j;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_frexpl.c b/libc/sysdeps/ieee754/ldbl-128/s_frexpl.c
index 6dbb60ece..7f899e470 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_frexpl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_frexpl.c
@@ -30,19 +30,10 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
two114 = 2.0769187434139310514121985316880384E+34L; /* 0x4071000000000000, 0 */
-#ifdef __STDC__
- long double __frexpl(long double x, int *eptr)
-#else
- long double __frexpl(x, eptr)
- long double x; int *eptr;
-#endif
+long double __frexpl(long double x, int *eptr)
{
u_int64_t hx, lx, ix;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_ilogbl.c b/libc/sysdeps/ieee754/ldbl-128/s_ilogbl.c
index fe14395ad..a6f52c3f7 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_ilogbl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_ilogbl.c
@@ -28,12 +28,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __ilogbl(long double x)
-#else
- int __ilogbl(x)
- long double x;
-#endif
+int __ilogbl(long double x)
{
int64_t hx,lx;
int ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_isnanl.c b/libc/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 267ec8d0a..ef7bc7b33 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -25,12 +25,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __isnanl(long double x)
-#else
- int __isnanl(x)
- long double x;
-#endif
+int __isnanl(long double x)
{
int64_t hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_logbl.c b/libc/sysdeps/ieee754/ldbl-128/s_logbl.c
index 1fda28931..8d7b4c65a 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __logbl(long double x)
-#else
- long double __logbl(x)
- long double x;
-#endif
+long double __logbl(long double x)
{
int64_t lx,hx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_modfl.c b/libc/sysdeps/ieee754/ldbl-128/s_modfl.c
index 63d66e711..36572680c 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_modfl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_modfl.c
@@ -30,18 +30,9 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0;
-#else
-static long double one = 1.0;
-#endif
-#ifdef __STDC__
- long double __modfl(long double x, long double *iptr)
-#else
- long double __modfl(x, iptr)
- long double x,*iptr;
-#endif
+long double __modfl(long double x, long double *iptr)
{
int64_t i0,i1,j0;
u_int64_t i;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index bea3183d3..b97c1ac40 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -27,22 +27,13 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
TWO112[2]={
5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
-5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
};
-#ifdef __STDC__
- long double __nearbyintl(long double x)
-#else
- long double __nearbyintl(x)
- long double x;
-#endif
+long double __nearbyintl(long double x)
{
fenv_t env;
int64_t i0,j0,sx;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c
index 7bc869a51..0bf9339ef 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c
@@ -27,12 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include <math_private.h>
-#ifdef __STDC__
- long double __nextafterl(long double x, long double y)
-#else
- long double __nextafterl(x,y)
- long double x,y;
-#endif
+long double __nextafterl(long double x, long double y)
{
int64_t hx,hy,ix,iy;
u_int64_t lx,ly;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c b/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c
index 178505c58..6506722c4 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c
@@ -29,13 +29,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_private.h>
#include <float.h>
-#ifdef __STDC__
- double __nexttoward(double x, long double y)
-#else
- double __nexttoward(x,y)
- double x;
- long double y;
-#endif
+double __nexttoward(double x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_nexttowardf.c b/libc/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
index 1f37d80e0..e7265e762 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
@@ -21,13 +21,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- float __nexttowardf(float x, long double y)
-#else
- float __nexttowardf(x,y)
- float x;
- long double y;
-#endif
+float __nexttowardf(float x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_rintl.c b/libc/sysdeps/ieee754/ldbl-128/s_rintl.c
index c3fc3ba19..833ad4294 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -30,22 +30,13 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
TWO112[2]={
5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
-5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
};
-#ifdef __STDC__
- long double __rintl(long double x)
-#else
- long double __rintl(x)
- long double x;
-#endif
+long double __rintl(long double x)
{
int64_t i0,j0,sx;
u_int64_t i,i1;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c b/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c
index 5e8b58b73..f5624e2a7 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c
@@ -28,22 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
huge = 1.0E+4900L,
tiny = 1.0E-4900L;
-#ifdef __STDC__
- long double __scalblnl (long double x, long int n)
-#else
- long double __scalblnl (x,n)
- long double x; long int n;
-#endif
+long double __scalblnl (long double x, long int n)
{
int64_t k,hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c b/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c
index c54f064c0..b9de0f74f 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c
@@ -28,22 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
huge = 1.0E+4900L,
tiny = 1.0E-4900L;
-#ifdef __STDC__
- long double __scalbnl (long double x, int n)
-#else
- long double __scalbnl (x,n)
- long double x; int n;
-#endif
+long double __scalbnl (long double x, int n)
{
int64_t k,hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_sinl.c b/libc/sysdeps/ieee754/ldbl-128/s_sinl.c
index dc509e72e..63a920bd8 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -48,12 +48,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __sinl(long double x)
-#else
- long double __sinl(x)
- long double x;
-#endif
+long double __sinl(long double x)
{
long double y[2],z=0.0L;
int64_t n, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_tanhl.c b/libc/sysdeps/ieee754/ldbl-128/s_tanhl.c
index fcbf300a1..979eb8655 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_tanhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_tanhl.c
@@ -44,20 +44,10 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, two = 2.0, tiny = 1.0e-4900L;
-#else
-static long double one = 1.0, two = 2.0, tiny = 1.0e-4900L;
-#endif
-#ifdef __STDC__
long double
__tanhl (long double x)
-#else
-long double
-__tanhl (x)
- long double x;
-#endif
{
long double t, z;
u_int32_t jx, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_tanl.c b/libc/sysdeps/ieee754/ldbl-128/s_tanl.c
index 2349da67f..41e590250 100644
--- a/libc/sysdeps/ieee754/ldbl-128/s_tanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/s_tanl.c
@@ -48,12 +48,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __tanl(long double x)
-#else
- long double __tanl(x)
- long double x;
-#endif
+long double __tanl(long double x)
{
long double y[2],z=0.0L;
int64_t n, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128/w_expl.c b/libc/sysdeps/ieee754/ldbl-128/w_expl.c
index d6205d3ef..ab82ef1e7 100644
--- a/libc/sysdeps/ieee754/ldbl-128/w_expl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/w_expl.c
@@ -25,20 +25,11 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
o_threshold= 1.1356523406294143949491931077970763428449E4L,
u_threshold= -1.1433462743336297878837243843452621503410E4;
-#ifdef __STDC__
- long double __expl(long double x) /* wrapper exp */
-#else
- long double __expl(x) /* wrapper exp */
- long double x;
-#endif
+long double __expl(long double x) /* wrapper exp */
{
#ifdef _IEEE_LIBM
return __ieee754_expl(x);
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
index 1b37c9220..cd51f1357 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
@@ -57,11 +57,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
pio2_hi = 1.5707963267948966192313216916397514420986L,
pio2_lo = 4.3359050650618905123985220130216759843812E-35L,
@@ -152,14 +148,8 @@ static long double
qS8 = -4.175375777334867025769346564600396877176E1L;
/* 1.000000000000000000000000000000000000000E0 */
-#ifdef __STDC__
long double
__ieee754_acosl (long double x)
-#else
-long double
-__ieee754_acosl (x)
- long double x;
-#endif
{
long double z, r, w, p, q, s, t, f2;
int32_t ix, sign;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
index 6c61232c0..576496c25 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
@@ -63,11 +63,7 @@
#include "math_private.h"
long double sqrtl (long double);
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
huge = 1.0e+300L,
pio2_hi = 1.5707963267948966192313216916397514420986L,
@@ -132,14 +128,8 @@ static long double
-#ifdef __STDC__
long double
__ieee754_asinl (long double x)
-#else
-double
-__ieee754_asinl (x)
- long double x;
-#endif
{
long double t, w, p, q, c, r, s;
int32_t ix, sign, flag;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
index 2114753f8..5115488bd 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
@@ -59,26 +59,15 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
two = 2.0e0L,
one = 1.0e0L,
zero = 0.0L;
-#ifdef __STDC__
long double
__ieee754_jnl (int n, long double x)
-#else
-long double
-__ieee754_jnl (n, x)
- int n;
- long double x;
-#endif
{
u_int32_t se;
int32_t i, ix, sgn;
@@ -305,15 +294,8 @@ __ieee754_jnl (n, x)
}
strong_alias (__ieee754_jnl, __jnl_finite)
-#ifdef __STDC__
long double
__ieee754_ynl (int n, long double x)
-#else
-long double
-__ieee754_ynl (n, x)
- int n;
- long double x;
-#endif
{
u_int32_t se;
int32_t i, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/k_tanl.c b/libc/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
index 6c45b2fc4..9487f6b1d 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
@@ -58,11 +58,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
pio4hi = 7.8539816339744830961566084581987569936977E-1L,
pio4lo = 2.1679525325309452561992610065108379921906E-35L,
@@ -85,15 +81,8 @@ static long double
/* 1.000000000000000000000000000000000000000E0 */
-#ifdef __STDC__
long double
__kernel_tanl (long double x, long double y, int iy)
-#else
-long double
-__kernel_tanl (x, y, iy)
- long double x, y;
- int iy;
-#endif
{
long double z, r, v, w, s;
int32_t ix, sign;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
index d1b63bb90..bc5a066ed 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
@@ -29,21 +29,12 @@ static char rcsid[] = "$NetBSD: s_asinh.c,v 1.9 1995/05/12 04:57:37 jtc Exp $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.00000000000000000000e+00L, /* 0x3ff0000000000000, 0 */
ln2 = 0.6931471805599453094172321214581766L, /* 0x3fe62e42fefa39ef, 0x3c7abc9e3b398040 */
huge= 1.00000000000000000000e+300L;
-#ifdef __STDC__
- long double __asinhl(long double x)
-#else
- long double __asinhl(x)
- long double x;
-#endif
+long double __asinhl(long double x)
{
long double t,w;
int64_t hx,ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
index 6252e9140..914f1b554 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
@@ -1,6 +1,6 @@
/* Ceil (round to +inf) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,14 +24,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long double
__ceill (long double x)
-#else
-long double
-__ceill (x)
- long double x;
-#endif
{
double xh, xl, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
index 1a198c16e..f3a906e65 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
@@ -27,12 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- long double __copysignl(long double x, long double y)
-#else
- long double __copysignl(x,y)
- long double x,y;
-#endif
+long double __copysignl(long double x, long double y)
{
if (signbit (x) != signbit (y))
x = -x;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
index 8470850fc..57bae0cab 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
@@ -49,12 +49,7 @@
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- long double __cosl(long double x)
-#else
- long double __cosl(x)
- long double x;
-#endif
+long double __cosl(long double x)
{
long double y[2],z=0.0L;
int64_t n, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
index f40c783d0..8cd1df6c0 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
@@ -140,11 +140,7 @@ deval (long double x, const long double *p, int n)
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
tiny = 1e-300L,
half = 0.5L,
one = 1.0L,
@@ -758,14 +754,8 @@ static const long double RDr1[NRDr1 + 1] =
};
-#ifdef __STDC__
long double
__erfl (long double x)
-#else
-double
-__erfl (x)
- long double x;
-#endif
{
long double a, y, z;
int32_t i, ix, sign;
@@ -818,15 +808,8 @@ __erfl (x)
}
long_double_symbol (libm, __erfl, erfl);
-#ifdef __STDC__
- long double
- __erfcl (long double x)
-#else
- long double
- __erfcl (x)
- double
- x;
-#endif
+long double
+__erfcl (long double x)
{
long double y, z, p, r;
int32_t i, ix, sign;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
index 89eb20510..a288eac37 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- long double __fabsl(long double x)
-#else
- long double __fabsl(x)
- long double x;
-#endif
+long double __fabsl(long double x)
{
u_int64_t hx, lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
index eff757240..685e411cd 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,14 +24,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long double
__floorl (long double x)
-#else
-long double
-__floorl (x)
- long double x;
-#endif
{
double xh, xl, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
index fab566da3..215083bc2 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
@@ -31,19 +31,10 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
two107 = 162259276829213363391578010288128.0; /* 0x4670000000000000, 0 */
-#ifdef __STDC__
- long double __frexpl(long double x, int *eptr)
-#else
- long double __frexpl(x, eptr)
- long double x; int *eptr;
-#endif
+long double __frexpl(long double x, int *eptr)
{
u_int64_t hx, lx, ix, ixl;
int64_t explo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_ilogbl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_ilogbl.c
index 428854d77..106c7311c 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_ilogbl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_ilogbl.c
@@ -29,12 +29,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- int __ilogbl(long double x)
-#else
- int __ilogbl(x)
- long double x;
-#endif
+int __ilogbl(long double x)
{
int64_t hx,lx;
int ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
index 3718250b6..0a399695c 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,14 +25,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long long
__llrintl (long double x)
-#else
-long long
-__llrintl (x)
- long double x;
-#endif
{
double xh, xl;
long long res, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
index 9e25024f9..00cc41620 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,14 +24,8 @@
#include <float.h>
#include <ieee754.h>
-#ifdef __STDC__
long long
__llroundl (long double x)
-#else
-long long
-__llroundl (x)
- long double x;
-#endif
{
double xh, xl;
long long res, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_logbl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
index 0c61cdae2..10ae684d1 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
@@ -27,12 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- long double __logbl(long double x)
-#else
- long double __logbl(x)
- long double x;
-#endif
+long double __logbl(long double x)
{
int64_t lx,hx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
index e28934842..9e50541d3 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,14 +25,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long
__lrintl (long double x)
-#else
-long
-__lrintl (x)
- long double x;
-#endif
{
double xh, xl;
long res, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
index a5251eece..24b4f46e6 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,14 +24,8 @@
#include <float.h>
#include <ieee754.h>
-#ifdef __STDC__
long
__lroundl (long double x)
-#else
-long
-__lroundl (x)
- long double x;
-#endif
{
double xh, xl;
long res, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_modfl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
index f2e65f0c4..1fe323595 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
@@ -31,18 +31,9 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
static const long double one = 1.0;
-#else
-static long double one = 1.0;
-#endif
-#ifdef __STDC__
- long double __modfl(long double x, long double *iptr)
-#else
- long double __modfl(x, iptr)
- long double x,*iptr;
-#endif
+long double __modfl(long double x, long double *iptr)
{
int64_t i0,i1,j0;
u_int64_t i;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index 36c5a164d..3f7d6bd60 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values without raising inexact.
IBM extended format long double version.
- Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,14 +28,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long double
__nearbyintl (long double x)
-#else
-long double
-__nearbyintl (x)
- long double x;
-#endif
{
fenv_t env;
static const long double TWO52 = 4503599627370496.0L;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
index 39d0e6a5e..994e287c9 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
@@ -28,12 +28,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_private.h>
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- long double __nextafterl(long double x, long double y)
-#else
- long double __nextafterl(x,y)
- long double x,y;
-#endif
+long double __nextafterl(long double x, long double y)
{
int64_t hx,hy,ihx,ihy,ilx;
u_int64_t lx,ly;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
index e2f6521f5..bcf265d40 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
@@ -30,13 +30,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_ldbl_opt.h>
#include <float.h>
-#ifdef __STDC__
- double __nexttoward(double x, long double y)
-#else
- double __nexttoward(x,y)
- double x;
- long double y;
-#endif
+double __nexttoward(double x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
index cf655fad1..e88361a93 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
@@ -23,13 +23,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_ldbl_opt.h>
#include <float.h>
-#ifdef __STDC__
- float __nexttowardf(float x, long double y)
-#else
- float __nexttowardf(x,y)
- float x;
- long double y;
-#endif
+float __nexttowardf(float x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_rintl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
index 1f4e33f91..2c16b8611 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,14 +28,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long double
__rintl (long double x)
-#else
-long double
-__rintl (x)
- long double x;
-#endif
{
double xh, xl, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
index d633bfa4c..ac8e17afa 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,14 +27,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long double
__roundl (long double x)
-#else
-long double
-__roundl (x)
- long double x;
-#endif
{
double xh, xl, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c
index 3a1ba07f2..a1632e77f 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c
@@ -29,28 +29,15 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
twolm54 = 5.55111512312578270212e-17, /* 0x3C90000000000000, 0 */
huge = 1.0E+300L,
tiny = 1.0E-300L;
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two54 = 1.80143985094819840000e+16, /* 0x4350000000000000 */
twom54 = 5.55111512312578270212e-17; /* 0x3C90000000000000 */
-#ifdef __STDC__
- long double __scalblnl (long double x, long int n)
-#else
- long double __scalblnl (x,n)
- long double x; long int n;
-#endif
+long double __scalblnl (long double x, long int n)
{
int64_t k,l,hx,lx;
union { int64_t i; double d; } u;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
index 50bd8cb0b..a52cd42f0 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
@@ -29,28 +29,15 @@ static char rcsid[] = "$NetBSD: $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
twolm54 = 5.55111512312578270212e-17, /* 0x3C90000000000000, 0 */
huge = 1.0E+300L,
tiny = 1.0E-300L;
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two54 = 1.80143985094819840000e+16, /* 0x4350000000000000 */
twom54 = 5.55111512312578270212e-17; /* 0x3C90000000000000 */
-#ifdef __STDC__
- long double __scalbnl (long double x, int n)
-#else
- long double __scalbnl (x,n)
- long double x; int n;
-#endif
+long double __scalbnl (long double x, int n)
{
int64_t k,l,hx,lx;
union { int64_t i; double d; } u;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
index bd72225e1..e26d99888 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
@@ -49,12 +49,7 @@
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- long double __sinl(long double x)
-#else
- long double __sinl(x)
- long double x;
-#endif
+long double __sinl(long double x)
{
long double y[2],z=0.0L;
int64_t n, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
index 851ca125f..40df484c8 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
@@ -42,18 +42,9 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
static const long double one=1.0L, two=2.0L, tiny = 1.0e-300L;
-#else
-static long double one=1.0L, two=2.0L, tiny = 1.0e-300L;
-#endif
-#ifdef __STDC__
- long double __tanhl(long double x)
-#else
- long double __tanhl(x)
- long double x;
-#endif
+long double __tanhl(long double x)
{
long double t,z;
int64_t jx,ix,lx;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
index 913f38f24..3de0a0da2 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
@@ -49,12 +49,7 @@
#include "math_private.h"
#include <math_ldbl_opt.h>
-#ifdef __STDC__
- long double __tanl(long double x)
-#else
- long double __tanl(x)
- long double x;
-#endif
+long double __tanl(long double x)
{
long double y[2],z=0.0L;
int64_t n, ix;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
index ceace0d43..ba86abf33 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
@@ -1,6 +1,6 @@
/* Truncate (toward zero) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,14 +27,8 @@
#include <ieee754.h>
-#ifdef __STDC__
long double
__truncl (long double x)
-#else
-long double
-__truncl (x)
- long double x;
-#endif
{
double xh, xl, hi, lo;
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_asinl.c b/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
index d81303931..02da3adf0 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
@@ -61,11 +61,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
huge = 1.0e+4932L,
pio2_hi = 1.5707963267948966192021943710788178805159986950457096099853515625L,
@@ -91,14 +87,8 @@ static long double
qS4 = -1.568433562487314651121702982333303458814E1L;
/* 1.000000000000000000000000000000000000000E0 */
-#ifdef __STDC__
long double
__ieee754_asinl (long double x)
-#else
-double
-__ieee754_asinl (x)
- long double x;
-#endif
{
long double t, w, p, q, c, r, s;
int32_t ix;
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c b/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c
index 5e0b37ec0..7a1ad3fd2 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c
@@ -49,12 +49,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __ieee754_hypotl(long double x, long double y)
-#else
- long double __ieee754_hypotl(x,y)
- long double x, y;
-#endif
+long double __ieee754_hypotl(long double x, long double y)
{
long double a,b,t1,t2,y1,y2,w;
u_int32_t j,k,ea,eb;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c b/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c
index 9f37d4884..415be5f19 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c
@@ -32,21 +32,12 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.000000000000000000000e+00L, /* 0x3FFF, 0x00000000, 0x00000000 */
ln2 = 6.931471805599453094287e-01L, /* 0x3FFE, 0xB17217F7, 0xD1CF79AC */
huge= 1.000000000000000000e+4900L;
-#ifdef __STDC__
- long double __asinhl(long double x)
-#else
- long double __asinhl(x)
- long double x;
-#endif
+long double __asinhl(long double x)
{
long double t,w;
int32_t hx,ix;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_ceill.c b/libc/sysdeps/ieee754/ldbl-96/s_ceill.c
index b99097f81..96cc27003 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_ceill.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_ceill.c
@@ -30,18 +30,9 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double huge = 1.0e4930;
-#else
-static long double huge = 1.0e4930;
-#endif
-#ifdef __STDC__
- long double __ceill(long double x)
-#else
- long double __ceill(x)
- long double x;
-#endif
+long double __ceill(long double x)
{
int32_t i1,j0;
u_int32_t i,j,se,i0,sx;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_copysignl.c b/libc/sysdeps/ieee754/ldbl-96/s_copysignl.c
index 9976575b3..3a390e9ef 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_copysignl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_copysignl.c
@@ -27,12 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __copysignl(long double x, long double y)
-#else
- long double __copysignl(x,y)
- long double x,y;
-#endif
+long double __copysignl(long double x, long double y)
{
u_int32_t es1,es2;
GET_LDOUBLE_EXP(es1,x);
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_cosl.c b/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
index e33abc9af..6cfebf638 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_cosl.c
@@ -53,12 +53,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __cosl(long double x)
-#else
- long double __cosl(x)
- long double x;
-#endif
+long double __cosl(long double x)
{
long double y[2],z=0.0;
int32_t n, se, i0, i1;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_erfl.c b/libc/sysdeps/ieee754/ldbl-96/s_erfl.c
index 957fd4b15..e925bfb75 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_erfl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_erfl.c
@@ -110,11 +110,7 @@
#if __OPTION_EGLIBC_LIBM_BIG
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
tiny = 1e-4931L,
half = 0.5L,
one = 1.0L,
@@ -256,14 +252,8 @@ tiny = 1e-4931L,
/* 1.000000000000000000000000000000000000000E0 */
};
-#ifdef __STDC__
long double
__erfl (long double x)
-#else
-long double
-__erfl (x)
- long double x;
-#endif
{
long double R, S, P, Q, s, y, z, r;
int32_t ix, i;
@@ -344,14 +334,8 @@ __erfl (x)
}
weak_alias (__erfl, erfl)
-#ifdef __STDC__
- long double
- __erfcl (long double x)
-#else
- long double
- __erfcl (x)
- long double x;
-#endif
+long double
+__erfcl (long double x)
{
int32_t hx, ix;
long double R, S, P, Q, s, y, z, r;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_fabsl.c b/libc/sysdeps/ieee754/ldbl-96/s_fabsl.c
index f7170503f..3f5106dba 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_fabsl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_fabsl.c
@@ -25,12 +25,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __fabsl(long double x)
-#else
- long double __fabsl(x)
- long double x;
-#endif
+long double __fabsl(long double x)
{
u_int32_t exp;
GET_LDOUBLE_EXP(exp,x);
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_finitel.c b/libc/sysdeps/ieee754/ldbl-96/s_finitel.c
index 437ea87f8..f30a4d2a2 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_finitel.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_finitel.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __finitel(long double x)
-#else
- int __finitel(x)
- long double x;
-#endif
+int __finitel(long double x)
{
int32_t exp;
GET_LDOUBLE_EXP(exp,x);
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_floorl.c b/libc/sysdeps/ieee754/ldbl-96/s_floorl.c
index 7115dbad9..d44e36e90 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_floorl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_floorl.c
@@ -30,18 +30,9 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double huge = 1.0e4930;
-#else
-static long double huge = 1.0e4930;
-#endif
-#ifdef __STDC__
- long double __floorl(long double x)
-#else
- long double __floorl(x)
- long double x;
-#endif
+long double __floorl(long double x)
{
int32_t i1,j0;
u_int32_t i,j,se,i0,sx;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_frexpl.c b/libc/sysdeps/ieee754/ldbl-96/s_frexpl.c
index 0caa90b03..57444c5a4 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_frexpl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_frexpl.c
@@ -32,11 +32,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
#if LDBL_MANT_DIG == 64
two65 = 3.68934881474191032320e+19L; /* 0x4040, 0x80000000, 0x00000000 */
#else
@@ -44,12 +40,7 @@ two65 = 3.68934881474191032320e+19L; /* 0x4040, 0x80000000, 0x00000000 */
#endif
-#ifdef __STDC__
- long double __frexpl(long double x, int *eptr)
-#else
- long double __frexpl(x, eptr)
- long double x; int *eptr;
-#endif
+long double __frexpl(long double x, int *eptr)
{
u_int32_t se, hx, ix, lx;
GET_LDOUBLE_WORDS(se,hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_ilogbl.c b/libc/sysdeps/ieee754/ldbl-96/s_ilogbl.c
index d11e4c2f2..fd030a7f4 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_ilogbl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_ilogbl.c
@@ -29,12 +29,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __ilogbl(long double x)
-#else
- int __ilogbl(x)
- long double x;
-#endif
+int __ilogbl(long double x)
{
int32_t es,hx,lx,ix;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_isnanl.c b/libc/sysdeps/ieee754/ldbl-96/s_isnanl.c
index 5aa94149f..9814aa788 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_isnanl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_isnanl.c
@@ -26,12 +26,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int __isnanl(long double x)
-#else
- int __isnanl(x)
- long double x;
-#endif
+int __isnanl(long double x)
{
int32_t se,hx,lx;
GET_LDOUBLE_WORDS(se,hx,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_logbl.c b/libc/sysdeps/ieee754/ldbl-96/s_logbl.c
index 2cd9d105f..27f5ed7ca 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_logbl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_logbl.c
@@ -27,12 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __logbl(long double x)
-#else
- long double __logbl(x)
- long double x;
-#endif
+long double __logbl(long double x)
{
int32_t es,lx,ix;
GET_LDOUBLE_WORDS(es,ix,lx,x);
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_modfl.c b/libc/sysdeps/ieee754/ldbl-96/s_modfl.c
index 99c0752ef..c7659119f 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_modfl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_modfl.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/*
* modfl(long double x, long double *iptr)
* return fraction part of x, and return x's integral part in *iptr.
@@ -31,18 +27,10 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0;
-#else
-static long double one = 1.0;
-#endif
-#ifdef __STDC__
- long double __modfl(long double x, long double *iptr)
-#else
- long double __modfl(x, iptr)
- long double x,*iptr;
-#endif
+long double
+__modfl(long double x, long double *iptr)
{
int32_t i0,i1,j0;
u_int32_t i,se;
@@ -50,7 +38,7 @@ static long double one = 1.0;
j0 = (se&0x7fff)-0x3fff; /* exponent of x */
if(j0<32) { /* integer part in high x */
if(j0<0) { /* |x|<1 */
- SET_LDOUBLE_WORDS(*iptr,se&0x8000,0,0); /* *iptr = +-0 */
+ SET_LDOUBLE_WORDS(*iptr,se&0x8000,0,0); /* *iptr = +-0 */
return x;
} else {
i = (0x7fffffff)>>j0;
@@ -63,7 +51,7 @@ static long double one = 1.0;
return x - *iptr;
}
}
- } else if (j0>63) { /* no fraction part */
+ } else if (__builtin_expect(j0>63, 0)) { /* no fraction part */
*iptr = x*one;
/* We must handle NaNs separately. */
if (j0 == 0x4000 && ((i0 & 0x7fffffff) | i1))
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_nearbyintl.c b/libc/sysdeps/ieee754/ldbl-96/s_nearbyintl.c
index 92c3ebf36..e9ba5027a 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_nearbyintl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_nearbyintl.c
@@ -29,22 +29,13 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
TWO63[2]={
9.223372036854775808000000e+18, /* 0x403E, 0x00000000, 0x00000000 */
-9.223372036854775808000000e+18 /* 0xC03E, 0x00000000, 0x00000000 */
};
-#ifdef __STDC__
- long double __nearbyintl(long double x)
-#else
- long double __nearbyintl(x)
- long double x;
-#endif
+long double __nearbyintl(long double x)
{
fenv_t env;
int32_t se,j0,sx;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c b/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c
index ed0877d6d..66d7580e9 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c
@@ -28,12 +28,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include <math_private.h>
-#ifdef __STDC__
- long double __nextafterl(long double x, long double y)
-#else
- long double __nextafterl(x,y)
- long double x,y;
-#endif
+long double __nextafterl(long double x, long double y)
{
int32_t hx,hy,ix,iy;
u_int32_t lx,ly,esx,esy;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c b/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c
index e30438482..2ea61a78c 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c
@@ -29,13 +29,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_private.h>
#include <float.h>
-#ifdef __STDC__
- double __nexttoward(double x, long double y)
-#else
- double __nexttoward(x,y)
- double x;
- long double y;
-#endif
+double __nexttoward(double x, long double y)
{
int32_t hx,ix,iy;
u_int32_t lx,hy,ly,esy;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c b/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
index 6357975ff..665a8c6ca 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
@@ -21,13 +21,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_private.h>
#include <float.h>
-#ifdef __STDC__
- float __nexttowardf(float x, long double y)
-#else
- float __nexttowardf(x,y)
- float x;
- long double y;
-#endif
+float __nexttowardf(float x, long double y)
{
int32_t hx,ix,iy;
u_int32_t hy,ly,esy;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_rintl.c b/libc/sysdeps/ieee754/ldbl-96/s_rintl.c
index 9d4777dcc..b69f306d7 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_rintl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_rintl.c
@@ -31,22 +31,13 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
TWO63[2]={
9.223372036854775808000000e+18, /* 0x403E, 0x00000000, 0x00000000 */
-9.223372036854775808000000e+18 /* 0xC03E, 0x00000000, 0x00000000 */
};
-#ifdef __STDC__
- long double __rintl(long double x)
-#else
- long double __rintl(x)
- long double x;
-#endif
+long double __rintl(long double x)
{
int32_t se,j0,sx;
u_int32_t i,i0,i1;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c b/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c
index 8e556fabe..ada587b9d 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/*
* scalbnl (long double x, int n)
* scalbnl(x,n) returns x* 2**n computed by exponent
@@ -28,44 +24,36 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
two63 = 4.50359962737049600000e+15,
twom63 = 1.08420217248550443400e-19,
huge = 1.0e+4900L,
tiny = 1.0e-4900L;
-#ifdef __STDC__
- long double __scalblnl (long double x, long int n)
-#else
- long double __scalblnl (x,n)
- long double x; long int n;
-#endif
+long double
+__scalblnl (long double x, long int n)
{
int32_t k,es,hx,lx;
GET_LDOUBLE_WORDS(es,hx,lx,x);
- k = es&0x7fff; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
+ k = es&0x7fff; /* extract exponent */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
+ if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
x *= two63;
GET_LDOUBLE_EXP(es,x);
k = (hx&0x7fff) - 63;
}
- if (k==0x7fff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0x7ffe)
+ if (__builtin_expect(k==0x7fff, 0)) return x+x; /* NaN or Inf */
+ k = k+n;
+ if (__builtin_expect(n> 50000 || k > 0x7ffe, 0))
return huge*__copysignl(huge,x); /* overflow */
- if (n< -50000)
+ if (__builtin_expect(n< -50000, 0))
return tiny*__copysignl(tiny,x);
- if (k > 0) /* normal result */
+ if (__builtin_expect(k > 0, 1)) /* normal result */
{SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;}
- if (k <= -63)
+ if (k <= -63)
return tiny*__copysignl(tiny,x); /*underflow*/
- k += 63; /* subnormal result */
+ k += 63; /* subnormal result */
SET_LDOUBLE_EXP(x,(es&0x8000)|k);
- return x*twom63;
+ return x*twom63;
}
weak_alias (__scalblnl, scalblnl)
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c b/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c
index 9f441fd1e..6a41920ac 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/*
* scalbnl (long double x, int n)
* scalbnl(x,n) returns x* 2**n computed by exponent
@@ -28,44 +24,36 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
two64 = 1.8446744073709551616e19L,
twom64 = 5.421010862427522170037e-20L,
huge = 1.0e+4900L,
tiny = 1.0e-4900L;
-#ifdef __STDC__
- long double __scalbnl (long double x, int n)
-#else
- long double __scalbnl (x,n)
- long double x; int n;
-#endif
+long double
+__scalbnl (long double x, int n)
{
int32_t k,es,hx,lx;
GET_LDOUBLE_WORDS(es,hx,lx,x);
- k = es&0x7fff; /* extract exponent */
- if (k==0) { /* 0 or subnormal x */
- if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
+ k = es&0x7fff; /* extract exponent */
+ if (__builtin_expect(k==0, 0)) { /* 0 or subnormal x */
+ if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
x *= two64;
GET_LDOUBLE_EXP(hx,x);
k = (hx&0x7fff) - 64;
}
- if (k==0x7fff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0x7ffe)
+ if (__builtin_expect(k==0x7fff, 0)) return x+x; /* NaN or Inf */
+ k = k+n;
+ if (__builtin_expect(n> 50000 || k > 0x7ffe, 0))
return huge*__copysignl(huge,x); /* overflow */
- if (n< -50000)
+ if (__builtin_expect(n< -50000, 0))
return tiny*__copysignl(tiny,x);
- if (k > 0) /* normal result */
+ if (__builtin_expect(k > 0, 1)) /* normal result */
{SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;}
- if (k <= -64)
+ if (k <= -64)
return tiny*__copysignl(tiny,x); /*underflow*/
- k += 64; /* subnormal result */
+ k += 64; /* subnormal result */
SET_LDOUBLE_EXP(x,(es&0x8000)|k);
- return x*twom64;
+ return x*twom64;
}
weak_alias (__scalbnl, scalbnl)
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_sinl.c b/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
index b939bd6a9..4f7ed91e3 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_sinl.c
@@ -53,12 +53,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __sinl(long double x)
-#else
- long double __sinl(x)
- long double x;
-#endif
+long double __sinl(long double x)
{
long double y[2],z=0.0;
int32_t n, se, i0, i1;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_tanhl.c b/libc/sysdeps/ieee754/ldbl-96/s_tanhl.c
index 45cea903e..4547517e9 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_tanhl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_tanhl.c
@@ -45,18 +45,9 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one=1.0, two=2.0, tiny = 1.0e-4900L;
-#else
-static long double one=1.0, two=2.0, tiny = 1.0e-4900L;
-#endif
-#ifdef __STDC__
- long double __tanhl(long double x)
-#else
- long double __tanhl(x)
- long double x;
-#endif
+long double __tanhl(long double x)
{
long double t,z;
int32_t se;
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_tanl.c b/libc/sysdeps/ieee754/ldbl-96/s_tanl.c
index 97a0b27f3..8e1686003 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_tanl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_tanl.c
@@ -51,12 +51,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __tanl(long double x)
-#else
- long double __tanl(x)
- long double x;
-#endif
+long double __tanl(long double x)
{
long double y[2],z=0.0;
int32_t n, se;
diff --git a/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h b/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
index 4a42495c7..7795969f1 100644
--- a/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
+++ b/libc/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
@@ -10,7 +10,7 @@
SHLIB_COMPAT(lib, introduced, LONG_DOUBLE_COMPAT_VERSION)
#define long_double_symbol(lib, local, symbol) \
long_double_symbol_1 (lib, local, symbol, LONG_DOUBLE_COMPAT_VERSION)
-#if defined HAVE_ELF && defined SHARED
+#if defined SHARED
# define ldbl_hidden_def(local, name) libc_hidden_ver (local, name)
# define ldbl_strong_alias(name, aliasname) \
strong_alias (name, __GL_##name##_##aliasname) \
@@ -21,7 +21,7 @@
versioned_weak;
# define long_double_symbol_1(lib, local, symbol, version) \
versioned_symbol (lib, local, symbol, version)
-#elif defined HAVE_WEAK_SYMBOLS
+#else
# define ldbl_hidden_def(local, name) libc_hidden_def (name)
# define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
# define ldbl_weak_alias(name, aliasname) weak_alias (name, aliasname)
@@ -34,12 +34,6 @@
# define long_double_symbol_1(lib, local, symbol, version) \
weak_alias (local, symbol)
# endif
-#else
-# define ldbl_hidden_def(local, name) libc_hidden_def (name)
-# define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
-# define ldbl_weak_alias(name, aliasname) strong_alias (name, aliasname)
-# define long_double_symbol_1(lib, local, symbol, version) \
- strong_alias (local, symbol)
#endif
#ifndef __ASSEMBLER__
diff --git a/libc/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c b/libc/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
index 422746379..33ff1ca5b 100644
--- a/libc/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
+++ b/libc/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
@@ -7,7 +7,7 @@
#undef __strtod_l
extern double
-__strtod_l (__const char *__restrict __nptr, char **__restrict __endptr,
+__strtod_l (const char *__restrict __nptr, char **__restrict __endptr,
__locale_t __loc);
double
diff --git a/libc/sysdeps/ieee754/s_matherr.c b/libc/sysdeps/ieee754/s_matherr.c
index 1ad3eb333..88d2dbed2 100644
--- a/libc/sysdeps/ieee754/s_matherr.c
+++ b/libc/sysdeps/ieee754/s_matherr.c
@@ -17,16 +17,9 @@ static char rcsid[] = "$NetBSD: s_matherr.c,v 1.6 1995/05/10 20:47:53 jtc Exp $"
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- int
- weak_function
- __matherr(struct exception *x)
-#else
- int
- weak_function
- __matherr(x)
- struct exception *x;
-#endif
+int
+weak_function
+__matherr(struct exception *x)
{
int n=0;
if(x->arg1!=x->arg1) return 0;