[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r17371 - in /fsf/trunk/libc: ./ manual/ manual/examples/ math/ sysdeps/gnu/ sysdeps/i386/fpu/ sysdeps/ieee754/dbl-64/ sysdep...



Author: eglibc
Date: Sat Mar  3 00:02:15 2012
New Revision: 17371

Log:
Import glibc-mainline for 2012-03-03

Added:
    fsf/trunk/libc/manual/examples/timeval_subtract.c
    fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/sparc/sparc32/fpu/s_signbit.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/fpu/s_signbitf.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/fpu/s_signbitl.S
    fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_finite.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_finitef.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_isinf.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_isinff.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_isnan.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_isnanf.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_signbit.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_signbitf.S
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_signbitl.S
Removed:
    fsf/trunk/libc/sysdeps/sparc/sparc32/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc32/getpagesize.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/manual/filesys.texi
    fsf/trunk/libc/manual/llio.texi
    fsf/trunk/libc/manual/time.texi
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/sysdeps/gnu/errlist-compat.awk
    fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbln.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbn.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c
    fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalblnf.c
    fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalbnf.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c
    fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Mar  3 00:02:15 2012
@@ -1,4 +1,112 @@
+2012-03-02  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	[BZ #13792]
+	* manual/time.texi (Elapsed Time): Move timeval_subtract example
+	function to ...
+	* manual/timeval_subtract.c.texi: ... here, new file.
+
+2012-03-02  David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* sysdeps/sparc/fpu/libm-test-ulps: Update for recently added tests.
+
+2012-03-02  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	[BZ #3976]
+	* sysdeps/ieee754/dbl-64/s_sin.c: Include <fenv.h>
+	(__sin): Save and restore rounding mode and use round-to-nearest
+	for all computations.
+	(__cos): Save and restore rounding mode and use round-to-nearest
+	for all computations.
+	* sysdeps/ieee754/dbl-64/s_tan.c: Include "math_private.h" and
+	<fenv.h>.
+	(tan): Save and restore rounding mode and use round-to-nearest for
+	all computations.
+	* math/libm-test.inc (cos_test_tonearest): New function.
+	(cos_test_towardzero): Likewise.
+	(cos_test_downward): Likewise.
+	(cos_test_upward): Likewise.
+	(sin_test_tonearest): Likewise.
+	(sin_test_towardzero): Likewise.
+	(sin_test_downward): Likewise.
+	(sin_test_upward): Likewise.
+	(tan_test_tonearest): Likewise.
+	(tan_test_towardzero): Likewise.
+	(tan_test_downward): Likewise.
+	(tan_test_upward): Likewise.
+	(main): Call the new functions.
+	* sysdeps/i386/fpu/libm-test-ulps: Update.
+	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+	[BZ #10135]
+	* sysdeps/ieee754/dbl-64/s_scalbln.c (__scalbln): First test for
+	small n, then large n, before computing and testing k+n.
+	* sysdeps/ieee754/dbl-64/s_scalbn.c (__scalbn): Likewise.
+	* sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c (__scalbln):
+	Likewise.
+	* sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c (__scalbn):
+	Likewise.
+	* sysdeps/ieee754/flt-32/s_scalblnf.c (__scalblnf): Likewise.
+	* sysdeps/ieee754/flt-32/s_scalbnf.c (__scalbnf): Likewise.
+	* sysdeps/ieee754/ldbl-128/s_scalblnl.c (__scalblnl): Likewise.
+	* sysdeps/ieee754/ldbl-128/s_scalbnl.c (__scalbnl): Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c (__scalblnl): Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c (__scalbnl): Likewise.
+	* sysdeps/ieee754/ldbl-96/s_scalblnl.c (__scalblnl): Likewise.
+	* sysdeps/ieee754/ldbl-96/s_scalbnl.c (__scalbnl): Likewise.
+	* math/libm-test.inc (scalbn_test): Add more tests.
+	(scalbln_test): Likewise.
+
+	* manual/filesys.texi (mode_t): Describe constraints on size and
+	signedness, not exact equivalence to a particular type.
+	(ino_t): Likewise.
+	(ino64_t): Likewise.
+	(dev_t): Likewise.
+	(nlink_t): Likewise.
+	(blkcnt_t): Likewise.
+	(blkcnt64_t): Likewise.
+	* manual/llio.texi (off_t): Likewise.
+
+	[BZ #3976]
+	* sysdeps/ieee754/dbl-64/e_exp.c: Include <fenv.h>.
+	(__ieee754_exp): Save and restore rounding mode and use
+	round-to-nearest for all computations.
+	* math/libm-test.inc (exp_test_tonearest): New function.
+	(exp_test_towardzero): Likewise.
+	(exp_test_downward): Likewise.
+	(exp_test_upward): Likewise.
+	(main): Call the new functions.
+	* sysdeps/i386/fpu/libm-test-ulps: Update.
+	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+2012-03-01  Chris Demetriou  <cgd@xxxxxxxxxx>
+
+	* sysdeps/gnu/errlist-compat.awk: Don't depend on AWK internals to
+	have predictable order.
+
 2012-03-01  David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sparc/sparc32/getpagesize.c: Delete.
+
+	* sysdeps/sparc/sparc64/fpu/s_finite.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_finitef.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_isinf.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_isinff.S: New file.
+
+	* sysdeps/sparc/sparc32/fpu/s_signbit.S: New file.
+	* sysdeps/sparc/sparc32/fpu/s_signbitf.S: New file.
+	* sysdeps/sparc/sparc32/fpu/s_signbitl.S: New file.
+	* sysdeps/sparc/sparc32/sparcv9/fpu/s_isnan.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_isnan.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_isnanf.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_signbit.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_signbitf.S: New file.
+	* sysdeps/sparc/sparc64/fpu/s_signbitl.S: New file.
+
+	* sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+	* sysdeps/sparc/sparc32/fpu/libm-test-ulps: Move...
+	* sysdeps/sparc/fpu/libm-test-ulps: to here.
+	* sysdeps/sparc/sparc64/fpu/libm-test-ulps: Delete.
 
 	* sysdeps/sparc/crti.S: Remove HAVE_BINUTILS_GOTDATA checks.
 	* sysdeps/sparc/sparc32/dl-machine.h: Likewise.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat Mar  3 00:02:15 2012
@@ -10,10 +10,10 @@
 * The following bugs are resolved with this release:
 
   174, 350, 411, 2541, 2547, 2548, 3335, 3992, 4026, 4108, 4596, 4822, 5077,
-  5461, 5805, 5993, 6884, 6907, 9739, 9902, 10110, 10140, 10210, 11174,
-  11322, 11365, 11494, 12047, 13058, 13525, 13526, 13527, 13528, 13529,
-  13530, 13531, 13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559,
-  13583, 13618, 13637, 13695, 13704, 13706, 13738, 13786
+  5461, 5805, 5993, 6884, 6907, 9739, 9902, 10110, 10135, 10140, 10210,
+  11174, 11322, 11365, 11494, 12047, 13058, 13525, 13526, 13527, 13528,
+  13529, 13530, 13531, 13532, 13533, 13547, 13551, 13552, 13553, 13555,
+  13559, 13583, 13618, 13637, 13695, 13704, 13706, 13738, 13786
 
 * ISO C11 support:
 

Added: fsf/trunk/libc/manual/examples/timeval_subtract.c
==============================================================================
--- fsf/trunk/libc/manual/examples/timeval_subtract.c (added)
+++ fsf/trunk/libc/manual/examples/timeval_subtract.c Sat Mar  3 00:02:15 2012
@@ -1,0 +1,28 @@
+/* Subtract the `struct timeval' values X and Y,
+   storing the result in RESULT.
+   Return 1 if the difference is negative, otherwise 0.  */
+
+int
+timeval_subtract (result, x, y)
+     struct timeval *result, *x, *y;
+{
+  /* Perform the carry for the later subtraction by updating @var{y}. */
+  if (x->tv_usec < y->tv_usec) {
+    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
+    y->tv_usec -= 1000000 * nsec;
+    y->tv_sec += nsec;
+  }
+  if (x->tv_usec - y->tv_usec > 1000000) {
+    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
+    y->tv_usec += 1000000 * nsec;
+    y->tv_sec -= nsec;
+  }
+
+  /* Compute the time remaining to wait.
+     @code{tv_usec} is certainly positive. */
+  result->tv_sec = x->tv_sec - y->tv_sec;
+  result->tv_usec = x->tv_usec - y->tv_usec;
+
+  /* Return 1 if result is negative. */
+  return x->tv_sec < y->tv_sec;
+}

Modified: fsf/trunk/libc/manual/filesys.texi
==============================================================================
--- fsf/trunk/libc/manual/filesys.texi (original)
+++ fsf/trunk/libc/manual/filesys.texi Sat Mar  3 00:02:15 2012
@@ -1770,17 +1770,18 @@
 @comment sys/types.h
 @comment POSIX.1
 @deftp {Data Type} mode_t
-This is an integer data type used to represent file modes.  In the
-GNU system, this is equivalent to @code{unsigned int}.
+This is an integer data type used to represent file modes.  In
+@theglibc{}, this is an unsigned type no narrower than @code{unsigned
+int}.
 @end deftp
 
 @cindex inode number
 @comment sys/types.h
 @comment POSIX.1
 @deftp {Data Type} ino_t
-This is an arithmetic data type used to represent file serial numbers.
+This is an unsigned integer type used to represent file serial numbers.
 (In Unix jargon, these are sometimes called @dfn{inode numbers}.)
-In the GNU system, this type is equivalent to @code{unsigned long int}.
+In @theglibc{}, this type is no narrower than @code{unsigned int}.
 
 If the source is compiled with @code{_FILE_OFFSET_BITS == 64} this type
 is transparently replaced by @code{ino64_t}.
@@ -1789,9 +1790,9 @@
 @comment sys/types.h
 @comment Unix98
 @deftp {Data Type} ino64_t
-This is an arithmetic data type used to represent file serial numbers
-for the use in LFS.  In the GNU system, this type is equivalent to
-@code{unsigned long long int}.
+This is an unsigned integer type used to represent file serial numbers
+for the use in LFS.  In @theglibc{}, this type is no narrower than
+@code{unsigned int}.
 
 When compiling with @code{_FILE_OFFSET_BITS == 64} this type is
 available under the name @code{ino_t}.
@@ -1801,21 +1802,20 @@
 @comment POSIX.1
 @deftp {Data Type} dev_t
 This is an arithmetic data type used to represent file device numbers.
-In the GNU system, this is equivalent to @code{int}.
+In @theglibc{}, this is an integer type no narrower than @code{int}.
 @end deftp
 
 @comment sys/types.h
 @comment POSIX.1
 @deftp {Data Type} nlink_t
-This is an arithmetic data type used to represent file link counts.
-In the GNU system, this is equivalent to @code{unsigned short int}.
+This is an integer type used to represent file link counts.
 @end deftp
 
 @comment sys/types.h
 @comment Unix98
 @deftp {Data Type} blkcnt_t
-This is an arithmetic data type used to represent block counts.
-In the GNU system, this is equivalent to @code{unsigned long int}.
+This is a signed integer type used to represent block counts.
+In @theglibc{}, this type is no narrower than @code{int}.
 
 If the source is compiled with @code{_FILE_OFFSET_BITS == 64} this type
 is transparently replaced by @code{blkcnt64_t}.
@@ -1824,9 +1824,8 @@
 @comment sys/types.h
 @comment Unix98
 @deftp {Data Type} blkcnt64_t
-This is an arithmetic data type used to represent block counts for the
-use in LFS.  In the GNU system, this is equivalent to @code{unsigned
-long long int}.
+This is a signed integer type used to represent block counts for the
+use in LFS.  In @theglibc{}, this type is no narrower than @code{int}.
 
 When compiling with @code{_FILE_OFFSET_BITS == 64} this type is
 available under the name @code{blkcnt_t}.

Modified: fsf/trunk/libc/manual/llio.texi
==============================================================================
--- fsf/trunk/libc/manual/llio.texi (original)
+++ fsf/trunk/libc/manual/llio.texi Sat Mar  3 00:02:15 2012
@@ -776,8 +776,8 @@
 @comment sys/types.h
 @comment POSIX.1
 @deftp {Data Type} off_t
-This is an arithmetic data type used to represent file sizes.
-In the GNU system, this is equivalent to @code{fpos_t} or @code{long int}.
+This is a signed integer type used to represent file sizes.  In
+@theglibc{}, this type is no narrower than @code{int}.
 
 If the source is compiled with @code{_FILE_OFFSET_BITS == 64} this type
 is transparently replaced by @code{off64_t}.

Modified: fsf/trunk/libc/manual/time.texi
==============================================================================
--- fsf/trunk/libc/manual/time.texi (original)
+++ fsf/trunk/libc/manual/time.texi Sat Mar  3 00:02:15 2012
@@ -139,34 +139,7 @@
 @code{tv_sec} member has an unsigned type.
 
 @smallexample
-/* @r{Subtract the `struct timeval' values X and Y,}
-   @r{storing the result in RESULT.}
-   @r{Return 1 if the difference is negative, otherwise 0.}  */
-
-int
-timeval_subtract (result, x, y)
-     struct timeval *result, *x, *y;
-@{
-  /* @r{Perform the carry for the later subtraction by updating @var{y}.} */
-  if (x->tv_usec < y->tv_usec) @{
-    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
-    y->tv_usec -= 1000000 * nsec;
-    y->tv_sec += nsec;
-  @}
-  if (x->tv_usec - y->tv_usec > 1000000) @{
-    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
-    y->tv_usec += 1000000 * nsec;
-    y->tv_sec -= nsec;
-  @}
-
-  /* @r{Compute the time remaining to wait.}
-     @r{@code{tv_usec} is certainly positive.} */
-  result->tv_sec = x->tv_sec - y->tv_sec;
-  result->tv_usec = x->tv_usec - y->tv_usec;
-
-  /* @r{Return 1 if result is negative.} */
-  return x->tv_sec < y->tv_sec;
-@}
+@include timeval_subtract.c.texi
 @end smallexample
 
 Common functions that use @code{struct timeval} are @code{gettimeofday}

Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sat Mar  3 00:02:15 2012
@@ -2017,6 +2017,142 @@
 
 
 static void
+cos_test_tonearest (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(cos) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (cos_tonearest);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TONEAREST))
+    {
+      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
+      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
+      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
+      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
+      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
+      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
+      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
+      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
+      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
+      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (cos_tonearest);
+}
+
+
+static void
+cos_test_towardzero (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(cos) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (cos_towardzero);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TOWARDZERO))
+    {
+      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
+      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
+      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
+      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
+      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
+      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
+      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
+      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
+      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
+      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (cos_towardzero);
+}
+
+
+static void
+cos_test_downward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(cos) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (cos_downward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_DOWNWARD))
+    {
+      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
+      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
+      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
+      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
+      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
+      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
+      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
+      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
+      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
+      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (cos_downward);
+}
+
+
+static void
+cos_test_upward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(cos) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (cos_upward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_UPWARD))
+    {
+      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
+      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
+      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
+      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
+      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
+      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
+      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
+      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
+      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
+      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (cos_upward);
+}
+
+
+static void
 cosh_test (void)
 {
   errno = 0;
@@ -2528,6 +2664,114 @@
 #endif
 
   END (exp);
+}
+
+
+static void
+exp_test_tonearest (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(exp) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (exp_tonearest);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TONEAREST))
+    {
+      TEST_f_f (exp, 1, M_El);
+      TEST_f_f (exp, 2, M_E2l);
+      TEST_f_f (exp, 3, M_E3l);
+    }
+
+  fesetround (save_round_mode);
+
+  END (exp_tonearest);
+}
+
+
+static void
+exp_test_towardzero (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(exp) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (exp_towardzero);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TOWARDZERO))
+    {
+      TEST_f_f (exp, 1, M_El);
+      TEST_f_f (exp, 2, M_E2l);
+      TEST_f_f (exp, 3, M_E3l);
+    }
+
+  fesetround (save_round_mode);
+
+  END (exp_towardzero);
+}
+
+
+static void
+exp_test_downward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(exp) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (exp_downward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_DOWNWARD))
+    {
+      TEST_f_f (exp, 1, M_El);
+      TEST_f_f (exp, 2, M_E2l);
+      TEST_f_f (exp, 3, M_E3l);
+    }
+
+  fesetround (save_round_mode);
+
+  END (exp_downward);
+}
+
+
+static void
+exp_test_upward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(exp) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (exp_upward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_UPWARD))
+    {
+      TEST_f_f (exp, 1, M_El);
+      TEST_f_f (exp, 2, M_E2l);
+      TEST_f_f (exp, 3, M_E3l);
+    }
+
+  fesetround (save_round_mode);
+
+  END (exp_upward);
 }
 
 
