diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
commit | a334319f6530564d22e775935d9c91663623a1b4 (patch) | |
tree | b5877475619e4c938e98757d518bb1e9cbead751 /sysdeps/ieee754/ldbl-96 | |
parent | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff) | |
download | glibc-a334319f6530564d22e775935d9c91663623a1b4.tar glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2 glibc-a334319f6530564d22e775935d9c91663623a1b4.zip |
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/printf_fphex.c | 4 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_erfl.c | 8 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_llrintl.c | 10 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_lrintl.c | 17 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_nextafterl.c | 20 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_nexttoward.c | 27 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_nexttowardf.c | 28 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/strtold_l.c | 4 |
8 files changed, 65 insertions, 53 deletions
diff --git a/sysdeps/ieee754/ldbl-96/printf_fphex.c b/sysdeps/ieee754/ldbl-96/printf_fphex.c index ba9f4c2960..3c8183df2e 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, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000 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 <stdio-common/printf_fphex.c> +#include <sysdeps/generic/printf_fphex.c> diff --git a/sysdeps/ieee754/ldbl-96/s_erfl.c b/sysdeps/ieee754/ldbl-96/s_erfl.c index 7406c3624c..e026f5a516 100644 --- a/sysdeps/ieee754/ldbl-96/s_erfl.c +++ b/sysdeps/ieee754/ldbl-96/s_erfl.c @@ -341,6 +341,10 @@ __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) @@ -452,3 +456,7 @@ weak_alias (__erfl, 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 d6eedf1f33..e927a8af40 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, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -47,7 +47,9 @@ __llrintl (long double x) if (j0 < (int32_t) (8 * sizeof (long long int)) - 1) { - if (j0 >= 63) + if (j0 < -1) + return 0; + else if (j0 >= 63) result = (((long long int) i0 << 32) | i1) << (j0 - 63); else { @@ -56,9 +58,7 @@ __llrintl (long double x) GET_LDOUBLE_WORDS (se, i0, i1, t); j0 = (se & 0x7fff) - 0x3fff; - if (j0 < 0) - result = 0; - else if (j0 <= 31) + 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 621951d87b..4212093989 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, 2006 Free Software Foundation, Inc. + Copyright (C) 1997, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -47,12 +47,17 @@ __lrintl (long double x) if (j0 < 31) { - w = two63[sx] + x; - t = w - two63[sx]; - GET_LDOUBLE_WORDS (se, i0, i1, t); - j0 = (se & 0x7fff) - 0x3fff; + 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; - result = (j0 < 0 ? 0 : i0 >> (31 - j0)); + result = 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 ed0877d6dd..1798261b28 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,12 +48,9 @@ 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 */ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ - return x; + y = x*x; + if(y==x) return y; else return x; /* raise underflow flag */ } if(esx<0x8000) { /* x > 0 */ if(ix>iy||((ix==iy) && (hx>hy||((hx==hy)&&(lx>ly))))) { @@ -88,10 +85,13 @@ static char rcsid[] = "$NetBSD: $"; } } esy = esx&0x7fff; - if(esy==0x7fff) return x+x; /* overflow */ - if(esy==0) { - long double u = x*x; /* underflow */ - math_force_eval (u); /* raise underflow flag */ + 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; + } } 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 e30438482c..8b273af929 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,12 +50,10 @@ 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 u; + double x2; INSERT_WORDS(x,(esy&0x8000)<<16,1); /* return +-minsub */ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ - return x; + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ } if(hx>=0) { /* x > 0 */ if (esy>=0x8000||((ix>>20)&0x7ff)>iy-0x3c00 @@ -86,15 +84,22 @@ static char rcsid[] = "$NetBSD: $"; if(hy>=0x7ff00000) { x = x+x; /* overflow */ if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1) - /* Force conversion to double. */ - asm ("" : "+m"(x)); + /* Force conversion to float. */ + asm ("" : "=m"(x) : "m"(x)); return x; } - if(hy<0x00100000) { - double u = x*x; /* underflow */ - math_force_eval (u); /* raise underflow flag */ + if(hy<0x00100000) { /* underflow */ + double x2 = x*x; + if(x2!=x) { /* raise underflow flag */ + INSERT_WORDS(x2,hx,lx); + return x2; + } } 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 6357975ffc..a1c38b5d4c 100644 --- a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c +++ b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c @@ -18,8 +18,7 @@ static char rcsid[] = "$NetBSD: $"; #endif #include "math.h" -#include <math_private.h> -#include <float.h> +#include "math_private.h" #ifdef __STDC__ float __nexttowardf(float x, long double y) @@ -42,12 +41,10 @@ static char rcsid[] = "$NetBSD: $"; return x+y; if((long double) x==y) return y; /* x=y, return y */ if(ix==0) { /* x == 0 */ - float u; + float x2; SET_FLOAT_WORD(x,((esy&0x8000)<<16)|1);/* return +-minsub*/ - u = math_opt_barrier (x); - u = u * u; - math_force_eval (u); /* raise underflow flag */ - return x; + x2 = x*x; + if(x2==x) return x2; else return x; /* raise underflow flag */ } if(hx>=0) { /* x > 0 */ if(esy>=0x8000||((ix>>23)&0xff)>iy-0x3f80 @@ -67,16 +64,13 @@ static char rcsid[] = "$NetBSD: $"; } } hy = hx&0x7f800000; - 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 */ + 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; + } } 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 52335c227f..32bf18084b 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, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2004 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 <stdlib/strtod_l.c> +#include <strtod_l.c> |