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

[Commits] r17658 - in /fsf/trunk/libc: ./ math/ nptl/ nptl/sysdeps/unix/sysv/linux/x86_64/ sysdeps/generic/ sysdeps/i386/fpu/ sysdeps/...



Author: eglibc
Date: Tue Mar 20 00:01:55 2012
New Revision: 17658

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

Added:
    fsf/trunk/libc/sysdeps/i386/fpu/fenv_private.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h
    fsf/trunk/libc/sysdeps/ieee754/flt-32/math_private.h
    fsf/trunk/libc/sysdeps/sparc/fpu/fenv_private.h
Removed:
    fsf/trunk/libc/sysdeps/unix/errnos-tmpl.c
    fsf/trunk/libc/sysdeps/unix/errnos.awk
    fsf/trunk/libc/sysdeps/unix/ioctls-tmpl.c
    fsf/trunk/libc/sysdeps/unix/ioctls.awk
    fsf/trunk/libc/sysdeps/unix/mk-local_lim.c
    fsf/trunk/libc/sysdeps/unix/snarf-ioctls
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/Makerules
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/math/s_clog.c
    fsf/trunk/libc/math/s_clog10.c
    fsf/trunk/libc/math/s_clog10f.c
    fsf/trunk/libc/math/s_clog10l.c
    fsf/trunk/libc/math/s_clogf.c
    fsf/trunk/libc/math/s_clogl.c
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
    fsf/trunk/libc/nptl/unwind.c
    fsf/trunk/libc/sysdeps/generic/math_private.h
    fsf/trunk/libc/sysdeps/i386/fpu/feholdexcpt.c
    fsf/trunk/libc/sysdeps/i386/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/i386/fpu/math_private.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp2.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fma.c
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.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/flt-32/e_exp2f.c
    fsf/trunk/libc/sysdeps/ieee754/flt-32/e_expf.c
    fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/sparc/fpu/math_private.h
    fsf/trunk/libc/sysdeps/unix/Makefile
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
    fsf/trunk/libc/sysdeps/x86_64/bits/mathdef.h
    fsf/trunk/libc/sysdeps/x86_64/fpu/bits/fenv.h
    fsf/trunk/libc/sysdeps/x86_64/fpu/feholdexcpt.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/libm-test-ulps
    fsf/trunk/libc/sysdeps/x86_64/fpu/math_private.h
    fsf/trunk/libc/sysdeps/x86_64/jmpbuf-unwind.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Mar 20 00:01:55 2012
@@ -1,3 +1,210 @@
+2012-03-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/bits/mathdef.h: Don't include <bits/wordsize.h>.
+	(fenv_t): Check __x86_64__ instead of __WORDSIZE.
+
+2012-03-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/bits/mathdef.h: Don't include <bits/wordsize.h>.
+	Check __x86_64__ instead of __WORDSIZE.
+
+2012-03-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed: Support x32.
+
+2012-03-19  David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* sysdeps/sparc/fpu/libm-test-ulps: Update.
+
+	* sysdeps/sparc/fpu/fenv_private.h: New file.
+	* sysdeps/sparc/fpu/math_private.h: Use it.
+	(libc_feholdexcept, libc_feholdexceptf, libc_feholdexceptl):
+	Remove.
+	(libc_feholdexcept_setround, libc_feholdexcept_setroundf,
+	(libc_feholdexcept_setroundl): Remove.
+	(libc_fetestexcept, libc_fetestexceptf, libc_fetestexceptl):
+	Remove.
+	(libc_fesetenv, libc_fesetenvf, libc_fesetenvl): Remove.
+	(libc_feupdateenv, libc_feupdateenvf, libc_feupdateenvf): Remove.
+
+2012-03-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/fpu/math_private.h (EXTRACT_WORDS64): Use
+	int64_t instead of long int.
+	(INSERT_WORDS64): Likwise.
+
+2012-03-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ): Cast
+	_Unwind_GetCFA return to _Unwind_Ptr first.
+
+2012-03-19  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	[BZ #13629]
+	* math/s_clog.c: Include <float.h>.
+	(__clog): Scale large or subnormal inputs.
+	* math/s_clogf.c: Likewise.
+	* math/s_clogl.c: Likewise.
+	* math/s_clog10.c: Include <float.h>.
+	(M_LOG10_2): Define.
+	(__clog10): Scale large or subnormal inputs.
+	* math/s_clog10f.c: Likewise.
+	* math/s_clog10l.c: Likewise.
+	* math/libm-test.inc (clog_test): Add more tests.
+	(clog10_test): Likewise.
+	* sysdeps/i386/fpu/libm-test-ulps: Update.
+	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
+	[BZ #11451]
+	* sysdeps/ieee754/dbl-64/e_atan2.c (__ieee754_atan2): Scale large
+	x and y.
+	* math/libm-test.inc (atan2_test): Add another test.
+
+	* Makerules (common-objdir-compile): Remove.
+	* sysdeps/unix/Makefile (config-generated): Do not add
+	$(unix-generated) to variable.
+	[generic bits/local_lim.h] (mk-local_lim-CFLAGS): Remove variable.
+	[generic bits/local_lim.h] ($(common-objpfx)bits/local_lim.h):
+	Remove rule.
+	[generic bits/local_lim.h] ($(common-objpfx)mk-local_lim):
+	Likewise.
+	[generic bits/local_lim.h] (before-compile): Do not append to
+	variable.
+	[generic bits/local_lim.h] (common-generated): Likewise.
+	[generic sys/param.h] (before-compile): Do not append to variable.
+	[generic sys/param.h] ($(common-objpfx)sys/param.h): Remove rule.
+	[generic sys/param.h] ($(common-objpfx)param.h.c): Likewise.
+	[generic sys/param.h] ($(common-objpfx)param.h.dep): Likewise.
+	[generic sys/param.h] ($(common-objpfx)param.h.dep): Do not
+	include.
+	[generic sys/param.h] (sys/param.h-includes): Remove variable.
+	[generic sys/param.h] (sys/param.h-includes): Remove rule.
+	[generic sys/param.h] ($(addprefix
+	$(common-objpfx),$(sys/param.h-includes))): Likewise.
+	[generic sys/param.h] (common-generated): Do not append to
+	variable.
+	[generic sys/param.h] (sysdep_headers): Likewise.
+	[generic bits/errno.h] (before-compile): Do not append to
+	variable.
+	[generic bits/errno.h] ($(common-objpfx)bits/errno.h): Remove
+	rule.
+	[generic bits/errno.h] ($(common-objpfx)make-errnos): Likewise.
+	[generic bits/errno.h] ($(common-objpfx)make-errnos.c): Likewise.
+	[generic bits/errno.h] ($(common-objpfx)errnos): Likewise.
+	[generic bits/errno.h] (common-generated): Do not append to
+	variable.
+	[generic bits/ioctls.h] (before-compile): Do not append to
+	variable.
+	[generic bits/ioctls.h] ($(common-objpfx)bits/ioctls.h): Remove
+	rule.
+	[generic bits/ioctls.h] (ioctl-includes): Remove variable.
+	[generic bits/ioctls.h] (make-ioctls-CFLAGS): Likewise.
+	[generic bits/ioctls.h] ($(common-objpfx)make-ioctls): Remove
+	rule.
+	[generic bits/ioctls.h] ($(common-objpfx)make-ioctls.c): Likewise.
+	[generic bits/ioctls.h] (bits_termios.h): Remove variable.
+	[generic bits/ioctls.h] ($(common-objpfx)ioctls): Remove rule.
+	[generic bits/ioctls.h] (common-generated): Do not append to
+	variable.
+	[generic sys/syscall.h] (syscall.h): Remove variable.
+	[generic sys/syscall.h] ($(common-objpfx)sys/syscall.h): Remove
+	rule.
+	[generic sys/syscall.h] (before-compile): Do not append to
+	variable.
+	[generic sys/syscall.h] (common-generated): Likewise.
+	* sysdeps/unix/errnos-tmpl.c: Remove file.
+	* sysdeps/unix/errnos.awk: Likewise.
+	* sysdeps/unix/ioctls-tmpl.c: Likewise.
+	* sysdeps/unix/ioctls.awk: Likewise.
+	* sysdeps/unix/mk-local_lim.c: Likewise.
+	* sysdeps/unix/snarf-ioctls: Likewise.
+
+2012-03-19  Richard Henderson  <rth@xxxxxxxxxxx>
+
+	* sysdeps/i386/fpu/fenv_private.h: New file.
+	* sysdeps/i386/fpu/math_private.h: Use it.
+	(math_opt_barrier, math_force_eval): Remove.
+	(libc_feholdexcept_setround_53bit): Remove.
+	(libc_feupdateenv_53bit): Remove.
+	* sysdeps/x86_64/fpu/math_private.h: Likewise.
+	(math_opt_barrier, math_force_eval): Remove.
+	(libc_feholdexcept): Remove.
+	(libc_feholdexcept_setround): Remove.
+	(libc_fetestexcept, libc_fesetenv): Remove.
+	(libc_feupdateenv_test): Remove.
+	(libc_feupdateenv, libc_feholdsetround): Remove.
+	(libc_feresetround): Remove.
+
+	* sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Avoid the fldenv.
+	* sysdeps/x86_64/fpu/feholdexcpt.c (feholdexcept): Likewise.
+
+	* sysdeps/generic/math_private.h (default_libc_feupdateenv_test): New.
+	(libc_feupdateenv_test, libc_feupdateenv_testf): New.
+	(libc_feupdateenv_testl): New.
+	* sysdeps/x86_64/fpu/math_private.h (libc_feupdateenv_test): New.
+	(libc_feupdateenv_testf): New.
+	(libc_feupdateenv): Use libc_feupdateenv_test.
+	* sysdeps/ieee754/dbl-64/s_fma.c (__fma): Use libc_feupdateenv_test.
+	* sysdeps/ieee754/dbl-64/s_fmaf.c (__fmaf): Likewise.
+
+	* sysdeps/generic/math_private.h (libc_feholdsetround): New.
+	(libc_feholdsetroundf, libc_feholdsetroundl): New.
+	(libc_feresetround, libc_feresetroundf, libc_feresetroundl): New.
+	(libc_feresetround_noex): New.
+	(libc_feresetround_noexf): New.
+	(libc_feresetround_noexl): New.
+	(SET_RESTORE_ROUND, SET_RESTORE_ROUNDF, SET_RESTORE_ROUNDL): New.
+	(SET_RESTORE_ROUND_NOEX, SET_RESTORE_ROUND_NOEXF): New.
+	(SET_RESTORE_ROUND_NOEXL, SET_RESTORE_ROUND_53BIT): New.
+	* sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Use
+	SET_RESTORE_ROUND.
+	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Likewise.
+	* sysdeps/ieee754/dbl-64/s_sin.c (__sin): Use SET_RESTORE_ROUND_53BIT.
+	(__cos): Likewise.
+	* sysdeps/ieee754/dbl-64/s_tan.c (__tan): Likewise.
+	* sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Use
+	SET_RESTORE_ROUND_NOEX.
+	* sysdeps/ieee754/dbl-64/e_exp2f.c (__ieee754_exp2f): Use
+	SET_RESTORE_ROUND_NOEXF.
+	* sysdeps/ieee754/flt-32/e_expf.c (__ieee754_expf): Likewise.
+	* sysdeps/x86_64/fpu/math_private.h (libc_feholdsetround): New.
+	(libc_feholdsetroundf): New.
+	(libc_feresetround, libc_feresetroundf): New.
+
+	* sysdeps/i386/fpu/math_private.h: Include <fenv.h>, <fpu_control.h>.
+	(libc_feholdexcept_setround_53bit): Convert from macro to function.
+	(libc_feupdateenv_53bit): Likewise.  Don't force _FPU_EXTENDED.
+
+	* sysdeps/generic/math_private.h: Include <fenv.h>.
+	(default_libc_feholdexcept): New.
+	(default_libc_feholdexcept_setround): New.
+	(default_libc_fesetenv, default_libc_feupdateenv): New.
+	(libc_feholdexcept): Only define if undefined.
+	(libc_feholdexceptf, libc_feholdexceptl): Likewise.
+	(libc_feholdexcept_setround, libc_feholdexcept_setroundf): Likewise.
+	(libc_feholdexcept_setroundl): Likewise.
+	(libc_feholdexcept_setround_53bit): Likewise.
+	(libc_fetestexcept, libc_fetestexceptf, libc_fetestexceptl): Likewise.
+	(libc_fesetenv, libc_fesetenvf, libc_fesetenvl): Likewise.
+	(libc_feupdateenv, libc_feupdateenvf, libc_feupdateenvl): Likewise.
+	(libc_feupdateenv_53bit): Likewise.
+	* sysdeps/x86_64/fpu/math_private.h: Include <fenv.h>.
+	(libc_feholdexcept): Convert from macro to inline function.
+	(libc_feholdexcept_setround, libc_fetestexcept): Likewise.
+	(libc_fesetenv, libc_feupdateenv): Likewise.
+
+	* sysdeps/generic/math_private.h (GET_HIGH_WORD): Define only if
+	not previously defined.
+	(GET_LOW_WORD, EXTRACT_WORDS64, INSERT_WORDS): Likewise.
+	(INSERT_WORDS64, SET_HIGH_WORD, SET_LOW_WORD): Likewise.
+	(GET_FLOAT_WORD, SET_FLOAT_WORD): Likewise.
+	* sysdeps/ieee754/dbl-64/wordsize-64/math_private.h: New file.
+	* sysdeps/ieee754/flt-32/math_private.h: New file.
+	* sysdeps/x86_64/fpu/math_private.h: Move the include_next of
+	math_private.h below SET_FLOAT_WORD.
+	(__isnan, __isinf_ns, __finite): Remove.
+	(__isnanf, __isinf_nsf, __finitef): Remove.
+
 2012-03-18  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
 
 	* sysdeps/powerpc/fpu/libm-test-ulps: Update.

Modified: fsf/trunk/libc/Makerules
==============================================================================
--- fsf/trunk/libc/Makerules (original)
+++ fsf/trunk/libc/Makerules Tue Mar 20 00:01:55 2012
@@ -1122,14 +1122,6 @@
 	    $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
 endef
 
-# Command to compile $< in $(common-objdir) using the native libraries.
-# We must cd to $(objdir) anyway so that $(..)config.h is valid.
-define common-objdir-compile
-$(patsubst %/,cd % &&,$(objpfx)) \
-$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
-	    $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(..)$(@F)
-endef
-
 # We always want to use configuration definitions.
 # Note that this is only used for commands running in $(objpfx).
 ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Tue Mar 20 00:01:55 2012
@@ -12,11 +12,11 @@
   174, 350, 411, 2541, 2547, 2548, 2551, 2552, 2553, 2554, 2562, 2563, 2565,
   2566, 2576, 3335, 3976, 3992, 4026, 4108, 4596, 4822, 5077, 5461, 5805,
   5993, 6471, 6884, 6907, 6911, 9739, 9902, 10110, 10135, 10140, 10210,
-  10545, 10716, 11174, 11322, 11365, 11494, 12047, 13058, 13525, 13526,
-  13527, 13528, 13529, 13530, 13531, 13532, 13533, 13547, 13551, 13552,
-  13553, 13555, 13559, 13566, 13583, 13618, 13637, 13656, 13658, 13673,
-  13695, 13704, 13706, 13726, 13738, 13786, 13792, 13806, 13840, 13841,
-  13844, 13846, 13851, 13852, 13854
+  10545, 10716, 11174, 11322, 11365, 11451, 11494, 12047, 13058, 13525,
+  13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533, 13547, 13551,
+  13552, 13553, 13555, 13559, 13566, 13583, 13618, 13637, 13656, 13658,
+  13673, 13695, 13704, 13706, 13726, 13738, 13786, 13792, 13806, 13840,
+  13841, 13844, 13846, 13851, 13852, 13854
 
 * ISO C11 support:
 

Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Tue Mar 20 00:01:55 2012
@@ -949,6 +949,8 @@
   TEST_ff_f (atan2, minus_infty, minus_infty, -M_PI_34l);
   TEST_ff_f (atan2, nan_value, nan_value, nan_value);
 
+  TEST_ff_f (atan2, max_value, max_value, M_PI_4l);
+
   TEST_ff_f (atan2, 0.75L, 1, 0.643501108793284386802809228717322638L);
   TEST_ff_f (atan2, -0.75L, 1.0L, -0.643501108793284386802809228717322638L);
   TEST_ff_f (atan2, 0.75L, -1.0L, 2.49809154479650885165983415456218025L);
@@ -1967,6 +1969,24 @@
   TEST_c_c (clog, 0.75L, 1.25L, 0.376885901188190075998919126749298416L, 1.03037682652431246378774332703115153L);
   TEST_c_c (clog, -2, -3, 1.2824746787307683680267437207826593L, -2.1587989303424641704769327722648368L);
 
+  TEST_c_c (clog, 0x1.fffffep+127L, 0x1.fffffep+127L, 89.06941264234832570836679262104313101776L, M_PI_4l);
+  TEST_c_c (clog, 0x1.fffffep+127L, 1.0L, 88.72283905206835305365817656031404273372L, 2.938736052218037251011746307725933020145e-39L);
+  TEST_c_c (clog, 0x1p-149L, 0x1p-149L, -102.9323563131518784484589700365392203592L, M_PI_4l);
+  TEST_c_c (clog, 0x1p-147L, 0x1p-147L, -101.5460619520319878296245057936228672231L, M_PI_4l);
+
+#ifndef TEST_FLOAT
+  TEST_c_c (clog, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 710.1292864836639693869320059713862337880L, M_PI_4l);
+  TEST_c_c (clog, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 709.8942846690411016323109979483151967689L, 0.4636476090008061606231772164674799632783L);
+  TEST_c_c (clog, 0x1p-1074L, 0x1p-1074L, -744.0934983311012896593986823853525458290L, M_PI_4l);
+  TEST_c_c (clog, 0x1p-1073L, 0x1p-1073L, -743.4003511505413443499814502638943692610L, M_PI_4l);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_c_c (clog, 0x1.fp+16383L, 0x1.fp+16383L, 11356.83823118610934184548269774874545400L, M_PI_4l);
+  TEST_c_c (clog, 0x1.fp+16383L, 0x1p+16383L, 11356.60974243783798653123798337822335902L, 0.4764674194737066993385333770295162295856L);
+  TEST_c_c (clog, 0x1p-16440L, 0x1p-16441L, -11395.22807662984378194141292922726786191L, 0.4636476090008061162142562314612144020285L);
+#endif
+
   END (clog, complex);
 }
 
@@ -2032,6 +2052,24 @@
 
   TEST_c_c (clog10, 0.75L, 1.25L, 0.163679467193165171449476605077428975L, 0.447486970040493067069984724340855636L);
   TEST_c_c (clog10, -2, -3, 0.556971676153418384603252578971164214L, -0.937554462986374708541507952140189646L);
+
+  TEST_c_c (clog10, 0x1.fffffep+127L, 0x1.fffffep+127L, 38.68235441693561449174780668781319348761L, M_PI4_LOG10El);
+  TEST_c_c (clog10, 0x1.fffffep+127L, 1.0L, 38.53183941910362389414093724045094697423L, 1.276276851248440096917018665609900318458e-39L);
+  TEST_c_c (clog10, 0x1p-149L, 0x1p-149L, -44.70295435610120748924022586658721447508L, M_PI4_LOG10El);
+  TEST_c_c (clog10, 0x1p-147L, 0x1p-147L, -44.10089436477324509881274807713822842154L, M_PI4_LOG10El);
+
+#ifndef TEST_FLOAT
+  TEST_c_c (clog10, 0x1.fffffffffffffp+1023L, 0x1.fffffffffffffp+1023L, 308.4052305577487344482591243175787477115L, M_PI4_LOG10El);
+  TEST_c_c (clog10, 0x1.fffffffffffffp+1023L, 0x1p+1023L, 308.3031705664207720674749211936626341569L, 0.2013595981366865903254995612594728746470L);
+  TEST_c_c (clog10, 0x1p-1074L, 0x1p-1074L, -323.1557003452838130619487034867432642357L, M_PI4_LOG10El);
+  TEST_c_c (clog10, 0x1p-1073L, 0x1p-1073L, -322.8546703496198318667349645920187712089L, M_PI4_LOG10El);
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_c_c (clog10, 0x1.fp+16383L, 0x1.fp+16383L, 4932.212175672014259683102930239951947672L, M_PI4_LOG10El);
+  TEST_c_c (clog10, 0x1.fp+16383L, 0x1p+16383L, 4932.112944269463028900262609694408579449L, 0.2069271710841128115912940666587802677383L);
+  TEST_c_c (clog10, 0x1p-16440L, 0x1p-16441L, -4948.884673709346821106688037612752099609L, 0.2013595981366865710389502301937289472543L);
+#endif
 
   END (clog10, complex);
 }

