From cd8127cc70f63e8d920880d32dd8887ab215d8ae Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 17 Jan 2007 13:00:11 +0000 Subject: [PATCH] [BZ #2749] * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: Include . Remove weak_alias. Use long_double_symbol macro. (__copysignl): Use signbit() for comparison. * sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (__fabsl): Correct parms for SET_LDOUBLE_WORDS64. [BZ #2423, #2749] * sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include . (__ceill): Remove calls to fegetround(), fesetround(). * sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_truncl.c: Likewise. 2007-01-12 Steven Munroe Joe Kerian [BZ #2749] * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: Include . Remove weak_alias. Use long_double_symbol macro. (__copysignl): Use signbit() for comparison. * sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (__fabsl): Correct parms for SET_LDOUBLE_WORDS64. [BZ #2423, #2749] * sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include . (__ceill): Remove calls to fegetround(), fesetround(). * sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_truncl.c: Likewise. --- ChangeLog | 17 +++++++++++++++++ sysdeps/ieee754/ldbl-128ibm/s_ceill.c | 7 +------ sysdeps/ieee754/ldbl-128ibm/s_copysignl.c | 15 ++++++++------- sysdeps/ieee754/ldbl-128ibm/s_fabsl.c | 4 ++-- sysdeps/ieee754/ldbl-128ibm/s_floorl.c | 8 +------- sysdeps/ieee754/ldbl-128ibm/s_roundl.c | 7 +------ sysdeps/ieee754/ldbl-128ibm/s_truncl.c | 7 +------ 7 files changed, 31 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b64c33..8e33965 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-01-12 Steven Munroe + Joe Kerian + + [BZ #2749] + * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: Include + . Remove weak_alias. Use long_double_symbol macro. + (__copysignl): Use signbit() for comparison. + * sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (__fabsl): Correct parms for + SET_LDOUBLE_WORDS64. + + [BZ #2423, #2749] + * sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include . + (__ceill): Remove calls to fegetround(), fesetround(). + * sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise. + * sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise. + * sysdeps/ieee754/ldbl-128ibm/s_truncl.c: Likewise. + 2007-01-17 Jakub Jelinek * nscd/nscd_getserv_r.c (nscd_getserv_r): Fix pastos. diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c index 035e4f5..6252e91 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c +++ b/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 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 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 @@ -19,7 +19,6 @@ 02111-1307 USA. */ #include -#include #include #include #include @@ -44,11 +43,9 @@ __ceill (x) __builtin_inf ()), 1)) { double orig_xh; - int save_round = fegetround (); /* Long double arithmetic, including the canonicalisation below, only works in round-to-nearest mode. */ - fesetround (FE_TONEAREST); /* Convert the high double to integer. */ orig_xh = xh; @@ -81,8 +78,6 @@ __ceill (x) /* Ensure we return -0 rather than +0 when appropriate. */ if (orig_xh < 0.0) xh = -__builtin_fabs (xh); - - fesetround (save_round); } return ldbl_pack (xh, xl); diff --git a/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c b/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c index 7e7b441..1a198c1 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c @@ -25,6 +25,7 @@ static char rcsid[] = "$NetBSD: $"; #include "math.h" #include "math_private.h" +#include #ifdef __STDC__ long double __copysignl(long double x, long double y) @@ -33,13 +34,13 @@ static char rcsid[] = "$NetBSD: $"; long double x,y; #endif { - if (y < 0.0) - { - if (x >= 0.0) - x = -x; - } - else if (x < 0.0) + if (signbit (x) != signbit (y)) x = -x; return x; } -weak_alias (__copysignl, copysignl) + +#ifdef IS_IN_libm +long_double_symbol (libm, __copysignl, copysignl); +#else +long_double_symbol (libc, __copysignl, copysignl); +#endif diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c index 6266312..89eb205 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c @@ -37,7 +37,7 @@ static char rcsid[] = "$NetBSD: $"; GET_LDOUBLE_WORDS64(hx,lx,x); lx = lx ^ ( hx & 0x8000000000000000LL ); hx = hx & 0x7fffffffffffffffLL; - SET_LDOUBLE_WORDS64(hx,lx,x); - return x; + SET_LDOUBLE_WORDS64(x,hx,lx); + return x; } long_double_symbol (libm, __fabsl, fabsl); diff --git a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c index 4c4ae9b..eff7572 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c +++ b/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 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 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 @@ -19,7 +19,6 @@ 02111-1307 USA. */ #include -#include #include #include #include @@ -43,11 +42,8 @@ __floorl (x) && __builtin_isless (__builtin_fabs (xh), __builtin_inf ()), 1)) { - int save_round = fegetround (); - /* Long double arithmetic, including the canonicalisation below, only works in round-to-nearest mode. */ - fesetround (FE_TONEAREST); /* Convert the high double to integer. */ hi = ldbl_nearbyint (xh); @@ -75,8 +71,6 @@ __floorl (x) xh = hi; xl = lo; ldbl_canonicalize (&xh, &xl); - - fesetround (save_round); } return ldbl_pack (xh, xl); diff --git a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c b/sysdeps/ieee754/ldbl-128ibm/s_roundl.c index 0880e6e..d633bfa 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c +++ b/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 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 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 @@ -22,7 +22,6 @@ when it's coded in C. */ #include -#include #include #include #include @@ -47,11 +46,9 @@ __roundl (x) __builtin_inf ()), 1)) { double orig_xh; - int save_round = fegetround (); /* Long double arithmetic, including the canonicalisation below, only works in round-to-nearest mode. */ - fesetround (FE_TONEAREST); /* Convert the high double to integer. */ orig_xh = xh; @@ -88,8 +85,6 @@ __roundl (x) xh = hi; xl = lo; ldbl_canonicalize (&xh, &xl); - - fesetround (save_round); } return ldbl_pack (xh, xl); diff --git a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c index d7bc47e..ceace0d 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c +++ b/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 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 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 @@ -22,7 +22,6 @@ when it's coded in C. */ #include -#include #include #include #include @@ -47,11 +46,9 @@ __truncl (x) __builtin_inf ()), 1)) { double orig_xh; - int save_round = fegetround (); /* Long double arithmetic, including the canonicalisation below, only works in round-to-nearest mode. */ - fesetround (FE_TONEAREST); /* Convert the high double to integer. */ orig_xh = xh; @@ -92,8 +89,6 @@ __truncl (x) /* Ensure we return -0 rather than +0 when appropriate. */ if (orig_xh < 0.0) xh = -__builtin_fabs (xh); - - fesetround (save_round); } return ldbl_pack (xh, xl); -- 2.7.4