@@ -5682,6 +5926,15 @@
 
   TEST_fi_f (scalbn, 1, 0L, 1);
 
+  TEST_fi_f (scalbn, 1, INT_MAX, plus_infty);
+  TEST_fi_f (scalbn, 1, INT_MIN, plus_zero);
+  TEST_fi_f (scalbn, max_value, INT_MAX, plus_infty);
+  TEST_fi_f (scalbn, max_value, INT_MIN, plus_zero);
+  TEST_fi_f (scalbn, min_value, INT_MAX, plus_infty);
+  TEST_fi_f (scalbn, min_value, INT_MIN, plus_zero);
+  TEST_fi_f (scalbn, min_value / 4, INT_MAX, plus_infty);
+  TEST_fi_f (scalbn, min_value / 4, INT_MIN, plus_zero);
+
   END (scalbn);
 }
 
@@ -5703,6 +5956,35 @@
   TEST_fl_f (scalbln, -0.854375L, 5, -27.34L);
 
   TEST_fl_f (scalbln, 1, 0L, 1);
+
+  TEST_fi_f (scalbln, 1, INT_MAX, plus_infty);
+  TEST_fi_f (scalbln, 1, INT_MIN, plus_zero);
+  TEST_fi_f (scalbln, max_value, INT_MAX, plus_infty);
+  TEST_fi_f (scalbln, max_value, INT_MIN, plus_zero);
+  TEST_fi_f (scalbln, min_value, INT_MAX, plus_infty);
+  TEST_fi_f (scalbln, min_value, INT_MIN, plus_zero);
+  TEST_fi_f (scalbln, min_value / 4, INT_MAX, plus_infty);
+  TEST_fi_f (scalbln, min_value / 4, INT_MIN, plus_zero);
+
+  TEST_fi_f (scalbln, 1, LONG_MAX, plus_infty);
+  TEST_fi_f (scalbln, 1, LONG_MIN, plus_zero);
+  TEST_fi_f (scalbln, max_value, LONG_MAX, plus_infty);
+  TEST_fi_f (scalbln, max_value, LONG_MIN, plus_zero);
+  TEST_fi_f (scalbln, min_value, LONG_MAX, plus_infty);
+  TEST_fi_f (scalbln, min_value, LONG_MIN, plus_zero);
+  TEST_fi_f (scalbln, min_value / 4, LONG_MAX, plus_infty);
+  TEST_fi_f (scalbln, min_value / 4, LONG_MIN, plus_zero);
+
+#if LONG_MAX >= 0x100000000
+  TEST_fi_f (scalbln, 1, 0x88000000L, plus_infty);
+  TEST_fi_f (scalbln, 1, -0x88000000L, plus_zero);
+  TEST_fi_f (scalbln, max_value, 0x88000000L, plus_infty);
+  TEST_fi_f (scalbln, max_value, -0x88000000L, plus_zero);
+  TEST_fi_f (scalbln, min_value, 0x88000000L, plus_infty);
+  TEST_fi_f (scalbln, min_value, -0x88000000L, plus_zero);
+  TEST_fi_f (scalbln, min_value / 4, 0x88000000L, plus_infty);
+  TEST_fi_f (scalbln, min_value / 4, -0x88000000L, plus_zero);
+#endif
 
   END (scalbn);
 }