Modified: fsf/trunk/libc/math/s_clog.c
==============================================================================
--- fsf/trunk/libc/math/s_clog.c (original)
+++ fsf/trunk/libc/math/s_clog.c Tue Mar 20 00:01:55 2012
@@ -1,5 +1,5 @@
 /* Compute complex natural logarithm.
-   Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -20,7 +20,7 @@
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
-
+#include <float.h>
 
 __complex__ double
 __clog (__complex__ double x)
@@ -40,8 +40,27 @@
   else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
     {
       /* Neither real nor imaginary part is NaN.  */
-      __real__ result = __ieee754_log (__ieee754_hypot (__real__ x,
-							__imag__ x));
+      double d;
+      int scale = 0;
+
+      if (fabs (__real__ x) > DBL_MAX / 2.0
+	  || fabs (__imag__ x) > DBL_MAX / 2.0)
+	{
+	  scale = -1;
+	  __real__ x = __scalbn (__real__ x, scale);
+	  __imag__ x = __scalbn (__imag__ x, scale);
+	}
+      else if (fabs (__real__ x) < DBL_MIN
+	       && fabs (__imag__ x) < DBL_MIN)
+	{
+	  scale = DBL_MANT_DIG;
+	  __real__ x = __scalbn (__real__ x, scale);
+	  __imag__ x = __scalbn (__imag__ x, scale);
+	}
+
+      d = __ieee754_hypot (__real__ x, __imag__ x);
+
+      __real__ result = __ieee754_log (d) - scale * M_LN2;
       __imag__ result = __ieee754_atan2 (__imag__ x, __real__ x);
     }
   else

Modified: fsf/trunk/libc/math/s_clog10.c
==============================================================================
--- fsf/trunk/libc/math/s_clog10.c (original)
+++ fsf/trunk/libc/math/s_clog10.c Tue Mar 20 00:01:55 2012
@@ -1,5 +1,5 @@
 /* Compute complex base 10 logarithm.
-   Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -20,7 +20,10 @@
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
+#include <float.h>
 
+/* log_10 (2).  */
+#define M_LOG10_2 0.3010299956639811952137388947244930267682
 
 __complex__ double
 __clog10 (__complex__ double x)
@@ -40,8 +43,27 @@
   else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
     {
       /* Neither real nor imaginary part is NaN.  */
-      __real__ result = __ieee754_log10 (__ieee754_hypot (__real__ x,
-							  __imag__ x));
+      double d;
+      int scale = 0;
+
+      if (fabs (__real__ x) > DBL_MAX / 2.0
+	  || fabs (__imag__ x) > DBL_MAX / 2.0)
+	{
+	  scale = -1;
+	  __real__ x = __scalbn (__real__ x, scale);
+	  __imag__ x = __scalbn (__imag__ x, scale);
+	}
+      else if (fabs (__real__ x) < DBL_MIN
+	       && fabs (__imag__ x) < DBL_MIN)
+	{
+	  scale = DBL_MANT_DIG;
+	  __real__ x = __scalbn (__real__ x, scale);
+	  __imag__ x = __scalbn (__imag__ x, scale);
+	}
+
+      d = __ieee754_hypot (__real__ x, __imag__ x);
+
+      __real__ result = __ieee754_log10 (d) - scale * M_LOG10_2;
       __imag__ result = M_LOG10E * __ieee754_atan2 (__imag__ x, __real__ x);
     }
   else

Modified: fsf/trunk/libc/math/s_clog10f.c
==============================================================================
--- fsf/trunk/libc/math/s_clog10f.c (original)
+++ fsf/trunk/libc/math/s_clog10f.c Tue Mar 20 00:01:55 2012
@@ -1,5 +1,5 @@
 /* Compute complex base 10 logarithm.
-   Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -20,7 +20,10 @@
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
+#include <float.h>
 
+/* log_10 (2).  */
+#define M_LOG10_2f 0.3010299956639811952137388947244930267682f
 
 __complex__ float
 __clog10f (__complex__ float x)
@@ -40,8 +43,27 @@
   else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
     {
       /* Neither real nor imaginary part is NaN.  */
-      __real__ result = __ieee754_log10f (__ieee754_hypotf (__real__ x,
-							    __imag__ x));
+      float d;
+      int scale = 0;
+
+      if (fabsf (__real__ x) > FLT_MAX / 2.0f
+	  || fabsf (__imag__ x) > FLT_MAX / 2.0f)
+	{
+	  scale = -1;
+	  __real__ x = __scalbnf (__real__ x, scale);
+	  __imag__ x = __scalbnf (__imag__ x, scale);
+	}
+      else if (fabsf (__real__ x) < FLT_MIN
+	       && fabsf (__imag__ x) < FLT_MIN)
+	{
+	  scale = FLT_MANT_DIG;
+	  __real__ x = __scalbnf (__real__ x, scale);
+	  __imag__ x = __scalbnf (__imag__ x, scale);
+	}
+
+      d = __ieee754_hypotf (__real__ x, __imag__ x);
+
+      __real__ result = __ieee754_log10f (d) - scale * M_LOG10_2f;
       __imag__ result = M_LOG10E * __ieee754_atan2f (__imag__ x, __real__ x);
     }
   else

Modified: fsf/trunk/libc/math/s_clog10l.c
==============================================================================
--- fsf/trunk/libc/math/s_clog10l.c (original)
+++ fsf/trunk/libc/math/s_clog10l.c Tue Mar 20 00:01:55 2012
@@ -1,5 +1,5 @@
 /* Compute complex base 10 logarithm.
-   Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -20,7 +20,10 @@
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
+#include <float.h>
 
+/* log_10 (2).  */
+#define M_LOG10_2l 0.3010299956639811952137388947244930267682L
 
 __complex__ long double
 __clog10l (__complex__ long double x)
@@ -40,8 +43,27 @@
   else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
     {
       /* Neither real nor imaginary part is NaN.  */
-      __real__ result = __ieee754_log10l (__ieee754_hypotl (__real__ x,
-							    __imag__ x));
+      long double d;
+      int scale = 0;
+
+      if (fabsl (__real__ x) > LDBL_MAX / 2.0L
+	  || fabsl (__imag__ x) > LDBL_MAX / 2.0L)
+	{
+	  scale = -1;
+	  __real__ x = __scalbnl (__real__ x, scale);
+	  __imag__ x = __scalbnl (__imag__ x, scale);
+	}
+      else if (fabsl (__real__ x) < LDBL_MIN
+	       && fabsl (__imag__ x) < LDBL_MIN)
+	{
+	  scale = LDBL_MANT_DIG;
+	  __real__ x = __scalbnl (__real__ x, scale);
+	  __imag__ x = __scalbnl (__imag__ x, scale);
+	}
+
+      d = __ieee754_hypotl (__real__ x, __imag__ x);
+
+      __real__ result = __ieee754_log10l (d) - scale * M_LOG10_2l;
       __imag__ result = M_LOG10El * __ieee754_atan2l (__imag__ x, __real__ x);
     }
   else

