]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
update from main archive 961229 cvs/libc-961230 cvs/libc-961231 cvs/libc20x-970306
authorUlrich Drepper <drepper@redhat.com>
Mon, 30 Dec 1996 01:47:46 +0000 (01:47 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 30 Dec 1996 01:47:46 +0000 (01:47 +0000)
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.

113 files changed:
ChangeLog
elf/dl-error.c
elf/dl-support.c
elf/eval.c
elf/rtld.c
features.h
gnu-versions.h
inet/rcmd.c
inet/rexec.c
libio/iovsprintf.c
posix/Makefile
posix/getopt.c
posix/getopt1.c
signal/Makefile
signal/gsignal.c [deleted file]
signal/signal.h
signal/ssignal.c [deleted file]
socket/sys/un.h
stdio-common/Makefile
stdio-common/scanf10.c [new file with mode: 0644]
stdio-common/vfscanf.c
sysdeps/generic/dl-cache.c
sysdeps/libm-i387/e_acos.S
sysdeps/libm-i387/e_acosf.S [new file with mode: 0644]
sysdeps/libm-i387/e_acosh.S [new file with mode: 0644]
sysdeps/libm-i387/e_acoshf.S [new file with mode: 0644]
sysdeps/libm-i387/e_acoshl.S [new file with mode: 0644]
sysdeps/libm-i387/e_acosl.S
sysdeps/libm-i387/e_asin.S
sysdeps/libm-i387/e_asinf.S [new file with mode: 0644]
sysdeps/libm-i387/e_asinl.S
sysdeps/libm-i387/e_atan2.S
sysdeps/libm-i387/e_atan2f.S
sysdeps/libm-i387/e_atan2l.S
sysdeps/libm-i387/e_atanh.S [new file with mode: 0644]
sysdeps/libm-i387/e_atanhf.S [new file with mode: 0644]
sysdeps/libm-i387/e_atanhl.S [new file with mode: 0644]
sysdeps/libm-i387/e_exp.S
sysdeps/libm-i387/e_expf.S [new file with mode: 0644]
sysdeps/libm-i387/e_expl.S
sysdeps/libm-i387/e_fmod.S
sysdeps/libm-i387/e_fmodf.S [new file with mode: 0644]
sysdeps/libm-i387/e_fmodl.S
sysdeps/libm-i387/e_log.S
sysdeps/libm-i387/e_log10.S
sysdeps/libm-i387/e_log10f.S [new file with mode: 0644]
sysdeps/libm-i387/e_log10l.S
sysdeps/libm-i387/e_logf.S [new file with mode: 0644]
sysdeps/libm-i387/e_logl.S
sysdeps/libm-i387/e_remainder.S
sysdeps/libm-i387/e_remainderf.S
sysdeps/libm-i387/e_remainderl.S
sysdeps/libm-i387/e_scalb.S
sysdeps/libm-i387/e_scalbf.S [new file with mode: 0644]
sysdeps/libm-i387/e_scalbl.S
sysdeps/libm-i387/e_sqrt.S
sysdeps/libm-i387/e_sqrtf.S
sysdeps/libm-i387/e_sqrtl.S
sysdeps/libm-i387/s_asinh.S [new file with mode: 0644]
sysdeps/libm-i387/s_asinhf.S [new file with mode: 0644]
sysdeps/libm-i387/s_asinhl.S [new file with mode: 0644]
sysdeps/libm-i387/s_atan.S
sysdeps/libm-i387/s_atanf.S
sysdeps/libm-i387/s_atanl.S
sysdeps/libm-i387/s_ceil.S
sysdeps/libm-i387/s_ceilf.S
sysdeps/libm-i387/s_ceill.S
sysdeps/libm-i387/s_copysign.S
sysdeps/libm-i387/s_copysignf.S
sysdeps/libm-i387/s_copysignl.S
sysdeps/libm-i387/s_cos.S
sysdeps/libm-i387/s_cosf.S
sysdeps/libm-i387/s_cosl.S
sysdeps/libm-i387/s_finite.S
sysdeps/libm-i387/s_finitef.S
sysdeps/libm-i387/s_finitel.S
sysdeps/libm-i387/s_floor.S
sysdeps/libm-i387/s_floorf.S
sysdeps/libm-i387/s_floorl.S
sysdeps/libm-i387/s_ilogb.S
sysdeps/libm-i387/s_ilogbf.S
sysdeps/libm-i387/s_ilogbl.S
sysdeps/libm-i387/s_log1p.S
sysdeps/libm-i387/s_log1pf.S
sysdeps/libm-i387/s_log1pl.S
sysdeps/libm-i387/s_logb.S
sysdeps/libm-i387/s_logbf.S
sysdeps/libm-i387/s_logbl.S
sysdeps/libm-i387/s_rint.S
sysdeps/libm-i387/s_rintf.S
sysdeps/libm-i387/s_rintl.S
sysdeps/libm-i387/s_scalbn.S
sysdeps/libm-i387/s_scalbnf.S
sysdeps/libm-i387/s_scalbnl.S
sysdeps/libm-i387/s_significand.S
sysdeps/libm-i387/s_significandf.S
sysdeps/libm-i387/s_significandl.S
sysdeps/libm-i387/s_sin.S
sysdeps/libm-i387/s_sinf.S
sysdeps/libm-i387/s_sinl.S
sysdeps/libm-i387/s_tan.S
sysdeps/libm-i387/s_tanf.S
sysdeps/libm-i387/s_tanl.S
sysdeps/libm-ieee754/s_asinhf.c
sysdeps/posix/bsd_signal.c [new file with mode: 0644]
sysdeps/posix/raise.c
sysdeps/posix/signal.c
sysdeps/stub/raise.c
sysdeps/stub/signal.c
sysdeps/unix/sysv/linux/m68k/setjmp.c
sysdeps/unix/sysv/linux/signal.c
sysdeps/unix/sysv/linux/syscalls.list
time/localtime.c

index 06aa40388fc189bd3c0fff76fbbe1f16218e05ff..03f06b09a2a48de6e73580c1e9fe1ef5342ee28d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,164 @@
+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.
index e0a73471a420895facde6f3ec26f4159e9d3d65c..55d9c2fc9320febfa0490fbd15cc8f7859b6393a 100644 (file)
@@ -90,6 +90,7 @@ _dl_catch_error (char **errstring,
     }
 
   /* We get here only if we longjmp'd out of OPERATE.  */
+  catch = NULL;
   *errstring = c.errstring;
   *objname = c.objname;
   return errcode == -1 ? 0 : errcode;
index 35710a0a74d405ed91cec9001a9c8605cf901992..593f96749b3d5bad5bf5162901c2a73c871fef94 100644 (file)
@@ -33,6 +33,7 @@ char **_dl_argv = &__progname;        /* This is checked for some error messages.  */
    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.  */
 
@@ -41,6 +42,7 @@ _dl_sysdep_open_zero_fill (void)
 {
   return __open ("/dev/zero", O_RDONLY);
 }
+#endif
 
 /* This should never be called.  */
 void
index 0fb6751a95108e815924b033e68057f4ec68863d..7d53671f6c91b558ae13757c6776c9756d8556b0 100644 (file)
@@ -128,7 +128,7 @@ _start (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);
index f65bd80954c3238d0e5a22702415fc6ee9e57952..28c9fd796ebbdf274a686b5303f1734b899d06bd 100644 (file)
@@ -236,6 +236,8 @@ of this helper program; chances are you did not intend to run this program.\n",
       /* 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;
index 4bcff2a19006cb076efb8479c02b618eb06c210e..f1f248cc68091b539078ca724d8f436e7e294052 100644 (file)
 /* 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.
@@ -39,7 +39,7 @@
    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__
index 15b07999dd8c21bdb4a218d49708c5db14e7d391..68545bd9b6675fcbee9ed98fee6d72db78226320 100644 (file)
@@ -47,5 +47,7 @@
 #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 */
index c9c3a2fabdb5d81cb2c75ba89b16b6f61babf06d..f13a2e6bad29f4bea3e5e43167a2f06f4c10f14b 100644 (file)
@@ -83,6 +83,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
                                  &hp, &herr) < 0)
          if (herr != NETDB_INTERNAL || errno != ERANGE)
            {
+             __set_h_errno (herr);
              herror(*ahost);
              return -1;
            }