@@ -5764,6 +6046,142 @@
 
   END (sin);
 
+}
+
+
+static void
+sin_test_tonearest (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(sin) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (sin_tonearest);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TONEAREST))
+    {
+      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
+      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
+      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
+      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
+      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
+      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
+      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
+      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
+      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
+      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (sin_tonearest);
+}
+
+
+static void
+sin_test_towardzero (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(sin) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (sin_towardzero);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TOWARDZERO))
+    {
+      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
+      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
+      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
+      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
+      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
+      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
+      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
+      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
+      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
+      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (sin_towardzero);
+}
+
+
+static void
+sin_test_downward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(sin) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (sin_downward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_DOWNWARD))
+    {
+      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
+      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
+      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
+      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
+      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
+      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
+      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
+      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
+      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
+      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (sin_downward);
+}
+
+
+static void
+sin_test_upward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(sin) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (sin_upward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_UPWARD))
+    {
+      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
+      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
+      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
+      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
+      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
+      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
+      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
+      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
+      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
+      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (sin_upward);
 }
 
 
@@ -5887,6 +6305,143 @@
 
   END (tan);
 }
+
+
+static void
+tan_test_tonearest (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(tan) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (tan_tonearest);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TONEAREST))
+    {
+      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
+      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
+      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
+      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
+      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
+      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
+      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
+      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
+      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
+      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (tan_tonearest);
+}
+
+
+static void
+tan_test_towardzero (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(tan) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (tan_towardzero);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_TOWARDZERO))
+    {
+      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
+      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
+      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
+      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
+      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
+      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
+      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
+      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
+      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
+      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (tan_towardzero);
+}
+
+
+static void
+tan_test_downward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(tan) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (tan_downward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_DOWNWARD))
+    {
+      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
+      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
+      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
+      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
+      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
+      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
+      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
+      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
+      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
+      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (tan_downward);
+}
+
+
+static void
+tan_test_upward (void)
+{
+  int save_round_mode;
+  errno = 0;
+  FUNC(tan) (0);
+  if (errno == ENOSYS)
+    /* Function not implemented.  */
+    return;
+
+  START (tan_upward);
+
+  save_round_mode = fegetround ();
+
+  if (!fesetround (FE_UPWARD))
+    {
+      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
+      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
+      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
+      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
+      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
+      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
+      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
+      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
+      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
+      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
+    }
+
+  fesetround (save_round_mode);
+
+  END (tan_upward);
+}
+
 
 static void
 tanh_test (void)
@@ -6386,9 +6941,21 @@
   atan_test ();
   atan2_test ();
   cos_test ();
+  cos_test_tonearest ();
+  cos_test_towardzero ();
+  cos_test_downward ();
+  cos_test_upward ();
   sin_test ();
+  sin_test_tonearest ();
+  sin_test_towardzero ();
+  sin_test_downward ();
+  sin_test_upward ();
   sincos_test ();
   tan_test ();
+  tan_test_tonearest ();
+  tan_test_towardzero ();
+  tan_test_downward ();
+  tan_test_upward ();
 
   /* Hyperbolic functions:  */
   acosh_test ();
@@ -6400,6 +6967,10 @@
 
   /* Exponential and logarithmic functions:  */
   exp_test ();
+  exp_test_tonearest ();
+  exp_test_towardzero ();
+  exp_test_downward ();
+  exp_test_upward ();
   exp10_test ();
   exp2_test ();
   expm1_test ();

Modified: fsf/trunk/libc/sysdeps/gnu/errlist-compat.awk
==============================================================================
--- fsf/trunk/libc/sysdeps/gnu/errlist-compat.awk (original)
+++ fsf/trunk/libc/sysdeps/gnu/errlist-compat.awk Sat Mar  3 00:02:15 2012
@@ -84,7 +84,10 @@
     printf "#define ERR_MAX %d\n\n", highest;
   }
 