Modified: fsf/trunk/libc/math/s_clogf.c
==============================================================================
--- fsf/trunk/libc/math/s_clogf.c (original)
+++ fsf/trunk/libc/math/s_clogf.c Tue Mar 20 00:01:55 2012
@@ -1,5 +1,5 @@
 /* Compute complex natural logarithm.
-   Copyright (C) 1997, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -19,9 +19,8 @@
 
 #include <complex.h>
 #include <math.h>
-
 #include <math_private.h>
-
+#include <float.h>
 
 __complex__ float
 __clogf (__complex__ float x)
@@ -41,8 +40,27 @@
   else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
     {
       /* Neither real nor imaginary part is NaN.  */
-      __real__ result = __ieee754_logf (__ieee754_hypotf (__real__ x,
-							  __imag__ x));
+      float d;
+      int scale = 0;
+
+      if (fabsf (__real__ x) > FLT_MAX / 2.0f
+	  || fabsf (__imag__ x) > FLT_MAX / 2.0f)
+	{
+	  scale = -1;
+	  __real__ x = __scalbnf (__real__ x, scale);
+	  __imag__ x = __scalbnf (__imag__ x, scale);
+	}
+      else if (fabsf (__real__ x) < FLT_MIN
+	       && fabsf (__imag__ x) < FLT_MIN)
+	{
+	  scale = FLT_MANT_DIG;
+	  __real__ x = __scalbnf (__real__ x, scale);
+	  __imag__ x = __scalbnf (__imag__ x, scale);
+	}
+
+      d = __ieee754_hypotf (__real__ x, __imag__ x);
+
+      __real__ result = __ieee754_logf (d) - scale * (float) M_LN2;
       __imag__ result = __ieee754_atan2f (__imag__ x, __real__ x);
     }
   else

Modified: fsf/trunk/libc/math/s_clogl.c
==============================================================================
--- fsf/trunk/libc/math/s_clogl.c (original)
+++ fsf/trunk/libc/math/s_clogl.c Tue Mar 20 00:01:55 2012
@@ -1,5 +1,5 @@
 /* Compute complex natural logarithm.
-   Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -20,7 +20,7 @@
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
-
+#include <float.h>
 
 __complex__ long double
 __clogl (__complex__ long double x)
@@ -40,8 +40,27 @@
   else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
     {
       /* Neither real nor imaginary part is NaN.  */
-      __real__ result = __ieee754_logl (__ieee754_hypotl (__real__ x,
-							  __imag__ x));
+      long double d;
+      int scale = 0;
+
+      if (fabsl (__real__ x) > LDBL_MAX / 2.0L
+	  || fabsl (__imag__ x) > LDBL_MAX / 2.0L)
+	{
+	  scale = -1;
+	  __real__ x = __scalbnl (__real__ x, scale);
+	  __imag__ x = __scalbnl (__imag__ x, scale);
+	}
+      else if (fabsl (__real__ x) < LDBL_MIN
+	       && fabsl (__imag__ x) < LDBL_MIN)
+	{
+	  scale = LDBL_MANT_DIG;
+	  __real__ x = __scalbnl (__real__ x, scale);
+	  __imag__ x = __scalbnl (__imag__ x, scale);
+	}
+
+      d = __ieee754_hypotl (__real__ x, __imag__ x);
+
+      __real__ result = __ieee754_logl (d) - scale * M_LN2l;
       __imag__ result = __ieee754_atan2l (__imag__ x, __real__ x);
     }
   else

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Tue Mar 20 00:01:55 2012
@@ -1,3 +1,13 @@
+2012-03-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (SYS_futex): Use
+	__NR_futex directly.
+
+2012-03-19  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* unwind.c (unwind_stop): Cast _Unwind_GetCFA return to
+	_Unwind_Ptr first.
+
 2012-03-16  David S. Miller  <davem@xxxxxxxxxxxxx>
 
 	[BZ #13844]

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h Tue Mar 20 00:01:55 2012
@@ -43,7 +43,7 @@
 # endif
 #endif
 
-#define SYS_futex		202
+#define SYS_futex		__NR_futex
 #define FUTEX_WAIT		0
 #define FUTEX_WAKE		1
 #define FUTEX_CMP_REQUEUE	4

Modified: fsf/trunk/libc/nptl/unwind.c
==============================================================================
--- fsf/trunk/libc/nptl/unwind.c (original)
+++ fsf/trunk/libc/nptl/unwind.c Tue Mar 20 00:01:55 2012
@@ -68,7 +68,7 @@
 	 registered with the old method which would be unwound by this
 	 step.  */
       struct _pthread_cleanup_buffer *oldp = buf->priv.data.cleanup;
-      void *cfa = (void *) _Unwind_GetCFA (context);
+      void *cfa = (void *) (_Unwind_Ptr) _Unwind_GetCFA (context);
 
       if (curp != oldp && (do_longjump || FRAME_LEFT (cfa, curp, adj)))
 	{

Modified: fsf/trunk/libc/sysdeps/generic/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/math_private.h (original)
+++ fsf/trunk/libc/sysdeps/generic/math_private.h Tue Mar 20 00:01:55 2012
@@ -19,6 +19,7 @@
 #include <endian.h>
 #include <stdint.h>
 #include <sys/types.h>
+#include <fenv.h>
 
 /* The original fdlibm code used statements like:
 	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
@@ -76,50 +77,59 @@
 
 /* Get the more significant 32 bit int from a double.  */
 
-#define GET_HIGH_WORD(i,d)					\
+#ifndef GET_HIGH_WORD
+# define GET_HIGH_WORD(i,d)					\
 do {								\
   ieee_double_shape_type gh_u;					\
   gh_u.value = (d);						\
   (i) = gh_u.parts.msw;						\
 } while (0)
+#endif
 
 /* Get the less significant 32 bit int from a double.  */
 
-#define GET_LOW_WORD(i,d)					\
+#ifndef GET_LOW_WORD
+# define GET_LOW_WORD(i,d)					\
 do {								\
   ieee_double_shape_type gl_u;					\
   gl_u.value = (d);						\
   (i) = gl_u.parts.lsw;						\
 } while (0)
+#endif
 
 /* Get all in one, efficient on 64-bit machines.  */
-#define EXTRACT_WORDS64(i,d)					\
+#ifndef EXTRACT_WORDS64
+# define EXTRACT_WORDS64(i,d)					\
 do {								\
   ieee_double_shape_type gh_u;					\
   gh_u.value = (d);						\
   (i) = gh_u.word;						\
 } while (0)
+#endif
 
 /* Set a double from two 32 bit ints.  */
-
-#define INSERT_WORDS(d,ix0,ix1)					\
+#ifndef INSERT_WORDS
+# define INSERT_WORDS(d,ix0,ix1)				\
 do {								\
   ieee_double_shape_type iw_u;					\
   iw_u.parts.msw = (ix0);					\
   iw_u.parts.lsw = (ix1);					\
   (d) = iw_u.value;						\
 } while (0)
+#endif
 
 /* Get all in one, efficient on 64-bit machines.  */
-#define INSERT_WORDS64(d,i)					\
+#ifndef INSERT_WORDS64
+# define INSERT_WORDS64(d,i)					\
 do {								\
   ieee_double_shape_type iw_u;					\
   iw_u.word = (i);						\
   (d) = iw_u.value;						\
 } while (0)
+#endif
 
 /* Set the more significant 32 bits of a double from an int.  */
-
+#ifndef SET_HIGH_WORD
 #define SET_HIGH_WORD(d,v)					\
 do {								\
   ieee_double_shape_type sh_u;					\
@@ -127,16 +137,18 @@
   sh_u.parts.msw = (v);						\
   (d) = sh_u.value;						\
 } while (0)
+#endif
 
 /* Set the less significant 32 bits of a double from an int.  */
-
-#define SET_LOW_WORD(d,v)					\
+#ifndef SET_LOW_WORD
+# define SET_LOW_WORD(d,v)					\
 do {								\
   ieee_double_shape_type sl_u;					\
   sl_u.value = (d);						\
   sl_u.parts.lsw = (v);						\
   (d) = sl_u.value;						\
 } while (0)
+#endif
 
 /* A union which permits us to convert between a float and a 32 bit
    int.  */
@@ -148,22 +160,24 @@
 } ieee_float_shape_type;
 
 /* Get a 32 bit int from a float.  */
-
-#define GET_FLOAT_WORD(i,d)					\
+#ifndef GET_FLOAT_WORD
+# define GET_FLOAT_WORD(i,d)					\
 do {								\
   ieee_float_shape_type gf_u;					\
   gf_u.value = (d);						\
   (i) = gf_u.word;						\
 } while (0)
+#endif
 
 /* Set a float from a 32 bit int.  */
-
-#define SET_FLOAT_WORD(d,i)					\
+#ifndef SET_FLOAT_WORD
+# define SET_FLOAT_WORD(d,i)					\
 do {								\
   ieee_float_shape_type sf_u;					\
   sf_u.word = (i);						\
   (d) = sf_u.value;						\
 } while (0)
+#endif
 
 /* Get long double macros from a separate header.  */
 #include <math_ldbl.h>
@@ -359,33 +373,176 @@
    know what operations are going to be performed.  Therefore we
    define additional interfaces.  By default they refer to the normal
    interfaces.  */
-#define libc_feholdexcept(e) (void) feholdexcept (e)
-#define libc_feholdexceptf(e) (void) feholdexcept (e)
-#define libc_feholdexceptl(e) (void) feholdexcept (e)
-
-#define libc_feholdexcept_setround(e, r) \
-  do { feholdexcept (e); fesetround (r); } while (0)
-#define libc_feholdexcept_setroundf(e, r) \
-  do { feholdexcept (e); fesetround (r); } while (0)
-#define libc_feholdexcept_setroundl(e, r) \
-  do { feholdexcept (e); fesetround (r); } while (0)
-
-#define libc_feholdexcept_setround_53bit(e, r) \
-  libc_feholdexcept_setround (e, r)
-
-#define libc_fetestexcept(e) fetestexcept (e)
-#define libc_fetestexceptf(e) fetestexcept (e)
-#define libc_fetestexceptl(e) fetestexcept (e)
-
-#define libc_fesetenv(e) (void) fesetenv (e)
-#define libc_fesetenvf(e) (void) fesetenv (e)
-#define libc_fesetenvl(e) (void) fesetenv (e)
-
-#define libc_feupdateenv(e) (void) feupdateenv (e)
-#define libc_feupdateenvf(e) (void) feupdateenv (e)
-#define libc_feupdateenvl(e) (void) feupdateenv (e)
-
-#define libc_feupdateenv_53bit(e) libc_feupdateenv (e)
+
+static __always_inline void
+default_libc_feholdexcept (fenv_t *e)
+{
+  (void) feholdexcept (e);
+}
+
+#ifndef libc_feholdexcept
+# define libc_feholdexcept  default_libc_feholdexcept
+#endif
+#ifndef libc_feholdexceptf
+# define libc_feholdexceptf default_libc_feholdexcept
+#endif
+#ifndef libc_feholdexceptl
+# define libc_feholdexceptl default_libc_feholdexcept
+#endif
+
+static __always_inline void
+default_libc_feholdexcept_setround (fenv_t *e, int r)
+{
+  feholdexcept (e);
+  fesetround (r);
+}
+
+#ifndef libc_feholdexcept_setround
+# define libc_feholdexcept_setround  default_libc_feholdexcept_setround
+#endif
+#ifndef libc_feholdexcept_setroundf
+# define libc_feholdexcept_setroundf default_libc_feholdexcept_setround
+#endif
+#ifndef libc_feholdexcept_setroundl
+# define libc_feholdexcept_setroundl default_libc_feholdexcept_setround
+#endif
+
+#ifndef libc_feholdexcept_setround_53bit
+# define libc_feholdexcept_setround_53bit libc_feholdexcept_setround
+#endif
+
+#ifndef libc_fetestexcept
+# define libc_fetestexcept  fetestexcept
+#endif
+#ifndef libc_fetestexceptf
+# define libc_fetestexceptf fetestexcept
+#endif
+#ifndef libc_fetestexceptl
+# define libc_fetestexceptl fetestexcept
+#endif
+
+static __always_inline void
+default_libc_fesetenv (fenv_t *e)
+{
+  (void) fesetenv (e);
+}
+
+#ifndef libc_fesetenv
+# define libc_fesetenv  default_libc_fesetenv
+#endif
+#ifndef libc_fesetenvf
+# define libc_fesetenvf default_libc_fesetenv
+#endif
+#ifndef libc_fesetenvl
+# define libc_fesetenvl default_libc_fesetenv
+#endif
+
+static __always_inline void
+default_libc_feupdateenv (fenv_t *e)
+{
+  (void) feupdateenv (e);
+}
+
+#ifndef libc_feupdateenv
+# define libc_feupdateenv  default_libc_feupdateenv
+#endif
+#ifndef libc_feupdateenvf
+# define libc_feupdateenvf default_libc_feupdateenv
+#endif
+#ifndef libc_feupdateenvl
+# define libc_feupdateenvl default_libc_feupdateenv
+#endif
+
+#ifndef libc_feupdateenv_53bit
+# define libc_feupdateenv_53bit libc_feupdateenv
+#endif
+
+static __always_inline int
+default_libc_feupdateenv_test (fenv_t *e, int ex)
+{
+  int ret = fetestexcept (ex);
+  feupdateenv (e);
+  return ret;
+}
+
+#ifndef libc_feupdateenv_test
+# define libc_feupdateenv_test  default_libc_feupdateenv_test
+#endif
+#ifndef libc_feupdateenv_testf
+# define libc_feupdateenv_testf default_libc_feupdateenv_test
+#endif
+#ifndef libc_feupdateenv_testl
+# define libc_feupdateenv_testl default_libc_feupdateenv_test
+#endif
+
+/* Save and set the rounding mode.  The use of fenv_t to store the old mode
+   allows a target-specific version of this function to avoid converting the
+   rounding mode from the fpu format.  By default we have no choice but to
+   manipulate the entire env.  */
+
+#ifndef libc_feholdsetround
+# define libc_feholdsetround  libc_feholdexcept_setround
+#endif
+#ifndef libc_feholdsetroundf
+# define libc_feholdsetroundf libc_feholdexcept_setroundf
+#endif
+#ifndef libc_feholdsetroundl
+# define libc_feholdsetroundl libc_feholdexcept_setroundl
+#endif
+
+/* ... and the reverse.  */
+
+#ifndef libc_feresetround
+# define libc_feresetround  libc_feupdateenv
+#endif
+#ifndef libc_feresetroundf
+# define libc_feresetroundf libc_feupdateenvf
+#endif
+#ifndef libc_feresetroundl
+# define libc_feresetroundl libc_feupdateenvl
+#endif
+
+/* ... and a version that may also discard exceptions.  */
+
+#ifndef libc_feresetround_noex
+# define libc_feresetround_noex  libc_fesetenv
+#endif
+#ifndef libc_feresetround_noexf
+# define libc_feresetround_noexf libc_fesetenvf
+#endif
+#ifndef libc_feresetround_noexl
+# define libc_feresetround_noexl libc_fesetenvl
+#endif
+
+/* Save and restore the rounding mode within a lexical block.  */
+
+#define SET_RESTORE_ROUND(RM) \
+  fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround)));	\
+  libc_feholdsetround (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUNDF(RM) \
+  fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetroundf)));	\
+  libc_feholdsetroundf (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUNDL(RM) \
+  fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetroundl)));	\
+  libc_feholdsetroundl (&__libc_save_rm, (RM))
+
+/* Save and restore the rounding mode within a lexical block, and also
+   the set of exceptions raised within the block may be discarded.  */
+
+#define SET_RESTORE_ROUND_NOEX(RM) \
+  fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noex))); \
+  libc_feholdsetround (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUND_NOEXF(RM) \
+  fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noexf))); \
+  libc_feholdsetroundf (&__libc_save_rm, (RM))
+#define SET_RESTORE_ROUND_NOEXL(RM) \
+  fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround_noexl))); \
+  libc_feholdsetroundl (&__libc_save_rm, (RM))
+
+/* Like SET_RESTORE_ROUND, but also set rounding precision to 53 bits.  */
+#define SET_RESTORE_ROUND_53BIT(RM) \
+  fenv_t __libc_save_rm __attribute__((cleanup(libc_feupdateenv_53bit))); \
+  libc_feholdexcept_setround_53bit (&__libc_save_rm, (RM))
 
 #define __nan(str) \
   (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))