@@ -322,7 +323,7 @@ again:
                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)
index d91949de3c0ce346e19d1d654b509e27f79457a2..611ff572870c43dbf9ecccc0143d1084cd752a14 100644 (file)
@@ -71,6 +71,7 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
                                  &hp, &herr) < 0)
          if (herr != NETDB_INTERNAL || errno != ERANGE)
            {
+             __set_h_errno (herr);
              herror(*ahost);
              return -1;
            }
index 11904e36b3cfbb0e95921671884a6bc914670bd1..099863c2f114fcc1c519a791a2f3b6c21c64bc79 100644 (file)
@@ -43,7 +43,6 @@ _IO_vsprintf (string, format, args)
   _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);
index fcf7cbae9e820e60c822f28b4d98ac7b31399ddf..1a2f6ae798335659f0de7638c18cf3a8cdb0c86e 100644 (file)
@@ -12,9 +12,9 @@
 # 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.
index 01adee0fe525b8172da9d2a8d8ed457c8c41fa68..a5fb9921a73a81e302d333dbe083e193db932caf 100644 (file)
    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
@@ -124,8 +132,14 @@ char *optarg = NULL;
    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.
@@ -431,10 +445,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 {
   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.
@@ -500,6 +515,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
             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;
        }
 
@@ -509,7 +529,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
       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;
        }
@@ -880,7 +905,7 @@ getopt (argc, argv, optstring)
                           0);
 }
 
-#endif /* _LIBC or not __GNU_LIBRARY__.  */
+#endif /* Not ELIDE_CODE.  */
 \f
 #ifdef TEST
 
index de8e2ad56748e9d510a91ac8a2e319b7489b382a..358935db69e938b2bbb166b4e469facf72d8590e 100644 (file)
@@ -1,24 +1,24 @@
 /* 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>
@@ -44,15 +44,21 @@ Cambridge, MA 02139, USA.  */
    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
@@ -87,7 +93,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index)
 }
 
 
-#endif /* _LIBC or not __GNU_LIBRARY__.  */
+#endif /* Not ELIDE_CODE.  */
 \f
 #ifdef TEST
 
index d3337385c9fb8883341abe9ec79925dbd05948d5..eac9576895466ebfb05830b879c1f8d98cb43a89 100644 (file)
@@ -12,9 +12,9 @@
 # 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.
@@ -30,7 +30,7 @@ routines      := signal raise killpg \
                   sigstack sigaltstack sigintr \
                   sigsetops sigempty sigfillset sigaddset sigdelset sigismem \
                   sigreturn \
-                  gsignal ssignal siggetmask
+                  siggetmask bsd_signal
 
 tests          := tst-signal
 
diff --git a/signal/gsignal.c b/signal/gsignal.c
deleted file mode 100644 (file)
index f5b79a9..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* 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);
-}
index 7b3c26094c15cc6d2a4785605971363afe773c7a..66ab3dd09ac731452b3f0fe597ccf12a56a3c75c 100644 (file)
@@ -22,7 +22,7 @@
 
 #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