-  for (old in compat) {
+  # same regardless of awk's ordering of the associative array.
+  num_compat_elems = asorti(compat, compat_indices)
+  for (i = 1; i <= num_compat_elems; i++) {
+    old = compat_indices[i]
     new = compat[old];
     n = vcount[old];
     printf "#if SHLIB_COMPAT (libc, %s, %s)\n", old, new;

Modified: fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps Sat Mar  3 00:02:15 2012
@@ -280,6 +280,130 @@
 ildouble: 1
 ldouble: 1
 
+# cos_downward
+Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
+double: 1
+idouble: 1
+Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
+float: 1
+ifloat: 1
+Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
+ildouble: 1
+ldouble: 1
+Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# cos_tonearest
+Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093":
+ildouble: 1
+ldouble: 1
+
+# cos_towardzero
+Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
+double: 1
+idouble: 1
+Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
+float: 1
+ifloat: 1
+Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+# cos_upward
+Test "cos_upward (1) == 0.5403023058681397174009366074429766037323":
+float: 1
+ifloat: 1
+Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
+ildouble: 1
+ldouble: 1
+Test "cos_upward (2) == -0.4161468365471423869975682295007621897660":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_upward (3) == -0.9899924966004454572715727947312613023937":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
+double: 1
+idouble: 1
+Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
+double: 1
+idouble: 1
+Test "cos_upward (8) == -0.1455000338086135258688413818311946826093":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
 # cosh
 Test "cosh (0.75) == 1.29468328467684468784170818539018176":
 ildouble: 1
@@ -460,6 +584,51 @@
 ildouble: 8
 ldouble: 8
 
+# exp_downward
+Test "exp_downward (1) == e":
+ildouble: 1
+ldouble: 1
+Test "exp_downward (2) == e^2":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "exp_downward (3) == e^3":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# exp_towardzero
+Test "exp_towardzero (1) == e":
+ildouble: 1
+ldouble: 1
+Test "exp_towardzero (2) == e^2":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+Test "exp_towardzero (3) == e^3":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# exp_upward
+Test "exp_upward (1) == e":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
 # expm1
 Test "expm1 (1) == M_El - 1.0":
 ildouble: 1
@@ -728,6 +897,135 @@
 ildouble: 1
 ldouble: 1
 
+# sin_downward
+Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
+ildouble: 1
+ldouble: 1
+Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
+double: 1
+idouble: 1
+Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
+ildouble: 1
+ldouble: 1
+Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "sin_downward (7) == 0.6569865987187890903969990915936351779369":
+ildouble: 1
+ldouble: 1
+Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "sin_downward (9) == 0.4121184852417565697562725663524351793439":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# sin_tonearest
+Test "sin_tonearest (10) == -0.5440211108893698134047476618513772816836":
+ildouble: 1
+ldouble: 1
+Test "sin_tonearest (4) == -0.7568024953079282513726390945118290941359":
+ildouble: 1
+ldouble: 1
+
+# sin_towardzero
+Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
+ildouble: 1
+ldouble: 1
+Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
+float: 1
+ifloat: 1
+Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023":
+double: 1
+idouble: 1
+Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
+ildouble: 1
+ldouble: 1
+Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
+float: 1
+ifloat: 1
+Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
+float: 1
+ifloat: 1
+Test "sin_towardzero (6) == -0.2794154981989258728115554466118947596280":
+ildouble: 1
+ldouble: 1
+Test "sin_towardzero (7) == 0.6569865987187890903969990915936351779369":
+ildouble: 1
+ldouble: 1
+Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# sin_upward
+Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
+float: 1
+ifloat: 1
+Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
+float: 1
+ifloat: 1
+Test "sin_upward (5) == -0.9589242746631384688931544061559939733525":
+float: 1
+ifloat: 1
+Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
+ildouble: 1
+ldouble: 1
+Test "sin_upward (7) == 0.6569865987187890903969990915936351779369":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "sin_upward (8) == 0.9893582466233817778081235982452886721164":
+float: 1
+ifloat: 1
+
 # sincos
 Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
 double: 1
@@ -758,6 +1056,152 @@
 Test "tan (pi/4) == 1":
 double: 1
 idouble: 1
+
+# tan_downward
+Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
+float: 1
+ifloat: 1
+Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "tan_downward (3) == -0.1425465430742778052956354105339134932261":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "tan_downward (4) == 1.1578212823495775831373424182673239231198":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "tan_downward (7) == 0.8714479827243187364564508896003135663222":
+double: 1
+idouble: 1
+Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
+float: 1
+ifloat: 1
+
+# tan_tonearest
+Test "tan_tonearest (1) == 1.5574077246549022305069748074583601730873":
+ildouble: 1
+ldouble: 1
+Test "tan_tonearest (2) == -2.1850398632615189916433061023136825434320":
+ildouble: 1
+ldouble: 1
+Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312":
+ildouble: 1
+ldouble: 1
+Test "tan_tonearest (8) == -6.7997114552203786999252627596086333648814":
+ildouble: 1
+ldouble: 1
+Test "tan_tonearest (9) == -0.4523156594418098405903708757987855343087":
+ildouble: 1
+ldouble: 1
+
+# tan_towardzero
+Test "tan_towardzero (1) == 1.5574077246549022305069748074583601730873":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
+float: 1
+ifloat: 1
+Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320":
+ildouble: 1
+ldouble: 1
+Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
+float: 1
+ifloat: 1
+Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
+ildouble: 1
+ldouble: 1
+Test "tan_towardzero (7) == 0.8714479827243187364564508896003135663222":
+double: 1
+idouble: 1
+Test "tan_towardzero (8) == -6.7997114552203786999252627596086333648814":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+
+# tan_upward
+Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
+ildouble: 1
+ldouble: 1
+Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "tan_upward (2) == -2.1850398632615189916433061023136825434320":
+ildouble: 1
+ldouble: 1
+Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
+float: 1
+ifloat: 1
+Test "tan_upward (4) == 1.1578212823495775831373424182673239231198":
+double: 1
+idouble: 1
+Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
+ildouble: 1
+ldouble: 1
+Test "tan_upward (7) == 0.8714479827243187364564508896003135663222":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "tan_upward (8) == -6.7997114552203786999252627596086333648814":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
 
 # tgamma
 Test "tgamma (-0.5) == -2 sqrt (pi)":
@@ -1093,6 +1537,34 @@
 ildouble: 1
 ldouble: 1
 
+Function: "cos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cos_tonearest":
+ildouble: 1
+ldouble: 1
+
+Function: "cos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "cos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
 Function: "cosh":
 ildouble: 1
 
@@ -1183,6 +1655,28 @@
 Function: "exp10":
 ildouble: 8
 ldouble: 8
+
+Function: "exp_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "exp_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
 
 Function: "expm1":
 ildouble: 1
@@ -1239,6 +1733,34 @@
 ildouble: 1
 ldouble: 1
 
+Function: "sin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "sin_tonearest":
+ildouble: 1
+ldouble: 1
+
+Function: "sin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "sin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
 Function: "sincos":
 double: 1
 float: 1
@@ -1254,6 +1776,34 @@
 Function: "tan":
 double: 1
 idouble: 1
+
+Function: "tan_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "tan_tonearest":
+ildouble: 1
+ldouble: 1
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+Function: "tan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
 
 Function: "tgamma":
 double: 2

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c Sat Mar  3 00:02:15 2012
@@ -1,7 +1,7 @@
 /*
  * IBM Accurate Mathematical Library
  * written by International Business Machines Corp.
- * Copyright (C) 2001, 2011 Free Software Foundation
+ * Copyright (C) 2001-2012 Free Software Foundation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -38,6 +38,7 @@
 #include "MathLib.h"
 #include "uexp.tbl"
 #include "math_private.h"
+#include <fenv.h>
 
 #ifndef SECTION
 # define SECTION
@@ -58,6 +59,10 @@
   int4 k;
 #endif
   int4 i,j,m,n,ex;
+  fenv_t env;
+  double retval;
+
+  libc_feholdexcept_setround (&env, FE_TONEAREST);
 
   junk1.x = x;
   m = junk1.i[HIGH_HALF];
@@ -90,18 +95,19 @@
     rem=(bet + bet*eps)+al*eps;
     res = al + rem;
     cor = (al - res) + rem;
-    if  (res == (res+cor*err_0)) return res*binexp.x;
-    else return __slowexp(x); /*if error is over bound */
-  }
-
-  if (n <= smallint) return 1.0;
+    if  (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
+    else { retval = __slowexp(x); goto ret; } /*if error is over bound */
+  }
+
+  if (n <= smallint) { retval = 1.0; goto ret; }
 
   if (n >= badint) {
-    if (n > infint) return(x+x);               /* x is NaN */
-    if (n < infint) return ( (x>0) ? (hhuge*hhuge) : (tiny*tiny) );
+    if (n > infint) { retval = x+x; goto ret; }               /* x is NaN */
+    if (n < infint) { retval = (x>0) ? (hhuge*hhuge) : (tiny*tiny); goto ret; }
     /* x is finite,  cause either overflow or underflow  */
-    if (junk1.i[LOW_HALF] != 0)  return (x+x);                /*  x is NaN  */
-    return ((x>0)?inf.x:zero );             /* |x| = inf;  return either inf or 0 */
+    if (junk1.i[LOW_HALF] != 0) { retval = x+x; goto ret; } /*  x is NaN  */
+    retval = (x>0)?inf.x:zero;             /* |x| = inf;  return either inf or 0 */
+    goto ret;
   }
 
   y = x*log2e.x + three51.x;
@@ -126,8 +132,8 @@
     if (res < 1.0) {res+=res; cor+=cor; ex-=1;}
     if (ex >=-1022) {
       binexp.i[HIGH_HALF] = (1023+ex)<<20;
-      if  (res == (res+cor*err_0)) return res*binexp.x;
-      else return __slowexp(x); /*if error is over bound */
+      if  (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
+      else { retval = __slowexp(x); goto ret; } /*if error is over bound */
     }
     ex = -(1022+ex);
     binexp.i[HIGH_HALF] = (1023-ex)<<20;
@@ -140,15 +146,19 @@
     cor = (t-res)+y;
     if (res == (res + eps*cor))
     { binexp.i[HIGH_HALF] = 0x00100000;
-      return (res-1.0)*binexp.x;
+      retval = (res-1.0)*binexp.x;
+      goto ret;
     }
-    else return __slowexp(x); /*   if error is over bound    */
+    else { retval = __slowexp(x); goto ret; } /*   if error is over bound    */
   }
   else {
     binexp.i[HIGH_HALF] =(junk1.i[LOW_HALF]+767)<<20;
-    if  (res == (res+cor*err_0)) return res*binexp.x*t256.x;
-    else return __slowexp(x);
-  }
+    if (res == (res+cor*err_0)) { retval = res*binexp.x*t256.x; goto ret; }
+    else { retval = __slowexp(x); goto ret; }
+  }
+ ret:
+  libc_feupdateenv (&env);
+  return retval;
 }
 #ifndef __ieee754_exp
 strong_alias (__ieee754_exp, __exp_finite)

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbln.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbln.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbln.c Sat Mar  3 00:02:15 2012
@@ -38,11 +38,13 @@
 	    k = ((hx&0x7ff00000)>>20) - 54;
 	    }
 	if (__builtin_expect(k==0x7ff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k >  0x7fe, 0))
