+2007-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ * elf/dl-open.c (dl_open_worker): Declare l in 2 different
+ smaller scopes.
+ * elf/dl-dst.h (DL_DST_REQ_STATIC): Add l as macro argument.
+ (DL_DST_REQUIRED): Adjust user.
+
+ * include/dlfcn.h (struct link_map): New forward decl.
+
+ * inet/getnameinfo.c: Include stddef.h.
+ (getnameinfo): Use offsetof.
+
+ * time/tst-mktime2.c (do_test): Don't rely on signed wrap.
+
+ * stdio-common/vfprintf.c (_itoa): Undef before redefining.
+
+ * string/strerror_l.c: Include stdlib.h.
+
+ * configure.in (libc_cv_gnu89_inline): Test for -fgnu89-inline.
+ * config.make.in (gnu89-inline-CFLAGS): New variable.
+ * Makeconfig (CFLAGS): Use $(gnu89-inline-CFLAGS) together with
+ -std=gnu99.
+ * misc/sys/cdefs.h (__extern_inline, __extern_always_inline): Define.
+ * argp/argp.h: Use it.
+ * bits/mathinline.h: Likewise.
+ * bits/sigset.h: Likewise.
+ * bits/string.h: Likewise.
+ * ctype/ctype.h: Likewise.
+ * hurd/hurd.h: Likewise.
+ * hurd/hurd/fd.h: Likewise.
+ * hurd/hurd/port.h: Likewise.
+ * hurd/hurd/signal.h: Likewise.
+ * hurd/hurd/threadvar.h: Likewise.
+ * hurd/hurd/userlink.h: Likewise.
+ * io/sys/stat.h: Likewise.
+ * libio/bits/stdio.h: Likewise.
+ * libio/bits/stdio2.h: Likewise.
+ * mach/lock-intern.h: Likewise.
+ * mach/mach/mig_support.h: Likewise.
+ * math/bits/cmathcalls.h: Likewise.
+ * posix/bits/unistd.h: Likewise.
+ * socket/bits/socket2.h: Likewise.
+ * stdlib/bits/stdlib.h: Likewise.
+ * stdlib/stdlib.h: Likewise.
+ * string/argz.h: Likewise.
+ * string/bits/string2.h: Likewise.
+ * string/bits/string3.h: Likewise.
+ * sysdeps/alpha/fpu/bits/mathinline.h: Likewise.
+ * sysdeps/generic/inttypes.h: Likewise.
+ * sysdeps/generic/machine-lock.h: Likewise.
+ * sysdeps/generic/machine-sp.h: Likewise.
+ * sysdeps/i386/fpu/bits/mathinline.h: Likewise.
+ * sysdeps/i386/i486/bits/string.h: Likewise.
+ * sysdeps/ia64/fpu/bits/mathinline.h: Likewise.
+ * sysdeps/mach/alpha/machine-lock.h: Likewise.
+ * sysdeps/mach/alpha/machine-sp.h: Likewise.
+ * sysdeps/mach/i386/machine-lock.h: Likewise.
+ * sysdeps/mach/powerpc/machine-lock.h: Likewise.
+ * sysdeps/mach/powerpc/machine-sp.h: Likewise.
+ * sysdeps/powerpc/fpu/bits/mathinline.h: Likewise.
+ * sysdeps/s390/bits/string.h: Likewise.
+ * sysdeps/s390/fpu/bits/mathinline.h: Likewise.
+ * sysdeps/sparc/fpu/bits/mathinline.h: Likewise.
+ * sysdeps/unix/bsd/bsd4.4/bits/socket.h: Likewise.
+ * sysdeps/unix/sysv/linux/bits/sigset.h: Likewise.
+ * sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
+ * sysdeps/unix/sysv/linux/sys/sysmacros.h: Likewise.
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Likewise.
+ * wcsmbs/bits/wchar2.h: Likewise.
+ * wcsmbs/wchar.h: Likewise.
+ * stdlib/gmp.h: Likewise. Include <features.h> to get
+ __extern_inline definition.
+
+2007-03-15 Jakub Jelinek <jakub@redhat.com>
+
+ * locale/programs/ld-ctype.c (find_translit): Return NULL if ctype is
+ NULL.
+
+ [BZ #3919]
+ * math/libm-test.inc (log_test): Test -Inf and NaN.
+ (log10_test, log1p_test, log2_test): Test -Inf.
+ * sysdeps/i386/fpu/e_log.S (__ieee754_log): Don't raise
+ FE_INVALID when argument is qNaN.
+ * sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Likewise.
+ * sysdeps/i386/fpu/e_logf.S (__ieee754_logf): Likewise.
+ * sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.
+ * sysdeps/x86_64/fpu/e_log10l.S (__ieee754_log10l): Replace
+ andb $1, %ah with testb $1, %ah, don't test for parity, instead
+ testb $4, %ah and jump if non-zero.
+ * sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Likewise.
+ * sysdeps/x86_64/fpu/s_log1pl.S (__log1pl): Likewise.
+
+ [BZ #4101]
+ * argp/argp-help.c (hol_cluster_cmp): Fix comparisons used to find
+ ancestors with the same depths.
+ Patch by Niels Moeller <nisse@lysator.liu.se>.
+ (filter_doc): Don't crash if argp is NULL.
+ * argp/Makefile (tests): Add tst-argp2.
+ * argp/tst-argp2.c: New test.
+
+ [BZ #4130]
+ * login/utmp_file.c (setutent_file): Use O_LARGEFILE for
+ open_not_cancel_2.
+ (updwtmp_file): Likewise.
+
+ [BZ #4181]
+ * inet/inet6_opt.c (add_padding): Only insert padding if npad > 0.
+ (inet6_opt_append): Don't check extlen is big enough if extbuf
+ is NULL.
+ (inet6_opt_finish): Likewise.
+ * inet/Makefile (tests): Add test-inet6_opt.
+ * inet/test-inet6_opt.c: New test.
+
+ * sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request): Never
+ reallocate the buffer, instead fail for MSG_TRUNC or for EBUSY
+ NLMSG_ERR. Instead use a page sized buffer.
+ * sysdeps/unix/sysv/linux/check_pf.c (make_request): Use page sized
+ buffer.
+
+2007-03-14 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/fpu/s_llround.c: New file.
+ * sysdeps/alpha/fpu/s_llroundf.c: New file.
+ * sysdeps/alpha/fpu/s_lround.c: New file.
+ * sysdeps/alpha/fpu/s_lroundf.c: New file.
+ * sysdeps/alpha/fpu/s_round.c: New file.
+ * sysdeps/alpha/fpu/s_roundf.c: New file.
+ * sysdeps/alpha/fpu/s_trunc.c: New file.
+ * sysdeps/alpha/fpu/s_truncf.c: New file.
+
+ * sysdeps/alpha/fpu/s_ceil.c: Rewrite without branches.
+ * sysdeps/alpha/fpu/s_ceilf.c: Likewise.
+ * sysdeps/alpha/fpu/s_floor.c: Likewise.
+ * sysdeps/alpha/fpu/s_floorf.c: Likewise.
+ * sysdeps/alpha/fpu/s_rint.c: Likewise.
+ * sysdeps/alpha/fpu/s_rintf.c: Likewise.
+
+ * sysdeps/alpha/fpu/s_fmax.S: New file.
+ * sysdeps/alpha/fpu/s_fmaxf.S: New file.
+ * sysdeps/alpha/fpu/s_fmin.S: New file.
+ * sysdeps/alpha/fpu/s_fminf.S: New file.
+ * sysdeps/alpha/fpu/s_isnan.c: New file.
+ * sysdeps/alpha/fpu/s_isnanf.c: New file.
+ * sysdeps/alpha/fpu/s_llrint.c: New file.
+ * sysdeps/alpha/fpu/s_llrintf.c: New file.
+ * sysdeps/alpha/fpu/s_lrint.c: New file.
+ * sysdeps/alpha/fpu/s_lrintf.c: New file.
+ * sysdeps/alpha/fpu/s_nearbyint.c: New file.
+ * sysdeps/alpha/fpu/s_nearbyintf.c: New file.
+
+ * sysdeps/alpha/fpu/bits/mathinline.h (__floorf, __floor): Remove.
+ (__fdimf, fdimf, __fdim, fdim): Remove.
+ (__signbitf, __signbit, __signbitl): Use gcc builtin if available.
+ (__isnanf, __isnan, __isnanl): New.
+
+2007-03-13 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/ieee754/ldbl-128/Makefile: New file.
+
+2007-03-13 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/Makefile (sysdep-CFLAGS): Force dynamic rounding.
+ * sysdeps/alpha/fpu/bits/mathinline.h (__signbitl): New.
+ * sysdeps/alpha/fpu/libm-test-ulps: Regenerate.
+ * sysdeps/unix/sysv/linux/alpha/alphaev6/fpu/Implies: New file.
+ * sysdeps/unix/sysv/linux/alpha/alphaev67/fpu/Implies: New file.
+ * sysdeps/unix/sysv/linux/alpha/fpu/Implies: New file.
+
+2007-03-13 Richard Henderson <rth@redhat.com>
+
+ * elf/dl-support.c (_dl_aux_init): Honor DL_PLATFORM_AUXV.
+ * sysdeps/unix/sysv/linux/alpha/dl-auxv.h: New file.
+ * sysdeps/unix/sysv/linux/alpha/dl-support.c: New file.
+ * sysdeps/unix/sysv/linux/alpha/dl-sysdep.c (__libc_alpha_cache_shape):
+ Move to dl-auxv.h; initialize instead of extern weak.
+ (DL_PLATFORM_AUXV): Move to dl-auxv.h; don't test for undef
+ weak symbol.
+ * sysdeps/unix/sysv/linux/alpha/sysconf.c (__libc_alpha_cache_shape):
+ Extern instead of initialized.
+
+2007-03-13 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Add support for
+ __sigsuspend_nocancel.
+
+2007-03-06 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/posix/getaddrinfo.c (get_scope): Correct test for
+ 172.16/12 address range.
+
+2007-03-02 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request): Retry with
+ a new netlink socket if NLMSG_ERR -EBUSY is seen after some MSG_TRUNC
+ message.
+
+2007-03-01 Jakub Jelinek <jakub@redhat.com>
+
+ [BZ #4069]
+ * sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Check for NaN
+ earlier.
+ * math/libm-test.inc (pow_test): Add more tests involving NaNs.
+
+ * sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Avoid invalid exception
+ for x qNaN and y either +-inf or non-integer value.
+ * sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Likewise.
+ * sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise.
+ * sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Likewise.
+
+2007-02-10 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/sh/Makefile: Remove sys/io.h
+ from sysdep_headers.
+
+2007-02-28 Jakub Jelinek <jakub@redhat.com>
+
+ * time/tzfile.c (find_transition): Instead of a linear search try to
+ guess the transition index, use a linear search if the result is at
+ most 10 transitions away from the guess or binary search otherwise.
+
+2007-02-27 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request): Fix
+ memory reallocation.
+
2007-02-21 Ulrich Drepper <drepper@redhat.com>
+ * stdlib/strtod_l.c (____STRTOF_INTERNAL): Add branch predictions
+ and fix some typos.
+ Optimize use of TOLOWER.
+
+ [BZ #3325]
+ * sysdeps/i386/fpu/e_fmodf.S: Revert last changes, keep using fprem.
+ * sysdeps/i386/fpu/e_fmodl.c: Likewise.
+ * sysdeps/i386/fpu/e_fmod.S: Likewise.
+
+ [BZ #3458]
+ * sysdeps/unix/sysv/linux/posix_madvise.c: New file.
+ * sysdeps/unix/sysv/linux/syscalls.list: Remove posix_madvise entry.
+
[BZ #4076]
* io/ftw.c (ftw_startup): Handle special case of FTW_CHDIR in /.
(open_dir_stream): Likewise.
[BZ #4070]
* stdio-common/printf_fp.c (___printf_fp): Handle a few more
- * stdio-common/tfformat.c (sprint_doubles): Some more tests.
special cases.
+ * stdio-common/tfformat.c (sprint_doubles): Some more tests.
2007-02-19 Ulrich Drepper <drepper@redhat.com>
-# Copyright (C) 1991-2003,2004,2005,2006 Free Software Foundation, Inc.
+# Copyright (C) 1991-2003,2004,2005,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
$(foreach lib,$(libof-$(basename $(@F))) \
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-override CFLAGS = -std=gnu99 \
+override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
$(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
$(CFLAGS-$(@F))
-# Copyright (C) 1997, 2002, 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2002, 2003, 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
routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
pvh xinl eexst)
-tests = argp-test tst-argp1 bug-argp1
+tests = argp-test tst-argp1 bug-argp1 tst-argp2
CFLAGS-argp-help.c = $(uses-callbacks) -fexceptions
CFLAGS-argp-parse.c = $(uses-callbacks)
/* Hierarchial argument parsing help output
- Copyright (C) 1995-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
{
/* If one cluster is deeper than the other, use its ancestor at the same
level, so that finding the common ancestor is straightforward. */
- while (cl1->depth < cl2->depth)
+ while (cl1->depth > cl2->depth)
cl1 = cl1->parent;
- while (cl2->depth < cl1->depth)
+ while (cl2->depth > cl1->depth)
cl2 = cl2->parent;
/* Now reduce both clusters to their ancestors at the point where both have
filter_doc (const char *doc, int key, const struct argp *argp,
const struct argp_state *state)
{
- if (argp->help_filter)
+ if (argp && argp->help_filter)
/* We must apply a user filter to this output. */
{
void *input = __argp_input (argp, state);
/* Hierarchial argument parsing, layered over getopt.
- Copyright (C) 1995-1999,2003,2004,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
# endif
# ifndef ARGP_EI
-# define ARGP_EI extern __inline__
+# define ARGP_EI __extern_inline
# endif
ARGP_EI void
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2007.
+
+ 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 <argp.h>
+
+static const struct argp_option opt1[] =
+ {
+ { "opt1", '1', "NUMBER", 0, "Option 1" },
+ { NULL, 0, NULL, 0, NULL }
+ };
+
+static const struct argp_option opt2[] =
+ {
+ { "opt2", '2', "NUMBER", 0, "Option 2" },
+ { NULL, 0, NULL, 0, NULL }
+ };
+
+static const struct argp_option opt3[] =
+ {
+ { "opt3", '3', "NUMBER", 0, "Option 3" },
+ { NULL, 0, NULL, 0, NULL }
+ };
+
+static const struct argp_option opt4[] =
+ {
+ { "opt4", '4', "NUMBER", 0, "Option 4" },
+ { NULL, 0, NULL, 0, NULL }
+ };
+
+static const struct argp_option opt5[] =
+ {
+ { "opt5", '5', "NUMBER", 0, "Option 5" },
+ { NULL, 0, NULL, 0, NULL }
+ };
+
+static struct argp argp5 =
+ {
+ opt5, NULL, "args doc5", "doc5", NULL, NULL, NULL
+ };
+
+static struct argp argp4 =
+ {
+ opt4, NULL, "args doc4", "doc4", NULL, NULL, NULL
+ };
+
+static struct argp argp3 =
+ {
+ opt3, NULL, "args doc3", "doc3", NULL, NULL, NULL
+ };
+
+static struct argp_child children2[] =
+ {
+ { &argp4, 0, "child3", 3 },
+ { &argp5, 0, "child4", 4 },
+ { NULL, 0, NULL, 0 }
+ };
+
+static struct argp argp2 =
+ {
+ opt2, NULL, "args doc2", "doc2", children2, NULL, NULL
+ };
+
+static struct argp_child children1[] =
+ {
+ { &argp2, 0, "child1", 1 },
+ { &argp3, 0, "child2", 2 },
+ { NULL, 0, NULL, 0 }
+ };
+
+static struct argp argp1 =
+ {
+ opt1, NULL, "args doc1", "doc1", children1, NULL, NULL
+ };
+
+
+static int
+do_test (void)
+{
+ argp_help (&argp1, stdout, ARGP_HELP_LONG, (char *) "tst-argp2");
+ return 0;
+}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
/* This file should provide inline versions of math functions.
- Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
+ Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
This file should define __MATH_INLINES if functions are actually defined as
inlines. */
/* __sig_atomic_t, __sigset_t, and related definitions. Generic/BSD version.
- Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1994, 1996, 1997, 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
#define _SIGSET_H_fns 1
#ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
#endif
/* Return a mask that includes SIG only. The cast to `sigset_t' avoids
/* This file should provide inline versions of string functions.
- Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
+ Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
This file should define __STRING_INLINES if functions are actually defined
as inlines. */
enable-check-abi = @enable_check_abi@
have-forced-unwind = @libc_cv_forced_unwind@
have-fpie = @libc_cv_fpie@
+gnu89-inline-CFLAGS = @libc_cv_gnu89_inline@
have-ssp = @libc_cv_ssp@
have-selinux = @have_selinux@
have-libaudit = @have_libaudit@
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_gnu89_inline libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
echo "${ECHO_T}$libc_cv_ssp" >&6
+echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5
+echo $ECHO_N "checking for -fgnu89-inline... $ECHO_C" >&6
+if test "${libc_cv_gnu89_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat > conftest.c <<EOF
+int foo;
+#ifdef __GNUC_GNU_INLINE__
+main () { return 0;}
+#else
+#error
+#endif
+EOF
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -std=gnu99 -fgnu89-inline
+ -o conftest conftest.c 1>&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }
+then
+ libc_cv_gnu89_inline=yes
+else
+ libc_cv_gnu89_inline=no
+fi
+rm -f conftest*
+fi
+echo "$as_me:$LINENO: result: $libc_cv_gnu89_inline" >&5
+echo "${ECHO_T}$libc_cv_gnu89_inline" >&6
+if test $libc_cv_gnu89_inline = yes; then
+ libc_cv_gnu89_inline=-fgnu89-inline
+else
+ libc_cv_gnu89_inline=
+fi
+
+
if test $elf != yes; then
echo "$as_me:$LINENO: checking for .init and .fini sections" >&5
echo $ECHO_N "checking for .init and .fini sections... $ECHO_C" >&6
s,@libc_cv_hashstyle@,$libc_cv_hashstyle,;t t
s,@fno_unit_at_a_time@,$fno_unit_at_a_time,;t t
s,@libc_cv_ssp@,$libc_cv_ssp,;t t
+s,@libc_cv_gnu89_inline@,$libc_cv_gnu89_inline,;t t
s,@libc_cv_have_initfini@,$libc_cv_have_initfini,;t t
s,@no_whole_archive@,$no_whole_archive,;t t
s,@exceptions@,$exceptions,;t t
rm -f conftest*])
AC_SUBST(libc_cv_ssp)
+AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
+cat > conftest.c <<EOF
+int foo;
+#ifdef __GNUC_GNU_INLINE__
+main () { return 0;}
+#else
+#error
+#endif
+EOF
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -std=gnu99 -fgnu89-inline
+ -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+ libc_cv_gnu89_inline=yes
+else
+ libc_cv_gnu89_inline=no
+fi
+rm -f conftest*])
+if test $libc_cv_gnu89_inline = yes; then
+ libc_cv_gnu89_inline=-fgnu89-inline
+else
+ libc_cv_gnu89_inline=
+fi
+AC_SUBST(libc_cv_gnu89_inline)
+
if test $elf != yes; then
AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
[AC_TRY_COMPILE(, [asm (".section .init");
-/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
# endif
# ifdef __USE_EXTERN_INLINES
-extern __inline int
+__extern_inline int
__NTH (tolower (int __c))
{
return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
}
-extern __inline int
+__extern_inline int
__NTH (toupper (int __c))
{
return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
/* Handling of dynamic sring tokens.
- Copyright (C) 1999,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
+ Copyright (C) 1999,2001,2002,2003,2004,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
\
First get the origin string if it is not available yet. \
This can only happen for the map of the executable. */ \
- DL_DST_REQ_STATIC \
+ DL_DST_REQ_STATIC (l) \
if ((l)->l_origin == NULL) \
{ \
assert ((l)->l_name[0] == '\0'); \
__len; })
#ifdef SHARED
-# define DL_DST_REQ_STATIC /* nothing */
+# define DL_DST_REQ_STATIC(l) /* nothing */
#else
-# define DL_DST_REQ_STATIC \
+# define DL_DST_REQ_STATIC(l) \
if ((l) == NULL) \
{ \
const char *origin = _dl_get_origin (); \
struct dl_open_args *args = a;
const char *file = args->file;
int mode = args->mode;
- struct link_map *new, *l;
+ struct link_map *new;
int lazy;
unsigned int i;
bool any_tls = false;
By default we assume this is the main application. */
call_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
+ struct link_map *l;
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
if (caller_dlopen >= (const void *) l->l_map_start
/* Relocate the objects loaded. We do this in reverse order so that copy
relocs of earlier objects overwrite the data written by later objects. */
- l = new;
+ struct link_map *l = new;
while (l->l_next)
l = l->l_next;
while (1)
__libc_enable_secure = av->a_un.a_val;
__libc_enable_secure_decided = 1;
break;
+# ifdef DL_PLATFORM_AUXV
+ DL_PLATFORM_AUXV
+# endif
}
if (seen == 0xf)
{
glibc-base := HEAD
DIST_BRANCH := devel
COLLECTION := dist-fc7
-fedora-sync-date := 2007-02-21 10:11 UTC
-fedora-sync-tag := fedora-glibc-20070221T1011
+fedora-sync-date := 2007-03-17 21:30 UTC
+fedora-sync-tag := fedora-glibc-20070317T2130
-%define glibcrelease 18
+%define glibcrelease 19
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define xenarches i686 athlon
%ifarch %{xenarches}
%endif
%changelog
+* Sat Mar 17 2007 Jakub Jelinek <jakub@redhat.com> 2.5.90-19
+- fix power6 libm compat symbols on ppc32 (#232633)
+- fix child refcntr in NPTL fork (#230198)
+- fix ifaddrs with many net devices on > 4KB page size arches (#230151)
+- fix pthread_mutex_timedlock on x86_64 (#228103)
+- various fixes (BZ#3919, BZ#4101, BZ#4130, BZ#4181, BZ#4069, BZ#3458)
+
* Wed Feb 21 2007 Jakub Jelinek <jakub@redhat.com> 2.5.90-18
- fix nftw with FTW_CHDIR on / (BZ#4076)
- nscd fixes (BZ#4074)
-/* Copyright (C) 1993,94,95,96,97,98,99,2001,02 Free Software Foundation, Inc.
+/* Copyright (C) 1993,94,95,96,97,98,99,2001,2002,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
#include <errno.h>
#ifndef _HURD_H_EXTERN_INLINE
-#define _HURD_H_EXTERN_INLINE extern __inline
+#define _HURD_H_EXTERN_INLINE __extern_inline
#endif
_HURD_H_EXTERN_INLINE int
/* File descriptors.
- Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006
+ Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
#include <hurd/signal.h>
#ifndef _HURD_FD_H_EXTERN_INLINE
-#define _HURD_FD_H_EXTERN_INLINE extern __inline
+#define _HURD_FD_H_EXTERN_INLINE __extern_inline
#endif
/* Returns the descriptor cell for FD. If FD is invalid or unused, return
/* Lightweight user references for ports.
- Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1997, 1999, 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
#ifndef _HURD_PORT_H_EXTERN_INLINE
-#define _HURD_PORT_H_EXTERN_INLINE extern __inline
+#define _HURD_PORT_H_EXTERN_INLINE __extern_inline
#endif
/* Implementing POSIX.1 signals under the Hurd.
- Copyright (C) 1993,94,95,96,98,99,2002 Free Software Foundation, Inc.
+ Copyright (C) 1993,94,95,96,98,99,2002,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
__attribute__ ((__const__));
#ifndef _HURD_SIGNAL_H_EXTERN_INLINE
-#define _HURD_SIGNAL_H_EXTERN_INLINE extern __inline
+#define _HURD_SIGNAL_H_EXTERN_INLINE __extern_inline
#endif
_HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate *
/* Internal per-thread variables for the Hurd.
- Copyright (C) 1994,95,97,98,99,2001,02 Free Software Foundation, Inc.
+ Copyright (C) 1994,95,97,98,99,2001,02,06,07 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
#ifndef _HURD_THREADVAR_H_EXTERN_INLINE
-#define _HURD_THREADVAR_H_EXTERN_INLINE extern __inline
+#define _HURD_THREADVAR_H_EXTERN_INLINE __extern_inline
#endif
/* Return the location of the value for the per-thread variable with index
/* Support for chains recording users of a resource; `struct hurd_userlink'.
- Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1997, 1999, 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
#ifndef _HURD_USERLINK_H_EXTERN_INLINE
-#define _HURD_USERLINK_H_EXTERN_INLINE extern __inline
+#define _HURD_USERLINK_H_EXTERN_INLINE __extern_inline
#endif
libc_hidden_proto (_dl_addr)
#endif
+struct link_map;
+
/* Close an object previously opened by _dl_open. */
extern void _dl_close (void *map) attribute_hidden;
/* Same as above, but without locking and safety checks for user
aux := check_pf ifreq
tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
- tst-gethnm test-ifaddrs bug-if1
+ tst-gethnm test-ifaddrs bug-if1 test-inet6_opt
include ../Rules
#include <alloca.h>
#include <errno.h>
#include <netdb.h>
+#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
switch (sa->sa_family)
{
case AF_LOCAL:
- if (addrlen < (socklen_t) (((struct sockaddr_un *) NULL)->sun_path))
+ if (addrlen < (socklen_t) offsetof (struct sockaddr_un, sun_path))
return EAI_FAMILY;
break;
case AF_INET:
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
{
if (npad == 1)
extbuf[offset] = IP6OPT_PAD1;
- else
+ else if (npad > 0)
{
struct ip6_opt *pad_opt = (struct ip6_opt *) (extbuf + offset);
int data_offset = offset + sizeof (struct ip6_opt);
int npad = (align - data_offset % align) & (align - 1);
- /* Now we can check whether the buffer is large enough. */
- if (data_offset + npad + len > extlen)
- return -1;
-
- if (npad != 0)
+ if (extbuf != NULL)
{
- if (extbuf != NULL)
- add_padding (extbuf, offset, npad);
+ /* Now we can check whether the buffer is large enough. */
+ if (data_offset + npad + len > extlen)
+ return -1;
+
+ add_padding (extbuf, offset, npad);
offset += npad;
- }
- /* Now prepare the option itself. */
- if (extbuf != NULL)
- {
+ /* Now prepare the option itself. */
struct ip6_opt *opt = (struct ip6_opt *) ((uint8_t *) extbuf + offset);
opt->ip6o_type = type;
*databufp = opt + 1;
}
+ else
+ offset += npad;
return offset + sizeof (struct ip6_opt) + len;
}
/* Required padding at the end. */
int npad = (8 - (offset & 7)) & 7;
- /* Make sure the buffer is large enough. */
- if (offset + npad > extlen)
- return -1;
-
if (extbuf != NULL)
- add_padding (extbuf, offset, npad);
+ {
+ /* Make sure the buffer is large enough. */
+ if (offset + npad > extlen)
+ return -1;
+
+ add_padding (extbuf, offset, npad);
+ }
return offset + npad;
}
--- /dev/null
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define OPT_X 42
+#define OPT_Y 43
+#define OPT_Z 44
+
+static void *
+encode_inet6_opt (socklen_t *elp)
+{
+ void *eb = NULL;
+ socklen_t el;
+ int cl;
+ void *db;
+ int offset;
+ uint8_t val1;
+ uint16_t val2;
+ uint32_t val4;
+ uint64_t val8;
+
+ *elp = 0;
+#define CHECK() \
+ if (cl == -1) \
+ { \
+ printf ("cl == -1 on line %d\n", __LINE__); \
+ free (eb); \
+ return NULL; \
+ }
+
+ /* Estimate the length */
+ cl = inet6_opt_init (NULL, 0);
+ CHECK ();
+ cl = inet6_opt_append (NULL, 0, cl, OPT_X, 12, 8, NULL);
+ CHECK ();
+ cl = inet6_opt_append (NULL, 0, cl, OPT_Y, 7, 4, NULL);
+ CHECK ();
+ cl = inet6_opt_append (NULL, 0, cl, OPT_Z, 7, 1, NULL);
+ CHECK ();
+ cl = inet6_opt_finish (NULL, 0, cl);
+ CHECK ();
+ el = cl;
+
+ eb = malloc (el + 8);
+ if (eb == NULL)
+ {
+ puts ("malloc failed");
+ return NULL;
+ }
+ /* Canary. */
+ memcpy (eb + el, "deadbeef", 8);
+
+ cl = inet6_opt_init (eb, el);
+ CHECK ();
+
+ cl = inet6_opt_append (eb, el, cl, OPT_X, 12, 8, &db);
+ CHECK ();
+ val4 = 0x12345678;
+ offset = inet6_opt_set_val (db, 0, &val4, sizeof (val4));
+ val8 = 0x0102030405060708LL;
+ inet6_opt_set_val (db, offset, &val8, sizeof (val8));
+
+ cl = inet6_opt_append (eb, el, cl, OPT_Y, 7, 4, &db);
+ CHECK ();
+ val1 = 0x01;
+ offset = inet6_opt_set_val (db, 0, &val1, sizeof (val1));
+ val2 = 0x1331;
+ offset = inet6_opt_set_val (db, offset, &val2, sizeof (val2));
+ val4 = 0x01020304;
+ inet6_opt_set_val (db, offset, &val4, sizeof (val4));
+
+ cl = inet6_opt_append (eb, el, cl, OPT_Z, 7, 1, &db);
+ CHECK ();
+ inet6_opt_set_val (db, 0, (void *) "abcdefg", 7);
+
+ cl = inet6_opt_finish (eb, el, cl);
+ CHECK ();
+
+ if (memcmp (eb + el, "deadbeef", 8) != 0)
+ {
+ puts ("Canary corrupted");
+ free (eb);
+ return NULL;
+ }
+ *elp = el;
+ return eb;
+}
+
+int
+decode_inet6_opt (void *eb, socklen_t el)
+{
+ int ret = 0;
+ int seq = 0;
+ int cl = 0;
+ int offset;
+ uint8_t type;
+ socklen_t len;
+ uint8_t val1;
+ uint16_t val2;
+ uint32_t val4;
+ uint64_t val8;
+ void *db;
+ char buf[8];
+
+ while ((cl = inet6_opt_next (eb, el, cl, &type, &len, &db)) != -1)
+ switch (type)
+ {
+ case OPT_X:
+ if (seq++ != 0)
+ {
+ puts ("OPT_X is not first");
+ ret = 1;
+ }
+ if (len != 12)
+ {
+ printf ("OPT_X's length %d != 12\n", len);
+ ret = 1;
+ }
+ offset = inet6_opt_get_val (db, 0, &val4, sizeof (val4));
+ if (val4 != 0x12345678)
+ {
+ printf ("OPT_X's val4 %x != 0x12345678\n", val4);
+ ret = 1;
+ }
+ offset = inet6_opt_get_val (db, offset, &val8, sizeof (val8));
+ if (offset != len || val8 != 0x0102030405060708LL)
+ {
+ printf ("OPT_X's val8 %llx != 0x0102030405060708\n",
+ (long long) val8);
+ ret = 1;
+ }
+ break;
+ case OPT_Y:
+ if (seq++ != 1)
+ {
+ puts ("OPT_Y is not second");
+ ret = 1;
+ }
+ if (len != 7)
+ {
+ printf ("OPT_Y's length %d != 7\n", len);
+ ret = 1;
+ }
+ offset = inet6_opt_get_val (db, 0, &val1, sizeof (val1));
+ if (val1 != 0x01)
+ {
+ printf ("OPT_Y's val1 %x != 0x01\n", val1);
+ ret = 1;
+ }
+ offset = inet6_opt_get_val (db, offset, &val2, sizeof (val2));
+ if (val2 != 0x1331)
+ {
+ printf ("OPT_Y's val2 %x != 0x1331\n", val2);
+ ret = 1;
+ }
+ offset = inet6_opt_get_val (db, offset, &val4, sizeof (val4));
+ if (offset != len || val4 != 0x01020304)
+ {
+ printf ("OPT_Y's val4 %x != 0x01020304\n", val4);
+ ret = 1;
+ }
+ break;
+ case OPT_Z:
+ if (seq++ != 2)
+ {
+ puts ("OPT_Z is not third");
+ ret = 1;
+ }
+ if (len != 7)
+ {
+ printf ("OPT_Z's length %d != 7\n", len);
+ ret = 1;
+ }
+ offset = inet6_opt_get_val (db, 0, buf, 7);
+ if (offset != len || memcmp (buf, "abcdefg", 7) != 0)
+ {
+ buf[7] = '\0';
+ printf ("OPT_Z's buf \"%s\" != \"abcdefg\"\n", buf);
+ ret = 1;
+ }
+ break;
+ default:
+ printf ("Unknown option %d\n", type);
+ ret = 1;
+ break;
+ }
+ if (seq != 3)
+ {
+ puts ("Didn't see all of OPT_X, OPT_Y and OPT_Z");
+ ret = 1;
+ }
+ return ret;
+}
+
+int
+main (void)
+{
+ void *eb;
+ socklen_t el;
+ eb = encode_inet6_opt (&el);
+ if (eb == NULL)
+ return 1;
+ if (decode_inet6_opt (eb, el))
+ return 1;
+ return 0;
+}
-/* Copyright (C) 1991,1992,1995-2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995-2004, 2005, 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
#if defined __GNUC__ && __GNUC__ >= 2
/* Inlined versions of the real stat and mknod functions. */
-extern __inline__ int
+__extern_inline int
__NTH (stat (__const char *__path, struct stat *__statbuf))
{
return __xstat (_STAT_VER, __path, __statbuf);
}
# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern __inline__ int
+__extern_inline int
__NTH (lstat (__const char *__path, struct stat *__statbuf))
{
return __lxstat (_STAT_VER, __path, __statbuf);
}
# endif
-extern __inline__ int
+__extern_inline int
__NTH (fstat (int __fd, struct stat *__statbuf))
{
return __fxstat (_STAT_VER, __fd, __statbuf);
}
# ifdef __USE_ATFILE
-extern __inline__ int
+__extern_inline int
__NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf,
int __flag))
{
# endif
# if defined __USE_MISC || defined __USE_BSD
-extern __inline__ int
+__extern_inline int
__NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev))
{
return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
# endif
# ifdef __USE_ATFILE
-extern __inline__ int
+__extern_inline int
__NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
__dev_t __dev))
{
# if defined __USE_LARGEFILE64 \
&& (! defined __USE_FILE_OFFSET64 \
|| (defined __REDIRECT_NTH && defined __OPTIMIZE__))
-extern __inline__ int
+__extern_inline int
__NTH (stat64 (__const char *__path, struct stat64 *__statbuf))
{
return __xstat64 (_STAT_VER, __path, __statbuf);
}
# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern __inline__ int
+__extern_inline int
__NTH (lstat64 (__const char *__path, struct stat64 *__statbuf))
{
return __lxstat64 (_STAT_VER, __path, __statbuf);
}
# endif
-extern __inline__ int
+__extern_inline int
__NTH (fstat64 (int __fd, struct stat64 *__statbuf))
{
return __fxstat64 (_STAT_VER, __fd, __statbuf);
}
# ifdef __USE_GNU
-extern __inline__ int
+__extern_inline int
__NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf,
int __flag))
{
/* Optimizing macros and inline functions for stdio functions.
- Copyright (C) 1998, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2004, 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
#ifdef __cplusplus
# define __STDIO_INLINE inline
#else
-# define __STDIO_INLINE extern __inline
+# define __STDIO_INLINE __extern_inline
#endif
/* Checking macros for stdio functions.
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 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
extern char *__gets_chk (char *__str, size_t) __wur;
extern char *__REDIRECT (__gets_alias, (char *__str), gets) __wur;
-extern __always_inline __wur char *
+__extern_always_inline __wur char *
gets (char *__str)
{
if (__bos (__str) != (size_t) -1)
(char *__restrict __s, int __n,
FILE *__restrict __stream), fgets) __wur;
-extern __always_inline __wur char *
+__extern_always_inline __wur char *
fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
{
if (__bos (__s) != (size_t) -1
(char *__restrict __s, int __n,
FILE *__restrict __stream), fgets_unlocked) __wur;
-extern __always_inline __wur char *
+__extern_always_inline __wur char *
fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
{
if (__bos (__s) != (size_t) -1
-/* Copyright (C) 1995-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
assert (locale != NULL);
ctype = locale->categories[LC_CTYPE].ctype;
+ if (ctype == NULL)
+ return NULL;
+
if (ctype->translit != NULL)
result = find_translit2 (ctype, charmap, wch);
+2007-03-07 Steven Munroe <sjmunroe@us.ibm.com>
+
+ * Makefile: Define tst-sscanf-ENV.
+ * tst-sscanf.c: Use fa_IR.UTF-8 which exists internally.
+
2007-02-18 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-sscanf.
bug-iconv-trans-ENV = LOCPATH=$(common-objpfx)localedata
+tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata
+
tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \
LOCPATH=$(common-objpfx)localedata
$(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
static int
do_test (void)
{
- if (setlocale (LC_ALL, "fa_IR") == NULL)
+ if (setlocale (LC_ALL, "fa_IR.UTF-8") == NULL)
{
puts ("cannot set fa_IR locale");
return 1;
-/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2002, 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>
and Paul Janzen <pcj@primenet.com>, 1996.
file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name);
- file_fd = open_not_cancel_2 (file_name, O_RDWR);
+ file_fd = open_not_cancel_2 (file_name, O_RDWR | O_LARGEFILE);
if (file_fd == -1)
{
/* Hhm, read-write access did not work. Try read-only. */
- file_fd = open_not_cancel_2 (file_name, O_RDONLY);
+ file_fd = open_not_cancel_2 (file_name, O_RDONLY | O_LARGEFILE);
if (file_fd == -1)
return 0;
}
int fd;
/* Open WTMP file. */
- fd = open_not_cancel_2 (file, O_WRONLY);
+ fd = open_not_cancel_2 (file, O_WRONLY | O_LARGEFILE);
if (fd < 0)
return -1;
-/* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1996, 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
#include <machine-lock.h>
#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
#endif
-/* Copyright (C) 1993,94,97,99,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1993,94,97,99,2001,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
/* Idiocy support function. */
extern vm_size_t mig_strncpy (char *__dst, const char *__src, vm_size_t __len);
extern vm_size_t __mig_strncpy (char *__dst, const char *__src, vm_size_t);
-extern __inline vm_size_t
+__extern_inline vm_size_t
__mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
{
return __stpncpy (__dst, __src, __len) - __dst;
}
-extern __inline vm_size_t
+__extern_inline vm_size_t
mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
{
return __mig_strncpy (__dst, __src, __len);
/* Prototype declarations for complex math functions;
helper file for <complex.h>.
- Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2001, 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
#if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__
/* Imaginary part of Z. */
-extern __inline _Mdouble_
+__extern_inline _Mdouble_
__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
{
return __imag__ __z;
}
/* Real part of Z. */
-extern __inline _Mdouble_
+__extern_inline _Mdouble_
__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
{
return __real__ __z;
}
/* Complex conjugate of Z. */
-extern __inline _Mdouble_complex_
+__extern_inline _Mdouble_complex_
__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
{
return __extension__ ~__z;
TEST_f_f (log, 1, 0);
TEST_f_f (log, -1, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log, plus_infty, plus_infty);
+ TEST_f_f (log, nan_value, nan_value);
TEST_f_f (log, M_El, 1);
TEST_f_f (log, 1.0 / M_El, -1);
/* log10 (x) == NaN plus invalid exception if x < 0. */
TEST_f_f (log10, -1, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log10, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log10, plus_infty, plus_infty);
TEST_f_f (log10, nan_value, nan_value);
TEST_f_f (log1p, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
TEST_f_f (log1p, -2, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log1p, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log1p, plus_infty, plus_infty);
TEST_f_f (log1p, nan_value, nan_value);
TEST_f_f (log2, 1, 0);
TEST_f_f (log2, -1, nan_value, INVALID_EXCEPTION);
+ TEST_f_f (log2, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_f_f (log2, plus_infty, plus_infty);
TEST_f_f (log2, nan_value, nan_value);
/* pow (x, NaN) == NaN. */
TEST_ff_f (pow, 3.0, nan_value, nan_value);
+ TEST_ff_f (pow, minus_zero, nan_value, nan_value);
+ TEST_ff_f (pow, plus_infty, nan_value, nan_value);
+ TEST_ff_f (pow, -3.0, nan_value, nan_value);
+ TEST_ff_f (pow, minus_infty, nan_value, nan_value);
+
+ TEST_ff_f (pow, nan_value, 3.0, nan_value);
+ TEST_ff_f (pow, nan_value, -3.0, nan_value);
+ TEST_ff_f (pow, nan_value, plus_infty, nan_value);
+ TEST_ff_f (pow, nan_value, minus_infty, nan_value);
+ TEST_ff_f (pow, nan_value, 2.5, nan_value);
+ TEST_ff_f (pow, nan_value, -2.5, nan_value);
TEST_ff_f (pow, 1, plus_infty, 1);
TEST_ff_f (pow, -1, plus_infty, 1);
-/* Copyright (C) 1992-2001, 2002, 2004, 2005, 2006
+/* Copyright (C) 1992-2001, 2002, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
# define __always_inline __inline
#endif
+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. */
+#ifdef __GNUC_STDC_INLINE__
+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
+# define __extern_always_inline \
+ extern __always_inline __attribute__ ((__gnu_inline__))
+#else
+# define __extern_inline extern __inline
+# define __extern_always_inline extern __always_inline
+#endif
+
/* It is possible to compile containing GCC extensions even if GCC is
run in pedantic mode if the uses are carefully marked using the
`__extension__' keyword. But this is not generally available before
+2007-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
+ __extern_always_inline where appropriate.
+ * sysdeps/pthread/pthread.h: Likewise.
+
+2007-03-13 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
+ separate cfi regions for the two subsections.
+
+2007-02-25 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
+ new thread, don't just decrement it.
+ Patch by Suzuki K P <suzuki@in.ibm.com>.
+
2007-02-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread-functions.h: Correct last patch, correct
/* Normal cleanup handling, based on C cleanup attribute. */
-extern __inline void
+__extern_inline void
__libc_cleanup_routine (struct __pthread_cleanup_frame *f)
{
if (f->__do_it)
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005, 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
function the compiler is free to decide inlining the change when
needed or fall back on the copy which must exist somewhere
else. */
-extern __inline void
+__extern_inline void
__pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
{
if (__frame->__do_it)
#ifdef __USE_EXTERN_INLINES
/* Optimizations. */
-extern __inline int
+__extern_inline int
__NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))
{
return __thread1 == __thread2;
bne a3, SYSCALL_ERROR_LABEL; \
__LABEL($pseudo_ret) \
.subsection 2; \
+ cfi_startproc; \
__LABEL($pseudo_cancel) \
subq sp, 64, sp; \
cfi_def_cfa_offset(64); \
cfi_def_cfa_offset(0); \
__LABEL($syscall_error) \
SYSCALL_ERROR_HANDLER; \
+ cfi_endproc; \
.previous
# undef PSEUDO_END
# define PSEUDO_END(sym) \
- .subsection 2; \
cfi_endproc; \
+ .subsection 2; \
.size sym, .-sym
# define SAVE_ARGS_0 /* Nothing. */
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
allp->handler->child_handler ();
/* Note that we do not have to wake any possible waiter.
- This is the only thread in the new process. */
- --allp->handler->refcntr;
+ This is the only thread in the new process. The count
+ may have been bumped up by other threads doing a fork.
+ We reset it to 1, to avoid waiting for non-existing
+ thread(s) to release the count. */
+ allp->handler->refcntr = 1;
/* XXX We could at this point look through the object pool
and mark all objects not on the __fork_handlers list as
/* Checking macros for unistd functions.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 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
extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
size_t __nbytes), read) __wur;
-extern __always_inline __wur ssize_t
+__extern_always_inline __wur ssize_t
read (int __fd, void *__buf, size_t __nbytes)
{
if (__bos0 (__buf) != (size_t) -1
__off64_t __offset), pread64) __wur;
# ifndef __USE_FILE_OFFSET64
-extern __always_inline __wur ssize_t
+__extern_always_inline __wur ssize_t
pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
{
if (__bos0 (__buf) != (size_t) -1
return __pread_alias (__fd, __buf, __nbytes, __offset);
}
# else
-extern __always_inline __wur ssize_t
+__extern_always_inline __wur ssize_t
pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
{
if (__bos0 (__buf) != (size_t) -1
# endif
# ifdef __USE_LARGEFILE64
-extern __always_inline __wur ssize_t
+__extern_always_inline __wur ssize_t
pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
{
if (__bos0 (__buf) != (size_t) -1
char *__restrict __buf, size_t __len), readlink)
__nonnull ((1, 2)) __wur;
-extern __always_inline __nonnull ((1, 2)) __wur ssize_t
+__extern_always_inline __nonnull ((1, 2)) __wur ssize_t
__NTH (readlink (__const char *__restrict __path, char *__restrict __buf,
size_t __len))
{
readlinkat)
__nonnull ((2, 3)) __wur;
-extern __always_inline __nonnull ((2, 3)) __wur ssize_t
+__extern_always_inline __nonnull ((2, 3)) __wur ssize_t
__NTH (readlinkat (int __fd, __const char *__restrict __path,
char *__restrict __buf, size_t __len))
{
extern char *__REDIRECT_NTH (__getcwd_alias,
(char *__buf, size_t __size), getcwd) __wur;
-extern __always_inline __wur char *
+__extern_always_inline __wur char *
__NTH (getcwd (char *__buf, size_t __size))
{
if (__bos (__buf) != (size_t) -1
extern char *__REDIRECT_NTH (__getwd_alias, (char *__buf), getwd)
__nonnull ((1)) __wur;
-extern __always_inline __nonnull ((1)) __attribute_deprecated__ __wur char *
+__extern_always_inline __nonnull ((1)) __attribute_deprecated__ __wur char *
__NTH (getwd (char *__buf))
{
if (__bos (__buf) != (size_t) -1)
extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf,
size_t __len), confstr);
-extern __always_inline size_t
+__extern_always_inline size_t
__NTH (confstr (int __name, char *__buf, size_t __len))
{
if (__bos (__buf) != (size_t) -1
extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]),
getgroups) __wur;
-extern __always_inline int
+__extern_always_inline int
__NTH (getgroups (int __size, __gid_t __list[]))
{
if (__bos (__list) != (size_t) -1
size_t __buflen), ttyname_r)
__nonnull ((2));
-extern __always_inline int
+__extern_always_inline int
__NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
{
if (__bos (__buf) != (size_t) -1
extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen),
getlogin_r) __nonnull ((1));
-extern __always_inline int
+__extern_always_inline int
getlogin_r (char *__buf, size_t __buflen)
{
if (__bos (__buf) != (size_t) -1
extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen),
gethostname) __nonnull ((1));
-extern __always_inline int
+__extern_always_inline int
__NTH (gethostname (char *__buf, size_t __buflen))
{
if (__bos (__buf) != (size_t) -1
size_t __buflen),
getdomainname) __nonnull ((1)) __wur;
-extern __always_inline int
+__extern_always_inline int
__NTH (getdomainname (char *__buf, size_t __buflen))
{
if (__bos (__buf) != (size_t) -1
+2007-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S: Use GLIBC_2_1
+ instead of GLIBC_2_0.
+ * sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S: Likewise.
+ * sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S: Likewise.
+ * sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S: Likewise.
+ * sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrint.S: Include
+ math_ldbl_opt.h.
+ (llrintl): Add @GLIBC_2.1 compat symbol.
+
2006-10-20 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power4/fpu/slowpow.c: New file.
/* round function. PowerPC32/power5+ version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
weak_alias (__round, roundl)
strong_alias (__round, __roundl)
#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __round, roundl, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __round, roundl, GLIBC_2_1)
#endif
/* trunc function. PowerPC32/power5+ version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
weak_alias (__trunc, truncl)
strong_alias (__trunc, __truncl)
#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
#endif
/* Round double to long int. PowerPC32 on PowerPC64 version.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 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
02110-1301 USA. */
#include <sysdep.h>
+#include <math_ldbl_opt.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
ENTRY (__llrint)
strong_alias (__llrint, __llrintl)
weak_alias (__llrint, llrintl)
#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
+#endif
/* round function. PowerPC64/power5+ version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
weak_alias (__round, roundl)
strong_alias (__round, __roundl)
#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __round, roundl, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __round, roundl, GLIBC_2_1)
#endif
/* trunc function. PowerPC64/power5+ version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
weak_alias (__trunc, truncl)
strong_alias (__trunc, __truncl)
#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1)
#endif
/* Checking macros for socket functions.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 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
extern ssize_t __REDIRECT (__recv_alias, (int __fd, void *__buf, size_t __n,
int __flags), recv);
-extern __always_inline ssize_t
+__extern_always_inline ssize_t
recv (int __fd, void *__buf, size_t __n, int __flags)
{
if (__bos0 (__buf) != (size_t) -1
int __flags, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len), recvfrom);
-extern __always_inline ssize_t
+__extern_always_inline ssize_t
recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
__SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
{
-/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006
+/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
# define PUTC(C, F) _IO_putwc_unlocked (C, F)
# define ORIENT if (_IO_fwide (s, 1) != 1) return -1
+# undef _itoa
# define _itoa(Val, Buf, Base, Case) _itowa (Val, Buf, Base, Case)
# define _itoa_word(Val, Buf, Base, Case) _itowa_word (Val, Buf, Base, Case)
# undef EOF
/* Checking macros for stdlib functions.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 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
(__const char *__restrict __name,
char *__restrict __resolved), realpath) __wur;
-extern __always_inline __wur char *
+__extern_always_inline __wur char *
__NTH (realpath (__const char *__restrict __name, char *__restrict __resolved))
{
if (__bos (__resolved) != (size_t) -1)
size_t __buflen), ptsname_r)
__nonnull ((2));
-extern __always_inline int
+__extern_always_inline int
__NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
{
if (__bos (__buf) != (size_t) -1
extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar),
wctomb) __wur;
-extern __always_inline __wur int
+__extern_always_inline __wur int
__NTH (wctomb (char *__s, wchar_t __wchar))
{
/* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
__const char *__restrict __src,
size_t __len), mbstowcs);
-extern __always_inline size_t
+__extern_always_inline size_t
__NTH (mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src,
size_t __len))
{
__const wchar_t *__restrict __src,
size_t __len), wcstombs);
-extern __always_inline size_t
+__extern_always_inline size_t
__NTH (wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src,
size_t __len))
{
/* gmp.h -- Definitions for GNU multiple precision functions.
-Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1991, 1993, 1994, 1995, 1996, 2007 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
#ifndef __GMP_H__
+#include <features.h>
+
#ifndef __GNU_MP__
#define __GNU_MP__ 2
#define __need_size_t
#ifndef _EXTERN_INLINE
#ifdef __GNUC__
-#define _EXTERN_INLINE extern __inline__
+#define _EXTERN_INLINE __extern_inline
#else
#define _EXTERN_INLINE static
#endif
-/* Copyright (C) 1991-2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2003,2004,2005,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
/* Define inline functions which call the internal entry points. */
__BEGIN_NAMESPACE_STD
-extern __inline double
+__extern_inline double
__NTH (strtod (__const char *__restrict __nptr, char **__restrict __endptr))
{
return __strtod_internal (__nptr, __endptr, 0);
}
-extern __inline long int
+__extern_inline long int
__NTH (strtol (__const char *__restrict __nptr, char **__restrict __endptr,
int __base))
{
return __strtol_internal (__nptr, __endptr, __base, 0);
}
-extern __inline unsigned long int
+__extern_inline unsigned long int
__NTH (strtoul (__const char *__restrict __nptr, char **__restrict __endptr,
int __base))
{
# ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
-extern __inline float
+__extern_inline float
__NTH (strtof (__const char *__restrict __nptr, char **__restrict __endptr))
{
return __strtof_internal (__nptr, __endptr, 0);
}
# ifndef __LDBL_COMPAT
-extern __inline long double
+__extern_inline long double
__NTH (strtold (__const char *__restrict __nptr, char **__restrict __endptr))
{
return __strtold_internal (__nptr, __endptr, 0);
# endif
# ifdef __USE_BSD
-__extension__ extern __inline long long int
+__extension__ __extern_inline long long int
__NTH (strtoq (__const char *__restrict __nptr, char **__restrict __endptr,
int __base))
{
return __strtoll_internal (__nptr, __endptr, __base, 0);
}
-__extension__ extern __inline unsigned long long int
+__extension__ __extern_inline unsigned long long int
__NTH (strtouq (__const char *__restrict __nptr, char **__restrict __endptr,
int __base))
{
# if defined __USE_MISC || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
-__extension__ extern __inline long long int
+__extension__ __extern_inline long long int
__NTH (strtoll (__const char *__restrict __nptr, char **__restrict __endptr,
int __base))
{
return __strtoll_internal (__nptr, __endptr, __base, 0);
}
-__extension__ extern __inline unsigned long long int
+__extension__ __extern_inline unsigned long long int
__NTH (strtoull (__const char * __restrict __nptr, char **__restrict __endptr,
int __base))
{
# endif
__BEGIN_NAMESPACE_STD
-extern __inline double
+__extern_inline double
__NTH (atof (__const char *__nptr))
{
return strtod (__nptr, (char **) NULL);
}
-extern __inline int
+__extern_inline int
__NTH (atoi (__const char *__nptr))
{
return (int) strtol (__nptr, (char **) NULL, 10);
}
-extern __inline long int
+__extern_inline long int
__NTH (atol (__const char *__nptr))
{
return strtol (__nptr, (char **) NULL, 10);
# if defined __USE_MISC || defined __USE_ISOC99
__BEGIN_NAMESPACE_C99
-__extension__ extern __inline long long int
+__extension__ __extern_inline long long int
__NTH (atoll (__const char *__nptr))
{
return strtoll (__nptr, (char **) NULL, 10);
struct locale_data *current = loc->__locales[LC_NUMERIC];
- if (group)
+ if (__builtin_expect (group, 0))
{
grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
if (*grouping <= 0 || *grouping == CHAR_MAX)
&& (wint_t) cp[1] >= L'0' && (wint_t) cp[1] <= L'9')
{
/* We accept it. This funny construct is here only to indent
- the code directly. */
+ the code correctly. */
}
#else
for (cnt = 0; decimal[cnt] != '\0'; ++cnt)
if (decimal[cnt] == '\0' && cp[cnt] >= '0' && cp[cnt] <= '9')
{
/* We accept it. This funny construct is here only to indent
- the code directly. */
+ the code correctly. */
}
#endif
else if (c < L_('0') || c > L_('9'))
{
/* Check for `INF' or `INFINITY'. */
- if (TOLOWER_C (c) == L_('i') && STRNCASECMP (cp, L_("inf"), 3) == 0)
+ CHAR_TYPE lowc = TOLOWER_C (c);
+
+ if (lowc == L_('i') && STRNCASECMP (cp, L_("inf"), 3) == 0)
{
/* Return +/- infinity. */
if (endptr != NULL)
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
}
- if (TOLOWER_C (c) == L_('n') && STRNCASECMP (cp, L_("nan"), 3) == 0)
+ if (lowc == L_('n') && STRNCASECMP (cp, L_("nan"), 3) == 0)
{
/* Return NaN. */
FLOAT retval = NAN;
do
++cp;
while ((*cp >= L_('0') && *cp <= L_('9'))
- || (TOLOWER (*cp) >= L_('a') && TOLOWER (*cp) <= L_('z'))
+ || ({ CHAR_TYPE lo = TOLOWER (*cp);
+ lo >= L_('a') && lo <= L_('z'); })
|| *cp == L_('_'));
if (*cp != L_(')'))
while (c == L'0' || ((wint_t) thousands != L'\0' && c == (wint_t) thousands))
c = *++cp;
#else
- if (thousands == NULL)
+ if (__builtin_expect (thousands == NULL, 1))
while (c == '0')
c = *++cp;
else
/* If no other digit but a '0' is found the result is 0.0.
Return current read pointer. */
+ CHAR_TYPE lowc = TOLOWER (c);
if (!((c >= L_('0') && c <= L_('9'))
- || (base == 16 && ((CHAR_TYPE) TOLOWER (c) >= L_('a')
- && (CHAR_TYPE) TOLOWER (c) <= L_('f')))
+ || (base == 16 && lowc >= L_('a') && lowc <= L_('f'))
|| (
#ifdef USE_WIDE_CHAR
c == (wint_t) decimal
&& (base != 16
|| cp != start_of_digits
|| (cp[decimal_len] >= L_('0') && cp[decimal_len] <= L_('9'))
- || ((CHAR_TYPE) TOLOWER (cp[decimal_len]) >= L_('a')
- && (CHAR_TYPE) TOLOWER (cp[decimal_len]) <= L_('f'))))
+ || ({ CHAR_TYPE lo = TOLOWER (cp[decimal_len]);
+ lo >= L_('a') && lo <= L_('f'); })))
|| (base == 16 && (cp != start_of_digits
- && (CHAR_TYPE) TOLOWER (c) == L_('p')))
- || (base != 16 && (CHAR_TYPE) TOLOWER (c) == L_('e'))))
+ && lowc == L_('p')))
+ || (base != 16 && lowc == L_('e'))))
{
#ifdef USE_WIDE_CHAR
tp = __correctly_grouped_prefixwc (start_of_digits, cp, thousands,
while (1)
{
if ((c >= L_('0') && c <= L_('9'))
- || (base == 16 && (wint_t) TOLOWER (c) >= L_('a')
- && (wint_t) TOLOWER (c) <= L_('f')))
+ || (base == 16
+ && ({ CHAR_TYPE lo = TOLOWER (c);
+ lo >= L_('a') && lo <= L_('f'); })))
++dig_no;
else
{
#ifdef USE_WIDE_CHAR
- if ((wint_t) thousands == L'\0' || c != (wint_t) thousands)
+ if (__builtin_expect ((wint_t) thousands == L'\0', 1)
+ || c != (wint_t) thousands)
/* Not a digit or separator: end of the integer part. */
break;
#else
- if (thousands == NULL)
+ if (__builtin_expect (thousands == NULL, 1))
break;
else
{
c = *++cp;
}
- if (grouping && cp > start_of_digits)
+ if (__builtin_expect (grouping != NULL, 0) && cp > start_of_digits)
{
/* Check the grouping of the digits. */
#ifdef USE_WIDE_CHAR
cp += decimal_len;
c = *cp;
while ((c >= L_('0') && c <= L_('9')) ||
- (base == 16 && TOLOWER (c) >= L_('a') && TOLOWER (c) <= L_('f')))
+ (base == 16 && ({ CHAR_TYPE lo = TOLOWER (c);
+ lo >= L_('a') && lo <= L_('f'); })))
{
if (c != L_('0') && lead_zero == -1)
lead_zero = dig_no - int_no;
expp = cp;
/* Read exponent. */
- if ((base == 16 && TOLOWER (c) == L_('p'))
- || (base != 16 && TOLOWER (c) == L_('e')))
+ lowc = TOLOWER (c);
+ if ((base == 16 && lowc == L_('p'))
+ || (base != 16 && lowc == L_('e')))
{
int exp_negative = 0;
exponent *= 10;
exponent += c - L_('0');
- if (exponent > exp_limit)
+ if (__builtin_expect (exponent > exp_limit, 0))
/* The exponent is too large/small to represent a valid
number. */
{
exponent -= incr;
}
- if (int_no + exponent > MAX_10_EXP + 1)
+ if (__builtin_expect (int_no + exponent > MAX_10_EXP + 1, 0))
{
__set_errno (ERANGE);
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
}
- if (exponent < MIN_10_EXP - (DIG + 1))
+ if (__builtin_expect (exponent < MIN_10_EXP - (DIG + 1), 0))
{
__set_errno (ERANGE);
return 0.0;
/* Now we know the exponent of the number in base two.
Check it against the maximum possible exponent. */
- if (bits > MAX_EXP)
+ if (__builtin_expect (bits > MAX_EXP, 0))
{
__set_errno (ERANGE);
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995,96,97,98,99,2000,2004 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000,2004,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
__const char *__restrict __entry) __THROW;
#ifdef __USE_EXTERN_INLINES
-extern inline char *
+__extern_inline char *
__NTH (__argz_next (__const char *__argz, size_t __argz_len,
__const char *__entry))
{
else
return __argz_len > 0 ? (char *) __argz : 0;
}
-extern inline char *
+__extern_inline char *
__NTH (argz_next (__const char *__argz, size_t __argz_len,
__const char *__entry))
{
/* Machine-independant string function optimizations.
- Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997-2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
# ifdef __cplusplus
# define __STRING_INLINE inline
# else
-# define __STRING_INLINE extern __inline
+# define __STRING_INLINE __extern_inline
# endif
#endif
-/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 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
__const char *__src,
size_t __n), stpncpy);
-extern __always_inline char *
+__extern_always_inline char *
__NTH (stpncpy (char *__dest, __const char *__src, size_t __n))
{
if (__bos (__dest) != (size_t) -1
#include <libintl.h>
#include <locale.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
CFLAGS-rtld.c = -mbuild-constants
endif
-# For now, build everything with full IEEE math support.
-# TODO: build separate libm and libm-ieee.
-sysdep-CFLAGS += -mieee
+# Build everything with full IEEE math support, and with dynamic rounding;
+# there are a number of math routines that are defined to work with the
+# "current" rounding mode, and it's easiest to set this with all of them.
+sysdep-CFLAGS += -mieee -mfp-rounding-mode=d
# libc.so requires about 16k for the small data area, which is well
# below the 64k maximum.
/* Inline math functions for Alpha.
- Copyright (C) 1996, 1997, 1999-2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1999-2001, 2004, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang.
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
#if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
# undef __inline_fabs
#endif
+#ifdef __USE_ISOC99
-/* Use the -inf rounding mode conversion instructions to implement
- floor. We note when the exponent is large enough that the value
- must be integral, as this avoids unpleasant integer overflows. */
-
-__MATH_INLINE float
-__NTH (__floorf (float __x))
+/* Test for negative number. Used in the signbit() macro. */
+__MATH_INLINE int
+__NTH (__signbitf (float __x))
{
- /* Check not zero since floor(-0) == -0. */
- if (__x != 0 && fabsf (__x) < 16777216.0f) /* 1 << FLT_MANT_DIG */
- {
- /* Note that Alpha S_Floating is stored in registers in a
- restricted T_Floating format, so we don't even need to
- convert back to S_Floating in the end. The initial
- conversion to T_Floating is needed to handle denormals. */
-
- float __tmp1, __tmp2;
-
- __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
+#if !__GNUC_PREREQ (4, 0)
+ __extension__ union { float __f; int __i; } __u = { __f: __x };
+ return __u.__i < 0;
#else
- "cvttq/svm %2,%1\n\t"
+ return __builtin_signbitf (__x);
#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(__x), "=&f"(__tmp1), "=&f"(__tmp2)
- : "f"(__x));
- }
- return __x;
}
-__MATH_INLINE double
-__NTH (__floor (double __x))
+__MATH_INLINE int
+__NTH (__signbit (double __x))
{
- if (__x != 0 && fabs (__x) < 9007199254740992.0) /* 1 << DBL_MANT_DIG */
- {
- double __tmp1;
- __asm (
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
+#if !__GNUC_PREREQ (4, 0)
+ __extension__ union { double __d; long __i; } __u = { __d: __x };
+ return __u.__i < 0;
#else
- "cvttq/svm %2,%1\n\t"
+ return __builtin_signbit (__x);
#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(__x), "=&f"(__tmp1)
- : "f"(__x));
- }
- return __x;
}
-__MATH_INLINE float __NTH (floorf (float __x)) { return __floorf(__x); }
-__MATH_INLINE double __NTH (floor (double __x)) { return __floor(__x); }
-
-
-#ifdef __USE_ISOC99
-
-__MATH_INLINE float
-__NTH (__fdimf (float __x, float __y))
-{
- return __x <= __y ? 0.0f : __x - __y;
-}
-
-__MATH_INLINE float
-__NTH (fdimf (float __x, float __y))
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
{
- return __x <= __y ? 0.0f : __x - __y;
+#if !__GNUC_PREREQ (4, 0)
+ __extension__ union {
+ long double __d;
+ long __i[sizeof(long double)/sizeof(long)];
+ } __u = { __d: __x };
+ return __u.__i[sizeof(long double)/sizeof(long) - 1] < 0;
+#else
+ return __builtin_signbitl (__x);
+#endif
}
-__MATH_INLINE double
-__NTH (__fdim (double __x, double __y))
-{
- return __x <= __y ? 0.0 : __x - __y;
-}
+/* Test for NaN. Used in the isnan() macro. */
-__MATH_INLINE double
-__NTH (fdim (double __x, double __y))
+__MATH_INLINE int
+__NTH (__isnanf (float __x))
{
- return __x <= __y ? 0.0 : __x - __y;
+ return isunordered (__x, __x);
}
-/* Test for negative number. Used in the signbit() macro. */
__MATH_INLINE int
-__NTH (__signbitf (float __x))
+__NTH (__isnan (double __x))
{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
+ return isunordered (__x, __x);
}
__MATH_INLINE int
-__NTH (__signbit (double __x))
+__NTH (__isnanl (long double __x))
{
- __extension__ union { double __d; long __i; } __u = { __d: __x };
- return __u.__i < 0;
+ return isunordered (__x, __x);
}
-
#endif /* C99 */
#endif /* __NO_MATH_INLINES */
# atan2
Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112":
-float: 6
-ifloat: 6
+ildouble: 1
+ldouble: 1
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
-float: 3
-ifloat: 3
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
-float: 3
-ifloat: 3
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# atanh
Test "atanh (0.75) == 0.972955074527656652552676371721589865":
float: 1
ifloat: 1
+# cacos
+Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
+
# cacosh
-Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
-double: 1
-float: 7
-idouble: 1
-ifloat: 7
Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
-double: 1
-float: 3
-idouble: 1
-ifloat: 3
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
# casin
Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
float: 1
idouble: 1
ifloat: 1
+Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
+ildouble: 1
+ldouble: 1
# casinh
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
float: 1
idouble: 5
ifloat: 1
+ildouble: 4
+ldouble: 4
Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 3
float: 6
idouble: 3
ifloat: 6
+ildouble: 2
+ldouble: 2
Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# catan
-Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
-float: 3
-ifloat: 3
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
double: 1
float: 1
idouble: 1
ifloat: 1
-Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
-float: 4
-ifloat: 4
+Test "Imaginary part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+ildouble: 1
+ldouble: 1
# catanh
Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
double: 4
idouble: 4
-Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
-float: 4
-ifloat: 4
Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
-float: 6
-ifloat: 6
+ildouble: 1
+ldouble: 1
# cbrt
+Test "cbrt (-0.001) == -0.1":
+ildouble: 1
+ldouble: 1
Test "cbrt (-27.0) == -3.0":
double: 1
idouble: 1
idouble: 1
# ccos
+Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
double: 1
float: 1
Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
double: 1
float: 1
ifloat: 1
# cexp
+Test "Real part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
float: 1
ifloat: 1
+Test "Imaginary part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
+ildouble: 1
+ldouble: 1
# clog
-Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
-float: 3
-ifloat: 3
Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
+Test "Real part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
-float: 5
idouble: 1
-ifloat: 5
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
+Test "Imaginary part of: clog10 (-inf + inf i) == inf + 3/4 pi*log10(e) i":
+double: 1
+idouble: 1
Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
float: 1
ifloat: 1
+Test "Imaginary part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i":
+double: 1
float: 1
+idouble: 1
ifloat: 1
# cos
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
-float: 1
idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
Test "cos (M_PI_6l * 4.0) == -0.5":
double: 2
float: 1
idouble: 2
ifloat: 1
-Test "cos (pi/2) == 0":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
# cpow
Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
float: 4
idouble: 1
ifloat: 4
+ildouble: 4
+ldouble: 4
+Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 2
+ldouble: 2
+Test "Imaginary part of: cpow (0.75 + 1.25 i, 1.0 + 0.0 i) == 0.75 + 1.25 i":
+ildouble: 1
+ldouble: 1
Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i":
double: 2
float: 3
idouble: 2
ifloat: 3
+ildouble: 10
+ldouble: 10
+Test "Real part of: cpow (2 + 0 i, 10 + 0 i) == 1024.0 + 0.0 i":
+ildouble: 2
+ldouble: 2
Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
double: 1
float: 4
idouble: 1
ifloat: 4
+ildouble: 3
+ldouble: 3
Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
float: 2
ifloat: 2
float: 2
idouble: 2
ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
+ildouble: 1
+ldouble: 1
# csinh
+Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
double: 1
idouble: 1
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: csqrt (0.75 + 1.25 i) == 1.05065169626078392338656675760808326 + 0.594868882070379067881984030639932657 i":
+ildouble: 1
+ldouble: 1
# ctan
+Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
double: 1
idouble: 1
+ildouble: 2
+ldouble: 2
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
float: 2
idouble: 1
ifloat: 2
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+ildouble: 1
+ldouble: 1
Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
float: 1
ifloat: 1
Test "erfc (2.0) == 0.00467773498104726583793074363274707139":
double: 1
idouble: 1
+Test "erfc (27.0) == 0.523704892378925568501606768284954709e-318":
+ildouble: 1
+ldouble: 1
Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8":
double: 1
idouble: 1
float: 2
idouble: 6
ifloat: 2
+ildouble: 1
+ldouble: 1
+
+# exp2
+Test "exp2 (10) == 1024":
+ildouble: 2
+ldouble: 2
# expm1
Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
double: 1
idouble: 1
Test "expm1 (1) == M_El - 1.0":
+double: 1
float: 1
+idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+# gamma
+Test "gamma (-0.5) == log(2*sqrt(pi))":
+ildouble: 1
+ldouble: 1
# hypot
Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271":
float: 1
idouble: 2
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "j0 (2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
+ildouble: 2
+ldouble: 2
Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
Test "j0 (8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# j1
+Test "j1 (-1.0) == -0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
+Test "j1 (0.75) == 0.349243602174862192523281016426251335":
+ildouble: 1
+ldouble: 1
+Test "j1 (1.0) == 0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
float: 2
ifloat: 2
+ildouble: 2
+ldouble: 2
Test "j1 (2.0) == 0.576724807756873387202448242269137087":
double: 1
idouble: 1
Test "j1 (8.0) == 0.234636346853914624381276651590454612":
double: 1
idouble: 1
+ildouble: 4
+ldouble: 4
# jn
Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
float: 1
idouble: 2
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
+ildouble: 2
+ldouble: 2
Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "jn (1, -1.0) == -0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
+Test "jn (1, 0.75) == 0.349243602174862192523281016426251335":
+ildouble: 1
+ldouble: 1
+Test "jn (1, 1.0) == 0.440050585744933515959682203718914913":
+ildouble: 1
+ldouble: 1
Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
float: 2
ifloat: 2
+ildouble: 2
+ldouble: 2
Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
double: 1
idouble: 1
Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
double: 1
idouble: 1
+ildouble: 4
+ldouble: 4
+Test "jn (10, -1.0) == 0.263061512368745320699785368779050294e-9":
+ildouble: 1
+ldouble: 1
Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+Test "jn (10, 1.0) == 0.263061512368745320699785368779050294e-9":
+ildouble: 1
+ldouble: 1
Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
double: 4
float: 3
idouble: 4
ifloat: 3
+ildouble: 2
+ldouble: 2
Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
float: 4
ifloat: 4
float: 1
idouble: 3
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
double: 1
float: 2
ifloat: 2
# lgamma
+Test "lgamma (-0.5) == log(2*sqrt(pi))":
+ildouble: 1
+ldouble: 1
Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1":
double: 1
float: 2
idouble: 1
ifloat: 2
+ildouble: 1
+ldouble: 1
# log10
Test "log10 (0.75) == -0.124938736608299953132449886193870744":
Test "log10 (e) == log10(e)":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# log1p
Test "log1p (-0.25) == -0.287682072451780927439219005993827432":
float: 1
ifloat: 1
+# log2
+Test "log2 (0.75) == -.415037499278843818546261056052183492":
+ildouble: 1
+ldouble: 1
+
# sincos
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
-float: 1
idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
double: 1
float: 1
idouble: 1
ifloat: 1
-Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
-double: 1
-float: 1
-idouble: 1
-ifloat: 1
+ildouble: 1
+ldouble: 1
Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
float: 1
ifloat: 1
-# tan
-Test "tan (pi/4) == 1":
-double: 1
-idouble: 1
+# sqrt
+Test "sqrt (2) == M_SQRT2l":
+ildouble: 1
+ldouble: 1
+
+# tanh
+Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
+ildouble: 1
+ldouble: 1
+Test "tanh (-1.0) == -0.7615941559557648881194582826047935904":
+ildouble: 1
+ldouble: 1
+Test "tanh (0.75) == 0.635148952387287319214434357312496495":
+ildouble: 1
+ldouble: 1
+Test "tanh (1.0) == 0.7615941559557648881194582826047935904":
+ildouble: 1
+ldouble: 1
# tgamma
Test "tgamma (-0.5) == -2 sqrt (pi)":
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "tgamma (0.5) == sqrt (pi)":
float: 1
ifloat: 1
float: 1
idouble: 1
ifloat: 1
+Test "tgamma (4) == 6":
+ildouble: 1
+ldouble: 1
# y0
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
float: 1
ifloat: 1
+ildouble: 3
+ldouble: 3
Test "y0 (8.0) == 0.223521489387566220527323400498620359":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 3
+ldouble: 3
# y1
Test "y1 (0.125) == -5.19993611253477499595928744876579921":
double: 1
idouble: 1
+Test "y1 (0.75) == -1.03759455076928541973767132140642198":
+ildouble: 1
+ldouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "y1 (10.0) == 0.249015424206953883923283474663222803":
double: 3
float: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "y1 (8.0) == -0.158060461731247494255555266187483550":
double: 1
float: 2
idouble: 1
ifloat: 2
+ildouble: 1
+ldouble: 1
# yn
Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481":
float: 1
ifloat: 1
+ildouble: 3
+ldouble: 3
Test "yn (0, 8.0) == 0.223521489387566220527323400498620359":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 3
+ldouble: 3
Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
double: 1
idouble: 1
+Test "yn (1, 0.75) == -1.03759455076928541973767132140642198":
+ildouble: 1
+ldouble: 1
Test "yn (1, 1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
double: 3
float: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "yn (1, 8.0) == -0.158060461731247494255555266187483550":
double: 1
float: 2
idouble: 1
ifloat: 2
+ildouble: 1
+ldouble: 1
Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
double: 1
idouble: 1
+ildouble: 2
+ldouble: 2
Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 5
+ldouble: 5
Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
double: 2
idouble: 2
+ildouble: 2
+ldouble: 2
Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
double: 1
idouble: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 2
+ldouble: 2
Test "yn (3, 10.0) == -0.251362657183837329779204747654240998":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
double: 1
idouble: 1
# Maximal error of functions:
Function: "atan2":
-float: 6
-ifloat: 6
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "atanh":
float: 1
ifloat: 1
-Function: Real part of "cacosh":
-double: 1
-float: 7
-idouble: 1
-ifloat: 7
+Function: Imaginary part of "cacos":
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "cacosh":
-double: 1
-float: 3
-idouble: 1
-ifloat: 3
+float: 1
+ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "casin":
double: 1
idouble: 1
ifloat: 1
+Function: Imaginary part of "casin":
+ildouble: 1
+ldouble: 1
+
Function: Real part of "casinh":
double: 5
float: 1
idouble: 5
ifloat: 1
+ildouble: 4
+ldouble: 4
Function: Imaginary part of "casinh":
double: 3
float: 6
idouble: 3
ifloat: 6
-
-Function: Real part of "catan":
-float: 4
-ifloat: 4
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catan":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "catanh":
double: 4
idouble: 4
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "catanh":
-float: 6
-ifloat: 6
+ildouble: 1
+ldouble: 1
Function: "cbrt":
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "ccos":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "ccos":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "ccosh":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "ccosh":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "cexp":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "cexp":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "clog":
float: 1
ifloat: 1
-
-Function: Imaginary part of "clog":
-float: 3
-ifloat: 3
+ildouble: 1
+ldouble: 1
Function: Real part of "clog10":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "clog10":
double: 1
-float: 5
+float: 1
idouble: 1
-ifloat: 5
+ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "cos":
double: 2
float: 1
idouble: 2
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Real part of "cpow":
double: 2
float: 4
idouble: 2
ifloat: 4
+ildouble: 10
+ldouble: 10
Function: Imaginary part of "cpow":
double: 2
float: 2
idouble: 2
ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "csin":
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csin":
+ildouble: 1
+ldouble: 1
Function: Real part of "csinh":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "csinh":
double: 1
Function: Real part of "csqrt":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: Imaginary part of "csqrt":
+ildouble: 1
+ldouble: 1
+
+Function: Real part of "ctan":
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "ctan":
double: 1
idouble: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "ctanh":
double: 1
float: 2
idouble: 1
ifloat: 2
+ildouble: 1
+ldouble: 1
Function: Imaginary part of "ctanh":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "erf":
double: 1
Function: "erfc":
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
Function: "exp10":
double: 6
float: 2
idouble: 6
ifloat: 2
+ildouble: 1
+ldouble: 1
+
+Function: "exp2":
+ildouble: 2
+ldouble: 2
Function: "expm1":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "gamma":
+ildouble: 1
+ldouble: 1
Function: "hypot":
float: 1
float: 2
idouble: 2
ifloat: 2
+ildouble: 2
+ldouble: 2
Function: "j1":
double: 1
float: 2
idouble: 1
ifloat: 2
+ildouble: 4
+ldouble: 4
Function: "jn":
double: 4
float: 4
idouble: 4
ifloat: 4
+ildouble: 4
+ldouble: 4
Function: "lgamma":
double: 1
float: 2
idouble: 1
ifloat: 2
+ildouble: 1
+ldouble: 1
Function: "log10":
double: 1
float: 2
idouble: 1
ifloat: 2
+ildouble: 1
+ldouble: 1
Function: "log1p":
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "log2":
+ildouble: 1
+ldouble: 1
Function: "sincos":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
+
+Function: "sqrt":
+ildouble: 1
+ldouble: 1
Function: "tan":
double: 1
idouble: 1
+Function: "tanh":
+ildouble: 1
+ldouble: 1
+
Function: "tgamma":
double: 1
float: 1
idouble: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
Function: "y0":
double: 2
float: 1
idouble: 2
ifloat: 1
+ildouble: 3
+ldouble: 3
Function: "y1":
double: 3
float: 2
idouble: 3
ifloat: 2
+ildouble: 1
+ldouble: 1
Function: "yn":
double: 3
float: 2
idouble: 3
ifloat: 2
+ildouble: 5
+ldouble: 5
# end of automatic generation
-/* Copyright (C) 1998, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
double
__ceil (double x)
{
- if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
- {
- double tmp1, new_x;
-
- new_x = -x;
- __asm (
+ double two52 = copysign (0x1.0p52, x);
+ double r, tmp;
+
+ __asm (
#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
+ "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
#else
- "cvttq/svm %2,%1\n\t"
+ "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1)
- : "f"(new_x));
-
- /* Fix up the negation we did above, as well as handling -0 properly. */
- x = copysign(new_x, x);
- }
- return x;
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(-x), "f"(-two52));
+
+ /* Fix up the negation we did above, as well as handling -0 properly. */
+ return copysign (r, x);
}
weak_alias (__ceil, ceil)
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
float
__ceilf (float x)
{
- if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
- {
- /* Note that Alpha S_Floating is stored in registers in a
- restricted T_Floating format, so we don't even need to
- convert back to S_Floating in the end. The initial
- conversion to T_Floating is needed to handle denormals. */
-
- float tmp1, tmp2, new_x;
-
- new_x = -x;
- __asm ("cvtst/s %3,%2\n\t"
+ float two23 = copysignf (0x1.0p23, x);
+ float r, tmp;
+
+ __asm (
#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
+ "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
#else
- "cvttq/svm %2,%1\n\t"
+ "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
- : "f"(new_x));
-
- /* Fix up the negation we did above, as well as handling -0 properly. */
- x = copysignf(new_x, x);
- }
- return x;
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(-x), "f"(-two23));
+
+ /* Fix up the negation we did above, as well as handling -0 properly. */
+ return copysignf (r, x);
}
weak_alias (__ceilf, ceilf)
-/* Copyright (C) 1998, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
#include <math_ldbl_opt.h>
-/* Use the -inf rounding mode conversion instructions to implement
- floor. We note when the exponent is large enough that the value
- must be integral, as this avoids unpleasant integer overflows. */
+/* Use the -inf rounding mode conversion instructions to implement floor. */
double
__floor (double x)
{
- if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
- {
- double tmp1, new_x;
-
- __asm (
+ double two52 = copysign (0x1.0p52, x);
+ double r, tmp;
+
+ __asm (
#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
+ "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
#else
- "cvttq/svm %2,%1\n\t"
+ "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1)
- : "f"(x));
-
- /* floor(-0) == -0, and in general we'll always have the same
- sign as our input. */
- x = copysign(new_x, x);
- }
- return x;
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(x), "f"(two52));
+
+ /* floor(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ return copysign (r, x);
}
weak_alias (__floor, floor)
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
#include <math.h>
-/* Use the -inf rounding mode conversion instructions to implement
- floor. We note when the exponent is large enough that the value
- must be integral, as this avoids unpleasant integer overflows. */
+/* Use the -inf rounding mode conversion instructions to implement floor. */
float
__floorf (float x)
{
- if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
- {
- /* Note that Alpha S_Floating is stored in registers in a
- restricted T_Floating format, so we don't even need to
- convert back to S_Floating in the end. The initial
- conversion to T_Floating is needed to handle denormals. */
-
- float tmp1, tmp2, new_x;
-
- __asm ("cvtst/s %3,%2\n\t"
+ float two23 = copysignf (0x1.0p23, x);
+ float r, tmp;
+
+ __asm (
#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
+ "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
#else
- "cvttq/svm %2,%1\n\t"
+ "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
- : "f"(x));
-
- /* floor(-0) == -0, and in general we'll always have the same
- sign as our input. */
- x = copysignf(new_x, x);
- }
- return x;
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(x), "f"(two23));
+
+ /* floor(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ return copysignf (r, x);
}
weak_alias (__floorf, floorf)
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ 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 <sysdep.h>
+#include <math_ldbl_opt.h>
+
+ .set noat
+ .set noreorder
+
+ .text
+ENTRY (__fmax)
+ .prologue 0
+
+ cmptun/su $f16, $f16, $f10
+ cmptun/su $f17, $f17, $f11
+ fmov $f17, $f0
+ unop
+
+ trapb
+ fbne $f10, $ret
+ fmov $f16, $f0
+ fbne $f11, $ret
+
+ cmptlt/su $f16, $f17, $f11
+ trapb
+ fcmovne $f11, $f17, $f0
+$ret: ret
+
+END (__fmax)
+
+/* Given the in-register format of single-precision, this works there too. */
+strong_alias (__fmax, __fmaxf)
+weak_alias (__fmaxf, fmaxf)
+
+weak_alias (__fmax, fmax)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__fmax, __fmaxl)
+weak_alias (__fmaxl, fmaxl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __fmax, fmaxl, GLIBC_2_0);
+#endif
--- /dev/null
+/* __fmaxf is in s_fmax.c */
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ 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 <sysdep.h>
+#include <math_ldbl_opt.h>
+
+ .set noat
+ .set noreorder
+
+ .text
+ENTRY (__fmin)
+ .prologue 0
+
+ cmptun/su $f16, $f16, $f10
+ cmptun/su $f17, $f17, $f11
+ fmov $f17, $f0
+ unop
+
+ trapb
+ fbne $f10, $ret
+ fmov $f16, $f0
+ fbne $f11, $ret
+
+ cmptlt/su $f17, $f16, $f11
+ trapb
+ fcmovne $f11, $f17, $f0
+$ret: ret
+
+END (__fmin)
+
+/* Given the in-register format of single-precision, this works there too. */
+strong_alias (__fmin, __fminf)
+weak_alias (__fminf, fminf)
+
+weak_alias (__fmin, fmin)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__fmin, __fminl)
+weak_alias (__fminl, fminl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __fmin, fminl, GLIBC_2_0);
+#endif
--- /dev/null
+/* __fminf is in s_fmin.c */
--- /dev/null
+/* Return 1 if argument is a NaN, else 0.
+ Copyright (C) 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
+ 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. */
+
+/* Ugly kludge to avoid declarations. */
+#define __isnanf not___isnanf
+#define isnanf not_isnanf
+#define __GI___isnanf not__GI___isnanf
+
+#include <math.h>
+#include <math_ldbl_opt.h>
+
+#undef __isnanf
+#undef isnanf
+#undef __GI___isnanf
+
+/* The hidden_proto in include/math.h was obscured by the macro hackery. */
+__typeof (__isnan) __isnanf;
+hidden_proto (__isnanf)
+
+
+int
+__isnan (double x)
+{
+ return isunordered (x, x);
+}
+
+hidden_def (__isnan)
+weak_alias (__isnan, isnan)
+
+/* It turns out that the 'double' version will also always work for
+ single-precision. */
+strong_alias (__isnan, __isnanf)
+hidden_def (__isnanf)
+weak_alias (__isnanf, isnanf)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__isnan, __isnanl)
+weak_alias (__isnan, isnanl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __isnan, isnanl, GLIBC_2_0);
+#endif
--- /dev/null
+/* In s_isnan.c */
--- /dev/null
+/* In s_lrint.c */
--- /dev/null
+/* In s_lrintf.c */
--- /dev/null
+/* In s_lround.c. */
--- /dev/null
+/* In s_lroundf.c. */
--- /dev/null
+/* Copyright (C) 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
+ 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. */
+
+#define __llrint not___llrint
+#define llrint not_llrint
+#include <math.h>
+#include <math_ldbl_opt.h>
+#undef __llrint
+#undef llrint
+
+long int
+__lrint (double x)
+{
+ long ret;
+
+ __asm ("cvttq/svd %1,%0" : "=&f"(ret) : "f"(x));
+
+ return ret;
+}
+
+strong_alias (__lrint, __llrint)
+weak_alias (__lrint, lrint)
+weak_alias (__llrint, llrint)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__lrint, __lrintl)
+strong_alias (__lrint, __llrintl)
+weak_alias (__lrintl, lrintl)
+weak_alias (__llrintl, llrintl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_0);
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_0);
+#endif
--- /dev/null
+/* Copyright (C) 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
+ 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. */
+
+#define __llrintf not___llrintf
+#define llrintf not_llrintf
+#include <math.h>
+#undef __llrintf
+#undef llrintf
+
+long int
+__lrintf (float x)
+{
+ double tmp;
+ long ret;
+
+ __asm ("cvtst/s %2,%1\n\tcvttq/svd %1,%0"
+ : "=&f"(ret), "=&f"(tmp) : "f"(x));
+
+ return ret;
+}
+
+strong_alias (__lrintf, __llrintf)
+weak_alias (__lrintf, lrintf)
+weak_alias (__llrintf, llrintf)
--- /dev/null
+/* Copyright (C) 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
+ 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. */
+
+#define __llround not___llround
+#define llround not_llround
+#include <math.h>
+#include <math_ldbl_opt.h>
+#undef __llround
+#undef llround
+
+long int
+__lround (double x)
+{
+ double adj;
+
+ adj = 0x1.fffffffffffffp-2; /* nextafter (0.5, 0.0) */
+ adj = copysign (adj, x);
+ return x + adj;
+}
+
+strong_alias (__lround, __llround)
+weak_alias (__lround, lround)
+weak_alias (__llround, llround)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__lround, __lroundl)
+strong_alias (__lround, __llroundl)
+weak_alias (__lroundl, lroundl)
+weak_alias (__llroundl, llroundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __lround, lroundl, GLIBC_2_0);
+compat_symbol (libm, __llround, llroundl, GLIBC_2_0);
+#endif
--- /dev/null
+/* Copyright (C) 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
+ 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. */
+
+#define __llroundf not___llroundf
+#define llroundf not_llroundf
+#include <math.h>
+#undef __llroundf
+#undef llroundf
+
+
+long int
+__lroundf (float x)
+{
+ float adj;
+
+ adj = 0x1.fffffep-2; /* nextafterf (0.5f, 0.0f) */
+ adj = copysignf (adj, x);
+ return x + adj;
+}
+
+strong_alias (__lroundf, __llroundf)
+weak_alias (__lroundf, lroundf)
+weak_alias (__llroundf, llroundf)
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ 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 <math.h>
+#include <math_ldbl_opt.h>
+
+#ifdef _IEEE_FP_INEXACT
+#error "Don't compile with -mieee-with-inexact"
+#endif
+
+double
+__nearbyint (double x)
+{
+ double two52 = copysign (0x1.0p52, x);
+ double r;
+
+ r = x + two52;
+ r = r - two52;
+
+ /* nearbyint(-0.1) == -0, and in general we'll always have the same sign
+ as our input. */
+ return copysign (r, x);
+}
+
+weak_alias (__nearbyint, nearbyint)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__nearbyint, __nearbyintl)
+weak_alias (__nearbyint, nearbyintl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_0);
+#endif
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ 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 <math.h>
+
+#ifdef _IEEE_FP_INEXACT
+#error "Don't compile with -mieee-with-inexact"
+#endif
+
+float
+__nearbyintf (float x)
+{
+ float two23 = copysignf (0x1.0p23, x);
+ float r;
+
+ r = x + two23;
+ r = r - two23;
+
+ /* nearbyint(-0.1) == -0, and in general we'll always have the same sign
+ as our input. */
+ return copysign (r, x);
+}
+
+weak_alias (__nearbyintf, nearbyintf)
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
double
__rint (double x)
{
- if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
- {
- double tmp1, new_x;
- __asm (
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svid %2,%1\n\t"
-#else
- "cvttq/svd %2,%1\n\t"
-#endif
- "cvtqt/d %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1)
- : "f"(x));
-
- /* rint(-0.1) == -0, and in general we'll always have the same
- sign as our input. */
- x = copysign(new_x, x);
- }
- return x;
+ double two52 = copysign (0x1.0p52, x);
+ double r;
+
+ r = x + two52;
+ r = r - two52;
+
+ /* rint(-0.1) == -0, and in general we'll always have the same sign
+ as our input. */
+ return copysign (r, x);
}
weak_alias (__rint, rint)
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
float
__rintf (float x)
{
- if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
- {
- /* Note that Alpha S_Floating is stored in registers in a
- restricted T_Floating format, so we don't even need to
- convert back to S_Floating in the end. The initial
- conversion to T_Floating is needed to handle denormals. */
-
- float tmp1, tmp2, new_x;
-
- __asm ("cvtst/s %3,%2\n\t"
-#ifdef _IEEE_FP_INEXACT
- "cvttq/svid %2,%1\n\t"
-#else
- "cvttq/svd %2,%1\n\t"
-#endif
- "cvtqt/d %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
- : "f"(x));
-
- /* rint(-0.1) == -0, and in general we'll always have the same
- sign as our input. */
- x = copysignf(new_x, x);
- }
- return x;
+ float two23 = copysignf (0x1.0p23, x);
+ float r;
+
+ r = x + two23;
+ r = r - two23;
+
+ /* rint(-0.1) == -0, and in general we'll always have the same sign
+ as our input. */
+ return copysign (r, x);
}
weak_alias (__rintf, rintf)
--- /dev/null
+/* Copyright (C) 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
+ 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 <math.h>
+#include <math_ldbl_opt.h>
+
+
+double
+__round (double x)
+{
+ const double almost_half = 0x1.fffffffffffffp-2;
+ const double two52 = 0x1.0p52;
+ double tmp, r;
+
+ __asm (
+#ifdef _IEEE_FP_INEXACT
+ "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
+#else
+ "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
+#endif
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(fabs (x) + almost_half), "f"(two52));
+
+ return copysign (r, x);
+}
+
+weak_alias (__round, round)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__round, __roundl)
+weak_alias (__roundl, roundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __round, roundl, GLIBC_2_0);
+#endif
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ 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 <math.h>
+
+
+float
+__roundf (float x)
+{
+ const float almost_half = 0x1.fffffep-2;
+ const float two23 = 0x1.0p23;
+ float r, tmp;
+
+ __asm (
+#ifdef _IEEE_FP_INEXACT
+ "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
+#else
+ "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
+#endif
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(fabsf (x) + almost_half), "f"(two23));
+
+ /* round(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ return copysignf (r, x);
+}
+
+weak_alias (__roundf, roundf)
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ 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 <math.h>
+#include <math_ldbl_opt.h>
+
+
+/* Use the chopped rounding mode conversion instructions to implement trunc. */
+
+double
+__trunc (double x)
+{
+ double two52 = copysign (0x1.0p52, x);
+ double r, tmp;
+
+ __asm (
+#ifdef _IEEE_FP_INEXACT
+ "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
+#else
+ "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
+#endif
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(x), "f"(two52));
+
+ /* trunc(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ return copysign (r, x);
+}
+
+weak_alias (__trunc, trunc)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__trunc, __truncl)
+weak_alias (__trunc, truncl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_0);
+#endif
--- /dev/null
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson.
+
+ 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 <math.h>
+
+
+/* Use the chopped rounding mode conversion instructions to implement trunc. */
+
+float
+__truncf (float x)
+{
+ float two23 = copysignf (0x1.0p23, x);
+ float r, tmp;
+
+ __asm (
+#ifdef _IEEE_FP_INEXACT
+ "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
+#else
+ "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
+#endif
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(x), "f"(two23));
+
+ /* trunc(-0) == -0, and in general we'll always have the same
+ sign as our input. */
+ return copysignf (r, x);
+}
+
+weak_alias (__truncf, truncf)
-/* Copyright (C) 1997-2001, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2001, 2004, 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
int __base, int __group) __THROW;
# define __strtol_internal_defined 1
# endif
-extern __inline intmax_t
+__extern_inline intmax_t
__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
int base))
{
int __base, int __group) __THROW;
# define __strtoul_internal_defined 1
# endif
-extern __inline uintmax_t
+__extern_inline uintmax_t
__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
int base))
{
int __base, int __group) __THROW;
# define __wcstol_internal_defined 1
# endif
-extern __inline intmax_t
+__extern_inline intmax_t
__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
__gwchar_t **__restrict endptr, int base))
{
int __base, int __group) __THROW;
# define __wcstoul_internal_defined 1
# endif
-extern __inline uintmax_t
+__extern_inline uintmax_t
__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
__gwchar_t **__restrict endptr, int base))
{
int __base, int __group) __THROW;
# define __strtoll_internal_defined 1
# endif
-extern __inline intmax_t
+__extern_inline intmax_t
__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
int base))
{
int __group) __THROW;
# define __strtoull_internal_defined 1
# endif
-extern __inline uintmax_t
+__extern_inline uintmax_t
__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
int base))
{
int __base, int __group) __THROW;
# define __wcstoll_internal_defined 1
# endif
-extern __inline intmax_t
+__extern_inline intmax_t
__NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
__gwchar_t **__restrict endptr, int base))
{
int __group) __THROW;
# define __wcstoull_internal_defined 1
# endif
-extern __inline uintmax_t
+__extern_inline uintmax_t
__NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
__gwchar_t **__restrict endptr, int base))
{
/* Machine-specific definition for spin locks. Stub version.
- Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1997, 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
#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
#endif
/* Unlock LOCK. */
/* Machine-specific function to return the stack pointer. Stub version.
- Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1997, 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
/* Return the current stack pointer. */
#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
#endif
_EXTERN_INLINE void *
/* Inline math functions for i387.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2003,2004,2006,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
ENTRY(__ieee754_fmod)
fldl 12(%esp)
fldl 4(%esp)
-1: fprem1
+1: fprem
fstsw %ax
sahf
jp 1b
ENTRY(__ieee754_fmodf)
flds 8(%esp)
flds 4(%esp)
-1: fprem1
+1: fprem
fstsw %ax
sahf
jp 1b
{
long double res;
- asm ("1:\tfprem1\n"
+ asm ("1:\tfprem\n"
"fstsw %%ax\n"
"sahf\n"
"jp 1b\n"
ENTRY(__ieee754_log)
fldln2 // log(2)
fldl 4(%esp) // x : log(2)
+ fxam
+ fnstsw
#ifdef PIC
LOAD_PIC_REG (dx)
#endif
fld %st // x : x : log(2)
- fsubl MO(one) // x-1 : x : log(2)
+ sahf
+ jc 3f // in case x is NaN or +-Inf
+4: fsubl MO(one) // x-1 : x : log(2)
fld %st // x-1 : x-1 : x : log(2)
fabs // |x-1| : x-1 : x : log(2)
fcompl MO(limit) // x-1 : x : log(2)
2: fstp %st(0) // x : log(2)
fyl2x // log(x)
ret
+
+3: jp 4b // in case x is +-Inf
+ fstp %st(1)
+ fstp %st(1)
+ ret
END (__ieee754_log)
ENTRY(__ieee754_logf)
fldln2 // log(2)
flds 4(%esp) // x : log(2)
+ fxam
+ fnstsw
#ifdef PIC
LOAD_PIC_REG (dx)
#endif
fld %st // x : x : log(2)
- fsubl MO(one) // x-1 : x : log(2)
+ sahf
+ jc 3f // in case x is NaN or +-Inf
+4: fsubl MO(one) // x-1 : x : log(2)
fld %st // x-1 : x-1 : x : log(2)
fabs // |x-1| : x-1 : x : log(2)
fcompl MO(limit) // x-1 : x : log(2)
2: fstp %st(0) // x : log(2)
fyl2x // log(x)
ret
+
+3: jp 4b // in case x is +-Inf
+ fstp %st(1)
+ fstp %st(1)
+ ret
END (__ieee754_logf)
ENTRY(__ieee754_logl)
fldln2 // log(2)
fldt 4(%esp) // x : log(2)
+ fxam
+ fnstsw
#ifdef PIC
LOAD_PIC_REG (dx)
#endif
fld %st // x : x : log(2)
- fsubl MO(one) // x-1 : x : log(2)
+ sahf
+ jc 3f // in case x is NaN or +-Inf
+4: fsubl MO(one) // x-1 : x : log(2)
fld %st // x-1 : x-1 : x : log(2)
fabs // |x-1| : x-1 : x : log(2)
fcompl MO(limit) // x-1 : x : log(2)
2: fstp %st(0) // x : log(2)
fyl2x // log(x)
ret
+
+3: jp 4b // in case x is +-Inf
+ fstp %st(1)
+ fstp %st(1)
+ ret
END (__ieee754_logl)
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005
+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
2: /* y is a real number. */
fxch // x : y
fldl MO(one) // 1.0 : x : y
- fld %st(1) // x : 1.0 : x : y
- fsub %st(1) // x-1 : 1.0 : x : y
- fabs // |x-1| : 1.0 : x : y
- fcompl MO(limit) // 1.0 : x : y
+ fldl MO(limit) // 0.29 : 1.0 : x : y
+ fld %st(2) // x : 0.29 : 1.0 : x : y
+ fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
+ fabs // |x-1| : 0.29 : 1.0 : x : y
+ fucompp // 1.0 : x : y
fnstsw
fxch // x : 1.0 : y
sahf
// y == ±inf
.align ALIGNARG(4)
12: fstp %st(0) // pop y
- fldl 4(%esp) // x
- fabs
- fcompl MO(one) // < 1, == 1, or > 1
+ fldl MO(one) // 1
+ fldl 4(%esp) // x : 1
+ fabs // abs(x) : 1
+ fucompp // < 1, == 1, or > 1
fnstsw
andb $0x45, %ah
cmpb $0x45, %ah
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1999, 2001, 2004, 2005
+ Copyright (C) 1996, 1997, 1999, 2001, 2004, 2005, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
2: /* y is a real number. */
fxch // x : y
fldl MO(one) // 1.0 : x : y
- fld %st(1) // x : 1.0 : x : y
- fsub %st(1) // x-1 : 1.0 : x : y
- fabs // |x-1| : 1.0 : x : y
- fcompl MO(limit) // 1.0 : x : y
+ fldl MO(limit) // 0.29 : 1.0 : x : y
+ fld %st(2) // x : 0.29 : 1.0 : x : y
+ fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
+ fabs // |x-1| : 0.29 : 1.0 : x : y
+ fucompp // 1.0 : x : y
fnstsw
fxch // x : 1.0 : y
sahf
// y == ±inf
.align ALIGNARG(4)
12: fstp %st(0) // pop y
- flds 4(%esp) // x
- fabs
- fcompl MO(one) // < 1, == 1, or > 1
+ fldl MO(one) // 1
+ flds 4(%esp) // x : 1
+ fabs // abs(x) : 1
+ fucompp // < 1, == 1, or > 1
fnstsw
andb $0x45, %ah
cmpb $0x45, %ah
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005
+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
2: /* y is a real number. */
fxch // x : y
fldl MO(one) // 1.0 : x : y
- fld %st(1) // x : 1.0 : x : y
- fsub %st(1) // x-1 : 1.0 : x : y
- fabs // |x-1| : 1.0 : x : y
- fcompl MO(limit) // 1.0 : x : y
+ fldl MO(limit) // 0.29 : 1.0 : x : y
+ fld %st(2) // x : 0.29 : 1.0 : x : y
+ fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
+ fabs // |x-1| : 0.29 : 1.0 : x : y
+ fucompp // 1.0 : x : y
fnstsw
fxch // x : 1.0 : y
sahf
// y == ±inf
.align ALIGNARG(4)
12: fstp %st(0) // pop y
- fldt 4(%esp) // x
- fabs
- fcompl MO(one) // < 1, == 1, or > 1
+ fldl MO(one) // 1
+ fldt 4(%esp) // x : 1
+ fabs // abs(x) : 1
+ fucompp // < 1, == 1, or > 1
fnstsw
andb $0x45, %ah
cmpb $0x45, %ah
/* Optimized, inlined string functions. i486 version.
- Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004
+ Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
# ifdef __cplusplus
# define __STRING_INLINE inline
# else
-# define __STRING_INLINE extern __inline
+# define __STRING_INLINE __extern_inline
# endif
#endif
/* Inline math functions for ia64.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 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
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
else
return y < 0 ? 1.0/ABS(x) : 0.0; /* return 0 */
}
+
+ qx = u.i[HIGH_HALF]&0x7fffffff; /* no sign */
+ qy = v.i[HIGH_HALF]&0x7fffffff; /* no sign */
+
+ if (qx >= 0x7ff00000 && (qx > 0x7ff00000 || u.i[LOW_HALF] != 0)) return NaNQ.x;
+ if (qy >= 0x7ff00000 && (qy > 0x7ff00000 || v.i[LOW_HALF] != 0))
+ return x == 1.0 ? 1.0 : NaNQ.x;
+
/* if x<0 */
if (u.i[HIGH_HALF] < 0) {
k = checkint(y);
if (k==0) {
- if ((v.i[HIGH_HALF] & 0x7fffffff) == 0x7ff00000 && v.i[LOW_HALF] == 0) {
+ if (qy == 0x7ff00000) {
if (x == -1.0) return 1.0;
else if (x > -1.0) return v.i[HIGH_HALF] < 0 ? INF.x : 0.0;
else return v.i[HIGH_HALF] < 0 ? 0.0 : INF.x;
}
- else if (u.i[HIGH_HALF] == 0xfff00000 && u.i[LOW_HALF] == 0)
+ else if (qx == 0x7ff00000)
return y < 0 ? 0.0 : INF.x;
return NaNQ.x; /* y not integer and x<0 */
}
- else if (u.i[HIGH_HALF] == 0xfff00000 && u.i[LOW_HALF] == 0)
+ else if (qx == 0x7ff00000)
{
if (k < 0)
return y < 0 ? nZERO.x : nINF.x;
return (k==1)?__ieee754_pow(-x,y):-__ieee754_pow(-x,y); /* if y even or odd */
}
/* x>0 */
- qx = u.i[HIGH_HALF]&0x7fffffff; /* no sign */
- qy = v.i[HIGH_HALF]&0x7fffffff; /* no sign */
-
- if (qx > 0x7ff00000 || (qx == 0x7ff00000 && u.i[LOW_HALF] != 0)) return NaNQ.x;
- /* if 0<x<2^-0x7fe */
- if (qy > 0x7ff00000 || (qy == 0x7ff00000 && v.i[LOW_HALF] != 0))
- return x == 1.0 ? 1.0 : NaNQ.x;
- /* if y<2^-0x7fe */
if (qx == 0x7ff00000) /* x= 2^-0x3ff */
{if (y == 0) return NaNQ.x;
--- /dev/null
+long-double-fcts = yes
/* Machine-specific definition for spin locks. Alpha version.
- Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1997, 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
#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
#endif
/* Unlock LOCK. */
/* Machine-specific function to return the stack pointer. Alpha version.
- Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1997, 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
/* Return the current stack pointer. */
#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
#endif
_EXTERN_INLINE void *
/* Machine-specific definition for spin locks. i386 version.
- Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1997, 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
#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
#endif
/* Unlock LOCK. */
/* Machine-specific definition for spin locks. PowerPC version.
- Copyright (C) 1994,97,2002 Free Software Foundation, Inc.
+ Copyright (C) 1994,97,2002,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
#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#define _EXTERN_INLINE __extern_inline
#endif
/* Unlock LOCK. */
/* Machine-specific function to return the stack pointer. PowerPC version.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 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
# ifdef _HURD_THREADVAR_H_EXTERN_INLINE
# define _EXTERN_INLINE _HURD_THREADVAR_H_EXTERN_INLINE
# else
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
#endif
169.254/16 and 127/8 are link-local. */
if ((addr[0] == 169 && addr[1] == 254) || addr[0] == 127)
scope = 2;
- else if (addr[0] == 10 || (addr[0] == 172 && addr[1] == 16)
+ else if (addr[0] == 10 || (addr[0] == 172 && (addr[1] & 0xf0) == 16)
|| (addr[0] == 192 && addr[1] == 168))
scope = 5;
else
/* Inline math functions for powerpc.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2006
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif /* __cplusplus */
#if defined __GNUC__ && !defined _SOFT_FLOAT
/* Optimized, inlined string functions. S/390 version.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2007 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
# ifdef __cplusplus
# define __STRING_INLINE inline
# else
-# define __STRING_INLINE extern __inline
+# define __STRING_INLINE __extern_inline
# endif
#endif
/* Inline math functions for s390.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 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
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
/* Inline math functions for SPARC.
- Copyright (C) 1999, 2000, 2001, 2002, 2004, 2006
+ Copyright (C) 1999, 2000, 2001, 2002, 2004, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
# ifdef __cplusplus
# define __MATH_INLINE __inline
# else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
# endif /* __cplusplus */
/* The gcc, version 2.7 or below, has problems with all this inlining
/* System-specific socket constants and types. 4.4 BSD version.
- Copyright (C) 1991,92,1994-2002,2004 Free Software Foundation, Inc.
+ Copyright (C) 1991,92,1994-2002,2004,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
struct cmsghdr *__cmsg) __THROW;
#ifdef __USE_EXTERN_INLINES
# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
_EXTERN_INLINE struct cmsghdr *
__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
--- /dev/null
+# Override ldbl-opt with alpha specific routines.
+alpha/alphaev6/fpu
--- /dev/null
+# Override ldbl-opt with alpha specific routines.
+alpha/alphaev67/fpu
--- /dev/null
+/* Auxiliary vector processing for Linux/Alpha.
+ Copyright (C) 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
+ 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. */
+
+/* Scan the Aux Vector for the cache shape entries. */
+
+long __libc_alpha_cache_shape[4] = { -2, -2, -2, -2 };
+
+#define DL_PLATFORM_AUXV \
+ case AT_L1I_CACHESHAPE: \
+ __libc_alpha_cache_shape[0] = av->a_un.a_val; \
+ break; \
+ case AT_L1D_CACHESHAPE: \
+ __libc_alpha_cache_shape[1] = av->a_un.a_val; \
+ break; \
+ case AT_L2_CACHESHAPE: \
+ __libc_alpha_cache_shape[2] = av->a_un.a_val; \
+ break; \
+ case AT_L3_CACHESHAPE: \
+ __libc_alpha_cache_shape[3] = av->a_un.a_val; \
+ break;
--- /dev/null
+#include "dl-auxv.h"
+#include <elf/dl-support.c>
-/* Operating system support for run-time dynamic linker. Linux/Alpha version.
- Copyright (C) 1997, 1998, 2001, 2003, 2006 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <config.h>
-#include <kernel-features.h>
-#include <ldsodefs.h>
-
-extern long __libc_alpha_cache_shape[4];
-weak_extern (__libc_alpha_cache_shape);
-
-
-/* Scan the Aux Vector for the cache shape entries. */
-#define DL_PLATFORM_AUXV \
- case AT_L1I_CACHESHAPE: \
- { \
- long *cls = __libc_alpha_cache_shape; \
- if (cls != NULL) \
- cls[0] = av->a_un.a_val; \
- break; \
- } \
- case AT_L1D_CACHESHAPE: \
- { \
- long *cls = __libc_alpha_cache_shape; \
- if (cls != NULL) \
- cls[1] = av->a_un.a_val; \
- break; \
- } \
- case AT_L2_CACHESHAPE: \
- { \
- long *cls = __libc_alpha_cache_shape; \
- if (cls != NULL) \
- cls[2] = av->a_un.a_val; \
- break; \
- } \
- case AT_L3_CACHESHAPE: \
- { \
- long *cls = __libc_alpha_cache_shape; \
- if (cls != NULL) \
- cls[3] = av->a_un.a_val; \
- break; \
- }
-
+#include "dl-auxv.h"
#include <sysdeps/unix/sysv/linux/dl-sysdep.c>
--- /dev/null
+# Override ldbl-opt with alpha specific routines.
+alpha/fpu
/* sigsuspend is a special syscall since it needs to dereference the
sigset. This will have to change when we have more than 64 signals. */
+#ifndef NO_CANCELLATION
+#include <sysdep.h>
+
+#undef PSEUDO_PREPARE_ARGS
+#define PSEUDO_PREPARE_ARGS ldq a0, 0(a0);
+
+PSEUDO(__sigsuspend_nocancel, sigsuspend, 1)
+ ret
+/* Use END, not PSEUDO_END, so that we don't issue two $syscall_error
+ symbols; we'll jump into __sigsuspend for the error case. */
+END(__sigsuspend_nocancel)
+#endif /* NO_CANCELLATION */
+
#include <sysdep-cancel.h>
#undef PSEUDO_PREPARE_ARGS
#define CSHAPE(totalsize, linesize, assoc) \
((totalsize & ~0xff) | (linesize << 4) | assoc)
-long __libc_alpha_cache_shape[4] = { -2, -2, -2, -2 };
+extern long __libc_alpha_cache_shape[4];
static inline unsigned long
implver (void)
/* __sig_atomic_t, __sigset_t, and related definitions. Linux version.
- Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1994, 1996, 1997, 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
# define _SIGSET_H_fns 1
# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
/* Return a mask that includes the bit for SIG only. */
/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991,1992,1994-2001,2004,2006 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1994-2001, 2004, 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
struct cmsghdr *__cmsg) __THROW;
#ifdef __USE_EXTERN_INLINES
# ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
+# define _EXTERN_INLINE __extern_inline
# endif
_EXTERN_INLINE struct cmsghdr *
__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
/* Determine protocol families for which interfaces exist. Linux version.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 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
memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
+#ifdef PAGE_SIZE
+ /* Help the compiler optimize out the malloc call if PAGE_SIZE
+ is constant and smaller or equal to PTHREAD_STACK_MIN/4. */
+ const size_t buf_size = PAGE_SIZE;
+#else
+ const size_t buf_size = __getpagesize ();
+#endif
+ bool use_malloc = false;
+ char *buf;
+
+ if (__libc_use_alloca (buf_size))
+ buf = alloca (buf_size);
+ else
+ {
+ buf = malloc (buf_size);
+ if (buf != NULL)
+ use_malloc = true;
+ else
+ goto out_fail;
+ }
+
+ struct iovec iov = { buf, buf_size };
+
if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
(struct sockaddr *) &nladdr,
sizeof (nladdr))) < 0)
- return -1;
+ goto out_fail;
*seen_ipv4 = false;
*seen_ipv6 = false;
bool done = false;
- char buf[4096];
- struct iovec iov = { buf, sizeof (buf) };
struct in6ailist
{
struct in6addrinfo info;
ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
if (read_len < 0)
- return -1;
+ goto out_fail;
if (msg.msg_flags & MSG_TRUNC)
- return -1;
+ goto out_fail;
struct nlmsghdr *nlmh;
for (nlmh = (struct nlmsghdr *) buf;
{
*in6ai = malloc (in6ailistlen * sizeof (**in6ai));
if (*in6ai == NULL)
- return -1;
+ goto out_fail;
*in6ailen = in6ailistlen;
while (in6ailist != NULL);
}
+ if (use_malloc)
+ free (buf);
+ return 0;
+
+out_fail:
+ if (use_malloc)
+ free (buf);
return 0;
}
/* getifaddrs -- get names and addresses of all network interfaces
- Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 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
__netlink_request (struct netlink_handle *h, int type)
{
struct netlink_res *nlm_next;
- struct netlink_res **new_nlm_list;
- static volatile size_t buf_size = 4096;
- char *buf;
struct sockaddr_nl nladdr;
struct nlmsghdr *nlmh;
ssize_t read_len;
bool done = false;
- bool use_malloc = false;
- if (__netlink_sendreq (h, type) < 0)
- return -1;
+#ifdef PAGE_SIZE
+ /* Help the compiler optimize out the malloc call if PAGE_SIZE
+ is constant and smaller or equal to PTHREAD_STACK_MIN/4. */
+ const size_t buf_size = PAGE_SIZE;
+#else
+ const size_t buf_size = __getpagesize ();
+#endif
+ bool use_malloc = false;
+ char *buf;
- size_t this_buf_size = buf_size;
- if (__libc_use_alloca (this_buf_size))
- buf = alloca (this_buf_size);
+ if (__libc_use_alloca (buf_size))
+ buf = alloca (buf_size);
else
{
- buf = malloc (this_buf_size);
+ buf = malloc (buf_size);
if (buf != NULL)
use_malloc = true;
else
goto out_fail;
}
- struct iovec iov = { buf, this_buf_size };
+ struct iovec iov = { buf, buf_size };
- if (h->nlm_list != NULL)
- new_nlm_list = &h->end_ptr->next;
- else
- new_nlm_list = &h->nlm_list;
+ if (__netlink_sendreq (h, type) < 0)
+ goto out_fail;
while (! done)
{
continue;
if (__builtin_expect (msg.msg_flags & MSG_TRUNC, 0))
- {
- if (this_buf_size >= SIZE_MAX / 2)
- goto out_fail;
-
- nlm_next = *new_nlm_list;
- while (nlm_next != NULL)
- {
- struct netlink_res *tmpptr;
-
- tmpptr = nlm_next->next;
- free (nlm_next);
- nlm_next = tmpptr;
- }
- *new_nlm_list = NULL;
-
- if (__libc_use_alloca (2 * this_buf_size))
- buf = extend_alloca (buf, this_buf_size, 2 * this_buf_size);
- else
- {
- this_buf_size *= 2;
-
- char *new_buf = realloc (use_malloc ? buf : NULL, this_buf_size);
- if (new_buf == NULL)
- goto out_fail;
- new_buf = buf;
-
- use_malloc = true;
- }
- buf_size = this_buf_size;
-
- iov.iov_base = buf;
- iov.iov_len = this_buf_size;
-
- /* Increase sequence number, so that we can distinguish
- between old and new request messages. */
- h->seq++;
-
- if (__netlink_sendreq (h, type) < 0)
- goto out_fail;
-
- continue;
- }
+ goto out_fail;
size_t count = 0;
size_t remaining_len = read_len;
--- /dev/null
+/* Copyright (C) 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
+ 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 <sysdep.h>
+#include <sys/mman.h>
+
+
+int
+posix_madvise (void *addr, size_t len, int advice)
+{
+ /* We have one problem: the kernel's MADV_DONTNEED does not
+ correspond to POSIX's POSIX_MADV_DONTNEED. The former simply
+ discards changes made to the memory without writing it back to
+ disk, if this would be necessary. The POSIX behavior does not
+ allow this. There is no functionality mapping the POSIX behavior
+ so far so we ignore that advice for now. */
+ if (advice == POSIX_MADV_DONTNEED)
+ return 0;
+
+ INTERNAL_SYSCALL_DECL (err);
+ int result = INTERNAL_SYSCALL (madvise, err, 3, addr, len, advice);
+ return INTERNAL_SYSCALL_ERRNO (result, err);
+}
sysdep_routines += pipe
endif
-ifeq ($(subdir),misc)
-sysdep_headers += sys/io.h
-endif
-
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif
/* Definitions of macros to access `dev_t' values.
- Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1999, 2003, 2004, 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
they need. */
#ifdef __GLIBC_HAVE_LONG_LONG
__extension__
-extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
+__extern_inline unsigned int gnu_dev_major (unsigned long long int __dev)
__THROW;
__extension__
-extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
+__extern_inline unsigned int gnu_dev_minor (unsigned long long int __dev)
__THROW;
__extension__
-extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
+__extern_inline unsigned long long int gnu_dev_makedev (unsigned int __major,
unsigned int __minor)
__THROW;
# if defined __GNUC__ && __GNUC__ >= 2
-__extension__ extern __inline unsigned int
+__extension__ __extern_inline unsigned int
__NTH (gnu_dev_major (unsigned long long int __dev))
{
return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}
-__extension__ extern __inline unsigned int
+__extension__ __extern_inline unsigned int
__NTH (gnu_dev_minor (unsigned long long int __dev))
{
return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}
-__extension__ extern __inline unsigned long long int
+__extension__ __extern_inline unsigned long long int
__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
{
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
iopl - iopl i:i iopl
klogctl EXTRA syslog i:isi klogctl
lchown - lchown i:sii __lchown lchown
-posix_madvise - madvise Vi:pii posix_madvise
madvise - madvise i:pii madvise
mincore - mincore i:anV mincore
mlock - mlock i:bn mlock
/* Inline math functions for x86-64.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
#ifdef __cplusplus
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE extern __inline
+# define __MATH_INLINE __extern_inline
#endif
fxam
fnstsw
fld %st // x : x : log10(2)
- andb $1,%ah
+ testb $1, %ah
jnz 3f // in case x is NaN or ±Inf
4: fsubl MO(one) // x-1 : x : log10(2)
fld %st // x-1 : x-1 : x : log10(2)
fyl2x // log10(x)
ret
-3: jp 4b // in case x is ±Inf
+3: testb $4, %ah
+ jnz 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
ret
fxam
fnstsw
fld %st // x : x : 1
- andb $1,%ah
+ testb $1, %ah
jnz 3f // in case x is NaN or ±Inf
4: fsub %st(2), %st // x-1 : x : 1
fld %st // x-1 : x-1 : x : 1
fyl2x // log(x)
ret
-3: jp 4b // in case x is ±Inf
+3: testb $4, %ah
+ jnz 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
ret
ENTRY(__ieee754_logl)
fldln2 // log(2)
fldt 8(%rsp) // x : log(2)
+ fxam
+ fnstsw
fld %st // x : x : log(2)
- fsubl MO(one) // x-1 : x : log(2)
+ testb $1, %ah
+ jnz 3f // in case x is NaN or +-Inf
+4: fsubl MO(one) // x-1 : x : log(2)
fld %st // x-1 : x-1 : x : log(2)
fabs // |x-1| : x-1 : x : log(2)
fcompl MO(limit) // x-1 : x : log(2)
2: fstp %st(0) // x : log(2)
fyl2x // log(x)
ret
+
+3: testb $4, %ah
+ jnz 4b // in case x is +-Inf
+ fstp %st(1)
+ fstp %st(1)
+ ret
END (__ieee754_logl)
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
2: /* y is a real number. */
fxch // x : y
fldl MO(one) // 1.0 : x : y
- fld %st(1) // x : 1.0 : x : y
- fsub %st(1) // x-1 : 1.0 : x : y
- fabs // |x-1| : 1.0 : x : y
- fcompl MO(limit) // 1.0 : x : y
+ fldl MO(limit) // 0.29 : 1.0 : x : y
+ fld %st(2) // x : 0.29 : 1.0 : x : y
+ fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
+ fabs // |x-1| : 0.29 : 1.0 : x : y
+ fucompp // 1.0 : x : y
fnstsw
fxch // x : 1.0 : y
test $4500,%eax
// y == ±inf
.align ALIGNARG(4)
12: fstp %st(0) // pop y
- fldt 8(%rsp) // x
- fabs
- fcompl MO(one) // < 1, == 1, or > 1
+ fldl MO(one) // 1
+ fldt 8(%rsp) // x : 1
+ fabs // abs(x) : 1
+ fucompp // < 1, == 1, or > 1
fnstsw
andb $0x45, %ah
cmpb $0x45, %ah
fxam
fnstsw
fld %st
- andb $1,%ah
+ testb $1, %ah
jnz 3f // in case x is NaN or ±Inf
4:
fabs
2: fyl2xp1
ret
-3: jp 4b // in case x is ±Inf
+3: testb $4, %ah
+ jnz 4b // in case x is ±Inf
fstp %st(1)
fstp %st(1)
ret
do_test (void)
{
time_t t, delta;
- int i, j;
+ int i;
+ unsigned int j;
setenv ("TZ", "America/Sao_Paulo", 1);
/* This test makes some buggy mktime implementations loop.
mktime_test ((time_t) (60 * 60));
mktime_test ((time_t) (60 * 60 * 24));
- for (j = 1; 0 < j; j *= 2)
+ for (j = 1; j <= INT_MAX; j *= 2)
bigtime_test (j);
bigtime_test (j - 1);
}
if (i == num_types)
i = 0;
}
+ else if (timer >= transitions[num_transitions - 1])
+ i = type_idxs[num_transitions - 1];
else
{
/* Find the first transition after TIMER, and
then pick the type of the transition before it. */
- for (i = 1; i < num_transitions; ++i)
- if (timer < transitions[i])
- break;
+ size_t lo = 0;
+ size_t hi = num_transitions - 1;
+ /* Assume that DST is changing twice a year and guess initial
+ search spot from it.
+ Half of a gregorian year has on average 365.2425 * 86400 / 2
+ = 15778476 seconds. */
+ i = (transitions[num_transitions - 1] - timer) / 15778476;
+ if (i < num_transitions)
+ {
+ i = num_transitions - 1 - i;
+ if (timer < transitions[i])
+ {
+ if (i < 10 || timer >= transitions[i - 10])
+ {
+ /* Linear search. */
+ while (timer < transitions[i - 1])
+ --i;
+ goto found;
+ }
+ hi = i - 10;
+ }
+ else
+ {
+ if (i + 10 >= num_transitions || timer < transitions[i + 10])
+ {
+ /* Linear search. */
+ while (timer >= transitions[i])
+ ++i;
+ goto found;
+ }
+ lo = i + 10;
+ }
+ }
+
+ /* Binary search. */
+ /* assert (timer >= transitions[lo] && timer < transitions[hi]); */
+ while (lo + 1 < hi)
+ {
+ i = (lo + hi) / 2;
+ if (timer < transitions[i])
+ hi = i;
+ else
+ lo = i;
+ }
+ i = hi;
+
+ found:
+ /* assert (timer >= transitions[i - 1] && timer < transitions[i]); */
i = type_idxs[i - 1];
}
/* Checking macros for wchar functions.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 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
__const wchar_t *__restrict __s2, size_t __n),
wmemcpy);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
size_t __n))
{
__const wchar_t *__s2,
size_t __n), wmemmove);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
size_t __n))
{
__const wchar_t *__restrict __s2,
size_t __n), wmempcpy);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wmempcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
size_t __n))
{
extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
size_t __n), wmemset);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
{
if (__bos0 (__s) != (size_t) -1)
(wchar_t *__restrict __dest,
__const wchar_t *__restrict __src), wcscpy);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
{
if (__bos (__dest) != (size_t) -1)
__const wchar_t *__src),
wcpcpy);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src))
{
if (__bos (__dest) != (size_t) -1)
__const wchar_t *__restrict __src,
size_t __n), wcsncpy);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
{
if (__bos (__dest) != (size_t) -1
__const wchar_t *__restrict __src,
size_t __n), wcpncpy);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
{
if (__bos (__dest) != (size_t) -1
(wchar_t *__restrict __dest,
__const wchar_t *__restrict __src), wcscat);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wcscat (wchar_t *__dest, __const wchar_t *__src))
{
if (__bos (__dest) != (size_t) -1)
__const wchar_t *__restrict __src,
size_t __n), wcsncat);
-extern __always_inline wchar_t *
+__extern_always_inline wchar_t *
__NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n))
{
if (__bos (__dest) != (size_t) -1)
(wchar_t *__restrict __s, int __n,
__FILE *__restrict __stream), fgetws) __wur;
-extern __always_inline __wur wchar_t *
+__extern_always_inline __wur wchar_t *
fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
{
if (__bos (__s) != (size_t) -1
__FILE *__restrict __stream), fgetws_unlocked)
__wur;
-extern __always_inline __wur wchar_t *
+__extern_always_inline __wur wchar_t *
fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
{
if (__bos (__s) != (size_t) -1
(char *__restrict __s, wchar_t __wchar,
mbstate_t *__restrict __ps), wcrtomb) __wur;
-extern __always_inline __wur size_t
+__extern_always_inline __wur size_t
__NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps))
{
/* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
size_t __len, mbstate_t *__restrict __ps),
mbsrtowcs);
-extern __always_inline size_t
+__extern_always_inline size_t
__NTH (mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
size_t __len, mbstate_t *__restrict __ps))
{
size_t __len, mbstate_t *__restrict __ps),
wcsrtombs);
-extern __always_inline size_t
+__extern_always_inline size_t
__NTH (wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
size_t __len, mbstate_t *__restrict __ps))
{
size_t __len, mbstate_t *__restrict __ps),
mbsnrtowcs);
-extern __always_inline size_t
+__extern_always_inline size_t
__NTH (mbsnrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
size_t __nmc, size_t __len, mbstate_t *__restrict __ps))
{
size_t __nwc, size_t __len,
mbstate_t *__restrict __ps), wcsnrtombs);
-extern __always_inline size_t
+__extern_always_inline size_t
__NTH (wcsnrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
size_t __nwc, size_t __len, mbstate_t *__restrict __ps))
{
locales must use ASCII encoding for the values in the ASCII range
and because the wchar_t encoding is always ISO 10646. */
extern wint_t __btowc_alias (int __c) __asm ("btowc");
-extern __inline wint_t
+__extern_inline wint_t
__NTH (btowc (int __c))
{ return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
? (wint_t) __c : __btowc_alias (__c)); }
extern int __wctob_alias (wint_t __c) __asm ("wctob");
-extern __inline int
+__extern_inline int
__NTH (wctob (wint_t __wc))
{ return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
? (int) __wc : __wctob_alias (__wc)); }
# endif
-extern __inline size_t
+__extern_inline size_t
__NTH (mbrlen (__const char *__restrict __s, size_t __n,
mbstate_t *__restrict __ps))
{ return (__ps != NULL
/* Define inline functions which call the internal entry points. */
__BEGIN_NAMESPACE_C99
-extern __inline double
+__extern_inline double
__NTH (wcstod (__const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr))
{ return __wcstod_internal (__nptr, __endptr, 0); }
-extern __inline long int
+__extern_inline long int
__NTH (wcstol (__const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base))
{ return __wcstol_internal (__nptr, __endptr, __base, 0); }
-extern __inline unsigned long int
+__extern_inline unsigned long int
__NTH (wcstoul (__const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base))
{ return __wcstoul_internal (__nptr, __endptr, __base, 0); }
__END_NAMESPACE_C99
# ifdef __USE_GNU
-extern __inline float
+__extern_inline float
__NTH (wcstof (__const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr))
{ return __wcstof_internal (__nptr, __endptr, 0); }
# ifndef __LDBL_COMPAT
-extern __inline long double
+__extern_inline long double
__NTH (wcstold (__const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr))
{ return __wcstold_internal (__nptr, __endptr, 0); }
# endif
__extension__
-extern __inline long long int
+__extern_inline long long int
__NTH (wcstoq (__const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base))
{ return __wcstoll_internal (__nptr, __endptr, __base, 0); }
__extension__
-extern __inline unsigned long long int
+__extern_inline unsigned long long int
__NTH (wcstouq (__const wchar_t *__restrict __nptr,
wchar_t **__restrict __endptr, int __base))
{ return __wcstoull_internal (__nptr, __endptr, __base, 0); }