Modified: fsf/trunk/libc/sysdeps/i386/fpu/feholdexcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/feholdexcpt.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/feholdexcpt.c Tue Mar 20 00:01:55 2012
@@ -1,6 +1,5 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 1997, 1999, 2003, 2004, 2005, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -26,19 +25,9 @@
 int
 feholdexcept (fenv_t *envp)
 {
-  fenv_t temp;
-
-  /* Store the environment.  */
-  __asm__ ("fnstenv %0" : "=m" (temp));
-  *envp = temp;
-
-  /* Now set all exceptions to non-stop.  */
-  temp.__control_word |= 0x3f;
-
-  /* And clear all exceptions.  */
-  temp.__status_word &= ~0x3f;
-
-  __asm__ ("fldenv %0" : : "m" (temp));
+  /* Store the environment.  Recall that fnstenv has a side effect of
+     masking all exceptions.  Then clear all exceptions.  */
+  __asm__ volatile ("fnstenv %0; fnclex" : "=m" (*envp));
 
   /* If the CPU supports SSE we set the MXCSR as well.  */
   if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)

Added: fsf/trunk/libc/sysdeps/i386/fpu/fenv_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/fenv_private.h (added)
+++ fsf/trunk/libc/sysdeps/i386/fpu/fenv_private.h Tue Mar 20 00:01:55 2012
@@ -1,0 +1,304 @@
+#ifndef FENV_PRIVATE_H
+#define FENV_PRIVATE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+#ifdef __SSE2_MATH__
+# define math_opt_barrier(x) \
+  ({ __typeof(x) __x;					\
+     if (sizeof (x) <= sizeof (double))			\
+       __asm ("" : "=x" (__x) : "0" (x));		\
+     else						\
+       __asm ("" : "=t" (__x) : "0" (x));		\
+     __x; })
+# define math_force_eval(x) \
+  do {							\
+    if (sizeof (x) <= sizeof (double))			\
+      __asm __volatile ("" : : "x" (x));		\
+    else						\
+      __asm __volatile ("" : : "f" (x));		\
+  } while (0)
+#else
+# define math_opt_barrier(x) \
+  ({ __typeof (x) __x;					\
+     __asm ("" : "=t" (__x) : "0" (x));			\
+     __x; })
+# define math_force_eval(x) \
+  do {							\
+    __typeof (x) __x = (x);				\
+    if (sizeof (x) <= sizeof (double))			\
+      __asm __volatile ("" : : "m" (__x));		\
+    else						\
+      __asm __volatile ("" : : "f" (__x));		\
+  } while (0)
+#endif
+
+/* This file is used by both the 32- and 64-bit ports.  The 64-bit port
+   has a field in the fenv_t for the mxcsr; the 32-bit port does not.
+   Instead, we (ab)use the only 32-bit field extant in the struct.  */
+#ifndef __x86_64__
+# define __mxcsr	__eip
+#endif
+
+
+/* All of these functions are private to libm, and are all used in pairs
+   to save+change the fp state and restore the original state.  Thus we
+   need not care for both the 387 and the sse unit, only the one we're
+   actually using.  */
+
+#if defined __AVX__ || defined SSE2AVX
+# define STMXCSR "vstmxcsr"
+# define LDMXCSR "vldmxcsr"
+#else
+# define STMXCSR "stmxcsr"
+# define LDMXCSR "ldmxcsr"
+#endif
+
+static __always_inline void
+libc_feholdexcept_sse (fenv_t *e)
+{
+  unsigned int mxcsr;
+  asm (STMXCSR " %0" : "=m" (*&mxcsr));
+  e->__mxcsr = mxcsr;
+  mxcsr = (mxcsr | 0x1f80) & ~0x3f;
+  asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+static __always_inline void
+libc_feholdexcept_387 (fenv_t *e)
+{
+  /* Recall that fnstenv has a side-effect of masking exceptions.
+     Clobber all of the fp registers so that the TOS field is 0.  */
+  asm volatile ("fnstenv %0; fnclex"
+		: "=m"(*e)
+		: : "st", "st(1)", "st(2)", "st(3)",
+		    "st(4)", "st(5)", "st(6)", "st(7)");
+}
+
+static __always_inline void
+libc_feholdexcept_setround_sse (fenv_t *e, int r)
+{
+  unsigned int mxcsr;
+  asm (STMXCSR " %0" : "=m" (*&mxcsr));
+  e->__mxcsr = mxcsr;
+  mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | (r << 3);
+  asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+/* Set both rounding mode and precision.  A convenience function for use
+   by libc_feholdexcept_setround and libc_feholdexcept_setround_53bit. */
+static __always_inline void
+libc_feholdexcept_setround_387_prec (fenv_t *e, int r)
+{
+  libc_feholdexcept_387 (e);
+
+  fpu_control_t cw = e->__control_word;
+  cw &= ~(_FPU_RC_ZERO | _FPU_EXTENDED);
+  cw |= r | 0x3f;
+  _FPU_SETCW (cw);
+}
+
+static __always_inline void
+libc_feholdexcept_setround_387 (fenv_t *e, int r)
+{
+  libc_feholdexcept_setround_387_prec (e, r | _FPU_EXTENDED);
+}
+
+static __always_inline void
+libc_feholdexcept_setround_387_53bit (fenv_t *e, int r)
+{
+  libc_feholdexcept_setround_387_prec (e, r | _FPU_DOUBLE);
+}
+
+static __always_inline int
+libc_fetestexcept_sse (int e)
+{
+  unsigned int mxcsr;
+  asm volatile (STMXCSR " %0" : "=m" (*&mxcsr));
+  return mxcsr & e & FE_ALL_EXCEPT;
+}
+
+static __always_inline int
+libc_fetestexcept_387 (int ex)
+{
+  fexcept_t temp;
+  asm volatile ("fnstsw %0" : "=a" (temp));
+  return temp & ex & FE_ALL_EXCEPT;
+}
+
+static __always_inline void
+libc_fesetenv_sse (fenv_t *e)
+{
+  asm volatile (LDMXCSR " %0" : : "m" (e->__mxcsr));
+}
+
+static __always_inline void
+libc_fesetenv_387 (fenv_t *e)
+{
+  /* Clobber all fp registers so that the TOS value we saved earlier is
+     compatible with the current state of the compiler.  */
+  asm volatile ("fldenv %0"
+		: : "m" (*e)
+		: "st", "st(1)", "st(2)", "st(3)",
+		  "st(4)", "st(5)", "st(6)", "st(7)");
+}
+
+static __always_inline int
+libc_feupdateenv_test_sse (fenv_t *e, int ex)
+{
+  unsigned int mxcsr, old_mxcsr, cur_ex;
+  asm volatile (STMXCSR " %0" : "=m" (*&mxcsr));
+  cur_ex = mxcsr & FE_ALL_EXCEPT;
+
+  /* Merge current exceptions with the old environment.  */
+  old_mxcsr = e->__mxcsr;
+  mxcsr = old_mxcsr | cur_ex;
+  asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+
+  /* Raise SIGFPE for any new exceptions since the hold.  Expect that
+     the normal environment has all exceptions masked.  */
+  if (__builtin_expect ((old_mxcsr >> 7) & cur_ex, 0))
+    __feraiseexcept (cur_ex);
+
+  /* Test for exceptions raised since the hold.  */
+  return cur_ex & ex;
+}
+
+static __always_inline int
+libc_feupdateenv_test_387 (fenv_t *e, int ex)
+{
+  fexcept_t cur_ex;
+
+  /* Save current exceptions.  */
+  asm volatile ("fnstsw %0" : "=a" (cur_ex));
+  cur_ex &= FE_ALL_EXCEPT;
+
+  /* Reload original environment.  */
+  libc_fesetenv_387 (e);
+
+  /* Merge current exceptions.  */
+  __feraiseexcept (cur_ex);
+
+  /* Test for exceptions raised since the hold.  */
+  return cur_ex & ex;
+}
+
+static __always_inline void
+libc_feupdateenv_sse (fenv_t *e)
+{
+  libc_feupdateenv_test_sse (e, 0);
+}
+
+static __always_inline void
+libc_feupdateenv_387 (fenv_t *e)
+{
+  libc_feupdateenv_test_387 (e, 0);
+}
+
+static __always_inline void
+libc_feholdsetround_sse (fenv_t *e, int r)
+{
+  unsigned int mxcsr;
+  asm (STMXCSR " %0" : "=m" (*&mxcsr));
+  e->__mxcsr = mxcsr;
+  mxcsr = (mxcsr & ~0x6000) | (r << 3);
+  asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+static __always_inline void
+libc_feholdsetround_387_prec (fenv_t *e, int r)
+{
+  fpu_control_t cw;
+
+  _FPU_GETCW (cw);
+  e->__control_word = cw;
+  cw &= ~(_FPU_RC_ZERO | _FPU_EXTENDED);
+  cw |= r;
+  _FPU_SETCW (cw);
+}
+
+static __always_inline void
+libc_feholdsetround_387 (fenv_t *e, int r)
+{
+  libc_feholdsetround_387_prec (e, r | _FPU_EXTENDED);
+}
+
+static __always_inline void
+libc_feholdsetround_387_53bit (fenv_t *e, int r)
+{
+  libc_feholdsetround_387_prec (e, r | _FPU_DOUBLE);
+}
+
+static __always_inline void
+libc_feresetround_sse (fenv_t *e)
+{
+  unsigned int mxcsr;
+  asm (STMXCSR " %0" : "=m" (*&mxcsr));
+  mxcsr = (mxcsr & ~0x6000) | (e->__mxcsr & 0x6000);
+  asm volatile (LDMXCSR " %0" : : "m" (*&mxcsr));
+}
+
+static __always_inline void
+libc_feresetround_387 (fenv_t *e)
+{
+  _FPU_SETCW (e->__control_word);
+}
+
+#ifdef __SSE_MATH__
+# define libc_feholdexceptf		libc_feholdexcept_sse
+# define libc_feholdexcept_setroundf	libc_feholdexcept_setround_sse
+# define libc_fetestexceptf		libc_fetestexcept_sse
+# define libc_fesetenvf			libc_fesetenv_sse
+# define libc_feupdateenv_testf		libc_feupdateenv_test_sse
+# define libc_feupdateenvf		libc_feupdateenv_sse
+# define libc_feholdsetroundf		libc_feholdsetround_sse
+# define libc_feresetroundf		libc_feresetround_sse
+#else
+# define libc_feholdexceptf		libc_feholdexcept_387
+# define libc_feholdexcept_setroundf	libc_feholdexcept_setround_387
+# define libc_fetestexceptf		libc_fetestexcept_387
+# define libc_fesetenvf			libc_fesetenv_387
+# define libc_feupdateenv_testf		libc_feupdateenv_test_387
+# define libc_feupdateenvf		libc_feupdateenv_387
+# define libc_feholdsetroundf		libc_feholdsetround_387
+# define libc_feresetroundf		libc_feresetround_387
+#endif /* __SSE_MATH__ */
+
+#ifdef __SSE2_MATH__
+# define libc_feholdexcept		libc_feholdexcept_sse
+# define libc_feholdexcept_setround	libc_feholdexcept_setround_sse
+# define libc_fetestexcept		libc_fetestexcept_sse
+# define libc_fesetenv			libc_fesetenv_sse
+# define libc_feupdateenv_test		libc_feupdateenv_test_sse
+# define libc_feupdateenv		libc_feupdateenv_sse
+# define libc_feholdsetround		libc_feholdsetround_sse
+# define libc_feresetround		libc_feresetround_sse
+#else
+# define libc_feholdexcept		libc_feholdexcept_387
+# define libc_feholdexcept_setround	libc_feholdexcept_setround_387
+# define libc_fetestexcept		libc_fetestexcept_387
+# define libc_fesetenv			libc_fesetenv_387
+# define libc_feupdateenv_test		libc_feupdateenv_test_387
+# define libc_feupdateenv		libc_feupdateenv_387
+# define libc_feholdsetround		libc_feholdsetround_387
+# define libc_feresetround		libc_feresetround_387
+#endif /* __SSE2_MATH__ */
+
+#define libc_feholdexceptl		libc_feholdexcept_387
+#define libc_feholdexcept_setroundl	libc_feholdexcept_setround_387
+#define libc_fetestexceptl		libc_fetestexcept_387
+#define libc_fesetenvl			libc_fesetenv_387
+#define libc_feupdateenv_testl		libc_feupdateenv_test_387
+#define libc_feupdateenvl		libc_feupdateenv_387
+#define libc_feholdsetroundl		libc_feholdsetround_387
+#define libc_feresetroundl		libc_feresetround_387
+
+#ifndef __SSE2_MATH__
+# define libc_feholdexcept_setround_53bit libc_feholdexcept_setround_387_53bit
+# define libc_feholdsetround_53bit	libc_feholdsetround_387_53bit
+#endif
+
+#undef __mxcsr
+
+#endif /* FENV_PRIVATE_H */

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 Tue Mar 20 00:01:55 2012
@@ -447,6 +447,21 @@
 ifloat: 1
 ildouble: 1
 ldouble: 1
+Test "Real part of: clog (0x1.fffffep+127 + 0x1.fffffep+127 i) == 89.06941264234832570836679262104313101776 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1p+16383 i) == 11356.60974243783798653123798337822335902 + 0.4764674194737066993385333770295162295856 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-149 + 0x1p-149 i) == -102.9323563131518784484589700365392203592 + pi/4 i":
+ildouble: 1
+ldouble: 1
 
 # clog10
 Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -512,6 +527,51 @@
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 308.4052305577487344482591243175787477115 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.fffffffffffffp+1023 + 0x1p+1023 i) == 308.3031705664207720674749211936626341569 + 0.2013595981366865903254995612594728746470 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1.fp+16383 i) == 4932.212175672014259683102930239951947672 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-16440 + 0x1p-16441 i) == -4948.884673709346821106688037612752099609 + 0.2013595981366865710389502301937289472543 i":
 ildouble: 1
 ldouble: 1
 Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":