-	  return huge*__copysign(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*__copysign(tiny,x); /*underflow*/
+	if (__builtin_expect(n> 50000 || k+n > 0x7fe, 0))
+	  return huge*__copysign(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
 	if (k <= -54)

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbn.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbn.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_scalbn.c Sat Mar  3 00:02:15 2012
@@ -38,11 +38,13 @@
 	    k = ((hx&0x7ff00000)>>20) - 54;
 	    }
 	if (__builtin_expect(k==0x7ff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k >  0x7fe, 0))
-	  return huge*__copysign(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*__copysign(tiny,x); /*underflow*/
+	if (__builtin_expect(n> 50000 || k+n > 0x7fe, 0))
+	  return huge*__copysign(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
 	if (k <= -54)

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c Sat Mar  3 00:02:15 2012
@@ -53,6 +53,7 @@
 #include "usncs.h"
 #include "MathLib.h"
 #include "math_private.h"
+#include <fenv.h>
 
 #ifndef SECTION
 # define SECTION
@@ -107,12 +108,16 @@
 #if 0
 	int4 nn;
 #endif
+	fenv_t env;
+	double retval = 0;
+
+	libc_feholdexcept_setround (&env, FE_TONEAREST);
 
 	u.x = x;
 	m = u.i[HIGH_HALF];
 	k = 0x7fffffff&m;              /* no sign           */
 	if (k < 0x3e500000)            /* if x->0 =>sin(x)=x */
-	 return x;
+	  { retval = x; goto ret; }
  /*---------------------------- 2^-26 < |x|< 0.25 ----------------------*/
 	else  if (k < 0x3fd00000){
 	  xx = x*x;
@@ -120,7 +125,8 @@
 	  t = ((((s5.x*xx + s4.x)*xx + s3.x)*xx + s2.x)*xx + s1.x)*(xx*x);
 	  res = x+t;
 	  cor = (x-res)+t;
-	  return (res == res + 1.07*cor)? res : slow(x);
+	  retval = (res == res + 1.07*cor)? res : slow(x);
+	  goto ret;
 	}    /*  else  if (k < 0x3fd00000)    */
 /*---------------------------- 0.25<|x|< 0.855469---------------------- */
 	else if (k < 0x3feb6000)  {
@@ -137,7 +143,8 @@
 	  cor=(ssn+s*ccs-sn*c)+cs*s;
 	  res=sn+cor;
 	  cor=(sn-res)+cor;
-	  return (res==res+1.096*cor)? res : slow1(x);
+	  retval = (res==res+1.096*cor)? res : slow1(x);
+	  goto ret;
 	}    /*   else  if (k < 0x3feb6000)    */
 
 /*----------------------- 0.855469  <|x|<2.426265  ----------------------*/
@@ -163,7 +170,8 @@
 	  cor=(ccs-s*ssn-cs*c)-sn*s;
 	  res=cs+cor;
 	  cor=(cs-res)+cor;
-	  return (res==res+1.020*cor)? ((m>0)?res:-res) : slow2(x);
+	  retval = (res==res+1.020*cor)? ((m>0)?res:-res) : slow2(x);
+	  goto ret;
 	} /*   else  if (k < 0x400368fd)    */
 
 /*-------------------------- 2.426265<|x|< 105414350 ----------------------*/
@@ -189,7 +197,8 @@
 	      res = a+t;
 	      cor = (a-res)+t;
 	      cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
-	      return (res == res + cor)? res : sloww(a,da,x);
+	      retval = (res == res + cor)? res : sloww(a,da,x);
+	      goto ret;
 	    }
 	    else  {
 	      if (a>0)
@@ -210,7 +219,8 @@
 	      res=sn+cor;
 	      cor=(sn-res)+cor;
 	      cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
-	      return (res==res+cor)? ((m)?res:-res) : sloww1(a,da,x);
+	      retval = (res==res+cor)? ((m)?res:-res) : sloww1(a,da,x);
+	      goto ret;
 	    }
 	    break;
 
@@ -232,7 +242,8 @@
 	    res=cs+cor;
 	    cor=(cs-res)+cor;
 	    cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
-	    return (res==res+cor)? ((n&2)?-res:res) : sloww2(a,da,x,n);
+	    retval = (res==res+cor)? ((n&2)?-res:res) : sloww2(a,da,x,n);
+	    goto ret;
 
 	    break;
 
@@ -268,7 +279,8 @@
 	      res = a+t;
 	      cor = (a-res)+t;
 	      cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
-	      return (res == res + cor)? res : bsloww(a,da,x,n);
+	      retval = (res == res + cor)? res : bsloww(a,da,x,n);
+	      goto ret;
 	    }
 	    else  {
 	      if (a>0) {m=1;t=a;db=da;}
@@ -287,7 +299,8 @@
 	      res=sn+cor;
 	      cor=(sn-res)+cor;
 	      cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
-	      return (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
+	      retval = (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
+	      goto ret;
 		   }
 	    break;
 
@@ -309,7 +322,8 @@
 	    res=cs+cor;
 	    cor=(cs-res)+cor;
 	    cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
-	    return (res==res+cor)? ((n&2)?-res:res) : bsloww2(a,da,x,n);
+	    retval = (res==res+cor)? ((n&2)?-res:res) : bsloww2(a,da,x,n);
+	    goto ret;
 
 	    break;
 
@@ -323,17 +337,20 @@
 	  n = __branred(x,&a,&da);
 	  switch (n) {
 	  case 0:
-	    if (a*a < 0.01588) return bsloww(a,da,x,n);
-	    else return bsloww1(a,da,x,n);
+	    if (a*a < 0.01588) retval = bsloww(a,da,x,n);
+	    else retval = bsloww1(a,da,x,n);
+	    goto ret;
 	    break;
 	  case 2:
-	    if (a*a < 0.01588) return bsloww(-a,-da,x,n);
-	    else return bsloww1(-a,-da,x,n);
+	    if (a*a < 0.01588) retval = bsloww(-a,-da,x,n);
+	    else retval = bsloww1(-a,-da,x,n);
+	    goto ret;
 	    break;
 
 	  case 1:
 	  case 3:
-	    return  bsloww2(a,da,x,n);
+	    retval = bsloww2(a,da,x,n);
+	    goto ret;
 	    break;
 	  }
 
@@ -343,9 +360,13 @@
 	else {
 	  if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
 	    __set_errno (EDOM);
-	  return x / x;
+	  retval = x / x;
+	  goto ret;
 	}
-	return 0;         /* unreachable */
+
+ ret:
+	libc_feupdateenv (&env);
+	return retval;
 }
 
 
@@ -362,11 +383,16 @@
   mynumber u,v;
   int4 k,m,n;
 
+  fenv_t env;
+  double retval = 0;
+
+  libc_feholdexcept_setround (&env, FE_TONEAREST);
+
   u.x = x;
   m = u.i[HIGH_HALF];
   k = 0x7fffffff&m;
 
-  if (k < 0x3e400000 ) return 1.0; /* |x|<2^-27 => cos(x)=1 */
+  if (k < 0x3e400000 ) { retval = 1.0; goto ret; } /* |x|<2^-27 => cos(x)=1 */
 
   else if (k < 0x3feb6000 ) {/* 2^-27 < |x| < 0.855469 */
     y=ABS(x);
@@ -383,7 +409,8 @@
     cor=(ccs-s*ssn-cs*c)-sn*s;
     res=cs+cor;
     cor=(cs-res)+cor;
-    return (res==res+1.020*cor)? res : cslow2(x);
+    retval = (res==res+1.020*cor)? res : cslow2(x);
+    goto ret;
 
 }    /*   else  if (k < 0x3feb6000)    */
 
@@ -397,7 +424,8 @@
       res = a+t;
       cor = (a-res)+t;
       cor = (cor>0)? 1.02*cor+1.0e-31 : 1.02*cor -1.0e-31;
-      return (res == res + cor)? res : csloww(a,da,x);
+      retval = (res == res + cor)? res : csloww(a,da,x);
+      goto ret;
     }
     else  {
       if (a>0) {m=1;t=a;db=da;}
@@ -416,7 +444,8 @@
       res=sn+cor;
       cor=(sn-res)+cor;
       cor = (cor>0)? 1.035*cor+1.0e-31 : 1.035*cor-1.0e-31;
-      return (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
+      retval = (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
+      goto ret;
 }
 
 }    /*   else  if (k < 0x400368fd)    */
@@ -443,7 +472,8 @@
 	res = a+t;
 	cor = (a-res)+t;
 	cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
-	return (res == res + cor)? res : csloww(a,da,x);
+	retval = (res == res + cor)? res : csloww(a,da,x);
+	goto ret;
       }
       else  {
 	if (a>0) {m=1;t=a;db=da;}
@@ -462,7 +492,8 @@
 	res=sn+cor;
 	cor=(sn-res)+cor;
 	cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
-	return (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
+	retval = (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
+	goto ret;
       }
       break;
 
@@ -483,7 +514,8 @@
       res=cs+cor;
       cor=(cs-res)+cor;
       cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
-      return (res==res+cor)? ((n)?-res:res) : csloww2(a,da,x,n);
+      retval = (res==res+cor)? ((n)?-res:res) : csloww2(a,da,x,n);
+      goto ret;
 
 	   break;
 
@@ -518,7 +550,8 @@
 	res = a+t;
 	cor = (a-res)+t;
 	cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
-	return (res == res + cor)? res : bsloww(a,da,x,n);
+	retval = (res == res + cor)? res : bsloww(a,da,x,n);
+	goto ret;
       }
       else  {
 	if (a>0) {m=1;t=a;db=da;}
@@ -537,7 +570,8 @@
 	res=sn+cor;
 	cor=(sn-res)+cor;
 	cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
-	return (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
+	retval = (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
+	goto ret;
       }
       break;
 
@@ -558,7 +592,8 @@
       res=cs+cor;
       cor=(cs-res)+cor;
       cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
-      return (res==res+cor)? ((n)?-res:res) : bsloww2(a,da,x,n);
+      retval = (res==res+cor)? ((n)?-res:res) : bsloww2(a,da,x,n);
+      goto ret;
       break;
 
     }
@@ -570,17 +605,20 @@
     n = __branred(x,&a,&da);
     switch (n) {
     case 1:
-      if (a*a < 0.01588) return bsloww(-a,-da,x,n);
-      else return bsloww1(-a,-da,x,n);
+      if (a*a < 0.01588) retval = bsloww(-a,-da,x,n);
+      else retval = bsloww1(-a,-da,x,n);
+      goto ret;
       break;
 		case 3:
-		  if (a*a < 0.01588) return bsloww(a,da,x,n);
-		  else return bsloww1(a,da,x,n);
+		  if (a*a < 0.01588) retval = bsloww(a,da,x,n);
+		  else retval = bsloww1(a,da,x,n);
+		  goto ret;
 		  break;
 
     case 0:
     case 2:
-      return  bsloww2(a,da,x,n);
+      retval = bsloww2(a,da,x,n);
+      goto ret;
       break;
     }
 
@@ -592,10 +630,13 @@
   else {
     if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
       __set_errno (EDOM);
-    return x / x; /* |x| > 2^1024 */
+    retval = x / x; /* |x| > 2^1024 */
+    goto ret;
   }
-  return 0;
-
+
+ ret:
+  libc_feupdateenv (&env);
+  return retval;
 }
 
 /************************************************************************/

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c Sat Mar  3 00:02:15 2012
@@ -39,6 +39,8 @@
 #include "mpa.h"
 #include "MathLib.h"
 #include "math.h"
+#include "math_private.h"
+#include <fenv.h>
 
 #ifndef SECTION
 # define SECTION
@@ -66,21 +68,27 @@
   mp_no mpy;
 #endif
 
+  fenv_t env;
+  double retval;
+
   int __branred(double, double *, double *);
   int __mpranred(double, mp_no *, int);
+
+  libc_feholdexcept_setround (&env, FE_TONEAREST);
 
   /* x=+-INF, x=NaN */
   num.d = x;  ux = num.i[HIGH_HALF];
   if ((ux&0x7ff00000)==0x7ff00000) {
     if ((ux&0x7fffffff)==0x7ff00000)
       __set_errno (EDOM);
-    return x-x;
+    retval = x-x;
+    goto ret;
   }
 
   w=(x<ZERO) ? -x : x;
 
   /* (I) The case abs(x) <= 1.259e-8 */
-  if (w<=g1.d)  return x;
+  if (w<=g1.d) { retval = x; goto ret; }
 
   /* (II) The case 1.259e-8 < abs(x) <= 0.0608 */
   if (w<=g2.d) {
@@ -88,7 +96,7 @@
     /* First stage */
     x2 = x*x;
     t2 = x*x2*(d3.d+x2*(d5.d+x2*(d7.d+x2*(d9.d+x2*d11.d))));
-    if ((y=x+(t2-u1.d*t2)) == x+(t2+u1.d*t2))  return y;
+    if ((y=x+(t2-u1.d*t2)) == x+(t2+u1.d*t2)) { retval = y; goto ret; }
 
     /* Second stage */
     c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+
@@ -108,8 +116,9 @@
     MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8)
     MUL2(x ,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8)
     ADD2(x    ,zero.d,c2,cc2,c1,cc1,t1,t2)
-    if ((y=c1+(cc1-u2.d*c1)) == c1+(cc1+u2.d*c1))  return y;
-    return tanMp(x);
+    if ((y=c1+(cc1-u2.d*c1)) == c1+(cc1+u2.d*c1)) { retval = y; goto ret; }
+    retval = tanMp(x);
+    goto ret;
   }
 
   /* (III) The case 0.0608 < abs(x) <= 0.787 */