@@ -32,15 +32,15 @@ __BEGIN_DECLS
 #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>
 
@@ -51,15 +51,27 @@ typedef void (*__sighandler_t) __P ((int));
    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.  */
@@ -69,13 +81,13 @@ extern int killpg __P ((__pid_t __pgrp, int __sig));
 /* 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.  */
@@ -95,7 +107,7 @@ extern int __sigsetmask __P ((int __mask));
    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)
@@ -107,7 +119,7 @@ extern int __sigpause __P ((int __sig_or_mask, int __is_sig));
 #endif
 
 
-#ifdef __USE_BSD
+#ifdef __USE_BSD
 #define        sigmask(sig)    __sigmask(sig)
 
 extern int sigblock __P ((int __mask));
@@ -119,32 +131,32 @@ extern int siggetmask __P ((void));
 #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));
@@ -194,7 +206,7 @@ extern int sigwait __P ((__const sigset_t *__set, int *__sig));
 
 #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>).  */
@@ -238,7 +250,7 @@ extern int sigreturn __P ((struct sigcontext *__scp));
 #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>
diff --git a/signal/ssignal.c b/signal/ssignal.c
deleted file mode 100644 (file)
index 54ab7f0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 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);
-}
index d88fa47069acb6b4b3700c018b68af7447e8c05e..02fc775acbbd0ff228331735a7af777dc9d9865e 100644 (file)
@@ -21,6 +21,8 @@
 #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>
 
@@ -33,6 +35,11 @@ struct sockaddr_un
     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  */
index 5189dd7eefc8b6e71073f595dcb0fbfdcb563268..f4e49e6b9d27ac3ab6bfdd9974404a401a51edf1 100644 (file)
@@ -43,7 +43,7 @@ tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
         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
diff --git a/stdio-common/scanf10.c b/stdio-common/scanf10.c
new file mode 100644 (file)
index 0000000..f896137
--- /dev/null
@@ -0,0 +1,15 @@
+#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;
+}
index 7a3440c99aa94cb07a54836fc0c81bef96cd2cbd..cb6d39629e17c425eed4d5cdfc88f4531e736603 100644 (file)
@@ -524,7 +524,10 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
                  if (First)                                                  \
                    input_error ();                                           \
                  else                                                        \
-                   break;                                                    \
+                   {                                                         \
+                     --read_in;                                              \
+                     break;                                                  \
+                   }                                                         \
                val = c;                                                      \
                if (val >= 0x80)                                              \
                  {                                                           \
@@ -667,6 +670,9 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
              STRING_ADD_CHAR (str, c, char);
            } while ((width <= 0 || --width > 0) && inchar () != EOF);
 
+         if (c == EOF)
+           --read_in;
+
          if (!(flags & SUPPRESS))
            {
              *str = '\0';
index 6cd454c7ac959d22a5733af91786511f09b48162..ac4ee5e6c9e3e779a7fdb076806b6ecdbcc743dc 100644 (file)
@@ -1,21 +1,21 @@
 /* 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>
index c9fa81006c403631d5f76ff2adfba11cd3b987bb..becae36d5e9361c6193aeeecb8a55f057419680e 100644 (file)
@@ -18,4 +18,4 @@ ENTRY(__ieee754_acos)
        fxch    %st(1)
        fpatan
        ret
-PSEUDO_END (__ieee754_acos)
+END (__ieee754_acos)
diff --git a/sysdeps/libm-i387/e_acosf.S b/sysdeps/libm-i387/e_acosf.S
new file mode 100644 (file)
index 0000000..87ee2fb
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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)
diff --git a/sysdeps/libm-i387/e_acosh.S b/sysdeps/libm-i387/e_acosh.S
new file mode 100644 (file)
index 0000000..a3397b3
--- /dev/null
@@ -0,0 +1,105 @@
+/* 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)
diff --git a/sysdeps/libm-i387/e_acoshf.S b/sysdeps/libm-i387/e_acoshf.S
new file mode 100644 (file)
index 0000000..a4f50ba
--- /dev/null
@@ -0,0 +1,105 @@
+/* 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)
diff --git a/sysdeps/libm-i387/e_acoshl.S b/sysdeps/libm-i387/e_acoshl.S
new file mode 100644 (file)
index 0000000..b0fa45c
--- /dev/null
@@ -0,0 +1,111 @@
+/* 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)
index 4cc56c0bb84cb053ccfbd842ce33aed899a8da7a..e8f97485deaed0726b52511f46e6ab83fe7f97c2 100644 (file)
@@ -19,4 +19,4 @@ ENTRY(__ieee754_acosl)
        fxch    %st(1)
        fpatan
        ret
-PSEUDO_END (__ieee754_acosl)
+END (__ieee754_acosl)
index cba41935d53ecb1f183abe1ebeea95fbe16d353d..1202753d9b1b395b1ac49739139dc0a8be7a1149 100644 (file)
@@ -17,4 +17,4 @@ ENTRY(__ieee754_asin)
        fsqrt                           /* sqrt (1 - x^2) */
        fpatan
        ret
-PSEUDO_END (__ieee754_asin)
+END (__ieee754_asin)
diff --git a/sysdeps/libm-i387/e_asinf.S b/sysdeps/libm-i387/e_asinf.S
new file mode 100644 (file)
index 0000000..d2159ba
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * 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)
index d4e254874eb612e0cc29f6b0c30e121eba29fd81..ab421f318903c1ad6d5ac80628763410596c9bc1 100644 (file)
@@ -19,4 +19,4 @@ ENTRY(__ieee754_asinl)
        fsqrt                           /* sqrt (1 - x^2) */
        fpatan
        ret