Modified: fsf/trunk/libc/sysdeps/i386/fpu/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/math_private.h (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/math_private.h Tue Mar 20 00:01:55 2012
@@ -1,48 +1,6 @@
 #ifndef _MATH_PRIVATE_H
 
-#define math_opt_barrier(x) \
-({ __typeof (x) __x;					\
-   __asm ("" : "=t" (__x) : "0" (x));			\
-   __x; })
-#define math_force_eval(x) \
-do							\
-  {							\
-    __typeof (x) __x = (x);				\
-    if (sizeof (x) <= sizeof (double))			\
-      __asm __volatile ("" : : "m" (__x));		\
-    else						\
-      __asm __volatile ("" : : "f" (__x));		\
-  }							\
-while (0)
-
+#include "fenv_private.h"
 #include_next <math_private.h>
 
-#include <fpu_control.h>
-
-#undef libc_feholdexcept_setround_53bit
-#define libc_feholdexcept_setround_53bit(e, r)	\
-  do						\
-    {						\
-      fpu_control_t cw;				\
-      libc_feholdexcept_setround (e, r);	\
-      _FPU_GETCW (cw);				\
-      cw &= ~(fpu_control_t) _FPU_EXTENDED;	\
-      cw |= _FPU_DOUBLE;			\
-      _FPU_SETCW (cw);				\
-    }						\
-  while (0)
-
-#undef libc_feupdateenv_53bit
-#define libc_feupdateenv_53bit(e)		\
-  do						\
-    {						\
-      fpu_control_t cw;				\
-      libc_feupdateenv (e);			\
-      _FPU_GETCW (cw);				\
-      cw &= ~(fpu_control_t) _FPU_EXTENDED;	\
-      cw |= _FPU_EXTENDED;			\
-      _FPU_SETCW (cw);				\
-    }						\
-  while (0)
-
 #endif

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c Tue Mar 20 00:01:55 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
@@ -153,6 +153,13 @@
   /* if either x or y is extremely close to zero, scale abs(x), abs(y). */
   if (ax<twom500.d || ay<twom500.d) { ax*=two500.d;  ay*=two500.d; }
 
+  /* Likewise for large x and y.  */
+  if (ax > two500.d || ay > two500.d)
+    {
+      ax *= twom500.d;
+      ay *= twom500.d;
+    }
+
   /* x,y which are neither special nor extreme */
   if (ay<ax) {
     u=ay/ax;

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 Tue Mar 20 00:01:55 2012
@@ -59,10 +59,9 @@
   int4 k;
 #endif
   int4 i,j,m,n,ex;
-  fenv_t env;
   double retval;
 
-  libc_feholdexcept_setround (&env, FE_TONEAREST);
+  SET_RESTORE_ROUND (FE_TONEAREST);
 
   junk1.x = x;
   m = junk1.i[HIGH_HALF];
@@ -157,7 +156,6 @@
     else { retval = __slowexp(x); goto ret; }
   }
  ret:
-  libc_feupdateenv (&env);
   return retval;
 }
 #ifndef __ieee754_exp

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp2.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp2.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_exp2.c Tue Mar 20 00:01:55 2012
@@ -61,57 +61,56 @@
       int tval, unsafe;
       double rx, x22, result;
       union ieee754_double ex2_u, scale_u;
-      fenv_t oldenv;
 
-      libc_feholdexcept_setround (&oldenv, FE_TONEAREST);
+      {
+	SET_RESTORE_ROUND_NOEX (FE_TONEAREST);
 
-      /* 1. Argument reduction.
-	 Choose integers ex, -256 <= t < 256, and some real
-	 -1/1024 <= x1 <= 1024 so that
-	 x = ex + t/512 + x1.
+	/* 1. Argument reduction.
+	   Choose integers ex, -256 <= t < 256, and some real
+	   -1/1024 <= x1 <= 1024 so that
+	   x = ex + t/512 + x1.
 
-	 First, calculate rx = ex + t/512.  */
-      rx = x + THREEp42;
-      rx -= THREEp42;
-      x -= rx;  /* Compute x=x1. */
-      /* Compute tval = (ex*512 + t)+256.
-	 Now, t = (tval mod 512)-256 and ex=tval/512  [that's mod, NOT %; and
-	 /-round-to-nearest not the usual c integer /].  */
-      tval = (int) (rx * 512.0 + 256.0);
+	   First, calculate rx = ex + t/512.  */
+	rx = x + THREEp42;
+	rx -= THREEp42;
+	x -= rx;  /* Compute x=x1. */
+	/* Compute tval = (ex*512 + t)+256.
+	   Now, t = (tval mod 512)-256 and ex=tval/512  [that's mod, NOT %;
+	   and /-round-to-nearest not the usual c integer /].  */
+	tval = (int) (rx * 512.0 + 256.0);
 
-      /* 2. Adjust for accurate table entry.
-	 Find e so that
-	 x = ex + t/512 + e + x2
-	 where -1e6 < e < 1e6, and
-	 (double)(2^(t/512+e))
-	 is accurate to one part in 2^-64.  */
+	/* 2. Adjust for accurate table entry.
+	   Find e so that
+	   x = ex + t/512 + e + x2
+	   where -1e6 < e < 1e6, and
+	   (double)(2^(t/512+e))
+	   is accurate to one part in 2^-64.  */
 
-      /* 'tval & 511' is the same as 'tval%512' except that it's always
-	 positive.
-	 Compute x = x2.  */
-      x -= exp2_deltatable[tval & 511];
+	/* 'tval & 511' is the same as 'tval%512' except that it's always
+	   positive.
+	   Compute x = x2.  */
+	x -= exp2_deltatable[tval & 511];
 
-      /* 3. Compute ex2 = 2^(t/512+e+ex).  */
-      ex2_u.d = exp2_accuratetable[tval & 511];
-      tval >>= 9;
-      unsafe = abs(tval) >= -DBL_MIN_EXP - 1;
-      ex2_u.ieee.exponent += tval >> unsafe;
-      scale_u.d = 1.0;
-      scale_u.ieee.exponent += tval - (tval >> unsafe);
+	/* 3. Compute ex2 = 2^(t/512+e+ex).  */
+	ex2_u.d = exp2_accuratetable[tval & 511];
+	tval >>= 9;
+	unsafe = abs(tval) >= -DBL_MIN_EXP - 1;
+	ex2_u.ieee.exponent += tval >> unsafe;
+	scale_u.d = 1.0;
+	scale_u.ieee.exponent += tval - (tval >> unsafe);
 
-      /* 4. Approximate 2^x2 - 1, using a fourth-degree polynomial,
-	 with maximum error in [-2^-10-2^-30,2^-10+2^-30]
-	 less than 10^-19.  */
+	/* 4. Approximate 2^x2 - 1, using a fourth-degree polynomial,
+	   with maximum error in [-2^-10-2^-30,2^-10+2^-30]
+	   less than 10^-19.  */
 
-      x22 = (((.0096181293647031180
-	       * x + .055504110254308625)
-	      * x + .240226506959100583)
-	     * x + .69314718055994495) * ex2_u.d;
-      math_opt_barrier (x22);
+	x22 = (((.0096181293647031180
+		 * x + .055504110254308625)
+		* x + .240226506959100583)
+	       * x + .69314718055994495) * ex2_u.d;
+        math_opt_barrier (x22);
+      }
 
       /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex).  */
-      libc_fesetenv (&oldenv);
-
       result = x22 * x + ex2_u.d;
 
       if (!unsafe)

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c Tue Mar 20 00:01:55 2012
@@ -85,10 +85,9 @@
        (u.i[HIGH_HALF]==0 && u.i[LOW_HALF]!=0))  &&
 				      /*   2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
       (v.i[HIGH_HALF]&0x7fffffff) < 0x4ff00000) {              /* if y<-1 or y>1   */
-    fenv_t env;
     double retval;
 
-    libc_feholdexcept_setround (&env, FE_TONEAREST);
+    SET_RESTORE_ROUND (FE_TONEAREST);
 
     z = log1(x,&aa,&error);                                 /* x^y  =e^(y log (X)) */
     t = y*134217729.0;
@@ -105,7 +104,6 @@
     t = __exp1(a1,a2,1.9e16*error);     /* return -10 or 0 if wasn't computed exactly */
     retval = (t>0)?t:power1(x,y);
 
-    libc_feupdateenv (&env);
     return retval;
   }
 

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fma.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fma.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fma.c Tue Mar 20 00:01:55 2012
@@ -149,35 +149,36 @@
 
   fenv_t env;
   libc_feholdexcept_setround (&env, FE_TOWARDZERO);
+
   /* Perform m2 + a2 addition with round to odd.  */
   u.d = a2 + m2;
 
-  if (__builtin_expect (adjust == 0, 1))
-    {
-      if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
-	u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
-      libc_feupdateenv (&env);
-      /* Result is a1 + u.d.  */
-      return a1 + u.d;
-    }
-  else if (__builtin_expect (adjust > 0, 1))
-    {
-      if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
-	u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
-      libc_feupdateenv (&env);
-      /* Result is a1 + u.d, scaled up.  */
-      return (a1 + u.d) * 0x1p53;
-    }
-  else
+  if (__builtin_expect (adjust < 0, 0))
     {
       if ((u.ieee.mantissa1 & 1) == 0)
 	u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
       v.d = a1 + u.d;
-      int j = libc_fetestexcept (FE_INEXACT) != 0;
-      libc_feupdateenv (&env);
-      /* Ensure the following computations are performed in default rounding
-	 mode instead of just reusing the round to zero computation.  */
-      asm volatile ("" : "=m" (u) : "m" (u));
+    }
+
+  /* Reset rounding mode and test for inexact simultaneously.  */
+  int j = libc_feupdateenv_test (&env, FE_INEXACT) != 0;
+
+  if (__builtin_expect (adjust == 0, 1))
+    {
+      if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
+	u.ieee.mantissa1 |= j;
+      /* Result is a1 + u.d.  */
+      return a1 + u.d;
+    }
+  else if (__builtin_expect (adjust > 0, 1))
+    {
+      if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
+	u.ieee.mantissa1 |= j;
+      /* Result is a1 + u.d, scaled up.  */
+      return (a1 + u.d) * 0x1p53;
+    }
+  else
+    {
       /* If a1 + u.d is exact, the only rounding happens during
 	 scaling down.  */
       if (j == 0)

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.c Tue Mar 20 00:01:55 2012
@@ -35,12 +35,18 @@
   /* Multiplication is always exact.  */
   double temp = (double) x * (double) y;
   union ieee754_double u;
-  libc_feholdexcept_setroundf (&env, FE_TOWARDZERO);
+
+  libc_feholdexcept_setround (&env, FE_TOWARDZERO);
+
   /* Perform addition with round to odd.  */
   u.d = temp + (double) z;
+
+  /* Reset rounding mode and test for inexact simultaneously.  */
+  int j = libc_feupdateenv_test (&env, FE_INEXACT) != 0;
+
   if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
-    u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
-  libc_feupdateenv (&env);
+    u.ieee.mantissa1 |= j;
+
   /* And finally truncation with round to nearest.  */
   return (float) u.d;
 }

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 Tue Mar 20 00:01:55 2012
@@ -108,10 +108,9 @@
 #if 0
 	int4 nn;
 #endif
-	fenv_t env;
 	double retval = 0;
 
-	libc_feholdexcept_setround_53bit (&env, FE_TONEAREST);
+	SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
 
 	u.x = x;
 	m = u.i[HIGH_HALF];
@@ -365,7 +364,6 @@
 	}
 
  ret:
-	libc_feupdateenv_53bit (&env);
 	return retval;
 }
 
@@ -383,10 +381,9 @@
   mynumber u,v;
   int4 k,m,n;
 
-  fenv_t env;
   double retval = 0;
 
-  libc_feholdexcept_setround_53bit (&env, FE_TONEAREST);
+  SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
 
   u.x = x;
   m = u.i[HIGH_HALF];