@@ -120,10 +129,10 @@
     z = w-xfg[i][0].d;  z2 = z*z;   s = (x<ZERO) ? MONE : ONE;
     pz = z+z*z2*(e0.d+z2*e1.d);
     fi = xfg[i][1].d;   gi = xfg[i][2].d;   t2 = pz*(gi+fi)/(gi-pz);
-    if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d))  return (s*y);
+    if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d)) { retval = (s*y); goto ret; }
     t3 = (t2<ZERO) ? -t2 : t2;
     t4 = fi*ua3.d+t3*ub3.d;
-    if ((y=fi+(t2-t4))==fi+(t2+t4))  return (s*y);
+    if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (s*y); goto ret; }
 
     /* Second stage */
     ffi = xfg[i][3].d;
@@ -141,8 +150,9 @@
     SUB2(one.d,zero.d,c3,cc3,c1,cc1,t1,t2)
     DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
 
-    if ((y=c3+(cc3-u4.d*c3))==c3+(cc3+u4.d*c3))  return (s*y);
-    return tanMp(x);
+      if ((y=c3+(cc3-u4.d*c3))==c3+(cc3+u4.d*c3)) { retval = (s*y); goto ret; }
+    retval = tanMp(x);
+    goto ret;
   }
 
   /* (---) The case 0.787 < abs(x) <= 25 */
@@ -160,7 +170,7 @@
     else         {ya= a;  yya= da;  sy= ONE;}
 
     /* (IV),(V) The case 0.787 < abs(x) <= 25,    abs(y) <= 1e-7 */
-    if (ya<=gy1.d)  return tanMp(x);
+    if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
 
     /* (VI) The case 0.787 < abs(x) <= 25,    1e-7 < abs(y) <= 0.0608 */
     if (ya<=gy2.d) {
@@ -170,10 +180,10 @@
 	/* First stage -cot */
 	EADD(a,t2,b,db)
 	DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-	if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c))  return (-y); }
+	if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c)) { retval = (-y); goto ret; } }
       else {
 	/* First stage tan */
-	if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a))  return y; }
+	if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a)) { retval = y; goto ret; } }
       /* Second stage */
       /* Range reduction by algorithm ii */
       t = (x*hpinv.d + toint.d);
@@ -211,11 +221,12 @@
       if (n) {
 	/* Second stage -cot */
 	DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-	if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2))  return (-y); }
+	if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2)) { retval = (-y); goto ret; } }
       else {
 	/* Second stage tan */
-	if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1))  return y; }
-      return tanMp(x);
+	if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1)) { retval = y; goto ret; } }
+      retval = tanMp(x);
+      goto ret;
     }
 
     /* (VII) The case 0.787 < abs(x) <= 25,    0.0608 < abs(y) <= 0.787 */
@@ -229,17 +240,17 @@
     if (n) {
       /* -cot */
       t2 = pz*(fi+gi)/(fi+pz);
-      if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d))  return (-sy*y);
+      if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d)) { retval = (-sy*y); goto ret; }
       t3 = (t2<ZERO) ? -t2 : t2;
       t4 = gi*ua10.d+t3*ub10.d;
-      if ((y=gi-(t2-t4))==gi-(t2+t4))  return (-sy*y); }
+      if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
     else   {
       /* tan */
       t2 = pz*(gi+fi)/(gi-pz);
-      if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d))  return (sy*y);
+      if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d)) { retval = (sy*y); goto ret; }
       t3 = (t2<ZERO) ? -t2 : t2;
       t4 = fi*ua9.d+t3*ub9.d;
-      if ((y=fi+(t2-t4))==fi+(t2+t4))  return (sy*y); }
+      if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
 
     /* Second stage */
     ffi = xfg[i][3].d;
@@ -260,13 +271,14 @@
     if (n) {
       /* -cot */
       DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-      if ((y=c3+(cc3-u12.d*c3))==c3+(cc3+u12.d*c3))  return (-sy*y); }
+      if ((y=c3+(cc3-u12.d*c3))==c3+(cc3+u12.d*c3)) { retval = (-sy*y); goto ret; } }
     else {
       /* tan */
       DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-      if ((y=c3+(cc3-u11.d*c3))==c3+(cc3+u11.d*c3))  return (sy*y); }
-
-    return tanMp(x);
+      if ((y=c3+(cc3-u11.d*c3))==c3+(cc3+u11.d*c3)) { retval = (sy*y); goto ret; } }
+
+    retval = tanMp(x);
+    goto ret;
   }
 
   /* (---) The case 25 < abs(x) <= 1e8 */
@@ -288,7 +300,7 @@
     else         {ya= a;  yya= da;  sy= ONE;}
 
     /* (+++) The case 25 < abs(x) <= 1e8,    abs(y) <= 1e-7 */
-    if (ya<=gy1.d)  return tanMp(x);
+    if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
 
     /* (VIII) The case 25 < abs(x) <= 1e8,    1e-7 < abs(y) <= 0.0608 */
     if (ya<=gy2.d) {
@@ -298,10 +310,10 @@
 	/* First stage -cot */
 	EADD(a,t2,b,db)
 	DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-	if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c))  return (-y); }
+	if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c)) { retval = (-y); goto ret; } }
       else {
 	/* First stage tan */
-	if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a))  return y; }
+	if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a)) { retval = y; goto ret; } }
 
       /* Second stage */
       MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8)
@@ -325,11 +337,12 @@
       if (n) {
 	/* Second stage -cot */
 	DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-	if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2))  return (-y); }