-PSEUDO_END (__ieee754_asinl)
+END (__ieee754_asinl)
index 6f7fc74b65b1f635e1c948c409426435f405f408..8df04e485e850a7abec1651aea8d94a4d21f5df7 100644 (file)
@@ -12,4 +12,4 @@ ENTRY(__ieee754_atan2)
        fldl    12(%esp)
        fpatan
        ret
-PSEUDO_END (__ieee754_atan2)
+END (__ieee754_atan2)
index bb6d90217291e52a8db2ac1f58d89ae1b1d341c6..fc6621f183022222e83841d01ff3ebf6c0079049 100644 (file)
@@ -12,4 +12,4 @@ ENTRY(__ieee754_atan2f)
        flds    8(%esp)
        fpatan
        ret
-PSEUDO_END (__ieee754_atan2f)
+END (__ieee754_atan2f)
index 860885ced1e7b2548832fe2bb75e5719423fbc37..f58eaa94a9adebde3f121fca34a40fa7952df978 100644 (file)
@@ -14,4 +14,4 @@ ENTRY(__ieee754_atan2l)
        fldt    16(%esp)
        fpatan
        ret
-PSEUDO_END (__ieee754_atan2l)
+END (__ieee754_atan2l)
diff --git a/sysdeps/libm-i387/e_atanh.S b/sysdeps/libm-i387/e_atanh.S
new file mode 100644 (file)
index 0000000..231e96f
--- /dev/null
@@ -0,0 +1,101 @@
+/* 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)
diff --git a/sysdeps/libm-i387/e_atanhf.S b/sysdeps/libm-i387/e_atanhf.S
new file mode 100644 (file)
index 0000000..687d4c9
--- /dev/null
@@ -0,0 +1,102 @@
+/* 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)
diff --git a/sysdeps/libm-i387/e_atanhl.S b/sysdeps/libm-i387/e_atanhl.S
new file mode 100644 (file)
index 0000000..8a2bd11
--- /dev/null
@@ -0,0 +1,108 @@
+/* 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)
index 01c254ab51861ab4b3184f37bb43e20b5bffac73..4505ebd3095d38d2b8c3690c4bca3aa916fa3d1e 100644 (file)
@@ -38,4 +38,4 @@ ENTRY(__ieee754_exp)
        jz      .LpInf                  /* If positive, jump.  */
        fldz                            /* Set result to 0.  */
 .LpInf:        ret
-PSEUDO_END (__ieee754_exp)
+END (__ieee754_exp)
diff --git a/sysdeps/libm-i387/e_expf.S b/sysdeps/libm-i387/e_expf.S
new file mode 100644 (file)
index 0000000..c8233eb
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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)
index fc4a1832cad2d00ff73cf58fd7953eece5451585..9103a923aa7210b90eb7a588ed896662364351fd 100644 (file)
@@ -40,4 +40,4 @@ ENTRY(__ieee754_expl)
        jz      .LpInf                  /* If positive, jump.  */
        fldz                            /* Set result to 0.  */
 .LpInf:        ret
-PSEUDO_END (__ieee754_expl)
+END (__ieee754_expl)
index c4d7535a7cd4caf5930fed9f5ed88a4482132bf8..9c780b9791c35cf850dd7719af91fe5a0c8bf3ca 100644 (file)
@@ -16,4 +16,4 @@ ENTRY(__ieee754_fmod)
        jp      1b
        fstpl   %st(1)
        ret
-PSEUDO_END (__ieee754_fmod)
+END (__ieee754_fmod)
diff --git a/sysdeps/libm-i387/e_fmodf.S b/sysdeps/libm-i387/e_fmodf.S
new file mode 100644 (file)
index 0000000..fbb0c69
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * 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)
index 8c2bd06b0a3b0717c7bece913baa53a010029246..f21082e0b4dc84d2e54261f7df2041a09e46bc3b 100644 (file)
@@ -18,4 +18,4 @@ ENTRY(__ieee754_fmodl)
        jp      1b
        fstpl   %st(1)
        ret
