+Mon Dec 30 01:32:59 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * tme/localtime.c: Rewrite so that localtime_r does not call tzset,
+ but localtime does.
+
+ * features.h: Rename ANSI C to ISO C.
+ Mention __GLIBC__ and __GLIBC_MINOR__ macros.
+
+ * gnu-versions.h: Add _GNU_GETOPT_INTERFACE_VERSION.
+ * posix/getopt.c: Use _GNU_GETOPT_INTERFACE_VERSION to check
+ whether we can elide the code.
+ * posix/getopt1.c: Likewise.
+ * posix/Makefile: Correct copyright.
+
+ * elf/dl-error.c (_dl_catch_error): Clear `catch' also when error
+ occurred.
+ * elf/dl-support.c (_dl_sysdep_open_zero_fill): Don't define if
+ MAP_ANON is defined.
+ * elf/eval.c: Use __getline instead of getline.
+ * elf/rtld.c (dl_main): Check return value of _dl_new_object
+ function for NULL.
+ * sysdeps/generic/dl-cache.c: Update copyright.
+
+ * signal/Makefile: Correct copyright.
+ (routines): Remove gsignal and ssignal. Add bsd_signal.
+ * signal/gsignal.c: Removed. Now is made an alias.
+ * signal/ssignal.c: Likewise.
+ * sysdeps/posix/raise.c: Add alias gsignal.
+ * sysdeps/stub/raise.c: Likewise.
+ * sysdeps/posix/signal.c: Add alias ssignal.
+ * sysdeps/stub/signal.c: Likewise.
+ * signal/signal.h: Declare bsd_signal. Define signal as bsd_signal
+ if __FAVOR_BSD.
+ * sysdeps/posix/bsd_signal.c: New file. Implementation of XPG
+ function.
+
+ * sysdeps/unix/sysv/linux/signal.c: Add explanation.
+
+ * socket/sys/un.h: Define SUN_LEN according to POSIX.1g.
+
+ * stdio-common/Makefile (tests): Add scanf10.
+ * stdio-common/scanf10.c: New file.
+ * stdio-common/vfscanf.c: Decrement counter if EOF is read while
+ reading string.
+
+ * sysdeps/libm-i387/e_acos.S: Use END, not PSEUDO_END.
+ * sysdeps/libm-i387/e_acosl.S: Likewise.
+ * sysdeps/libm-i387/e_asin.S: Likewise.
+ * sysdeps/libm-i387/e_asinl.S: Likewise.
+ * sysdeps/libm-i387/e_atan2.S: Likewise.
+ * sysdeps/libm-i387/e_atan2f.S: Likewise.
+ * sysdeps/libm-i387/e_atan2l.S: Likewise.
+ * sysdeps/libm-i387/e_exp.S: Likewise.
+ * sysdeps/libm-i387/e_expl.S: Likewise.
+ * sysdeps/libm-i387/e_fmod.S: Likewise.
+ * sysdeps/libm-i387/e_fmodl.S: Likewise.
+ * sysdeps/libm-i387/e_log.S: Likewise.
+ * sysdeps/libm-i387/e_log10.S: Likewise.
+ * sysdeps/libm-i387/e_log10l.S: Likewise.
+ * sysdeps/libm-i387/e_logl.S: Likewise.
+ * sysdeps/libm-i387/e_remainder.S: Likewise.
+ * sysdeps/libm-i387/e_remainderf.S: Likewise.
+ * sysdeps/libm-i387/e_remainderl.S: Likewise.
+ * sysdeps/libm-i387/e_scalb.S: Likewise.
+ * sysdeps/libm-i387/e_scalbl.S: Likewise.
+ * sysdeps/libm-i387/e_sqrt.S: Likewise.
+ * sysdeps/libm-i387/e_sqrtf.S: Likewise.
+ * sysdeps/libm-i387/e_sqrtl.S: Likewise.
+ * sysdeps/libm-i387/s_atan.S: Likewise.
+ * sysdeps/libm-i387/s_atanf.S: Likewise.
+ * sysdeps/libm-i387/s_atanl.S: Likewise.
+ * sysdeps/libm-i387/s_ceil.S: Likewise.
+ * sysdeps/libm-i387/s_ceilf.S: Likewise.
+ * sysdeps/libm-i387/s_ceill.S: Likewise.
+ * sysdeps/libm-i387/s_copysign.S: Likewise.
+ * sysdeps/libm-i387/s_copysignf.S: Likewise.
+ * sysdeps/libm-i387/s_copysignl.S: Likewise.
+ * sysdeps/libm-i387/s_cos.S: Likewise.
+ * sysdeps/libm-i387/s_cosf.S: Likewise.
+ * sysdeps/libm-i387/s_cosl.S: Likewise.
+ * sysdeps/libm-i387/s_finite.S: Likewise.
+ * sysdeps/libm-i387/s_finitef.S: Likewise.
+ * sysdeps/libm-i387/s_finitel.S: Likewise.
+ * sysdeps/libm-i387/s_floor.S: Likewise.
+ * sysdeps/libm-i387/s_floorf.S: Likewise.
+ * sysdeps/libm-i387/s_floorl.S: Likewise.
+ * sysdeps/libm-i387/s_ilogb.S: Likewise.
+ * sysdeps/libm-i387/s_ilogbf.S: Likewise.
+ * sysdeps/libm-i387/s_ilogbl.S: Likewise.
+ * sysdeps/libm-i387/s_log1p.S: Likewise.
+ * sysdeps/libm-i387/s_log1pf.S: Likewise.
+ * sysdeps/libm-i387/s_log1pl.S: Likewise.
+ * sysdeps/libm-i387/s_logb.S: Likewise.
+ * sysdeps/libm-i387/s_logbf.S: Likewise.
+ * sysdeps/libm-i387/s_logbl.S: Likewise.
+ * sysdeps/libm-i387/s_rint.S: Likewise.
+ * sysdeps/libm-i387/s_rintf.S: Likewise.
+ * sysdeps/libm-i387/s_rintl.S: Likewise.
+ * sysdeps/libm-i387/s_scalbn.S: Likewise.
+ * sysdeps/libm-i387/s_scalbnf.S: Likewise.
+ * sysdeps/libm-i387/s_scalbnl.S: Likewise.
+ * sysdeps/libm-i387/s_significand.S: Likewise.
+ * sysdeps/libm-i387/s_significandf.S: Likewise.
+ * sysdeps/libm-i387/s_significandl.S: Likewise.
+ * sysdeps/libm-i387/s_sin.S: Likewise.
+ * sysdeps/libm-i387/s_sinf.S: Likewise.
+ * sysdeps/libm-i387/s_sinl.S: Likewise.
+
+ * sysdeps/libm-i387/e_log.S: Use fyl2xp1 instruction for values
+ near 1 to increase precision.
+ * sysdeps/libm-i387/e_log10.S: Likewise.
+ * sysdeps/libm-i387/e_log10l.S: Likewise.
+ * sysdeps/libm-i387/e_logl.S: Likewise.
+
+ * sysdeps/libm-i387/s_cos.S: Use testl instead of andw.
+ * sysdeps/libm-i387/s_cosl.S: Likewise.
+ * sysdeps/libm-i387/s_sin.S: Likewise.
+ * sysdeps/libm-i387/s_sinl.S: Likewise.
+ * sysdeps/libm-i387/s_tan.S: Likewise.
+ * sysdeps/libm-i387/s_tanl.S: Likewise.
+
+ * sysdeps/libm-i387/e_acosf.S: New file. Add float versions.
+ * sysdeps/libm-i387/e_asinf.S: Likewise.
+ * sysdeps/libm-i387/e_expf.S: Likewise.
+ * sysdeps/libm-i387/e_fmodf.S: Likewise.
+ * sysdeps/libm-i387/e_log10f.S: Likewise.
+ * sysdeps/libm-i387/e_logf.S: Likewise.
+ * sysdeps/libm-i387/e_scalbf.S: Likewise.
+
+ * sysdeps/libm-i387/e_acosh.S: New file. Highly optimized versions.
+ * sysdeps/libm-i387/e_acoshf.S: Likewise.
+ * sysdeps/libm-i387/e_acoshl.S: Likewise.
+ * sysdeps/libm-i387/e_atanh.S: Likewise.
+ * sysdeps/libm-i387/e_atanhf.S: Likewise.
+ * sysdeps/libm-i387/e_atanhl.S: Likewise.
+ * sysdeps/libm-i387/e_asinh.S: Likewise.
+ * sysdeps/libm-i387/e_asinhf.S: Likewise.
+ * sysdeps/libm-i387/e_asinhl.S: Likewise.
+
+ * sysdeps/libm-ieee754/s_asinhf.c: Tweak a bit. Use lower levels
+ for simplified handling.
+
+ * sysdeps/unix/sysv/linux/syscalls.list: Add query_module.
+
+Sun Dec 22 01:39:29 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * inet/rcmd.c (rcmd): Set h_errno before calling herror.
+ * inet/rexec.c (rexec): Likewise.
+
+Sat Dec 21 21:47:08 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/unix/sysv/linux/m68k/setjmp.c (__setjmp): Make it really
+ compatible.
+
+Sun Dec 22 03:23:33 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/libm-i387/s_log1p.S: Use fyl2xp1 for numbers in range
+ -0.29 <= x <= 0.29, otherwise the old method.
+ * sysdeps/libm-i387/s_log1pf.S: Likewise.
+ * sysdeps/libm-i387/s_log1pl.S: Likewise.
+
Sun Dec 22 00:01:27 1996 Ulrich Drepper <drepper@cygnus.com>
* inet/getnetgrent.c: Reformat copyright.
}
/* We get here only if we longjmp'd out of OPERATE. */
+ catch = NULL;
*errstring = c.errstring;
*objname = c.objname;
return errcode == -1 ? 0 : errcode;
For the dynamic linker it is set by -rpath when linking. */
const char *_dl_rpath = DEFAULT_RPATH;
\f
+#ifndef MAP_ANON
/* This is the only dl-sysdep.c function that is actually needed at run-time
by _dl_map_object. */
{
return __open ("/dev/zero", O_RDONLY);
}
+#endif
/* This should never be called. */
void
char *buf = NULL;
size_t bufsz = 0;
- while (getline (&buf, &bufsz, stdin) > 0)
+ while (__getline (&buf, &bufsz, stdin) > 0)
{
char *p = buf;
eval (&p);
/* Create a link_map for the executable itself.
This will be what dlopen on "" returns. */
l = _dl_new_object ((char *) "", "", lt_executable);
+ if (l == NULL)
+ _dl_sysdep_fatal ("cannot allocate memory for link map", NULL);
l->l_phdr = phdr;
l->l_phnum = phent;
l->l_entry = *user_entry;
/* These are defined by the user (or the compiler)
to specify the desired environment:
- __STRICT_ANSI__ ANSI Standard C.
+ __STRICT_ANSI__ ISO Standard C.
_POSIX_SOURCE IEEE Std 1003.1.
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
if >=199309L, add IEEE Std 1003.1b-1993
_XOPEN_SOURCE Includes POSIX and XPG things.
_XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
- _BSD_SOURCE ANSI, POSIX, and 4.3BSD things.
- _SVID_SOURCE ANSI, POSIX, and SVID things.
+ _BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
+ _SVID_SOURCE ISO C, POSIX, and SVID things.
_GNU_SOURCE All of the above, plus GNU extensions.
_REENTRANT Select additionally reentrant object.
_THREAD_SAFE Same as _REENTRANT, often used by other systems.
If none of these are defined, the default is all but _GNU_SOURCE.
If more than one of these are defined, they accumulate.
For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
- together give you ANSI C, 1003.1, and 1003.2, but nothing else.
+ together give you ISO C, 1003.1, and 1003.2, but nothing else.
These are defined by this file and are used by the
header files to decide what to declare or define:
__USE_REENTRANT Define reentrant/thread-safe *_r functions.
__FAVOR_BSD Favor 4.3BSD things in cases of conflict.
- The macro `__GNU_LIBRARY__' is defined by this file unconditionally.
+ The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
+ defined by this file unconditionally. `__GNU_LIBRARY__' is provided
+ only for compatibility. All new code should use the other symbols
+ to test for features.
All macros listed above as possibly being defined by this file are
explicitly undefined if they are not explicitly defined.
# define __KERNEL_STRICT_NAMES
#endif
-/* Always use ANSI things. */
+/* Always use ISO C things. */
#define __USE_ANSI 1
/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
-#if defined (_BSD_SOURCE) && \
- !(defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) || \
- defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_DEFINED) || \
- defined (_GNU_SOURCE) || defined (_SVID_SOURCE))
+#if defined _BSD_SOURCE && \
+ !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
+ defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_DEFINED || \
+ defined _GNU_SOURCE || defined _SVID_SOURCE)
# define __FAVOR_BSD 1
#endif
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
-#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \
- !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE) && \
- !defined (_XOPEN_SOURCE_EXTENDED) && !defined (_BSD_SOURCE) && \
- !defined (_SVID_SOURCE))
+#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
+ !defined _POSIX_C_SOURCE && !defined _XOPEN_SOURCE && \
+ !defined _XOPEN_SOURCE_EXTENDED && !defined _BSD_SOURCE && \
+ !defined _SVID_SOURCE)
#define _BSD_SOURCE 1
#define _SVID_SOURCE 1
#endif
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
(and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
-#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \
- !defined (_POSIX_C_SOURCE))
+#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
+ !defined _POSIX_C_SOURCE)
#define _POSIX_SOURCE 1
-#if defined(_XOPEN_SOURCE)
+#ifdef _XOPEN_SOURCE
#define _POSIX_C_SOURCE 2
#else
#define _POSIX_C_SOURCE 199309L
#endif
#endif
-#if (defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1 || \
- defined (_XOPEN_SOURCE))
+#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
#define __USE_POSIX 1
#endif
-#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2 || \
- defined (_XOPEN_SOURCE))
+#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
#define __USE_POSIX2 1
#endif
-#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L)
+#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 199309L
#define __USE_POSIX199309 1
#endif
#endif
#endif
-#if defined (_BSD_SOURCE) || defined (_SVID_SOURCE)
+#if defined _BSD_SOURCE || defined _SVID_SOURCE
#define __USE_MISC 1
#endif
#define __USE_GNU 1
#endif
-#if defined (_REENTRANT) || defined (_THREAD_SAFE)
+#if defined _REENTRANT || defined _THREAD_SAFE
#define __USE_REENTRANT 1
#endif
#define __GLIBC_MINOR__ 0
-#if !defined (__GNUC__) || __GNUC__ < 2
+#if !defined __GNUC__ || __GNUC__ < 2
/* In GCC version 2, (__extension__ EXPR) will not complain
about GCC extensions used in EXPR under -ansi or -pedantic. */
#define __extension__
#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */
+#define _GNU_GETOPT_INTERFACE_VERSION 1 /* vs posix/getopt.c and
+ posix/getopt1.c */
#endif /* gnu-versions.h */
&hp, &herr) < 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
{
+ __set_h_errno (herr);
herror(*ahost);
return -1;
}
char *pbuf;
size_t dirlen;
size_t buflen = __sysconf (_SC_GETPW_R_SIZE_MAX);
- char buffer = __alloca (buflen);
+ char *buffer = __alloca (buflen);
first = 0;
if (getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)
&hp, &herr) < 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
{
+ __set_h_errno (herr);
herror(*ahost);
return -1;
}
_IO_init (&sf._sbf._f, 0);
_IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps;
_IO_str_init_static (&sf._sbf._f, string, -1, string);
- _IO_str_init_static ((_IO_FILE *) &sf, string, -1, string);
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, &sf);
_IO_flockfile (&sf._sbf._f);
ret = _IO_vfprintf (&sf._sbf._f, format, args);
# Library General Public License for more details.
# You should have received a copy of the GNU Library General Public
-# License along with the GNU C Library; see the file COPYING.LIB. If
-# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-# Cambridge, MA 02139, USA.
+# License along with the GNU C Library; see the file COPYING.LIB. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
#
# Sub-makefile for POSIX portion of the library.
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+#define GETOPT_INTERFACE_VERSION 1
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
/* This needs to come after some library #include
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
-/* XXX 1003.2 says this must be 1 before any call. */
-int optind = 0;
+/* 1003.2 says this must be 1 before any call. */
+int optind = 1;
+
+/* Formerly, initialization of getopt depended on optind==0, which
+ causes problems with re-calling getopt as programs generally don't
+ know that. */
+
+int __getopt_initialized = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
{
optarg = NULL;
- if (optind == 0)
+ if (!__getopt_initialized)
{
optstring = _getopt_initialize (optstring);
optind = 1; /* Don't scan ARGV[0], the program name. */
+ __getopt_initialized = 1;
}
/* Test whether ARGV[optind] points to a non-option argument.
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
+
+ /* Before we can be provide the next result we must be
+ reinitialized. */
+ __getopt_initialized = 0;
+
return EOF;
}
if (NONOPTION_P)
{
if (ordering == REQUIRE_ORDER)
- return EOF;
+ {
+ /* Before we can be provide the next result we must be
+ reinitialized. */
+ __getopt_initialized = 0;
+ return EOF;
+ }
optarg = argv[optind++];
return 1;
}
0);
}
-#endif /* _LIBC or not __GNU_LIBRARY__. */
+#endif /* Not ELIDE_CODE. */
\f
#ifdef TEST
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 1996
Free Software Foundation, Inc.
-This file is part of the GNU C Library. Its master source is NOT part of
-the C library, however. The master source lives in /gd/gnu/lib.
+ This file is part of the GNU C Library. Its master source is NOT part of
+ the C library, however. The master source lives in /gd/gnu/lib.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
+ 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
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
\f
#ifdef HAVE_CONFIG_H
#include <config.h>
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+#define GETOPT_INTERFACE_VERSION 1
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
-#else
-char *getenv ();
#endif
#ifndef NULL
}
-#endif /* _LIBC or not __GNU_LIBRARY__. */
+#endif /* Not ELIDE_CODE. */
\f
#ifdef TEST
# Library General Public License for more details.
# You should have received a copy of the GNU Library General Public
-# License along with the GNU C Library; see the file COPYING.LIB. If
-# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-# Cambridge, MA 02139, USA.
+# License along with the GNU C Library; see the file COPYING.LIB. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
#
# Makefile for signal routines.
sigstack sigaltstack sigintr \
sigsetops sigempty sigfillset sigaddset sigdelset sigismem \
sigreturn \
- gsignal ssignal siggetmask
+ siggetmask bsd_signal
tests := tst-signal
+++ /dev/null
-/* Copyright (C) 1991, 1995 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <signal.h>
-
-#undef gsignal
-
-int
-gsignal (sig)
- int sig;
-{
- return raise (sig);
-}
#ifndef _SIGNAL_H
-#if !defined(__need_sig_atomic_t) && !defined(__need_sigset_t)
+#if !defined __need_sig_atomic_t && !defined __need_sigset_t
#define _SIGNAL_H 1
#include <features.h>
#endif
#include <gnu/types.h>
#include <sigset.h> /* __sigset_t, __sig_atomic_t. */
-#if !defined(__sig_atomic_t_defined) && \
- (defined(_SIGNAL_H) || defined(__need_sig_atomic_t))
+#if !defined __sig_atomic_t_defined \
+ && (defined _SIGNAL_H || defined __need_sig_atomic_t)
/* An integral type that can be modified atomically, without the
possibility of a signal arriving in the middle of the operation. */
typedef __sig_atomic_t sig_atomic_t;
#endif /* `sig_atomic_t' undefined and <signal.h> or need `sig_atomic_t'. */
-#undef __need_sig_atomic_t
+#undef __need_sig_atomic_t
-#ifdef _SIGNAL_H
+#ifdef _SIGNAL_H
#include <signum.h>
returning the old handler, or SIG_ERR on error. */
extern __sighandler_t signal __P ((int __sig, __sighandler_t __handler));
+#if defined __FAVOR_BSD || defined __USE_XOPEN
+/* The X/Open definition of `signal' conflicts with the BSD version.
+ So they defined another function `bsd_signal'. We will use this
+ implementation as the official `signal' function if the BSD
+ interface is preferred. */
+extern __sighandler_t bsd_signal __P ((int __sig, __sighandler_t __handler));
+
+#ifdef __FAVOR_BSD
+#define signal(sig, handler) bsd_signal ((sig), (handler))
+#endif
+#endif
+
/* Send signal SIG to process number PID. If PID is zero,
send SIG to all processes in the current process's process group.
If PID is < -1, send SIG to all processes in process group - PID. */
extern int __kill __P ((__pid_t __pid, int __sig));
-#ifdef __USE_POSIX
+#ifdef __USE_POSIX
extern int kill __P ((__pid_t __pid, int __sig));
#endif /* Use POSIX. */
-#if defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Send SIG to all processes in process group PGRP.
If PGRP is zero, send SIG to all processes in
the current process's process group. */
/* Raise signal SIG, i.e., send SIG to yourself. */
extern int raise __P ((int __sig));
-#ifdef __USE_SVID
+#ifdef __USE_SVID
/* SVID names for the same things. */
extern __sighandler_t ssignal __P ((int __sig, __sighandler_t __handler));
extern int gsignal __P ((int __sig));
#endif /* Use SVID. */
-#ifdef __USE_MISC
+#ifdef __USE_MISC
/* Print a message describing the meaning of the given signal number. */
extern void psignal __P ((int __sig, __const char *__s));
#endif /* Use misc. */
explitcly selects the BSD version. */
extern int __sigpause __P ((int __sig_or_mask, int __is_sig));
-#if defined(__USE_BSD) && !defined(__USE_XOPEN)
+#if defined __USE_BSD && !defined __USE_XOPEN
/* Set the mask of blocked signals to MASK,
wait for a signal to arrive, and then restore the mask. */
#define sigpause(mask) __sigpause ((mask), 0)
#endif
-#ifdef __USE_BSD
+#ifdef __USE_BSD
#define sigmask(sig) __sigmask(sig)
extern int sigblock __P ((int __mask));
#endif /* Use BSD. */
-#ifdef __USE_MISC
+#ifdef __USE_MISC
#define NSIG _NSIG
#endif
-#ifdef __USE_GNU
+#ifdef __USE_GNU
typedef __sighandler_t sighandler_t;
#endif
/* 4.4 BSD uses the name `sig_t' for this. */
-#ifdef __USE_BSD
+#ifdef __USE_BSD
typedef __sighandler_t sig_t;
#endif
#endif /* <signal.h> included. */
-#ifdef __USE_POSIX
+#ifdef __USE_POSIX
-#if !defined(__sigset_t_defined) && \
- (defined(_SIGNAL_H) || defined(__need_sigset_t))
+#if !defined __sigset_t_defined \
+ && (defined _SIGNAL_H || defined __need_sigset_t)
typedef __sigset_t sigset_t;
#define __sigset_t_defined 1
#endif /* `sigset_t' not defined and <signal.h> or need `sigset_t'. */
-#undef __need_sigset_t
+#undef __need_sigset_t
-#ifdef _SIGNAL_H
+#ifdef _SIGNAL_H
/* Clear all signals from SET. */
extern int sigemptyset __P ((sigset_t *__set));
#endif /* Use POSIX. */
-#if defined(_SIGNAL_H) && defined(__USE_BSD)
+#if defined _SIGNAL_H && defined __USE_BSD
/* Names of the signals. This variable exists only for compatibility.
Use `strsignal' instead (see <string.h>). */
#endif /* signal.h included and use BSD. */
-#if defined(_SIGNAL_H) && (defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED))
+#if defined _SIGNAL_H && (defined __USE_BSD || defined __USE_XOPEN_EXTENDED)
#define __need_size_t
#include <stddef.h>
+++ /dev/null
-/* Copyright (C) 1991, 1992, 1995 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <signal.h>
-
-#undef ssignal
-
-__sighandler_t
-ssignal (sig, func)
- int sig;
- __sighandler_t func;
-{
- return signal (sig, func);
-}
#define _SYS_UN_H 1
#include <sys/cdefs.h>
+#include <string.h> /* For prototype of `strlen'. */
+
/* Get the definition of the macro to define the common sockaddr members. */
#include <sockaddrcom.h>
char sun_path[108]; /* Path name. */
};
+
+/* Evaluate to actual length of the `sockaddr_un' structure. */
+#define SUN_LEN(ptr) (((struct sockaddr_un *) 0)->sun_path \
+ + strlen ((ptr)->sun_path))
+
__END_DECLS
#endif /* sys/un.h */
xbug errnobug \
bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 \
tfformat tiformat tstdiomisc \
- scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9
+ scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10
include ../Rules
--- /dev/null
+#include <stdio.h>
+#include <string.h>
+
+int
+main (int argc, char *argv[])
+{
+ const char teststring[] = "<tag `word'>";
+ int retc, a, b;
+
+ retc = sscanf (teststring, "<%*s `%n%*s%n'>", &a, &b);
+
+ printf ("retc=%d a=%d b=%d\n", retc, a, b);
+
+ return retc == -1 && a == 6 && b == 12 ? 0 : 1;
+}
if (First) \
input_error (); \
else \
- break; \
+ { \
+ --read_in; \
+ break; \
+ } \
val = c; \
if (val >= 0x80) \
{ \
STRING_ADD_CHAR (str, c, char);
} while ((width <= 0 || --width > 0) && inchar () != EOF);
+ if (c == EOF)
+ --read_in;
+
if (!(flags & SUPPRESS))
{
*str = '\0';
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
-Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
+ 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
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <link.h>
#include <stddef.h>
fxch %st(1)
fpatan
ret
-PSEUDO_END (__ieee754_acos)
+END (__ieee754_acos)
--- /dev/null
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: $")
+
+/* acos = atan (sqrt(1 - x^2) / x) */
+ENTRY(__ieee754_acosf)
+ flds 4(%esp) /* x */
+ fst %st(1)
+ fmul %st(0) /* x^2 */
+ fld1
+ fsubp /* 1 - x^2 */
+ fsqrt /* sqrt (1 - x^2) */
+ fxch %st(1)
+ fpatan
+ ret
+END (__ieee754_acosf)
--- /dev/null
+/* ix87 specific implementation of arcsinh.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_acosh)
+ movl 8(%esp), %ecx
+ cmpl $0x3ff00000, %ecx
+ jl 5f // < 1 => invalid
+ fldln2 // log(2)
+ fldl 4(%esp) // x : log(2)
+ cmpl $0x41b00000, %ecx
+ ja 3f // x > 2^28
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ cmpl $0x40000000, %ecx
+ ja 4f // x > 2
+
+ // 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
+ fsubl MO(one) // x-1 : log(2)
+ fld %st // x-1 : x-1 : log(2)
+ fmul %st(1) // (x-1)^2 : x-1 : log(2)
+ fadd %st(1) // x-1+(x-1)^2 : x-1 : log(2)
+ fadd %st(1) // 2*(x-1)+(x-1)^2 : x-1 : log(2)
+ fsqrt // sqrt(2*(x-1)+(x-1)^2) : x-1 : log(2)
+ faddp // x-1+sqrt(2*(x-1)+(x-1)^2) : log(2)
+ fcoml MO(limit)
+ fnstsw
+ sahf
+ ja 2f
+ fyl2xp1 // log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
+ ret
+
+2: faddl MO(one) // x+sqrt(2*(x-1)+(x-1)^2) : log(2)
+ fyl2x // log(x+sqrt(2*(x-1)+(x-1)^2))
+ ret
+
+ // x > 2^28 => y = log(x) + log(2)
+ .align ALIGNARG(4)
+3: fyl2x // log(x)
+ fldln2 // log(2) : log(x)
+ faddp // log(x)+log(2)
+ ret
+
+ // 2^28 > x > 2 => y = log(2*x - 1/(x+sqrt(x*x-1)))
+ .align ALIGNARG(4)
+4: fld %st // x : x : log(2)
+ fadd %st, %st(1) // x : 2*x : log(2)
+ fld %st // x : x : 2*x : log(2)
+ fmul %st(1) // x^2 : x : 2*x : log(2)
+ fsubl MO(one) // x^2-1 : x : 2*x : log(2)
+ fsqrt // sqrt(x^2-1) : x : 2*x : log(2)
+ faddp // x+sqrt(x^2-1) : 2*x : log(2)
+ fdivrl MO(one) // 1/(x+sqrt(x^2-1)) : 2*x : log(2)
+ fsubrp // 2*x+1/(x+sqrt(x^2)-1) : log(2)
+ fyl2x // log(2*x+1/(x+sqrt(x^2-1)))
+ ret
+
+ // x < 1 => NaN
+ .align ALIGNARG(4)
+5: fldz
+ fdiv %st, %st(0)
+ ret
+END(__ieee754_acosh)
--- /dev/null
+/* ix87 specific implementation of arcsinh.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_acoshf)
+ movl 8(%esp), %ecx
+ cmpl $0x3f800000, %ecx
+ jl 5f // < 1 => invalid
+ fldln2 // log(2)
+ flds 4(%esp) // x : log(2)
+ cmpl $0x47000000, %ecx
+ ja 3f // x > 2^14
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ cmpl $0x40000000, %ecx
+ ja 4f // x > 2
+
+ // 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
+ fsubl MO(one) // x-1 : log(2)
+ fld %st // x-1 : x-1 : log(2)
+ fmul %st(1) // (x-1)^2 : x-1 : log(2)
+ fadd %st(1) // x-1+(x-1)^2 : x-1 : log(2)
+ fadd %st(1) // 2*(x-1)+(x-1)^2 : x-1 : log(2)
+ fsqrt // sqrt(2*(x-1)+(x-1)^2) : x-1 : log(2)
+ faddp // x-1+sqrt(2*(x-1)+(x-1)^2) : log(2)
+ fcoml MO(limit)
+ fnstsw
+ sahf
+ ja 2f
+ fyl2xp1 // log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
+ ret
+
+2: faddl MO(one) // x+sqrt(2*(x-1)+(x-1)^2) : log(2)
+ fyl2x // log(x+sqrt(2*(x-1)+(x-1)^2))
+ ret
+
+ // x > 2^14 => y = log(x) + log(2)
+ .align ALIGNARG(4)
+3: fyl2x // log(x)
+ fldln2 // log(2) : log(x)
+ faddp // log(x)+log(2)
+ ret
+
+ // 2^28 > x > 2 => y = log(2*x - 1/(x+sqrt(x*x-1)))
+ .align ALIGNARG(4)
+4: fld %st // x : x : log(2)
+ fadd %st, %st(1) // x : 2*x : log(2)
+ fld %st // x : x : 2*x : log(2)
+ fmul %st(1) // x^2 : x : 2*x : log(2)
+ fsubl MO(one) // x^2-1 : x : 2*x : log(2)
+ fsqrt // sqrt(x^2-1) : x : 2*x : log(2)
+ faddp // x+sqrt(x^2-1) : 2*x : log(2)
+ fdivrl MO(one) // 1/(x+sqrt(x^2-1)) : 2*x : log(2)
+ fsubrp // 2*x+1/(x+sqrt(x^2)-1) : log(2)
+ fyl2x // log(2*x+1/(x+sqrt(x^2-1)))
+ ret
+
+ // x < 1 => NaN
+ .align ALIGNARG(4)
+5: fldz
+ fdiv %st, %st(0)
+ ret
+END(__ieee754_acoshf)
--- /dev/null
+/* ix87 specific implementation of arcsinh.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ /* Please note that we use double value for 1.0. This number
+ has an exact representation and so we don't get accuracy
+ problems. The advantage is that the code is simpler. */
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_acoshl)
+ movl 12(%esp), %ecx
+ cmpl $0x3fff, %ecx
+ jl 5f // < 1 => invalid
+ fldln2 // log(2)
+ fldt 4(%esp) // x : log(2)
+ cmpl $0x4020, %ecx
+ ja 3f // x > 2^34
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ cmpl $0x4000, %ecx
+ ja 4f // x > 2
+
+ // 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
+ fsubl MO(one) // x-1 : log(2)
+ fld %st // x-1 : x-1 : log(2)
+ fmul %st(1) // (x-1)^2 : x-1 : log(2)
+ fadd %st(1) // x-1+(x-1)^2 : x-1 : log(2)
+ fadd %st(1) // 2*(x-1)+(x-1)^2 : x-1 : log(2)
+ fsqrt // sqrt(2*(x-1)+(x-1)^2) : x-1 : log(2)
+ faddp // x-1+sqrt(2*(x-1)+(x-1)^2) : log(2)
+ fcoml MO(limit)
+ fnstsw
+ sahf
+ ja 2f
+ fyl2xp1 // log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
+ ret
+
+2: faddl MO(one) // x+sqrt(2*(x-1)+(x-1)^2) : log(2)
+ fyl2x // log(x+sqrt(2*(x-1)+(x-1)^2))
+ ret
+
+ // x > 2^34 => y = log(x) + log(2)
+ .align ALIGNARG(4)
+3: fyl2x // log(x)
+ fldln2 // log(2) : log(x)
+ faddp // log(x)+log(2)
+ ret
+
+ // 2^34 > x > 2 => y = log(2*x - 1/(x+sqrt(x*x-1)))
+ .align ALIGNARG(4)
+4: fld %st // x : x : log(2)
+ fadd %st, %st(1) // x : 2*x : log(2)
+ fld %st // x : x : 2*x : log(2)
+ fmul %st(1) // x^2 : x : 2*x : log(2)
+ fsubl MO(one) // x^2-1 : x : 2*x : log(2)
+ fsqrt // sqrt(x^2-1) : x : 2*x : log(2)
+ faddp // x+sqrt(x^2-1) : 2*x : log(2)
+ fdivrl MO(one) // 1/(x+sqrt(x^2-1)) : 2*x : log(2)
+ fsubrp // 2*x+1/(x+sqrt(x^2)-1) : log(2)
+ fyl2x // log(2*x+1/(x+sqrt(x^2-1)))
+ ret
+
+ // x < 1 => NaN
+ .align ALIGNARG(4)
+5: fldz
+ fdiv %st, %st(0)
+ ret
+END(__ieee754_acoshl)
fxch %st(1)
fpatan
ret
-PSEUDO_END (__ieee754_acosl)
+END (__ieee754_acosl)
fsqrt /* sqrt (1 - x^2) */
fpatan
ret
-PSEUDO_END (__ieee754_asin)
+END (__ieee754_asin)
--- /dev/null
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: $")
+
+/* asin = atan (x / sqrt(1 - x^2)) */
+ENTRY(__ieee754_asinf)
+ flds 4(%esp) /* x */
+ fst %st(1)
+ fmul %st(0) /* x^2 */
+ fld1
+ fsubp /* 1 - x^2 */
+ fsqrt /* sqrt (1 - x^2) */
+ fpatan
+ ret
+END (__ieee754_asinf)
fsqrt /* sqrt (1 - x^2) */
fpatan
ret
-PSEUDO_END (__ieee754_asinl)
+END (__ieee754_asinl)
fldl 12(%esp)
fpatan
ret
-PSEUDO_END (__ieee754_atan2)
+END (__ieee754_atan2)
flds 8(%esp)
fpatan
ret
-PSEUDO_END (__ieee754_atan2f)
+END (__ieee754_atan2f)
fldt 16(%esp)
fpatan
ret
-PSEUDO_END (__ieee754_atan2l)
+END (__ieee754_atan2l)
--- /dev/null
+/* ix87 specific implementation of arctanh function.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(half,@object)
+half: .double 0.5
+ ASM_SIZE_DIRECTIVE(half)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+ ASM_TYPE_DIRECTIVE(ln2_2,@object)
+ln2_2: .tfloat 0.3465735902799726547086160
+ ASM_SIZE_DIRECTIVE(ln2_2)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_atanh)
+ movl 8(%esp), %ecx
+
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+
+ andl $0x80000000, %ecx // ECX == 0 iff X >= 0
+
+ fldt MO(ln2_2) // 0.5*ln2
+ xorl %ecx, 8(%esp)
+ fldl 4(%esp) // |x| : 0.5*ln2
+ fcoml MO(half) // |x| : 0.5*ln2
+ fld %st // |x| : |x| : 0.5*ln2
+ fnstsw // |x| : |x| : 0.5*ln2
+ sahf
+ jae 2f
+ fadd %st, %st(1) // |x| : 2*|x| : 0.5*ln2
+ fld %st // |x| : |x| : 2*|x| : 0.5*ln2
+ fsubrl MO(one) // 1-|x| : |x| : 2*|x| : 0.5*ln2
+ fxch // |x| : 1-|x| : 2*|x| : 0.5*ln2
+ fmul %st(2) // 2*|x|^2 : 1-|x| : 2*|x| : 0.5*ln2
+ fdivp // (2*|x|^2)/(1-|x|) : 2*|x| : 0.5*ln2
+ faddp // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fcoml MO(limit) // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fnstsw // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ sahf
+ jae 4f
+ fyl2xp1 // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x))
+3: ret
+
+ .align ALIGNARG(4)
+4: faddl MO(one) // 1+2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fyl2x // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x))
+3: ret
+
+ .align ALIGNARG(4)
+2: faddl MO(one) // 1+|x| : |x| : 0.5*ln2
+ fxch // |x| : 1+|x| : 0.5*ln2
+ fsubrl MO(one) // 1-|x| : 1+|x| : 0.5*ln2
+ fdivrp // (1+|x|)/(1-|x|) : 0.5*ln2
+ fyl2x // 0.5*ln2*ld((1+|x|)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld((1+x)/(1-x))
+3: ret
+END(__ieee754_atanh)
--- /dev/null
+/* ix87 specific implementation of arctanh function.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(half,@object)
+half: .double 0.5
+ ASM_SIZE_DIRECTIVE(half)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(ln2_2,@object)
+ln2_2: .tfloat 0.3465735902799726547086160
+ ASM_SIZE_DIRECTIVE(ln2_2)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_atanhf)
+ movl 4(%esp), %ecx
+
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+
+ andl $0x80000000, %ecx // ECX == 0 iff X >= 0
+
+ fldt MO(ln2_2) // 0.5*ln2
+ xorl %ecx, 4(%esp)
+ flds 4(%esp) // |x| : 0.5*ln2
+ fcoml MO(half) // |x| : 0.5*ln2
+ fld %st(0) // |x| : |x| : 0.5*ln2
+ fnstsw // |x| : |x| : 0.5*ln2
+ sahf
+ jae 2f
+ fadd %st, %st(1) // |x| : 2*|x| : 0.5*ln2
+ fld %st // |x| : |x| : 2*|x| : 0.5*ln2
+ fsubrl MO(one) // 1-|x| : |x| : 2*|x| : 0.5*ln2
+ fxch // |x| : 1-|x| : 2*|x| : 0.5*ln2
+ fmul %st(2) // 2*|x|^2 : 1-|x| : 2*|x| : 0.5*ln2
+ fdivp // (2*|x|^2)/(1-|x|) : 2*|x| : 0.5*ln2
+ faddp // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fcoml MO(limit) // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fnstsw // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ sahf
+ jae 4f
+ fyl2xp1 // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x))
+3: ret
+
+ .align ALIGNARG(4)
+4: faddl MO(one) // 1+2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fyl2x // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x))
+3: ret
+
+ .align ALIGNARG(4)
+2: faddl MO(one) // 1+|x| : |x| : 0.5*ln2
+ fxch // |x| : 1+|x| : 0.5*ln2
+ fsubrl MO(one) // 1-|x| : 1+|x| : 0.5*ln2
+ fdivrp // (1+|x|)/(1-|x|) : 0.5*ln2
+ fyl2x // 0.5*ln2*ld((1+|x|)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld((1+x)/(1-x))
+3: ret
+END(__ieee754_atanhf)
--- /dev/null
+/* ix87 specific implementation of arctanh function.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ /* Please note that we use double values for 0.5 and 1.0. These
+ numbers have exact representations and so we don't get accuracy
+ problems. The advantage is that the code is simpler. */
+ ASM_TYPE_DIRECTIVE(half,@object)
+half: .double 0.5
+ ASM_SIZE_DIRECTIVE(half)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(ln2_2,@object)
+ln2_2: .tfloat 0.3465735902799726547086160
+ ASM_SIZE_DIRECTIVE(ln2_2)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_atanhl)
+ movl 12(%esp), %ecx
+
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+
+ andl $0x8000, %ecx // ECX == 0 iff X >= 0
+
+ fldt MO(ln2_2) // 0.5*ln2
+ xorl %ecx, 12(%esp)
+ fldt 4(%esp) // |x| : 0.5*ln2
+ fcoml MO(half) // |x| : 0.5*ln2
+ fld %st(0) // |x| : |x| : 0.5*ln2
+ fnstsw // |x| : |x| : 0.5*ln2
+ sahf
+ jae 2f
+ fadd %st, %st(1) // |x| : 2*|x| : 0.5*ln2
+ fld %st // |x| : |x| : 2*|x| : 0.5*ln2
+ fsubrl MO(one) // 1-|x| : |x| : 2*|x| : 0.5*ln2
+ fxch // |x| : 1-|x| : 2*|x| : 0.5*ln2
+ fmul %st(2) // 2*|x|^2 : 1-|x| : 2*|x| : 0.5*ln2
+ fdivp // (2*|x|^2)/(1-|x|) : 2*|x| : 0.5*ln2
+ faddp // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fcoml MO(limit) // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fnstsw // 2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ sahf
+ jae 4f
+ fyl2xp1 // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x))
+3: ret
+
+ .align ALIGNARG(4)
+4: faddl MO(one) // 1+2*|x|+(2*|x|^2)/(1-|x|) : 0.5*ln2
+ fyl2x // 0.5*ln2*ld(1+2*|x|+(2*|x|^2)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld(1+2*x+(2*x^2)/(1-x))
+3: ret
+
+ .align ALIGNARG(4)
+2: faddl MO(one) // 1+|x| : |x| : 0.5*ln2
+ fxch // |x| : 1+|x| : 0.5*ln2
+ fsubrl MO(one) // 1-|x| : 1+|x| : 0.5*ln2
+ fdivrp // (1+|x|)/(1-|x|) : 0.5*ln2
+ fyl2x // 0.5*ln2*ld((1+|x|)/(1-|x|))
+ jecxz 3f
+ fchs // 0.5*ln2*ld((1+x)/(1-x))
+3: ret
+END(__ieee754_atanhl)
jz .LpInf /* If positive, jump. */
fldz /* Set result to 0. */
.LpInf: ret
-PSEUDO_END (__ieee754_exp)
+END (__ieee754_exp)
--- /dev/null
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: $")
+
+/* e^x = 2^(x * log2(e)) */
+ENTRY(__ieee754_expf)
+ flds 4(%esp)
+/* I added the following ugly construct because exp(+-Inf) resulted
+ in NaN. The ugliness results from the bright minds at Intel.
+ For the i686 the code can be written better.
+ -- drepper@cygnus.com. */
+ fxam /* Is NaN or +-Inf? */
+ fstsw %ax
+ sahf
+ jnc .LnoInfNaN /* No, jump. */
+ jp .LisInf /* Is +-Inf, jump. */
+.LnoInfNaN:
+ fldl2e
+ fmulp /* x * log2(e) */
+ fstl %st(1)
+ frndint /* int(x * log2(e)) */
+ fstl %st(2)
+ fsubrp /* fract(x * log2(e)) */
+ f2xm1 /* 2^(fract(x * log2(e))) - 1 */
+ fld1
+ faddp /* 2^(fract(x * log2(e))) */
+ fscale /* e^x */
+ fstp %st(1)
+ ret
+
+.LisInf:
+ andb $2, %ah /* Test sign. */
+ jz .LpInf /* If positive, jump. */
+ fldz /* Set result to 0. */
+.LpInf: ret
+END (__ieee754_expf)
jz .LpInf /* If positive, jump. */
fldz /* Set result to 0. */
.LpInf: ret
-PSEUDO_END (__ieee754_expl)
+END (__ieee754_expl)
jp 1b
fstpl %st(1)
ret
-PSEUDO_END (__ieee754_fmod)
+END (__ieee754_fmod)
--- /dev/null
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: $")
+
+ENTRY(__ieee754_fmodf)
+ flds 8(%esp)
+ flds 4(%esp)
+1: fprem
+ fstsw %ax
+ sahf
+ jp 1b
+ fstpl %st(1)
+ ret
+END(__ieee754_fmodf)
jp 1b
fstpl %st(1)
ret
-PSEUDO_END (__ieee754_fmodl)
+END (__ieee754_fmodl)
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
+ *
+ * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
*/
#include <machine/asm.h>
RCSID("$NetBSD: e_log.S,v 1.4 1995/05/08 23:48:39 jtc Exp $")
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
ENTRY(__ieee754_log)
- fldln2
- fldl 4(%esp)
- fyl2x
+ fldln2 // log(2)
+ fldl 4(%esp) // x : log(2)
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ fld %st // x : x : log(2)
+ 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)
+ fnstsw // x-1 : x : log(2)
+ sahf
+ ja 2f
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+
+2: fincstp // x : log(2)
+ fyl2x // log(x)
ret
-PSEUDO_END (__ieee754_log)
+END (__ieee754_log)
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
+ *
+ * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
*/
#include <machine/asm.h>
RCSID("$NetBSD: e_log10.S,v 1.4 1995/05/08 23:49:24 jtc Exp $")
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
ENTRY(__ieee754_log10)
- fldlg2
- fldl 4(%esp)
- fyl2x
+ fldlg2 // log10(2)
+ fldl 4(%esp) // x : log10(2)
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ fld %st // x : x : log10(2)
+ fsubl MO(one) // x-1 : x : log10(2)
+ fld %st // x-1 : x-1 : x : log10(2)
+ fabs // |x-1| : x-1 : x : log10(2)
+ fcompl MO(limit) // x-1 : x : log10(2)
+ fnstsw // x-1 : x : log10(2)
+ sahf
+ ja 2f
+ fstp %st(1) // x-1 : log10(2)
+ fyl2xp1 // log10(x)
+ ret
+
+2: fincstp // x : log10(2)
+ fyl2x // log10(x)
ret
-PSEUDO_END (__ieee754_log10)
+END (__ieee754_log10)
--- /dev/null
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
+ *
+ * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: $")
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_log10f)
+ fldlg2 // log10(2)
+ flds 4(%esp) // x : log10(2)
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ fld %st // x : x : log10(2)
+ fsubl MO(one) // x-1 : x : log10(2)
+ fld %st // x-1 : x-1 : x : log10(2)
+ fabs // |x-1| : x-1 : x : log10(2)
+ fcompl MO(limit) // x-1 : x : log10(2)
+ fnstsw // x-1 : x : log10(2)
+ sahf
+ ja 2f
+ fstp %st(1) // x-1 : log10(2)
+ fyl2xp1 // log10(x)
+ ret
+
+2: fincstp // x : log10(2)
+ fyl2x // log10(x)
+ ret
+END (__ieee754_log10f)
* Public domain.
*
* Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
+ *
+ * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
*/
#include <machine/asm.h>
RCSID("$NetBSD: $")
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
ENTRY(__ieee754_log10l)
- fldlg2
- fldt 4(%esp)
- fyl2x
+ fldlg2 // log10(2)
+ fldt 4(%esp) // x : log10(2)
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ fld %st // x : x : log10(2)
+ fsubl MO(one) // x-1 : x : log10(2)
+ fld %st // x-1 : x-1 : x : log10(2)
+ fabs // |x-1| : x-1 : x : log10(2)
+ fcompl MO(limit) // x-1 : x : log10(2)
+ fnstsw // x-1 : x : log10(2)
+ sahf
+ ja 2f
+ fstp %st(1) // x-1 : log10(2)
+ fyl2xp1 // log10(x)
+ ret
+
+2: fincstp // x : log10(2)
+ fyl2x // log10(x)
ret
-PSEUDO_END(__ieee754_log10l)
+END(__ieee754_log10l)
--- /dev/null
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float by Ulrich Drepper <drepper@cygnus.com>.
+ *
+ * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: e_log.S,v 1.4 1995/05/08 23:48:39 jtc Exp $")
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__ieee754_logf)
+ fldln2 // log(2)
+ flds 4(%esp) // x : log(2)
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ fld %st // x : x : log(2)
+ 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)
+ fnstsw // x-1 : x : log(2)
+ sahf
+ ja 2f
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+
+2: fincstp // x : log(2)
+ fyl2x // log(x)
+ ret
+END (__ieee754_logf)
RCSID("$NetBSD: $")
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
ENTRY(__ieee754_logl)
- fldln2
- fldt 4(%esp)
- fyl2x
+ fldln2 // log(2)
+ fldt 4(%esp) // x : log(2)
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ fld %st // x : x : log(2)
+ 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)
+ fnstsw // x-1 : x : log(2)
+ sahf
+ ja 2f
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+
+2: fincstp // x : log(2)
+ fyl2x // log(x)
ret
-PSEUDO_END(__ieee754_logl)
+END (__ieee754_logl)
jp 1b
fstpl %st(1)
ret
-PSEUDO_END (__ieee754_remainder)
+END (__ieee754_remainder)
jp 1b
fstpl %st(1)
ret
-PSEUDO_END (__ieee754_remainderf)
+END (__ieee754_remainderf)
sahf
jp 1b
ret
-PSEUDO_END (__ieee754_remainderl)
+END (__ieee754_remainderl)
fldl 4(%esp)
fscale
ret
-PSEUDO_END(__ieee754_scalb)
+END(__ieee754_scalb)
--- /dev/null
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
+ */
+
+#include <machine/asm.h>
+
+RCSID("$NetBSD: $")
+
+ENTRY(__ieee754_scalbf)
+ flds 8(%esp)
+ flds 4(%esp)
+ fscale
+ ret
+END(__ieee754_scalbf)
fldt 4(%esp)
fscale
ret
-PSEUDO_END(__ieee754_scalbl)
+END(__ieee754_scalbl)
fldl 4(%esp)
fsqrt
ret
-PSEUDO_END (__ieee754_sqrt)
+END (__ieee754_sqrt)
flds 4(%esp)
fsqrt
ret
-PSEUDO_END (__ieee754_sqrtf)
+END (__ieee754_sqrtf)
fldt 4(%esp)
fsqrt
ret
-PSEUDO_END (__ieee754_sqrtl)
+END (__ieee754_sqrtl)
--- /dev/null
+/* ix87 specific implementation of arcsinh.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(huge,@object)
+huge: .double 1e+300
+ ASM_SIZE_DIRECTIVE(huge)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__asinh)
+ movl 8(%esp), %ecx
+ movl $0x7fffffff, %eax
+ andl %ecx, %eax
+ andl $0x80000000, %ecx
+ xorl %ecx, 8(%esp)
+ fldl 4(%esp) // |x|
+ cmpl $0x3e300000, %eax
+ jb 2f // |x| < 2^-28
+ fldln2 // log(2) : |x|
+ cmpl $0x41b00000, %eax
+ fxch // |x| : log(2)
+ ja 3f // |x| > 2^28
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ cmpl $0x40000000, %eax
+ ja 5f // |x| > 2
+
+ // 2^-28 <= |x| <= 2 => y = sign(x)*log1p(|x|+|x|^2/(1+sqrt(1+|x|^2)))
+ fld %st // |x| : |x| : log(2)
+ fmul %st(1) // |x|^2 : |x| : log(2)
+ fld %st // |x|^2 : |x|^2 : |x| : log(2)
+ faddl MO(one) // 1+|x|^2 : |x|^2 : |x| : log(2)
+ fsqrt // sqrt(1+|x|^2) : |x|^2 : |x| : log(2)
+ faddl MO(one) // 1+sqrt(1+|x|^2) : |x|^2 : |x| : log(2)
+ fdivrp // |x|^2/(1+sqrt(1+|x|^2)) : |x| : log(2)
+ faddp // |x|+|x|^2/(1+sqrt(1+|x|^2)) : log(2)
+ fcoml MO(limit)
+ fnstsw
+ sahf
+ ja 6f
+ fyl2xp1
+ jecxz 4f
+ fchs
+4: ret
+
+6: faddl MO(one)
+ fyl2x
+ jecxz 4f
+ fchs
+4: ret
+
+ // |x| < 2^-28 => y = x (inexact iff |x| != 0.0)
+ .align ALIGNARG(4)
+2:
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ jecxz 4f
+ fchs // x
+4: fld %st // x : x
+ faddl MO(huge) // huge+x : x
+ fincstp // x
+ ret
+
+ // |x| > 2^28 => y = sign(x) * (log(|x|) + log(2))
+ .align ALIGNARG(4)
+3: fyl2x // log(|x|)
+ fldln2 // log(2) : log(|x|)
+ faddp // log(|x|)+log(2)
+ jecxz 4f
+ fchs
+4: ret
+
+ // |x| > 2 => y = sign(x) * log(2*|x| + 1/(|x|+sqrt(x*x+1)))
+ .align ALIGNARG(4)
+5: fld %st // |x| : |x| : log(2)
+ fadd %st, %st(1) // |x| : 2*|x| : log(2)
+ fld %st // |x| : |x| : 2*|x| : log(2)
+ fmul %st(1) // |x|^2 : |x| : 2*|x| : log(2)
+ faddl MO(one) // 1+|x|^2 : |x| : 2*|x| : log(2)
+ fsqrt // sqrt(1+|x|^2) : |x| : 2*|x| : log(2)
+ faddp // |x|+sqrt(1+|x|^2) : 2*|x| : log(2)
+ fdivrl MO(one) // 1/(|x|+sqrt(1+|x|^2)) : 2*|x| : log(2)
+ faddp // 2*|x|+1/(|x|+sqrt(1+|x|^2)) : log(2)
+ fyl2x // log(2*|x|+1/(|x|+sqrt(1+|x|^2)))
+ jecxz 4f
+ fchs
+4: ret
+END(__asinh)
+weak_alias (__asinh, asinh)
--- /dev/null
+/* ix87 specific implementation of arcsinh.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(huge,@object)
+huge: .double 1e+36
+ ASM_SIZE_DIRECTIVE(huge)
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__asinhf)
+ movl 4(%esp), %ecx
+ movl $0x7fffffff, %eax
+ andl %ecx, %eax
+ andl $0x80000000, %ecx
+ xorl %ecx, 8(%esp)
+ flds 4(%esp) // |x|
+ cmpl $0x38000000, %eax
+ jb 2f // |x| < 2^-14
+ fldln2 // log(2) : |x|
+ cmpl $0x47000000, %eax
+ fxch // |x| : log(2)
+ ja 3f // |x| > 2^14
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ cmpl $0x40000000, %eax
+ ja 5f // |x| > 2
+
+ // 2^-14 <= |x| <= 2 => y = sign(x)*log1p(|x|+|x|^2/(1+sqrt(1+|x|^2)))
+ fld %st // |x| : |x| : log(2)
+ fmul %st(1) // |x|^2 : |x| : log(2)
+ fld %st // |x|^2 : |x|^2 : |x| : log(2)
+ faddl MO(one) // 1+|x|^2 : |x|^2 : |x| : log(2)
+ fsqrt // sqrt(1+|x|^2) : |x|^2 : |x| : log(2)
+ faddl MO(one) // 1+sqrt(1+|x|^2) : |x|^2 : |x| : log(2)
+ fdivrp // |x|^2/(1+sqrt(1+|x|^2)) : |x| : log(2)
+ faddp // |x|+|x|^2/(1+sqrt(1+|x|^2)) : log(2)
+ fcoml MO(limit)
+ fnstsw
+ sahf
+ ja 6f
+ fyl2xp1
+ jecxz 4f
+ fchs
+4: ret
+
+6: faddl MO(one)
+ fyl2x
+ jecxz 4f
+ fchs
+4: ret
+
+ // |x| < 2^-14 => y = x (inexact iff |x| != 0.0)
+ .align ALIGNARG(4)
+2:
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ jecxz 4f
+ fchs // x
+4: fld %st // x : x
+ faddl MO(huge) // huge+x : x
+ fincstp // x
+ ret
+
+ // |x| > 2^14 => y = sign(x) * (log(|x|) + log(2))
+ .align ALIGNARG(4)
+3: fyl2x // log(|x|)
+ fldln2 // log(2) : log(|x|)
+ faddp // log(|x|)+log(2)
+ jecxz 4f
+ fchs
+4: ret
+
+ // |x| > 2 => y = sign(x) * log(2*|x| + 1/(|x|+sqrt(x*x+1)))
+ .align ALIGNARG(4)
+5: fld %st // |x| : |x| : log(2)
+ fadd %st, %st(1) // |x| : 2*|x| : log(2)
+ fld %st // |x| : |x| : 2*|x| : log(2)
+ fmul %st(1) // |x|^2 : |x| : 2*|x| : log(2)
+ faddl MO(one) // 1+|x|^2 : |x| : 2*|x| : log(2)
+ fsqrt // sqrt(1+|x|^2) : |x| : 2*|x| : log(2)
+ faddp // |x|+sqrt(1+|x|^2) : 2*|x| : log(2)
+ fdivrl MO(one) // 1/(|x|+sqrt(1+|x|^2)) : 2*|x| : log(2)
+ faddp // 2*|x|+1/(|x|+sqrt(1+|x|^2)) : log(2)
+ fyl2x // log(2*|x|+1/(|x|+sqrt(1+|x|^2)))
+ jecxz 4f
+ fchs
+4: ret
+END(__asinhf)
+weak_alias (__asinhf, asinhf)
--- /dev/null
+/* ix87 specific implementation of arcsinh.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+
+ .align ALIGNARG(4)
+ ASM_TYPE_DIRECTIVE(huge,@object)
+huge: .tfloat 1e+4930
+ ASM_SIZE_DIRECTIVE(huge)
+ .align ALIGNARG(4)
+ /* Please note that we use double value for 1.0. This number
+ has an exact representation and so we don't get accuracy
+ problems. The advantage is that the code is simpler. */
+ ASM_TYPE_DIRECTIVE(one,@object)
+one: .double 1.0
+ ASM_SIZE_DIRECTIVE(one)
+ /* It is not important that this constant is precise. It is only
+ a value which is known to be on the safe side for using the
+ fyl2xp1 instruction. */
+ ASM_TYPE_DIRECTIVE(limit,@object)
+limit: .double 0.29
+ ASM_SIZE_DIRECTIVE(limit)
+
+#ifdef PIC
+#define MO(op) op##@GOTOFF(%edx)
+#else
+#define MO(op) op
+#endif
+
+ .text
+ENTRY(__asinhl)
+ movl 12(%esp), %ecx
+ movl $0x7fff, %eax
+ andl %ecx, %eax
+ andl $0x8000, %ecx
+ xorl %ecx, 12(%esp)
+ fldt 4(%esp) // |x|
+ cmpl $0x3fde, %eax
+ jb 2f // |x| < 2^-34
+ fldln2 // log(2) : |x|
+ cmpl $0x4020, %eax
+ fxch // |x| : log(2)
+ ja 3f // |x| > 2^34
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ cmpl $0x4000, %eax
+ ja 5f // |x| > 2
+
+ // 2^-34 <= |x| <= 2 => y = sign(x)*log1p(|x|+|x|^2/(1+sqrt(1+|x|^2)))
+ fld %st // |x| : |x| : log(2)
+ fmul %st(1) // |x|^2 : |x| : log(2)
+ fld %st // |x|^2 : |x|^2 : |x| : log(2)
+ faddl MO(one) // 1+|x|^2 : |x|^2 : |x| : log(2)
+ fsqrt // sqrt(1+|x|^2) : |x|^2 : |x| : log(2)
+ faddl MO(one) // 1+sqrt(1+|x|^2) : |x|^2 : |x| : log(2)
+ fdivrp // |x|^2/(1+sqrt(1+|x|^2)) : |x| : log(2)
+ faddp // |x|+|x|^2/(1+sqrt(1+|x|^2)) : log(2)
+ fcoml MO(limit)
+ fnstsw
+ sahf
+ ja 6f
+ fyl2xp1
+ jecxz 4f
+ fchs
+4: ret
+
+6: faddl MO(one)
+ fyl2x
+ jecxz 4f
+ fchs
+4: ret
+
+ // |x| < 2^-34 => y = x (inexact iff |x| != 0.0)
+ .align ALIGNARG(4)
+2:
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+ jecxz 4f
+ fchs // x
+4: fld %st // x : x
+ fldt MO(huge) // huge : x : x
+ faddp // huge+x : x
+ fincstp // x
+ ret
+
+ // |x| > 2^34 => y = sign(x) * (log(|x|) + log(2))
+ .align ALIGNARG(4)
+3: fyl2x // log(|x|)
+ fldln2 // log(2) : log(|x|)
+ faddp // log(|x|)+log(2)
+ jecxz 4f
+ fchs
+4: ret
+
+ // |x| > 2 => y = sign(x) * log(2*|x| + 1/(|x|+sqrt(x*x+1)))
+ .align ALIGNARG(4)
+5: fld %st // |x| : |x| : log(2)
+ fadd %st, %st(1) // |x| : 2*|x| : log(2)
+ fld %st // |x| : |x| : 2*|x| : log(2)
+ fmul %st(1) // |x|^2 : |x| : 2*|x| : log(2)
+ faddl MO(one) // 1+|x|^2 : |x| : 2*|x| : log(2)
+ fsqrt // sqrt(1+|x|^2) : |x| : 2*|x| : log(2)
+ faddp // |x|+sqrt(1+|x|^2) : 2*|x| : log(2)
+ fdivrl MO(one) // 1/(|x|+sqrt(1+|x|^2)) : 2*|x| : log(2)
+ faddp // 2*|x|+1/(|x|+sqrt(1+|x|^2)) : log(2)
+ fyl2x // log(2*|x|+1/(|x|+sqrt(1+|x|^2)))
+ jecxz 4f
+ fchs
+4: ret
+END(__asinhl)
+weak_alias (__asinhl, asinhl)
fld1
fpatan
ret
-PSEUDO_END (__atan)
+END (__atan)
weak_alias (__atan, atan)
fld1
fpatan
ret
-PSEUDO_END (__atanf)
+END (__atanf)
weak_alias (__atanf, atanf)
fld1
fpatan
ret
-PSEUDO_END (__atanl)
+END (__atanl)
weak_alias (__atanl, atanl)
leave
ret
-PSEUDO_END (__ceil)
+END (__ceil)
weak_alias (__ceil, ceil)
leave
ret
-PSEUDO_END (__ceilf)
+END (__ceilf)
weak_alias (__ceilf, ceilf)
leave
ret
-PSEUDO_END (__ceill)
+END (__ceill)
weak_alias (__ceill, ceill)
movl %eax,8(%esp)
fldl 4(%esp)
ret
-PSEUDO_END (__copysign)
+END (__copysign)
weak_alias (__copysign, copysign)
movl %eax,4(%esp)
flds 4(%esp)
ret
-PSEUDO_END (__copysignf)
+END (__copysignf)
weak_alias (__copysignf, copysignf)
movl %eax,12(%esp)
fldt 4(%esp)
ret
-PSEUDO_END (__copysignl)
+END (__copysignl)
weak_alias (__copysignl, copysignl)
fldl 4(%esp)
fcos
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 1f
ret
1: fldpi
fxch %st(1)
2: fprem1
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 2b
fstp %st(1)
fcos
ret
-PSEUDO_END (__cos)
+END (__cos)
weak_alias (__cos, cos)
flds 4(%esp)
fcos
ret
-PSEUDO_END (__cosf)
+END (__cosf)
weak_alias (__cosf, cosf)
fldt 4(%esp)
fcos
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 1f
ret
1: fldpi
fxch %st(1)
2: fprem1
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 2b
fstp %st(1)
fcos
ret
-PSEUDO_END (__cosl)
+END (__cosl)
weak_alias (__cosl, cosl)
setne %al
andl $0x000000ff, %eax
ret
-PSEUDO_END (__finite)
+END (__finite)
weak_alias (__finite, finite)
setne %al
andl $0x000000ff, %eax
ret
-PSEUDO_END (__finitef)
+END (__finitef)
weak_alias (__finitef, finitef)
setne %al
andl $0x000000ff, %eax
ret
-PSEUDO_END (__finitel)
+END (__finitel)
weak_alias (__finitel, finitel)
leave
ret
-PSEUDO_END (__floor)
+END (__floor)
weak_alias (__floor, floor)
leave
ret
-PSEUDO_END (__floorf)
+END (__floorf)
weak_alias (__floorf, floorf)
leave
ret
-PSEUDO_END (__floorl)
+END (__floorl)
weak_alias (__floorl, floorl)
leave
ret
-PSEUDO_END (__ilogb)
+END (__ilogb)
weak_alias (__ilogb, ilogb)
leave
ret
-PSEUDO_END (__ilogbf)
+END (__ilogbf)
weak_alias (__ilogbf, ilogbf)
leave
ret
-PSEUDO_END (__ilogbl)
+END (__ilogbl)
weak_alias (__ilogbl, ilogbl)
RCSID("$NetBSD: s_log1p.S,v 1.7 1995/05/09 00:10:58 jtc Exp $")
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ /* The fyl2xp1 can only be used for values in
+ -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
+ 0.29 is a safe value.
+ */
+limit: .double 0.29
+one: .double 1.0
+
/*
- * Since the fyl2xp1 instruction has such a limited range:
- * -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
- * it's not worth trying to use it.
+ * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
+ * otherwise fyl2x with the needed extra computation.
*/
-
+ .text
ENTRY(__log1p)
fldln2
- fldl 4(%esp)
- fld1
- faddp
+
+ fldl 4(%esp)
+
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+
+ fld %st
+ fabs
+#ifdef PIC
+ fcompl limit@GOTOFF(%edx)
+#else
+ fcompl limit
+#endif
+ fnstsw
+ sahf
+ jc 2f
+
+#ifdef PIC
+ faddl one@GOTOFF(%edx)
+#else
+ faddl one
+#endif
fyl2x
ret
-PSEUDO_END (__log1p)
+
+2: fyl2xp1
+ ret
+
+END (__log1p)
weak_alias (__log1p, log1p)
RCSID("$NetBSD: s_log1pf.S,v 1.4 1995/05/09 00:13:05 jtc Exp $")
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ /* The fyl2xp1 can only be used for values in
+ -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
+ 0.29 is a safe value.
+ */
+limit: .float 0.29
+one: .float 1.0
+
/*
- * Since the fyl2xp1 instruction has such a limited range:
- * -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
- * it's not worth trying to use it.
+ * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
+ * otherwise fyl2x with the needed extra computation.
*/
-
+ .text
ENTRY(__log1pf)
fldln2
- flds 4(%esp)
- fld1
- faddp
+
+ flds 4(%esp)
+
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+
+ fld %st
+ fabs
+#ifdef PIC
+ fcomps limit@GOTOFF(%edx)
+#else
+ fcomps limit
+#endif
+ fnstsw
+ sahf
+ jc 2f
+
+#ifdef PIC
+ fadds one@GOTOFF(%edx)
+#else
+ fadds one
+#endif
fyl2x
ret
-PSEUDO_END (__log1pf)
+
+2: fyl2xp1
+ ret
+
+END (__log1pf)
weak_alias (__log1pf, log1pf)
#include <machine/asm.h>
-RCSID("$NetBSD: $")
+RCSID("$NetBSD: s_log1p.S,v 1.7 1995/05/09 00:10:58 jtc Exp $")
+
+#ifdef __ELF__
+ .section .rodata
+#else
+ .text
+#endif
+ .align ALIGNARG(4)
+ /* The fyl2xp1 can only be used for values in
+ -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
+ 0.29 is a safe value.
+ */
+limit: .tfloat 0.29
+ /* Please note: we use a double value here. Since 1.0 has
+ an exact representation this does not effect the accuracy
+ but it helps to optimize the code. */
+one: .double 1.0
/*
- * Since the fyl2xp1 instruction has such a limited range:
- * -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
- * it's not worth trying to use it.
+ * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
+ * otherwise fyl2x with the needed extra computation.
*/
-
+ .text
ENTRY(__log1pl)
fldln2
- fldt 4(%esp)
- fld1
- faddp
+
+ fldt 4(%esp)
+
+#ifdef PIC
+ call 1f
+1: popl %edx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
+#endif
+
+ fld %st
+ fabs
+#ifdef PIC
+ fldt limit@GOTOFF(%edx)
+#else
+ fldt limit
+#endif
+ fcompp
+ fnstsw
+ sahf
+ jnc 2f
+
+#ifdef PIC
+ faddl one@GOTOFF(%edx)
+#else
+ faddl one
+#endif
fyl2x
ret
-PSEUDO_END (__log1pl)
+
+2: fyl2xp1
+ ret
+
+END (__log1pl)
weak_alias (__log1pl, log1pl)
fxtract
fstpl %st
ret
-PSEUDO_END (__logb)
+END (__logb)
weak_alias (__logb, logb)
fxtract
fstpl %st
ret
-PSEUDO_END (__logbf)
+END (__logbf)
weak_alias (__logbf, logbf)
fldt 4(%esp)
fxtract
ret
-PSEUDO_END (__logbl)
+END (__logbl)
weak_alias (__logbl, logbl)
fldl 4(%esp)
frndint
ret
-PSEUDO_END (__rint)
+END (__rint)
weak_alias (__rint, rint)
flds 4(%esp)
frndint
ret
-PSEUDO_END (__rintf)
+END (__rintf)
weak_alias (__rintf, rintf)
fldt 4(%esp)
frndint
ret
-PSEUDO_END (__rintl)
+END (__rintl)
weak_alias (__rintl, rintl)
fldl 4(%esp)
fscale
ret
-PSEUDO_END (__scalbn)
+END (__scalbn)
weak_alias (__scalbn, scalbn)
flds 4(%esp)
fscale
ret
-PSEUDO_END (__scalbnf)
+END (__scalbnf)
weak_alias (__scalbnf, scalbnf)
fldt 4(%esp)
fscale
ret
-PSEUDO_END (__scalbnl)
+END (__scalbnl)
weak_alias (__scalbnl, scalbnl)
fxtract
fstpl %st(1)
ret
-PSEUDO_END (__significand)
+END (__significand)
weak_alias (__significand, significand)
fxtract
fstpl %st(1)
ret
-PSEUDO_END (__significandf)
+END (__significandf)
weak_alias (__significandf, significandf)
fxtract
fincstp
ret
-PSEUDO_END (__significandl)
+END (__significandl)
weak_alias (__significandl, significandl)
fldl 4(%esp)
fsin
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 1f
ret
1: fldpi
fxch %st(1)
2: fprem1
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 2b
fstp %st(1)
fsin
ret
-PSEUDO_END (__sin)
+END (__sin)
weak_alias (__sin, sin)
flds 4(%esp)
fsin
ret
-PSEUDO_END (__sinf)
+END (__sinf)
weak_alias (__sinf, sinf)
fldt 4(%esp)
fsin
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 1f
ret
1: fldpi
fxch %st(1)
2: fprem1
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 2b
fstp %st(1)
fsin
ret
-PSEUDO_END (__sinl)
+END (__sinl)
weak_alias (__sinl, sinl)
fldl 4(%esp)
fptan
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 1f
fstp %st(0)
ret
fxch %st(1)
2: fprem1
fstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 2b
fstp %st(1)
fptan
fstp %st(0)
ret
-PSEUDO_END (__tan)
+END (__tan)
weak_alias (__tan, tan)
fptan
fstp %st(0)
ret
-PSEUDO_END (__tanf)
+END (__tanf)
weak_alias (__tanf, tanf)
fldt 4(%esp)
fptan
fnstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 1f
fstp %st(0)
ret
fxch %st(1)
2: fprem1
fstsw %ax
- andw $0x400,%ax
+ testl $0x400,%eax
jnz 2b
fstp %st(1)
fptan
fstp %st(0)
ret
-PSEUDO_END (__tanl)
+END (__tanl)
weak_alias (__tanl, tanl)
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#include "math_private.h"
#ifdef __STDC__
-static const float
+static const float
#else
-static float
+static float
#endif
one = 1.0000000000e+00, /* 0x3F800000 */
ln2 = 6.9314718246e-01, /* 0x3f317218 */
-huge= 1.0000000000e+30;
+huge= 1.0000000000e+30;
#ifdef __STDC__
float __asinhf(float x)
float __asinhf(x)
float x;
#endif
-{
+{
float t,w;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7f800000) return x+x; /* x is inf or NaN */
- if(ix< 0x31800000) { /* |x|<2**-28 */
+ if(ix< 0x38000000) { /* |x|<2**-14 */
if(huge+x>one) return x; /* return x inexact except 0 */
- }
- if(ix>0x4d800000) { /* |x| > 2**28 */
+ }
+ if(ix>0x47000000) { /* |x| > 2**14 */
w = __ieee754_logf(fabsf(x))+ln2;
- } else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */
+ } else if (ix>0x40000000) { /* 2**14 > |x| > 2.0 */
t = fabsf(x);
w = __ieee754_logf((float)2.0*t+one/(__ieee754_sqrtf(x*x+one)+t));
- } else { /* 2.0 > |x| > 2**-28 */
+ } else { /* 2.0 > |x| > 2**-14 */
t = x*x;
w =__log1pf(fabsf(x)+t/(one+__ieee754_sqrtf(one+t)));
}
--- /dev/null
+/* X/Open compatibility function.
+ Copyright (C) 1991, 1992, 1996 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <errno.h>
+#include <signal.h>
+
+
+sigset_t _sigintr; /* Set by siginterrupt. */
+
+/* Set the handler for the signal SIG to HANDLER,
+ returning the old handler, or SIG_ERR on error. */
+__sighandler_t
+bsd_signal (sig, handler)
+ int sig;
+ __sighandler_t handler;
+{
+ struct sigaction act, oact;
+
+ /* Check signal extents to protect __sigismember. */
+ if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
+ {
+ __set_errno (EINVAL);
+ return SIG_ERR;
+ }
+
+ act.sa_handler = handler;
+ if (__sigemptyset (&act.sa_mask) < 0)
+ return SIG_ERR;
+ act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
+ if (__sigaction (sig, &act, &oact) < 0)
+ return SIG_ERR;
+
+ return oact.sa_handler;
+}
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
+ 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
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <signal.h>
#include <unistd.h>
/* Raise the signal SIG. */
int
-DEFUN(raise, (sig), int sig)
+raise (sig)
+ int sig;
{
- return __kill(__getpid(), sig);
+ return __kill (__getpid (), sig);
}
+weak_alias (raise, gsignal)
#include <signal.h>
-sigset_t _sigintr; /* Set by siginterrupt. */
-
/* Set the handler for the signal SIG to HANDLER,
returning the old handler, or SIG_ERR on error. */
__sighandler_t
act.sa_handler = handler;
if (__sigemptyset (&act.sa_mask) < 0)
return SIG_ERR;
- act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
+ act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT;
+ act.sa_flags &= ~SA_RESTART;
if (__sigaction (sig, &act, &oact) < 0)
return SIG_ERR;
return oact.sa_handler;
}
+
+weak_alias (signal, ssignal)
/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
+ 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
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <signal.h>
#include <errno.h>
return -1;
}
+weak_alias (raise, gsignal)
+
stub_warning (raise)
+stub_warning (gsignal)
/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
+ 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
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <signal.h>
return SIG_ERR;
}
+weak_alias (signal, ssignal)
stub_warning (signal)
+stub_warning (ssignal)
: : "m" (env[0].__jmpbuf[0].__fpregs[0]));
#endif
- /* Don't save the signal mask. */
- env[0].__mask_was_saved = 0;
-
+ /* The signal mask has already been dealt with. */
return 0;
}
+/* We need this file since otherwise `signal' would be handled as a
+ system call. */
#include <sysdeps/posix/signal.c>
pause - pause 0 __libc_pause pause
personality init-first personality 1 __personality personality
pipe - pipe 1 __pipe pipe
+query_module EXTRA query_module 5 query_module
s_getpriority getpriority getpriority 2 __syscall_getpriority
s_ptrace ptrace ptrace 4 __syscall_ptrace
s_reboot EXTRA reboot 3 __syscall_reboot
-/* localtime -- convert `time_t' to `struct tm' in local time zone
+/* Convert `time_t' to `struct tm' in local time zone.
Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
/* Prototype for the internal function to get information based on TZ. */
extern void __tzset_internal __P ((void));
+extern int __tz_compute __P ((time_t timer, struct tm *tp));
+extern int __tzfile_compute __P ((time_t timer,
+ long int *leap_correct, int *leap_hit));
+extern int __use_tzfile;
-/* Return the `struct tm' representation of *TIMER in the local timezone. */
-struct tm *
-localtime (timer)
- const time_t *timer;
-{
- return __localtime_r (timer, &_tmbuf);
-}
+/* This lock is defined in tzset.c and locks all the data defined there
+ and in tzfile.c; the internal functions do no locking themselves.
+ This lock is only taken here and in `tzset'. */
+__libc_lock_define (extern, __tzset_lock)
-struct tm *
-__localtime_r (timer, tp)
- const time_t *timer;
- struct tm *tp;
+
+/* Return the `struct tm' representation of *TIMER in the local timezone. */
+static struct tm *
+localtime_internal (const time_t *timer, struct tm *tp)
{
- /* This lock is defined in tzset.c and locks all the data defined there
- and in tzfile.c; the internal functions do no locking themselves.
- This lock is only taken here and in `tzset'. */
- __libc_lock_define (extern, __tzset_lock)
- extern int __use_tzfile;
- extern int __tz_compute __P ((time_t timer, struct tm *tp));
- extern int __tzfile_compute __P ((time_t timer,
- long int *leap_correct, int *leap_hit));
long int leap_correction;
int leap_extra_secs;
return NULL;
}
- __libc_lock_lock (__tzset_lock);
-
- /* Make sure the database is initialized. */
- __tzset_internal ();
-
if (__use_tzfile)
{
if (! __tzfile_compute (*timer, &leap_correction, &leap_extra_secs))
tp->tm_zone = __tzname[__daylight];
}
+ return tp;
+}
+
+
+/* POSIX.1 8.3.7.2 says that localtime_r is not required to set
+ tzname. This is a good idea since this allows at least a bit more
+ parallelism. */
+
+struct tm *
+localtime (timer)
+ const time_t *timer;
+{
+ struct tm *result;
+
+ __libc_lock_lock (__tzset_lock);
+
+ /* Make sure the database is initialized. */
+ __tzset_internal ();
+
+ result = localtime_internal (timer, &_tmbuf);
+
__libc_lock_unlock (__tzset_lock);
- return tp;
+ return result;
+}
+
+
+struct tm *
+__localtime_r (timer, tp)
+ const time_t *timer;
+ struct tm *tp;
+{
+ struct tm *result;
+
+ __libc_lock_lock (__tzset_lock);
+
+ result = localtime_internal (timer, tp);
+
+ __libc_lock_unlock (__tzset_lock);
+
+ return result;
}
weak_alias (__localtime_r, localtime_r)