+	if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2)) { retval = (-y); goto ret; } }
       else {
 	/* Second stage tan */
-	if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1))  return (y); }
-      return tanMp(x);
+	if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1)) { retval = (y); goto ret; } }
+      retval = tanMp(x);
+      goto ret;
     }
 
     /* (IX) The case 25 < abs(x) <= 1e8,    0.0608 < abs(y) <= 0.787 */
@@ -342,17 +355,17 @@
     if (n) {
       /* -cot */
       t2 = pz*(fi+gi)/(fi+pz);
-      if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d))  return (-sy*y);
+      if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d)) { retval = (-sy*y); goto ret; }
       t3 = (t2<ZERO) ? -t2 : t2;
       t4 = gi*ua18.d+t3*ub18.d;
-      if ((y=gi-(t2-t4))==gi-(t2+t4))  return (-sy*y); }
+      if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
     else   {
       /* tan */
       t2 = pz*(gi+fi)/(gi-pz);
-      if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d))  return (sy*y);
+      if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d)) { retval = (sy*y); goto ret; }
       t3 = (t2<ZERO) ? -t2 : t2;
       t4 = fi*ua17.d+t3*ub17.d;
-      if ((y=fi+(t2-t4))==fi+(t2+t4))  return (sy*y); }
+      if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
 
     /* Second stage */
     ffi = xfg[i][3].d;
@@ -373,12 +386,13 @@
     if (n) {
       /* -cot */
       DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-      if ((y=c3+(cc3-u20.d*c3))==c3+(cc3+u20.d*c3))  return (-sy*y); }
+      if ((y=c3+(cc3-u20.d*c3))==c3+(cc3+u20.d*c3)) { retval = (-sy*y); goto ret; } }
     else {
       /* tan */
       DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-      if ((y=c3+(cc3-u19.d*c3))==c3+(cc3+u19.d*c3))  return (sy*y); }
-    return tanMp(x);
+      if ((y=c3+(cc3-u19.d*c3))==c3+(cc3+u19.d*c3)) { retval = (sy*y); goto ret; } }
+    retval = tanMp(x);
+    goto ret;
   }
 
   /* (---) The case 1e8 < abs(x) < 2**1024 */
@@ -389,7 +403,7 @@
   else         {ya= a;  yya= da;  sy= ONE;}
 
   /* (+++) The case 1e8 < abs(x) < 2**1024,    abs(y) <= 1e-7 */
-  if (ya<=gy1.d)  return tanMp(x);
+  if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
 
   /* (X) The case 1e8 < abs(x) < 2**1024,    1e-7 < abs(y) <= 0.0608 */
   if (ya<=gy2.d) {
@@ -399,10 +413,10 @@
       /* First stage -cot */
       EADD(a,t2,b,db)
       DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-      if ((y=c+(dc-u22.d*c))==c+(dc+u22.d*c))  return (-y); }
+      if ((y=c+(dc-u22.d*c))==c+(dc+u22.d*c)) { retval = (-y); goto ret; } }
     else {
       /* First stage tan */
-      if ((y=a+(t2-u21.d*a))==a+(t2+u21.d*a))  return y; }
+      if ((y=a+(t2-u21.d*a))==a+(t2+u21.d*a)) { retval = y; goto ret; } }
 
     /* Second stage */
     /* Reduction by algorithm iv */
@@ -431,11 +445,12 @@
     if (n) {
       /* Second stage -cot */
       DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-      if ((y=c2+(cc2-u24.d*c2)) == c2+(cc2+u24.d*c2))  return (-y); }
+      if ((y=c2+(cc2-u24.d*c2)) == c2+(cc2+u24.d*c2)) { retval = (-y); goto ret; } }
     else {
       /* Second stage tan */
-      if ((y=c1+(cc1-u23.d*c1)) == c1+(cc1+u23.d*c1))  return y; }
-    return tanMp(x);
+      if ((y=c1+(cc1-u23.d*c1)) == c1+(cc1+u23.d*c1)) { retval = y; goto ret; } }
+    retval = tanMp(x);
+    goto ret;
   }
 
   /* (XI) The case 1e8 < abs(x) < 2**1024,    0.0608 < abs(y) <= 0.787 */
@@ -448,17 +463,17 @@
   if (n) {
     /* -cot */
     t2 = pz*(fi+gi)/(fi+pz);
-    if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d))  return (-sy*y);
+    if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d)) { retval = (-sy*y); goto ret; }
     t3 = (t2<ZERO) ? -t2 : t2;
     t4 = gi*ua26.d+t3*ub26.d;
-    if ((y=gi-(t2-t4))==gi-(t2+t4))  return (-sy*y); }
+    if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
   else   {
     /* tan */
     t2 = pz*(gi+fi)/(gi-pz);
-    if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d))  return (sy*y);
+    if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d)) { retval = (sy*y); goto ret; }
     t3 = (t2<ZERO) ? -t2 : t2;
     t4 = fi*ua25.d+t3*ub25.d;
-    if ((y=fi+(t2-t4))==fi+(t2+t4))  return (sy*y); }
+    if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
 
   /* Second stage */
   ffi = xfg[i][3].d;
@@ -479,14 +494,18 @@
   if (n) {
     /* -cot */
     DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-    if ((y=c3+(cc3-u28.d*c3))==c3+(cc3+u28.d*c3))  return (-sy*y); }
+    if ((y=c3+(cc3-u28.d*c3))==c3+(cc3+u28.d*c3)) { retval = (-sy*y); goto ret; } }
   else {
     /* tan */
     DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
-    if ((y=c3+(cc3-u27.d*c3))==c3+(cc3+u27.d*c3))  return (sy*y); }
-  return tanMp(x);
+    if ((y=c3+(cc3-u27.d*c3))==c3+(cc3+u27.d*c3)) { retval = (sy*y); goto ret; } }
+  retval = tanMp(x);
+  goto ret;
+
+ ret:
+  libc_feupdateenv (&env);
+  return retval;
 }
-
 
 /* multiple precision stage                                              */
 /* Convert x to multi precision number,compute tan(x) by mptan() routine */

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbln.c Sat Mar  3 00:02:15 2012
@@ -39,11 +39,13 @@
 	    k = ((ix >> 52) & 0x7ff) - 54;
 	    }
 	if (__builtin_expect(k==0x7ff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k >  0x7fe, 0))
-	  return huge*__copysign(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*__copysign(tiny,x); /*underflow*/
+	if (__builtin_expect(n> 50000 || k+n > 0x7fe, 0))
+	  return huge*__copysign(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {INSERT_WORDS64(x,(ix&UINT64_C(0x800fffffffffffff))|(k<<52));
 	      return x;}

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c Sat Mar  3 00:02:15 2012
@@ -39,11 +39,13 @@
 	    k = ((ix >> 52) & 0x7ff) - 54;
 	    }
 	if (__builtin_expect(k==0x7ff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k >  0x7fe, 0))
-	  return huge*__copysign(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*__copysign(tiny,x); /*underflow*/
+	if (__builtin_expect(n> 50000 || k+n > 0x7fe, 0))
+	  return huge*__copysign(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {INSERT_WORDS64(x,(ix&UINT64_C(0x800fffffffffffff))|(k<<52));
 	      return x;}

Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalblnf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalblnf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalblnf.c Sat Mar  3 00:02:15 2012
@@ -35,11 +35,13 @@
 	    k = ((ix&0x7f800000)>>23) - 25;
 	    }
 	if (__builtin_expect(k==0xff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k >  0xfe, 0))
-	  return huge*copysignf(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*copysignf(tiny,x);	/*underflow*/
+	if (__builtin_expect(n> 50000 || k+n > 0xfe, 0))
+	  return huge*copysignf(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;}
 	if (k <= -25)

Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalbnf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalbnf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/s_scalbnf.c Sat Mar  3 00:02:15 2012
@@ -35,11 +35,13 @@
 	    k = ((ix&0x7f800000)>>23) - 25;
 	    }
 	if (__builtin_expect(k==0xff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k >  0xfe, 0))
-	  return huge*__copysignf(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*__copysignf(tiny,x);	/*underflow*/
+	if (__builtin_expect(n> 50000 || k+n > 0xfe, 0))
+	  return huge*__copysignf(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;}
 	if (k <= -25)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalblnl.c Sat Mar  3 00:02:15 2012
@@ -46,10 +46,12 @@
 	    k = ((hx>>48)&0x7fff) - 114;
 	}
         if (k==0x7fff) return x+x;		/* NaN or Inf */
+	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow*/
+        if (n> 50000 || k+n > 0x7ffe)
+	  return huge*__copysignl(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
         k = k+n;
-        if (n> 50000 || k > 0x7ffe)
-	  return huge*__copysignl(huge,x); /* overflow  */
-	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow*/
         if (k > 0) 				/* normal result */
 	    {SET_LDOUBLE_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); return x;}
         if (k <= -114)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_scalbnl.c Sat Mar  3 00:02:15 2012
@@ -46,10 +46,12 @@
 	    k = ((hx>>48)&0x7fff) - 114;
 	}
         if (k==0x7fff) return x+x;		/* NaN or Inf */
+	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow*/
+        if (n> 50000 || k+n > 0x7ffe)
+	  return huge*__copysignl(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
         k = k+n;
-        if (n> 50000 || k > 0x7ffe)
-	  return huge*__copysignl(huge,x); /* overflow  */
-	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow*/
         if (k > 0) 				/* normal result */
 	    {SET_LDOUBLE_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); return x;}
         if (k <= -114)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c Sat Mar  3 00:02:15 2012
@@ -52,10 +52,12 @@
 	    k = ((hx>>52)&0x7ff) - 54;
 	}
 	else if (k==0x7ff) return x+x;		/* NaN or Inf */