-PSEUDO_END (__ieee754_fmodl)
+END (__ieee754_fmodl)
index 2a51d7520c2a8f3f6c7e4ba32c8bf284019ddd89..43d430332c045a6dcf2c73623b1e0e69e35e9d81 100644 (file)
@@ -1,15 +1,59 @@
 /*
  * 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)
index 17b3067de5518c0a126100a69eeea20a311da1f0..95efc8f7a2fbae8d9f9fe01e68e99bfeea731d52 100644 (file)
@@ -1,15 +1,59 @@
 /*
  * 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)
diff --git a/sysdeps/libm-i387/e_log10f.S b/sysdeps/libm-i387/e_log10f.S
new file mode 100644 (file)
index 0000000..bddb501
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * 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)
index cfddb5ce2a460418220c907564feb2394b81c395..f0b8f325a7c278a2b98892d5f0ff2bafe79e7759 100644 (file)
@@ -3,15 +3,59 @@
  * 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)
diff --git a/sysdeps/libm-i387/e_logf.S b/sysdeps/libm-i387/e_logf.S
new file mode 100644 (file)
index 0000000..b79f478
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * 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)
index 4c1550e929100bc439dd55b8608ed91f169c82b0..1657dfd5fb940caffd3c33dca97a1e4cbe52b44f 100644 (file)
@@ -9,9 +9,52 @@
 
 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)
index 287b616ff736c364032e728179bb9a61ab229614..06cdddc9d1db4adee020351f15cec59a8f0e796f 100644 (file)
@@ -16,4 +16,4 @@ ENTRY(__ieee754_remainder)
        jp      1b
        fstpl   %st(1)
        ret
-PSEUDO_END (__ieee754_remainder)
+END (__ieee754_remainder)
index cdc1ac8b6f3b57abb14b07e70659e1a63e8629cb..d313a55382270fddc9f503e90d936f2fb10e8a9f 100644 (file)
@@ -16,4 +16,4 @@ ENTRY(__ieee754_remainderf)
        jp      1b
        fstpl   %st(1)
        ret
-PSEUDO_END (__ieee754_remainderf)
+END (__ieee754_remainderf)
index 2c32550708d128c9c4137cef0ecff9f22dd90b2c..90a8da7633077f4fb56a6397e561f5dfb2ad4707 100644 (file)
@@ -17,4 +17,4 @@ ENTRY(__ieee754_remainderl)
        sahf
        jp      1b
        ret
-PSEUDO_END (__ieee754_remainderl)
+END (__ieee754_remainderl)
index 0aed96d1c5e6ed71691268b3d2367bde1fe61254..db63dde56e688a2309b895a2aacc9f4318a3322f 100644 (file)
@@ -12,4 +12,4 @@ ENTRY(__ieee754_scalb)
        fldl    4(%esp)
        fscale
        ret
-PSEUDO_END(__ieee754_scalb)
+END(__ieee754_scalb)
diff --git a/sysdeps/libm-i387/e_scalbf.S b/sysdeps/libm-i387/e_scalbf.S
new file mode 100644 (file)
index 0000000..7de03db
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * 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)
index 40d6ff028f94706861c94470530c14dee0bae74e..7b20cc6f9c4f1d2488637e705f55c45f62afe9f1 100644 (file)
@@ -14,4 +14,4 @@ ENTRY(__ieee754_scalbl)
        fldt    4(%esp)
        fscale
        ret
-PSEUDO_END(__ieee754_scalbl)
+END(__ieee754_scalbl)
index 170363fa87822563bcc8444e5c411cd633becda1..6f253d51aaa39bf3decc3a8fc35e65008e1b3807 100644 (file)
@@ -11,4 +11,4 @@ ENTRY(__ieee754_sqrt)
        fldl    4(%esp)
        fsqrt
        ret
-PSEUDO_END (__ieee754_sqrt)
+END (__ieee754_sqrt)
index f13c129aa0e418751dbf7520f4188b23f01b6d13..5ce1ad054406c6cfaab4d9a5e26b154d576d80dc 100644 (file)
@@ -11,4 +11,4 @@ ENTRY(__ieee754_sqrtf)
        flds    4(%esp)
        fsqrt
        ret
-PSEUDO_END (__ieee754_sqrtf)
+END (__ieee754_sqrtf)
index 56947e16f881dcad325dc4f7d22dfa6b1ec30d33..d47aae5cb5b55e9e5805ab962cb99a18beb2c91f 100644 (file)
@@ -13,4 +13,4 @@ ENTRY(__ieee754_sqrtl)
        fldt    4(%esp)
        fsqrt
        ret
-PSEUDO_END (__ieee754_sqrtl)
+END (__ieee754_sqrtl)
diff --git a/sysdeps/libm-i387/s_asinh.S b/sysdeps/libm-i387/s_asinh.S
new file mode 100644 (file)
index 0000000..9b58eaa
--- /dev/null
@@ -0,0 +1,132 @@
+/* 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)
diff --git a/sysdeps/libm-i387/s_asinhf.S b/sysdeps/libm-i387/s_asinhf.S
new file mode 100644 (file)
index 0000000..d0a99a9
--- /dev/null
@@ -0,0 +1,132 @@
+/* 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)
diff --git a/sysdeps/libm-i387/s_asinhl.S b/sysdeps/libm-i387/s_asinhl.S
new file mode 100644 (file)
index 0000000..28f76c2
--- /dev/null
@@ -0,0 +1,140 @@
+/* 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)
index f670031877634e379cd16ff70c0ea9f377e53275..7502f6d828825eddabab21dec470fe240f126233 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__atan)
        fld1
        fpatan
        ret
-PSEUDO_END (__atan)
+END (__atan)
 weak_alias (__atan, atan)
index 803b7f972d9450fc943c4fa87d36dfbf54794b73..70232c824030b93a76831b8754d3543551a2a3a8 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__atanf)
        fld1
        fpatan
        ret
-PSEUDO_END (__atanf)
+END (__atanf)
 weak_alias (__atanf, atanf)
index 59f139005ae2bedc99b22cc81daddeda41355813..8b072727642d703c08a53749357763bcadffcc29 100644 (file)
@@ -14,5 +14,5 @@ ENTRY(__atanl)
        fld1
        fpatan
        ret
-PSEUDO_END (__atanl)
+END (__atanl)
 weak_alias (__atanl, atanl)
index 5135c90e40a0e2da378d16e4d4a0b7515a33701d..309fe882f8b1810c77d5544c33de0fc8fcdd6d3e 100644 (file)
@@ -30,5 +30,5 @@ ENTRY(__ceil)
 
        leave
        ret
-PSEUDO_END (__ceil)
+END (__ceil)
 weak_alias (__ceil, ceil)
index 93cf40bd43cb4ebb41b45a07eee1dd939ac44ad7..768d1170211781dfd1581f1163c6265c2fa9b0fc 100644 (file)
@@ -30,5 +30,5 @@ ENTRY(__ceilf)
 
        leave
        ret
-PSEUDO_END (__ceilf)
+END (__ceilf)
 weak_alias (__ceilf, ceilf)
index a77e550d7be40c1f3c04304501dbea498b8394ef..dcf8719af3a8eb4332e79743f9a3169402cb0460 100644 (file)
@@ -31,5 +31,5 @@ ENTRY(__ceill)
 
        leave
        ret
-PSEUDO_END (__ceill)
+END (__ceill)
 weak_alias (__ceill, ceill)
index 45b86f58c89c272e91d25d456034a62627dca032..2520a944270708af7f6e8616b3859e7eb062c939 100644 (file)
@@ -16,5 +16,5 @@ ENTRY(__copysign)
        movl    %eax,8(%esp)
        fldl    4(%esp)
        ret
-PSEUDO_END (__copysign)
+END (__copysign)
 weak_alias (__copysign, copysign)
index 4844a2b879a61ab0e6272880316986594d367175..57b1a6f11978dc51d765e7546768f93dd8b1745e 100644 (file)
@@ -16,5 +16,5 @@ ENTRY(__copysignf)
        movl    %eax,4(%esp)
        flds    4(%esp)
        ret
-PSEUDO_END (__copysignf)
+END (__copysignf)
 weak_alias (__copysignf, copysignf)
index 37e34fe1b41f2d28558f154119c1e728232fa1dc..2163e7b014373ab1ef068e6291620be04a1ac95a 100644 (file)
@@ -17,5 +17,5 @@ ENTRY(__copysignl)
        movl    %eax,12(%esp)
        fldt    4(%esp)
        ret
-PSEUDO_END (__copysignl)
+END (__copysignl)
 weak_alias (__copysignl, copysignl)
index 6b47e80d2e5a59690beae18e67e24f180563723c..f75e98060b39bafbf2e00e083d208229d64c06b1 100644 (file)
@@ -11,7 +11,7 @@ ENTRY(__cos)
        fldl    4(%esp)
        fcos
        fnstsw  %ax
-       andw    $0x400,%ax
+       testl   $0x400,%eax
        jnz     1f
        ret
 1:     fldpi
@@ -19,10 +19,10 @@ ENTRY(__cos)
        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)
index a2bd0e5fa92765abdc07b1be1ec4efc3f561822e..d8e80906393613cf5ac788e22a3b61c84fde5e7b 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__cosf)
        flds    4(%esp)
        fcos
        ret
-PSEUDO_END (__cosf)
+END (__cosf)
 weak_alias (__cosf, cosf)
index 2ddb549b7701266abc775be214ec6be855afceac..f41fc199584fc5636005dd59b6b672b6ce5a8558 100644 (file)
@@ -13,7 +13,7 @@ ENTRY(__cosl)
        fldt    4(%esp)
        fcos
        fnstsw  %ax
-       andw    $0x400,%ax
+       testl   $0x400,%eax
        jnz     1f
        ret
 1:     fldpi
@@ -21,10 +21,10 @@ ENTRY(__cosl)
        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)
index 538fec94e15cbac569246f9cfd0c1adf2d7a55c2..7c67e1906fee1d143c53309bd3c43d9f43cac82b 100644 (file)
@@ -14,5 +14,5 @@ ENTRY(__finite)
        setne   %al
        andl    $0x000000ff, %eax
        ret
-PSEUDO_END (__finite)
+END (__finite)
 weak_alias (__finite, finite)
index cb0caabf6f639bb20ebf71a4aa8df35a0c860c44..ee26c875a51b4678c28a6717fea226b764d16a9b 100644 (file)
@@ -14,5 +14,5 @@ ENTRY(__finitef)
        setne   %al
        andl    $0x000000ff, %eax
        ret
-PSEUDO_END (__finitef)
+END (__finitef)
 weak_alias (__finitef, finitef)
index 7af80475ae05053a8096f3a21e1b65fe78df02fd..944b2497e266042eb2ea7002fbd89760421d4cbe 100644 (file)
@@ -16,5 +16,5 @@ ENTRY(__finitel)
        setne   %al
        andl    $0x000000ff, %eax
        ret
-PSEUDO_END (__finitel)
+END (__finitel)
 weak_alias (__finitel, finitel)
index ca8914ee1424d4e6cef5067502a2c32e2e78d539..561f83d98a452a40c99429b1b4c9c0f864c49bcf 100644 (file)
@@ -26,5 +26,5 @@ ENTRY(__floor)
 
        leave
        ret
-PSEUDO_END (__floor)
+END (__floor)
 weak_alias (__floor, floor)
index 796db4fdadfc63c05f8c5b4dc562d7c527441814..059f4f3a152b1f998c446409acd918223ac58815 100644 (file)
@@ -26,5 +26,5 @@ ENTRY(__floorf)
 
        leave
        ret
-PSEUDO_END (__floorf)
+END (__floorf)
 weak_alias (__floorf, floorf)
index 396d854edc6ba3874c9bb829d86d24d222d2a026..7b7cff777a8b4988578cc4000480ed17284a6294 100644 (file)
@@ -27,5 +27,5 @@ ENTRY(__floorl)
 
        leave
        ret
-PSEUDO_END (__floorl)
+END (__floorl)
 weak_alias (__floorl, floorl)
index 6fb51d913f2cbc5b55492b2b4c0406828a6cdb9e..01b8afac10984a10c41f9770c329bff99a69bbdd 100644 (file)
@@ -21,5 +21,5 @@ ENTRY(__ilogb)
 
        leave
        ret
-PSEUDO_END (__ilogb)
+END (__ilogb)
 weak_alias (__ilogb, ilogb)
index 71e4f42c9aaaed5cc07ad133ec52c3016083c743..6a943265b27c3301019d068f454e1a0b02689b2a 100644 (file)
@@ -21,5 +21,5 @@ ENTRY(__ilogbf)
 
        leave
        ret
-PSEUDO_END (__ilogbf)
+END (__ilogbf)
 weak_alias (__ilogbf, ilogbf)
index 2b841463df58784a562befc78e21a263990a129a..2422a4135553f593f5c794b776e7ee57ea48640f 100644 (file)
@@ -21,5 +21,5 @@ ENTRY(__ilogbl)
 
        leave
        ret
-PSEUDO_END (__ilogbl)
+END (__ilogbl)
 weak_alias (__ilogbl, ilogbl)
index ce8665d3a5c966a42abd0b446a79b1b7f7ad8597..10e8a363697969b7ea65d9432023cd610cb5a3e4 100644 (file)
@@ -7,18 +7,56 @@
 
 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)
index 7a161f26f95763efbb4664b560e952d20a8d9cd5..df9fdcbcfc216c0edba5da28b2bb1d1ed68b3c62 100644 (file)
@@ -7,18 +7,56 @@
 
 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)
index 647e136413734908e481c5d1df5bfaa70e19636b..05a17b2831ecf1d0afd130a63d7363883c685653 100644 (file)
@@ -7,20 +7,62 @@
 
 #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)
index 92d8fee85c5f4971d4e797aed13eed555cab648e..2f1afd40ccbb2742f2844158bc6284f6482e060f 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__logb)
        fxtract
        fstpl   %st
        ret
-PSEUDO_END (__logb)
+END (__logb)
 weak_alias (__logb, logb)
index b557974a823d6d932abee9c26066286388b99952..0052497272a6bb1a4222ff883c7a26ffd29e2029 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__logbf)
        fxtract
        fstpl   %st
        ret
-PSEUDO_END (__logbf)
+END (__logbf)
 weak_alias (__logbf, logbf)
index 91bddb6b3af229550123b95514f01131ae19b382..6ce274c57c76f4b541dac8975e35483984f01ef1 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__logbl)
        fldt    4(%esp)
        fxtract
        ret
-PSEUDO_END (__logbl)
+END (__logbl)
 weak_alias (__logbl, logbl)
index 9231fef32d38001d886dd75bd09036ac8450f200..be36c5f0ca8899e054ae765209ea83a5ec9f3bcf 100644 (file)
@@ -11,5 +11,5 @@ ENTRY(__rint)
        fldl    4(%esp)
        frndint
        ret
-PSEUDO_END (__rint)
+END (__rint)
 weak_alias (__rint, rint)
index 3e35f2c822bcf5bddd2e459d0969ff8812367366..2b358c1cf124266bdd4ec5817edea9f928a95a92 100644 (file)
@@ -11,5 +11,5 @@ ENTRY(__rintf)
        flds    4(%esp)
        frndint
        ret
-PSEUDO_END (__rintf)
+END (__rintf)
 weak_alias (__rintf, rintf)
index a8198d3d7f27f69192749406954795c6fa31acc1..fd1ae6324e6d25f00fb2e371ab24b1eb2194ffda 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__rintl)
        fldt    4(%esp)
        frndint
        ret
-PSEUDO_END (__rintl)
+END (__rintl)
 weak_alias (__rintl, rintl)
index 4a4149500c939e9f209571e9e78eaee75f89bffc..3ec56d452302da93c110a5b8920c7e6ac7f0a16f 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__scalbn)
        fldl    4(%esp)
        fscale
        ret
-PSEUDO_END (__scalbn)
+END (__scalbn)
 weak_alias (__scalbn, scalbn)
index 080304d574a441796e81df7f6a5297d8d8231dda..b1a1c46b6c9c2edda1423f803dfa26e9a17aeb8e 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__scalbnf)
        flds    4(%esp)
        fscale
        ret
-PSEUDO_END (__scalbnf)
+END (__scalbnf)
 weak_alias (__scalbnf, scalbnf)
index adf1dea604335b199a77757e538e3e122d204619..0f3323803c43ba39f268fd397be2f16398bea28a 100644 (file)
@@ -13,5 +13,5 @@ ENTRY(__scalbnl)
        fldt    4(%esp)
        fscale
        ret
-PSEUDO_END (__scalbnl)
+END (__scalbnl)
 weak_alias (__scalbnl, scalbnl)
index ff72b88560f672c4c949321767fcaef6f7b80a9d..4f8d91fe9de8ecfe08a5b3b234651daf4754bb57 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__significand)
        fxtract
        fstpl   %st(1)
        ret
-PSEUDO_END (__significand)
+END (__significand)
 weak_alias (__significand, significand)
index af92886501cae3e866aa603cacac4943b05abfc5..603e9f029dfb2e3d90d45a505b67e764bc577cfe 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__significandf)
        fxtract
        fstpl   %st(1)
        ret
-PSEUDO_END (__significandf)
+END (__significandf)
 weak_alias (__significandf, significandf)
index 1483a0dec2bb324f3baa0bbd4c1d52ee2150fc28..1d5f4a3f6a10f85836e7961cae031984a9e0e9d9 100644 (file)
@@ -13,5 +13,5 @@ ENTRY(__significandl)
        fxtract
        fincstp
        ret
-PSEUDO_END (__significandl)
+END (__significandl)
 weak_alias (__significandl, significandl)
index f06c9440adcaf42c6b47e140b68ca83382e2a57e..f048e5278b7b124f23be7dfdb942ae4fdb9ac9e5 100644 (file)
@@ -11,7 +11,7 @@ ENTRY(__sin)
        fldl    4(%esp)
        fsin
        fnstsw  %ax
-       andw    $0x400,%ax
+       testl   $0x400,%eax
        jnz     1f
        ret
 1:     fldpi
@@ -19,10 +19,10 @@ ENTRY(__sin)
        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)
index 464ccb2b8ab4b18ee16a47c9703500d88353c3b5..a010d60f5ef4e53fb2381c73a02214a66d122932 100644 (file)
@@ -12,5 +12,5 @@ ENTRY(__sinf)
        flds    4(%esp)
        fsin
        ret
-PSEUDO_END (__sinf)
+END (__sinf)
 weak_alias (__sinf, sinf)
index 2872334881722674a02c0622d7355701e79101df..7c8c95f8a640726c39ce9e09218a8bdd50c22f70 100644 (file)
@@ -13,7 +13,7 @@ ENTRY(__sinl)
        fldt    4(%esp)
        fsin
        fnstsw  %ax
-       andw    $0x400,%ax
+       testl   $0x400,%eax
        jnz     1f
        ret
 1:     fldpi
@@ -21,10 +21,10 @@ ENTRY(__sinl)
        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)
index 93336718733b1b081fe4f8174fca058d2566b312..7b3547af4c76f134a86c1bab3004baafe69821bc 100644 (file)
@@ -11,7 +11,7 @@ ENTRY(__tan)
        fldl    4(%esp)
        fptan
        fnstsw  %ax
-       andw    $0x400,%ax
+       testl   $0x400,%eax
        jnz     1f
        fstp    %st(0)
        ret
@@ -20,11 +20,11 @@ ENTRY(__tan)
        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)
index cbf8dd8496f291e7c5016e957bcd0a64c814c11f..7a7509119b9f3546e8ef46ee376b5d82d124c2ef 100644 (file)
@@ -13,5 +13,5 @@ ENTRY(__tanf)
        fptan
        fstp    %st(0)
        ret
-PSEUDO_END (__tanf)
+END (__tanf)
 weak_alias (__tanf, tanf)
index c818e96f8861c226081817e1e7fa80fe19da2268..f2bdd6a60574c575620a69b19aab3251d5f599ef 100644 (file)
@@ -13,7 +13,7 @@ ENTRY(__tanl)
        fldt    4(%esp)
        fptan
        fnstsw  %ax
-       andw    $0x400,%ax
+       testl   $0x400,%eax
        jnz     1f
        fstp    %st(0)
        ret
@@ -22,11 +22,11 @@ ENTRY(__tanl)
        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)
index d57508de9fcd51a2e70608553b372e3d027054a9..fac256d37a895192610f4b33141048d81cda6300 100644 (file)
@@ -8,7 +8,7 @@
  *
  * 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.
  * ====================================================
  */
