summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-96
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r--sysdeps/ieee754/ldbl-96/printf_fphex.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/s_erfl.c8
-rw-r--r--sysdeps/ieee754/ldbl-96/s_llrintl.c10
-rw-r--r--sysdeps/ieee754/ldbl-96/s_lrintl.c17
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nextafterl.c20
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttoward.c27
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttowardf.c28
-rw-r--r--sysdeps/ieee754/ldbl-96/strtold_l.c4
8 files changed, 53 insertions, 65 deletions
diff --git a/sysdeps/ieee754/ldbl-96/printf_fphex.c b/sysdeps/ieee754/ldbl-96/printf_fphex.c
index 3c8183df2e..ba9f4c2960 100644
--- a/sysdeps/ieee754/ldbl-96/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-96/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2005 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
@@ -90,4 +90,4 @@ do { \
} \
} while (0)
-#include <sysdeps/generic/printf_fphex.c>
+#include <stdio-common/printf_fphex.c>
diff --git a/sysdeps/ieee754/ldbl-96/s_erfl.c b/sysdeps/ieee754/ldbl-96/s_erfl.c
index e026f5a516..7406c3624c 100644
--- a/sysdeps/ieee754/ldbl-96/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-96/s_erfl.c
@@ -341,10 +341,6 @@ __erfl (x)
}
weak_alias (__erfl, erfl)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erf, __erfl)
-weak_alias (__erf, erfl)
-#endif
#ifdef __STDC__
long double
__erfcl (long double x)
@@ -456,7 +452,3 @@ weak_alias (__erf, erfl)
}
weak_alias (__erfcl, erfcl)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erfc, __erfcl)
-weak_alias (__erfc, erfcl)
-#endif
diff --git a/sysdeps/ieee754/ldbl-96/s_llrintl.c b/sysdeps/ieee754/ldbl-96/s_llrintl.c
index e927a8af40..d6eedf1f33 100644
--- a/sysdeps/ieee754/ldbl-96/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -47,9 +47,7 @@ __llrintl (long double x)
if (j0 < (int32_t) (8 * sizeof (long long int)) - 1)
{
- if (j0 < -1)
- return 0;
- else if (j0 >= 63)
+ if (j0 >= 63)
result = (((long long int) i0 << 32) | i1) << (j0 - 63);
else
{
@@ -58,7 +56,9 @@ __llrintl (long double x)
GET_LDOUBLE_WORDS (se, i0, i1, t);
j0 = (se & 0x7fff) - 0x3fff;
- if (j0 <= 31)
+ if (j0 < 0)
+ result = 0;
+ else if (j0 <= 31)
result = i0 >> (31 - j0);
else
result = ((long long int) i0 << (j0 - 31)) | (i1 >> (63 - j0));
diff --git a/sysdeps/ieee754/ldbl-96/s_lrintl.c b/sysdeps/ieee754/ldbl-96/s_lrintl.c
index 4212093989..621951d87b 100644
--- a/sysdeps/ieee754/ldbl-96/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -47,17 +47,12 @@ __lrintl (long double x)
if (j0 < 31)
{
- if (j0 < -1)
- return 0;
- else
- {
- w = two63[sx] + x;
- t = w - two63[sx];
- GET_LDOUBLE_WORDS (se, i0, i1, t);
- j0 = (se & 0x7fff) - 0x3fff;
+ w = two63[sx] + x;
+ t = w - two63[sx];
+ GET_LDOUBLE_WORDS (se, i0, i1, t);
+ j0 = (se & 0x7fff) - 0x3fff;
- result = i0 >> (31 - j0);
- }
+ result = (j0 < 0 ? 0 : i0 >> (31 - j0));
}
else if (j0 < (int32_t) (8 * sizeof (long int)) - 1)
{
diff --git a/sysdeps/ieee754/ldbl-96/s_nextafterl.c b/sysdeps/ieee754/ldbl-96/s_nextafterl.c
index 1798261b28..ed0877d6dd 100644
--- a/sysdeps/ieee754/ldbl-96/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-96/s_nextafterl.c
@@ -26,7 +26,7 @@ static char rcsid[] = "$NetBSD: $";
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
long double __nextafterl(long double x, long double y)
@@ -48,9 +48,12 @@ static char rcsid[] = "$NetBSD: $";
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|hx|lx)==0) { /* x == 0 */
+ long double u;
SET_LDOUBLE_WORDS(x,esy&0x8000,0,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(esx<0x8000) { /* x > 0 */
if(ix>iy||((ix==iy) && (hx>hy||((hx==hy)&&(lx>ly))))) {
@@ -85,13 +88,10 @@ static char rcsid[] = "$NetBSD: $";
}
}
esy = esx&0x7fff;
- if(esy==0x7fff) return x+x; /* overflow */
- if(esy==0) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- SET_LDOUBLE_WORDS(y,esx,hx,lx);
- return y;
- }
+ if(esy==0x7fff) return x+x; /* overflow */
+ if(esy==0) {
+ long double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_LDOUBLE_WORDS(x,esx,hx,lx);
return x;
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttoward.c b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
index 8b273af929..e30438482c 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
@@ -26,7 +26,7 @@ static char rcsid[] = "$NetBSD: $";
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -50,10 +50,12 @@ static char rcsid[] = "$NetBSD: $";
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
- double x2;
+ double u;
INSERT_WORDS(x,(esy&0x8000)<<16,1); /* return +-minsub */
- x2 = x*x;
- if(x2==x) return x2; 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 (esy>=0x8000||((ix>>20)&0x7ff)>iy-0x3c00
@@ -84,22 +86,15 @@ static char rcsid[] = "$NetBSD: $";
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
- /* Force conversion to float. */
- asm ("" : "=m"(x) : "m"(x));
+ /* Force conversion to double. */
+ asm ("" : "+m"(x));
return x;
}
- if(hy<0x00100000) { /* underflow */
- double x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- INSERT_WORDS(x2,hx,lx);
- return x2;
- }
+ if(hy<0x00100000) {
+ double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;
}
weak_alias (__nexttoward, nexttoward)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nexttoward, __nexttowardl)
-weak_alias (__nexttoward, nexttowardl)
-#endif
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
index a1c38b5d4c..6357975ffc 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
@@ -18,7 +18,8 @@ static char rcsid[] = "$NetBSD: $";
#endif
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
+#include <float.h>
#ifdef __STDC__
float __nexttowardf(float x, long double y)
@@ -41,10 +42,12 @@ static char rcsid[] = "$NetBSD: $";
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
- float x2;
+ float u;
SET_FLOAT_WORD(x,((esy&0x8000)<<16)|1);/* return +-minsub*/
- x2 = x*x;
- if(x2==x) return x2; 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(esy>=0x8000||((ix>>23)&0xff)>iy-0x3f80
@@ -64,13 +67,16 @@ static char rcsid[] = "$NetBSD: $";
}
}
hy = hx&0x7f800000;
- if(hy>=0x7f800000) return x+x; /* overflow */
- if(hy<0x00800000) { /* underflow */
- float x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(x2,hx);
- return x2;
- }
+ if(hy>=0x7f800000) {
+ x = x+x; /* overflow */
+ if (FLT_EVAL_METHOD != 0)
+ /* Force conversion to float. */
+ asm ("" : "+m"(x));
+ return x;
+ }
+ if(hy<0x00800000) {
+ float u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;
diff --git a/sysdeps/ieee754/ldbl-96/strtold_l.c b/sysdeps/ieee754/ldbl-96/strtold_l.c
index 32bf18084b..52335c227f 100644
--- a/sysdeps/ieee754/ldbl-96/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-96/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2004, 2005 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
@@ -42,4 +42,4 @@
(flt) = u.d; \
} while (0)
-#include <strtod_l.c>
+#include <stdlib/strtod_l.c>