summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/flt-32
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/flt-32')
-rw-r--r--sysdeps/ieee754/flt-32/Dist1
-rw-r--r--sysdeps/ieee754/flt-32/e_atan2f.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_exp2f.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_expf.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_hypotf.c10
-rw-r--r--sysdeps/ieee754/flt-32/s_expm1f.c11
-rw-r--r--sysdeps/ieee754/flt-32/s_llrintf.c10
-rw-r--r--sysdeps/ieee754/flt-32/s_lrintf.c10
-rw-r--r--sysdeps/ieee754/flt-32/s_nextafterf.c20
9 files changed, 32 insertions, 36 deletions
diff --git a/sysdeps/ieee754/flt-32/Dist b/sysdeps/ieee754/flt-32/Dist
deleted file mode 100644
index 045ac801f6..0000000000
--- a/sysdeps/ieee754/flt-32/Dist
+++ /dev/null
@@ -1 +0,0 @@
-t_exp2f.h
diff --git a/sysdeps/ieee754/flt-32/e_atan2f.c b/sysdeps/ieee754/flt-32/e_atan2f.c
index 8b3398c0a3..c0cafb16b8 100644
--- a/sysdeps/ieee754/flt-32/e_atan2f.c
+++ b/sysdeps/ieee754/flt-32/e_atan2f.c
@@ -30,7 +30,7 @@ zero = 0.0,
pi_o_4 = 7.8539818525e-01, /* 0x3f490fdb */
pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */
pi = 3.1415927410e+00, /* 0x40490fdb */
-pi_lo = -8.7422776573e-07; /* 0xb3bbbd2e */
+pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */
#ifdef __STDC__
float __ieee754_atan2f(float y, float x)
diff --git a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c
index 752272db46..194222a0cd 100644
--- a/sysdeps/ieee754/flt-32/e_exp2f.c
+++ b/sysdeps/ieee754/flt-32/e_exp2f.c
@@ -1,5 +1,5 @@
/* Single-precision floating point 2^x.
- Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,2000,2001,2005,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
diff --git a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c
index 62448a9554..b9cd53c033 100644
--- a/sysdeps/ieee754/flt-32/e_expf.c
+++ b/sysdeps/ieee754/flt-32/e_expf.c
@@ -1,5 +1,5 @@
/* Single-precision floating point e^x.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
diff --git a/sysdeps/ieee754/flt-32/e_hypotf.c b/sysdeps/ieee754/flt-32/e_hypotf.c
index d6b1520cb8..a8e1a52d2b 100644
--- a/sysdeps/ieee754/flt-32/e_hypotf.c
+++ b/sysdeps/ieee754/flt-32/e_hypotf.c
@@ -23,7 +23,7 @@ static char rcsid[] = "$NetBSD: e_hypotf.c,v 1.5 1995/05/12 04:57:30 jtc Exp $";
#ifdef __STDC__
float __ieee754_hypotf(float x, float y)
#else
- float __ieee754_hypot(x,y)
+ float __ieee754_hypotf(x,y)
float x, y;
#endif
{
@@ -47,20 +47,20 @@ static char rcsid[] = "$NetBSD: e_hypotf.c,v 1.5 1995/05/12 04:57:30 jtc Exp $";
return w;
}
/* scale a and b by 2**-60 */
- ha -= 0x5d800000; hb -= 0x5d800000; k += 60;
+ ha -= 0x1e000000; hb -= 0x1e000000; k += 60;
SET_FLOAT_WORD(a,ha);
SET_FLOAT_WORD(b,hb);
}
if(hb < 0x26800000) { /* b < 2**-50 */
if(hb <= 0x007fffff) { /* subnormal b or 0 */
if(hb==0) return a;
- SET_FLOAT_WORD(t1,0x3f000000); /* t1=2^126 */
+ SET_FLOAT_WORD(t1,0x7e800000); /* t1=2^126 */
b *= t1;
a *= t1;
k -= 126;
} else { /* scale a and b by 2^60 */
- ha += 0x5d800000; /* a *= 2^60 */
- hb += 0x5d800000; /* b *= 2^60 */
+ ha += 0x1e000000; /* a *= 2^60 */
+ hb += 0x1e000000; /* b *= 2^60 */
k -= 60;
SET_FLOAT_WORD(a,ha);
SET_FLOAT_WORD(b,hb);
diff --git a/sysdeps/ieee754/flt-32/s_expm1f.c b/sysdeps/ieee754/flt-32/s_expm1f.c
index 375e334c38..1f032be25f 100644
--- a/sysdeps/ieee754/flt-32/s_expm1f.c
+++ b/sysdeps/ieee754/flt-32/s_expm1f.c
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -20,7 +20,8 @@ static char rcsid[] = "$NetBSD: s_expm1f.c,v 1.5 1995/05/10 20:47:11 jtc Exp $";
#include "math.h"
#include "math_private.h"
-static const volatile float huge = 1.0e+30, tiny = 1.0e-30;
+static const volatile float huge = 1.0e+30;
+static const volatile float tiny = 1.0e-30;
#ifdef __STDC__
static const float
@@ -71,7 +72,7 @@ Q5 = -2.0109921195e-07; /* 0xb457edbb */
}
/* argument reduction */
- if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */
+ if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */
if(hx < 0x3F851592) { /* and |x| < 1.5 ln2 */
if(xsb==0)
{hi = x - ln2_hi; lo = ln2_lo; k = 1;}
@@ -85,10 +86,10 @@ Q5 = -2.0109921195e-07; /* 0xb457edbb */
}
x = hi - lo;
c = (hi-x)-lo;
- }
+ }
else if(hx < 0x33000000) { /* when |x|<2**-25, return x */
t = huge+x; /* return x with inexact flags when x!=0 */
- return x - (t-(huge+x));
+ return x - (t-(huge+x));
}
else k = 0;
diff --git a/sysdeps/ieee754/flt-32/s_llrintf.c b/sysdeps/ieee754/flt-32/s_llrintf.c
index 3b9a484a8d..7c6e4bcda4 100644
--- a/sysdeps/ieee754/flt-32/s_llrintf.c
+++ b/sysdeps/ieee754/flt-32/s_llrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,7 +23,7 @@
#include "math_private.h"
-static const double two23[2] =
+static const float two23[2] =
{
8.3886080000e+06, /* 0x4B000000 */
-8.3886080000e+06, /* 0xCB000000 */
@@ -49,9 +49,7 @@ __llrintf (float x)
if (j0 < (int32_t) (sizeof (long long int) * 8) - 1)
{
- if (j0 < -1)
- return 0;
- else if (j0 >= 23)
+ if (j0 >= 23)
result = (long long int) i0 << (j0 - 23);
else
{
@@ -62,7 +60,7 @@ __llrintf (float x)
i0 &= 0x7fffff;
i0 |= 0x800000;
- result = i0 >> (23 - j0);
+ result = (j0 < 0 ? 0 : i0 >> (23 - j0));
}
}
else
diff --git a/sysdeps/ieee754/flt-32/s_lrintf.c b/sysdeps/ieee754/flt-32/s_lrintf.c
index 2a156f7ce2..64486a4c3e 100644
--- a/sysdeps/ieee754/flt-32/s_lrintf.c
+++ b/sysdeps/ieee754/flt-32/s_lrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,7 +23,7 @@
#include "math_private.h"
-static const double two23[2] =
+static const float two23[2] =
{
8.3886080000e+06, /* 0x4B000000 */
-8.3886080000e+06, /* 0xCB000000 */
@@ -49,9 +49,7 @@ __lrintf (float x)
if (j0 < (int32_t) (sizeof (long int) * 8) - 1)
{
- if (j0 < -1)
- return 0;
- else if (j0 >= 23)
+ if (j0 >= 23)
result = (long int) i0 << (j0 - 23);
else
{
@@ -62,7 +60,7 @@ __lrintf (float x)
i0 &= 0x7fffff;
i0 |= 0x800000;
- result = i0 >> (23 - j0);
+ result = (j0 < 0 ? 0 : i0 >> (23 - j0));
}
}
else
diff --git a/sysdeps/ieee754/flt-32/s_nextafterf.c b/sysdeps/ieee754/flt-32/s_nextafterf.c
index e1568e24c9..600c14621f 100644
--- a/sysdeps/ieee754/flt-32/s_nextafterf.c
+++ b/sysdeps/ieee754/flt-32/s_nextafterf.c
@@ -18,7 +18,7 @@ static char rcsid[] = "$NetBSD: s_nextafterf.c,v 1.4 1995/05/10 20:48:01 jtc Exp
#endif
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -40,9 +40,12 @@ static char rcsid[] = "$NetBSD: s_nextafterf.c,v 1.4 1995/05/10 20:48:01 jtc Exp
return x+y;
if(x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
+ float u;
SET_FLOAT_WORD(x,(hy&0x80000000)|1);/* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u*u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hx>hy) { /* x > y, x -= ulp */
@@ -61,15 +64,12 @@ static char rcsid[] = "$NetBSD: s_nextafterf.c,v 1.4 1995/05/10 20:48:01 jtc Exp
if(hy>=0x7f800000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0)
- asm ("" : "=m"(x) : "m"(x));
+ asm ("" : "+m"(x));
return x; /* overflow */
}
- if(hy<0x00800000) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(y,hx);
- return y;
- }
+ if(hy<0x00800000) {
+ float u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;