[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r2000 - in /fsf/trunk/libc: ./ libio/ locale/programs/ math/ posix/ stdio-common/ sysdeps/i386/fpu/ sysdeps/ia64/fpu/ sysdep...
- To: commits@xxxxxxxxxx
- Subject: [commits] r2000 - in /fsf/trunk/libc: ./ libio/ locale/programs/ math/ posix/ stdio-common/ sysdeps/i386/fpu/ sysdeps/ia64/fpu/ sysdep...
- From: eglibc@xxxxxxxxxx
- Date: Tue, 17 Apr 2007 07:01:51 -0000
Author: eglibc
Date: Tue Apr 17 00:01:51 2007
New Revision: 2000
Log:
Import glibc-mainline for 2007-04-17
Added:
fsf/trunk/libc/sysdeps/i386/fpu/math_private.h
fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/x86_64/fpu/math_private.h
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/libio/fileops.c
fsf/trunk/libc/libio/genops.c
fsf/trunk/libc/libio/libio.h
fsf/trunk/libc/libio/libioP.h
fsf/trunk/libc/libio/oldfileops.c
fsf/trunk/libc/locale/programs/locarchive.c
fsf/trunk/libc/math/bug-nextafter.c
fsf/trunk/libc/math/bug-nexttoward.c
fsf/trunk/libc/math/math_private.h
fsf/trunk/libc/math/s_nextafter.c
fsf/trunk/libc/math/s_nexttowardf.c
fsf/trunk/libc/math/test-fenv.c
fsf/trunk/libc/posix/unistd.h
fsf/trunk/libc/stdio-common/printf_fp.c
fsf/trunk/libc/stdio-common/tfformat.c
fsf/trunk/libc/sysdeps/i386/fpu/feholdexcpt.c
fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/i386/fpu/s_nextafterl.c
fsf/trunk/libc/sysdeps/i386/fpu/s_nexttoward.c
fsf/trunk/libc/sysdeps/i386/fpu/s_nexttowardf.c
fsf/trunk/libc/sysdeps/ia64/fpu/feholdexcpt.c
fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/ieee754/flt-32/s_nextafterf.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
fsf/trunk/libc/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
fsf/trunk/libc/sysdeps/x86_64/fpu/fedisblxcpt.c
fsf/trunk/libc/sysdeps/x86_64/fpu/feenablxcpt.c
fsf/trunk/libc/sysdeps/x86_64/fpu/feholdexcpt.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Apr 17 00:01:51 2007
@@ -1,3 +1,157 @@
+2007-04-16 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ [BZ #4364]
+ * posix/unistd.h (_XOPEN_VERSION): Define appropriately for SUSv3.
+
+2007-04-15 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * locale/programs/locarchive.c (INITIAL_NUM_NAMES,
+ INITIAL_SIZE_STRINGS, INITIAL_NUM_LOCREC): Update to accomodate
+ current number of locales in SUPPORTED.
+ (create_archive): Initialize serial.
+ (enlarge_archive): Preserve aliases rather than duplicating
+ their locrecs.
+
+2007-04-13 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * libio/genops.c (_IO_default_finish): Call _IO_lock_fini
+ after _IO_un_link, not before it.
+
+ * stdio-common/printf_fp.c (___printf_fp): Fix exponent -4
+ special case handling when wcp == wstartp + 1. Fix a comment typo.
+ * stdio-common/tfformat.c (sprint_doubles): Add a new testcase.
+
+2007-03-30 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * libio/libio.h (__underflow, __uflow, __overflow, __wunderflow,
+ __wuflow, __woverflow, _IO_getc, _IO_putc, _IO_peekc_locked, _IO_padn,
+ _IO_sgetn, _IO_seekoff, _IO_seekpos, _IO_getwc, _IO_putwc, _IO_wpadn):
+ Remove __THROW.
+ * libio/fileops.c (new_do_write, _IO_file_xsgetn_mmap,
+ _IO_file_xsgetn_maybe_mmap): Likewise.
+ * libio/oldfileops.c (old_do_write): Likewise.
+ * libio/libioP.h (_IO_switch_to_get_mode, _IO_switch_to_wget_mode,
+ _IO_init_marker, _IO_init_wmarker, _IO_default_uflow,
+ _IO_wdefault_uflow, _IO_default_setbuf, _IO_default_seekpos,
+ _IO_do_write, _IO_new_do_write, _IO_old_do_write, _IO_wdo_write,
+ _IO_flush_all_lockp, _IO_flush_all, _IO_cleanup,
+ _IO_flush_all_linebuffered, _IO_new_fgetpos, _IO_old_fgetpos,
+ _IO_new_fsetpos, _IO_old_fsetpos, _IO_new_fgetpos64,
+ _IO_old_fgetpos64, _IO_new_fsetpos64, _IO_old_fsetpos64,
+ _IO_file_setbuf, _IO_file_seekoff, _IO_file_xsputn, _IO_file_xsgetn,
+ _IO_file_underflow, _IO_file_underflow_mmap,
+ _IO_file_underflow_maybe_mmap, _IO_file_overflow, _IO_file_attach,
+ _IO_file_open, _IO_file_fopen, _IO_file_write, _IO_file_read,
+ _IO_file_sync, _IO_file_close_it, _IO_file_finish,
+ _IO_new_file_attach, _IO_new_file_close_it, _IO_new_file_finish,
+ _IO_new_file_fopen, _IO_new_file_setbuf, _IO_file_setbuf_mmap,
+ _IO_new_file_sync, _IO_new_file_underflow, _IO_new_file_overflow,
+ _IO_new_file_seekoff, _IO_new_file_write, _IO_new_file_xsputn,
+ _IO_old_file_setbuf, _IO_old_file_seekoff, _IO_old_file_xsputn,
+ _IO_old_file_underflow, _IO_old_file_overflow, _IO_old_file_attach,
+ _IO_old_file_fopen, _IO_old_file_write, _IO_old_file_sync,
+ _IO_old_file_close_it, _IO_old_file_finish, _IO_wfile_xsputn,
+ _IO_wfile_setbuf, _IO_wfile_sync, _IO_wfile_underflow,
+ _IO_wfile_overflow, _IO_wfile_seekoff, _IO_old_proc_open,
+ _IO_old_proc_close, _IO_getdelim, _IO_flush_all_internal,
+ _IO_adjust_column_internal, _IO_default_uflow_internal,
+ _IO_default_xsgetn_internal, _IO_wdefault_xsputn_internal,
+ _IO_wdefault_xsgetn_internal, _IO_wdefault_uflow_internal,
+ _IO_file_setbuf_internal, _IO_file_seekoff_internal,
+ _IO_file_xsputn_internal, _IO_file_xsgetn_internal,
+ _IO_file_close_it_internal, _IO_file_underflow_internal,
+ _IO_file_overflow_internal, _IO_file_attach_internal,
+ _IO_file_fopen_internal, _IO_file_sync_internal,
+ _IO_file_finish_internal, _IO_wfile_xsputn_internal,
+ _IO_wfile_seekoff_internal, _IO_wfile_sync_internal,
+ _IO_switch_to_wget_mode_internal, _IO_padn_internal,
+ _IO_switch_to_get_mode_internal, _IO_seekoff_unlocked,
+ _IO_seekpos_unlocked): Likewise.
+ (_IO_strtod, _IO_dtoa, _IO_outfloat, _IO_read, _IO_write,
+ _IO_lseek, _IO_close, _IO_fstat): Remove unused prototypes.
+
+2007-04-16 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * locale/programs/locarchive.c (show_archive_content): Fix sizeof
+ argument in xmalloc size computation.
+
+2007-04-01 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Use
+ math_opt_barrier and math_force_eval macros.
+
+2007-03-27 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ [BZ #3306]
+ * math/math_private.h (math_opt_barrier, math_force_eval): Define.
+ * sysdeps/i386/fpu/math_private.h: New file.
+ * sysdeps/x86_64/fpu/math_private.h: New file.
+ * math/s_nexttowardf.c (__nexttowardf): Use math_opt_barrier and
+ math_force_eval macros. Use "+m" constraint on asm rather than
+ "=m" and "m".
+ * math/s_nextafter.c (__nextafter): Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c (__nexttoward):
+ Likewise.
+ * sysdeps/ieee754/flt-32/s_nextafterf.c (__nextafterf): Likewise.
+ * sysdeps/ieee754/ldbl-128/s_nexttoward.c (__nexttoward): Likewise.
+ * sysdeps/ieee754/ldbl-96/s_nexttoward.c (__nexttoward): Likewise.
+ * sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Use
+ math_opt_barrier and math_force_eval macros.
+ * sysdeps/ieee754/ldbl-128/s_nextafterl.c (__nextafterl): Likewise.
+ * sysdeps/ieee754/ldbl-96/s_nextafterl.c (__nextafterl): Likewise.
+ * sysdeps/i386/fpu/s_nexttoward.c: Include float.h.
+ (__nexttoward): Use math_opt_barrier and
+ math_force_eval macros. Use "+m" constraint on asm rather than
+ "=m" and "m". Only use asm to force double result if
+ FLT_EVAL_METHOD is 2.
+ * sysdeps/i386/fpu/s_nexttowardf.c: Include float.h.
+ (__nexttowardf): Use math_opt_barrier and
+ math_force_eval macros. Use "+m" constraint on asm rather than
+ "=m" and "m". Only use asm to force double result if
+ FLT_EVAL_METHOD is not 0.
+ * sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c: Include float.h.
+ (__nexttowardf): Use math_opt_barrier and
+ math_force_eval macros. If FLT_EVAL_METHOD is not 0, force
+ x to float using asm.
+ * sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c: Include float.h.
+ (__nldbl_nexttowardf): Use math_opt_barrier and
+ math_force_eval macros. If FLT_EVAL_METHOD is not 0, force
+ x to float using asm.
+ * sysdeps/ieee754/ldbl-96/s_nexttowardf.c: Include float.h.
+ (__nexttowardf): Use math_opt_barrier and math_force_eval
+ macros. If FLT_EVAL_METHOD is not 0, force x to float using asm.
+ * math/bug-nextafter.c (zero, inf): New variables.
+ (main): Add new tests.
+ * math/bug-nexttoward.c (zero, inf): New variables.
+ (main): Add new tests.
+
+2007-03-22 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ [BZ #3427]
+ * sysdeps/x86_64/fpu/feholdexcpt.c (feholdexcept): Clear all
+ exceptions both in SW and MXCSR.
+ * sysdeps/x86_64/fpu/feupdateenv.c: New file.
+ * sysdeps/x86_64/fpu/feenablxcpt.c (feenableexcept): Remove dead code.
+ * sysdeps/x86_64/fpu/fedisblxcpt.c (fedisableexcept): Likewise.
+ * sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Clear all exceptions
+ in MXCSR if SSE is available.
+ * sysdeps/i386/fpu/feupdateenv.c: Include unistd.h, dl-procinfo.h
+ and ldsodefs.h.
+ (__feupdateenv): Query exceptions also from MXCSR if SSE is available.
+ Fix comment typo.
+ * sysdeps/ia64/fpu/feholdexcpt.c (feholdexcept): Clear all exceptions.
+ Return 0 rather than 1.
+ * sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Fix comment typo.
+ Remove incorrect part of a comment. Fix argument to feraiseexcept.
+ * math/test-fenv.c (feholdexcept_tests): New function.
+ (main): Call it.
+
+2007-01-05 Richard B. Kreckel <kreckel@xxxxxxxx>
+
+ [BZ #3427]
+ * sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Clear all exceptions
+ in SW.
+
2007-04-13 Jakub Jelinek <jakub@xxxxxxxxxx>
[BZ #4344]
Modified: fsf/trunk/libc/libio/fileops.c
==============================================================================
--- fsf/trunk/libc/libio/fileops.c (original)
+++ fsf/trunk/libc/libio/fileops.c Tue Apr 17 00:01:51 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993, 1995, 1997-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997-2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@xxxxxxxxxx>.
@@ -472,7 +473,7 @@
return result;
}
-static _IO_size_t new_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
+static _IO_size_t new_do_write (_IO_FILE *, const char *, _IO_size_t);
/* Write TO_DO bytes from DATA to FP.
Then mark FP as having empty buffers. */
@@ -1468,8 +1469,7 @@
}
INTDEF(_IO_file_xsgetn)
-static _IO_size_t _IO_file_xsgetn_mmap (_IO_FILE *, void *, _IO_size_t)
- __THROW;
+static _IO_size_t _IO_file_xsgetn_mmap (_IO_FILE *, void *, _IO_size_t);
static _IO_size_t
_IO_file_xsgetn_mmap (fp, data, n)
_IO_FILE *fp;
@@ -1528,8 +1528,7 @@
return s - (char *) data;
}
-static _IO_size_t _IO_file_xsgetn_maybe_mmap (_IO_FILE *, void *, _IO_size_t)
- __THROW;
+static _IO_size_t _IO_file_xsgetn_maybe_mmap (_IO_FILE *, void *, _IO_size_t);
static _IO_size_t
_IO_file_xsgetn_maybe_mmap (fp, data, n)
_IO_FILE *fp;
Modified: fsf/trunk/libc/libio/genops.c
==============================================================================
--- fsf/trunk/libc/libio/genops.c (original)
+++ fsf/trunk/libc/libio/genops.c Tue Apr 17 00:01:51 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006
+/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -696,12 +696,12 @@
fp->_IO_save_base = NULL;
}
+ INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
+
#ifdef _IO_MTSAFE_IO
if (fp->_lock != NULL)
_IO_lock_fini (*fp->_lock);
#endif
-
- INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
}
INTDEF(_IO_default_finish)
Modified: fsf/trunk/libc/libio/libio.h
==============================================================================
--- fsf/trunk/libc/libio/libio.h (original)
+++ fsf/trunk/libc/libio/libio.h Tue Apr 17 00:01:51 2007
@@ -410,12 +410,12 @@
extern "C" {
#endif
-extern int __underflow (_IO_FILE *) __THROW;
-extern int __uflow (_IO_FILE *) __THROW;
-extern int __overflow (_IO_FILE *, int) __THROW;
-extern _IO_wint_t __wunderflow (_IO_FILE *) __THROW;
-extern _IO_wint_t __wuflow (_IO_FILE *) __THROW;
-extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW;
+extern int __underflow (_IO_FILE *);
+extern int __uflow (_IO_FILE *);
+extern int __overflow (_IO_FILE *, int);
+extern _IO_wint_t __wunderflow (_IO_FILE *);
+extern _IO_wint_t __wuflow (_IO_FILE *);
+extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);
#if __GNUC__ >= 3
# define _IO_BE(expr, res) __builtin_expect ((expr), res)
@@ -448,12 +448,12 @@
#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
-extern int _IO_getc (_IO_FILE *__fp) __THROW;
-extern int _IO_putc (int __c, _IO_FILE *__fp) __THROW;
+extern int _IO_getc (_IO_FILE *__fp);
+extern int _IO_putc (int __c, _IO_FILE *__fp);
extern int _IO_feof (_IO_FILE *__fp) __THROW;
extern int _IO_ferror (_IO_FILE *__fp) __THROW;
-extern int _IO_peekc_locked (_IO_FILE *__fp) __THROW;
+extern int _IO_peekc_locked (_IO_FILE *__fp);
/* This one is for Emacs. */
#define _IO_PENDING_OUTPUT_COUNT(_fp) \
@@ -482,17 +482,17 @@
_IO_va_list, int *__restrict);
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
_IO_va_list);
-extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t) __THROW;
-extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t) __THROW;
-
-extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW;
-extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int) __THROW;
+extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t);
+extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
+
+extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int);
extern void _IO_free_backup_area (_IO_FILE *) __THROW;
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-extern _IO_wint_t _IO_getwc (_IO_FILE *__fp) __THROW;
-extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp) __THROW;
+extern _IO_wint_t _IO_getwc (_IO_FILE *__fp);
+extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp);
extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW;
# if __GNUC__ >= 2
/* While compiling glibc we have to handle compatibility with very old
@@ -531,7 +531,7 @@
_IO_va_list, int *__restrict);
extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict,
_IO_va_list);
-extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t) __THROW;
+extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t);
extern void _IO_free_wbackup_area (_IO_FILE *) __THROW;
#endif
Modified: fsf/trunk/libc/libio/libioP.h
==============================================================================
--- fsf/trunk/libc/libio/libioP.h (original)
+++ fsf/trunk/libc/libio/libioP.h Tue Apr 17 00:01:51 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003,2004,2005,2006
+/* Copyright (C) 1993, 1997-2003,2004,2005,2006,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -380,7 +380,7 @@
extern void _IO_switch_to_main_get_area (_IO_FILE *) __THROW;
extern void _IO_switch_to_backup_area (_IO_FILE *) __THROW;
-extern int _IO_switch_to_get_mode (_IO_FILE *) __THROW;
+extern int _IO_switch_to_get_mode (_IO_FILE *);
extern void _IO_init (_IO_FILE *, int) __THROW;
extern int _IO_sputbackc (_IO_FILE *, int) __THROW;
extern int _IO_sungetc (_IO_FILE *) __THROW;
@@ -394,7 +394,7 @@
extern void _IO_switch_to_main_wget_area (_IO_FILE *) __THROW;
extern void _IO_switch_to_wbackup_area (_IO_FILE *) __THROW;
-extern int _IO_switch_to_wget_mode (_IO_FILE *) __THROW;
+extern int _IO_switch_to_wget_mode (_IO_FILE *);
extern void _IO_wsetb (_IO_FILE *, wchar_t *, wchar_t *, int) __THROW;
extern wint_t _IO_sputbackwc (_IO_FILE *, wint_t) __THROW;
extern wint_t _IO_sungetwc (_IO_FILE *) __THROW;
@@ -404,8 +404,8 @@
/* Marker-related function. */
-extern void _IO_init_marker (struct _IO_marker *, _IO_FILE *) __THROW;
-extern void _IO_init_wmarker (struct _IO_marker *, _IO_FILE *) __THROW;
+extern void _IO_init_marker (struct _IO_marker *, _IO_FILE *);
+extern void _IO_init_wmarker (struct _IO_marker *, _IO_FILE *);
extern void _IO_remove_marker (struct _IO_marker *) __THROW;
extern int _IO_marker_difference (struct _IO_marker *, struct _IO_marker *)
__THROW;
@@ -434,22 +434,22 @@
/* Default jumptable functions. */
extern int _IO_default_underflow (_IO_FILE *) __THROW;
-extern int _IO_default_uflow (_IO_FILE *) __THROW;
-extern wint_t _IO_wdefault_uflow (_IO_FILE *) __THROW;
+extern int _IO_default_uflow (_IO_FILE *);
+extern wint_t _IO_wdefault_uflow (_IO_FILE *);
extern int _IO_default_doallocate (_IO_FILE *) __THROW;
extern int _IO_wdefault_doallocate (_IO_FILE *) __THROW;
extern void _IO_default_finish (_IO_FILE *, int) __THROW;
extern void _IO_wdefault_finish (_IO_FILE *, int) __THROW;
extern int _IO_default_pbackfail (_IO_FILE *, int) __THROW;
extern wint_t _IO_wdefault_pbackfail (_IO_FILE *, wint_t) __THROW;
-extern _IO_FILE* _IO_default_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
+extern _IO_FILE* _IO_default_setbuf (_IO_FILE *, char *, _IO_ssize_t);
extern _IO_size_t _IO_default_xsputn (_IO_FILE *, const void *, _IO_size_t);
extern _IO_size_t _IO_wdefault_xsputn (_IO_FILE *, const void *, _IO_size_t);
extern _IO_size_t _IO_default_xsgetn (_IO_FILE *, void *, _IO_size_t);
extern _IO_size_t _IO_wdefault_xsgetn (_IO_FILE *, void *, _IO_size_t);
extern _IO_off64_t _IO_default_seekoff (_IO_FILE *, _IO_off64_t, int, int)
__THROW;
-extern _IO_off64_t _IO_default_seekpos (_IO_FILE *, _IO_off64_t, int) __THROW;
+extern _IO_off64_t _IO_default_seekpos (_IO_FILE *, _IO_off64_t, int);
extern _IO_ssize_t _IO_default_write (_IO_FILE *, const void *, _IO_ssize_t);
extern _IO_ssize_t _IO_default_read (_IO_FILE *, void *, _IO_ssize_t);
extern int _IO_default_stat (_IO_FILE *, void *) __THROW;
@@ -473,22 +473,22 @@
extern const struct _IO_jump_t _IO_str_jumps attribute_hidden;
extern const struct _IO_jump_t _IO_wstr_jumps attribute_hidden;
extern const struct _IO_codecvt __libio_codecvt attribute_hidden;
-extern int _IO_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
-extern int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
-extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
-extern int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t) __THROW;
-extern int _IO_flush_all_lockp (int) __THROW;
-extern int _IO_flush_all (void) __THROW;
-extern int _IO_cleanup (void) __THROW;
-extern void _IO_flush_all_linebuffered (void) __THROW;
-extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *) __THROW;
-extern int _IO_old_fgetpos (_IO_FILE *, _IO_fpos_t *) __THROW;
-extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *) __THROW;
-extern int _IO_old_fsetpos (_IO_FILE *, const _IO_fpos_t *) __THROW;
-extern int _IO_new_fgetpos64 (_IO_FILE *, _IO_fpos64_t *) __THROW;
-extern int _IO_old_fgetpos64 (_IO_FILE *, _IO_fpos64_t *) __THROW;
-extern int _IO_new_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *) __THROW;
-extern int _IO_old_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *) __THROW;
+extern int _IO_do_write (_IO_FILE *, const char *, _IO_size_t);
+extern int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t);
+extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t);
+extern int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t);
+extern int _IO_flush_all_lockp (int);
+extern int _IO_flush_all (void);
+extern int _IO_cleanup (void);
+extern void _IO_flush_all_linebuffered (void);
+extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *);
+extern int _IO_old_fgetpos (_IO_FILE *, _IO_fpos_t *);
+extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *);
+extern int _IO_old_fsetpos (_IO_FILE *, const _IO_fpos_t *);
+extern int _IO_new_fgetpos64 (_IO_FILE *, _IO_fpos64_t *);
+extern int _IO_old_fgetpos64 (_IO_FILE *, _IO_fpos64_t *);
+extern int _IO_new_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *);
+extern int _IO_old_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *);
extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
@@ -534,95 +534,79 @@
/* Jumptable functions for files. */
extern int _IO_file_doallocate (_IO_FILE *) __THROW;
-extern _IO_FILE* _IO_file_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
-extern _IO_off64_t _IO_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
- __THROW;
+extern _IO_FILE* _IO_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+extern _IO_off64_t _IO_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
extern _IO_off64_t _IO_file_seekoff_mmap (_IO_FILE *, _IO_off64_t, int, int)
__THROW;
-extern _IO_size_t _IO_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
- __THROW;
-extern _IO_size_t _IO_file_xsgetn (_IO_FILE *, void *, _IO_size_t) __THROW;
+extern _IO_size_t _IO_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern _IO_size_t _IO_file_xsgetn (_IO_FILE *, void *, _IO_size_t);
extern int _IO_file_stat (_IO_FILE *, void *) __THROW;
extern int _IO_file_close (_IO_FILE *) __THROW;
extern int _IO_file_close_mmap (_IO_FILE *) __THROW;
-extern int _IO_file_underflow (_IO_FILE *) __THROW;
-extern int _IO_file_underflow_mmap (_IO_FILE *) __THROW;
-extern int _IO_file_underflow_maybe_mmap (_IO_FILE *) __THROW;
-extern int _IO_file_overflow (_IO_FILE *, int) __THROW;
+extern int _IO_file_underflow (_IO_FILE *);
+extern int _IO_file_underflow_mmap (_IO_FILE *);
+extern int _IO_file_underflow_maybe_mmap (_IO_FILE *);
+extern int _IO_file_overflow (_IO_FILE *, int);
#define _IO_file_is_open(__fp) ((__fp)->_fileno != -1)
extern void _IO_file_init (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_file_attach (_IO_FILE *, int) __THROW;
-extern _IO_FILE* _IO_file_open (_IO_FILE *, const char *, int, int, int, int)
- __THROW;
+extern _IO_FILE* _IO_file_attach (_IO_FILE *, int);
+extern _IO_FILE* _IO_file_open (_IO_FILE *, const char *, int, int, int, int);
libc_hidden_proto (_IO_file_open)
-extern _IO_FILE* _IO_file_fopen (_IO_FILE *, const char *, const char *, int)
- __THROW;
-extern _IO_ssize_t _IO_file_write (_IO_FILE *, const void *, _IO_ssize_t)
- __THROW;
-extern _IO_ssize_t _IO_file_read (_IO_FILE *, void *, _IO_ssize_t) __THROW;
-extern int _IO_file_sync (_IO_FILE *) __THROW;
-extern int _IO_file_close_it (_IO_FILE *) __THROW;
+extern _IO_FILE* _IO_file_fopen (_IO_FILE *, const char *, const char *, int);
+extern _IO_ssize_t _IO_file_write (_IO_FILE *, const void *, _IO_ssize_t);
+extern _IO_ssize_t _IO_file_read (_IO_FILE *, void *, _IO_ssize_t);
+extern int _IO_file_sync (_IO_FILE *);
+extern int _IO_file_close_it (_IO_FILE *);
extern _IO_off64_t _IO_file_seek (_IO_FILE *, _IO_off64_t, int) __THROW;
-extern void _IO_file_finish (_IO_FILE *, int) __THROW;
-
-extern _IO_FILE* _IO_new_file_attach (_IO_FILE *, int) __THROW;
-extern int _IO_new_file_close_it (_IO_FILE *) __THROW;
-extern void _IO_new_file_finish (_IO_FILE *, int) __THROW;
+extern void _IO_file_finish (_IO_FILE *, int);
+
+extern _IO_FILE* _IO_new_file_attach (_IO_FILE *, int);
+extern int _IO_new_file_close_it (_IO_FILE *);
+extern void _IO_new_file_finish (_IO_FILE *, int);
extern _IO_FILE* _IO_new_file_fopen (_IO_FILE *, const char *, const char *,
- int) __THROW;
+ int);
extern void _IO_no_init (_IO_FILE *, int, int, struct _IO_wide_data *,
const struct _IO_jump_t *) __THROW;
extern void _IO_new_file_init (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_new_file_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
-extern _IO_FILE* _IO_file_setbuf_mmap (_IO_FILE *, char *, _IO_ssize_t)
- __THROW;
-extern int _IO_new_file_sync (_IO_FILE *) __THROW;
-extern int _IO_new_file_underflow (_IO_FILE *) __THROW;
-extern int _IO_new_file_overflow (_IO_FILE *, int) __THROW;
-extern _IO_off64_t _IO_new_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
- __THROW;
-extern _IO_ssize_t _IO_new_file_write (_IO_FILE *, const void *, _IO_ssize_t)
- __THROW;
-extern _IO_size_t _IO_new_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
- __THROW;
-
-extern _IO_FILE* _IO_old_file_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
-extern _IO_off64_t _IO_old_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
- __THROW;
-extern _IO_size_t _IO_old_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
- __THROW;
-extern int _IO_old_file_underflow (_IO_FILE *) __THROW;
-extern int _IO_old_file_overflow (_IO_FILE *, int) __THROW;
+extern _IO_FILE* _IO_new_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+extern _IO_FILE* _IO_file_setbuf_mmap (_IO_FILE *, char *, _IO_ssize_t);
+extern int _IO_new_file_sync (_IO_FILE *);
+extern int _IO_new_file_underflow (_IO_FILE *);
+extern int _IO_new_file_overflow (_IO_FILE *, int);
+extern _IO_off64_t _IO_new_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern _IO_ssize_t _IO_new_file_write (_IO_FILE *, const void *, _IO_ssize_t);
+extern _IO_size_t _IO_new_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+
+extern _IO_FILE* _IO_old_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+extern _IO_off64_t _IO_old_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern _IO_size_t _IO_old_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern int _IO_old_file_underflow (_IO_FILE *);
+extern int _IO_old_file_overflow (_IO_FILE *, int);
extern void _IO_old_file_init (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_old_file_attach (_IO_FILE *, int) __THROW;
-extern _IO_FILE* _IO_old_file_fopen (_IO_FILE *, const char *, const char *)
- __THROW;
-extern _IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t)
- __THROW;
-extern int _IO_old_file_sync (_IO_FILE *) __THROW;
-extern int _IO_old_file_close_it (_IO_FILE *) __THROW;
-extern void _IO_old_file_finish (_IO_FILE *, int) __THROW;
+extern _IO_FILE* _IO_old_file_attach (_IO_FILE *, int);
+extern _IO_FILE* _IO_old_file_fopen (_IO_FILE *, const char *, const char *);
+extern _IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t);
+extern int _IO_old_file_sync (_IO_FILE *);
+extern int _IO_old_file_close_it (_IO_FILE *);
+extern void _IO_old_file_finish (_IO_FILE *, int);
extern int _IO_wfile_doallocate (_IO_FILE *) __THROW;
-extern _IO_size_t _IO_wfile_xsputn (_IO_FILE *, const void *, _IO_size_t)
- __THROW;
-extern _IO_FILE* _IO_wfile_setbuf (_IO_FILE *, wchar_t *, _IO_ssize_t) __THROW;
-extern wint_t _IO_wfile_sync (_IO_FILE *) __THROW;
-extern wint_t _IO_wfile_underflow (_IO_FILE *) __THROW;
-extern wint_t _IO_wfile_overflow (_IO_FILE *, wint_t) __THROW;
-extern _IO_off64_t _IO_wfile_seekoff (_IO_FILE *, _IO_off64_t, int, int)
- __THROW;
+extern _IO_size_t _IO_wfile_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern _IO_FILE* _IO_wfile_setbuf (_IO_FILE *, wchar_t *, _IO_ssize_t);
+extern wint_t _IO_wfile_sync (_IO_FILE *);
+extern wint_t _IO_wfile_underflow (_IO_FILE *);
+extern wint_t _IO_wfile_overflow (_IO_FILE *, wint_t);
+extern _IO_off64_t _IO_wfile_seekoff (_IO_FILE *, _IO_off64_t, int, int);
/* Jumptable functions for proc_files. */
extern _IO_FILE* _IO_proc_open (_IO_FILE *, const char *, const char *)
__THROW;
extern _IO_FILE* _IO_new_proc_open (_IO_FILE *, const char *, const char *)
__THROW;
-extern _IO_FILE* _IO_old_proc_open (_IO_FILE *, const char *, const char *)
- __THROW;
+extern _IO_FILE* _IO_old_proc_open (_IO_FILE *, const char *, const char *);
extern int _IO_proc_close (_IO_FILE *) __THROW;
extern int _IO_new_proc_close (_IO_FILE *) __THROW;
-extern int _IO_old_proc_close (_IO_FILE *) __THROW;
+extern int _IO_old_proc_close (_IO_FILE *);
/* Jumptable functions for strfiles. */
extern int _IO_str_underflow (_IO_FILE *) __THROW;
@@ -660,73 +644,62 @@
extern _IO_size_t _IO_getline (_IO_FILE *,char *, _IO_size_t, int, int);
extern _IO_size_t _IO_getline_info (_IO_FILE *,char *, _IO_size_t,
int, int, int *);
-extern _IO_ssize_t _IO_getdelim (char **, _IO_size_t *, int, _IO_FILE *)
- __THROW;
+extern _IO_ssize_t _IO_getdelim (char **, _IO_size_t *, int, _IO_FILE *);
extern _IO_size_t _IO_getwline (_IO_FILE *,wchar_t *, _IO_size_t, wint_t, int);
extern _IO_size_t _IO_getwline_info (_IO_FILE *,wchar_t *, _IO_size_t,
wint_t, int, wint_t *);
-extern double _IO_strtod (const char *, char **) __THROW;
-extern char *_IO_dtoa (double __d, int __mode, int __ndigits,
- int *__decpt, int *__sign, char **__rve) __THROW;
-extern int _IO_outfloat (double __value, _IO_FILE *__sb, int __type,
- int __width, int __precision, int __flags,
- int __sign_mode, int __fill) __THROW;
extern struct _IO_FILE_plus *_IO_list_all;
extern void (*_IO_cleanup_registration_needed) (void);
/* Prototype for functions with alternative entry point. */
-extern int _IO_flush_all_internal (void) __THROW;
-extern unsigned _IO_adjust_column_internal (unsigned, const char *, int)
- __THROW;
-
-extern int _IO_default_uflow_internal (_IO_FILE *) __THROW;
+extern int _IO_flush_all_internal (void);
+extern unsigned _IO_adjust_column_internal (unsigned, const char *, int);
+
+extern int _IO_default_uflow_internal (_IO_FILE *);
extern void _IO_default_finish_internal (_IO_FILE *, int) __THROW;
extern int _IO_default_pbackfail_internal (_IO_FILE *, int) __THROW;
extern _IO_size_t _IO_default_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t) __THROW;
-extern _IO_size_t _IO_default_xsgetn_internal (_IO_FILE *, void *, _IO_size_t)
- __THROW;
+ _IO_size_t);
+extern _IO_size_t _IO_default_xsgetn_internal (_IO_FILE *, void *, _IO_size_t);
extern int _IO_default_doallocate_internal (_IO_FILE *) __THROW;
extern void _IO_wdefault_finish_internal (_IO_FILE *, int) __THROW;
extern wint_t _IO_wdefault_pbackfail_internal (_IO_FILE *, wint_t) __THROW;
extern _IO_size_t _IO_wdefault_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t) __THROW;
+ _IO_size_t);
extern _IO_size_t _IO_wdefault_xsgetn_internal (_IO_FILE *, void *,
- _IO_size_t) __THROW;
+ _IO_size_t);
extern int _IO_wdefault_doallocate_internal (_IO_FILE *) __THROW;
-extern wint_t _IO_wdefault_uflow_internal (_IO_FILE *) __THROW;
+extern wint_t _IO_wdefault_uflow_internal (_IO_FILE *);
extern int _IO_file_doallocate_internal (_IO_FILE *) __THROW;
-extern _IO_FILE* _IO_file_setbuf_internal (_IO_FILE *, char *, _IO_ssize_t)
- __THROW;
+extern _IO_FILE* _IO_file_setbuf_internal (_IO_FILE *, char *, _IO_ssize_t);
extern _IO_off64_t _IO_file_seekoff_internal (_IO_FILE *, _IO_off64_t,
- int, int) __THROW;
+ int, int);
extern _IO_size_t _IO_file_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t) __THROW;
-extern _IO_size_t _IO_file_xsgetn_internal (_IO_FILE *, void *, _IO_size_t)
- __THROW;
+ _IO_size_t);
+extern _IO_size_t _IO_file_xsgetn_internal (_IO_FILE *, void *, _IO_size_t);
extern int _IO_file_stat_internal (_IO_FILE *, void *) __THROW;
extern int _IO_file_close_internal (_IO_FILE *) __THROW;
-extern int _IO_file_close_it_internal (_IO_FILE *) __THROW;
-extern int _IO_file_underflow_internal (_IO_FILE *) __THROW;
-extern int _IO_file_overflow_internal (_IO_FILE *, int) __THROW;
+extern int _IO_file_close_it_internal (_IO_FILE *);
+extern int _IO_file_underflow_internal (_IO_FILE *);
+extern int _IO_file_overflow_internal (_IO_FILE *, int);
extern void _IO_file_init_internal (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_file_attach_internal (_IO_FILE *, int) __THROW;
+extern _IO_FILE* _IO_file_attach_internal (_IO_FILE *, int);
extern _IO_FILE* _IO_file_fopen_internal (_IO_FILE *, const char *,
- const char *, int) __THROW;
+ const char *, int);
extern _IO_ssize_t _IO_file_read_internal (_IO_FILE *, void *,
_IO_ssize_t);
-extern int _IO_file_sync_internal (_IO_FILE *) __THROW;
+extern int _IO_file_sync_internal (_IO_FILE *);
extern _IO_off64_t _IO_file_seek_internal (_IO_FILE *, _IO_off64_t, int)
__THROW;
-extern void _IO_file_finish_internal (_IO_FILE *, int) __THROW;
+extern void _IO_file_finish_internal (_IO_FILE *, int);
extern _IO_size_t _IO_wfile_xsputn_internal (_IO_FILE *, const void *,
- _IO_size_t) __THROW;
+ _IO_size_t);
extern _IO_off64_t _IO_wfile_seekoff_internal (_IO_FILE *, _IO_off64_t,
- int, int) __THROW;
-extern wint_t _IO_wfile_sync_internal (_IO_FILE *) __THROW;
+ int, int);
+extern wint_t _IO_wfile_sync_internal (_IO_FILE *);
extern int _IO_str_underflow_internal (_IO_FILE *) __THROW;
extern int _IO_str_overflow_internal (_IO_FILE *, int) __THROW;
@@ -747,12 +720,12 @@
extern _IO_size_t _IO_sgetn_internal (_IO_FILE *, void *, _IO_size_t);
extern void _IO_flush_all_linebuffered_internal (void) __THROW;
-extern int _IO_switch_to_wget_mode_internal (_IO_FILE *) __THROW;
+extern int _IO_switch_to_wget_mode_internal (_IO_FILE *);
extern void _IO_unsave_markers_internal (_IO_FILE *) __THROW;
extern void _IO_switch_to_main_wget_area_internal (_IO_FILE *) __THROW;
extern int _IO_wdo_write_internal (_IO_FILE *, const wchar_t *, _IO_size_t);
extern int _IO_do_write_internal (_IO_FILE *, const char *, _IO_size_t);
-extern _IO_ssize_t _IO_padn_internal (_IO_FILE *, int, _IO_ssize_t) __THROW;
+extern _IO_ssize_t _IO_padn_internal (_IO_FILE *, int, _IO_ssize_t);
extern _IO_size_t _IO_getline_info_internal (_IO_FILE *,char *, _IO_size_t,
int, int, int *);
extern _IO_size_t _IO_getline_internal (_IO_FILE *, char *, _IO_size_t, int,
@@ -762,7 +735,7 @@
extern void _IO_switch_to_wbackup_area_internal (_IO_FILE *) __THROW;
extern void _IO_setb_internal (_IO_FILE *, char *, char *, int) __THROW;
extern wint_t _IO_sputbackwc_internal (_IO_FILE *, wint_t) __THROW;
-extern int _IO_switch_to_get_mode_internal (_IO_FILE *) __THROW;
+extern int _IO_switch_to_get_mode_internal (_IO_FILE *);
extern int _IO_vfscanf_internal (_IO_FILE * __restrict,
const char * __restrict,
_IO_va_list, int *__restrict);
@@ -772,9 +745,9 @@
extern void _IO_wsetb_internal (_IO_FILE *, wchar_t *, wchar_t *, int)
__THROW;
extern _IO_off64_t _IO_seekoff_unlocked (_IO_FILE *, _IO_off64_t, int, int)
- attribute_hidden __THROW;
+ attribute_hidden;
extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE *, _IO_off64_t, int)
- attribute_hidden __THROW;
+ attribute_hidden;
extern int _IO_putc_internal (int __c, _IO_FILE *__fp);
extern void _IO_init_internal (_IO_FILE *, int) __THROW;
extern void _IO_un_link_internal (struct _IO_FILE_plus *) __THROW;
@@ -866,12 +839,6 @@
#ifndef OS_FSTAT
# define OS_FSTAT fstat
#endif
-struct stat;
-extern _IO_ssize_t _IO_read (int, void *, _IO_size_t);
-extern _IO_ssize_t _IO_write (int, const void *, _IO_size_t);
-extern _IO_off64_t _IO_lseek (int, _IO_off64_t, int) __THROW;
-extern int _IO_close (int);
-extern int _IO_fstat (int, struct stat *) __THROW;
extern int _IO_vscanf (const char *, _IO_va_list) __THROW;
/* _IO_pos_BAD is an _IO_off64_t value indicating error, unknown, or EOF. */
Modified: fsf/trunk/libc/libio/oldfileops.c
==============================================================================
--- fsf/trunk/libc/libio/oldfileops.c (original)
+++ fsf/trunk/libc/libio/oldfileops.c Tue Apr 17 00:01:51 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993, 1995, 1997-2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997-2004, 2005, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@xxxxxxxxxx>.
@@ -271,7 +272,7 @@
return fp;
}
-static int old_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
+static int old_do_write (_IO_FILE *, const char *, _IO_size_t);
/* Write TO_DO bytes from DATA to FP.
Then mark FP as having empty buffers. */
Modified: fsf/trunk/libc/locale/programs/locarchive.c
==============================================================================
--- fsf/trunk/libc/locale/programs/locarchive.c (original)
+++ fsf/trunk/libc/locale/programs/locarchive.c Tue Apr 17 00:01:51 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -64,9 +64,9 @@
/* Size of the initial archive header. */
-#define INITIAL_NUM_NAMES 450
-#define INITIAL_SIZE_STRINGS 3500
-#define INITIAL_NUM_LOCREC 350
+#define INITIAL_NUM_NAMES 900
+#define INITIAL_SIZE_STRINGS 7500
+#define INITIAL_NUM_LOCREC 420
#define INITIAL_NUM_SUMS 2000
@@ -88,6 +88,7 @@
/* Create the initial content of the archive. */
head.magic = AR_MAGIC;
+ head.serial = 0;
head.namehash_offset = sizeof (struct locarhead);
head.namehash_used = 0;
head.namehash_size = next_prime (INITIAL_NUM_NAMES);
@@ -217,9 +218,12 @@
}
-/* forward decl for below */
+/* forward decls for below */
static uint32_t add_locale (struct locarhandle *ah, const char *name,
locale_data_t data, bool replace);
+static void add_alias (struct locarhandle *ah, const char *alias,
+ bool replace, const char *oldname,
+ uint32_t *locrec_offset_p);
static void
enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
@@ -350,6 +354,7 @@
qsort (oldlocrecarray, loccnt, sizeof (struct oldlocrecent),
oldlocrecentcmp);
+ uint32_t last_locrec_offset = 0;
for (cnt = 0; cnt < loccnt; ++cnt)
{
/* Insert this entry in the new hash table. */
@@ -368,10 +373,25 @@
old_data[idx].sum);
}
- if (add_locale (&new_ah,
- ((char *) ah->addr
- + oldnamehashtab[oldlocrecarray[cnt].cnt].name_offset),
- old_data, 0) == 0)
+ if (cnt > 0 && oldlocrecarray[cnt - 1].locrec == oldlocrec)
+ {
+ const char *oldname
+ = ((char *) ah->addr
+ + oldnamehashtab[oldlocrecarray[cnt - 1].cnt].name_offset);
+
+ add_alias (&new_ah,
+ ((char *) ah->addr
+ + oldnamehashtab[oldlocrecarray[cnt].cnt].name_offset),
+ 0, oldname, &last_locrec_offset);
+ continue;
+ }
+
+ last_locrec_offset =
+ add_locale (&new_ah,
+ ((char *) ah->addr
+ + oldnamehashtab[oldlocrecarray[cnt].cnt].name_offset),
+ old_data, 0);
+ if (last_locrec_offset == 0)
error (EXIT_FAILURE, 0, _("cannot extend locale archive file"));
}
@@ -1428,7 +1448,7 @@
int sumused;
files = (struct dataent *) xmalloc (head->sumhash_used
- * sizeof (struct sumhashent));
+ * sizeof (struct dataent));
sumhashtab = (struct sumhashent *) ((char *) ah.addr
+ head->sumhash_offset);
Modified: fsf/trunk/libc/math/bug-nextafter.c
==============================================================================
--- fsf/trunk/libc/math/bug-nextafter.c (original)
+++ fsf/trunk/libc/math/bug-nextafter.c Tue Apr 17 00:01:51 2007
@@ -4,6 +4,9 @@
#include <stdlib.h>
#include <stdio.h>
+float zero = 0.0;
+float inf = INFINITY;
+
int
main (void)
{
@@ -34,6 +37,81 @@
++result;
}
+ i = 0;
+ m = FLT_MIN;
+ feclearexcept (FE_ALL_EXCEPT);
+ i = nextafterf (m, i);
+ if (i < 0 || i >= FLT_MIN)
+ {
+ puts ("nextafterf+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterf+ did not underflow");
+ ++result;
+ }
+ i = 0;
+ feclearexcept (FE_ALL_EXCEPT);
+ i = nextafterf (-m, -i);
+ if (i > 0 || i <= -FLT_MIN)
+ {
+ puts ("nextafterf- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterf- did not underflow");
+ ++result;
+ }
+ i = -INFINITY;
+ feclearexcept (FE_ALL_EXCEPT);
+ m = nextafterf (zero, inf);
+ if (m < 0.0 || m >= FLT_MIN)
+ {
+ puts ("nextafterf+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterf+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafterf (m, i) != 0.0)
+ {
+ puts ("nextafterf+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterf+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ m = nextafterf (copysignf (zero, -1.0), -inf);
+ if (m > 0.0 || m <= -FLT_MIN)
+ {
+ puts ("nextafterf- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterf- did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafterf (m, -i) != 0.0)
+ {
+ puts ("nextafterf- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterf- did not underflow");
+ ++result;
+ }
+
double di = INFINITY;
double dm = DBL_MAX;
feclearexcept (FE_ALL_EXCEPT);
@@ -59,5 +137,182 @@
++result;
}
+ di = 0;
+ dm = DBL_MIN;
+ feclearexcept (FE_ALL_EXCEPT);
+ di = nextafter (dm, di);
+ if (di < 0 || di >= DBL_MIN)
+ {
+ puts ("nextafter+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafter+ did not underflow");
+ ++result;
+ }
+ di = 0;
+ feclearexcept (FE_ALL_EXCEPT);
+ di = nextafter (-dm, -di);
+ if (di > 0 || di <= -DBL_MIN)
+ {
+ puts ("nextafter- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafter- did not underflow");
+ ++result;
+ }
+ di = -INFINITY;
+ feclearexcept (FE_ALL_EXCEPT);
+ dm = nextafter (zero, inf);
+ if (dm < 0.0 || dm >= DBL_MIN)
+ {
+ puts ("nextafter+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafter+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafter (dm, di) != 0.0)
+ {
+ puts ("nextafter+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafter+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ dm = nextafter (copysign (zero, -1.0), -inf);
+ if (dm > 0.0 || dm <= -DBL_MIN)
+ {
+ puts ("nextafter- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafter- did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafter (dm, -di) != 0.0)
+ {
+ puts ("nextafter- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafter- did not underflow");
+ ++result;
+ }
+
+#ifndef NO_LONG_DOUBLE
+ long double li = INFINITY;
+ long double lm = LDBL_MAX;
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafterl (lm, li) != li)
+ {
+ puts ("nextafterl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_OVERFLOW) == 0)
+ {
+ puts ("nextafterl+ did not overflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafterl (-lm, -li) != -li)
+ {
+ puts ("nextafterl failed");
+ ++result;
+ }
+ if (fetestexcept (FE_OVERFLOW) == 0)
+ {
+ puts ("nextafterl- did not overflow");
+ ++result;
+ }
+
+ li = 0;
+ lm = LDBL_MIN;
+ feclearexcept (FE_ALL_EXCEPT);
+ li = nextafterl (lm, li);
+ if (li < 0 || li >= LDBL_MIN)
+ {
+ puts ("nextafterl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterl+ did not underflow");
+ ++result;
+ }
+ li = 0;
+ feclearexcept (FE_ALL_EXCEPT);
+ li = nextafterl (-lm, -li);
+ if (li > 0 || li <= -LDBL_MIN)
+ {
+ puts ("nextafterl- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterl- did not underflow");
+ ++result;
+ }
+ li = -INFINITY;
+ feclearexcept (FE_ALL_EXCEPT);
+ lm = nextafterl (zero, inf);
+ if (lm < 0.0 || lm >= LDBL_MIN)
+ {
+ puts ("nextafterl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterl+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafterl (lm, li) != 0.0)
+ {
+ puts ("nextafterl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterl+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ lm = nextafterl (copysign (zero, -1.0), -inf);
+ if (lm > 0.0 || lm <= -LDBL_MIN)
+ {
+ puts ("nextafterl- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterl- did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nextafterl (lm, -li) != 0.0)
+ {
+ puts ("nextafterl- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nextafterl- did not underflow");
+ ++result;
+ }
+#endif
+
return result;
}
Modified: fsf/trunk/libc/math/bug-nexttoward.c
==============================================================================
--- fsf/trunk/libc/math/bug-nexttoward.c (original)
+++ fsf/trunk/libc/math/bug-nexttoward.c Tue Apr 17 00:01:51 2007
@@ -4,6 +4,9 @@
#include <stdlib.h>
#include <stdio.h>
+float zero = 0.0;
+float inf = INFINITY;
+
int
main (void)
{
@@ -35,6 +38,81 @@
++result;
}
+ fi = 0;
+ m = FLT_MIN;
+ feclearexcept (FE_ALL_EXCEPT);
+ fi = nexttowardf (m, fi);
+ if (fi < 0 || fi >= FLT_MIN)
+ {
+ puts ("nexttowardf+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardf+ did not underflow");
+ ++result;
+ }
+ fi = 0;
+ feclearexcept (FE_ALL_EXCEPT);
+ fi = nexttowardf (-m, -fi);
+ if (fi > 0 || fi <= -FLT_MIN)
+ {
+ puts ("nexttowardf- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardf- did not underflow");
+ ++result;
+ }
+ fi = -INFINITY;
+ feclearexcept (FE_ALL_EXCEPT);
+ m = nexttowardf (zero, inf);
+ if (m < 0.0 || m >= FLT_MIN)
+ {
+ puts ("nexttowardf+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardf+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttowardf (m, fi) != 0.0)
+ {
+ puts ("nexttowardf+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardf+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ m = nexttowardf (copysignf (zero, -1.0), -inf);
+ if (m > 0.0 || m <= -FLT_MIN)
+ {
+ puts ("nexttowardf- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardf- did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttowardf (m, -fi) != 0.0)
+ {
+ puts ("nexttowardf- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardf- did not underflow");
+ ++result;
+ }
+
tl = (long double) DBL_MAX + 1.0e305L;
double di = INFINITY;
double dm = DBL_MAX;
@@ -61,5 +139,182 @@
++result;
}
+ di = 0;
+ dm = DBL_MIN;
+ feclearexcept (FE_ALL_EXCEPT);
+ di = nexttoward (dm, di);
+ if (di < 0 || di >= DBL_MIN)
+ {
+ puts ("nexttoward+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttoward+ did not underflow");
+ ++result;
+ }
+ di = 0;
+ feclearexcept (FE_ALL_EXCEPT);
+ di = nexttoward (-dm, -di);
+ if (di > 0 || di <= -DBL_MIN)
+ {
+ puts ("nexttoward- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttoward- did not underflow");
+ ++result;
+ }
+ di = -INFINITY;
+ feclearexcept (FE_ALL_EXCEPT);
+ dm = nexttoward (zero, inf);
+ if (dm < 0.0 || dm >= DBL_MIN)
+ {
+ puts ("nexttoward+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttoward+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttoward (dm, di) != 0.0)
+ {
+ puts ("nexttoward+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttoward+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ dm = nexttoward (copysign (zero, -1.0), -inf);
+ if (dm > 0.0 || dm <= -DBL_MIN)
+ {
+ puts ("nexttoward- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttoward- did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttoward (dm, -di) != 0.0)
+ {
+ puts ("nexttoward- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttoward- did not underflow");
+ ++result;
+ }
+
+#ifndef NO_LONG_DOUBLE
+ long double li = INFINITY;
+ long double lm = LDBL_MAX;
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttowardl (lm, li) != li)
+ {
+ puts ("nexttowardl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_OVERFLOW) == 0)
+ {
+ puts ("nexttowardl+ did not overflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttowardl (-lm, -li) != -li)
+ {
+ puts ("nexttowardl failed");
+ ++result;
+ }
+ if (fetestexcept (FE_OVERFLOW) == 0)
+ {
+ puts ("nexttowardl- did not overflow");
+ ++result;
+ }
+
+ li = 0;
+ lm = LDBL_MIN;
+ feclearexcept (FE_ALL_EXCEPT);
+ li = nexttowardl (lm, li);
+ if (li < 0 || li >= LDBL_MIN)
+ {
+ puts ("nexttowardl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardl+ did not underflow");
+ ++result;
+ }
+ li = 0;
+ feclearexcept (FE_ALL_EXCEPT);
+ li = nexttowardl (-lm, -li);
+ if (li > 0 || li <= -LDBL_MIN)
+ {
+ puts ("nexttowardl- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardl- did not underflow");
+ ++result;
+ }
+ li = -INFINITY;
+ feclearexcept (FE_ALL_EXCEPT);
+ lm = nexttowardl (zero, inf);
+ if (lm < 0.0 || lm >= LDBL_MIN)
+ {
+ puts ("nexttowardl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardl+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttowardl (lm, li) != 0.0)
+ {
+ puts ("nexttowardl+ failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardl+ did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ lm = nexttowardl (copysign (zero, -1.0), -inf);
+ if (lm > 0.0 || lm <= -LDBL_MIN)
+ {
+ puts ("nexttowardl- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardl- did not underflow");
+ ++result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ if (nexttowardl (lm, -li) != 0.0)
+ {
+ puts ("nexttowardl- failed");
+ ++result;
+ }
+ if (fetestexcept (FE_UNDERFLOW) == 0)
+ {
+ puts ("nexttowardl- did not underflow");
+ ++result;
+ }
+#endif
+
return result;
}
Modified: fsf/trunk/libc/math/math_private.h
==============================================================================
--- fsf/trunk/libc/math/math_private.h (original)
+++ fsf/trunk/libc/math/math_private.h Tue Apr 17 00:01:51 2007
@@ -332,4 +332,10 @@
extern double __slowpow (double __x, double __y, double __z);
extern void __docos (double __x, double __dx, double __v[]);
+#ifndef math_opt_barrier
+#define math_opt_barrier(x) \
+({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; })
+#define math_force_eval(x) __asm __volatile ("" : : "m" (x))
+#endif
+
#endif /* _MATH_PRIVATE_H_ */
Modified: fsf/trunk/libc/math/s_nextafter.c
==============================================================================
--- fsf/trunk/libc/math/s_nextafter.c (original)
+++ fsf/trunk/libc/math/s_nextafter.c Tue Apr 17 00:01:51 2007
@@ -26,7 +26,7 @@
#define nexttoward __internal_nexttoward
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -49,9 +49,12 @@
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
+ double u;
INSERT_WORDS(x,hy&0x80000000,1); /* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u*u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */
@@ -74,15 +77,12 @@
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
- asm ("" : "=m"(x) : "m"(x));
+ asm ("" : "+m"(x));
return x; /* overflow */
}
- if(hy<0x00100000) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- INSERT_WORDS(y,hx,lx);
- return y;
- }
+ if(hy<0x00100000) {
+ double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;
Modified: fsf/trunk/libc/math/s_nexttowardf.c
==============================================================================
--- fsf/trunk/libc/math/s_nexttowardf.c (original)
+++ fsf/trunk/libc/math/s_nexttowardf.c Tue Apr 17 00:01:51 2007
@@ -21,7 +21,7 @@
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -45,10 +45,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
- float x2;
+ float u;
SET_FLOAT_WORD(x,(u_int32_t)(hy&0x80000000)|1);/* return +-minsub*/
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hy<0||(ix>>23)>(iy>>20)-0x380
@@ -70,15 +72,12 @@
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0)
/* Force conversion to float. */
- asm ("" : "=m"(x) : "m"(x));
+ asm ("" : "+m"(x));
return x;
}
- if(hy<0x00800000) { /* underflow */
- float x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(x2,hx);
- return x2;
- }
+ if(hy<0x00800000) {
+ float u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;
Modified: fsf/trunk/libc/math/test-fenv.c
==============================================================================
--- fsf/trunk/libc/math/test-fenv.c (original)
+++ fsf/trunk/libc/math/test-fenv.c Tue Apr 17 00:01:51 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2001, 2003, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@xxxxxxx> and
Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -636,6 +637,102 @@
}
+static void
+feholdexcept_tests (void)
+{
+ fenv_t saved, saved2;
+ int res;
+
+ feclearexcept (FE_ALL_EXCEPT);
+ fedisableexcept (FE_ALL_EXCEPT);
+#ifdef FE_DIVBYZERO
+ feraiseexcept (FE_DIVBYZERO);
+#endif
+ test_exceptions ("feholdexcept_tests FE_DIVBYZERO test",
+ DIVBYZERO_EXC, 0);
+ res = feholdexcept (&saved);
+ if (res != 0)
+ {
+ printf ("feholdexcept failed: %d\n", res);
+ ++count_errors;
+ }
+#if defined FE_TONEAREST && defined FE_TOWARDZERO
+ res = fesetround (FE_TOWARDZERO);
+ if (res != 0)
+ {
+ printf ("fesetround failed: %d\n", res);
+ ++count_errors;
+ }
+#endif
+ test_exceptions ("feholdexcept_tests 0 test", NO_EXC, 0);
+ feraiseexcept (FE_INVALID);
+ test_exceptions ("feholdexcept_tests FE_INVALID test",
+ INVALID_EXC, 0);
+ res = feupdateenv (&saved);
+ if (res != 0)
+ {
+ printf ("feupdateenv failed: %d\n", res);
+ ++count_errors;
+ }
+#if defined FE_TONEAREST && defined FE_TOWARDZERO
+ res = fegetround ();
+ if (res != FE_TONEAREST)
+ {
+ printf ("feupdateenv didn't restore rounding mode: %d\n", res);
+ ++count_errors;
+ }
+#endif
+ test_exceptions ("feholdexcept_tests FE_DIVBYZERO|FE_INVALID test",
+ DIVBYZERO_EXC | INVALID_EXC, 0);
+ feclearexcept (FE_ALL_EXCEPT);
+ feraiseexcept (FE_INVALID);
+#if defined FE_TONEAREST && defined FE_UPWARD
+ res = fesetround (FE_UPWARD);
+ if (res != 0)
+ {
+ printf ("fesetround failed: %d\n", res);
+ ++count_errors;
+ }
+#endif
+ res = feholdexcept (&saved2);
+ if (res != 0)
+ {
+ printf ("feholdexcept failed: %d\n", res);
+ ++count_errors;
+ }
+#if defined FE_TONEAREST && defined FE_UPWARD
+ res = fesetround (FE_TONEAREST);
+ if (res != 0)
+ {
+ printf ("fesetround failed: %d\n", res);
+ ++count_errors;
+ }
+#endif
+ test_exceptions ("feholdexcept_tests 0 2nd test", NO_EXC, 0);
+ feraiseexcept (FE_INEXACT);
+ test_exceptions ("feholdexcept_tests FE_INEXACT test",
+ INEXACT_EXC, 0);
+ res = feupdateenv (&saved2);
+ if (res != 0)
+ {
+ printf ("feupdateenv failed: %d\n", res);
+ ++count_errors;
+ }
+#if defined FE_TONEAREST && defined FE_UPWARD
+ res = fegetround ();
+ if (res != FE_UPWARD)
+ {
+ printf ("feupdateenv didn't restore rounding mode: %d\n", res);
+ ++count_errors;
+ }
+ fesetround (FE_TONEAREST);
+#endif
+ test_exceptions ("feholdexcept_tests FE_INEXACT|FE_INVALID test",
+ INVALID_EXC | INEXACT_EXC, 0);
+ feclearexcept (FE_ALL_EXCEPT);
+}
+
+
/* IEC 559 and ISO C99 define a default startup environment */
static void
initial_tests (void)
@@ -654,6 +751,7 @@
initial_tests ();
fe_tests ();
feenv_tests ();
+ feholdexcept_tests ();
if (count_errors)
{
Modified: fsf/trunk/libc/posix/unistd.h
==============================================================================
--- fsf/trunk/libc/posix/unistd.h (original)
+++ fsf/trunk/libc/posix/unistd.h Tue Apr 17 00:01:51 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -56,7 +56,9 @@
#define _POSIX2_LOCALEDEF 200112L
/* X/Open version number to which the library conforms. It is selectable. */
-#ifdef __USE_UNIX98
+#ifdef __USE_XOPEN2K
+# define _XOPEN_VERSION 600
+#elif defined __USE_UNIX98
# define _XOPEN_VERSION 500
#else
# define _XOPEN_VERSION 4
Modified: fsf/trunk/libc/stdio-common/printf_fp.c
==============================================================================
--- fsf/trunk/libc/stdio-common/printf_fp.c (original)
+++ fsf/trunk/libc/stdio-common/printf_fp.c Tue Apr 17 00:01:51 2007
@@ -990,7 +990,7 @@
0))
/* This is a special case: the rounded number is 1.0,
the format is 'g' or 'G', and the alternative format
- is selected. This means the result mist be "1.". */
+ is selected. This means the result must be "1.". */
--added_zeros;
}
@@ -1081,12 +1081,17 @@
/* This is another special case. The exponent of the number is
really smaller than -4, which requires the 'e'/'E' format.
But after rounding the number has an exponent of -4. */
- assert (wcp >= wstartp + 2);
+ assert (wcp >= wstartp + 1);
assert (wstartp[0] == L'1');
__wmemcpy (wstartp, L"0.0001", 6);
wstartp[1] = decimalwc;
- wmemset (wstartp + 6, L'0', wcp - (wstartp + 2));
- wcp += 4;
+ if (wcp >= wstartp + 2)
+ {
+ wmemset (wstartp + 6, L'0', wcp - (wstartp + 2));
+ wcp += 4;
+ }
+ else
+ wcp += 5;
}
else
{
Modified: fsf/trunk/libc/stdio-common/tfformat.c
==============================================================================
--- fsf/trunk/libc/stdio-common/tfformat.c (original)
+++ fsf/trunk/libc/stdio-common/tfformat.c Tue Apr 17 00:01:51 2007
@@ -4020,6 +4020,7 @@
{__LINE__, 0.000956, "0.001", "%#.0g"},
{__LINE__, 0.000098, "0.0001", "%#.0g"},
{__LINE__, 0.0000996, "0.00010", "%#.2g"},
+ {__LINE__, 9.999999999999999e-05, "0.0001", "%g"},
{0 }
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 Apr 17 00:01:51 2007
@@ -1,5 +1,6 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2003, 2004, 2005, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -26,14 +27,19 @@
int
feholdexcept (fenv_t *envp)
{
- unsigned short int work;
+ fenv_t temp;
/* Store the environment. */
- __asm__ ("fnstenv %0" : "=m" (*envp));
+ __asm__ ("fnstenv %0" : "=m" (temp));
+ *envp = temp;
/* Now set all exceptions to non-stop. */
- work = envp->__control_word | 0x3f;
- __asm__ ("fldcw %0" : : "m" (*&work));
+ temp.__control_word |= 0x3f;
+
+ /* And clear all exceptions. */
+ temp.__status_word &= ~0x3f;
+
+ __asm__ ("fldenv %0" : : "m" (temp));
/* If the CPU supports SSE we set the MXCSR as well. */
if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
@@ -43,8 +49,8 @@
/* Get the current control word. */
__asm__ ("stmxcsr %0" : "=m" (*&xwork));
- /* Set all exceptions to non-stop. */
- xwork |= 0x1f80;
+ /* Set all exceptions to non-stop and clear them. */
+ xwork = (xwork | 0x1f80) & ~0x3f;
__asm__ ("ldmxcsr %0" : : "m" (*&xwork));
}
Modified: fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c Tue Apr 17 00:01:51 2007
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -20,20 +20,29 @@
#include <fenv.h>
#include <bp-sym.h>
+#include <unistd.h>
+#include <dl-procinfo.h>
+#include <ldsodefs.h>
int
__feupdateenv (const fenv_t *envp)
{
fexcept_t temp;
+ unsigned int xtemp = 0;
/* Save current exceptions. */
__asm__ ("fnstsw %0" : "=m" (*&temp));
- temp &= FE_ALL_EXCEPT;
+
+ /* If the CPU supports SSE we test the MXCSR as well. */
+ if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ __asm__ ("stmxcsr %0" : "=m" (*&xtemp));
+
+ temp = (temp | xtemp) & FE_ALL_EXCEPT;
/* Install new environment. */
fesetenv (envp);
- /* Raise the safed exception. Incidently for us the implementation
+ /* Raise the saved exception. Incidently for us the implementation
defined format of the values in objects of type fexcept_t is the
same as the ones specified using the FE_* constants. */
feraiseexcept ((int) temp);
Added: fsf/trunk/libc/sysdeps/i386/fpu/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/math_private.h (added)
+++ fsf/trunk/libc/sysdeps/i386/fpu/math_private.h Tue Apr 17 00:01:51 2007
@@ -1,0 +1,18 @@
+#ifndef _MATH_PRIVATE_H
+
+#define math_opt_barrier(x) \
+({ __typeof(x) __x; \
+ __asm ("" : "=t" (__x) : "0" (x)); \
+ __x; })
+#define math_force_eval(x) \
+do \
+ { \
+ if (sizeof (x) <= sizeof (double)) \
+ __asm __volatile ("" : : "m" (x)); \
+ else \
+ __asm __volatile ("" : : "f" (x)); \
+ } \
+while (0)
+
+#include <math/math_private.h>
+#endif
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_nextafterl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_nextafterl.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_nextafterl.c Tue Apr 17 00:01:51 2007
@@ -27,7 +27,7 @@
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
long double __nextafterl(long double x, long double y)
@@ -52,9 +52,12 @@
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|hx|lx)==0) { /* x == 0 */
+ long double u;
SET_LDOUBLE_WORDS(x,esy&0x8000,0,1);/* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(esx>=0) { /* x > 0 */
if(esx>esy||((esx==esy) && (hx>hy||((hx==hy)&&(lx>ly))))) {
@@ -109,12 +112,9 @@
}
esy = esx&0x7fff;
if(esy==0x7fff) return x+x; /* overflow */
- if(esy==0) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- SET_LDOUBLE_WORDS(y,esx,hx,lx);
- return y;
- }
+ if(esy==0) {
+ long double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_LDOUBLE_WORDS(x,esx,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_nexttoward.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_nexttoward.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_nexttoward.c Tue Apr 17 00:01:51 2007
@@ -27,7 +27,8 @@
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
+#include <float.h>
#ifdef __STDC__
double __nexttoward(double x, long double y)
@@ -52,10 +53,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
- double x2;
+ double u;
INSERT_WORDS(x,(esy&0x8000)<<16,1); /* return +-minsub */
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if (esy>=0x8000||((ix>>20)&0x7ff)>iy-0x3c00
@@ -85,16 +88,14 @@
hy = hx&0x7ff00000;
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
- /* Force conversion to double. */
- asm ("" : "=m"(x) : "m"(x));
+ if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
+ /* Force conversion to double. */
+ asm ("" : "+m"(x));
return x;
}
- if(hy<0x00100000) { /* underflow */
- double x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- INSERT_WORDS(x2,hx,lx);
- return x2;
- }
+ if(hy<0x00100000) {
+ double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/i386/fpu/s_nexttowardf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/s_nexttowardf.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/s_nexttowardf.c Tue Apr 17 00:01:51 2007
@@ -19,7 +19,8 @@
#endif
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
+#include <float.h>
#ifdef __STDC__
float __nexttowardf(float x, long double y)
@@ -44,10 +45,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
- float x2;
+ float u;
SET_FLOAT_WORD(x,((esy&0x8000)<<16)|1);/* return +-minsub*/
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(esy>=0x8000||((ix>>23)&0xff)>iy-0x3f80
@@ -69,16 +72,14 @@
hy = hx&0x7f800000;
if(hy>=0x7f800000) {
x = x+x; /* overflow */
- /* Force conversion to float. */
- asm ("" : "=m"(x) : "m"(x));
+ if (FLT_EVAL_METHOD != 0)
+ /* Force conversion to float. */
+ asm ("" : "+m"(x));
return x;
}
- if(hy<0x00800000) { /* underflow */
- float x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(x2,hx);
- return x2;
- }
+ if(hy<0x00800000) {
+ float u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;
Modified: fsf/trunk/libc/sysdeps/ia64/fpu/feholdexcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ia64/fpu/feholdexcpt.c (original)
+++ fsf/trunk/libc/sysdeps/ia64/fpu/feholdexcpt.c Tue Apr 17 00:01:51 2007
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 1997, 1999, 2000, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@xxxxxxx>, 1999
@@ -23,12 +23,20 @@
int
feholdexcept (fenv_t *envp)
{
+ fenv_t fpsr;
/* Save the current state. */
- fegetenv (envp);
+ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));
+ *envp = fpsr;
- /* set the trap disable bit */
- __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (*envp | FE_ALL_EXCEPT));
+ /* Set the trap disable bits. */
+ fpsr |= FE_ALL_EXCEPT;
- return 1;
+ /* And clear the exception bits. */
+ fpsr &= ~(fenv_t) (FE_ALL_EXCEPT << 13);
+
+ __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr));
+
+ /* Success. */
+ return 0;
}
libm_hidden_def (feholdexcept)
Modified: fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c Tue Apr 17 00:01:51 2007
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@xxxxxxx>, 1999.
@@ -32,10 +32,8 @@
/* Install new environment. */
fesetenv (envp);
- /* Raise the safed exception. Incidently for us the implementation
- defined format of the values in objects of type fexcept_t is the
- same as the ones specified using the FE_* constants. */
- feraiseexcept ((int) fpsr & FE_ALL_EXCEPT);
+ /* Raise the saved exceptions. */
+ feraiseexcept ((int) (fpsr >> 13) & FE_ALL_EXCEPT);
/* Success. */
return 0;
Modified: fsf/trunk/libc/sysdeps/ieee754/flt-32/s_nextafterf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/flt-32/s_nextafterf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/flt-32/s_nextafterf.c Tue Apr 17 00:01:51 2007
@@ -18,7 +18,7 @@
#endif
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -40,9 +40,12 @@
return x+y;
if(x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
+ float u;
SET_FLOAT_WORD(x,(hy&0x80000000)|1);/* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u*u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hx>hy) { /* x > y, x -= ulp */
@@ -61,15 +64,12 @@
if(hy>=0x7f800000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0)
- asm ("" : "=m"(x) : "m"(x));
+ asm ("" : "+m"(x));
return x; /* overflow */
}
- if(hy<0x00800000) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(y,hx);
- return y;
- }
+ if(hy<0x00800000) {
+ float u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nextafterl.c Tue Apr 17 00:01:51 2007
@@ -25,7 +25,7 @@
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
long double __nextafterl(long double x, long double y)
@@ -47,9 +47,12 @@
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
+ long double u;
SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */
@@ -70,12 +73,9 @@
}
hy = hx&0x7fff000000000000LL;
if(hy==0x7fff000000000000LL) return x+x;/* overflow */
- if(hy==0) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- SET_LDOUBLE_WORDS64(y,hx,lx);
- return y;
- }
+ if(hy==0) {
+ long double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_LDOUBLE_WORDS64(x,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128/s_nexttoward.c Tue Apr 17 00:01:51 2007
@@ -26,7 +26,7 @@
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -53,10 +53,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
- double x2;
+ double u;
INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if (hy<0||(ix>>20)>(iy>>48)-0x3c00
@@ -87,16 +89,13 @@
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
- /* Force conversion to float. */
- asm ("" : "=m"(x) : "m"(x));
+ /* Force conversion to double. */
+ asm ("" : "+m"(x));
return x;
}
- if(hy<0x00100000) { /* underflow */
- double x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- INSERT_WORDS(x2,hx,lx);
- return x2;
- }
+ if(hy<0x00100000) {
+ double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c Tue Apr 17 00:01:51 2007
@@ -24,8 +24,8 @@
* Special cases:
*/
-#include "math.h"
-#include "math_private.h"
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#ifdef __STDC__
@@ -53,9 +53,12 @@
if(x==y)
return y; /* x=y, return y */
if(ihx == 0 && ilx == 0) { /* x == 0 */
+ long double u;
SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (u);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(ihx>=0) { /* x > 0 */
if(ihx>ihy||((ihx==ihy)&&(ilx>ily))) { /* x > y, x -= ulp */
@@ -93,12 +96,9 @@
}
hy = hx&0x7ff0000000000000LL;
if(hy==0x7ff0000000000000LL) return x+x;/* overflow */
- if(hy==0) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- SET_LDOUBLE_WORDS64(y,hx,lx);
- return y;
- }
+ if(hy==0) {
+ long double u = x * x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_LDOUBLE_WORDS64(x,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c Tue Apr 17 00:01:51 2007
@@ -26,7 +26,7 @@
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -55,10 +55,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
- double x2;
+ double u;
INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if (hy<0||(ix>>20)>(iy>>52)
@@ -89,16 +91,13 @@
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
- /* Force conversion to float. */
- asm ("" : "=m"(x) : "m"(x));
+ /* Force conversion to double. */
+ asm ("" : "+m"(x));
return x;
}
- if(hy<0x00100000) { /* underflow */
- double x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- INSERT_WORDS(x2,hx,lx);
- return x2;
- }
+ if(hy<0x00100000) {
+ double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c Tue Apr 17 00:01:51 2007
@@ -19,8 +19,9 @@
#endif
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#include <math_ldbl_opt.h>
+#include <float.h>
#ifdef __STDC__
float __nexttowardf(float x, long double y)
@@ -46,10 +47,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
- float x2;
+ float u;
SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hy<0||(ix>>23)>(iy>>52)-0x380
@@ -69,13 +72,16 @@
}
}
hy = hx&0x7f800000;
- if(hy>=0x7f800000) return x+x; /* overflow */
+ if(hy>=0x7f800000) {
+ x = x+x; /* overflow */
+ if (FLT_EVAL_METHOD != 0)
+ /* Force conversion to float. */
+ asm ("" : "+m"(x));
+ return x;
+ }
if(hy<0x00800000) { /* underflow */
- float x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(x2,hx);
- return x2;
- }
+ float u = x*x;
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nextafterl.c Tue Apr 17 00:01:51 2007
@@ -26,7 +26,7 @@
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
long double __nextafterl(long double x, long double y)
@@ -48,9 +48,12 @@
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|hx|lx)==0) { /* x == 0 */
+ long double u;
SET_LDOUBLE_WORDS(x,esy&0x8000,0,1);/* return +-minsubnormal */
- y = x*x;
- if(y==x) return y; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(esx<0x8000) { /* x > 0 */
if(ix>iy||((ix==iy) && (hx>hy||((hx==hy)&&(lx>ly))))) {
@@ -85,13 +88,10 @@
}
}
esy = esx&0x7fff;
- if(esy==0x7fff) return x+x; /* overflow */
- if(esy==0) { /* underflow */
- y = x*x;
- if(y!=x) { /* raise underflow flag */
- SET_LDOUBLE_WORDS(y,esx,hx,lx);
- return y;
- }
+ if(esy==0x7fff) return x+x; /* overflow */
+ if(esy==0) {
+ long double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_LDOUBLE_WORDS(x,esx,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttoward.c Tue Apr 17 00:01:51 2007
@@ -26,7 +26,7 @@
*/
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
#include <float.h>
#ifdef __STDC__
@@ -50,10 +50,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
- double x2;
+ double u;
INSERT_WORDS(x,(esy&0x8000)<<16,1); /* return +-minsub */
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if (esy>=0x8000||((ix>>20)&0x7ff)>iy-0x3c00
@@ -84,16 +86,13 @@
if(hy>=0x7ff00000) {
x = x+x; /* overflow */
if (FLT_EVAL_METHOD != 0 && FLT_EVAL_METHOD != 1)
- /* Force conversion to float. */
- asm ("" : "=m"(x) : "m"(x));
+ /* Force conversion to double. */
+ asm ("" : "+m"(x));
return x;
}
- if(hy<0x00100000) { /* underflow */
- double x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- INSERT_WORDS(x2,hx,lx);
- return x2;
- }
+ if(hy<0x00100000) {
+ double u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
INSERT_WORDS(x,hx,lx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_nexttowardf.c Tue Apr 17 00:01:51 2007
@@ -18,7 +18,8 @@
#endif
#include "math.h"
-#include "math_private.h"
+#include <math_private.h>
+#include <float.h>
#ifdef __STDC__
float __nexttowardf(float x, long double y)
@@ -41,10 +42,12 @@
return x+y;
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
- float x2;
+ float u;
SET_FLOAT_WORD(x,((esy&0x8000)<<16)|1);/* return +-minsub*/
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(esy>=0x8000||((ix>>23)&0xff)>iy-0x3f80
@@ -64,13 +67,16 @@
}
}
hy = hx&0x7f800000;
- if(hy>=0x7f800000) return x+x; /* overflow */
- if(hy<0x00800000) { /* underflow */
- float x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(x2,hx);
- return x2;
- }
+ if(hy>=0x7f800000) {
+ x = x+x; /* overflow */
+ if (FLT_EVAL_METHOD != 0)
+ /* Force conversion to float. */
+ asm ("" : "+m"(x));
+ return x;
+ }
+ if(hy<0x00800000) {
+ float u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;
Modified: fsf/trunk/libc/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c Tue Apr 17 00:01:51 2007
@@ -20,7 +20,10 @@
* Special cases:
*/
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
+#include <float.h>
float __nldbl_nexttowardf(float x, double y);
@@ -39,10 +42,12 @@
return x+y;
if((double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
- float x2;
+ float u;
SET_FLOAT_WORD(x,(u_int32_t)(hy&0x80000000)|1);/* return +-minsub*/
- x2 = x*x;
- if(x2==x) return x2; else return x; /* raise underflow flag */
+ u = math_opt_barrier (x);
+ u = u * u;
+ math_force_eval (u); /* raise underflow flag */
+ return x;
}
if(hx>=0) { /* x > 0 */
if(hy<0||(ix>>23)>(iy>>20)-0x380
@@ -60,13 +65,16 @@
hx += 1;
}
hy = hx&0x7f800000;
- if(hy>=0x7f800000) return x+x; /* overflow */
- if(hy<0x00800000) { /* underflow */
- float x2 = x*x;
- if(x2!=x) { /* raise underflow flag */
- SET_FLOAT_WORD(x2,hx);
- return x2;
- }
+ if(hy>=0x7f800000) {
+ x = x+x; /* overflow */
+ if (FLT_EVAL_METHOD != 0)
+ /* Force conversion to float. */
+ asm ("" : "+m"(x));
+ return x;
+ }
+ if(hy<0x00800000) {
+ float u = x*x; /* underflow */
+ math_force_eval (u); /* raise underflow flag */
}
SET_FLOAT_WORD(x,hx);
return x;
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/fedisblxcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/fedisblxcpt.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/fedisblxcpt.c Tue Apr 17 00:01:51 2007
@@ -1,5 +1,5 @@
/* Disable floating-point exceptions.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@xxxxxxx>, 2001.
@@ -24,7 +24,7 @@
fedisableexcept (int excepts)
{
unsigned short int new_exc, old_exc;
- unsigned int new, old;
+ unsigned int new;
excepts &= FE_ALL_EXCEPT;
@@ -40,8 +40,6 @@
__asm__ ("stmxcsr %0" : "=m" (*&new));
/* The SSE exception masks are shifted by 7 bits. */
- old = (~new) & (FE_ALL_EXCEPT << 7);
-
new |= excepts << 7;
__asm__ ("ldmxcsr %0" : : "m" (*&new));
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/feenablxcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/feenablxcpt.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/feenablxcpt.c Tue Apr 17 00:01:51 2007
@@ -1,5 +1,5 @@
/* Enable floating-point exceptions.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@xxxxxxx>, 2001.
@@ -24,7 +24,7 @@
feenableexcept (int excepts)
{
unsigned short int new_exc, old_exc;
- unsigned int new, old;
+ unsigned int new;
excepts &= FE_ALL_EXCEPT;
@@ -40,8 +40,6 @@
__asm__ ("stmxcsr %0" : "=m" (*&new));
/* The SSE exception masks are shifted by 7 bits. */
- old = (~new) & (FE_ALL_EXCEPT << 7);
-
new &= ~(excepts << 7);
__asm__ ("ldmxcsr %0" : : "m" (*&new));
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/feholdexcpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/feholdexcpt.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/feholdexcpt.c Tue Apr 17 00:01:51 2007
@@ -1,5 +1,5 @@
/* Store current floating-point environment and clear exceptions.
- Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,19 +22,24 @@
int
feholdexcept (fenv_t *envp)
{
- unsigned short int work;
unsigned int mxcsr;
+ fenv_t temp;
/* Store the environment. */
__asm__ ("fnstenv %0\n"
- "stmxcsr %1" : "=m" (*envp), "=m" (envp->__mxcsr));
+ "stmxcsr %1" : "=m" (temp), "=m" (temp.__mxcsr));
+ *envp = temp;
/* Now set all exceptions to non-stop, first the x87 FPU. */
- work = envp->__control_word | 0x3f;
- __asm__ ("fldcw %0" : : "m" (*&work));
+ temp.__control_word |= 0x3f;
+
+ /* And clear all exceptions. */
+ temp.__status_word &= ~0x3f;
+
+ __asm__ ("fldenv %0" : : "m" (temp));
/* Set the SSE MXCSR register. */
- mxcsr = envp->__mxcsr | 0x1f80;
+ mxcsr = (envp->__mxcsr | 0x1f80) & ~0x3f;
__asm__ ("ldmxcsr %0" : : "m" (*&mxcsr));
return 0;
Added: fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c Tue Apr 17 00:01:51 2007
@@ -1,0 +1,51 @@
+/* Install given floating-point environment and raise exceptions.
+ Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
+
+ 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <fenv.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+ fexcept_t temp;
+ unsigned int xtemp;
+
+ /* Save current exceptions. */
+ __asm__ ("fnstsw %0\n\tstmxcsr %1" : "=m" (*&temp), "=m" (xtemp));
+ temp = (temp | xtemp) & FE_ALL_EXCEPT;
+
+ /* Install new environment. */
+ fesetenv (envp);
+
+ /* Raise the saved exception. Incidently for us the implementation
+ defined format of the values in objects of type fexcept_t is the
+ same as the ones specified using the FE_* constants. */
+ feraiseexcept ((int) temp);
+
+ /* Success. */
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__feupdateenv, __old_feupdateenv)
+compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
+#endif
+
+versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
Added: fsf/trunk/libc/sysdeps/x86_64/fpu/math_private.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/math_private.h (added)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/math_private.h Tue Apr 17 00:01:51 2007
@@ -1,0 +1,21 @@
+#ifndef _MATH_PRIVATE_H
+
+#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)
+
+#include <math/math_private.h>
+#endif