@@ -635,7 +632,6 @@
   }
 
  ret:
-  libc_feupdateenv_53bit (&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 Tue Mar 20 00:01:55 2012
@@ -68,13 +68,12 @@
   mp_no mpy;
 #endif
 
-  fenv_t env;
   double retval;
 
   int __branred(double, double *, double *);
   int __mpranred(double, mp_no *, int);
 
-  libc_feholdexcept_setround_53bit (&env, FE_TONEAREST);
+  SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
 
   /* x=+-INF, x=NaN */
   num.d = x;  ux = num.i[HIGH_HALF];
@@ -503,7 +502,6 @@
   goto ret;
 
  ret:
-  libc_feupdateenv_53bit (&env);
   return retval;
 }
 

Added: fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h (added)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h Tue Mar 20 00:01:55 2012
@@ -1,0 +1,35 @@
+#ifndef _MATH_PRIVATE_H_
+
+#include_next <math_private.h>
+
+#ifndef __isnan
+extern __always_inline int
+__isnan (double d)
+{
+  uint64_t di;
+  EXTRACT_WORDS64 (di, d);
+  return (di & 0x7fffffffffffffffull) > 0x7ff0000000000000ull;
+}
+#endif
+
+#ifndef __isinf_ns
+extern __always_inline int
+__isinf_ns (double d)
+{
+  uint64_t di;
+  EXTRACT_WORDS64 (di, d);
+  return (di & 0x7fffffffffffffffull) == 0x7ff0000000000000ull;
+}
+#endif
+
+#ifndef __finite
+extern __always_inline int
+__finite (double d)
+{
+  uint64_t di;
+  EXTRACT_WORDS64 (di, d);
+  return (di & 0x7fffffffffffffffull) < 0x7ff0000000000000ull;
+}
+#endif
+
+#endif /* _MATH_PRIVATE_H_ */

Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/e_exp2f.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/e_exp2f.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/e_exp2f.c Tue Mar 20 00:01:55 2012
@@ -54,53 +54,52 @@
       int tval, unsafe;
       float rx, x22, result;
       union ieee754_float ex2_u, scale_u;
-      fenv_t oldenv;
 
-      libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
+      {
+	SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
 
-      /* 1. Argument reduction.
-	 Choose integers ex, -128 <= t < 128, and some real
-	 -1/512 <= x1 <= 1/512 so that
-	 x = ex + t/512 + x1.
+	/* 1. Argument reduction.
+	   Choose integers ex, -128 <= t < 128, and some real
+	   -1/512 <= x1 <= 1/512 so that
+	   x = ex + t/512 + x1.
 
-	 First, calculate rx = ex + t/256.  */
-      rx = x + THREEp14;
-      rx -= THREEp14;
-      x -= rx;  /* Compute x=x1. */
-      /* Compute tval = (ex*256 + t)+128.
-	 Now, t = (tval mod 256)-128 and ex=tval/256  [that's mod, NOT %; and
-	 /-round-to-nearest not the usual c integer /].  */
-      tval = (int) (rx * 256.0f + 128.0f);
+	   First, calculate rx = ex + t/256.  */
+	rx = x + THREEp14;
+	rx -= THREEp14;
+	x -= rx;  /* Compute x=x1. */
+	/* Compute tval = (ex*256 + t)+128.
+	   Now, t = (tval mod 256)-128 and ex=tval/256  [that's mod, NOT %;
+	   and /-round-to-nearest not the usual c integer /].  */
+	tval = (int) (rx * 256.0f + 128.0f);
 
-      /* 2. Adjust for accurate table entry.
-	 Find e so that
-	 x = ex + t/256 + e + x2
-	 where -7e-4 < e < 7e-4, and
-	 (float)(2^(t/256+e))
-	 is accurate to one part in 2^-64.  */
+	/* 2. Adjust for accurate table entry.
+	   Find e so that
+	   x = ex + t/256 + e + x2
+	   where -7e-4 < e < 7e-4, and
+	   (float)(2^(t/256+e))
+	   is accurate to one part in 2^-64.  */
 
-      /* 'tval & 255' is the same as 'tval%256' except that it's always
-	 positive.
-	 Compute x = x2.  */
-      x -= __exp2f_deltatable[tval & 255];
+	/* 'tval & 255' is the same as 'tval%256' except that it's always
+	   positive.
+	   Compute x = x2.  */
+	x -= __exp2f_deltatable[tval & 255];
 
-      /* 3. Compute ex2 = 2^(t/255+e+ex).  */
-      ex2_u.f = __exp2f_atable[tval & 255];
-      tval >>= 8;
-      unsafe = abs(tval) >= -FLT_MIN_EXP - 1;
-      ex2_u.ieee.exponent += tval >> unsafe;
-      scale_u.f = 1.0;
-      scale_u.ieee.exponent += tval - (tval >> unsafe);
+	/* 3. Compute ex2 = 2^(t/255+e+ex).  */
+	ex2_u.f = __exp2f_atable[tval & 255];
+	tval >>= 8;
+	unsafe = abs(tval) >= -FLT_MIN_EXP - 1;
+	ex2_u.ieee.exponent += tval >> unsafe;
+	scale_u.f = 1.0;
+	scale_u.ieee.exponent += tval - (tval >> unsafe);
 
-      /* 4. Approximate 2^x2 - 1, using a second-degree polynomial,
-	 with maximum error in [-2^-9 - 2^-14, 2^-9 + 2^-14]
-	 less than 1.3e-10.  */
+	/* 4. Approximate 2^x2 - 1, using a second-degree polynomial,
+	   with maximum error in [-2^-9 - 2^-14, 2^-9 + 2^-14]
+	   less than 1.3e-10.  */
 
-      x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
+	x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
+      }
 
       /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex).  */
-      libc_fesetenv (&oldenv);
-
       result = x22 * x + ex2_u.f;
 
       if (!unsafe)

Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/e_expf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/e_expf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/e_expf.c Tue Mar 20 00:01:55 2012
@@ -80,40 +80,39 @@
       double x22, t, result, dx;
       float n, delta;
       union ieee754_double ex2_u;
-      fenv_t oldenv;
 
-      libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
+      {
+	SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
 
-      /* Calculate n.  */
-      n = x * M_1_LN2 + THREEp22;
-      n -= THREEp22;
-      dx = x - n*M_LN2;
+	/* Calculate n.  */
+	n = x * M_1_LN2 + THREEp22;
+	n -= THREEp22;
+	dx = x - n*M_LN2;
 
-      /* Calculate t/512.  */
-      t = dx + THREEp42;
-      t -= THREEp42;
-      dx -= t;
+	/* Calculate t/512.  */
+	t = dx + THREEp42;
+	t -= THREEp42;
+	dx -= t;
 
-      /* Compute tval = t.  */
-      tval = (int) (t * 512.0);
+	/* Compute tval = t.  */
+	tval = (int) (t * 512.0);
 
-      if (t >= 0)
-	delta = - __exp_deltatable[tval];
-      else
-	delta = __exp_deltatable[-tval];
+	if (t >= 0)
+	  delta = - __exp_deltatable[tval];
+	else
+	  delta = __exp_deltatable[-tval];
 
-      /* Compute ex2 = 2^n e^(t/512+delta[t]).  */
-      ex2_u.d = __exp_atable[tval+177];
-      ex2_u.ieee.exponent += (int) n;
+	/* Compute ex2 = 2^n e^(t/512+delta[t]).  */
+	ex2_u.d = __exp_atable[tval+177];
+	ex2_u.ieee.exponent += (int) n;
 
-      /* Approximate e^(dx+delta) - 1, using a second-degree polynomial,
-	 with maximum error in [-2^-10-2^-28,2^-10+2^-28]
-	 less than 5e-11.  */
-      x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
+	/* Approximate e^(dx+delta) - 1, using a second-degree polynomial,
+	   with maximum error in [-2^-10-2^-28,2^-10+2^-28]
+	   less than 5e-11.  */
+	x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
+      }
 
       /* Return result.  */
-      libc_fesetenvf (&oldenv);
-
       result = x22 * ex2_u.d + ex2_u.d;
       return (float) result;
     }

Added: fsf/trunk/libc/sysdeps/ieee754/flt-32/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/math_private.h (added)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/math_private.h Tue Mar 20 00:01:55 2012
@@ -1,0 +1,35 @@
+#ifndef _MATH_PRIVATE_H_
+
+#include_next <math_private.h>
+
+#ifndef __isnanf
+extern __always_inline int
+__isnanf (float d)
+{
+  u_int32_t di;
+  GET_FLOAT_WORD (di, d);
+  return (di & 0x7fffffff) > 0x7f800000;
+}
+#endif
+
+#ifndef __isinf_nsf
+extern __always_inline int
+__isinf_nsf (float d)
+{
+  u_int32_t di;
+  GET_FLOAT_WORD (di, d);
+  return (di & 0x7fffffff) == 0x7f800000;
+}
+#endif
+
+#ifndef __finitef
+extern __always_inline int
+__finitef (float d)
+{
+  u_int32_t di;
+  GET_FLOAT_WORD (di, d);
+  return (di & 0x7fffffff) < 0x7f800000;
+}
+#endif
+
+#endif /* _MATH_PRIVATE_H_ */

Added: fsf/trunk/libc/sysdeps/sparc/fpu/fenv_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/fpu/fenv_private.h (added)
+++ fsf/trunk/libc/sysdeps/sparc/fpu/fenv_private.h Tue Mar 20 00:01:55 2012
@@ -1,0 +1,106 @@
+#ifndef FENV_PRIVATE_H
+#define FENV_PRIVATE_H 1
+
+#include <fenv.h>
+
+static __always_inline void
+libc_feholdexcept (fenv_t *e)
+{
+  fenv_t etmp;
+  __fenv_stfsr(etmp);
+  *(e) = etmp;
+  etmp = etmp & ~((0x1f << 23) | FE_ALL_EXCEPT);
+  __fenv_ldfsr(etmp);
+}
+
+static __always_inline void
+libc_feholdexcept_setround (fenv_t *e, int r)
+{
+  fenv_t etmp;
+  __fenv_stfsr(etmp);
+  *(e) = etmp;
+  etmp = etmp & ~((0x1f << 23) | FE_ALL_EXCEPT);
+  etmp = (etmp & ~__FE_ROUND_MASK) | (r);
+  __fenv_ldfsr(etmp);
+}
+
+static __always_inline int
+libc_fetestexcept (int e)
+{
+  fenv_t etmp;
+  __fenv_stfsr(etmp);
+  return etmp & (e) & FE_ALL_EXCEPT;
+}
+
+static __always_inline void
+libc_fesetenv (fenv_t *e)
+{
+  __fenv_ldfsr(*e);
+}
+
+static __always_inline int
+libc_feupdateenv_test (fenv_t *e, int ex)
+{
+  fenv_t etmp;
+
+  __fenv_stfsr(etmp);
+  etmp &= FE_ALL_EXCEPT;
+
+  __fenv_ldfsr(*e);
+
+  __feraiseexcept (etmp);
+
+  return etmp & ex;
+}
+
+static __always_inline void
+libc_feupdateenv (fenv_t *e)
+{
+  libc_feupdateenv_test (e, 0);
+}
+
+static __always_inline void
+libc_feholdsetround (fenv_t *e, int r)
+{
+  fenv_t etmp;
+  __fenv_stfsr(etmp);
+  *(e) = etmp;
+  etmp = (etmp & ~__FE_ROUND_MASK) | (r);
+  __fenv_ldfsr(etmp);
+}
+
+static __always_inline void
+libc_feresetround (fenv_t *e)
+{
+  fenv_t etmp;
+  __fenv_stfsr(etmp);
+  etmp = (etmp & ~__FE_ROUND_MASK) | (*e & __FE_ROUND_MASK);
+  __fenv_ldfsr(etmp);
+}
+
+#define libc_feholdexceptf		libc_feholdexcept
+#define libc_feholdexcept_setroundf	libc_feholdexcept_setround
+#define libc_fetestexceptf		libc_fetestexcept
+#define libc_fesetenvf			libc_fesetenv
+#define libc_feupdateenv_testf		libc_feupdateenv_test
+#define libc_feupdateenvf		libc_feupdateenv
+#define libc_feholdsetroundf		libc_feholdsetround
+#define libc_feresetroundf		libc_feresetround
+#define libc_feholdexcept		libc_feholdexcept
+#define libc_feholdexcept_setround	libc_feholdexcept_setround
+#define libc_fetestexcept		libc_fetestexcept
+#define libc_fesetenv			libc_fesetenv
+#define libc_feupdateenv_test		libc_feupdateenv_test
+#define libc_feupdateenv		libc_feupdateenv
+#define libc_feholdsetround		libc_feholdsetround
+#define libc_feresetround		libc_feresetround
+#define libc_feholdexceptl		libc_feholdexcept
+#define libc_feholdexcept_setroundl	libc_feholdexcept_setround
+#define libc_fetestexceptl		libc_fetestexcept
+#define libc_fesetenvl			libc_fesetenv
+#define libc_feupdateenv_testl		libc_feupdateenv_test
+#define libc_feupdateenvl		libc_feupdateenv
+#define libc_feholdsetroundl		libc_feholdsetround
+#define libc_feresetroundl		libc_feresetround
+
+#endif /* FENV_PRIVATE_H */

Modified: fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps (original)
+++ fsf/trunk/libc/sysdeps/sparc/fpu/libm-test-ulps Tue Mar 20 00:01:55 2012
@@ -546,6 +546,15 @@
 ifloat: 1
 ildouble: 1
 ldouble: 1
+Test "Real part of: clog (0x1.fp+16383 + 0x1.fp+16383 i) == 11356.83823118610934184548269774874545400 + pi/4 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog (0x1p-1074 + 0x1p-1074 i) == -744.0934983311012896593986823853525458290 + pi/4 i":
+double: 1
+idouble: 1
+Test "Real part of: clog (0x1p-147 + 0x1p-147 i) == -101.5460619520319878296245057936228672231 + pi/4 i":
+float: 1
+ifloat: 1
 
 # clog10
 Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