@@ -21,13 +21,13 @@ static char rcsid[] = "$NetBSD: s_asinhf.c,v 1.5 1995/05/12 04:57:39 jtc Exp $";
 #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)
@@ -35,21 +35,21 @@ huge=  1.0000000000e+30;
        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)));
        }
diff --git a/sysdeps/posix/bsd_signal.c b/sysdeps/posix/bsd_signal.c
new file mode 100644 (file)
index 0000000..4941485
--- /dev/null
@@ -0,0 +1,50 @@
+/* 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;
+}
index 159fdd5cb96338b5c80e4416c9a7d9122fb3c12d..3a49fe5e6a01b4ea0f00b7877938f20129ff7471 100644 (file)
@@ -1,28 +1,29 @@
-/* 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)
index ce93116075e30f3598ac9f632f45f75bf481264d..25e7cab6170c151397d15d7b1232dbf48619b859 100644 (file)
@@ -20,8 +20,6 @@
 #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
@@ -41,9 +39,12 @@ signal (sig, handler)
   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)
index cac49df7dedb2810a9b94b7cc9891d104541a833..97fd5fe931be45bf20b81c70e741bdd191af6498 100644 (file)
@@ -1,20 +1,20 @@
 /* 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>
@@ -28,4 +28,7 @@ raise (sig)
   return -1;
 }
 
+weak_alias (raise, gsignal)
+
 stub_warning (raise)
+stub_warning (gsignal)
index 6ee587acb3a89cb793308903a54aa176694e5ad3..066a8cc79f83c352e2b1dcb6acf4339e21a34a9e 100644 (file)
@@ -1,20 +1,20 @@
 /* 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>
@@ -31,5 +31,7 @@ signal (sig, handler)
   return SIG_ERR;
 }
 
+weak_alias (signal, ssignal)
 
 stub_warning (signal)
+stub_warning (ssignal)
index ef609cc7ab961db52c1696b9ef58dc5cf4d3f438..477e8960c6a326c7bca8d4d8d6095a4b05fe68cb 100644 (file)
@@ -76,8 +76,6 @@ __setjmp (jmp_buf env)
                : : "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;
 }
index 55f1108498c1bcc6996f2e5e77d9996cd0d94a7f..bc4e4e84479fe672c361edfce2eef2d39815a469 100644 (file)
@@ -1 +1,3 @@
+/* We need this file since otherwise `signal' would be handled as a
+   system call.  */
 #include <sysdeps/posix/signal.c>
index 07a3c1db4b4c8bbdabb5e18d3ec37ce3267ee31b..38896e7f18145c41fcb7deb89a78746f5589232b 100644 (file)
@@ -30,6 +30,7 @@ nanosleep     -       nanosleep       2       __libc_nanosleep        __nanosleep nanosleep
 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
index 5e1dd0a5b57f90de2360e6bc66d8d96b128a4994..f228776952b93526b6f9d50e972c3bc7425a061b 100644 (file)
@@ -1,4 +1,4 @@
-/* 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.
 
@@ -26,29 +26,22 @@ struct tm _tmbuf;
 
 /* 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;
 
@@ -58,11 +51,6 @@ __localtime_r (timer, tp)
       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))
@@ -86,8 +74,46 @@ __localtime_r (timer, tp)
       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)