[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r641 - in /branches/eglibc-2_5/libc: ./ soft-fp/ sysdeps/ieee754/ldbl-128ibm/
- To: commits@xxxxxxxxxx
- Subject: [commits] r641 - in /branches/eglibc-2_5/libc: ./ soft-fp/ sysdeps/ieee754/ldbl-128ibm/
- From: joseph@xxxxxxxxxx
- Date: Thu, 09 Nov 2006 23:54:13 -0000
Author: joseph
Date: Thu Nov 9 15:54:13 2006
New Revision: 641
Log:
2006-11-09 Steven Munroe <sjmunroe@xxxxxxxxxx>
Joe Kerian <jkerian@xxxxxxxxxxxxx>
[BZ #2749]
* soft-fp/fenv_libc.h: New file.
* soft-fp/op-common.h (_FP_OVERFLOW_SEMIRAW): Always set inexact =
and overflow for infinity.
(_FP_PACK_SEMIRAW): Update comment. Do not round if NaN.
* soft-fp/op-4.h (__FP_FRAC_SUB_3, __FP_FRAC_SUB_4): Correct borrow
handling for high words.
* sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: =
Include <math_ldbl_opt.h>.
Remove weak_alias. Use long_double_symbol macro.
(__copysignl): Use signbit() for comparison.
* sysdeps/ieee754/ldbl-128ibm/s_fabsl.c:
[BZ #2423, #2749]
* sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include <fenv_libc.h>.
(__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.
Added:
branches/eglibc-2_5/libc/soft-fp/fenv_libc.h
- copied unchanged from r640, trunk/libc/soft-fp/fenv_libc.h
Modified:
branches/eglibc-2_5/libc/ChangeLog.eglibc
branches/eglibc-2_5/libc/soft-fp/op-4.h
branches/eglibc-2_5/libc/soft-fp/op-common.h
branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
Modified: branches/eglibc-2_5/libc/ChangeLog.eglibc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/ChangeLog.eglibc (original)
+++ branches/eglibc-2_5/libc/ChangeLog.eglibc Thu Nov 9 15:54:13 2006
@@ -1,3 +1,26 @@
+2006-11-09 Steven Munroe <sjmunroe@xxxxxxxxxx>
+ Joe Kerian <jkerian@xxxxxxxxxxxxx>
+
+ [BZ #2749]
+ * soft-fp/fenv_libc.h: New file.
+ * soft-fp/op-common.h (_FP_OVERFLOW_SEMIRAW): Always set inexact =
+ and overflow for infinity.
+ (_FP_PACK_SEMIRAW): Update comment. Do not round if NaN.
+ * soft-fp/op-4.h (__FP_FRAC_SUB_3, __FP_FRAC_SUB_4): Correct borrow
+ handling for high words.
+ * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: =
+ Include <math_ldbl_opt.h>.
+ Remove weak_alias. Use long_double_symbol macro.
+ (__copysignl): Use signbit() for comparison.
+ * sysdeps/ieee754/ldbl-128ibm/s_fabsl.c:
+
+ [BZ #2423, #2749]
+ * sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include <fenv_libc.h>.
+ (__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.
+
2006-09-07 Richard Sandiford <richard@xxxxxxxxxxxxxxxx>
=
* sysdeps/unix/sysv/linux/getcwd.c: Include sys/param.h.
Modified: branches/eglibc-2_5/libc/soft-fp/op-4.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/soft-fp/op-4.h (original)
+++ branches/eglibc-2_5/libc/soft-fp/op-4.h Thu Nov 9 15:54:13 2006
@@ -564,7 +564,7 @@
r1 =3D x1 - y1; \
_c2 =3D r1 > x1; \
r1 -=3D _c1; \
- _c2 |=3D r1 > _c1; \
+ _c2 |=3D _c1 && (y1 =3D=3D x1); \
r2 =3D x2 - y2 - _c2; \
} while (0)
#endif
@@ -578,11 +578,11 @@
r1 =3D x1 - y1; \
_c2 =3D r1 > x1; \
r1 -=3D _c1; \
- _c2 |=3D r1 > _c1; \
+ _c2 |=3D _c1 && (y1 =3D=3D x1); \
r2 =3D x2 - y2; \
_c3 =3D r2 > x2; \
r2 -=3D _c2; \
- _c3 |=3D r2 > _c2; \
+ _c3 |=3D _c2 && (y2 =3D=3D x2); \
r3 =3D x3 - y3 - _c3; \
} while (0)
#endif
Modified: branches/eglibc-2_5/libc/soft-fp/op-common.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/soft-fp/op-common.h (original)
+++ branches/eglibc-2_5/libc/soft-fp/op-common.h Thu Nov 9 15:54:13 2006
@@ -99,10 +99,10 @@
else \
{ \
X##_e =3D _FP_EXPMAX_##fs - 1; \
- FP_SET_EXCEPTION(FP_EX_OVERFLOW); \
- FP_SET_EXCEPTION(FP_EX_INEXACT); \
_FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc); \
} \
+ FP_SET_EXCEPTION(FP_EX_INEXACT); \
+ FP_SET_EXCEPTION(FP_EX_OVERFLOW); \
} while (0)
=
/* Check for a semi-raw value being a signaling NaN and raise the
@@ -131,10 +131,12 @@
=
/* Prepare to pack an fp value in semi-raw mode: the mantissa is
rounded and shifted right, with the rounding possibly increasing
- the exponent (including changing a finite value to infinity). */
+ the exponent (including changing a finite value to infinity).
+ Be sure not to round NaNs. */
#define _FP_PACK_SEMIRAW(fs, wc, X) \
do { \
- _FP_ROUND(wc, X); \
+ if(X##_e !=3D _FP_EXPMAX_##fs) \
+ _FP_ROUND(wc, X); \
if (_FP_FRAC_HIGH_##fs(X) \
& (_FP_OVERFLOW_##fs >> 1)) \
{ \
Modified: branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c (origina=
l)
+++ branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c Thu Nov =
9 15:54:13 2006
@@ -19,7 +19,6 @@
02111-1307 USA. */
=
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -44,11 +43,9 @@
__builtin_inf ()), 1))
{
double orig_xh;
- int save_round =3D 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 =3D xh;
@@ -81,8 +78,6 @@
/* Ensure we return -0 rather than +0 when appropriate. */
if (orig_xh < 0.0)
xh =3D -__builtin_fabs (xh);
-
- fesetround (save_round);
}
=
return ldbl_pack (xh, xl);
Modified: branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c (ori=
ginal)
+++ branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c Thu =
Nov 9 15:54:13 2006
@@ -25,6 +25,7 @@
=
#include "math.h"
#include "math_private.h"
+#include <math_ldbl_opt.h>
=
#ifdef __STDC__
long double __copysignl(long double x, long double y)
@@ -33,13 +34,13 @@
long double x,y;
#endif
{
- if (y < 0.0)
- {
- if (x >=3D 0.0)
- x =3D -x;
- }
- else if (x < 0.0)
+ if( signbit(x) !=3D signbit(y) )
x =3D -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
Modified: branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (origina=
l)
+++ branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c Thu Nov =
9 15:54:13 2006
@@ -37,7 +37,7 @@
GET_LDOUBLE_WORDS64(hx,lx,x);
lx =3D lx ^ ( hx & 0x8000000000000000LL );
hx =3D hx & 0x7fffffffffffffffLL;
- SET_LDOUBLE_WORDS64(hx,lx,x);
+ SET_LDOUBLE_WORDS64(x,hx,lx);
return x;
}
long_double_symbol (libm, __fabsl, fabsl);
Modified: branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c (origin=
al)
+++ branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c Thu Nov=
9 15:54:13 2006
@@ -19,7 +19,6 @@
02111-1307 USA. */
=
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -43,11 +42,8 @@
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- int save_round =3D 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 =3D ldbl_nearbyint (xh);
@@ -75,8 +71,6 @@
xh =3D hi;
xl =3D lo;
ldbl_canonicalize (&xh, &xl);
-
- fesetround (save_round);
}
=
return ldbl_pack (xh, xl);
Modified: branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c (origin=
al)
+++ branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c Thu Nov=
9 15:54:13 2006
@@ -22,7 +22,6 @@
when it's coded in C. */
=
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -47,11 +46,9 @@
__builtin_inf ()), 1))
{
double orig_xh;
- int save_round =3D 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 =3D xh;
@@ -88,8 +85,6 @@
xh =3D hi;
xl =3D lo;
ldbl_canonicalize (&xh, &xl);
-
- fesetround (save_round);
}
=
return ldbl_pack (xh, xl);
Modified: branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c (origin=
al)
+++ branches/eglibc-2_5/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c Thu Nov=
9 15:54:13 2006
@@ -22,7 +22,6 @@
when it's coded in C. */
=
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -47,11 +46,9 @@
__builtin_inf ()), 1))
{
double orig_xh;
- int save_round =3D 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 =3D xh;
@@ -92,8 +89,6 @@
/* Ensure we return -0 rather than +0 when appropriate. */
if (orig_xh < 0.0)
xh =3D -__builtin_fabs (xh);
-
- fesetround (save_round);
}
=
return ldbl_pack (xh, xl);