@@ -615,6 +624,42 @@
 Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
 ildouble: 1
 ldouble: 1
+Test "Imaginary part of: clog10 (0x1.fffffep+127 + 0x1.fffffep+127 i) == 38.68235441693561449174780668781319348761 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Real part of: clog10 (0x1.fffffep+127 + 1.0 i) == 38.53183941910362389414093724045094697423 + 1.276276851248440096917018665609900318458e-39 i":
+float: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1.fffffffffffffp+1023 + 0x1.fffffffffffffp+1023 i) == 308.4052305577487344482591243175787477115 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1.fp+16383 i) == 4932.212175672014259683102930239951947672 + pi/4*log10(e) i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: clog10 (0x1.fp+16383 + 0x1p+16383 i) == 4932.112944269463028900262609694408579449 + 0.2069271710841128115912940666587802677383 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: clog10 (0x1p-1073 + 0x1p-1073 i) == -322.8546703496198318667349645920187712089 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Real part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-1074 + 0x1p-1074 i) == -323.1557003452838130619487034867432642357 + pi/4*log10(e) i":
+double: 1
+idouble: 1
+Test "Imaginary part of: clog10 (0x1p-147 + 0x1p-147 i) == -44.10089436477324509881274807713822842154 + pi/4*log10(e) i":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+Test "Imaginary part of: clog10 (0x1p-149 + 0x1p-149 i) == -44.70295435610120748924022586658721447508 + pi/4*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
@@ -1981,13 +2026,17 @@
 ldouble: 1
 
 Function: Real part of "clog":
-float: 1
+double: 1
+float: 1
+idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1
 
 Function: Real part of "clog10":
-float: 1
+double: 1
+float: 1
+idouble: 1
 ifloat: 1
 ildouble: 1
 ldouble: 1

Modified: fsf/trunk/libc/sysdeps/sparc/fpu/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/fpu/math_private.h (original)
+++ fsf/trunk/libc/sysdeps/sparc/fpu/math_private.h Tue Mar 20 00:01:55 2012
@@ -1,68 +1,7 @@
 #ifndef SPARC_MATH_PRIVATE_H
 #define SPARC_MATH_PRIVATE_H 1
 
+#include "fenv_private.h"
 #include_next <math_private.h>
-#include <fenv.h>
-
-#undef libc_feholdexcept
-#define libc_feholdexcept(e) \
-  do {							\
-     fenv_t etmp;					\
-     __fenv_stfsr(etmp);				\
-     *(e) = etmp;					\
-     etmp = etmp & ~((0x1f << 23) | FE_ALL_EXCEPT);	\
-     __fenv_ldfsr(etmp);				\
-  } while (0)
-#undef libc_feholdexceptf
-#define libc_feholdexceptf(e) libc_feholdexcept (e)
-#undef libc_feholdexceptl
-#define libc_feholdexceptl(e) libc_feholdexcept (e)
-
-#undef libc_feholdexcept_setround
-#define libc_feholdexcept_setround(e, r) \
-  do {							\
-     fenv_t etmp;					\
-     __fenv_stfsr(etmp);				\
-     *(e) = etmp;					\
-     etmp = etmp & ~((0x1f << 23) | FE_ALL_EXCEPT);	\
-     etmp = (etmp & ~__FE_ROUND_MASK) | (r);		\
-     __fenv_ldfsr(etmp);				\
-  } while (0)
-#undef libc_feholdexcept_setroundf
-#define libc_feholdexcept_setroundf(e, r) libc_feholdexcept_setround (e, r)
-#undef libc_feholdexcept_setroundl
-#define libc_feholdexcept_setroundl(e, r) libc_feholdexcept_setround (e, r)
-
-#undef libc_fetestexcept
-#define libc_fetestexcept(e) \
-  ({							\
-     fenv_t etmp;					\
-     __fenv_stfsr(etmp);				\
-     etmp & (e) & FE_ALL_EXCEPT; })
-#undef libc_fetestexceptf
-#define libc_fetestexceptf(e) libc_fetestexcept (e)
-#undef libc_fetestexceptl
-#define libc_fetestexceptl(e) libc_fetestexcept (e)
-
-#undef libc_fesetenv
-#define libc_fesetenv(e) \
-  __fenv_ldfsr(*e)
-#undef libc_fesetenvf
-#define libc_fesetenvf(e) libc_fesetenv (e)
-#undef libc_fesetenvl
-#define libc_fesetenvl(e) libc_fesetenv (e)
-
-#undef libc_feupdateenv
-#define libc_feupdateenv(e) \
-  do {						\
-     fenv_t etmp;				\
-     __fenv_stfsr(etmp);			\
-     __fenv_ldfsr(*e);				\
-     __feraiseexcept (etmp & FE_ALL_EXCEPT);	\
-  } while (0)
-#undef libc_feupdateenvf
-#define libc_feupdateenvf(e) libc_feupdateenv (e)
-#undef libc_feupdateenvl
-#define libc_feupdateenvl(e) libc_feupdateenv (e)
 
 #endif /* SPARC_MATH_PRIVATE_H */

Modified: fsf/trunk/libc/sysdeps/unix/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/Makefile (original)
+++ fsf/trunk/libc/sysdeps/unix/Makefile Tue Mar 20 00:01:55 2012
@@ -1,5 +1,4 @@
-# Copyright (C) 1991,1992,1993,1994,1995,1996,1997,1998,1999,2003,2006,2008,2009
-#	Free Software Foundation, Inc.
+# Copyright (C) 1991-2012 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -16,243 +15,6 @@
 # License along with the GNU C Library; if not, see
 # <http://www.gnu.org/licenses/>.
 
-# The unix-specific configure fragment writes `unix-generated' in config.make.
-config-generated := $(config-generated) $(unix-generated)
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
-	$(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/local_lim.h))))))
-
-ifneq (,$(wildcard $(sysincludedir)/sys/param.h))
-mk-local_lim-CFLAGS += -DHAVE_SYS_PARAM_H
-endif
-ifneq (,$(wildcard $(sysincludedir)/sys/limits.h))
-mk-local_lim-CFLAGS += -DHAVE_SYS_LIMITS_H
-endif
-ifneq (,$(wildcard $(sysincludedir)/limits.h))
-mk-local_lim-CFLAGS += -DHAVE_LIMITS_H
-endif
-
-$(common-objpfx)bits/local_lim.h: $(common-objpfx)mk-local_lim
-	$(dir $<)$(notdir $<) > $@-t
-	mv -f $@-t $@
-$(common-objpfx)mk-local_lim: $(sysdep_dir)/unix/mk-local_lim.c
-	$(common-objdir-compile)
-
-before-compile += $(common-objpfx)bits/local_lim.h
-common-generated += bits/local_lim.h mk-local_lim
-
-endif
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
-	$(patsubst %/sys/param.h,%/,\
-		   $(firstword $(wildcard $(+sysdep_dirs:%=%/sys/param.h))))))
-
-before-compile := $(before-compile) $(common-objpfx)sys/param.h
-
-$(common-objpfx)sys/param.h: $(sysincludedir)/sys/param.h
-	$(make-target-directory)
-	(echo '#ifndef _SYS_PARAM_H';	\
-	 echo '#define _SYS_PARAM_H 1';	\
-	 echo '#include <endian.h>';		\
-	 $(AWK) < $<			\
-	   '/^#define[ 	]*NULL/ { print "#ifndef NULL";	\
-				  print $$0;		\
-				  print "#endif";	\
-				  was_null = 1 }	\
-	    { if (!was_null) print $$0;			\
-	      was_null = 0 }';		\
-	 echo '#ifndef MAXHOSTNAMELEN'; \
-	 echo '#define MAXHOSTNAMELEN 64 /* XXX */'; \
-	 echo '#endif /* No MAXHOSTNAMELEN.  */'; \
-	 echo '#endif	/* sys/param.h */') > $@-tmp
-	mv $@-tmp $@
-
-$(common-objpfx)param.h.c: $(sysincludedir)/sys/param.h
-	rm -f $@
-	cp $< $@
-$(common-objpfx)param.h.dep: $(common-objpfx)param.h.c \
-			     $(sysdep_dir)/unix/Makefile
-	$(+mkdep) -I$(sysincludedir) $<			\
-	| sed > $@-t					\
-	      -e 's@$(sysincludedir)/sys/param.h@@'	\
-	      -e 's@^.*:@@'				\
-	      -e 's@$<@@g'				\
-	      -e 's@$(sysincludedir)/*@@g'		\
-	      -e 's@\\$$@@'				\
-	      -e 's@^@sys/param.h-includes := $$(sys/param.h-includes) @'
-	mv $@-t $@
-
-# Get the generated definition of sys/param.h-includes.
-ifndef no_deps
--include $(common-objpfx)param.h.dep
-endif
-
-# Don't preempt our own headers.
-sys/param.h-includes := \
-  $(filter-out $(patsubst $(..)%,%,\
-			  $(wildcard $(addprefix $(..),\
-				     $(sys/param.h-includes)))),\
-	       $(sys/param.h-includes))
-
-
-.PHONY: sys/param.h-includes
-sys/param.h-includes: $(addprefix $(common-objpfx),$(sys/param.h-includes))
-
-ifdef sys/param.h-includes
-# Copy the system files to $(common-objdir).
-$(addprefix $(common-objpfx),$(sys/param.h-includes)): $(common-objpfx)%: \
-						       $(sysincludedir)/%
-	$(make-target-directory)
-# Some of these files sometimes contain conflicting declarations for htons,
-# ntohs, etc.  They also often contain definitions of *_ENDIAN and
-# BYTE_ORDER, which we define ourselves in <endian.h>.
-	sed -e '/[ 	]*[hn]to[nh][sl][	 (]*/d' \
-	    -e '/^#define[ 	]*[A-Z]*_ENDIAN/d' \
-	    -e '/^#define[ 	]*BYTE_ORDER/d' \
-	    $< > $@-t
-	mv $@-t $@
-endif
-
-common-generated := $(common-generated) \
-		    sys/param.h $(sys/param.h-includes) param.h.c param.h.dep
-
-
-ifeq ($(subdir),misc)
-
-# Install system headers the system sys/param.h uses.
-
-sysdep_headers := $(sysdep_headers) $(sys/param.h-includes)
-
-endif # misc
-
-endif # No sysdep sys/param.h.
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
-	$(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/errno.h))))))
-
-# These need to exist before any compiling is done,
-# so cpp doesn't instead find the generic versions.
-before-compile := $(before-compile) $(common-objpfx)bits/errno.h
-
-$(common-objpfx)bits/errno.h: $(common-objpfx)make-errnos
-	$(dir $<)$(notdir $<) > $@-tmp
-	mv $@-tmp $@
-
-$(common-objpfx)make-errnos: $(common-objpfx)make-errnos.c
-	$(common-objdir-compile)
-
-$(common-objpfx)make-errnos.c: $(sysdep_dir)/unix/errnos-tmpl.c \
-			$(sysdep_dir)/unix/errnos.awk $(common-objpfx)errnos
-	$(AWK) -f $(word 2,$^) errnos="`tr '\012' ' ' < $(word 3,$^)`" $< > $@T
-	mv $@T $@
-
-$(common-objpfx)errnos: $(wildcard $(sysincludedir)/errno.h	\
-				   $(sysincludedir)/sys/errno.h)
-	sed -n 's/^#define[ 	]*\(E[A-Z0-9][A-Z0-9]*\)[ 	].*$$/\1/p' \
-	    $^ > $@-tmp
-	mv $@-tmp $@
-
-common-generated := $(common-generated) \
-		    errnos.h errnos make-errnos make-errnos.c
-endif
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
-	$(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/ioctls.h))))))
-
-before-compile := $(before-compile) $(common-objpfx)bits/ioctls.h
-
-$(common-objpfx)bits/ioctls.h: $(common-objpfx)make-ioctls
-	$(dir $<)$(notdir $<) > $@-tmp
-	mv $@-tmp $@
-
-ioctl-includes := sys/termios.h net/nit.h
-ioctl-includes := $(wildcard $(addprefix $(sysincludedir)/,$(ioctl-includes)))
-make-ioctls-CFLAGS := $(subst /,_,$(subst .,_,\
-			$(patsubst $(sysincludedir)/%,-DHAVE_%,\
-				   $(ioctl-includes))))
-
-$(common-objpfx)make-ioctls: $(common-objpfx)make-ioctls.c
-	$(common-objdir-compile)
-
-$(common-objpfx)make-ioctls.c: $(sysdep_dir)/unix/ioctls-tmpl.c \
-			       $(sysdep_dir)/unix/ioctls.awk \
-			       $(common-objpfx)ioctls
-	$(AWK) -f $(word 2,$^) requests="`cat $(word 3,$^)`" $< > $@T
-	mv $@T $@
-
-
-bits_termios.h := $(firstword $(wildcard $(+sysdep_dirs:%=%/bits/termios.h)))
-ifeq ($(bits_termios.h),$(sysdep_dir)/generic/bits/termios.h)
-bits_termios.h := # Ignore the generic version.
-endif
-
-# If there is a system-specific <bits/termios.h> file, we want to omit
-# all the symbols it defines from ioctls.  Otherwise, both
-# <bits/ioctls.h> and <bits/termios.h> would define them.  The
-# system-specific <bits/termios.h> file presumably defines them with
-# the same values as we find from the system's headers.  We also want
-# to omit from ioctls the symbols defined in our own
-# <sys/ttydefaults.h>, to avoid multiple definition conflicts.  We use
-# snarf-ioctls on these files to find what symbols we want to omit.
-# fgrep -xv gives all lines which do not match in their entirety;
-# without -x, CSTOP's presence elided TIOCSTOP.
-
-$(common-objpfx)ioctls: $(sysdep_dir)/unix/snarf-ioctls \
-			$(sysincludedir)/sys/ioctl.h $(ioctl-includes)
-	$(dir $<)$(notdir $<) $(filter-out $<,$^) \
-	| fgrep -xv "`($(dir $<)$(notdir $<) $(bits_termios.h) \
-					     $(..)sysdeps/generic/sys/ttydefaults.h; \
-		      echo NULL) \
-		     | sort | uniq`" \
-	| sort | uniq | tr '\012' ' ' > $@-tmp
-	mv $@-tmp $@
-
-common-generated := $(common-generated) \
-		    bits/ioctls.h ioctls make-ioctls make-ioctls.c
-endif
-
-ifeq (,$(filter-out $(sysdep_dir)/generic/ $(common-objpfx),\
-	$(dir $(firstword $(wildcard $(+sysdep_dirs:%=%/sys/syscall.h))))))
-
-# The syscall code assumes a file <sys/syscall.h> that defines macros
-# `SYS_call' for syscall `call'.  Variations on this I have seen include:
-# it's in <sys/syscall.h>;
-# it's in <sys.s>;
-# it defines `CALL' instead of `SYS_call'.
-# Irix has a <syscall.h> which is not what we want, so check for <sys.s> first.
-
-# Find a file that might have these.  NOTE: This list of possibilities is
-# repeated in sysdeps/unix/configure and the two should be kept in sync.
-syscall.h := $(firstword $(wildcard $(addprefix $(sysincludedir)/, \
-						sys.s sys/sys.s \
-						sys.S sys/sys.S \
-						syscall.h sys/syscall.h \
-						)))
-ifdef syscall.h
-
-# Transmogrify any of several formats of the file into the one we want.
-$(common-objpfx)sys/syscall.h: $(syscall.h)
-	$(make-target-directory)
-	tr '[A-Z]' '[a-z]' < $< | \
-	sed -e 's/[ 	]sys_/ /' \
-	    -e 's/^#define[ 	]*\([a-z0-9_]*\)[ 	]*/#define SYS_\1 /' \
-	    -e 's/[ 	]sys_/ SYS_/' \
-	    -e 's/SYS_syscall_basenum/syscall_basenum/g' \
-	    -e 's/SYS_kerncall_basenum/kerncall_basenum/g' \
-	    -e 's/SYS_sysvoffset/sysvoffset/g' \
-	    -e '/^#/!d' \
-	    -e '/^#ident/d' \
-	    -e 's-\(/\*[^*]*\)$$-\1\*/-' \
-	> $@-tmp
-	mv $@-tmp $@
-
-before-compile += $(common-objpfx)sys/syscall.h
-common-generated += sys/syscall.h
-
-endif
-
-endif
-
 ifndef inhibit-unix-syscalls
 
 # Sysdep dirs unix/... can contain a file syscalls.list,

Removed: fsf/trunk/libc/sysdeps/unix/errnos-tmpl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/errnos-tmpl.c (original)
+++ fsf/trunk/libc/sysdeps/unix/errnos-tmpl.c (removed)
@@ -1,98 +1,0 @@
-/* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-
-static char iferrno[] = "#ifdef _ERRNO_H";
-static char endiferrno[] = "#endif /* <errno.h> included.  */";
-static char ifEmath[] = "#if !defined(__Emath_defined) && \
- (defined(_ERRNO_H) || defined(__need_Emath))";
-static char endifEmath[] = "#endif /* Emath not defined and <errno.h> \
-included or need Emath.  */";
-
-static int biggest_value = 0;
-static int done_ENOSYS = 0;
-static int done_ERANGE = 0, done_EDOM = 0;
-
-static void
-DO(name, value)
-     char *name;
-     int value;
-{
-  int is_ERANGE = !done_ERANGE && !strcmp(name, "ERANGE");
-  int is_EDOM = !done_EDOM && !strcmp(name, "EDOM");
-  int is_Emath = is_ERANGE || is_EDOM;
-
-  if (is_Emath)
-    {
-      puts(endiferrno);
-      puts(ifEmath);
-    }
-
-  if (!strcmp (name, "EWOULDBLOCK"))
-    {
-      puts ("#define EWOULDBLOCK EAGAIN /* Translated in glibc. */");
-      name = "EWOULDBLOCK_sys /* Value actually returned by kernel. */";
-    }
-
-  printf ("#define %s %d\n", name, value);
-
-  if (is_Emath)
-    {
-      puts(endifEmath);
-      puts(iferrno);
-    }
-
-  if (value > biggest_value)
-    biggest_value = value;
-
-  if (is_ERANGE)
-    done_ERANGE = 1;
-  else if (is_EDOM)
-    done_EDOM = 1;
-  else if (!done_ENOSYS && !strcmp(name, "ENOSYS"))
-    done_ENOSYS = 1;
-}
-
-int
-main()
-{
-  puts(iferrno);
-
-  ERRNOS;
-
-  if (!done_EDOM || !done_ERANGE)
-    {
-      puts(endiferrno);
-      puts(ifEmath);
-      if (!done_EDOM)
-	printf("#define EDOM %d\n", ++biggest_value);
-      if (!done_ERANGE)
-	printf("#define ERANGE %d\n", ++biggest_value);
-      puts(endifEmath);
-    }
-
-  if (!done_ENOSYS)
-    printf("#define ENOSYS %d\n", ++biggest_value);
-
-  puts(endiferrno);
-
-  puts("#undef __need_Emath");
-  puts("#ifndef __Emath_defined\n#define __Emath_defined 1\n#endif");
-
-  exit(0);
-}

Removed: fsf/trunk/libc/sysdeps/unix/errnos.awk
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/errnos.awk (original)
+++ fsf/trunk/libc/sysdeps/unix/errnos.awk (removed)
@@ -1,12 +1,0 @@
-BEGIN { special = 0 }
-
-/ERRNOS/ { nerrnos = split(errnos, errs)
-	     for (i = 1; i <= nerrnos; ++i)
-	       # Some systems define errno codes inside undefined #ifdefs,
-	       # and then never actually use them.
-	       printf "#ifdef %s\n  DO(\"%s\", %s);\n#endif\n", \
-		 errs[i], errs[i], errs[i]
-	     special = 1 }
-
-
-{ if (special == 0) print $0; special = 0 }

Removed: fsf/trunk/libc/sysdeps/unix/ioctls-tmpl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/ioctls-tmpl.c (original)
+++ fsf/trunk/libc/sysdeps/unix/ioctls-tmpl.c (removed)
@@ -1,134 +1,0 @@
-/* On SVR4, this #define is necessary to make <sys/ioctl.h> define
-   many of the ioctls.  */
-#define BSD_COMP
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-/* On SunOS 4.1, <sys/ioctl.h> and <sys/termios.h> define some symbols
-   with different values, but <sys/termios.h> defines some ioctl symbols
-   not in <sys/ioctl.h>, so we need it.  Our <sys/ioctl.h> should define
-   them with the values from Sun's <sys/ioctl.h>, not <sys/termios.h>.
-   So we include <sys/termios.h> and let <sys/ioctl.h> redefine things.
-   This produces some spurious warnings.  */
-
-#ifdef HAVE_sys_termios_h
-#include <sys/termios.h>
-#endif
-
-/* This causes <sys/ioctl.h> to define some necessary data structure.  */
-#ifdef sony_news
-#define KANJI
-#endif
-
-#include <sys/ioctl.h>
-
-#ifdef	SIOCGIFCONF
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <net/if.h>
-#include <net/route.h>
-#if	defined(SIOCGARP) && !defined(ARPOP_REQUEST)
-#include <net/if_arp.h>
-#endif
-#ifdef	SIOCGNIT
-#ifdef	HAVE_net_nit_h
-#include <net/nit.h>
-#else	/* No net/nit.h.  */
-#undef SIOCGNIT
-#undef SIOCSNIT
-#endif	/* net/nit.h.  */
-#endif	/* SIOCGNIT.  */
-#endif	/* SIOCGIFCONF.  */
-
-/* These exist on Sequents.  */
-#ifdef SMIOSTATS
-#include <sec/sec.h>
-#include <sec/sm.h>
-#endif
-#ifdef SMIOGETREBOOT0
-#include <i386/cfg.h>
-#endif
-#ifdef ZIOCBCMD
-#include <zdc/zdc.h>
-#endif
-
-/* These exist under Ultrix, but I figured there may be others.  */
-#ifdef DIOCGETPT
-#include <ufs/fs.h>		/* for DIOC* */
-#endif
-#ifdef DEVGETGEOM
-#include <sys/devio.h>
-#endif
-
-#ifdef ultrix
-/* Ultrix has a conditional include that brings these in; we have to force
-   their inclusion when we actually compile them.  */
-#undef TCGETA
-#undef TCSETA
-#undef TCSETAW
-#undef TCSETAF
-#undef TCGETP
-#undef TCSANOW
-#undef TCSADRAIN
-#undef TCSAFLUSH
-#ifdef ELSETPID
-#include <sys/un.h> /* get sockaddr_un for elcsd.h */
-#include <elcsd.h>
-#endif
-#ifdef DKIOCDOP
-#include <sys/dkio.h>
-#endif
-/* Couldn't find the header where the structures used by these are
-   defined; it looks like an unbundled LAT package or something.  */
-#undef LIOCSOL
-#undef LIOCRES
-#undef LIOCCMD
-#undef LIOCINI
-#undef LIOCTTYI
-#undef LIOCCONN
-/* struct mtop hasn't been in sys/mtio.h since 4.1 */
-#undef MTIOCTOP
-#undef MTIOCGET
-#endif
-
-#if defined(__osf__) && defined(__alpha__)
-#include <sys/ioctl_compat.h>	/* To get TIOCGETP, etc.  */
-#include <alpha/pt.h>		/* for DIOC* */
-#include <sys/mtio.h>		/* for MTIOC* */
-/* The binlog_getstatus structure doesn't seem to be defined.  */
-#undef BINLOG_GETSTATUS
-/* Can't find `struct ifdata' anywhere.  */
-#undef SIOCMANREQ
-#undef SIOCGETEVENTS
-/* OSF/1 smells an awful lot like Ultrix.  */
-#undef TCGETA
-#undef TCSETA
-#undef TCSETAF
-#undef TCSETAW
-/* This macro looks screwed in sys/devio.h.  */
-#undef DEV_DISKPART
-/* This is in sys/dkio.h, but we don't need it.  */
-#undef DKIOCACC
-#undef DKIOCDOP
-#undef DKIOCEXCL
-#undef DKIOCGET
-#undef DKIOCHDR
-/* Introduced by OSF/1 2.0.  */
-#undef FIOPIPESTAT
-#undef SIOCSRREQR
-#undef SIOCSRREQW
-#undef SRVC_REQUEST
-#endif
-
-#define	DEFINE(name, value) \
-  printf("#define %s 0x%.8x\n", (name), (value))
-
-int
-main()
-{
-  REQUESTS
-
-  exit(0);
-  return 0;
-}

Removed: fsf/trunk/libc/sysdeps/unix/ioctls.awk
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/ioctls.awk (original)
+++ fsf/trunk/libc/sysdeps/unix/ioctls.awk (removed)
@@ -1,10 +1,0 @@
-BEGIN { special = 0 }
-
-/REQUESTS/ { nreqs = split(requests, reqs)
-	     for (i = 1; i <= nreqs; ++i)
-	       printf "#ifdef\t%s\n  DEFINE(\"%s\", %s);\n#endif\n", \
-		      reqs[i], reqs[i], reqs[i]
-	     special = 1 }
-
-
-{ if (special == 0) print $0; special = 0 }

Removed: fsf/trunk/libc/sysdeps/unix/mk-local_lim.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/mk-local_lim.c (original)
+++ fsf/trunk/libc/sysdeps/unix/mk-local_lim.c (removed)
@@ -1,125 +1,0 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <stdio.h>
-#include <sys/types.h>
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifdef HAVE_SYS_LIMITS_H
-#include <sys/limits.h>
-#endif
-
-/* Generate bits/local_lim.h from the values defined in the system's
-   headers.  */
-
-struct param
-  {
-    char *name;
-    int value;
-  };
-
-static struct param params[] =
-  {
-
-#if !defined (ARG_MAX) && defined (NCARGS)
-#define ARG_MAX NCARGS
-#endif
-#ifdef ARG_MAX
-    { "ARG_MAX", ARG_MAX },
-#endif
-
-#if !defined (CHILD_MAX) && defined (MAXUPRC)
-#define CHILD_MAX MAXUPRC
-#endif
-#ifdef CHILD_MAX
-    { "CHILD_MAX", CHILD_MAX },
-#endif
-
-#if !defined (LINK_MAX) && defined (MAXLINK)
-#define LINK_MAX MAXLINK
-#endif
-#ifdef LINK_MAX
-    { "LINK_MAX", LINK_MAX },
-#endif
-
-#if !defined (OPEN_MAX) && defined (NOFILE)
-#define OPEN_MAX NOFILE
-#endif
-#ifdef OPEN_MAX
-    { "OPEN_MAX", OPEN_MAX },
-#endif
-
-#if !defined (MAX_CANON) && defined (CANBSIZ)
-#define MAX_CANON CANBSIZ
-#endif
-#ifdef MAX_CANON
-    { "MAX_CANON", MAX_CANON },
-#endif
-
-#if !defined (NAME_MAX) && defined (MAXNAMLEN)
-#define NAME_MAX MAXNAMLEN
-#endif
-#ifndef NAME_MAX
-#define NAME_MAX	255	/* XXX ? */
-#endif
-    { "NAME_MAX", NAME_MAX },
-
-#if !defined (PATH_MAX) && defined (MAXPATHLEN)
-#define PATH_MAX MAXPATHLEN
-#endif
-#ifdef PATH_MAX
-    { "PATH_MAX", PATH_MAX },
-#endif
-
-#if !defined (SYMLOOP_MAX) && defined (MAXSYMLINKS)
-#define SYMLOOP_MAX MAXSYMLINKS
-#endif
-#ifdef SYMLOOP_MAX
-    { "SYMLOOP_MAX", SYMLOOP_MAX },
-#endif
-
-    { NULL, 0 }
-  };
-
-int
-main()
-{
-  extern char *ctime ();
-  extern time_t time ();
-  time_t now = time ((time_t *) NULL);
-  register struct param *p;
-
-  if (! params[0].name)

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