+	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow */
+	if (n> 50000 || k+n > 0x7fe)
+	  return huge*__copysignl(huge,x); /* overflow */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
 	k = k+n;
-	if (n> 50000 || k > 0x7fe)
-	  return huge*__copysignl(huge,x); /* overflow */
-	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow */
 	if (k > 0) {				/* normal result */
 	    hx = (hx&0x800fffffffffffffULL)|(k<<52);
 	    if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c Sat Mar  3 00:02:15 2012
@@ -52,10 +52,12 @@
 	    k = ((hx>>52)&0x7ff) - 54;
 	}
 	else if (k==0x7ff) return x+x;		/* NaN or Inf */
+	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow */
+	if (n> 50000 || k+n > 0x7fe)
+	  return huge*__copysignl(huge,x); /* overflow */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
 	k = k+n;
-	if (n> 50000 || k > 0x7fe)
-	  return huge*__copysignl(huge,x); /* overflow */
-	if (n< -50000) return tiny*__copysignl(tiny,x); /*underflow */
 	if (k > 0) {				/* normal result */
 	    hx = (hx&0x800fffffffffffffULL)|(k<<52);
 	    if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalblnl.c Sat Mar  3 00:02:15 2012
@@ -43,11 +43,13 @@
 	    k = (hx&0x7fff) - 63;
 	    }
 	if (__builtin_expect(k==0x7fff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k > 0x7ffe, 0))
-	  return huge*__copysignl(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*__copysignl(tiny,x);
+	if (__builtin_expect(n> 50000 || k+n > 0x7ffe, 0))
+	  return huge*__copysignl(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;}
 	if (k <= -63)

Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_scalbnl.c Sat Mar  3 00:02:15 2012
@@ -43,11 +43,13 @@
 	    k = (hx&0x7fff) - 64;
 	    }
 	if (__builtin_expect(k==0x7fff, 0)) return x+x;	/* NaN or Inf */
-	k = k+n;
-	if (__builtin_expect(n> 50000 || k > 0x7ffe, 0))
-	  return huge*__copysignl(huge,x); /* overflow  */
 	if (__builtin_expect(n< -50000, 0))
 	  return tiny*__copysignl(tiny,x);
+	if (__builtin_expect(n> 50000 || k+n > 0x7ffe, 0))
+	  return huge*__copysignl(huge,x); /* overflow  */
+	/* Now k and n are bounded we know that k = k+n does not
+	   overflow.  */
+	k = k+n;
 	if (__builtin_expect(k > 0, 1))		/* normal result */
 	    {SET_LDOUBLE_EXP(x,(es&0x8000)|k); return x;}
 	if (k <= -64)

Added: fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps (added)
+++ fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps Sat Mar  3 00:02:15 2012
@@ -1,0 +1,1801 @@
+# Begin of automatic generation
+
+# atan2
+Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112":
+float: 6
+ifloat: 6
+ildouble: 1
+ldouble: 1
+Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
+float: 3
+ifloat: 3
+ildouble: 1
+ldouble: 1
+Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
+float: 3
+ifloat: 3
+ildouble: 1
+ldouble: 1
+Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# atanh
+Test "atanh (0.75) == 0.972955074527656652552676371721589865":
+float: 1
+ifloat: 1
+
+# cacos
+Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
+
+# cacosh
+Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+double: 1
+float: 7
+idouble: 1
+ifloat: 7
+ildouble: 5
+ldouble: 5
+Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+ildouble: 1
+ldouble: 1
+
+# casin
+Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
+
+# casinh
+Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
+double: 5
+float: 1
+idouble: 5
+ifloat: 1
+ildouble: 4
+ldouble: 4
+Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
+double: 3
+float: 6
+idouble: 3
+ifloat: 6
+ildouble: 2
+ldouble: 2
+Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# catan
+Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+float: 3
+ifloat: 3
+Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+float: 4
+ifloat: 4
+Test "Imaginary part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+ildouble: 1
+ldouble: 1
+
+# catanh
+Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+double: 4
+idouble: 4
+Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+float: 4
+ifloat: 4
+Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+float: 6
+ifloat: 6
+ildouble: 1
+ldouble: 1
+
+# cbrt
+Test "cbrt (-0.001) == -0.1":
+ildouble: 1
+ldouble: 1
+Test "cbrt (-27.0) == -3.0":
+double: 1
+idouble: 1
+Test "cbrt (0.75) == 0.908560296416069829445605878163630251":
+double: 1
+idouble: 1
+Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217":
+double: 1
+idouble: 1
+
+# ccos
+Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
+float: 1
+ifloat: 1
+
+# ccosh
+Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
+float: 1
+ifloat: 1
+
+# cexp
+Test "Real part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+ildouble: 1
+ldouble: 1
+
+# clog
+Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
+float: 3
+ifloat: 3
+Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# clog10
+Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+double: 1
+float: 5
+idouble: 1
+ifloat: 5
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-inf + inf i) == inf + 3/4 pi*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+# cos
+Test "cos (M_PI_6l * 2.0) == 0.5":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos (M_PI_6l * 4.0) == -0.5":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos (pi/2) == 0":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# cos_downward
+Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
+ildouble: 1
+ldouble: 1
+Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (6) == 0.9601702866503660205456522979229244054519":
+ildouble: 1
+ldouble: 1
+Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# cos_tonearest
+Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183":
+float: 1
+ifloat: 1
+
+# cos_towardzero
+Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (6) == 0.9601702866503660205456522979229244054519":
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
+float: 1
+ifloat: 1
+ildouble: 2
+ldouble: 2
+
+# cos_upward
+Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
+float: 1
+ifloat: 1
+Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
+float: 1
+ifloat: 1
+Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
+float: 1
+ifloat: 1
+Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
+float: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# cpow
+Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+float: 1
+ifloat: 1
+Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
+double: 1
+float: 4
+idouble: 1
+ifloat: 4
+ildouble: 4
+ldouble: 4
+Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+ildouble: 10
+ldouble: 10
+Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i":
+ildouble: 2
+ldouble: 2
+Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
+double: 1
+float: 4
+idouble: 1
+ifloat: 4
+ildouble: 3
+ldouble: 3
+Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
+float: 2
+ifloat: 2
+Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
+ildouble: 1
+ldouble: 1
+
+# csinh
+Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
+double: 1
+idouble: 1
+Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
+float: 1
+ifloat: 1
+
+# csqrt
+Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0.75 + 1.25 i) == 1.05065169626078392338656675760808326 + 0.594868882070379067881984030639932657 i":
+ildouble: 1
+ldouble: 1
+
+# ctan
+Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
+double: 1
+idouble: 1
+ildouble: 2
+ldouble: 2
+
+# ctanh
+Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
+float: 1
+ifloat: 1
+Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
+double: 1
+idouble: 1
+
+# erf
+Test "erf (1.25) == 0.922900128256458230136523481197281140":
+double: 1
+idouble: 1
+
+# erfc
+Test "erfc (0x1.f7303cp+1) == 2.705500297238986897105236321218861842255e-8":
+double: 1
+idouble: 1
+Test "erfc (0x1.ffa002p+2) == 1.233585992097580296336099501489175967033e-29":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "erfc (0x1.ffffc8p+2) == 1.122671365033056305522366683719541099329e-29":
+ildouble: 1
+ldouble: 1
+Test "erfc (2.0) == 0.00467773498104726583793074363274707139":
+double: 1
+idouble: 1
+Test "erfc (27.0) == 0.523704892378925568501606768284954709e-318":
+ildouble: 1
+ldouble: 1
+Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8":
+double: 1
+idouble: 1
+
+# exp10
+Test "exp10 (-1) == 0.1":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "exp10 (3) == 1000":
+double: 6
+float: 2
+idouble: 6
+ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# exp2
+Test "exp2 (10) == 1024":
+ildouble: 2
+ldouble: 2
+
+# exp_downward
+Test "exp_downward (2) == e^2":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "exp_downward (3) == e^3":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# exp_towardzero
+Test "exp_towardzero (2) == e^2":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "exp_towardzero (3) == e^3":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# exp_upward
+Test "exp_upward (1) == e":
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# expm1
+Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
+double: 1
+idouble: 1
+Test "expm1 (1) == M_El - 1.0":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# gamma
+Test "gamma (-0.5) == log(2*sqrt(pi))":
+ildouble: 1
+ldouble: 1
+
+# hypot
+Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271":
+float: 1
+ifloat: 1
+
+# j0
+Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "j0 (0.75) == 0.864242275166648623555731103820923211":
+float: 1
+ifloat: 1

[... 4869 lines stripped ...]
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits