summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-25 00:37:10 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-25 00:37:10 +0000
commit4bbe4e2185c5484328182720ff7b3bb4f9593bff (patch)
treecd67e40a74928c0f58d4f5b79d2e260e4099fee7
parent91b4be71461f78cabe1fb5f164cea71b60e9e98a (diff)
Merge changes between r15223 and r15532 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15545 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog1632
-rw-r--r--libc/Makeconfig6
-rw-r--r--libc/Makefile12
-rw-r--r--libc/Makerules10
-rw-r--r--libc/NEWS31
-rw-r--r--libc/README5
-rw-r--r--libc/Versions.def3
-rw-r--r--libc/argp/argp-fmtstream.c12
-rw-r--r--libc/argp/argp-fmtstream.h5
-rw-r--r--libc/argp/argp-help.c11
-rw-r--r--libc/assert/assert.c8
-rw-r--r--libc/bits/libc-tsd.h23
-rw-r--r--libc/bits/select.h7
-rw-r--r--libc/config.h.in23
-rw-r--r--libc/config.make.in3
-rwxr-xr-xlibc/configure150
-rw-r--r--libc/configure.in103
-rw-r--r--libc/csu/Versions11
-rw-r--r--libc/csu/errno-loc.c10
-rw-r--r--libc/csu/errno.c21
-rw-r--r--libc/csu/init.c4
-rw-r--r--libc/ctype/Versions3
-rw-r--r--libc/ctype/ctype-info.c15
-rw-r--r--libc/ctype/ctype.h40
-rw-r--r--libc/debug/Makefile3
-rw-r--r--libc/debug/Versions3
-rw-r--r--libc/debug/fdelt_chk.c30
-rw-r--r--libc/debug/tst-chk1.c32
-rw-r--r--libc/elf/Makefile3
-rw-r--r--libc/elf/dl-conflict.c5
-rw-r--r--libc/elf/dl-fini.c12
-rw-r--r--libc/elf/dl-iteratephdr.c14
-rw-r--r--libc/elf/dl-libc.c31
-rw-r--r--libc/elf/dl-load.c4
-rw-r--r--libc/elf/dl-reloc.c3
-rw-r--r--libc/elf/dl-support.c5
-rw-r--r--libc/elf/dl-tsd.c8
-rw-r--r--libc/elf/do-rel.h95
-rw-r--r--libc/elf/dynamic-link.h66
-rw-r--r--libc/elf/elf.h3
-rw-r--r--libc/elf/pldd-xx.c1
-rw-r--r--libc/elf/rtld.c38
-rwxr-xr-xlibc/elf/sotruss.ksh23
-rw-r--r--libc/elf/sprof.c8
-rw-r--r--libc/elf/tst-audit2.c10
-rw-r--r--libc/elf/tst-tls10.c5
-rw-r--r--libc/elf/tst-tls10.h4
-rw-r--r--libc/elf/tst-tls11.c3
-rw-r--r--libc/elf/tst-tls12.c3
-rw-r--r--libc/elf/tst-tls14.c13
-rw-r--r--libc/elf/tst-tlsmod11.c2
-rw-r--r--libc/elf/tst-tlsmod12.c2
-rw-r--r--libc/elf/tst-tlsmod13.c4
-rw-r--r--libc/elf/tst-tlsmod13a.c4
-rw-r--r--libc/elf/tst-tlsmod14a.c12
-rw-r--r--libc/elf/tst-tlsmod15b.c8
-rw-r--r--libc/elf/tst-tlsmod16a.c4
-rw-r--r--libc/elf/tst-tlsmod16b.c4
-rw-r--r--libc/elf/tst-tlsmod7.c2
-rw-r--r--libc/elf/tst-tlsmod8.c2
-rw-r--r--libc/elf/tst-tlsmod9.c2
-rw-r--r--libc/gmon/gmon.c8
-rw-r--r--libc/grp/fgetgrent_r.c10
-rw-r--r--libc/grp/initgroups.c12
-rw-r--r--libc/grp/putgrent.c8
-rw-r--r--libc/hurd/fopenport.c10
-rw-r--r--libc/hurd/vpprintf.c27
-rw-r--r--libc/iconv/gconv_conf.c8
-rw-r--r--libc/include/bits/select2.h1
-rw-r--r--libc/include/ctype.h20
-rw-r--r--libc/include/dlfcn.h1
-rw-r--r--libc/include/errno.h14
-rw-r--r--libc/include/libc-symbols.h33
-rw-r--r--libc/include/math.h4
-rw-r--r--libc/include/netdb.h22
-rw-r--r--libc/include/resolv.h12
-rw-r--r--libc/include/tls.h18
-rw-r--r--libc/inet/getnetgrent_r.c65
-rw-r--r--libc/inet/herrno-loc.c6
-rw-r--r--libc/inet/herrno.c20
-rw-r--r--libc/intl/Makefile5
-rw-r--r--libc/intl/gettextP.h8
-rw-r--r--libc/intl/loadinfo.h8
-rw-r--r--libc/intl/plural.c348
-rw-r--r--libc/libio/genops.c18
-rw-r--r--libc/libio/iofwide.c11
-rw-r--r--libc/locale/Makefile3
-rw-r--r--libc/locale/global-locale.c14
-rw-r--r--libc/locale/localeinfo.h4
-rw-r--r--libc/locale/programs/locarchive.c74
-rw-r--r--libc/localedata/ChangeLog7
-rw-r--r--libc/localedata/Makefile5
-rw-r--r--libc/localedata/tst-setlocale2.c76
-rw-r--r--libc/mach/devstream.c4
-rw-r--r--libc/malloc/Makefile2
-rw-r--r--libc/malloc/arena.c270
-rw-r--r--libc/malloc/hooks.c202
-rw-r--r--libc/malloc/malloc.c1750
-rw-r--r--libc/malloc/obstack.h8
-rw-r--r--libc/malloc/set-freeres.c8
-rw-r--r--libc/manual/libc.texinfo6
-rw-r--r--libc/manual/signal.texi4
-rw-r--r--libc/manual/string.texi8
-rw-r--r--libc/math/Makefile8
-rw-r--r--libc/math/Versions30
-rw-r--r--libc/math/bits/math-finite.h322
-rw-r--r--libc/math/bits/mathcalls.h5
-rw-r--r--libc/math/divtc3.c16
-rw-r--r--libc/math/e_acoshl.c1
-rw-r--r--libc/math/e_acosl.c1
-rw-r--r--libc/math/e_asinl.c1
-rw-r--r--libc/math/e_atan2l.c1
-rw-r--r--libc/math/e_atanhl.c1
-rw-r--r--libc/math/e_coshl.c1
-rw-r--r--libc/math/e_exp10.c5
-rw-r--r--libc/math/e_exp10f.c5
-rw-r--r--libc/math/e_exp10l.c5
-rw-r--r--libc/math/e_exp2l.c3
-rw-r--r--libc/math/e_expl.c1
-rw-r--r--libc/math/e_fmodl.c1
-rw-r--r--libc/math/e_gammal_r.c1
-rw-r--r--libc/math/e_hypotl.c1
-rw-r--r--libc/math/e_j0l.c4
-rw-r--r--libc/math/e_j1l.c4
-rw-r--r--libc/math/e_jnl.c4
-rw-r--r--libc/math/e_lgammal_r.c3
-rw-r--r--libc/math/e_log10l.c1
-rw-r--r--libc/math/e_log2l.c1
-rw-r--r--libc/math/e_logl.c1
-rw-r--r--libc/math/e_powl.c1
-rw-r--r--libc/math/e_rem_pio2l.c2
-rw-r--r--libc/math/e_scalb.c114
-rw-r--r--libc/math/e_scalbf.c111
-rw-r--r--libc/math/e_scalbl.c116
-rw-r--r--libc/math/e_sinhl.c1
-rw-r--r--libc/math/e_sqrtl.c1
-rw-r--r--libc/math/k_cosl.c2
-rw-r--r--libc/math/k_sinl.c2
-rw-r--r--libc/math/k_tanl.c2
-rw-r--r--libc/math/libm-test.inc31
-rw-r--r--libc/math/math.h19
-rw-r--r--libc/math/math_private.h45
-rw-r--r--libc/math/multc3.c17
-rw-r--r--libc/math/s_cacosh.c3
-rw-r--r--libc/math/s_cacoshf.c2
-rw-r--r--libc/math/s_cacoshl.c3
-rw-r--r--libc/math/s_casin.c5
-rw-r--r--libc/math/s_casinf.c5
-rw-r--r--libc/math/s_casinh.c3
-rw-r--r--libc/math/s_casinhf.c3
-rw-r--r--libc/math/s_casinhl.c3
-rw-r--r--libc/math/s_casinl.c5
-rw-r--r--libc/math/s_catan.c9
-rw-r--r--libc/math/s_catanf.c9
-rw-r--r--libc/math/s_catanh.c17
-rw-r--r--libc/math/s_catanhf.c17
-rw-r--r--libc/math/s_catanhl.c17
-rw-r--r--libc/math/s_catanl.c9
-rw-r--r--libc/math/s_ccos.c51
-rw-r--r--libc/math/s_ccosf.c51
-rw-r--r--libc/math/s_ccosh.c26
-rw-r--r--libc/math/s_ccoshf.c26
-rw-r--r--libc/math/s_ccoshl.c28
-rw-r--r--libc/math/s_ccosl.c51
-rw-r--r--libc/math/s_cexp.c19
-rw-r--r--libc/math/s_cexpf.c19
-rw-r--r--libc/math/s_cexpl.c19
-rw-r--r--libc/math/s_clog.c9
-rw-r--r--libc/math/s_clog10.c9
-rw-r--r--libc/math/s_clog10f.c9
-rw-r--r--libc/math/s_clog10l.c9
-rw-r--r--libc/math/s_clogf.c8
-rw-r--r--libc/math/s_clogl.c9
-rw-r--r--libc/math/s_csin.c14
-rw-r--r--libc/math/s_csinf.c14
-rw-r--r--libc/math/s_csinh.c28
-rw-r--r--libc/math/s_csinhf.c28
-rw-r--r--libc/math/s_csinhl.c28
-rw-r--r--libc/math/s_csinl.c14
-rw-r--r--libc/math/s_csqrt.c11
-rw-r--r--libc/math/s_csqrtf.c11
-rw-r--r--libc/math/s_csqrtl.c11
-rw-r--r--libc/math/s_ctan.c12
-rw-r--r--libc/math/s_ctanf.c13
-rw-r--r--libc/math/s_ctanh.c13
-rw-r--r--libc/math/s_ctanhf.c13
-rw-r--r--libc/math/s_ctanhl.c13
-rw-r--r--libc/math/s_ctanl.c12
-rw-r--r--libc/math/s_ldexp.c2
-rw-r--r--libc/math/s_ldexpf.c2
-rw-r--r--libc/math/s_ldexpl.c2
-rw-r--r--libc/math/s_nan.c1
-rw-r--r--libc/math/s_nanf.c1
-rw-r--r--libc/math/s_nanl.c1
-rw-r--r--libc/math/s_significand.c2
-rw-r--r--libc/math/s_significandf.c2
-rw-r--r--libc/math/s_significandl.c2
-rw-r--r--libc/math/w_acos.c64
-rw-r--r--libc/math/w_acosf.c66
-rw-r--r--libc/math/w_acosh.c61
-rw-r--r--libc/math/w_acoshf.c64
-rw-r--r--libc/math/w_acoshl.c63
-rw-r--r--libc/math/w_acosl.c66
-rw-r--r--libc/math/w_asin.c63
-rw-r--r--libc/math/w_asinf.c67
-rw-r--r--libc/math/w_asinl.c67
-rw-r--r--libc/math/w_atan2.c55
-rw-r--r--libc/math/w_atan2f.c56
-rw-r--r--libc/math/w_atan2l.c57
-rw-r--r--libc/math/w_atanh.c66
-rw-r--r--libc/math/w_atanhf.c69
-rw-r--r--libc/math/w_atanhl.c68
-rw-r--r--libc/math/w_cosh.c33
-rw-r--r--libc/math/w_coshf.c37
-rw-r--r--libc/math/w_coshl.c32
-rw-r--r--libc/math/w_dremf.c2
-rw-r--r--libc/math/w_exp10.c60
-rw-r--r--libc/math/w_exp10f.c65
-rw-r--r--libc/math/w_exp10l.c63
-rw-r--r--libc/math/w_exp2.c28
-rw-r--r--libc/math/w_exp2f.c28
-rw-r--r--libc/math/w_exp2l.c22
-rw-r--r--libc/math/w_fmod.c63
-rw-r--r--libc/math/w_fmodf.c64
-rw-r--r--libc/math/w_fmodl.c65
-rw-r--r--libc/math/w_hypot.c31
-rw-r--r--libc/math/w_hypotf.c33
-rw-r--r--libc/math/w_hypotl.c28
-rw-r--r--libc/math/w_j0.c106
-rw-r--r--libc/math/w_j0f.c112
-rw-r--r--libc/math/w_j0l.c110
-rw-r--r--libc/math/w_j1.c107
-rw-r--r--libc/math/w_j1f.c112
-rw-r--r--libc/math/w_j1l.c110
-rw-r--r--libc/math/w_jn.c129
-rw-r--r--libc/math/w_jnf.c111
-rw-r--r--libc/math/w_jnl.c2
-rw-r--r--libc/math/w_lgamma.c45
-rw-r--r--libc/math/w_lgamma_r.c37
-rw-r--r--libc/math/w_lgammaf.c47
-rw-r--r--libc/math/w_lgammaf_r.c45
-rw-r--r--libc/math/w_lgammal.c45
-rw-r--r--libc/math/w_lgammal_r.c38
-rw-r--r--libc/math/w_log.c71
-rw-r--r--libc/math/w_log10.c74
-rw-r--r--libc/math/w_log10f.c77
-rw-r--r--libc/math/w_log10l.c76
-rw-r--r--libc/math/w_log2.c51
-rw-r--r--libc/math/w_log2f.c55
-rw-r--r--libc/math/w_log2l.c53
-rw-r--r--libc/math/w_logf.c74
-rw-r--r--libc/math/w_logl.c73
-rw-r--r--libc/math/w_pow.c113
-rw-r--r--libc/math/w_powf.c124
-rw-r--r--libc/math/w_powl.c117
-rw-r--r--libc/math/w_remainder.c62
-rw-r--r--libc/math/w_remainderf.c64
-rw-r--r--libc/math/w_remainderl.c65
-rw-r--r--libc/math/w_scalb.c96
-rw-r--r--libc/math/w_scalbf.c99
-rw-r--r--libc/math/w_scalbl.c98
-rw-r--r--libc/math/w_sinh.c31
-rw-r--r--libc/math/w_sinhf.c36
-rw-r--r--libc/math/w_sinhl.c31
-rw-r--r--libc/math/w_sqrt.c60
-rw-r--r--libc/math/w_sqrtf.c62
-rw-r--r--libc/math/w_sqrtl.c62
-rw-r--r--libc/math/w_tgamma.c28
-rw-r--r--libc/math/w_tgammaf.c36
-rw-r--r--libc/math/w_tgammal.c30
-rw-r--r--libc/misc/Makefile3
-rw-r--r--libc/misc/bits/select2.h34
-rw-r--r--libc/misc/err.c18
-rw-r--r--libc/misc/getttyent.c6
-rw-r--r--libc/misc/mntent_r.c6
-rw-r--r--libc/misc/sys/cdefs.h15
-rw-r--r--libc/misc/sys/select.h16
-rw-r--r--libc/nptl/ChangeLog75
-rw-r--r--libc/nptl/allocatestack.c1
-rw-r--r--libc/nptl/descr.h1
-rw-r--r--libc/nptl/nptl-init.c1
-rw-r--r--libc/nptl/pthread_create.c6
-rw-r--r--libc/nptl/sysdeps/i386/tls.h10
-rw-r--r--libc/nptl/sysdeps/ia64/tls.h7
-rw-r--r--libc/nptl/sysdeps/powerpc/tls.h7
-rw-r--r--libc/nptl/sysdeps/pthread/list.h31
-rw-r--r--libc/nptl/sysdeps/pthread/malloc-machine.h3
-rw-r--r--libc/nptl/sysdeps/s390/tls.h7
-rw-r--r--libc/nptl/sysdeps/sh/tls.h9
-rw-r--r--libc/nptl/sysdeps/sparc/tls.h6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S20
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S11
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S11
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S28
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h37
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S17
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S27
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S13
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S27
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S18
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S12
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S21
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S11
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S14
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S16
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S33
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S7
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S8
-rw-r--r--libc/nptl/sysdeps/x86_64/tls.h7
-rw-r--r--libc/nptl/tst-tls1.c12
-rw-r--r--libc/nptl/tst-tls2.c13
-rw-r--r--libc/nptl/tst-tls3.c10
-rw-r--r--libc/nptl/tst-tls3mod.c5
-rw-r--r--libc/nptl/tst-tls4.c10
-rw-r--r--libc/nptl/tst-tls4moda.c9
-rw-r--r--libc/nptl/tst-tls4modb.c9
-rw-r--r--libc/nptl/tst-tls5.h3
-rw-r--r--libc/nptl_db/ChangeLog4
-rw-r--r--libc/nptl_db/thread_dbP.h3
-rw-r--r--libc/nscd/Makefile6
-rw-r--r--libc/nscd/cache.c6
-rw-r--r--libc/nscd/connections.c48
-rw-r--r--libc/nscd/grpcache.c2
-rw-r--r--libc/nscd/netgroupcache.c669
-rw-r--r--libc/nscd/nscd-client.h23
-rw-r--r--libc/nscd/nscd.conf9
-rw-r--r--libc/nscd/nscd.h22
-rw-r--r--libc/nscd/nscd_conf.c3
-rw-r--r--libc/nscd/nscd_netgroup.c290
-rw-r--r--libc/nscd/nscd_proto.h7
-rw-r--r--libc/nscd/selinux.c9
-rw-r--r--libc/nss/Versions2
-rw-r--r--libc/nss/getent.c19
-rw-r--r--libc/nss/nss_files/files-init.c56
-rw-r--r--libc/nss/nss_files/files-initgroups.c12
-rw-r--r--libc/nss/nsswitch.c17
-rw-r--r--libc/nss/nsswitch.h3
-rw-r--r--libc/po/Makefile6
-rw-r--r--libc/po/ca.po1664
-rw-r--r--libc/po/it.po1776
-rw-r--r--libc/po/ja.po469
-rw-r--r--libc/posix/Makefile7
-rw-r--r--libc/posix/getopt.c38
-rw-r--r--libc/posix/wordexp.c20
-rw-r--r--libc/pwd/fgetpwent_r.c8
-rw-r--r--libc/resolv/Makefile8
-rw-r--r--libc/resolv/Versions11
-rw-r--r--libc/resolv/res-state.c19
-rw-r--r--libc/resolv/res_hconf.c4
-rw-r--r--libc/resolv/res_libc.c2
-rw-r--r--libc/shadow/fgetspent_r.c8
-rw-r--r--libc/shadow/putspent.c8
-rw-r--r--libc/stdio-common/printf_fp.c10
-rw-r--r--libc/stdio-common/printf_fphex.c38
-rw-r--r--libc/stdio-common/printf_size.c24
-rw-r--r--libc/stdio-common/tmpfile.c14
-rw-r--r--libc/stdio-common/vfscanf.c134
-rw-r--r--libc/stdlib/abort.c6
-rw-r--r--libc/stdlib/fmtmsg.c6
-rw-r--r--libc/stdlib/longlong.h45
-rw-r--r--libc/string/Makefile6
-rw-r--r--libc/string/memrchr.c11
-rw-r--r--libc/string/stratcliff.c35
-rw-r--r--libc/string/strncat.c1
-rw-r--r--libc/string/strnlen.c13
-rw-r--r--libc/string/test-memcmp.c125
-rw-r--r--libc/string/test-rawmemchr.c189
-rw-r--r--libc/string/test-strchr.c137
-rw-r--r--libc/string/test-strcmp.c89
-rw-r--r--libc/string/test-strlen.c85
-rw-r--r--libc/string/test-wcscmp.c2
-rw-r--r--libc/sunrpc/auth_unix.c6
-rw-r--r--libc/sunrpc/clnt_perr.c9
-rw-r--r--libc/sunrpc/clnt_tcp.c4
-rw-r--r--libc/sunrpc/clnt_udp.c4
-rw-r--r--libc/sunrpc/clnt_unix.c4
-rw-r--r--libc/sunrpc/netname.c5
-rw-r--r--libc/sunrpc/openchild.c8
-rw-r--r--libc/sunrpc/svc_simple.c6
-rw-r--r--libc/sunrpc/svc_tcp.c6
-rw-r--r--libc/sunrpc/svc_udp.c6
-rw-r--r--libc/sunrpc/svc_unix.c5
-rw-r--r--libc/sunrpc/xdr.c4
-rw-r--r--libc/sunrpc/xdr_array.c5
-rw-r--r--libc/sunrpc/xdr_rec.c7
-rw-r--r--libc/sunrpc/xdr_ref.c7
-rw-r--r--libc/sunrpc/xdr_stdio.c12
-rw-r--r--libc/sysdeps/gnu/Makefile7
-rw-r--r--libc/sysdeps/i386/bits/select.h6
-rwxr-xr-xlibc/sysdeps/i386/configure25
-rw-r--r--libc/sysdeps/i386/configure.in11
-rw-r--r--libc/sysdeps/i386/dl-machine.h67
-rwxr-xr-xlibc/sysdeps/i386/elf/configure11
-rw-r--r--libc/sysdeps/i386/elf/configure.in6
-rw-r--r--libc/sysdeps/i386/fpu/e_acos.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_acosf.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_acosh.S7
-rw-r--r--libc/sysdeps/i386/fpu/e_acoshf.S7
-rw-r--r--libc/sysdeps/i386/fpu/e_acoshl.S7
-rw-r--r--libc/sysdeps/i386/fpu/e_acosl.c1
-rw-r--r--libc/sysdeps/i386/fpu/e_asin.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_asinf.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_atan2.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_atan2f.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_atan2l.c1
-rw-r--r--libc/sysdeps/i386/fpu/e_atanh.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_atanhf.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_atanhl.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_exp.S17
-rw-r--r--libc/sysdeps/i386/fpu/e_exp10.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_exp10f.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_exp10l.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_exp2.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_exp2f.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_exp2l.S1
-rw-r--r--libc/sysdeps/i386/fpu/e_expf.S17
-rw-r--r--libc/sysdeps/i386/fpu/e_expl.c3
-rw-r--r--libc/sysdeps/i386/fpu/e_fmod.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_fmodf.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_fmodl.c1
-rw-r--r--libc/sysdeps/i386/fpu/e_hypot.S5
-rw-r--r--libc/sysdeps/i386/fpu/e_hypotf.S5
-rw-r--r--libc/sysdeps/i386/fpu/e_log.S29
-rw-r--r--libc/sysdeps/i386/fpu/e_log10.S11
-rw-r--r--libc/sysdeps/i386/fpu/e_log10f.S11
-rw-r--r--libc/sysdeps/i386/fpu/e_log10l.S11
-rw-r--r--libc/sysdeps/i386/fpu/e_log2.S9
-rw-r--r--libc/sysdeps/i386/fpu/e_log2f.S9
-rw-r--r--libc/sysdeps/i386/fpu/e_log2l.S9
-rw-r--r--libc/sysdeps/i386/fpu/e_logf.S29
-rw-r--r--libc/sysdeps/i386/fpu/e_logl.S29
-rw-r--r--libc/sysdeps/i386/fpu/e_pow.S39
-rw-r--r--libc/sysdeps/i386/fpu/e_powf.S39
-rw-r--r--libc/sysdeps/i386/fpu/e_powl.S39
-rw-r--r--libc/sysdeps/i386/fpu/e_remainder.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_remainderf.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_remainderl.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_scalb.S12
-rw-r--r--libc/sysdeps/i386/fpu/e_scalbf.S12
-rw-r--r--libc/sysdeps/i386/fpu/e_scalbl.S12
-rw-r--r--libc/sysdeps/i386/fpu/e_sqrt.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_sqrtf.S3
-rw-r--r--libc/sysdeps/i386/fpu/e_sqrtl.c2
-rw-r--r--libc/sysdeps/i386/fpu/libm-test-ulps54
-rw-r--r--libc/sysdeps/i386/i686/fpu/e_log.S29
-rw-r--r--libc/sysdeps/i386/i686/fpu/e_logf.S30
-rw-r--r--libc/sysdeps/i386/i686/fpu/e_logl.S81
-rw-r--r--libc/sysdeps/i386/i686/multiarch/Makefile6
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S497
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memchr-sse2.S706
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memchr.S99
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S396
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S565
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S927
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memrchr-c.c7
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S418
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memrchr-sse2.S725
-rw-r--r--libc/sysdeps/i386/i686/multiarch/memrchr.S79
-rw-r--r--libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2-bsf.S3
-rw-r--r--libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2.S3
-rw-r--r--libc/sysdeps/i386/i686/multiarch/rawmemchr.S99
-rw-r--r--libc/sysdeps/i386/i686/multiarch/rtld-strnlen.c1
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strchr-sse2.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S3
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strlen-sse2.S442
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strnlen-c.c8
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strnlen-sse2.S3
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strnlen.S56
-rw-r--r--libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S2
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S148
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wcslen-c.c5
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wcslen-sse2.S194
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wcslen.S56
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wmemcmp-c.c5
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wmemcmp-sse4.S4
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wmemcmp-ssse3.S4
-rw-r--r--libc/sysdeps/i386/i686/multiarch/wmemcmp.S59
-rw-r--r--libc/sysdeps/i386/sysdep.h4
-rw-r--r--libc/sysdeps/ia64/dl-machine.h29
-rw-r--r--libc/sysdeps/ia64/elf/configure33
-rw-r--r--libc/sysdeps/ia64/elf/configure.in28
-rw-r--r--libc/sysdeps/ia64/fpu/bits/math-finite.h25
-rw-r--r--libc/sysdeps/ieee754/dbl-64/dla.h107
-rw-r--r--libc/sysdeps/ieee754/dbl-64/doasin.c9
-rw-r--r--libc/sysdeps/ieee754/dbl-64/dosincos.c22
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_acosh.c31
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_asin.c30
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_atan2.c383
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_atanh.c122
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_cosh.c64
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_exp.c3
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_exp2.c48
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_fmod.c43
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_gamma_r.c10
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_hypot.c25
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_j0.c212
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_j1.c255
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_jn.c93
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c85
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_log.c31
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_log10.c42
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_log2.c34
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_pow.c16
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_remainder.c11
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_sinh.c36
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_sqrt.c5
-rw-r--r--libc/sysdeps/ieee754/dbl-64/halfulp.c25
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_asinh.c40
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_atan.c117
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_ceil.c20
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_finite.c1
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_floor.c14
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_fma.c22
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_fmaf.c10
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_isinf_ns.c20
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_isnan.c1
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_lround.c2
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_rint.c26
-rw-r--r--libc/sysdeps/ieee754/dbl-64/s_tan.c61
-rw-r--r--libc/sysdeps/ieee754/dbl-64/w_exp.c79
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c82
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c16
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c33
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c81
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c67
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c20
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c1
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c (renamed from ports/sysdeps/m68k/m680x0/s_isnanl.c)38
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c28
-rw-r--r--libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c17
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_acosf.c21
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_acoshf.c15
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_asinf.c9
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_atan2f.c27
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_atanhf.c112
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_coshf.c43
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_exp2f.c14
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_expf.c21
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_fmodf.c33
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_gammaf_r.c10
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_hypotf.c21
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_j0f.c200
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_j1f.c239
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_jnf.c64
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c70
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_log10f.c42
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_log2f.c26
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_logf.c32
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_powf.c46
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_remainderf.c21
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_sinhf.c25
-rw-r--r--libc/sysdeps/ieee754/flt-32/e_sqrtf.c39
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_asinhf.c40
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_ceilf.c27
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_finitef.c1
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_floorf.c26
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_isinf_nsf.c20
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_isnanf.c3
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_nearbyintf.c28
-rw-r--r--libc/sysdeps/ieee754/flt-32/s_rintf.c28
-rw-r--r--libc/sysdeps/ieee754/flt-32/w_expf.c90
-rw-r--r--libc/sysdeps/ieee754/k_standard.c331
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_acoshl.c15
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_acosl.c21
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_asinl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_atan2l.c25
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_atanhl.c23
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_coshl.c16
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_expl.c5
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_fmodl.c41
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c5
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_hypotl.c21
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_j0l.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_j1l.c2
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_jnl.c35
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c12
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_log10l.c6
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_log2l.c3
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_logl.c5
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_powl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_remainderl.c25
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/e_sinhl.c16
-rw-r--r--libc/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c19
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c19
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c23
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c25
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c27
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c3
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c31
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c5
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c21
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c13
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_log10l.c4
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_log2l.c1
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_logl.c3
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c11
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c19
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c23
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c5
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c1
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c (renamed from ports/sysdeps/m68k/m680x0/s_isinfl.c)37
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c16
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_acoshl.c21
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_asinl.c7
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_atan2l.c29
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_atanhl.c23
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_coshl.c46
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_gammal_r.c13
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_hypotl.c17
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_j0l.c138
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_j1l.c156
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_jnl.c52
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c30
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_remainderl.c23
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/e_sinhl.c21
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_asinhl.c22
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/s_isinf_nsl.c18
-rw-r--r--libc/sysdeps/ieee754/ldbl-96/w_expl.c89
-rw-r--r--libc/sysdeps/mach/hurd/Makefile6
-rw-r--r--libc/sysdeps/mach/hurd/fork.c4
-rw-r--r--libc/sysdeps/mach/hurd/i386/tls.h20
-rw-r--r--libc/sysdeps/mach/hurd/sys/param.h6
-rw-r--r--libc/sysdeps/mach/hurd/tls.h6
-rw-r--r--libc/sysdeps/posix/spawni.c20
-rw-r--r--libc/sysdeps/powerpc/Makefile4
-rw-r--r--libc/sysdeps/powerpc/fpu/e_hypot.c118
-rw-r--r--libc/sysdeps/powerpc/fpu/e_hypotf.c119
-rw-r--r--libc/sysdeps/powerpc/fpu/e_rem_pio2f.c189
-rw-r--r--libc/sysdeps/powerpc/fpu/e_sqrt.c21
-rw-r--r--libc/sysdeps/powerpc/fpu/e_sqrtf.c19
-rw-r--r--libc/sysdeps/powerpc/fpu/k_cosf.c65
-rw-r--r--libc/sysdeps/powerpc/fpu/k_rem_pio2f.c274
-rw-r--r--libc/sysdeps/powerpc/fpu/k_sinf.c53
-rw-r--r--libc/sysdeps/powerpc/fpu/libm-test-ulps46
-rw-r--r--libc/sysdeps/powerpc/fpu/s_cosf.c71
-rw-r--r--libc/sysdeps/powerpc/fpu/s_float_bitwise.h112
-rw-r--r--libc/sysdeps/powerpc/fpu/s_sinf.c70
-rw-r--r--libc/sysdeps/powerpc/powerpc32/Makefile5
-rw-r--r--libc/sysdeps/powerpc/powerpc32/Versions3
-rw-r--r--libc/sysdeps/powerpc/powerpc32/dl-machine.h21
-rwxr-xr-xlibc/sysdeps/powerpc/powerpc32/elf/configure11
-rw-r--r--libc/sysdeps/powerpc/powerpc32/elf/configure.in6
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/memcpy.S88
-rw-r--r--libc/sysdeps/powerpc/powerpc32/power7/strncmp.S4
-rw-r--r--libc/sysdeps/powerpc/powerpc32/ppc-mcount.S3
-rw-r--r--libc/sysdeps/powerpc/powerpc64/Makefile1
-rw-r--r--libc/sysdeps/powerpc/powerpc64/dl-machine.h107
-rw-r--r--libc/sysdeps/powerpc/powerpc64/elf/configure68
-rw-r--r--libc/sysdeps/powerpc/powerpc64/elf/configure.in63
-rw-r--r--libc/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c3
-rw-r--r--libc/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c3
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/memcpy.S86
-rw-r--r--libc/sysdeps/powerpc/powerpc64/power7/strncmp.S4
-rw-r--r--libc/sysdeps/s390/fpu/e_sqrt.c5
-rw-r--r--libc/sysdeps/s390/fpu/e_sqrtf.c5
-rw-r--r--libc/sysdeps/s390/fpu/e_sqrtl.c5
-rw-r--r--libc/sysdeps/s390/fpu/libm-test-ulps42
-rw-r--r--libc/sysdeps/s390/s390-32/dl-machine.h12
-rw-r--r--libc/sysdeps/s390/s390-32/elf/configure11
-rw-r--r--libc/sysdeps/s390/s390-32/elf/configure.in6
-rw-r--r--libc/sysdeps/s390/s390-64/dl-machine.h10
-rw-r--r--libc/sysdeps/s390/s390-64/elf/configure11
-rw-r--r--libc/sysdeps/s390/s390-64/elf/configure.in6
-rw-r--r--libc/sysdeps/sh/dl-machine.h33
-rw-r--r--libc/sysdeps/sh/elf/configure11
-rw-r--r--libc/sysdeps/sh/elf/configure.in6
-rw-r--r--libc/sysdeps/sparc/sparc32/Makefile5
-rw-r--r--libc/sysdeps/sparc/sparc32/dl-machine.h24
-rw-r--r--libc/sysdeps/sparc/sparc32/e_sqrt.c3
-rw-r--r--libc/sysdeps/sparc/sparc32/elf/configure11
-rw-r--r--libc/sysdeps/sparc/sparc32/elf/configure.in6
-rw-r--r--libc/sysdeps/sparc/sparc64/dl-machine.h39
-rw-r--r--libc/sysdeps/sparc/sparc64/elf/configure11
-rw-r--r--libc/sysdeps/sparc/sparc64/elf/configure.in6
-rw-r--r--libc/sysdeps/sparc/sparc64/fpu/e_sqrtl.c3
-rw-r--r--libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h4
-rw-r--r--libc/sysdeps/unix/clock_gettime.c4
-rw-r--r--libc/sysdeps/unix/i386/sysdep.S43
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/in.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/socket.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/clock_gettime.c22
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure12
-rw-r--r--libc/sysdeps/unix/sysv/linux/configure.in12
-rw-r--r--libc/sysdeps/unix/sysv/linux/getpagesize.c18
-rw-r--r--libc/sysdeps/unix/sysv/linux/getsysstats.c22
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sysdep.h50
-rw-r--r--libc/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S8
-rw-r--r--libc/sysdeps/unix/sysv/linux/ia64/sysdep.S36
-rw-r--r--libc/sysdeps/unix/sysv/linux/init-first.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S76
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h37
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S61
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h25
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/sysdep.h60
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h31
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h31
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c14
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/init-first.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h39
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/time.c9
-rw-r--r--libc/sysdeps/unix/x86_64/sysdep.S38
-rw-r--r--libc/sysdeps/x86_64/bits/select.h6
-rw-r--r--libc/sysdeps/x86_64/dl-machine.h30
-rw-r--r--libc/sysdeps/x86_64/dl-trampoline.S5
-rw-r--r--libc/sysdeps/x86_64/dla.h6
-rwxr-xr-xlibc/sysdeps/x86_64/elf/configure11
-rw-r--r--libc/sysdeps/x86_64/elf/configure.in6
-rw-r--r--libc/sysdeps/x86_64/fpu/bits/fenv.h40
-rw-r--r--libc/sysdeps/x86_64/fpu/bits/mathinline.h189
-rw-r--r--libc/sysdeps/x86_64/fpu/e_exp2l.S1
-rw-r--r--libc/sysdeps/x86_64/fpu/e_fmodl.S1
-rw-r--r--libc/sysdeps/x86_64/fpu/e_log10l.S27
-rw-r--r--libc/sysdeps/x86_64/fpu/e_log2l.S25
-rw-r--r--libc/sysdeps/x86_64/fpu/e_logl.S27
-rw-r--r--libc/sysdeps/x86_64/fpu/e_powl.S34
-rw-r--r--libc/sysdeps/x86_64/fpu/e_remainderl.S1
-rw-r--r--libc/sysdeps/x86_64/fpu/e_scalbl.S8
-rw-r--r--libc/sysdeps/x86_64/fpu/e_sqrt.c6
-rw-r--r--libc/sysdeps/x86_64/fpu/e_sqrtf.c6
-rw-r--r--libc/sysdeps/x86_64/fpu/feupdateenv.c4
-rw-r--r--libc/sysdeps/x86_64/fpu/fraiseexcpt.c5
-rw-r--r--libc/sysdeps/x86_64/fpu/libm-test-ulps158
-rw-r--r--libc/sysdeps/x86_64/fpu/math_private.h141
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/Makefile4
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_ceil-c.c2
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_ceil.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_ceilf-c.c2
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_ceilf.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_floor-c.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_floor.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_floorf-c.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_floorf.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_fma.c (renamed from libc/sysdeps/x86_64/multiarch/s_fma.c)22
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_fmaf.c (renamed from libc/sysdeps/x86_64/multiarch/s_fmaf.c)22
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf-c.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_rint-c.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_rint.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_rintf-c.c3
-rw-r--r--libc/sysdeps/x86_64/fpu/multiarch/s_rintf.S40
-rw-r--r--libc/sysdeps/x86_64/fpu/s_copysign.S4
-rw-r--r--libc/sysdeps/x86_64/memchr.S316
-rw-r--r--libc/sysdeps/x86_64/memrchr.S383
-rw-r--r--libc/sysdeps/x86_64/multiarch/Makefile5
-rw-r--r--libc/sysdeps/x86_64/multiarch/init-arch.c13
-rw-r--r--libc/sysdeps/x86_64/multiarch/init-arch.h6
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcmp-sse4.S192
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcmp-ssse3.S1997
-rw-r--r--libc/sysdeps/x86_64/multiarch/memcmp.S19
-rw-r--r--libc/sysdeps/x86_64/multiarch/rawmemchr.S17
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcat-ssse3.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcmp-sse42.S1836
-rw-r--r--libc/sysdeps/x86_64/multiarch/strcmp.S1828
-rw-r--r--libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S313
-rw-r--r--libc/sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S686
-rw-r--r--libc/sysdeps/x86_64/multiarch/strlen.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/strnlen-sse2-no-bsf.S3
-rw-r--r--libc/sysdeps/x86_64/multiarch/strnlen.S55
-rw-r--r--libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S2
-rw-r--r--libc/sysdeps/x86_64/multiarch/wmemcmp-c.c5
-rw-r--r--libc/sysdeps/x86_64/multiarch/wmemcmp-sse4.S4
-rw-r--r--libc/sysdeps/x86_64/multiarch/wmemcmp-ssse3.S4
-rw-r--r--libc/sysdeps/x86_64/multiarch/wmemcmp.S47
-rw-r--r--libc/sysdeps/x86_64/rawmemchr.S195
-rw-r--r--libc/sysdeps/x86_64/sysdep.h4
-rw-r--r--libc/sysdeps/x86_64/wcscmp.S102
-rw-r--r--libc/sysdeps/x86_64/wcslen.S239
-rw-r--r--libc/tls.make.c9
-rw-r--r--libc/wcsmbs/Makefile5
-rw-r--r--libc/wcsmbs/test-wcschr.c2
-rw-r--r--libc/wcsmbs/test-wcscmp.c2
-rw-r--r--libc/wcsmbs/test-wcslen.c2
-rw-r--r--libc/wcsmbs/test-wmemcmp.c2
-rw-r--r--libc/wcsmbs/wcscmp.c4
-rw-r--r--libc/wcsmbs/wcslen.c11
-rw-r--r--libc/wcsmbs/wmemcmp.c21
-rw-r--r--ports/ChangeLog.alpha7
-rw-r--r--ports/ChangeLog.am335
-rw-r--r--ports/ChangeLog.arm39
-rw-r--r--ports/ChangeLog.cris5
-rw-r--r--ports/ChangeLog.hppa97
-rw-r--r--ports/ChangeLog.m68k79
-rw-r--r--ports/ChangeLog.mips34
-rw-r--r--ports/sysdeps/alpha/dl-machine.h8
-rw-r--r--ports/sysdeps/am33/dl-machine.h7
-rw-r--r--ports/sysdeps/arm/dl-machine.h45
-rw-r--r--ports/sysdeps/arm/dl-tlsdesc.S5
-rw-r--r--ports/sysdeps/arm/elf/configure11
-rw-r--r--ports/sysdeps/arm/elf/configure.in6
-rw-r--r--ports/sysdeps/arm/libc-tls.c6
-rw-r--r--ports/sysdeps/arm/nptl/tls.h10
-rw-r--r--ports/sysdeps/arm/tlsdesc.c5
-rw-r--r--ports/sysdeps/arm/tlsdesc.sym4
-rw-r--r--ports/sysdeps/cris/dl-machine.h7
-rw-r--r--ports/sysdeps/hppa/dl-machine.h244
-rw-r--r--ports/sysdeps/hppa/dl-tls.h5
-rw-r--r--ports/sysdeps/hppa/elf/configure11
-rw-r--r--ports/sysdeps/hppa/elf/configure.in6
-rw-r--r--ports/sysdeps/hppa/fpu/fegetenv.c3
-rw-r--r--ports/sysdeps/hppa/fpu/feupdateenv.c3
-rw-r--r--ports/sysdeps/hppa/fpu/ftestexcept.c3
-rw-r--r--ports/sysdeps/hppa/linuxthreads/pspinlock.c82
-rw-r--r--ports/sysdeps/hppa/linuxthreads/pt-machine.h134
-rw-r--r--ports/sysdeps/hppa/linuxthreads/tls.h163
-rw-r--r--ports/sysdeps/hppa/nptl/tls.h8
-rw-r--r--ports/sysdeps/hppa/stackinfo.h8
-rw-r--r--ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c3
-rw-r--r--ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c3
-rw-r--r--ports/sysdeps/m68k/dl-machine.h11
-rw-r--r--ports/sysdeps/m68k/libc-tls.c6
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_acos.c10
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_acosf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_acosl.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_asin.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_asinf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_asinl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_atan2.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_atanh.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_cosh.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_coshf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_coshl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_exp.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_exp10.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_exp2.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_expf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_expl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_fmod.c10
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_log.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_log10.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_log10f.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_log10l.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_log2.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_log2f.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_log2l.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_logf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_logl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_pow.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_remainder.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_scalb.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_sinh.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c1
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/s_ccos.c73
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/s_ccosf.c3
-rw-r--r--ports/sysdeps/m68k/m680x0/fpu/s_ccosl.c3
-rw-r--r--ports/sysdeps/m68k/nptl/tls.h3
-rw-r--r--ports/sysdeps/mips/dl-machine.h17
-rw-r--r--ports/sysdeps/mips/elf/configure11
-rw-r--r--ports/sysdeps/mips/elf/configure.in6
-rw-r--r--ports/sysdeps/mips/fpu/e_sqrt.c3
-rw-r--r--ports/sysdeps/mips/fpu/e_sqrtf.c3
-rw-r--r--ports/sysdeps/mips/libc-tls.c6
-rw-r--r--ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c3
-rw-r--r--ports/sysdeps/mips/nptl/tls.h8
-rw-r--r--ports/sysdeps/unix/arm/sysdep.S43
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S4
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h66
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c33
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h41
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h159
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h73
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c109
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h242
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h84
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h144
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h54
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h107
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h5
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h66
-rw-r--r--ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h60
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/sysdep.h14
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/bits/socket.h4
895 files changed, 27961 insertions, 17700 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index fd78d9928..c41dfd840 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,1635 @@
+2011-10-23 Ulrich Drepper <drepper@gmail.com>
+
+ * string/strnlen.c: Don't define STRNLEN, reverse logic.
+ Remove unused variable magic_bits.
+ * sysdeps/i386/i686/multiarch/rtld-strnlen.c: New file.
+
+ * string/strnlen.c: Define and use STRNLEN macro.
+ * sysdeps/i386/i686/multiarch/Makefile [string] (sysdep_routines):
+ Add strnlen-sse2, strnlen-c, wcslen-sse2, and wcslen-c.
+ * sysdeps/i386/i686/multiarch/strlen-sse2.S: Add support for strnlen.
+ * wcsmbs/wcslen.c: Define and use WCSLEN.
+ * sysdeps/i386/i686/multiarch/strnlen-c.c: New file.
+ * sysdeps/i386/i686/multiarch/strnlen-sse2.S: New file.
+ * sysdeps/i386/i686/multiarch/strnlen.S: New file.
+ * sysdeps/i386/i686/multiarch/wcslen-c.c: New file.
+ * sysdeps/i386/i686/multiarch/wcslen-sse2.S: New file.
+ * sysdeps/i386/i686/multiarch/wcslen.S: New file.
+ Patch by Liubov Dmitrieva <liubov.dmitrieva@gmail.com>.
+
+2011-10-20 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
+ strnlen-sse2-no-bsf.
+ Rename strlen-no-bsf to strlen-sse2-no-bsf.
+ * sysdeps/x86_64/multiarch/strlen-no-bsf.S: Rename to
+ * sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S:
+ Add strnlen support.
+ (USE_AS_STRNLEN): New macro.
+ * sysdeps/x86_64/multiarch/strnlen-sse2-no-bsf.S: New file.
+ * sysdeps/x86_64/multiarch/strcat-ssse3.S: Update.
+ Rename strlen-no-bsf.S to strlen-sse2-no-bsf.S
+ * sysdeps/x86_64/wcslen.S: New file.
+
+2011-10-20 Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
+
+ * sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Update.
+ XMM-moves are used for copying on small sizes.
+
+2011-10-19 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * wcsmbs/Makefile (strop-tests): Add wcschr.
+ * wcsmbs/test-wcschr.c: New file.
+ * string/test-strchr.c: Update.
+ Add wcschr support.
+ (WIDE): New macro.
+
+2011-10-18 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * wcsmbs/Makefile (strop-tests): Add wcslen.
+ * wcsmbs/test-wcslen.c: New file.
+ * string/test-strlen.c: Update.
+ Add wcslen support.
+ (WIDE): New macro.
+
+2011-10-23 Ulrich Drepper <drepper@gmail.com>
+
+ * po/it.po: Update from translation team.
+
+2011-09-22 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * sysdeps/x86_64/wcscmp.S: Update.
+ Fix wrong comparison semantics.
+ wcscmp shall use signed comparison not unsigned.
+ Don't use substraction to avoid overflow bug.
+ * sysdeps/i386/i686/multiarch/wcscmp-sse2.S: Likewise.
+ * wcsmbc/wcscmp.c: Likewise.
+ * string/test-strcmp.c: Likewise.
+ Add new tests to check cases with negative values.
+
+2011-10-23 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/ieee754/dbl-64/dla.h: Move DLA_FMA definition to...
+ * sysdeps/x86_64/dla.h: ...here. New file.
+ * sysdeps/ieee754/dbl-64/doasin.c: Use <dla.h> not "dla.h".
+ * sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise.
+ * sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_atan.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
+
+2011-10-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Add __jnl_finite and
+ __ynl_finite aliases.
+
+2011-10-22 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/x86_64/fpu/libm-test-ulps: Update.
+
+ * sysdeps/ieee754/dbl-64/dla.h: When compiling with FMA4 support
+ define DLA_FMA.
+ [DLA_FMA] (EMULV): Use DLA_FMA.
+ [DLA_FMA] (MUL12): Use EMULV.
+ * sysdeps/ieee754/dbl-64/doasin.c [DLA_FMA]: Don't define variables
+ that are not needed.
+ * sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
+ * sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_atan.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
+
+2011-10-22 Andreas Schwab <schwab@linux-m68k.org>
+
+ * math/s_nan.c: Undef __nan.
+ * math/s_nanf.c: Undef __nanf.
+ * math/s_nanl.c: Undef __nanl.
+ * sysdeps/ieee754/ldbl-128ibm/s_atanl.c: Include <math.h> before
+ "math_private.h".
+
+2011-10-22 Ulrich Drepper <drepper@gmail.com>
+
+ * math/s_catan.c: Add branch predictions.
+ * math/s_catanf.c: Likewise.
+ * math/s_catanh.c: Likewise.
+ * math/s_catanhf.c: Likewise.
+ * math/s_catanhl.c: Likewise.
+ * math/s_catanl.c: Likewise.
+ * math/s_cexp.c: Likewise.
+ * math/s_cexpf.c: Likewise.
+ * math/s_cexpl.c: Likewise.
+ * math/s_clog.c: Likewise.
+ * math/s_clog10.c: Likewise.
+ * math/s_clog10f.c: Likewise.
+ * math/s_clog10l.c: Likewise.
+ * math/s_clogf.c: Likewise.
+ * math/s_clogl.c: Likewise.
+ * math/s_csqrt.c: Likewise.
+ * math/s_csqrtf.c: Likewise.
+ * math/s_csqrtl.c: Likewise.
+ * math/s_ctanf.c: Likewise.
+ * math/s_ctanh.c: Likewise.
+ * math/s_ctanhf.c: Likewise.
+ * math/s_ctanhl.c: Likewise.
+ * math/s_ctanl.c: Likewise.
+
+ * math/math_private.h: Define __nan, __nanf, __nanl.
+ * math/s_cacosh.c: Include <math_private.h>.
+ * math/s_cacoshl.c: Likewise.
+ * math/s_casinh.c: Likewise.
+ * math/s_casinhf.c: Likewise.
+ * math/s_casinhl.c: Likewise.
+ * math/s_ccos.c: Rely entire on ccosh.
+ * math/s_ccosf.c: Rely entire on ccoshf.
+ * math/s_ccosl.c: Rely entirely on ccoshl.
+ * math/s_ccosh.c: Add branch predicion helpers. Add branch prediction.
+ Remove tests for FE_INVALID.
+ * math/s_ccoshf.c: Likewise.
+ * math/s_ccoshl.c: Likewise.
+ * math/s_csin.c: Likewise.
+ * math/s_csinf.c: Likewise.
+ * math/s_csinh.c Likewise.
+ * math/s_csinhf.c: Likewise.
+ * math/s_csinhl.c: Likewise.
+ * math/s_csinl.c: Likewise.
+ * math/s_ctan.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_acosh.c: Use __ieee754_sqrt.
+ * sysdeps/ieee754/flt-32/e_acoshf.c: Use __ieee754_sqrtf.
+ * sysdeps/ieee754/ldbl-96/e_acoshl.c: Use __ieee754_sqrtl.
+
+2011-10-21 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Fix
+ compilation problems.
+
+ * sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Add a few more
+ __builtin_expect.
+
+2011-10-20 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/i386/configure.in: Test for -mfma4 option.
+ * config.h.in: Add HAVE_FMA4_SUPPORT entry.
+ * sysdeps/x86_64/multiarch/init-arch.h: Define HAS_FMA4 and
+ COMMON_CPUID_INDEX_80000001.
+ * sysdeps/x86_64/multiarch/init-arch.c: Read 80000001 leaf for AMD.
+ * sysdeps/x86_64/fpu/multiarch/s_fma.c: Test for FMA4 support and
+ use it if FMA3 is not supported.
+ * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Likewise.
+
+ * sysdeps/x86_64/multiarch/s_fma.c: Moved to ../fpu/multiarch.
+ * sysdeps/x86_64/multiarch/s_fmaf.c: Likewise.
+
+2011-10-20 Andreas Schwab <schwab@redhat.com>
+
+ [BZ #12892]
+ * elf/dl-fini.c (_dl_sort_fini): Ignore relocation dependency if
+ it would create a cycle with a link time dependency.
+
+2011-10-19 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/x86_64/multiarch/rawmemchr.S: Small optimization to safe an
+ instruction.
+ * string/Makefile (strop-tests): Add rawmemchr.
+ * string/test-rawmemchr.c: New file.
+
+ * sysdeps/x86_64/multiarch/init-arch.h: Define bit_AVX and index_AVX.
+ * sysdeps/x86_64/multiarch/strcmp-sse42.S: New file. Split out from...
+ * sysdeps/x86_64/multiarch/strcmp.S: ...here. Include strcmp-sse42.S
+ when compiling str{,n}casecmp and when AVX is available. Hook up
+ new optimized code in initializers.
+
+2011-10-19 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/x86_64/fpu/math_private.h (libc_feupdateenv): Use
+ __feraiseexcept instead of feraiseexcept.
+
+2011-10-18 Ulrich Drepper <drepper@gmail.com>
+
+ * math/math_private.h: Define defaults for libc_fetestexcept and
+ libc_feupdateenv.
+ * sysdeps/ieee754/dbl-64/s_fma.c: Use libc_fe* interfaces.
+ * sysdeps/ieee754/dbl-64/s_fmaf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_exp2f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_expf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_nearbyintf.c: Likewise.
+ * sysdeps/x86_64/fpu/math_private.h: Define special versions of
+ libc_fetestexcept and libc_feupdateenv.
+
+ * math/math_private.h: Define defaults for libc_feholdexcept_setround,
+ libc_feholdexcept_setroundf, libc_feholdexcept_setroundl.
+ * sysdeps/ieee754/dbl-64/e_exp2.c: Use libc_feholdexcept_setround.
+ * sysdeps/x86_64/fpu/math_private.h: Define special version of
+ libc_feholdexcept_setround.
+
+ * sysdeps/x86_64/fpu/multiarch/Makefile [math] (libm-sysdep-routines):
+ Add s_nearbyint-c and s_nearbyintf-c.
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Define nearbyint and
+ nearbyintf inlines.
+ * sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_nearbyint.S: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_nearbyintf-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S: New file.
+
+ * math/math_private.h: Define defaults for libc_fegetround,
+ libc_fegetroundf, libc_fegetroundl, libc_fesetround, libc_fesetroundf,
+ libc_fesetroundl, libc_feholdexcept, libc_feholdexceptf,
+ libc_feholdexceptl, libc_fesetenv, libc_fesetenvf, libc_fesetenvl.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c: Use
+ libc_feholdexcept, libc_fesetround, libc_fesetenv instead of the
+ standard functions.
+ * sysdeps/ieee754/dbl-64/e_exp2.c: Likewise.
+ Remove comments and hacks for old compiler versions.
+ * sysdeps/x86_64/fpu/math_private.h: Define special versions of
+ libc_fegetround, libc_fesetround, libc_feholdexcept, and
+ libc_feholdexceptl.
+
+2011-10-18 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/x86_64/fpu/bits/fenv.h: Add C linkage markers.
+ (__feraiseexcept_renamed): Add __NTH.
+ (feraiseexcept): Add __NTH. Rename local variables to fix
+ namespace violations.
+
+2011-10-17 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Small optimization.
+
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c: New file.
+
+ * sysdeps/x86_64/fpu/math_private.h: Relax asm requirements for
+ recently added interfaces.
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Likewise.
+
+ * sysdeps/x86_64/fpu/math_private.h: Add some parenthesis to be safe
+ about macro parameter expansion.
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Don't define inlines if
+ __NO_MATH_INLINES is defined. Cleanups.
+
+ * sysdeps/x86_64/fpu/math_private.h: Define __rint, __rintf, __floor,
+ and __floorf is target has SSE4.1.
+ * sysdeps/x86_64/fpu/multiarch/s_floor-c.c: Undef first.
+ * sysdeps/x86_64/fpu/multiarch/s_floorf-c.: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/s_rint-c.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/s_rintf-c.c: Likewise.
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h (floor): Use correct function
+ name.
+ (floorf): Likewise.
+
+ * nscd/netgroupcache.c (addgetnetgrentX): Fix #ifdef nesting.
+
+2011-10-17 Andreas Schwab <schwab@redhat.com>
+
+ * misc/sys/cdefs.h: Fix last change.
+
+ * grp/initgroups.c (internal_getgrouplist): Fix initgroups
+ database lookup.
+
+2011-10-16 Ulrich Drepper <drepper@gmail.com>
+
+ * misc/sys/cdefs.h: Use leaf function attribute in __THROW.
+
+ * sysdeps/ieee754/dbl-64/s_ceil.c: Avoid alias renamed.
+ * sysdeps/ieee754/dbl-64/s_floor.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_rint.c: Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c: Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c: Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_ceilf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_floorf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_rintf.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/Makefile: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_ceil-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_ceil.S: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_ceilf-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_ceilf.S: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_floor-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_floor.S: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_floorf-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_floorf.S: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_rint-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_rint.S: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_rintf-c.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_rintf.S: New file.
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Add inlines for rint, rintf,
+ ceil, ceilf, floor, floorf.
+
+ * elf/do-rel.h (elf_dynamic_do_Rel): Work around linker problem.
+ Perform IRELATIVE relocations last.
+
+ * elf/do-rel.h: Add another parameter nrelative, replacing the
+ local variable with the same name. Change name of the function
+ to end in Rel or Rela (uppercase).
+ * elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): Add new element
+ nrelative to ranges. Only nonzero for DT_REL/DT_RELA. Pass to the
+ elf_dynamic_do_##reloc function.
+
+2011-10-15 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/i386/i686/fpu/e_log.S: No need for the fyl2xp1 use, fyl2x
+ is sufficient, at least on modern CPUs.
+
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c: New file.
+
+ * sysdeps/ieee754/dbl-64/e_cosh.c: Cleanup.
+ * sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c: New file.
+
+ * math/Versions [libm] (GLIBC_2.15): Add __exp_finite, __expf_finite,
+ __expl_finite.
+ * math/bits/math-finite.h: Add entries for exp.
+ * math/e_expl.c: Add __*_finite alias.
+ * sysdeps/i386/fpu/e_exp.S: Likewise.
+ * sysdeps/i386/fpu/e_expf.S: Likewise.
+ * sysdeps/i386/fpu/e_expl.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_exp.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_expf.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_expl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_expl.c: Likewise.
+ * sysdeps/ieee754/dbl-64/w_exp.c: Complete rewrite.
+ * sysdeps/ieee754/flt-32/w_expf.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/w_expl.c: Likewise.
+
+ * sysdeps/i386/i686/fpu/e_logf.S: No need for the fyl2xp1 use, fyl2x
+ is sufficient, at least on modern CPUs.
+
+ * ctype/ctype-info.c (__ctype_init): Define.
+ * include/ctype.h (__ctype_init): Declare.
+ (__ctype_b_loc): The variable is always initialized.
+ (__ctype_toupper_loc): Likewise.
+ (__ctype_tolower_loc): Likewise.
+ * ctype/Versions: Export __ctype_init for GLIBC_PRIVATE.
+ * sysdeps/unix/sysv/linux/init-first.c (_init): Call __ctype_init.
+
+2011-10-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * wcsmbs/wmemcmp.c (WMEMCMP): Define.
+
+ * configure.in: Also look in $cxxmachine/include for C++ system
+ headers.
+
+2011-09-27 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * sysdeps/x86_64/multiarch/Makefile: (sysdep_routines): Add
+ memcmp-ssse3 wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c
+ * sysdeps/x86_64/multiarch/memcmp-ssse3: New file.
+ * sysdeps/x86_64/multiarch/memcmp.S: Update. Add __memcmp_ssse3.
+ * sysdeps/x86_64/multiarch/memcmp-sse4.S: Update.
+ (USE_AS_WMEMCMP): New macro.
+ Fixing indents.
+ * sysdeps/x86_64/multiarch/wmemcmp.S: New file.
+ * sysdeps/x86_64/multiarch/wmemcmp-ssse3.S: New file.
+ * sysdeps/x86_64/multiarch/wmemcmp-sse4.S: New file.
+ * sysdeps/x86_64/multiarch/wmemcmp-c.S: New file.
+ * sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
+ wmemcmp-ssse3 wmemcmp-sse4 wmemcmp-c
+ * sysdeps/i386/i686/multiarch/wmemcmp.S: New file.
+ * sysdeps/i386/i686/multiarch/wmemcmp-c.c: New file.
+ * sysdeps/i386/i686/multiarch/wmemcmp-ssse3.S: New file.
+ * sysdeps/i386/i686/multiarch/wmemcmp-sse4.S: New file.
+ * sysdeps/i386/i686/multiarch/memcmp-sse4.S: Update.
+ (USE_AS_WMEMCMP): New macro.
+ * sysdeps/i386/i686/multiarch/memcmp-ssse3: Likewise.
+ * sysdeps/string/test-memcmp.c: Update.
+ Fix simple_wmemcmp.
+ Add new tests.
+ * wcsmbs/wmemcmp.c: Update.
+ (WMEMCMP): New macro.
+ Fix overflow bug.
+
+2011-10-12 Andreas Jaeger <aj@suse.de>
+
+ [BZ #13268]
+ * math/bits/mathcalls.h: Mark argument 2 of modf as non-null.
+
+2011-10-15 Ulrich Drepper <drepper@gmail.com>
+
+ * libio/iofwide.c (do_length): Avoid warning.
+
+ * ctype/ctype.h (__isctype_f): Add missing __THROW.
+
+2011-10-14 Ulrich Drepper <drepper@gmail.com>
+
+ * elf/pldd-xx.c (find_maps): Remove leftover debug message.
+
+ * sysdeps/i386/fpu/e_log.S: Add real definition of __log_finite.
+ * sysdeps/i386/fpu/e_logf.S: Add real definition of __logf_finite.
+ * sysdeps/i386/fpu/e_logl.S: Add real definition of __logl_finite.
+ * sysdeps/i386/i686/fpu/e_log.S: New file.
+ * sysdeps/i386/i686/fpu/e_logf.S: New file.
+ * sysdeps/i386/i686/fpu/e_logl.S: New file.
+
+ * ctype/ctype.h: Add support for inlined isXXX functions when
+ compiling C++ code.
+
+2011-10-14 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/s390/fpu/libm-test-ulps: Adjust ULPs for jn tests.
+
+ * sysdeps/x86_64/fpu/fraiseexcpt.c: Fix last change.
+
+2011-10-13 Roland McGrath <roland@hack.frob.com>
+
+ [BZ #13291]
+ * manual/string.texi (String/Array Comparison): Typo fix in strverscmp.
+
+2011-10-13 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/x86_64/fpu/fraiseexcpt.c: Add __feraiseexcept alias.
+ * sysdeps/x86_64/fpu/feupdateenv.c: Use __feraiseexcept instead of
+ feraiseexcept.
+
+ * sysdeps/x86_64/memrchr.S: Check for zero size.
+
+ * string/stratcliff.c: Add memrchr tests.
+
+2011-10-12 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
+ memchr-sse2 memchr-sse2-bsf memrchr-sse2 memrchr-sse2-bsf memrchr-c
+ rawmemchr-sse2 rawmemchr-sse2-bsf.
+ * sysdeps/i386/i686/multiarch/memchr.S: New file.
+ * sysdeps/i386/i686/multiarch/memchr-sse2.S: New file.
+ * sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S: New file.
+ * sysdeps/i386/i686/multiarch/memrchr.S: New file.
+ * sysdeps/i386/i686/multiarch/memrchr-c.c: New file.
+ * sysdeps/i386/i686/multiarch/memrchr-sse2.S: New file.
+ * sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S: New file.
+ * sysdeps/i386/i686/multiarch/rawmemchr.S: New file.
+ * sysdeps/i386/i686/multiarch/rawmemchr-sse2.S: New file.
+ * sysdeps/i386/i686/multiarch/rawmemchr-sse2-bsf.S: New file.
+ * string/memrchr.c (MEMRCHR): New macro.
+
+2011-10-12 Ulrich Drepper <drepper@gmail.com>
+
+ Add integration with gcc's -ffinite-math-only and optimize wrapper
+ functions in libm.
+ * Versions.def: Define GLIBC_2.15 version for libm.
+ * math/Makefile (headers): Add bits/math-finite.h.
+ * math/bits/math-finite.h: New file.
+ * sysdeps/ia64/fpu/bits/math-finite.h: New file.
+ * math/Versions [libm] (GLIBC_2.15): Export __*_finite symbols.
+ * math/e_acoshl.c: Add __*_finite alias.
+ * math/e_acosl.c: Likewise.
+ * math/e_asinl.c: Likewise.
+ * math/e_atan2l.c: Likewise.
+ * math/e_atanhl.c: Likewise.
+ * math/e_coshl.c: Likewise.
+ * math/e_exp10.c: Likewise.
+ * math/e_exp10f.c: Likewise.
+ * math/e_exp10l.c: Likewise.
+ * math/e_exp2l.c: Likewise.
+ * math/e_fmodl.c: Likewise.
+ * math/e_gammal_r.c: Likewise.
+ * math/e_hypotl.c: Likewise.
+ * math/e_j0l.c: Likewise.
+ * math/e_j1l.c: Likewise.
+ * math/e_jnl.c: Likewise.
+ * math/e_lgammal_r.c: Likewise.
+ * math/e_log10l.c: Likewise.
+ * math/e_log2l.c: Likewise.
+ * math/e_logl.c: Likewise.
+ * math/e_powl.c: Likewise.
+ * math/e_sinhl.c: Likewise.
+ * math/e_sqrtl.c: Likewise.
+ * math/e_scalb.c: Completely rewritten and optimized.
+ * math/e_scalbf.c: Likewise.
+ * math/e_scalbl.c: Likewise.
+ * math/w_acos.c: Likewise.
+ * math/w_acosf.c: Likewise.
+ * math/w_acosl.c: Likewise.
+ * math/w_acosh.c: Likewise.
+ * math/w_acoshf.c: Likewise.
+ * math/w_acoshl.c: Likewise.
+ * math/w_asin.c: Likewise.
+ * math/w_asinf.c: Likewise.
+ * math/w_asinl.c: Likewise.
+ * math/w_atan2.c: Likewise.
+ * math/w_atan2f.c: Likewise.
+ * math/w_atan2l.c: Likewise.
+ * math/w_atanh.c: Likewise.
+ * math/w_atanhf.c: Likewise.
+ * math/w_atanhl.c: Likewise.
+ * math/w_exp10.c: Likewise.
+ * math/w_exp10f.c: Likewise.
+ * math/w_exp10l.c: Likewise.
+ * math/w_fmod.c: Likewise.
+ * math/w_fmodf.c: Likewise.
+ * math/w_fmodl.c: Likewise.
+ * math/w_j0.c: Likewise.
+ * math/w_j0f.c: Likewise.
+ * math/w_j0l.c: Likewise.
+ * math/w_j1.c: Likewise.
+ * math/w_j1f.c: Likewise.
+ * math/w_j1l.c: Likewise.
+ * math/w_jn.c: Likewise.
+ * math/w_jnf.c: Likewise.
+ * math/w_log.c: Likewise.
+ * math/w_logf.c: Likewise.
+ * math/w_logl.c: Likewise.
+ * math/w_log10.c: Likewise.
+ * math/w_log10f.c: Likewise.
+ * math/w_log10l.c: Likewise.
+ * math/w_log2.c: Likewise.
+ * math/w_log2f.c: Likewise.
+ * math/w_log2l.c: Likewise.
+ * math/w_pow.c: Likewise.
+ * math/w_powf.c: Likewise.
+ * math/w_powl.c: Likewise.
+ * math/w_remainder.c: Likewise.
+ * math/w_remainderf.c: Likewise.
+ * math/w_remainderl.c: Likewise.
+ * math/w_scalb.c: Likewise.
+ * math/w_scalbf.c: Likewise.
+ * math/w_scalbl.c: Likewise.
+ * math/w_sqrt.c: Likewise.
+ * math/w_sqrtf.c: Likewise.
+ * math/w_sqrtl.c: Likewise.
+ * math/math.h: Define __MATH_DECLARE_LDOUBLE if long double functions
+ are declared. Include <bits/math-finite.h> if -ffinite-math-only is
+ used.
+ * math/math_private.h: Declare __kernel_standard_f.
+ * math/w_cosh.c: Remove cruft and optimize a bit.
+ * math/w_coshf.c: Likewise.
+ * math/w_coshl.c: Likewise.
+ * math/w_exp2.c: Likewise.
+ * math/w_exp2f.c: Likewise.
+ * math/w_exp2l.c: Likewise.
+ * math/w_hypot.c: Likewise.
+ * math/w_hypotf.c: Likewise.
+ * math/w_hypotl.c: Likewise.
+ * math/w_lgamma.c: Likewise.
+ * math/w_lgamma_r.c: Likewise.
+ * math/w_lgammaf.c: Likewise.
+ * math/w_lgammaf_r.c: Likewise.
+ * math/w_lgammal.c: Likewise.
+ * math/w_lgammal_r.c: Likewise.
+ * math/w_sinh.c: Likewise.
+ * math/w_sinhf.c: Likewise.
+ * math/w_sinhl.c: Likewise.
+ * math/w_tgamma.c: Likewise.
+ * math/w_tgammaf.c: Likewise.
+ * math/w_tgammal.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_atanh.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_atanhf.c: Likewise.
+ * sysdeps/i386/fpu/e_acos.S: Add __*_finite alias.
+ Minor optimizations. Pretty printing. Remove cruft.
+ * sysdeps/i386/fpu/e_acosf.S: Likewise.
+ * sysdeps/i386/fpu/e_acosh.S: Likewise.
+ * sysdeps/i386/fpu/e_acoshf.S: Likewise.
+ * sysdeps/i386/fpu/e_acoshl.S: Likewise.
+ * sysdeps/i386/fpu/e_acosl.c: Likewise.
+ * sysdeps/i386/fpu/e_asin.S: Likewise.
+ * sysdeps/i386/fpu/e_asinf.S: Likewise.
+ * sysdeps/i386/fpu/e_atan2.S: Likewise.
+ * sysdeps/i386/fpu/e_atan2f.S: Likewise.
+ * sysdeps/i386/fpu/e_atan2l.c: Likewise.
+ * sysdeps/i386/fpu/e_atanh.S: Likewise.
+ * sysdeps/i386/fpu/e_atanhf.S: Likewise.
+ * sysdeps/i386/fpu/e_atanhl.S: Likewise.
+ * sysdeps/i386/fpu/e_exp10.S: Likewise.
+ * sysdeps/i386/fpu/e_exp10f.S: Likewise.
+ * sysdeps/i386/fpu/e_exp10l.S: Likewise.
+ * sysdeps/i386/fpu/e_exp2.S: Likewise.
+ * sysdeps/i386/fpu/e_exp2f.S: Likewise.
+ * sysdeps/i386/fpu/e_exp2l.S: Likewise.
+ * sysdeps/i386/fpu/e_fmod.S: Likewise.
+ * sysdeps/i386/fpu/e_fmodf.S: Likewise.
+ * sysdeps/i386/fpu/e_fmodl.c: Likewise.
+ * sysdeps/i386/fpu/e_hypot.S: Likewise.
+ * sysdeps/i386/fpu/e_hypotf.S: Likewise.
+ * sysdeps/i386/fpu/e_log.S: Likewise.
+ * sysdeps/i386/fpu/e_log10.S: Likewise.
+ * sysdeps/i386/fpu/e_log10f.S: Likewise.
+ * sysdeps/i386/fpu/e_log10l.S: Likewise.
+ * sysdeps/i386/fpu/e_log2.S: Likewise.
+ * sysdeps/i386/fpu/e_log2f.S: Likewise.
+ * sysdeps/i386/fpu/e_log2l.S: Likewise.
+ * sysdeps/i386/fpu/e_logf.S: Likewise.
+ * sysdeps/i386/fpu/e_logl.S: Likewise.
+ * sysdeps/i386/fpu/e_pow.S: Likewise.
+ * sysdeps/i386/fpu/e_powf.S: Likewise.
+ * sysdeps/i386/fpu/e_powl.S: Likewise.
+ * sysdeps/i386/fpu/e_remainder.S: Likewise.
+ * sysdeps/i386/fpu/e_remainderf.S: Likewise.
+ * sysdeps/i386/fpu/e_remainderl.S: Likewise.
+ * sysdeps/i386/fpu/e_scalb.S: Likewise.
+ * sysdeps/i386/fpu/e_scalbf.S: Likewise.
+ * sysdeps/i386/fpu/e_scalbl.S: Likewise.
+ * sysdeps/i386/fpu/e_sqrt.S: Likewise.
+ * sysdeps/i386/fpu/e_sqrtf.S: Likewise.
+ * sysdeps/i386/fpu/e_sqrtl.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_acosh.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_asin.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_cosh.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_exp2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_fmod.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_gamma_r.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_hypot.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_j0.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_j1.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_jn.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_lgamma_r.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log10.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_remainder.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_sinh.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise.
+ * sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_asinh.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_acosf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_acoshf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_asinf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_atan2f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_coshf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_exp2f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_fmodf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_gammaf_r.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_hypotf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_j0f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_j1f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_jnf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_lgammaf_r.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_log10f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_log2f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_logf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_powf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_remainderf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_sinhf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_sqrtf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_asinhf.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_acoshl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_acosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_asinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_atan2l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_atanhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_coshl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_fmodl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_gammal_r.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_hypotl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_j0l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_j1l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_log10l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_log2l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_logl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_powl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_remainderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_sinhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_acoshl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_acosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_asinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_atan2l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_atanhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_coshl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_hypotl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_log10l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_log2l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_logl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_powl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_remainderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_sinhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_acoshl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_asinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_atan2l.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_atanhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_coshl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_gammal_r.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_hypotl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_j0l.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_j1l.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_remainderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_sinhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_asinhl.c: Likewise.
+ * sysdeps/powerpc/fpu/e_hypot.c: Likewise.
+ * sysdeps/powerpc/fpu/e_hypotf.c: Likewise.
+ * sysdeps/powerpc/fpu/e_sqrt.c: Likewise.
+ * sysdeps/powerpc/fpu/e_sqrtf.c: Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/e_sqrt.c: Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c: Likewise.
+ * sysdeps/s390/fpu/e_sqrt.c: Likewise.
+ * sysdeps/s390/fpu/e_sqrtf.c: Likewise.
+ * sysdeps/s390/fpu/e_sqrtl.c: Likewise.
+ * sysdeps/sparc/sparc32/e_sqrt.c: Likewise.
+ * sysdeps/sparc/sparc64/fpu/e_sqrtl.c: Likewise.
+ * sysdeps/x86_64/fpu/e_exp2l.S: Likewise.
+ * sysdeps/x86_64/fpu/e_fmodl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_log10l.S: Likewise.
+ * sysdeps/x86_64/fpu/e_log2l.S: Likewise.
+ * sysdeps/x86_64/fpu/e_logl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_powl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_remainderl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_scalbl.S: Likewise.
+ * sysdeps/x86_64/fpu/e_sqrt.c: Likewise. Fix parameter order
+ * sysdeps/x86_64/fpu/e_sqrtf.c: Likewise.
+ * sysdeps/x86_64/fpu/math_private.h (__isnan): Cast d parameter.
+ (__isnanf): Likewise.
+ (__isinf_ns): Likewise.
+ (__isinf_nsf): Likewise.
+ (__finite): Likewise.
+ (__finitef): Likewise.
+ (__ieee754_sqrt): Define as macro.
+ (__ieee754_sqrtf): Define as macro.
+ (__ieee754_sqrtl): Define as macro.
+ * sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Add partially
+ inlined copy.
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Make use of
+ __FINITE_MATH_ONLY__ consistent.
+ * sysdeps/ieee754/k_standard.c (__kernel_standard_f): New function.
+
+2011-10-10 Andreas Schwab <schwab@linux-m68k.org>
+
+ * inet/getnetgrent_r.c (nscd_getnetgrent): Use __rawmemchr instead
+ of rawmemchr.
+
+ * sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c: New file.
+
+2011-10-09 Ulrich Drepper <drepper@gmail.com>
+
+ * po/ja.po: Update from translation team.
+
+2011-10-08 Roland McGrath <roland@hack.frob.com>
+
+ * locale/programs/locarchive.c (prepare_address_space): New function.
+ (create_archive, enlarge_archive, open_archive): Use it.
+
+ * sysdeps/unix/sysv/linux/x86_64/time.c: Move #include <dl-vdso.h>
+ inside [SHARED], where it is used.
+
+ * nscd/nscd_proto.h: Declare __nscd_setnetgrent.
+
+ * nss/getent.c (netgroup_keys): Remove unused variable.
+ * sysdeps/ieee754/flt-32/s_isinf_nsf.c: Likewise.
+
+2011-10-08 Ulrich Drepper <drepper@gmail.com>
+
+ * include/math.h: Declare __isinf_ns, __isinf_nsf, __isinf_nsl.
+ * sysdeps/ieee754/dbl-64/s_isinf_ns.c: New file.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c: New file.
+ * sysdeps/ieee754/flt-32/s_isinf_nsf.c: New file.
+ * sysdeps/ieee754/ldbl-128/s_isinf_nsl.c: New file.
+ * sysdeps/ieee754/ldbl-96/s_isinf_nsl.c: New file.
+ * math/Makefile (libm-calls): Add s_isinf_ns.
+ * math/divtc3.c: Use __isinf_nsl instead of isinf.
+ * math/multc3.c: Likewise.
+ * math/s_casin.c: Likewise.
+ * math/s_casinf.c: Likewise.
+ * math/s_casinl.c: Likewise.
+ * math/s_ccos.c: Likewise.
+ * math/s_ccosf.c: Likewise.
+ * math/s_ccosl.c: Likewise.
+ * math/s_ctan.c: Likewise.
+ * math/s_ctanf.c: Likewise.
+ * math/s_ctanh.c: Likewise.
+ * math/s_ctanhf.c: Likewise.
+ * math/s_ctanhl.c: Likewise.
+ * math/s_ctanl.c: Likewise.
+ * math/w_fmod.c: Likewise.
+ * math/w_fmodf.c: Likewise.
+ * math/w_fmodl.c: Likewise.
+ * math/w_remainder.c: Likewise.
+ * math/w_remainderf.c: Likewise.
+ * math/w_remainderl.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_finite.c: Undefine __finite.
+ * sysdeps/ieee754/dbl-64/s_isnan.c: Undefine __isnan.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c: Undefine __finite.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c: Undefine __nan.
+ * sysdeps/ieee754/flt-32/s_finitef.c: Undefine __finitef.
+ * sysdeps/ieee754/flt-32/s_isnanf.c: Undefine __nan.
+ * sysdeps/x86_64/fpu/math_private.h: Add optimized versions of __isnsn,
+ __isnanf, __isinf_ns, __isinf_nsf, __finite, and __finitef.
+
+ * stdio-common/printf_fp.c: Use the fact that isinf returns the sign
+ of the number.
+ * stdio-common/printf_fphex.c: Likewise.
+ * stdio-common/printf_size.c: Likewise.
+
+ * math/e_exp10.c: Include math_private.h using <...> not "...".
+ * math/e_exp10f.c: Likewise.
+ * math/e_exp10l.c: Likewise.
+ * math/e_exp2l.c: Likewise.
+ * math/e_j0l.c: Likewise.
+ * math/e_j1l.c: Likewise.
+ * math/e_jnl.c: Likewise.
+ * math/e_lgammal_r.c: Likewise.
+ * math/e_rem_pio2l.c: Likewise.
+ * math/e_scalb.c: Likewise.
+ * math/e_scalbf.c: Likewise.
+ * math/e_scalbl.c: Likewise.
+ * math/k_cosl.c: Likewise.
+ * math/k_sinl.c: Likewise.
+ * math/k_tanl.c: Likewise.
+ * math/s_cacoshf.c: Likewise.
+ * math/s_catan.c: Likewise.
+ * math/s_catanf.c: Likewise.
+ * math/s_catanh.c: Likewise.
+ * math/s_catanhf.c: Likewise.
+ * math/s_catanhl.c: Likewise.
+ * math/s_catanl.c: Likewise.
+ * math/s_ccosh.c: Likewise.
+ * math/s_ccoshf.c: Likewise.
+ * math/s_ccoshl.c: Likewise.
+ * math/s_cexp.c: Likewise.
+ * math/s_cexpf.c: Likewise.
+ * math/s_cexpl.c: Likewise.
+ * math/s_clog.c: Likewise.
+ * math/s_clog10.c: Likewise.
+ * math/s_clog10f.c: Likewise.
+ * math/s_clog10l.c: Likewise.
+ * math/s_clogf.c: Likewise.
+ * math/s_clogl.c: Likewise.
+ * math/s_csin.c: Likewise.
+ * math/s_csinf.c: Likewise.
+ * math/s_csinh.c: Likewise.
+ * math/s_csinhf.c: Likewise.
+ * math/s_csinhl.c: Likewise.
+ * math/s_csinl.c: Likewise.
+ * math/s_csqrt.c: Likewise.
+ * math/s_csqrtf.c: Likewise.
+ * math/s_csqrtl.c: Likewise.
+ * math/s_ctan.c: Likewise.
+ * math/s_ctanf.c: Likewise.
+ * math/s_ctanh.c: Likewise.
+ * math/s_ctanhf.c: Likewise.
+ * math/s_ctanhl.c: Likewise.
+ * math/s_ctanl.c: Likewise.
+ * math/s_ldexp.c: Likewise.
+ * math/s_ldexpf.c: Likewise.
+ * math/s_ldexpl.c: Likewise.
+ * math/s_significand.c: Likewise.
+ * math/s_significandf.c: Likewise.
+ * math/s_significandl.c: Likewise.
+ * math/w_acos.c: Likewise.
+ * math/w_acosf.c: Likewise.
+ * math/w_acosh.c: Likewise.
+ * math/w_acoshf.c: Likewise.
+ * math/w_acoshl.c: Likewise.
+ * math/w_acosl.c: Likewise.
+ * math/w_asin.c: Likewise.
+ * math/w_asinf.c: Likewise.
+ * math/w_asinl.c: Likewise.
+ * math/w_atan2.c: Likewise.
+ * math/w_atan2f.c: Likewise.
+ * math/w_atan2l.c: Likewise.
+ * math/w_atanh.c: Likewise.
+ * math/w_atanhf.c: Likewise.
+ * math/w_atanhl.c: Likewise.
+ * math/w_cosh.c: Likewise.
+ * math/w_coshf.c: Likewise.
+ * math/w_coshl.c: Likewise.
+ * math/w_dremf.c: Likewise.
+ * math/w_exp10.c: Likewise.
+ * math/w_exp10f.c: Likewise.
+ * math/w_exp10l.c: Likewise.
+ * math/w_exp2.c: Likewise.
+ * math/w_exp2f.c: Likewise.
+ * math/w_fmod.c: Likewise.
+ * math/w_fmodf.c: Likewise.
+ * math/w_fmodl.c: Likewise.
+ * math/w_hypot.c: Likewise.
+ * math/w_hypotf.c: Likewise.
+ * math/w_hypotl.c: Likewise.
+ * math/w_j0.c: Likewise.
+ * math/w_j0f.c: Likewise.
+ * math/w_j0l.c: Likewise.
+ * math/w_j1.c: Likewise.
+ * math/w_j1f.c: Likewise.
+ * math/w_j1l.c: Likewise.
+ * math/w_jn.c: Likewise.
+ * math/w_jnf.c: Likewise.
+ * math/w_jnl.c: Likewise.
+ * math/w_lgamma.c: Likewise.
+ * math/w_lgamma_r.c: Likewise.
+ * math/w_lgammaf.c: Likewise.
+ * math/w_lgammaf_r.c: Likewise.
+ * math/w_lgammal.c: Likewise.
+ * math/w_lgammal_r.c: Likewise.
+ * math/w_log.c: Likewise.
+ * math/w_log10.c: Likewise.
+ * math/w_log10f.c: Likewise.
+ * math/w_log10l.c: Likewise.
+ * math/w_log2.c: Likewise.
+ * math/w_log2f.c: Likewise.
+ * math/w_log2l.c: Likewise.
+ * math/w_logf.c: Likewise.
+ * math/w_logl.c: Likewise.
+ * math/w_pow.c: Likewise.
+ * math/w_powf.c: Likewise.
+ * math/w_powl.c: Likewise.
+ * math/w_remainder.c: Likewise.
+ * math/w_remainderf.c: Likewise.
+ * math/w_remainderl.c: Likewise.
+ * math/w_scalb.c: Likewise.
+ * math/w_scalbf.c: Likewise.
+ * math/w_scalbl.c: Likewise.
+ * math/w_sinh.c: Likewise.
+ * math/w_sinhf.c: Likewise.
+ * math/w_sinhl.c: Likewise.
+ * math/w_sqrt.c: Likewise.
+ * math/w_sqrtf.c: Likewise.
+ * math/w_sqrtl.c: Likewise.
+ * math/w_tgamma.c: Likewise.
+ * math/w_tgammaf.c: Likewise.
+ * math/w_tgammal.c: Likewise.
+
+ * po/ja.po: Update from translation team.
+
+2011-09-29 Andreas Jaeger <aj@suse.de>
+
+ [BZ #13179]
+ * sunrpc/netname.c (netname2host): Fix logic.
+
+ [BZ #6779]
+ [BZ #6783]
+ * math/w_remainderl.c (__remainderl): Handle (NaN, 0) and (Inf,y)
+ correctly.
+ * math/w_remainder.c (__remainder): Likewise.
+ * math/w_remainderf.c (__remainderf): Likewise.
+ * math/libm-test.inc (remainder_test): Add test cases.
+
+2011-10-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * stdlib/longlong.h: Update from GCC. Fix zarch smul_ppmm and
+ sdiv_qrnnd.
+
+2011-10-07 Ulrich Drepper <drepper@gmail.com>
+
+ * string/test-memcmp.c: Avoid unncessary #defines.
+ Patch by Liubov Dmitrieva <liubov.dmitrieva@gmail.com>.
+
+2011-08-31 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * sysdeps/x86_64/multiarch/rawmemchr.S: Update.
+ Use new sse2 version for core i3 - i7 as it's faster
+ than sse42 version.
+ (bit_Prefer_PMINUB_for_stringop): New.
+ * sysdeps/x86_64/rawmemchr.S: Update.
+ Replace with faster SSE2 version.
+ * sysdeps/x86_64/memrchr.S: New file.
+ * sysdeps/x86_64/memchr.S: Update.
+ Replace with faster SSE2 version.
+
+2011-09-12 Marek Polacek <mpolacek@redhat.com>
+
+ * elf/dl-load.c (lose): Add cast to avoid warning.
+
+2011-10-07 Ulrich Drepper <drepper@gmail.com>
+
+ * po/ca.po: Update from translation team.
+
+ * inet/getnetgrent_r.c: Hook up nscd.
+ * nscd/Makefile (routines): Add nscd_netgroup.
+ (nscd-modules): Add netgroupcache.
+ (CFLAGS-netgroupcache.c): Define.
+ * nscd/cache.c (readdfcts): Add entries for GETNETGRENT and INNETGR.
+ (cache_search): Add const to second parameter.
+ * nscd/connections.c (serv2str): Add entries for GETNETGRENT and
+ INNETGR.
+ (dbs): Add netgrdb entry.
+ (reqinfo): Add entries for GETNETGRENT, INNETGR, and GETFDNETGR.
+ (verify_persistent_db): Handle netgrdb.
+ (handle_request): Handle GETNETGRENT, INNETGR, and GETFDNETGR.
+ * nscd/nscd-client.h (request_type): Add GETNETGRENT, INNETGR, and
+ GETFDNETGR.
+ (netgroup_response_header): Define.
+ (innetgroup_response_header): Define.
+ (datahead): Add netgroup_response_header and innetgroup_response_header
+ elements.
+ * nscd/nscd.conf: Add entries for netgroup cache.
+ * nscd/nscd.h (dbtype): Add netgrdb.
+ (_PATH_NSCD_NETGROUP_DB): Define.
+ (netgroup_iov_disabled): Declare.
+ (xmalloc, xcalloc, xrealloc): Move declarations here.
+ (cache_search): Adjust prototype.
+ Add netgroup-related prototypes.
+ * nscd/nscd_conf.c (dbnames): Add netgrdb entry.
+ * nscd/nscd_proto.h (__nss_not_use_nscd_netgroup): Declare.
+ (__nscd_innetgr): Declare.
+ * nscd/selinux.c (perms): Use access_vector_t as element type and
+ add netgroup-related initializers.
+ * nscd/netgroupcache.c: New file.
+ * nscd/nscd_netgroup.c: New file.
+ * nss/Versions [libc] (GLIBC_PRIVATE): Export __nss_lookup.
+ * nss/getent.c (netgroup_keys): Use setnetgrent only for one parameter.
+ For four parameters use innetgr.
+ * nss/nss_files/files-init.c: Add definition and callback for netgr.
+ * nss/nsswitch.c (__nss_lookup): Add libc_hidden_def.
+ (__nss_disable_nscd): Set __nss_not_use_nscd_netgroup.
+ * nss/nsswitch.h (__nss_lookup): Add libc_hidden_proto.
+
+ * nscd/connections.c (register_traced_file): Don't register file
+ for disabled databases.
+
+2011-10-06 Ulrich Drepper <drepper@gmail.com>
+
+ * nscd/grpcache.c (cache_addgr): Initialize written in all cases.
+
+ * nss/nsswitch.c (__nss_lookup_function): Fix order of deleting
+ from tree and freeing node.
+
+2011-09-25 Jiri Olsa <jolsa@redhat.com>
+
+ * nss/nsswitch.c (__nss_database_lookup): Handle
+ nss_parse_service_list out of memory case.
+
+2011-09-15 Jiri Olsa <jolsa@redhat.com>
+
+ * nss/nsswitch.c (__nss_lookup_function): Handle __tsearch
+ out of memory case.
+
+2011-10-04 Andreas Schwab <schwab@redhat.com>
+
+ * include/dlfcn.h (__RTLD_NOIFUNC): Define.
+ * elf/do-rel.h (elf_dynamic_do_rel): Add parameter skip_ifunc and
+ pass it down.
+ * elf/dynamic-link.h: Adjust prototypes of elf_machine_rel,
+ elf_machine_rela, elf_machine_lazy_rel.
+ (_ELF_DYNAMIC_DO_RELOC): Add parameter skip_ifunc and pass it down.
+ (ELF_DYNAMIC_DO_REL): Likewise.
+ (ELF_DYNAMIC_DO_RELA): Likewise.
+ (ELF_DYNAMIC_RELOCATE): Likewise.
+ * elf/dl-reloc.c (_dl_relocate_object): Pass __RTLD_NOIFUNC down
+ to ELF_DYNAMIC_DO_REL.
+ * elf/rtld.c (_dl_start): Adjust use of ELF_DYNAMIC_RELOCATE.
+ (dl_main): In trace mode always set __RTLD_NOIFUNC.
+ * elf/dl-conflict.c (_dl_resolve_conflicts): Adjust call to
+ elf_machine_rela.
+ * sysdeps/i386/dl-machine.h (elf_machine_rel): Add parameter
+ skip_ifunc, don't call ifunc function if non-zero.
+ (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ (elf_machine_lazy_rela): Likewise.
+ * sysdeps/ia64/dl-machine.h (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela):
+ Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela):
+ Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+ * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
+ (elf_machine_lazy_rel): Likewise.
+
+2011-09-28 Ulrich Drepper <drepper@gmail.com>
+
+ * nss/nss_files/files-init.c (_nss_files_init): Use static
+ initialization for all the *_traced_file variables.
+
+2011-09-28 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Adjust ULPs for jn tests.
+
+2011-09-27 Roland McGrath <roland@hack.frob.com>
+
+ [BZ #13226]
+ * manual/signal.texi (Longjmp in Handler): Grammar fixes.
+
+2011-09-27 Andreas Schwab <schwab@redhat.com>
+
+ * nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn):
+ Reread the line before reparsing it.
+
+2011-09-26 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Use __asm instead of asm.
+
+2011-09-21 Chung-Lin Tang <cltang@codesourcery.com>
+ Maxim Kuvyrkov <maxim@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * resolv/Makefile (LDLIBS-resolv.so): Link in $(elfobjdir)/ld.so
+ if needed for __stack_chk_guard.
+
+2011-09-19 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/posix/spawni.c (script_execute): Always define it.
+ It will be optimized away if unused.
+ (maybe_script_execute): New function.
+ (__spawni): Call it.
+
+ * Makerules: Don't include tls.make.
+ (config-tls): Always set to thread.
+ * tls.make.c: File removed.
+
+2011-09-19 Mike Frysinger <vapier@gentoo.org>
+
+ * Makeconfig (CPPFLAGS): Prepend $(CPPFLAGS-config).
+ * config.make.in (CPPFLAGS-config): New substituted variable.
+
+2011-09-15 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c: New file.
+
+ [BZ #13192]
+ * sysdeps/unix/sysv/linux/bits/in.h (IP_MULTICAST_ALL): Define.
+ Patch mostly by Neil Horman <nhorman@tuxdriver.com>.
+
+2011-09-15 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
+ (CALL_FAIL): Use HIDDEN_JUMPTARGET for __fortify_fail.
+ * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+ (CALL_FAIL): Likewise.
+ * sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S (CHECK_RSP): Likewise.
+ (CALL_FAIL): Macro removed.
+ Patch mostly by Mike Frysinger <vapier@gentoo.org>.
+
+2011-09-15 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h: Add fmax and fmin optimizations
+ for __FINITE_MATH_ONLY__ == 1.
+
+2011-09-15 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/powerpc/fpu/e_hypot.c (__ieee754_hypot): Use
+ __ieee754_sqrt instead of sqrt.
+ * sysdeps/powerpc/fpu/e_hypotf.c (__ieee754_hypotf): Use
+ __ieee754_sqrtf instead of sqrtf.
+ * sysdeps/powerpc/fpu/e_rem_pio2f.c (__ieee754_rem_pio2f): Use
+ __floorf instead of floorf.
+ * sysdeps/powerpc/fpu/k_rem_pio2f.c (__fp_kernel_rem_pio2f): Use
+ __floorf, __truncf instead of floorf, truncf.
+
+2011-09-14 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/x86_64/fpu/s_copysign.S [ELF]: Use correct section.
+
+ * sysdeps/x86_64/fpu/bits/mathinline.h (__MATH_INLINE): Use
+ __extern_always_inline.
+ Define lrint{f,} and llrint{f,} for 64-bit and in some situations for
+ 32-bit.
+
+2011-09-14 Andreas Schwab <schwab@redhat.com>
+
+ * elf/rtld.c (dl_main): Also relocate in dependency order when
+ doing symbol dependency testing.
+
+2011-09-13 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela):
+ Always define `refsym'.
+
+2011-09-13 Andreas Schwab <schwab@redhat.com>
+
+ * misc/sys/select.h (__FD_MASK): Renamed from __FDMASK.
+ (__FD_ELT): Renamed from __FDELT.
+ * misc/bits/select2.h (__FD_ELT): Likewise.
+ * bits/select.h (__FD_SET, __FD_CLR, __FD_ISSET): Use __FD_ELT,
+ __FD_MASK instead of __FDELT, __FDMASK.
+ * sysdeps/i386/bits/select.h (__FD_SET, __FD_CLR, __FD_ISSET):
+ Likewise.
+ * sysdeps/x86_64/bits/select.h (__FD_SET, __FD_CLR, __FD_ISSET):
+ Likewise.
+
+ * elf/Makefile (gen-ldd): Fix pattern.
+
+ * elf/rtld.c (dl_main): Only use USE___THREAD when defined.
+ (init_tls): Likewise.
+
+2011-09-12 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c: New file.
+
+2011-09-12 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Cast to
+ `struct cmsghdr *' instead of `void *'.
+ * sysdeps/unix/sysv/linux/sparc/bits/socket.h (__cmsg_nxthdr):
+ Likewise.
+
+2011-09-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * elf/Makefile (gen-ldd): Prepend $(..) to $(ldd-rewrite-script)
+ if non-absolute.
+ * sysdeps/unix/sysv/linux/configure.in: Remove leading ../ from
+ ldd_rewrite_script.
+
+2011-09-11 Ulrich Drepper <drepper@gmail.com>
+
+ * configure.in: Remove --with-tls option.
+ * config.h.in: Remove HAVE_TLS_SUPPORT entry.
+ * sysdeps/i386/elf/configure.in: Always test for TLS support and err
+ out in case it is missing.
+ * sysdeps/ia64/elf/configure.in: Likewise.
+ * sysdeps/powerpc/powerpc32/elf/configure.in: Likewise.
+ * sysdeps/powerpc/powerpc64/elf/configure.in: Likewise.
+ * sysdeps/s390/s390-32/elf/configure.in: Likewise.
+ * sysdeps/s390/s390-64/elf/configure.in: Likewise.
+ * sysdeps/sh/elf/configure.in: Likewise.
+ * sysdeps/sparc/sparc32/elf/configure.in: Likewise.
+ * sysdeps/sparc/sparc64/elf/configure.in: Likewise.
+ * sysdeps/x86_64/elf/configure.in: Likewise.
+ * sysdeps/mach/hurd/i386/tls.h: Remove test for HAVE_TLS_SUPPORT.
+ * sysdeps/mach/hurd/tls.h: Likewise.
+
+ [BZ #13067]
+ * malloc/obstack.h [!GNUC] (obstack_free): Avoid cast to int.
+
+ [BZ #13090]
+ * configure.in: Fix use of AC_INIT.
+
+ * elf/dl-support.c (_dl_pagesize): Initialize to EXEC_PAGESIZE.
+
+2011-09-10 Ulrich Drepper <drepper@gmail.com>
+
+ * malloc/malloc.c: Replace MALLOC_FAILURE_ACTION with use of
+ __set_errno.
+ * malloc/hooks.c: Likewise.
+
+ * malloc/arena.c (ptmalloc_init_minimal): Removed. Initialize all
+ variables statically.
+ (narenas): Initialize.
+ (list_lock): Initialize.
+ (ptmalloc_init): Don't call ptmalloc_init_minimal. Remove
+ initializtion of main_arena and list_lock. Small cleanups.
+ Replace all uses of malloc_getpagesize with GLRO(dl_pagesize).
+ * malloc/malloc.c: Remove malloc_getpagesize. Include <ldsodefs.h>.
+ Add initializers to main_arena and mp_.
+ (malloc_state): Remove pagesize member. Change all users to use
+ GLRO(dl_pagesize).
+
+ * elf/rtld.c (rtld_global_ro): Initialize _dl_pagesize.
+ * sysdeps/unix/sysv/linux/getpagesize.c: Simplify. GLRO(dl_pagesize)
+ is always initialized.
+
+ * malloc/malloc.c: Removed unused configurations and dead code.
+ * malloc/arena.c: Likewise.
+ * malloc/hooks.c: Likewise.
+ * malloc/Makefile (CPPFLAGS-malloc.c): Don't add -DATOMIC_FASTBINS.
+
+ * include/tls.h: Removed. USE___THREAD must always be defined.
+ * bits/libc-tsd.h: Don't handle !USE___THREAD.
+ * elf/dl-libc.c: Likewise.
+ * elf/dl-tsd.c: Likewise.
+ * include/errno.h: Likewise.
+ * include/netdb.h: Likewise.
+ * include/resolv.h: Likewise.
+ * inet/herrno-loc.c: Likewise.
+ * inet/herrno.c: Likewise.
+ * malloc/arena.c: Likewise.
+ * malloc/hooks.c: Likewise.
+ * malloc/malloc.c: Likewise.
+ * resolv/res-state.c: Likewise.
+ * resolv/res_libc.c: Likewise.
+ * sysdeps/i386/dl-machine.h: Likewise.
+ * sysdeps/ia64/dl-machine.h: Likewise.
+ * sysdeps/powerpc/powerpc32/dl-machine.h: Likewise.
+ * sysdeps/powerpc/powerpc64/dl-machine.h: Likewise.
+ * sysdeps/s390/s390-32/dl-machine.h: Likewise.
+ * sysdeps/s390/s390-64/dl-machine.h: Likewise.
+ * sysdeps/sh/dl-machine.h: Likewise.
+ * sysdeps/sparc/sparc32/dl-machine.h: Likewise.
+ * sysdeps/sparc/sparc64/dl-machine.h: Likewise.
+ * sysdeps/unix/i386/sysdep.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
+ * sysdeps/unix/x86_64/sysdep.S: Likewise.
+ * sysdeps/x86_64/dl-machine.h: Likewise.
+ * tls.make.c: Likewise.
+
+ * configure.in: Remove --with-__thread option. Make tests for
+ --no-whole-archive, __builtin_expect, symbol redirection, __thread,
+ tls_model attribute fail if no support is available. Remove
+ USE_IN_LIBIO.
+ * Makeconfig: Adjust for dropped configure option. All features are
+ now mandatory.
+ * Makerules: Likewise.
+ * Versions.def: Likewise.
+ * argp/argp-fmtstream.c: Likewise.
+ * argp/argp-fmtstream.h: Likewise.
+ * argp/argp-help.c: Likewise.
+ * assert/assert.c: Likewise.
+ * config.h.in: Likewise.
+ * config.make.in: Likewise.
+ * configure: Likewise.
+ * configure.in: Likewise.
+ * csu/Versions: Likewise.
+ * csu/init.c: Likewise.
+ * elf/tst-audit2.c: Likewise.
+ * elf/tst-tls10.c: Likewise.
+ * elf/tst-tls10.h: Likewise.
+ * elf/tst-tls11.c: Likewise.
+ * elf/tst-tls12.c: Likewise.
+ * elf/tst-tls14.c: Likewise.
+ * elf/tst-tlsmod11.c: Likewise.
+ * elf/tst-tlsmod12.c: Likewise.
+ * elf/tst-tlsmod13.c: Likewise.
+ * elf/tst-tlsmod13a.c: Likewise.
+ * elf/tst-tlsmod14a.c: Likewise.
+ * elf/tst-tlsmod15b.c: Likewise.
+ * elf/tst-tlsmod16a.c: Likewise.
+ * elf/tst-tlsmod16b.c: Likewise.
+ * elf/tst-tlsmod7.c: Likewise.
+ * elf/tst-tlsmod8.c: Likewise.
+ * elf/tst-tlsmod9.c: Likewise.
+ * gmon/gmon.c: Likewise.
+ * grp/fgetgrent_r.c: Likewise.
+ * grp/putgrent.c: Likewise.
+ * hurd/fopenport.c: Likewise.
+ * include/libc-symbols.h: Likewise.
+ * include/tls.h: Likewise.
+ * intl/gettextP.h: Likewise.
+ * intl/loadinfo.h: Likewise.
+ * locale/global-locale.c: Likewise.
+ * locale/localeinfo.h: Likewise.
+ * mach/devstream.c: Likewise.
+ * malloc/arena.c: Likewise.
+ * malloc/set-freeres.c: Likewise.
+ * misc/err.c: Likewise.
+ * misc/getttyent.c: Likewise.
+ * misc/mntent_r.c: Likewise.
+ * posix/getopt.c: Likewise.
+ * posix/wordexp.c: Likewise.
+ * pwd/fgetpwent_r.c: Likewise.
+ * resolv/Versions: Likewise.
+ * resolv/res_hconf.c: Likewise.
+ * shadow/fgetspent_r.c: Likewise.
+ * shadow/putspent.c: Likewise.
+ * stdio-common/printf_fphex.c: Likewise.
+ * stdio-common/tmpfile.c: Likewise.
+ * stdlib/abort.c: Likewise.
+ * stdlib/fmtmsg.c: Likewise.
+ * sunrpc/auth_unix.c: Likewise.
+ * sunrpc/clnt_perr.c: Likewise.
+ * sunrpc/clnt_tcp.c: Likewise.
+ * sunrpc/clnt_udp.c: Likewise.
+ * sunrpc/clnt_unix.c: Likewise.
+ * sunrpc/openchild.c: Likewise.
+ * sunrpc/svc_simple.c: Likewise.
+ * sunrpc/svc_tcp.c: Likewise.
+ * sunrpc/svc_udp.c: Likewise.
+ * sunrpc/svc_unix.c: Likewise.
+ * sunrpc/xdr.c: Likewise.
+ * sunrpc/xdr_array.c: Likewise.
+ * sunrpc/xdr_rec.c: Likewise.
+ * sunrpc/xdr_ref.c: Likewise.
+ * sunrpc/xdr_stdio.c: Likewise.
+
+2011-09-09 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/i386/fpu/libm-test-ulps: Adjust ULPs for jn tests.
+
+2011-07-03 Andreas Jaeger <aj@suse.de>
+
+ * math/libm-test.inc (jn_test): Add tests for BZ#11589.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Add new ULPs for jn_test,
+ regenerate with gen-libm-tests.pl.
+
+2010-05-12 Petr Baudis <pasky@suse.cz>
+
+ [BZ #11589]
+ * sysdeps/ieee754/dbl-64/e_jn.c: Compensate major precision loss
+ around j0() zero points by switching to j1().
+ * sysdeps/ieee754/flt-32/e_jnf.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
+
+2011-09-09 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/unix/bsd/bsd4.4/bits/socket.h (__cmsg_nxthdr): Use NULL
+ instead of 0.
+ * sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Use (void*)0
+ instead of 0. .
+ * sysdeps/unix/sysv/linux/sparc/bits/socket.h: Likewise.
+ Patch in part by Pavel Roskin <proski@gnu.org>.
+
+ [BZ #13138]
+ * stdio-common/vfscanf.c (ADDW): Allocate large memory block with
+ realloc.
+ (_IO_vfscanf_internal): Remove reteof. Use errout after setting done.
+ Free memory block if necessary.
+
+ [BZ #12847]
+ * libio/genops.c (INTDEF): For string streams the _lock pointer can
+ be NULL. Don't lock in this case.
+
+2011-09-09 Roland McGrath <roland@hack.frob.com>
+
+ * elf/elf.h (ELFOSABI_GNU): New macro.
+ (ELFOSABI_LINUX): Define to that.
+
+2011-07-29 Denis Zaitceff <zaitceff@gmail.com>
+
+ * string/strncat.c (strncat): Undef the symbol in case it has been
+ defined in bits/string.h.
+
+2011-09-09 Ulrich Drepper <drepper@gmail.com>
+
+ * elf/sotruss.ksh: Clean up, fix, and complete help messages.
+
+ * elf/dl-iteratephdr.c (__dl_iterate_phdr): Fill in data from the real
+ link map.
+
+2011-08-17 Andreas Jaeger <aj@suse.de>
+
+ * elf/sprof.c (load_shobj): Remove unused variable log_hashfraction.
+
+2011-08-18 Paul Pluzhnikov <ppluzhnikov@google.com>
+ Ian Lance Taylor <iant@google.com>
+
+ * math/libm-test.inc (lround_test): New testcase.
+ * sysdeps/ieee754/dbl-64/s_lround.c (__lround): Don't lose precision.
+
+2011-09-08 Ulrich Drepper <drepper@gmail.com>
+
+ * Makefile: Remove support for automatic cvs check-ins.
+ * Makerules: Likewise.
+ * config.make.in: Likewise.
+ * configure.in: Likewise.
+ * intl/Makefile: Likewise.
+ * locale/Makefile: Likewise.
+ * po/Makefile: Likewise.
+ * posix/Makefile: Likewise.
+ * sysdeps/gnu/Makefile: Likewise.
+ * sysdeps/mach/hurd/Makefile: Likewise.
+ * sysdeps/sparc/sparc32/Makefile: Likewise.
+
+ [BZ #13118]
+ * posix/Makefile (bug-regex32-ENV): Define.
+ Patch by John Stanley <jpsinthemix@verizon.net>.
+
+ * misc/Makefile (headers): Add bits/select2.h.
+ * misc/sys/select.h: Include bits/select2.h for _FORTIFY_SOURCE.
+ * misc/bits/select2.h: New file.
+ * include/bits/select2.h: New file.
+ * debug/Makefile (routines): Add fdelt_chk.
+ * debug/Versions: Export __fdelt_chk and __fdelt_warn for GLIBC_2.15.
+ * debug/tst-chk1.c (do_test): Add tests for FD_SET, FD_CLR, and
+ FD_ISSET.
+ * debug/fdelt_chk.c: New file.
+
+ * wcsmbs/test-wcscmp.c: Moved from string/*. Adjust.
+ * wcsmbs/test-wmemcmp.c: Likewise.
+ * string/Makefile (strop-tests): Remove wcscmp and wmemcmp.
+ * wcsmbs/Makefile (strop-tests): Add wcscmp and wmemcmp.
+
+2011-09-08 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
+
+ * string/Makefile (strop-tests): Add memcmp.
+ * string/test-wmemcmp.c: New file.
+ * string/test-memcmp.c: Add wmemcmp support.
+
+2011-09-08 Roland McGrath <roland@hack.frob.com>
+
+ [BZ #13153]
+ * manual/libc.texinfo (EDITION, VERSION, UPDATED): Update for
+ 2011-07-19 change.
+
+ * sysdeps/mach/hurd/fork.c (__fork): Initialize REFS so we don't use a
+ garbage value in a __mach_port_mod_refs call in the cases of the
+ task-self and thread-self ports.
+
+2011-09-06 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * sysdeps/mach/hurd/sys/param.h (DEV_BSIZE): New macro.
+
+2011-09-08 Andreas Schwab <schwab@redhat.com>
+
+ * elf/dl-load.c (lose): Check for non-null L.
+
+2011-09-07 Ulrich Drepper <drepper@gmail.com>
+
+ * elf/dl-load.c (open_verify): Use O_CLOEXEC.
+
+ * elf/dl-libc.c (dlerror_run): Pass back error code from
+ dl_catch_error.
+
+ [BZ #13123]
+ * elf/dl-load.c (lose): Free l_origin if it is valid.
+
+ * sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Fix mixup in section
+ names.
+ * sysdeps/i386/i686/multiarch/strchr-sse2.S: Likewise.
+ * sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Likewise.
+ * sysdeps/i386/i686/multiarch/strlen-sse2.S: Likewise.
+ * sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: Likewise.
+ * sysdeps/i386/i686/multiarch/strrchr-sse2.S: Likewise.
+ Patch by Liubov Dmitrieva <liubov.dmitrieva@intel.com>.
+
+2011-08-01 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/fpu/e_hypot.c: New file.
+ * sysdeps/powerpc/fpu/e_hypotf.c: New file.
+ * sysdeps/powerpc/fpu/e_rem_pio2f.c: New file.
+ * sysdeps/powerpc/fpu/k_rem_pio2f.c: New file.
+ * sysdeps/powerpc/fpu/k_cosf.c: New file.
+ * sysdeps/powerpc/fpu/k_sinf.c: New file.
+ * sysdeps/powerpc/fpu/s_cosf.c: New file.
+ * sysdeps/powerpc/fpu/s_sinf.c: New file.
+ * sysdeps/powerpc/fpu/s_scalbnf.c: New file.
+ * sysdeps/powerpc/fpu/s_float_bitwise.h: New file.
+
+2011-08-15 Alan Modra <amodra@gmail.com>
+
+ [BZ #13092]
+ * sysdeps/powerpc/Makefile (gmon): Move sysdep_routines to..
+ * sysdeps/powerpc/powerpc64/Makefile (gmon): ..here..
+ * sysdeps/powerpc/powerpc32/Makefile (gmon): ..and here. Add
+ ppc_mcount to static-only-routines.
+ * sysdeps/powerpc/powerpc32/Versions: Export GLIBC_PRIVATE
+ __mcount_internal.
+ * sysdeps/powerpc/powerpc32/ppc-mcount.S (_mcount): Call
+ __mcount_internal with usual JUMPTARGET. Remove useless nop.
+
+2011-08-18 David Flaherty <flaherty@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128ibm/s_fmal.c: New file which checks
+ for finite and infinity parameters.
+
+2011-08-04 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power7/strncmp.S: Adjust the alignment
+ and add nop instructions for throughput optimization.
+ * sysdeps/powerpc/powerpc64/power7/strncmp.S: Likewise.
+
+2011-07-28 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ * sysdeps/powerpc/powerpc32/power7/memcpy.S: Optimize the
+ aligned copy for power7 with vector-scalar instructions.
+ * sysdeps/powerpc/powerpc64/power7/memcpy.S: Likewise.
+
+2011-07-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Simplify
+ AVX check.
+
+2011-09-07 Andreas Schwab <schwab@redhat.com>
+
+ [BZ #13144]
+ * sysdeps/unix/sysv/linux/x86_64/bits/sem.h (semdid_ds): Revert
+ last change.
+
+2011-09-07 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/init-first.c
+ (_libc_vdso_platform_setup): If vDSO is not present store pointer to
+ syscall wrapper around clock_gettime in __vdso_clock_gettime.
+ * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add entry for
+ clock_gettime.
+
+2011-09-06 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/clock_gettime.c (INTERNAL_GETTIME):
+ Forgot to demangle the pointer.
+
+ * sysdeps/i386/sysdep.h: Define atom_text_section.
+ * sysdeps/x86_64/sysdep.h: Likewise.
+ * sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Place function in
+ section with atom_text_section.
+ * sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Likewise.
+ * sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: Likewise.
+ * sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: Likewise.
+ * sysdeps/x86_64/multiarch/strlen-no-bsf.S: Likewise.
+ * sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S: Likewise.
+
+ * sysdeps/unix/sysv/linux/x86_64/clock_gettime.c: New file.
+ * sysdeps/unix/sysv/linux/clock_gettime.c (SYSCALL_GETTIME): Allow
+ already be defined. Change to take two parameters and don't assign
+ result to variable. Adjust all users.
+ Define INTERNAL_GETTIME if not already defined.
+ Use INTERNAL_GETTIME instead of INTERNAL_VSYSCALL got clock_gettime
+ call.
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Don't define
+ HAVE_CLOCK_GETTIME_VSYSCALL.
+ * sysdeps/unix/clock_gettime.c: Adjust use of SYSDEP_GETTIME_CPU.
+
+ * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Don't use
+ gettimeofday vsyscall, just use time.
+
2011-09-06 Andreas Schwab <schwab@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c [!SHARED]: Include
diff --git a/libc/Makeconfig b/libc/Makeconfig
index 4ff8cbe40..a75ae7f50 100644
--- a/libc/Makeconfig
+++ b/libc/Makeconfig
@@ -407,6 +407,10 @@ as-needed :=
no-as-needed :=
endif
+# Must be supported by the linker.
+no-whole-archive = -Wl,--no-whole-archive
+whole-archive = -Wl,--whole-archive
+
# Installed name of the startup code.
ifneq ($(have-initfini),yes)
# When not having init/fini, there is just one startfile, called crt0.o.
@@ -707,7 +711,7 @@ libio-include = -I$(..)libio
# Note that we can't use -std=* in CPPFLAGS, because it overrides
# the implicit -lang-asm and breaks cpp behavior for .S files--notably
# it causes cpp to stop predefining __ASSEMBLER__.
-CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
+CPPFLAGS = $(CPPFLAGS-config) $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
-include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
$(CPPFLAGS-$(suffix $@)) \
$(foreach lib,$(libof-$(basename $(@F))) \
diff --git a/libc/Makefile b/libc/Makefile
index c438e1313..9b8501428 100644
--- a/libc/Makefile
+++ b/libc/Makefile
@@ -33,20 +33,11 @@ all: lib others
ifneq ($(AUTOCONF),no)
-ifeq ($(with-cvs),yes)
-define autoconf-it-cvs
-test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated: autoconf $(ACFLAGS) $<' $@
-endef
-else
-autoconf-it-cvs =
-endif
-
define autoconf-it
@-rm -f $@.new
$(AUTOCONF) $(ACFLAGS) $< > $@.new
chmod a-w$(patsubst %,$(comma)a+x,$(filter .,$(@D))) $@.new
mv -f $@.new $@
-$(autoconf-it-cvs)
endef
configure: configure.in aclocal.m4; $(autoconf-it)
@@ -434,9 +425,6 @@ manual/dir-add.texi manual/dir-add.info: FORCE
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
FAQ: scripts/gen-FAQ.pl FAQ.in
$(PERL) $^ > $@.new && rm -f $@ && mv $@.new $@ && chmod a-w $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -m'Regenerated: $(PERL) $^' $@
-endif
FORCE:
iconvdata/% localedata/% po/% manual/%: FORCE
diff --git a/libc/Makerules b/libc/Makerules
index 58047249d..554f4b649 100644
--- a/libc/Makerules
+++ b/libc/Makerules
@@ -618,7 +618,6 @@ endif
build-module-helper-objlist = \
$(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\
$(filter-out %.lds $(map-file) $(+preinit) $(+postinit),$^))
-whole-archive := -Wl,--whole-archive
build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so)
build-shlib-objlist = $(build-module-helper-objlist) \
@@ -644,7 +643,7 @@ endif
ifeq ($(elf),yes)
$(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
- $(LDFLAGS-c_pic.os) -Wl,-d -Wl,--whole-archive $^ -o $@
+ $(LDFLAGS-c_pic.os) -Wl,-d $(whole-archive) $^ -o $@
ifeq (,$(strip $(shlib-lds-flags)))
# Generate a list of -R options to excise .gnu.glibc-stub.* sections.
@@ -1328,11 +1327,7 @@ check-abi-warn = || echo '*** WARNING: $*.so failed ABI check'
endif
ifeq ($(firstword $(sysd-sorted-done) f)$(firstword $(generating) f),tf)
--include $(common-objpfx)tls.make
-config-tls := tls
-ifeq ($(use-thread),yes)
config-tls := thread
-endif
check-abi-config := \
$(config-machine)-$(config-vendor)-$(config-os)/$(config-tls)
endif
@@ -1519,9 +1514,6 @@ $(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/%
# So I don't edit them by mistake.
chmod a-w $@-tmp
mv -f $@-tmp $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -m'Updated from $^' $@
-endif
endif
endif
diff --git a/libc/NEWS b/libc/NEWS
index 3eda9c195..e0bb0eff2 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes. 2011-9-5
+GNU C Library NEWS -- history of user-visible changes. 2011-10-20
Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -9,8 +9,9 @@ Version 2.15
* The following bugs are resolved with this release:
- 9696, 12868, 12852, 12874, 12885, 12907, 12922, 12935, 13007, 13021,
- 13068, 13114, 13134, 13144, 13150
+ 6779, 6783, 9696, 11589, 12403, 12847, 12868, 12852, 12874, 12885, 12892,
+ 12907, 12922, 12935, 13007, 13021, 13067, 13068, 13090, 13092, 13114,
+ 13118, 13123, 13134, 13138, 13150, 13179, 13192, 13268, 13291
* New program pldd to list loaded object of a process
Implemented by Ulrich Drepper.
@@ -25,15 +26,33 @@ Version 2.15
* Improved strcpy, strncpy, stpcpy, stpncpy for SSE2 and SSSE3 on x86-64.
Contributed by HJ Lu.
-* Optimized strcat and strncat on x86-64 and optimized wcscmp on x86-32 and
- x86-64.
+* Optimized strcat, strncat on x86-64 and optimized wcscmp, wcslen, strnlen
+ on x86-32 and x86-64.
Contributed by Liubov Dmitrieva.
-* Optimized strchrm strrchr for SSE on x86-32.
+* Optimized strchr and strrchr for SSE on x86-32.
+ Contributed by Liubov Dmitrieva.
+
+* Optimized memchr, memrchr, rawmemchr, memcmp, wmemcmp for x86-64 and x86-32.
Contributed by Liubov Dmitrieva.
* New interfaces: scandirat, scandirat64
Implemented by Ulrich Drepper.
+
+* Checking versions of FD_SET, FD_CLR, and FD_ISSET added.
+ Implemented by Ulrich Drepper.
+
+* nscd now also caches the netgroup database.
+ Implemented by Ulrich Drepper.
+
+* Integrate libm with gcc's -ffinite-math-only option.
+ Implemented by Ulrich Drepper.
+
+* Lots of generic, 64-bit, and x86-64-specific performance optimizations
+ to math functions. Implemented by Ulrich Drepper.
+
+* Optimized strcasecmp and strncasecmp for AVX on x86-64.
+ Implemented by Ulrich Drepper.
Version 2.14
diff --git a/libc/README b/libc/README
index 0ba128879..d2f61926a 100644
--- a/libc/README
+++ b/libc/README
@@ -122,4 +122,7 @@ This web page gives detailed information on how to report bugs properly.
The GNU C Library is free software. See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
-these additional notices to be distributed.
+these additional notices to be distributed. License copyright years may be
+listed using range notation, e.g., 2000-2011, indicating that every year in
+the range, inclusive, is a copyrightable year that would otherwise be listed
+individually.
diff --git a/libc/Versions.def b/libc/Versions.def
index 98c28001a..6b05e5ba5 100644
--- a/libc/Versions.def
+++ b/libc/Versions.def
@@ -32,9 +32,7 @@ libc {
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
-%ifdef USE_IN_LIBIO
HURD_CTHREADS_0.3
-%endif
%ifdef EXPORT_UNWIND_FIND_FDE
GCC_3.0
%endif
@@ -56,6 +54,7 @@ libm {
GLIBC_2.2.3
GLIBC_2.3.4
GLIBC_2.4
+ GLIBC_2.15
}
libnsl {
GLIBC_2.0
diff --git a/libc/argp/argp-fmtstream.c b/libc/argp/argp-fmtstream.c
index c4714ffb7..22bfc4ea7 100644
--- a/libc/argp/argp-fmtstream.c
+++ b/libc/argp/argp-fmtstream.c
@@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams
- Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc.
+ Copyright (C) 1997-1999,2001-2003,2005,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -40,7 +40,7 @@
#define isblank(ch) ((ch)==' ' || (ch)=='\t')
#endif
-#if defined _LIBC && defined USE_IN_LIBIO
+#ifdef _LIBC
# include <wchar.h>
# include <libio/libioP.h>
# include <gnu/option-groups.h>
@@ -102,11 +102,7 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
__argp_fmtstream_update (fs);
if (fs->p > fs->buf)
{
-#ifdef USE_IN_LIBIO
__fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
-#else
- fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
-#endif
}
free (fs->buf);
free (fs);
@@ -151,7 +147,6 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
size_t i;
for (i = 0; i < pad; i++)
{
-#ifdef USE_IN_LIBIO
if (_IO_fwide (fs->stream, 0) > 0)
{
#if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
@@ -161,7 +156,6 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
#endif
}
else
-#endif
putc_unlocked (' ', fs->stream);
}
}
@@ -322,7 +316,6 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
*nl++ = ' ';
else
for (i = 0; i < fs->wmargin; ++i)
-#ifdef USE_IN_LIBIO
if (_IO_fwide (fs->stream, 0) > 0)
{
#ifdef OPTION_POSIX_WIDE_CHAR_DEVICE_IO
@@ -332,7 +325,6 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
#endif
}
else
-#endif
putc_unlocked (' ', fs->stream);
/* Copy the tail of the original buffer into the current buffer
diff --git a/libc/argp/argp-fmtstream.h b/libc/argp/argp-fmtstream.h
index f94207a20..aa8842132 100644
--- a/libc/argp/argp-fmtstream.h
+++ b/libc/argp/argp-fmtstream.h
@@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -43,8 +43,7 @@
# endif
#endif
-#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
- || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H))
+#if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
/* line_wrap_stream is available, so use that. */
#define ARGP_FMTSTREAM_USE_LINEWRAP
#endif
diff --git a/libc/argp/argp-help.c b/libc/argp/argp-help.c
index 874c6afa3..7004a2e54 100644
--- a/libc/argp/argp-help.c
+++ b/libc/argp/argp-help.c
@@ -1,6 +1,5 @@
/* Hierarchial argument parsing help output
- Copyright (C) 1995-2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -313,13 +312,13 @@ fill_in_uparams (const struct argp_state *state)
{"no-parent", 'P', 0, 0, "Include processes without parents"},
{0, 'x', 0, OPTION_ALIAS},
{"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally"
- " if there's some reason ps can't"
+ " if there's some reason ps can't"
" print a field for any process, it's"
- " removed from the output entirely)" },
+ " removed from the output entirely)" },
{"reverse", 'r', 0, 0, "Reverse the order of any sort"},
{"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
{"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL,
- "Add the processes from the session"
+ "Add the processes from the session"
" SID (which defaults to the sid of"
" the current process)" },
@@ -1875,7 +1874,6 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
#endif
}
-#ifdef USE_IN_LIBIO
if (_IO_fwide (stream, 0) > 0)
{
#if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
@@ -1885,7 +1883,6 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
#endif
}
else
-#endif
putc_unlocked ('\n', stream);
#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
diff --git a/libc/assert/assert.c b/libc/assert/assert.c
index 803015f0f..40fedb72e 100644
--- a/libc/assert/assert.c
+++ b/libc/assert/assert.c
@@ -30,11 +30,9 @@
extern const char *__progname;
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
-#endif
+#include <wchar.h>
+#include <libio/iolibio.h>
+#define fflush(s) INTUSE(_IO_fflush) (s)
/* This function, when passed a string containing an asserted
expression, a filename, and a line number, prints a message
diff --git a/libc/bits/libc-tsd.h b/libc/bits/libc-tsd.h
index 1a24b701b..d1118a5ba 100644
--- a/libc/bits/libc-tsd.h
+++ b/libc/bits/libc-tsd.h
@@ -1,5 +1,5 @@
/* libc-internal interface for thread-specific data. Stub or TLS version.
- Copyright (C) 1998,2001,2002,2008 Free Software Foundation, Inc.
+ Copyright (C) 1998,2001,2002,2008,2011 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
@@ -24,12 +24,12 @@
set of thread-specific `void *' data used only internally by libc.
__libc_tsd_define(CLASS, TYPE, KEY) -- Define or declare a datum with TYPE
- for KEY. CLASS can be `static' for
+ for KEY. CLASS can be `static' for
keys used in only one source file,
empty for global definitions, or
`extern' for global declarations.
__libc_tsd_address(TYPE, KEY) -- Return the `TYPE *' pointing to
- the current thread's datum for KEY.
+ the current thread's datum for KEY.
__libc_tsd_get(TYPE, KEY) -- Return the `TYPE' datum for KEY.
__libc_tsd_set(TYPE, KEY, VALUE) -- Set the datum for KEY to VALUE.
@@ -51,20 +51,11 @@
We don't define an enum for the possible key values, because the KEYs
translate directly into variables by macro magic. */
-#if USE___THREAD
-# define __libc_tsd_define(CLASS, TYPE, KEY) \
+#define __libc_tsd_define(CLASS, TYPE, KEY) \
CLASS __thread TYPE __libc_tsd_##KEY attribute_tls_model_ie;
-# define __libc_tsd_address(TYPE, KEY) (&__libc_tsd_##KEY)
-# define __libc_tsd_get(TYPE, KEY) (__libc_tsd_##KEY)
-# define __libc_tsd_set(TYPE, KEY, VALUE) (__libc_tsd_##KEY = (VALUE))
-#else
-# define __libc_tsd_define(CLASS, TYPE, KEY) \
- CLASS TYPE __libc_tsd_##KEY##_data;
-
-# define __libc_tsd_address(TYPE, KEY) (&__libc_tsd_##KEY##_data)
-# define __libc_tsd_get(TYPE, KEY) (__libc_tsd_##KEY##_data)
-# define __libc_tsd_set(TYPE, KEY, VALUE) (__libc_tsd_##KEY##_data = (VALUE))
-#endif
+#define __libc_tsd_address(TYPE, KEY) (&__libc_tsd_##KEY)
+#define __libc_tsd_get(TYPE, KEY) (__libc_tsd_##KEY)
+#define __libc_tsd_set(TYPE, KEY, VALUE) (__libc_tsd_##KEY = (VALUE))
#endif /* bits/libc-tsd.h */
diff --git a/libc/bits/select.h b/libc/bits/select.h
index 8a4e537b9..2302c18dd 100644
--- a/libc/bits/select.h
+++ b/libc/bits/select.h
@@ -31,7 +31,8 @@
__FDS_BITS (__arr)[__i] = 0; \
} while (0)
#define __FD_SET(d, s) \
- ((void) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d)))
+ ((void) (__FDS_BITS (s)[__FD_ELT(d)] |= __FD_MASK(d)))
#define __FD_CLR(d, s) \
- ((void) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d)))
-#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT (d)] & __FDMASK (d)) != 0)
+ ((void) (__FDS_BITS (s)[__FD_ELT(d)] &= ~__FD_MASK(d)))
+#define __FD_ISSET(d, s) \
+ ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0)
diff --git a/libc/config.h.in b/libc/config.h.in
index 8fa682177..198e7db38 100644
--- a/libc/config.h.in
+++ b/libc/config.h.in
@@ -74,10 +74,6 @@
/* Define if _Unwind_Find_FDE should be exported from glibc. */
#undef EXPORT_UNWIND_FIND_FDE
-/* Define to use GNU libio instead of GNU stdio.
- This is defined by configure under --enable-libio. */
-#undef USE_IN_LIBIO
-
/* Define if using ELF and the assembler supports the `.previous'
directive. */
#undef HAVE_ASM_PREVIOUS_DIRECTIVE
@@ -95,22 +91,9 @@
/* Define if static NSS modules are wanted. */
#undef DO_STATIC_NSS
-/* Define if the compiler supports __builtin_expect. */
-#undef HAVE_BUILTIN_EXPECT
-
/* Define if the compiler supports __builtin_memset. */
#undef HAVE_BUILTIN_MEMSET
-/* Define if __asm () on built-in function's prototype causes redirection of
- the builtin. */
-#undef HAVE_BUILTIN_REDIRECTION
-
-/* Define if the __thread keyword is supported. */
-#undef HAVE___THREAD
-
-/* Define if the compiler supports __attribute__((tls_model(""))). */
-#undef HAVE_TLS_MODEL_ATTRIBUTE
-
/* Define if the regparm attribute shall be used for local functions
(gcc on ix86 only). */
#undef USE_REGPARMS
@@ -129,15 +112,15 @@
/* Define if _rtld_local structure should be forced into .sdata section. */
#undef HAVE_SDATA_SECTION
-/* Define if binutils support TLS handling. */
-#undef HAVE_TLS_SUPPORT
-
/* Define if gcc supports SSE4. */
#undef HAVE_SSE4_SUPPORT
/* Define if gcc supports AVX. */
#undef HAVE_AVX_SUPPORT
+/* Define if gcc supports FMA4. */
+#undef HAVE_FMA4_SUPPORT
+
/* Define if the compiler's exception support is based on libunwind. */
#undef HAVE_CC_WITH_LIBUNWIND
diff --git a/libc/config.make.in b/libc/config.make.in
index 4d1c7ebf4..2b7ae58c6 100644
--- a/libc/config.make.in
+++ b/libc/config.make.in
@@ -53,7 +53,6 @@ have-as-needed = @libc_cv_as_needed@
libgcc_s_suffix = @libc_cv_libgcc_s_suffix@
need-nopic-initfini = @nopic_initfini@
with-fp = @with_fp@
-with-cvs = @with_cvs@
old-glibc-headers = @old_glibc_headers@
unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
have-cpp-asm-debuginfo = @libc_cv_cpp_asm_debuginfo@
@@ -76,7 +75,6 @@ static-libgcc = @libc_cv_gcc_static_libgcc@
versioning = @VERSIONING@
oldest-abi = @oldest_abi@
-no-whole-archive = @no_whole_archive@
exceptions = @exceptions@
multi-arch = @multi_arch@
@@ -108,6 +106,7 @@ CC = @CC@
CXX = @CXX@
BUILD_CC = @BUILD_CC@
CFLAGS = @CFLAGS@
+CPPFLAGS-config = @CPPFLAGS@
ASFLAGS-config = @ASFLAGS_config@
AR = @AR@
NM = @NM@
diff --git a/libc/configure b/libc/configure
index cb177933c..ce163c961 100755
--- a/libc/configure
+++ b/libc/configure
@@ -3,7 +3,7 @@
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for GNU C Library (see version.h).
#
-# Report bugs to <glibc>.
+# Report bugs to <http://sourceware.org/bugzilla/>.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -596,10 +596,10 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='GNU C Library'
-PACKAGE_TARNAME='c-library'
+PACKAGE_TARNAME='glibc'
PACKAGE_VERSION='(see version.h)'
PACKAGE_STRING='GNU C Library (see version.h)'
-PACKAGE_BUGREPORT='glibc'
+PACKAGE_BUGREPORT='http://sourceware.org/bugzilla/'
ac_unique_file="include/features.h"
enable_option_checking=no
@@ -678,7 +678,6 @@ have_libaudit
LIBGD
libc_cv_cc_submachine
exceptions
-no_whole_archive
libc_cv_have_initfini
gnu89_inline
libc_cv_ssp
@@ -740,7 +739,6 @@ bindnow
oldest_abi
enable_check_abi
use_default_link
-with_cvs
with_fp
ac_ct_CXX
CXXFLAGS
@@ -811,7 +809,6 @@ with_binutils
with_elf
with_selinux
with_xcoff
-with_cvs
with_headers
with_default_link
enable_sanity_checks
@@ -824,8 +821,6 @@ enable_versioning
enable_oldest_abi
enable_stackguard_randomization
enable_add_ons
-with_tls
-with___thread
enable_hidden_plt
enable_bind_now
enable_static_nss
@@ -1451,7 +1446,7 @@ Fine tuning of the installation directories:
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/c-library]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/glibc]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
@@ -1517,12 +1512,9 @@ Optional Packages:
--with-elf if using the ELF object format
--with-selinux if building with SELinux support
--with-xcoff if using the XCOFF object format
- --without-cvs if CVS should not be used
--with-headers=PATH location of system headers to use (for example
/usr/src/linux/include) [default=compiler default]
--with-default-link do not use explicit linker scripts
- --with-tls enable support for TLS
- --without-__thread do not use TLS features even when supporting them
--with-pkgversion=PKG Use PKG in the version string in place of "EGLIBC"
--with-bugurl=URL Direct users to URL to report a bug
--with-cpu=CPU select code for CPU variant
@@ -1542,7 +1534,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <glibc>.
+Report bugs to <http://sourceware.org/bugzilla/>.
_ACEOF
ac_status=$?
fi
@@ -3602,21 +3594,6 @@ else
fi
-# Check whether --with-cvs was given.
-if test "${with_cvs+set}" = set; then
- withval=$with_cvs; with_cvs=$withval
-else
- with_cvs=yes
-fi
-
-if test "$with_cvs" = yes; then
- if test -d $srcdir/CVS && grep :pserver: $srcdir/CVS/Root > /dev/null
- then
- with_cvs=no
- fi
-fi
-
-
# Check whether --with-headers was given.
if test "${with_headers+set}" = set; then
@@ -3729,24 +3706,6 @@ else
fi
-
-# Check whether --with-tls was given.
-if test "${with_tls+set}" = set; then
- withval=$with_tls; usetls=$withval
-else
- usetls=yes
-fi
-
-
-
-# Check whether --with-__thread was given.
-if test "${with___thread+set}" = set; then
- withval=$with___thread; use__thread=$withval
-else
- use__thread=yes
-fi
-
-
# Check whether --enable-hidden-plt was given.
if test "${enable_hidden_plt+set}" = set; then
enableval=$enable_hidden_plt; hidden=$enableval
@@ -5622,8 +5581,7 @@ $as_echo "$libc_cv_autoconf_works" >&6; }
test $libc_cv_autoconf_works = yes || AUTOCONF=no
;;
esac
-if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
- # If --without-cvs they probably won't change configure.in, so no complaints.
+if test "x$AUTOCONF" = xno; then
aux_missing="$aux_missing autoconf"
fi
@@ -5656,11 +5614,16 @@ if test -n "$sysheaders"; then
SYSINCLUDES="$SYSINCLUDES \
-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
if test -n "$CXX"; then
+ CXX_SYSINCLUDES=
cxxversion=`$CXX -dumpversion 2>&5` &&
cxxmachine=`$CXX -dumpmachine 2>&5` &&
- cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
- CXX_SYSINCLUDES="-isystem $cxxheaders \
+ for d in include "$cxxmachine/include"; do
+ i=../../../../$d/c++/$cxxversion
+ cxxheaders=`$CXX -print-file-name="$i"` &&
+ test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
+ CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
-isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
+ done
fi
fi
@@ -6536,13 +6499,13 @@ EOF
(exit $ac_status); }; }
then
if $READELF -WS conftest$ac_exeext | $AWK '
- { gsub(/\[ */, "[") }
+ { gsub(/\[ */, "[") }
$2 == ".ctors" || $2 == ".dtors" {
size = strtonum("0x" $6)
align = strtonum("0x" $NF)
seen[$2] = 1
stub[$2] = size == align * 2
- }
+ }
END {
ctors_ok = !seen[".ctors"] || stub[".ctors"]
dtors_ok = !seen[".dtors"] || stub[".dtors"]
@@ -7504,8 +7467,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_ld_no_whole_archive" >&5
$as_echo "$libc_cv_ld_no_whole_archive" >&6; }
-if test $libc_cv_ld_no_whole_archive = yes; then
- no_whole_archive=-Wl,--no-whole-archive
+if test $libc_cv_ld_no_whole_archive = no; then
+ { { $as_echo "$as_me:$LINENO: error: support for --no-whole-archive is needed" >&5
+$as_echo "$as_me: error: support for --no-whole-archive is needed" >&2;}
+ { (exit 1); exit 1; }; }
fi
{ $as_echo "$as_me:$LINENO: checking for gcc -fexceptions" >&5
@@ -7627,11 +7592,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_gcc_builtin_expect" >&5
$as_echo "$libc_cv_gcc_builtin_expect" >&6; }
-if test "$libc_cv_gcc_builtin_expect" = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_BUILTIN_EXPECT 1
-_ACEOF
-
+if test "$libc_cv_gcc_builtin_expect" = no; then
+ { { $as_echo "$as_me:$LINENO: error: support for __builtin_expect needed" >&5
+$as_echo "$as_me: error: support for __builtin_expect needed" >&2;}
+ { (exit 1); exit 1; }; }
fi
{ $as_echo "$as_me:$LINENO: checking for __builtin_memset" >&5
@@ -7694,15 +7658,13 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_gcc_builtin_redirection" >&5
$as_echo "$libc_cv_gcc_builtin_redirection" >&6; }
-if test "$libc_cv_gcc_builtin_redirection" = yes ; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_BUILTIN_REDIRECTION 1
-_ACEOF
-
+if test "$libc_cv_gcc_builtin_redirection" = no; then
+ { { $as_echo "$as_me:$LINENO: error: support for the symbol redirection needed" >&5
+$as_echo "$as_me: error: support for the symbol redirection needed" >&2;}
+ { (exit 1); exit 1; }; }
fi
-if test "x$use__thread" != xno; then
- { $as_echo "$as_me:$LINENO: checking for __thread" >&5
+{ $as_echo "$as_me:$LINENO: checking for __thread" >&5
$as_echo_n "checking for __thread... " >&6; }
if test "${libc_cv_gcc___thread+set}" = set; then
$as_echo_n "(cached) " >&6
@@ -7710,59 +7672,52 @@ else
cat > conftest.c <<\EOF
__thread int a = 42;
EOF
- if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&5'
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- libc_cv_gcc___thread=yes
- else
- libc_cv_gcc___thread=no
- fi
- rm -f conftest*
+ libc_cv_gcc___thread=yes
+else
+ libc_cv_gcc___thread=no
+fi
+rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_gcc___thread" >&5
$as_echo "$libc_cv_gcc___thread" >&6; }
- if test "$libc_cv_gcc___thread" = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___THREAD 1
-_ACEOF
-
- fi
-else
- libc_cv_gcc___thread=no
+if test "$libc_cv_gcc___thread" = no; then
+ { { $as_echo "$as_me:$LINENO: error: support for the __thread keyword is required" >&5
+$as_echo "$as_me: error: support for the __thread keyword is required" >&2;}
+ { (exit 1); exit 1; }; }
fi
-if test "$libc_cv_gcc___thread" = yes; then
- { $as_echo "$as_me:$LINENO: checking for tls_model attribute" >&5
+{ $as_echo "$as_me:$LINENO: checking for tls_model attribute" >&5
$as_echo_n "checking for tls_model attribute... " >&6; }
if test "${libc_cv_gcc_tls_model_attr+set}" = set; then
$as_echo_n "(cached) " >&6
else
- cat > conftest.c <<\EOF
+ cat > conftest.c <<\EOF
extern __thread int a __attribute__((tls_model ("initial-exec")));
EOF
- if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&5'
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- libc_cv_gcc_tls_model_attr=yes
- else
- libc_cv_gcc_tls_model_attr=no
- fi
- rm -f conftest*
+ libc_cv_gcc_tls_model_attr=yes
+else
+ libc_cv_gcc_tls_model_attr=no
+fi
+rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_gcc_tls_model_attr" >&5
$as_echo "$libc_cv_gcc_tls_model_attr" >&6; }
- if test "$libc_cv_gcc_tls_model_attr" = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_MODEL_ATTRIBUTE 1
-_ACEOF
-
- fi
+if test "$libc_cv_gcc_tls_model_attr" = no; then
+ { { $as_echo "$as_me:$LINENO: error: support for the tls_model attribute is required" >&5
+$as_echo "$as_me: error: support for the tls_model attribute is required" >&2;}
+ { (exit 1); exit 1; }; }
fi
if test -n "$submachine"; then
@@ -8950,11 +8905,6 @@ _ACEOF
fi
-cat >>confdefs.h <<\_ACEOF
-#define USE_IN_LIBIO 1
-_ACEOF
-
-
# Test for old glibc 2.0.x headers so that they can be removed properly
# Search only in includedir.
{ $as_echo "$as_me:$LINENO: checking for old glibc 2.0.x headers" >&5
diff --git a/libc/configure.in b/libc/configure.in
index 9a80e5a06..3877f53e3 100644
--- a/libc/configure.in
+++ b/libc/configure.in
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$CVSid$])
AC_PREREQ(2.53)dnl dnl Minimum Autoconf version required.
-AC_INIT([GNU C Library], [(see version.h)], [glibc])
+AC_INIT([GNU C Library], [(see version.h)], [http://sourceware.org/bugzilla/], [glibc])
AC_CONFIG_SRCDIR([include/features.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([scripts])
@@ -93,18 +93,6 @@ AC_ARG_WITH([xcoff],
[if using the XCOFF object format]),
[xcoff=$withval],
[xcoff=no])
-AC_ARG_WITH([cvs],
- AC_HELP_STRING([--without-cvs],
- [if CVS should not be used]),
- [with_cvs=$withval],
- [with_cvs=yes])
-if test "$with_cvs" = yes; then
- if test -d $srcdir/CVS && grep :pserver: $srcdir/CVS/Root > /dev/null
- then
- with_cvs=no
- fi
-fi
-AC_SUBST(with_cvs)
AC_ARG_WITH([headers],
AC_HELP_STRING([--with-headers=PATH],
@@ -199,19 +187,6 @@ AC_ARG_ENABLE([add-ons],
search for add-ons if no parameter given]),
, [enable_add_ons=yes])
-dnl Let the user avoid using TLS. Don't know why but...
-AC_ARG_WITH([tls],
- AC_HELP_STRING([--with-tls],
- [enable support for TLS]),
- [usetls=$withval],
- [usetls=yes])
-
-AC_ARG_WITH([__thread],
- AC_HELP_STRING([--without-__thread],
- [do not use TLS features even when supporting them]),
- [use__thread=$withval],
- [use__thread=yes])
-
AC_ARG_ENABLE([hidden-plt],
AC_HELP_STRING([--disable-hidden-plt],
[do not hide internal function calls to avoid PLT]),
@@ -1094,8 +1069,7 @@ whether $AUTOCONF${ACFLAGS:+ }$ACFLAGS works, libc_cv_autoconf_works, [dnl
test $libc_cv_autoconf_works = yes || AUTOCONF=no
;;
esac
-if test "x$with_cvs" = xyes && test "x$AUTOCONF" = xno; then
- # If --without-cvs they probably won't change configure.in, so no complaints.
+if test "x$AUTOCONF" = xno; then
aux_missing="$aux_missing autoconf"
fi
@@ -1120,11 +1094,16 @@ if test -n "$sysheaders"; then
SYSINCLUDES="$SYSINCLUDES \
-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
if test -n "$CXX"; then
+ CXX_SYSINCLUDES=
cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
- cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
- CXX_SYSINCLUDES="-isystem $cxxheaders \
+ for d in include "$cxxmachine/include"; do
+ i=../../../../$d/c++/$cxxversion
+ cxxheaders=`$CXX -print-file-name="$i"` &&
+ test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
+ CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
-isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
+ done
fi
fi
AC_SUBST(SYSINCLUDES)
@@ -1535,13 +1514,13 @@ EOF
conftest.c -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
then
AS_IF([$READELF -WS conftest$ac_exeext | $AWK '
- { gsub(/\@<:@ */, "@<:@") }
+ { gsub(/\@<:@ */, "@<:@") }
$2 == ".ctors" || $2 == ".dtors" {
size = strtonum("0x" $6)
align = strtonum("0x" $NF)
seen@<:@$2@:>@ = 1
stub@<:@$2@:>@ = size == align * 2
- }
+ }
END {
ctors_ok = !seen@<:@".ctors"@:>@ || stub@<:@".ctors"@:>@
dtors_ok = !seen@<:@".dtors"@:>@ || stub@<:@".dtors"@:>@
@@ -2120,10 +2099,9 @@ else
libc_cv_ld_no_whole_archive=no
fi
rm -f conftest*])
-if test $libc_cv_ld_no_whole_archive = yes; then
- no_whole_archive=-Wl,--no-whole-archive
+if test $libc_cv_ld_no_whole_archive = no; then
+ AC_MSG_ERROR([support for --no-whole-archive is needed])
fi
-AC_SUBST(no_whole_archive)dnl
AC_CACHE_CHECK(for gcc -fexceptions, libc_cv_gcc_exceptions, [dnl
cat > conftest.c <<\EOF
@@ -2175,8 +2153,8 @@ else
libc_cv_gcc_builtin_expect=no
fi
rm -f conftest*])
-if test "$libc_cv_gcc_builtin_expect" = yes; then
- AC_DEFINE(HAVE_BUILTIN_EXPECT)
+if test "$libc_cv_gcc_builtin_expect" = no; then
+ AC_MSG_ERROR([support for __builtin_expect needed])
fi
AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl
@@ -2214,44 +2192,38 @@ else
libc_cv_gcc_builtin_redirection=no
fi
rm -f conftest* ])
-if test "$libc_cv_gcc_builtin_redirection" = yes ; then
- AC_DEFINE(HAVE_BUILTIN_REDIRECTION)
+if test "$libc_cv_gcc_builtin_redirection" = no; then
+ AC_MSG_ERROR([support for the symbol redirection needed])
fi
dnl Check whether the compiler supports the __thread keyword.
-if test "x$use__thread" != xno; then
- AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
- [cat > conftest.c <<\EOF
+AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
+[cat > conftest.c <<\EOF
__thread int a = 42;
EOF
- if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
- libc_cv_gcc___thread=yes
- else
- libc_cv_gcc___thread=no
- fi
- rm -f conftest*])
- if test "$libc_cv_gcc___thread" = yes; then
- AC_DEFINE(HAVE___THREAD)
- fi
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
+ libc_cv_gcc___thread=yes
else
libc_cv_gcc___thread=no
fi
+rm -f conftest*])
+if test "$libc_cv_gcc___thread" = no; then
+ AC_MSG_ERROR([support for the __thread keyword is required])
+fi
-if test "$libc_cv_gcc___thread" = yes; then
- dnl Check whether the compiler supports the tls_model attribute.
- AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
- cat > conftest.c <<\EOF
+dnl Check whether the compiler supports the tls_model attribute.
+AC_CACHE_CHECK([for tls_model attribute], libc_cv_gcc_tls_model_attr, [dnl
+cat > conftest.c <<\EOF
extern __thread int a __attribute__((tls_model ("initial-exec")));
EOF
- if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
- libc_cv_gcc_tls_model_attr=yes
- else
- libc_cv_gcc_tls_model_attr=no
- fi
- rm -f conftest*])
- if test "$libc_cv_gcc_tls_model_attr" = yes; then
- AC_DEFINE(HAVE_TLS_MODEL_ATTRIBUTE)
- fi
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -Werror conftest.c >&AS_MESSAGE_LOG_FD]); then
+ libc_cv_gcc_tls_model_attr=yes
+else
+ libc_cv_gcc_tls_model_attr=no
+fi
+rm -f conftest*])
+if test "$libc_cv_gcc_tls_model_attr" = no; then
+ AC_MSG_ERROR([support for the tls_model attribute is required])
fi
if test -n "$submachine"; then
@@ -2369,9 +2341,6 @@ if test x$libc_cv_gcc_unwind_find_fde = xyes; then
fi
AC_SUBST(libc_cv_gcc_unwind_find_fde)
-dnl This is tested by existing code and it's simpler to avoid changing it.
-AC_DEFINE(USE_IN_LIBIO)
-
# Test for old glibc 2.0.x headers so that they can be removed properly
# Search only in includedir.
AC_MSG_CHECKING(for old glibc 2.0.x headers)
diff --git a/libc/csu/Versions b/libc/csu/Versions
index f0b4f0054..4ddf0d5b0 100644
--- a/libc/csu/Versions
+++ b/libc/csu/Versions
@@ -4,23 +4,12 @@ libc {
GLIBC_2.0 {
# helper functions
__libc_init_first; __libc_start_main;
-
-%if !HAVE___THREAD
- # global variables
- _errno;
-
- # variables in normal name space
- errno;
-%endif
}
GLIBC_2.1 {
# New special glibc functions.
gnu_get_libc_release; gnu_get_libc_version;
}
GLIBC_PRIVATE {
-%if HAVE___THREAD
- # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
errno;
-%endif
}
}
diff --git a/libc/csu/errno-loc.c b/libc/csu/errno-loc.c
index 633590f4f..f7de2b7b0 100644
--- a/libc/csu/errno-loc.c
+++ b/libc/csu/errno-loc.c
@@ -1,6 +1,6 @@
/* MT support function to get address of `errno' variable, non-threaded
version.
- Copyright (C) 1996, 1998, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1998, 2002, 2004, 2011 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
@@ -21,15 +21,7 @@
#include <errno.h>
#include <tls.h>
-#if ! USE___THREAD && !RTLD_PRIVATE_ERRNO
-#undef errno
-extern int errno;
-#endif
-
int *
-#if ! USE___THREAD
-weak_const_function
-#endif
__errno_location (void)
{
return &errno;
diff --git a/libc/csu/errno.c b/libc/csu/errno.c
index 03d661b71..d5d2c98fb 100644
--- a/libc/csu/errno.c
+++ b/libc/csu/errno.c
@@ -1,5 +1,5 @@
/* Definition of `errno' variable. Canonical version.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2011 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
@@ -27,27 +27,10 @@
/* Code compiled for rtld refers only to this name. */
int rtld_errno attribute_hidden;
-#elif USE___THREAD
+#else
__thread int errno;
extern __thread int __libc_errno __attribute__ ((alias ("errno")))
attribute_hidden;
-#else
-
-/* This differs from plain `int errno;' in that it doesn't create
- a common definition, but a plain symbol that resides in .bss,
- which can have an alias. */
-int errno __attribute__ ((nocommon));
-strong_alias (errno, _errno)
-
-/* We declare these with compat_symbol so that they are not visible at
- link time. Programs must use the accessor functions. RTLD is special,
- since it's not exported from there at any time. */
-# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
-# include <shlib-compat.h>
-compat_symbol (libc, errno, errno, GLIBC_2_0);
-compat_symbol (libc, _errno, _errno, GLIBC_2_0);
-# endif
-
#endif
diff --git a/libc/csu/init.c b/libc/csu/init.c
index 129609e08..559d13e64 100644
--- a/libc/csu/init.c
+++ b/libc/csu/init.c
@@ -1,5 +1,5 @@
/* Special startup support.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2011 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
@@ -17,7 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#if defined USE_IN_LIBIO && defined __GNUC__ && __GNUC__ >= 2
+#if defined __GNUC__ && __GNUC__ >= 2
#include <_G_config.h>
diff --git a/libc/ctype/Versions b/libc/ctype/Versions
index 8cf0338b3..84f1e2c7c 100644
--- a/libc/ctype/Versions
+++ b/libc/ctype/Versions
@@ -21,4 +21,7 @@ libc {
# functions used by optimized macros in ctype.h
__ctype_b_loc; __ctype_tolower_loc; __ctype_toupper_loc;
}
+ GLIBC_PRIVATE {
+ __ctype_init;
+ }
}
diff --git a/libc/ctype/ctype-info.c b/libc/ctype/ctype-info.c
index 03b67d179..b64e7439a 100644
--- a/libc/ctype/ctype-info.c
+++ b/libc/ctype/ctype-info.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,95,96,97,99,2000, 2002, 2008
+/* Copyright (C) 1991,92,95,96,97,99,2000, 2002, 2008, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -26,6 +26,19 @@ __libc_tsd_define (, const int32_t *, CTYPE_TOLOWER)
__libc_tsd_define (, const int32_t *, CTYPE_TOUPPER)
+void
+__ctype_init (void)
+{
+ const uint16_t **bp = __libc_tsd_address (const uint16_t *, CTYPE_B);
+ *bp = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
+ const int32_t **up = __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
+ *up = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
+ const int32_t **lp = __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
+ *lp = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
+}
+libc_hidden_def (__ctype_init)
+
+
#include <shlib-compat.h>
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
diff --git a/libc/ctype/ctype.h b/libc/ctype/ctype.h
index e859c4a62..1f3052abf 100644
--- a/libc/ctype/ctype.h
+++ b/libc/ctype/ctype.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004,2007,2008,2009
- Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004,2007,2008,2009,2011
+ 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
@@ -85,8 +85,18 @@ extern __const __int32_t **__ctype_tolower_loc (void)
extern __const __int32_t **__ctype_toupper_loc (void)
__THROW __attribute__ ((__const));
-#define __isctype(c, type) \
+
+#ifndef __cplusplus
+# define __isctype(c, type) \
((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type)
+#elif defined __USE_EXTERN_INLINES
+# define __isctype_f(type) \
+ __extern_inline int \
+ is##type (int __c) __THROW \
+ { \
+ return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS##type; \
+ }
+#endif
#define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */
#define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */
@@ -169,7 +179,23 @@ __exctype (_tolower);
__res = (a)[(int) (c)]; \
__res; }))
-#if !defined __NO_CTYPE && !defined __cplusplus
+#if !defined __NO_CTYPE
+# ifdef __isctype_f
+__isctype_f (alnum)
+__isctype_f (alpha)
+__isctype_f (cntrl)
+__isctype_f (digit)
+__isctype_f (lower)
+__isctype_f (graph)
+__isctype_f (print)
+__isctype_f (punct)
+__isctype_f (space)
+__isctype_f (upper)
+__isctype_f (xdigit)
+# ifdef __USE_ISOC99
+__isctype_f (blank)
+# endif
+# elif defined __isctype
# define isalnum(c) __isctype((c), _ISalnum)
# define isalpha(c) __isctype((c), _ISalpha)
# define iscntrl(c) __isctype((c), _IScntrl)
@@ -181,9 +207,9 @@ __exctype (_tolower);
# define isspace(c) __isctype((c), _ISspace)
# define isupper(c) __isctype((c), _ISupper)
# define isxdigit(c) __isctype((c), _ISxdigit)
-
-# ifdef __USE_ISOC99
-# define isblank(c) __isctype((c), _ISblank)
+# ifdef __USE_ISOC99
+# define isblank(c) __isctype((c), _ISblank)
+# endif
# endif
# ifdef __USE_EXTERN_INLINES
diff --git a/libc/debug/Makefile b/libc/debug/Makefile
index 98bbe3c8e..84ee1d4d3 100644
--- a/libc/debug/Makefile
+++ b/libc/debug/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2001,2004-2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1998-2001,2004-2008, 2009, 2011 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
@@ -40,6 +40,7 @@ routines = noophooks \
asprintf_chk vasprintf_chk dprintf_chk \
vdprintf_chk obprintf_chk \
longjmp_chk ____longjmp_chk \
+ fdelt_chk \
stack_chk_fail fortify_fail \
$(static-only-routines)
routines-$(OPTION_EGLIBC_GETLOGIN) += getlogin_r_chk
diff --git a/libc/debug/Versions b/libc/debug/Versions
index ff40107b7..3db4a2955 100644
--- a/libc/debug/Versions
+++ b/libc/debug/Versions
@@ -49,6 +49,9 @@ libc {
GLIBC_2.11 {
__longjmp_chk;
}
+ GLIBC_2.15 {
+ __fdelt_chk; __fdelt_warn;
+ }
GLIBC_PRIVATE {
__fortify_fail;
}
diff --git a/libc/debug/fdelt_chk.c b/libc/debug/fdelt_chk.c
new file mode 100644
index 000000000..7d9e4b96e
--- /dev/null
+++ b/libc/debug/fdelt_chk.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sys/select.h>
+
+
+unsigned long int
+__fdelt_chk (unsigned long int d)
+{
+ if (d >= FD_SETSIZE)
+ __chk_fail ();
+
+ return d / __NFDBITS;
+}
+strong_alias (__fdelt_chk, __fdelt_warn)
diff --git a/libc/debug/tst-chk1.c b/libc/debug/tst-chk1.c
index 86d3c9392..aa265280d 100644
--- a/libc/debug/tst-chk1.c
+++ b/libc/debug/tst-chk1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2004,2005,2006,2007,2008,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
@@ -29,6 +29,7 @@
#include <string.h>
#include <unistd.h>
#include <wchar.h>
+#include <sys/select.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <gnu/option-groups.h>
@@ -108,11 +109,11 @@ int num2 = 987654;
FAIL (); \
}
#if __USE_FORTIFY_LEVEL >= 2 && (!defined __cplusplus || defined __va_arg_pack)
-#define CHK_FAIL2_START CHK_FAIL_START
-#define CHK_FAIL2_END CHK_FAIL_END
+# define CHK_FAIL2_START CHK_FAIL_START
+# define CHK_FAIL2_END CHK_FAIL_END
#else
-#define CHK_FAIL2_START
-#define CHK_FAIL2_END
+# define CHK_FAIL2_START
+# define CHK_FAIL2_END
#endif
static int
@@ -1455,5 +1456,26 @@ do_test (void)
CHK_FAIL_END
#endif
+ fd_set s;
+ FD_ZERO (&s);
+ FD_SET (FD_SETSIZE - 1, &s);
+#if __USE_FORTIFY_LEVEL >= 1
+ CHK_FAIL_START
+ FD_SET (FD_SETSIZE, &s);
+ CHK_FAIL_END
+#endif
+ FD_CLR (FD_SETSIZE - 1, &s);
+#if __USE_FORTIFY_LEVEL >= 1
+ CHK_FAIL_START
+ FD_CLR (FD_SETSIZE, &s);
+ CHK_FAIL_END
+#endif
+ FD_ISSET (FD_SETSIZE - 1, &s);
+#if __USE_FORTIFY_LEVEL >= 1
+ CHK_FAIL_START
+ FD_ISSET (FD_SETSIZE, &s);
+ CHK_FAIL_END
+#endif
+
return ret;
}
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index 5788a4652..394b57071 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -488,7 +488,8 @@ LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new
endef
else
define gen-ldd
-LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< | LC_ALL=C sed -f $(ldd-rewrite-script) > $@.new
+LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< \
+| LC_ALL=C sed -f $(patsubst $(..)/%,/%,$(..)$(ldd-rewrite-script)) > $@.new
endef
endif
diff --git a/libc/elf/dl-conflict.c b/libc/elf/dl-conflict.c
index a01e2a9a7..8ad332686 100644
--- a/libc/elf/dl-conflict.c
+++ b/libc/elf/dl-conflict.c
@@ -1,5 +1,5 @@
/* Resolve conflicts against already prelinked libraries.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -69,7 +69,8 @@ _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict,
GL(dl_num_cache_relocations) += conflictend - conflict;
for (; conflict < conflictend; ++conflict)
- elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset);
+ elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset,
+ 0);
}
#endif
}
diff --git a/libc/elf/dl-fini.c b/libc/elf/dl-fini.c
index b2a698c66..953849d92 100644
--- a/libc/elf/dl-fini.c
+++ b/libc/elf/dl-fini.c
@@ -100,7 +100,17 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
/* Look through the relocation dependencies of the object. */
while (m-- > 0)
if (__builtin_expect (relmaps[m] == thisp, 0))
- goto move;
+ {
+ /* If a cycle exists with a link time dependency,
+ preserve the latter. */
+ struct link_map **runp = thisp->l_initfini;
+ if (runp != NULL)
+ while (*runp != NULL)
+ if (__builtin_expect (*runp++ == maps[k], 0))
+ goto ignore;
+ goto move;
+ }
+ ignore:;
}
--k;
diff --git a/libc/elf/dl-iteratephdr.c b/libc/elf/dl-iteratephdr.c
index 5f1c20d75..45107a9b6 100644
--- a/libc/elf/dl-iteratephdr.c
+++ b/libc/elf/dl-iteratephdr.c
@@ -1,5 +1,5 @@
/* Get loaded objects program headers.
- Copyright (C) 2001-2004, 2006-2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -62,16 +62,16 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
{
- info.dlpi_addr = l->l_addr;
- info.dlpi_name = l->l_name;
- info.dlpi_phdr = l->l_phdr;
- info.dlpi_phnum = l->l_phnum;
+ info.dlpi_addr = l->l_real->l_addr;
+ info.dlpi_name = l->l_real->l_name;
+ info.dlpi_phdr = l->l_real->l_phdr;
+ info.dlpi_phnum = l->l_real->l_phnum;
info.dlpi_adds = GL(dl_load_adds);
info.dlpi_subs = GL(dl_load_adds) - nloaded;
info.dlpi_tls_data = NULL;
- info.dlpi_tls_modid = l->l_tls_modid;
+ info.dlpi_tls_modid = l->l_real->l_tls_modid;
if (info.dlpi_tls_modid != 0)
- info.dlpi_tls_data = GLRO(dl_tls_get_addr_soft) (l);
+ info.dlpi_tls_data = GLRO(dl_tls_get_addr_soft) (l->l_real);
ret = callback (&info, sizeof (struct dl_phdr_info), data);
if (ret)
break;
diff --git a/libc/elf/dl-libc.c b/libc/elf/dl-libc.c
index e440d016d..f44fa10e0 100644
--- a/libc/elf/dl-libc.c
+++ b/libc/elf/dl-libc.c
@@ -45,10 +45,10 @@ dlerror_run (void (*operate) (void *), void *args)
const char *last_errstring = NULL;
bool malloced;
- (void) GLRO(dl_catch_error) (&objname, &last_errstring, &malloced,
- operate, args);
+ int result = (GLRO(dl_catch_error) (&objname, &last_errstring, &malloced,
+ operate, args)
+ ?: last_errstring != NULL);
- int result = last_errstring != NULL;
if (result && malloced)
free ((char *) last_errstring);
@@ -307,22 +307,19 @@ libc_freeres_fn (free_mem)
}
}
- if (USE___THREAD || GL(dl_tls_dtv_slotinfo_list) != NULL)
- {
- /* Free the memory allocated for the dtv slotinfo array. We can do
- this only if all modules which used this memory are unloaded. */
+ /* Free the memory allocated for the dtv slotinfo array. We can do
+ this only if all modules which used this memory are unloaded. */
#ifdef SHARED
- if (GL(dl_initial_dtv) == NULL)
- /* There was no initial TLS setup, it was set up later when
- it used the normal malloc. */
- free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
- else
+ if (GL(dl_initial_dtv) == NULL)
+ /* There was no initial TLS setup, it was set up later when
+ it used the normal malloc. */
+ free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
+ else
#endif
- /* The first element of the list does not have to be deallocated.
- It was allocated in the dynamic linker (i.e., with a different
- malloc), and in the static library it's in .bss space. */
- free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
- }
+ /* The first element of the list does not have to be deallocated.
+ It was allocated in the dynamic linker (i.e., with a different
+ malloc), and in the static library it's in .bss space. */
+ free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
void *scope_free_list = GL(dl_scope_free_list);
GL(dl_scope_free_list) = NULL;
diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c
index 6bae71725..26581c897 100644
--- a/libc/elf/dl-load.c
+++ b/libc/elf/dl-load.c
@@ -888,6 +888,8 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
/* The file might already be closed. */
if (fd != -1)
(void) __close (fd);
+ if (l != NULL && l->l_origin != (char *) -1l)
+ free ((char *) l->l_origin);
free (l);
free (realname);
@@ -1708,7 +1710,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
#endif
/* Open the file. We always open files read-only. */
- int fd = __open (name, O_RDONLY);
+ int fd = __open (name, O_RDONLY | O_CLOEXEC);
if (fd != -1)
{
ElfW(Ehdr) *ehdr;
diff --git a/libc/elf/dl-reloc.c b/libc/elf/dl-reloc.c
index 5102f8002..0a165f1c4 100644
--- a/libc/elf/dl-reloc.c
+++ b/libc/elf/dl-reloc.c
@@ -162,6 +162,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
/* Initialize it to make the compiler happy. */
const char *errstring = NULL;
int lazy = reloc_mode & RTLD_LAZY;
+ int skip_ifunc = reloc_mode & __RTLD_NOIFUNC;
#ifdef SHARED
/* If we are auditing, install the same handlers we need for profiling. */
@@ -261,7 +262,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
#include "dynamic-link.h"
- ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling);
+ ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
#ifndef PROF
if (__builtin_expect (consider_profiling, 0))
diff --git a/libc/elf/dl-support.c b/libc/elf/dl-support.c
index b034777e0..8f3106866 100644
--- a/libc/elf/dl-support.c
+++ b/libc/elf/dl-support.c
@@ -1,5 +1,5 @@
/* Support for dynamic linking code in static libc.
- Copyright (C) 1996-2008,2009,2010 Free Software Foundation, Inc.
+ Copyright (C) 1996-2008,2009,2010,2011 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
@@ -25,6 +25,7 @@
#include <libintl.h>
#include <stdlib.h>
#include <unistd.h>
+#include <sys/param.h>
#include <ldsodefs.h>
#include <dl-machine.h>
#include <bits/libc-lock.h>
@@ -108,7 +109,7 @@ hp_timing_t _dl_cpuclock_offset;
void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls;
-size_t _dl_pagesize;
+size_t _dl_pagesize = EXEC_PAGESIZE;
unsigned int _dl_osversion;
diff --git a/libc/elf/dl-tsd.c b/libc/elf/dl-tsd.c
index f01f8d652..ea0fccd98 100644
--- a/libc/elf/dl-tsd.c
+++ b/libc/elf/dl-tsd.c
@@ -1,5 +1,5 @@
/* Thread-local data used by error handling for runtime dynamic linker.
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2011 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
@@ -30,17 +30,13 @@
void ** __attribute__ ((const))
_dl_initial_error_catch_tsd (void)
{
-# if USE___THREAD
static __thread void *data;
-# else
- static void *data;
-# endif
return &data;
}
void **(*_dl_error_catch_tsd) (void) __attribute__ ((const))
= &_dl_initial_error_catch_tsd;
-# elif USE___THREAD
+# else
/* libpthread sets _dl_error_catch_tsd to point to this function.
We define it here instead of in libpthread so that it doesn't
diff --git a/libc/elf/do-rel.h b/libc/elf/do-rel.h
index c87e88ad2..34ba5d1ce 100644
--- a/libc/elf/do-rel.h
+++ b/libc/elf/do-rel.h
@@ -1,5 +1,5 @@
/* Do relocations for ELF dynamic linking.
- Copyright (C) 1995-2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003, 2004, 2011 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
@@ -21,13 +21,10 @@
`elf_dynamic_do_rel' and `elf_dynamic_do_rela'. */
#ifdef DO_RELA
-# define elf_dynamic_do_rel elf_dynamic_do_rela
-# define RELCOUNT_IDX VERSYMIDX (DT_RELACOUNT)
+# define elf_dynamic_do_Rel elf_dynamic_do_Rela
# define Rel Rela
# define elf_machine_rel elf_machine_rela
# define elf_machine_rel_relative elf_machine_rela_relative
-#else
-# define RELCOUNT_IDX VERSYMIDX (DT_RELCOUNT)
#endif
#ifndef DO_ELF_MACHINE_REL_RELATIVE
@@ -50,13 +47,18 @@
than fully resolved now. */
auto inline void __attribute__ ((always_inline))
-elf_dynamic_do_rel (struct link_map *map,
+elf_dynamic_do_Rel (struct link_map *map,
ElfW(Addr) reladdr, ElfW(Addr) relsize,
- int lazy)
+ __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative,
+ int lazy, int skip_ifunc)
{
const ElfW(Rel) *r = (const void *) reladdr;
const ElfW(Rel) *end = (const void *) (reladdr + relsize);
ElfW(Addr) l_addr = map->l_addr;
+# if defined ELF_MACHINE_IRELATIVE && !defined RTLD_BOOTSTRAP
+ const ElfW(Rel) *r2 = NULL;
+ const ElfW(Rel) *end2 = NULL;
+# endif
#if (!defined DO_RELA || !defined ELF_MACHINE_PLT_REL) && !defined RTLD_BOOTSTRAP
/* We never bind lazily during ld.so bootstrap. Unfortunately gcc is
@@ -66,17 +68,31 @@ elf_dynamic_do_rel (struct link_map *map,
{
/* Doing lazy PLT relocations; they need very little info. */
for (; r < end; ++r)
- elf_machine_lazy_rel (map, l_addr, r);
+# ifdef ELF_MACHINE_IRELATIVE
+ if (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_IRELATIVE)
+ {
+ if (r2 == NULL)
+ r2 = r;
+ end2 = r;
+ }
+ else
+# endif
+ elf_machine_lazy_rel (map, l_addr, r, skip_ifunc);
+
+# ifdef ELF_MACHINE_IRELATIVE
+ if (r2 != NULL)
+ for (; r2 <= end2; ++r2)
+ if (ELFW(R_TYPE) (r2->r_info) == ELF_MACHINE_IRELATIVE)
+ elf_machine_lazy_rel (map, l_addr, r2, skip_ifunc);
+# endif
}
else
#endif
{
const ElfW(Sym) *const symtab =
(const void *) D_PTR (map, l_info[DT_SYMTAB]);
- ElfW(Word) nrelative = (map->l_info[RELCOUNT_IDX] == NULL
- ? 0 : map->l_info[RELCOUNT_IDX]->d_un.d_val);
const ElfW(Rel) *relative = r;
- r = r + MIN (nrelative, relsize / sizeof (ElfW(Rel)));
+ r += nrelative;
#ifndef RTLD_BOOTSTRAP
/* This is defined in rtld.c, but nowhere in the static libc.a; make
@@ -116,24 +132,69 @@ elf_dynamic_do_rel (struct link_map *map,
for (; r < end; ++r)
{
+#if defined ELF_MACHINE_IRELATIVE && !defined RTLD_BOOTSTRAP
+ if (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_IRELATIVE)
+ {
+ if (r2 == NULL)
+ r2 = r;
+ end2 = r;
+ continue;
+ }
+#endif
+
ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff;
elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)],
&map->l_versions[ndx],
- (void *) (l_addr + r->r_offset));
+ (void *) (l_addr + r->r_offset), skip_ifunc);
}
+
+#if defined ELF_MACHINE_IRELATIVE && !defined RTLD_BOOTSTRAP
+ if (r2 != NULL)
+ for (; r2 <= end2; ++r2)
+ if (ELFW(R_TYPE) (r2->r_info) == ELF_MACHINE_IRELATIVE)
+ {
+ ElfW(Half) ndx
+ = version[ELFW(R_SYM) (r2->r_info)] & 0x7fff;
+ elf_machine_rel (map, r2,
+ &symtab[ELFW(R_SYM) (r2->r_info)],
+ &map->l_versions[ndx],
+ (void *) (l_addr + r2->r_offset),
+ skip_ifunc);
+ }
+#endif
}
#if !defined RTLD_BOOTSTRAP || !defined DO_VERSIONING
else
- for (; r < end; ++r)
- elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL,
- (void *) (l_addr + r->r_offset));
+ {
+ for (; r < end; ++r)
+# ifdef ELF_MACHINE_IRELATIVE
+ if (ELFW(R_TYPE) (r->r_info) == ELF_MACHINE_IRELATIVE)
+ {
+ if (r2 == NULL)
+ r2 = r;
+ end2 = r;
+ }
+ else
+# endif
+ elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL,
+ (void *) (l_addr + r->r_offset), skip_ifunc);
+
+# ifdef ELF_MACHINE_IRELATIVE
+ if (r2 != NULL)
+ for (; r2 <= end2; ++r2)
+ if (ELFW(R_TYPE) (r2->r_info) == ELF_MACHINE_IRELATIVE)
+ elf_machine_rel (map, r2, &symtab[ELFW(R_SYM) (r2->r_info)],
+ NULL, (void *) (l_addr + r2->r_offset),
+ skip_ifunc);
+# endif
+ }
#endif
}
}
-#undef elf_dynamic_do_rel
+#undef elf_dynamic_do_Rel
#undef Rel
#undef elf_machine_rel
#undef elf_machine_rel_relative
#undef DO_ELF_MACHINE_REL_RELATIVE
-#undef RELCOUNT_IDX
+#undef DO_RELA
diff --git a/libc/elf/dynamic-link.h b/libc/elf/dynamic-link.h
index 9c16da4eb..9cdbee1e3 100644
--- a/libc/elf/dynamic-link.h
+++ b/libc/elf/dynamic-link.h
@@ -60,7 +60,7 @@ int internal_function _dl_try_allocate_static_tls (struct link_map *map);
auto inline void __attribute__((always_inline))
elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr);
+ void *const reloc_addr, int skip_ifunc);
auto inline void __attribute__((always_inline))
elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
void *const reloc_addr);
@@ -69,7 +69,7 @@ elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
auto inline void __attribute__((always_inline))
elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr);
+ void *const reloc_addr, int skip_ifunc);
auto inline void __attribute__((always_inline))
elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
void *const reloc_addr);
@@ -77,11 +77,13 @@ elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
auto inline void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
+ ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
+ int skip_ifunc);
# else
auto inline void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
+ ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+ int skip_ifunc);
# endif
#endif
@@ -254,19 +256,26 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
not happen we do something more optimal. */
# ifdef ELF_MACHINE_PLTREL_OVERLAP
-# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, test_rel) \
+# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, skip_ifunc, test_rel) \
do { \
- struct { ElfW(Addr) start, size; int lazy; } ranges[3]; \
+ struct { ElfW(Addr) start, size; \
+ __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative; int lazy; } \
+ ranges[3]; \
int ranges_index; \
\
ranges[0].lazy = ranges[2].lazy = 0; \
ranges[1].lazy = 1; \
ranges[0].size = ranges[1].size = ranges[2].size = 0; \
+ ranges[0].nrelative = ranges[1].nrelative = ranges[2].nrelative = 0; \
\
if ((map)->l_info[DT_##RELOC]) \
{ \
ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \
ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \
+ if (map->l_info[VERSYMIDX (DT_##RELOC##COUNT)] != NULL) \
+ ranges[0].nrelative \
+ = MIN (map->l_info[VERSYMIDX (DT_##RELOC##COUNT)]->d_un.d_val, \
+ ranges[0].size / sizeof (ElfW(reloc))); \
} \
\
if ((do_lazy) \
@@ -284,20 +293,25 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
elf_dynamic_do_##reloc ((map), \
ranges[ranges_index].start, \
ranges[ranges_index].size, \
- ranges[ranges_index].lazy); \
+ ranges[ranges_index].nrelative, \
+ ranges[ranges_index].lazy, \
+ skip_ifunc); \
} while (0)
# else
-# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, test_rel) \
+# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, skip_ifunc, test_rel) \
do { \
- struct { ElfW(Addr) start, size; int lazy; } ranges[2]; \
- ranges[0].lazy = 0; \
- ranges[0].size = ranges[1].size = 0; \
- ranges[0].start = 0; \
+ struct { ElfW(Addr) start, size; \
+ __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative; int lazy; } \
+ ranges[2] = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }; \
\
if ((map)->l_info[DT_##RELOC]) \
{ \
ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \
ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \
+ if (map->l_info[VERSYMIDX (DT_##RELOC##COUNT)] != NULL) \
+ ranges[0].nrelative \
+ = MIN (map->l_info[VERSYMIDX (DT_##RELOC##COUNT)]->d_un.d_val, \
+ ranges[0].size / sizeof (ElfW(reloc))); \
} \
if ((map)->l_info[DT_PLTREL] \
&& (!test_rel || (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)) \
@@ -309,7 +323,8 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
/* This test does not only detect whether the relocation \
sections are in the right order, it also checks whether \
there is a DT_REL/DT_RELA section. */ \
- || ranges[0].start + ranges[0].size != start)) \
+ || __builtin_expect (ranges[0].start + ranges[0].size \
+ != start, 0))) \
{ \
ranges[1].start = start; \
ranges[1].size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \
@@ -324,7 +339,8 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
} \
\
if (ELF_DURING_STARTUP) \
- elf_dynamic_do_##reloc ((map), ranges[0].start, ranges[0].size, 0); \
+ elf_dynamic_do_##reloc ((map), ranges[0].start, ranges[0].size, \
+ ranges[0].nrelative, 0, skip_ifunc); \
else \
{ \
int ranges_index; \
@@ -332,7 +348,9 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
elf_dynamic_do_##reloc ((map), \
ranges[ranges_index].start, \
ranges[ranges_index].size, \
- ranges[ranges_index].lazy); \
+ ranges[ranges_index].nrelative, \
+ ranges[ranges_index].lazy, \
+ skip_ifunc); \
} \
} while (0)
# endif
@@ -345,29 +363,29 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
# if ! ELF_MACHINE_NO_REL
# include "do-rel.h"
-# define ELF_DYNAMIC_DO_REL(map, lazy) \
- _ELF_DYNAMIC_DO_RELOC (REL, rel, map, lazy, _ELF_CHECK_REL)
+# define ELF_DYNAMIC_DO_REL(map, lazy, skip_ifunc) \
+ _ELF_DYNAMIC_DO_RELOC (REL, Rel, map, lazy, skip_ifunc, _ELF_CHECK_REL)
# else
-# define ELF_DYNAMIC_DO_REL(map, lazy) /* Nothing to do. */
+# define ELF_DYNAMIC_DO_REL(map, lazy, skip_ifunc) /* Nothing to do. */
# endif
# if ! ELF_MACHINE_NO_RELA
# define DO_RELA
# include "do-rel.h"
-# define ELF_DYNAMIC_DO_RELA(map, lazy) \
- _ELF_DYNAMIC_DO_RELOC (RELA, rela, map, lazy, _ELF_CHECK_REL)
+# define ELF_DYNAMIC_DO_RELA(map, lazy, skip_ifunc) \
+ _ELF_DYNAMIC_DO_RELOC (RELA, Rela, map, lazy, skip_ifunc, _ELF_CHECK_REL)
# else
-# define ELF_DYNAMIC_DO_RELA(map, lazy) /* Nothing to do. */
+# define ELF_DYNAMIC_DO_RELA(map, lazy, skip_ifunc) /* Nothing to do. */
# endif
/* This can't just be an inline function because GCC is too dumb
to inline functions containing inlines themselves. */
-# define ELF_DYNAMIC_RELOCATE(map, lazy, consider_profile) \
+# define ELF_DYNAMIC_RELOCATE(map, lazy, consider_profile, skip_ifunc) \
do { \
int edr_lazy = elf_machine_runtime_setup ((map), (lazy), \
(consider_profile)); \
- ELF_DYNAMIC_DO_REL ((map), edr_lazy); \
- ELF_DYNAMIC_DO_RELA ((map), edr_lazy); \
+ ELF_DYNAMIC_DO_REL ((map), edr_lazy, skip_ifunc); \
+ ELF_DYNAMIC_DO_RELA ((map), edr_lazy, skip_ifunc); \
} while (0)
#endif
diff --git a/libc/elf/elf.h b/libc/elf/elf.h
index 47db25c16..7c6412078 100644
--- a/libc/elf/elf.h
+++ b/libc/elf/elf.h
@@ -142,7 +142,8 @@ typedef struct
#define ELFOSABI_SYSV 0 /* Alias. */
#define ELFOSABI_HPUX 1 /* HP-UX */
#define ELFOSABI_NETBSD 2 /* NetBSD. */
-#define ELFOSABI_LINUX 3 /* Linux. */
+#define ELFOSABI_GNU 3 /* Object uses GNU ELF extensions. */
+#define ELFOSABI_LINUX ELFOSABI_GNU /* Compatibility alias. */
#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
#define ELFOSABI_AIX 7 /* IBM AIX. */
#define ELFOSABI_IRIX 8 /* SGI Irix. */
diff --git a/libc/elf/pldd-xx.c b/libc/elf/pldd-xx.c
index 8ecd468dd..1e84ec211 100644
--- a/libc/elf/pldd-xx.c
+++ b/libc/elf/pldd-xx.c
@@ -101,7 +101,6 @@ E(find_maps) (pid_t pid, void *auxv, size_t auxv_size)
default:
break;
}
- printf("progam header at offset %lu\n", (unsigned long)phdr);
if (phdr == 0 || phnum == 0 || phent == 0)
error (EXIT_FAILURE, 0, gettext ("cannot find program header of process"));
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index 28360d144..b93a01f72 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -162,6 +162,7 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
._dl_lazy = 1,
._dl_fpu_control = _FPU_DEFAULT,
._dl_pointer_guard = 1,
+ ._dl_pagesize = EXEC_PAGESIZE,
/* Function pointers. */
._dl_debug_printf = _dl_debug_printf,
@@ -544,7 +545,7 @@ _dl_start (void *arg)
/* Relocate ourselves so we can do normal function calls and
data access using the global offset table. */
- ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0);
+ ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0, 0);
}
bootstrap_map.l_relocated = 1;
@@ -779,7 +780,12 @@ cannot allocate TLS data structures for initial thread");
/* And finally install it for the main thread. If ld.so itself uses
TLS we know the thread pointer was initialized earlier. */
- const char *lossage = TLS_INIT_TP (tcbp, USE___THREAD);
+ const char *lossage
+#ifdef USE___THREAD
+ = TLS_INIT_TP (tcbp, USE___THREAD);
+#else
+ = TLS_INIT_TP (tcbp, 0);
+#endif
if (__builtin_expect (lossage != NULL, 0))
_dl_fatal_printf ("cannot set up thread-local storage: %s\n", lossage);
tls_init_tp_called = true;
@@ -1946,8 +1952,9 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
/* Relocate the main executable. */
struct relocate_args args = { .l = l,
- .reloc_mode = (GLRO(dl_lazy)
- ? RTLD_LAZY : 0) };
+ .reloc_mode = ((GLRO(dl_lazy)
+ ? RTLD_LAZY : 0)
+ | __RTLD_NOIFUNC) };
_dl_receive_error (print_unresolved, relocate_doit, &args);
/* This loop depends on the dependencies of the executable to
@@ -2022,24 +2029,22 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
{
/* We have to do symbol dependency testing. */
struct relocate_args args;
- struct link_map *l;
+ unsigned int i;
- args.reloc_mode = GLRO(dl_lazy) ? RTLD_LAZY : 0;
+ args.reloc_mode = ((GLRO(dl_lazy) ? RTLD_LAZY : 0)
+ | __RTLD_NOIFUNC);
- l = main_map;
- while (l->l_next != NULL)
- l = l->l_next;
- do
+ i = main_map->l_searchlist.r_nlist;
+ while (i-- > 0)
{
+ struct link_map *l = main_map->l_initfini[i];
if (l != &GL(dl_rtld_map) && ! l->l_faked)
{
args.l = l;
_dl_receive_error (print_unresolved, relocate_doit,
&args);
}
- l = l->l_prev;
}
- while (l != NULL);
if ((GLRO_dl_debug_mask & DL_DEBUG_PRELINK)
&& rtld_multiple_ref)
@@ -2047,7 +2052,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
/* Mark the link map as not yet relocated again. */
GL(dl_rtld_map).l_relocated = 0;
_dl_relocate_object (&GL(dl_rtld_map),
- main_map->l_scope, 0, 0);
+ main_map->l_scope, __RTLD_NOIFUNC, 0);
}
}
#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED))
@@ -2310,7 +2315,12 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
TLS we know the thread pointer was initialized earlier. */
if (! tls_init_tp_called)
{
- const char *lossage = TLS_INIT_TP (tcbp, USE___THREAD);
+ const char *lossage
+#ifdef USE___THREAD
+ = TLS_INIT_TP (tcbp, USE___THREAD);
+#else
+ = TLS_INIT_TP (tcbp, 0);
+#endif
if (__builtin_expect (lossage != NULL, 0))
_dl_fatal_printf ("cannot set up thread-local storage: %s\n",
lossage);
diff --git a/libc/elf/sotruss.ksh b/libc/elf/sotruss.ksh
index 9da5bfffd..1c3f4eebf 100755
--- a/libc/elf/sotruss.ksh
+++ b/libc/elf/sotruss.ksh
@@ -31,22 +31,23 @@ lib='@PREFIX@/$LIB/audit/sotruss-lib.so'
function do_help {
echo $"Usage: sotruss [OPTION...] [--] EXECUTABLE [EXECUTABLE-OPTION...]
- -F, --from FROMLIST trace calls from objects on FORMLIST
- -T, --to TOLIST trace calls to objects on TOLIST
+ -F, --from FROMLIST Trace calls from objects on FROMLIST
+ -T, --to TOLIST Trace calls to objects on TOLIST
- -e, --exit also show exits from the function calls
- -f, --follow trace child processes
- -o, --output FILENAME write output to FILENAME (or FILENAME.$PID in case
+ -e, --exit Also show exits from the function calls
+ -f, --follow Trace child processes
+ -o, --output FILENAME Write output to FILENAME (or FILENAME.$PID in case
-f is also used) instead of standard error
- --help print this help and exit
- --version print version information and exit"
+ -?, --help Give this help list
+ --usage Give a short usage message
+ --version Print program version"
echo
printf $"Mandatory arguments to long options are also mandatory for any corresponding\nshort options.\n"
echo
- echo $"For bug reporting instructions, please see:
+ printf $"For bug reporting instructions, please see:
@REPORT_BUGS_TO@.
"
exit 0
@@ -80,12 +81,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
printf $"Written by %s.\n" "Ulrich Drepper"
exit 0
;;
- --h | --he | --hel | --help)
+ -\? | --h | --he | --hel | --help)
do_help
;;
--u | --us | --usa | --usag | --usage)
printf $"Usage: %s [-ef] [-F FROMLIST] [-o FILENAME] [-T TOLIST] [--exit]
- [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]\n" sotruss
+ [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]
+ [--help] [--usage] [--version] [--]
+ EXECUTABLE [EXECUTABLE-OPTION...]\n" sotruss
exit 0
;;
-F | --fr | --fro | --from)
diff --git a/libc/elf/sprof.c b/libc/elf/sprof.c
index 2535ff04d..a5caddded 100644
--- a/libc/elf/sprof.c
+++ b/libc/elf/sprof.c
@@ -407,7 +407,6 @@ load_shobj (const char *name)
ElfW(Addr) mapend = 0;
const ElfW(Phdr) *ph;
size_t textsize;
- unsigned int log_hashfraction;
ElfW(Ehdr) *ehdr;
int fd;
ElfW(Shdr) *shdr;
@@ -477,13 +476,6 @@ load_shobj (const char *name)
textsize = result->highpc - result->lowpc;
result->kcountsize = textsize / HISTFRACTION;
result->hashfraction = HASHFRACTION;
- if ((HASHFRACTION & (HASHFRACTION - 1)) == 0)
- /* If HASHFRACTION is a power of two, mcount can use shifting
- instead of integer division. Precompute shift amount. */
- log_hashfraction = __builtin_ffs (result->hashfraction
- * sizeof (struct here_fromstruct)) - 1;
- else
- log_hashfraction = -1;
if (do_test)
printf ("hashfraction = %d\ndivider = %Zu\n",
result->hashfraction,
diff --git a/libc/elf/tst-audit2.c b/libc/elf/tst-audit2.c
index fd089b6f6..b4fa90694 100644
--- a/libc/elf/tst-audit2.c
+++ b/libc/elf/tst-audit2.c
@@ -4,11 +4,9 @@
#include <stdlib.h>
#include <string.h>
-#if HAVE___THREAD
-# define MAGIC1 0xabcdef72
-# define MAGIC2 0xd8675309
+#define MAGIC1 0xabcdef72
+#define MAGIC2 0xd8675309
static __thread unsigned int magic[] = { MAGIC1, MAGIC2 };
-#endif
#undef calloc
@@ -18,7 +16,6 @@ static __thread unsigned int magic[] = { MAGIC1, MAGIC2 };
void *
calloc (size_t n, size_t m)
{
-#if HAVE___THREAD
if (magic[0] != MAGIC1 || magic[1] != MAGIC2)
{
printf ("{%x, %x} != {%x, %x}\n", magic[0], magic[1], MAGIC1, MAGIC2);
@@ -26,7 +23,6 @@ calloc (size_t n, size_t m)
}
magic[0] = MAGIC2;
magic[1] = MAGIC1;
-#endif
n *= m;
void *ptr = malloc (n);
@@ -38,13 +34,11 @@ calloc (size_t n, size_t m)
int
main (void)
{
-#if HAVE___THREAD
if (magic[1] != MAGIC1 || magic[0] != MAGIC2)
{
printf ("{%x, %x} != {%x, %x}\n", magic[0], magic[1], MAGIC2, MAGIC1);
return 1;
}
-#endif
return 0;
}
diff --git a/libc/elf/tst-tls10.c b/libc/elf/tst-tls10.c
index dbcc69727..347243f66 100644
--- a/libc/elf/tst-tls10.c
+++ b/libc/elf/tst-tls10.c
@@ -1,9 +1,7 @@
#include "tst-tls10.h"
-#ifdef USE_TLS__THREAD
__thread int dummy __attribute__((visibility ("hidden"))) = 12;
__thread struct A local = { 1, 2, 3 };
-#endif
#define CHECK(N, S) \
p = f##N##a (); \
@@ -13,7 +11,6 @@ __thread struct A local = { 1, 2, 3 };
int
main (void)
{
-#ifdef USE_TLS__THREAD
struct A *p;
if (local.a != 1 || local.b != 2 || local.c != 3)
abort ();
@@ -35,6 +32,6 @@ main (void)
abort ();
CHECK (9, 28);
CHECK (10, 31);
-#endif
+
exit (0);
}
diff --git a/libc/elf/tst-tls10.h b/libc/elf/tst-tls10.h
index bffc332a0..2b5709af7 100644
--- a/libc/elf/tst-tls10.h
+++ b/libc/elf/tst-tls10.h
@@ -1,9 +1,6 @@
#include <tls.h>
#include <stdlib.h>
-#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
-# define USE_TLS__THREAD
-
struct A
{
char a;
@@ -34,4 +31,3 @@ extern int f9b (void);
extern int f10b (void);
extern void check1 (void);
extern void check2 (void);
-#endif
diff --git a/libc/elf/tst-tls11.c b/libc/elf/tst-tls11.c
index 816cf5cc2..8a2fef4a7 100644
--- a/libc/elf/tst-tls11.c
+++ b/libc/elf/tst-tls11.c
@@ -8,7 +8,6 @@
int
main (void)
{
-#ifdef USE_TLS__THREAD
struct A *p;
check1 ();
check2 ();
@@ -22,6 +21,6 @@ main (void)
CHECK (8, 25);
CHECK (9, 28);
CHECK (10, 31);
-#endif
+
exit (0);
}
diff --git a/libc/elf/tst-tls12.c b/libc/elf/tst-tls12.c
index 84aa7d35c..9086d1717 100644
--- a/libc/elf/tst-tls12.c
+++ b/libc/elf/tst-tls12.c
@@ -8,11 +8,10 @@
int
main (void)
{
-#ifdef USE_TLS__THREAD
struct A *p;
check1 ();
CHECK (1, 4);
CHECK (2, 7);
-#endif
+
exit (0);
}
diff --git a/libc/elf/tst-tls14.c b/libc/elf/tst-tls14.c
index c1e6ba7e2..ffd31e97b 100644
--- a/libc/elf/tst-tls14.c
+++ b/libc/elf/tst-tls14.c
@@ -6,9 +6,7 @@
#include <tls.h>
-#if HAVE___THREAD
-
-# define AL 4096
+#define AL 4096
struct foo
{
int i;
@@ -55,12 +53,5 @@ do_test (void)
return result;
}
-# define TEST_FUNCTION do_test ()
-
-#else
-
-# define TEST_FUNCTION 0
-
-#endif
-
+#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
diff --git a/libc/elf/tst-tlsmod11.c b/libc/elf/tst-tlsmod11.c
index 9938b5753..cffbd68ed 100644
--- a/libc/elf/tst-tlsmod11.c
+++ b/libc/elf/tst-tlsmod11.c
@@ -1,6 +1,4 @@
#include "tst-tls10.h"
-#ifdef USE_TLS__THREAD
__thread struct A a1 = { 4, 5, 6 };
__thread struct A a2 = { 7, 8, 9 };
-#endif
diff --git a/libc/elf/tst-tlsmod12.c b/libc/elf/tst-tlsmod12.c
index 4602709a1..d0be51891 100644
--- a/libc/elf/tst-tlsmod12.c
+++ b/libc/elf/tst-tlsmod12.c
@@ -1,6 +1,5 @@
#include "tst-tls10.h"
-#ifdef USE_TLS__THREAD
extern __thread struct A a2 __attribute__((tls_model("initial-exec")));
void
@@ -11,4 +10,3 @@ check1 (void)
if (a2.a != 7 || a2.b != 8 || a2.c != 9)
abort ();
}
-#endif
diff --git a/libc/elf/tst-tlsmod13.c b/libc/elf/tst-tlsmod13.c
index e4e23af2d..76da630a0 100644
--- a/libc/elf/tst-tlsmod13.c
+++ b/libc/elf/tst-tlsmod13.c
@@ -1,10 +1,6 @@
#include <tls.h>
-#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
__thread int a[2] __attribute__ ((tls_model ("initial-exec")));
-#else
-int a[2];
-#endif
int
foo (void)
diff --git a/libc/elf/tst-tlsmod13a.c b/libc/elf/tst-tlsmod13a.c
index 70a02131e..d5515d4a1 100644
--- a/libc/elf/tst-tlsmod13a.c
+++ b/libc/elf/tst-tlsmod13a.c
@@ -1,10 +1,6 @@
#include <tls.h>
-#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
__thread int b[2] __attribute__ ((tls_model ("initial-exec")));
-#else
-int b[2];
-#endif
extern int foo (void);
diff --git a/libc/elf/tst-tlsmod14a.c b/libc/elf/tst-tlsmod14a.c
index ad1d179aa..6806d3403 100644
--- a/libc/elf/tst-tlsmod14a.c
+++ b/libc/elf/tst-tlsmod14a.c
@@ -3,9 +3,7 @@
#include <tls.h>
-#if HAVE___THREAD
-
-# define AL 4096
+#define AL 4096
struct foo
{
int i;
@@ -15,9 +13,9 @@ static __thread struct foo f;
static struct foo g;
-# ifndef FCT
-# define FCT in_dso1
-# endif
+#ifndef FCT
+# define FCT in_dso1
+#endif
int
@@ -37,5 +35,3 @@ FCT (void)
return result;
}
-
-#endif
diff --git a/libc/elf/tst-tlsmod15b.c b/libc/elf/tst-tlsmod15b.c
index 4f63eab14..b37283686 100644
--- a/libc/elf/tst-tlsmod15b.c
+++ b/libc/elf/tst-tlsmod15b.c
@@ -1,6 +1,5 @@
#include "tst-tls10.h"
-#ifdef USE_TLS__THREAD
__thread int mod15b_var __attribute__((tls_model("initial-exec")));
int
@@ -8,10 +7,3 @@ in_dso (void)
{
return mod15b_var;
}
-#else
-int
-in_dso (void)
-{
- return 0;
-}
-#endif
diff --git a/libc/elf/tst-tlsmod16a.c b/libc/elf/tst-tlsmod16a.c
index 847c8090f..c16e603c8 100644
--- a/libc/elf/tst-tlsmod16a.c
+++ b/libc/elf/tst-tlsmod16a.c
@@ -1,7 +1,3 @@
#include <tls.h>
-#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
int __thread tlsvar;
-#else
-int tlsvar;
-#endif
diff --git a/libc/elf/tst-tlsmod16b.c b/libc/elf/tst-tlsmod16b.c
index 308e6bae9..7268c56bc 100644
--- a/libc/elf/tst-tlsmod16b.c
+++ b/libc/elf/tst-tlsmod16b.c
@@ -1,10 +1,6 @@
#include <tls.h>
-#if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
extern __thread int tlsvar __attribute__((tls_model("initial-exec")));
-#else
-extern int tlsvar;
-#endif
void *
in_dso (void)
diff --git a/libc/elf/tst-tlsmod7.c b/libc/elf/tst-tlsmod7.c
index 944b97f9c..3df7907bc 100644
--- a/libc/elf/tst-tlsmod7.c
+++ b/libc/elf/tst-tlsmod7.c
@@ -1,6 +1,5 @@
#include "tst-tls10.h"
-#ifdef USE_TLS__THREAD
__thread int dummy __attribute__((visibility ("hidden"))) = 12;
__thread struct A a1 = { 4, 5, 6 };
__thread struct A a2 = { 7, 8, 9 };
@@ -100,4 +99,3 @@ f6b (void)
{
return local2.c;
}
-#endif
diff --git a/libc/elf/tst-tlsmod8.c b/libc/elf/tst-tlsmod8.c
index c1822fc0c..89772ac42 100644
--- a/libc/elf/tst-tlsmod8.c
+++ b/libc/elf/tst-tlsmod8.c
@@ -1,6 +1,5 @@
#include "tst-tls10.h"
-#ifdef USE_TLS__THREAD
__thread long long dummy __attribute__((visibility ("hidden"))) = 12;
__thread struct A a2 = { 22, 23, 24 };
__thread struct A a4 __attribute__((tls_model("initial-exec")))
@@ -69,4 +68,3 @@ f10b (void)
{
return local2.c;
}
-#endif
diff --git a/libc/elf/tst-tlsmod9.c b/libc/elf/tst-tlsmod9.c
index e124144e4..6b11ed58b 100644
--- a/libc/elf/tst-tlsmod9.c
+++ b/libc/elf/tst-tlsmod9.c
@@ -1,6 +1,5 @@
#include "tst-tls10.h"
-#ifdef USE_TLS__THREAD
__thread int dummy __attribute__((visibility ("hidden"))) = 12;
__thread struct A a1 = { 4, 5, 6 };
__thread struct A a3 __attribute__((tls_model("initial-exec")))
@@ -98,4 +97,3 @@ f6b (void)
{
return local2.c;
}
-#endif
diff --git a/libc/gmon/gmon.c b/libc/gmon/gmon.c
index af2ac1c0f..0d2ed0594 100644
--- a/libc/gmon/gmon.c
+++ b/libc/gmon/gmon.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1983, 1992, 1993
+ * Copyright (c) 1983, 1992, 1993, 2011
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
+#include <wchar.h>
#include <stdio.h>
#include <stdlib.h>
@@ -45,9 +46,6 @@
#include <libc-internal.h>
#include <not-cancel.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
/* Head of basic-block list or NULL. */
struct __bb *__bb_head attribute_hidden;
@@ -194,7 +192,7 @@ write_hist (fd)
char dimen_abbrev;
} thdr;
struct iovec iov[3] =
- {
+ {
{ &tag, sizeof (tag) },
{ &thdr, sizeof (struct gmon_hist_hdr) },
{ _gmonparam.kcount, _gmonparam.kcountsize }
diff --git a/libc/grp/fgetgrent_r.c b/libc/grp/fgetgrent_r.c
index 8278a4516..f7135ee90 100644
--- a/libc/grp/fgetgrent_r.c
+++ b/libc/grp/fgetgrent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996-1999, 2000, 2011 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
@@ -21,11 +21,9 @@
#include <grp.h>
#include <stdio.h>
-#ifdef USE_IN_LIBIO
-# include <libio/iolibio.h>
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#include <libio/iolibio.h>
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
/* Define a line parsing function using the common code
used in the nss_files module. */
diff --git a/libc/grp/initgroups.c b/libc/grp/initgroups.c
index 48119ff7f..c63bba138 100644
--- a/libc/grp/initgroups.c
+++ b/libc/grp/initgroups.c
@@ -82,9 +82,8 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
if (__nss_initgroups_database == NULL)
{
- no_more = __nss_database_lookup ("initgroups", NULL, "",
- &__nss_initgroups_database);
- if (no_more == 0 && __nss_initgroups_database == NULL)
+ if (__nss_database_lookup ("initgroups", NULL, "",
+ &__nss_initgroups_database) < 0)
{
if (__nss_group_database == NULL)
no_more = __nss_database_lookup ("group", NULL, "compat files",
@@ -92,11 +91,8 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
__nss_initgroups_database = __nss_group_database;
}
- else if (__nss_initgroups_database != NULL)
- {
- assert (no_more == 0);
- use_initgroups_entry = true;
- }
+ else
+ use_initgroups_entry = true;
}
else
/* __nss_initgroups_database might have been set through
diff --git a/libc/grp/putgrent.c b/libc/grp/putgrent.c
index 382d6a4da..6d7dce9d7 100644
--- a/libc/grp/putgrent.c
+++ b/libc/grp/putgrent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,96,98,99,2000,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,96,98,99,2000,2005,2011 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
@@ -20,10 +20,8 @@
#include <stdio.h>
#include <grp.h>
-#ifdef USE_IN_LIBIO
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
#define _S(x) x ? x : ""
diff --git a/libc/hurd/fopenport.c b/libc/hurd/fopenport.c
index 5dcb5ab30..d01b9f3f3 100644
--- a/libc/hurd/fopenport.c
+++ b/libc/hurd/fopenport.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,95,97,2000,01,02 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1995,1997,2000-2002,2011 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
@@ -63,11 +63,7 @@ writeio (void *cookie, const char *buf, size_t n)
Returns zero if successful, nonzero if not. */
static int
seekio (void *cookie,
-#ifdef USE_IN_LIBIO
_IO_off64_t *pos,
-#else
- fpos_t *pos,
-#endif
int whence)
{
error_t err = __io_seek ((file_t) cookie, *pos, whence, pos);
@@ -86,12 +82,8 @@ closeio (void *cookie)
return 0;
}
-#ifdef USE_IN_LIBIO
#include "../libio/libioP.h"
#define fopencookie _IO_fopencookie
-#else
-#define cookie_io_functions_t __io_functions
-#endif
static const cookie_io_functions_t funcsio =
{ readio, writeio, seekio, closeio };
diff --git a/libc/hurd/vpprintf.c b/libc/hurd/vpprintf.c
index 796799816..0b09df34d 100644
--- a/libc/hurd/vpprintf.c
+++ b/libc/hurd/vpprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,94,97,2000,01 Free Software Foundation, Inc.
+/* Copyright (C) 1991,94,97,2000,01,11 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
@@ -21,9 +21,7 @@
#include <string.h>
#include <hurd.h>
-#ifdef USE_IN_LIBIO
-# include <libioP.h>
-#endif
+#include <libioP.h>
static ssize_t
do_write (void *cookie, const char *buf, size_t n)
@@ -42,8 +40,6 @@ vpprintf (io_t port, const char *format, va_list arg)
{
int done;
-#ifdef USE_IN_LIBIO
-
struct locked_FILE
{
struct _IO_cookie_file cfile;
@@ -60,24 +56,5 @@ vpprintf (io_t port, const char *format, va_list arg)
done = _IO_vfprintf (&temp_f.cfile.__fp.file, format, arg);
-#else
-
- FILE f;
-
- /* Create an unbuffered stream talking to PORT on the stack. */
- memset ((void *) &f, 0, sizeof (f));
- f.__magic = _IOMAGIC;
- f.__mode.__write = 1;
- f.__cookie = (void *) port;
- f.__room_funcs = __default_room_functions;
- f.__io_funcs.__write = do_write;
- f.__seen = 1;
- f.__userbuf = 1;
-
- /* vfprintf will use a buffer on the stack for the life of the call. */
- done = vfprintf (&f, format, arg);
-
-#endif
-
return done;
}
diff --git a/libc/iconv/gconv_conf.c b/libc/iconv/gconv_conf.c
index 2023beb26..b28cb3c9a 100644
--- a/libc/iconv/gconv_conf.c
+++ b/libc/iconv/gconv_conf.c
@@ -1,5 +1,5 @@
/* Handle configuration data.
- Copyright (C) 1997-2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2003, 2005, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -90,10 +90,8 @@ static const char builtin_aliases[] =
#undef BUILTIN_ALIAS
};
-#ifdef USE_IN_LIBIO
-# include <libio/libioP.h>
-# define __getdelim(line, len, c, fp) _IO_getdelim (line, len, c, fp)
-#endif
+#include <libio/libioP.h>
+#define __getdelim(line, len, c, fp) _IO_getdelim (line, len, c, fp)
/* Value of the GCONV_PATH environment variable. */
diff --git a/libc/include/bits/select2.h b/libc/include/bits/select2.h
new file mode 100644
index 000000000..08f725964
--- /dev/null
+++ b/libc/include/bits/select2.h
@@ -0,0 +1 @@
+#include "../../misc/bits/select2.h"
diff --git a/libc/include/ctype.h b/libc/include/ctype.h
index f4b782e13..4b5abda37 100644
--- a/libc/include/ctype.h
+++ b/libc/include/ctype.h
@@ -1,5 +1,9 @@
#ifndef _CTYPE_H
+/* Initialize ctype locale data. */
+extern void __ctype_init (void);
+libc_hidden_proto (__ctype_init)
+
extern int __isctype (int __c, int __mask);
# ifndef NOT_IN_libc
@@ -22,31 +26,23 @@ __libc_tsd_define (extern, const uint16_t *, CTYPE_B)
__libc_tsd_define (extern, const int32_t *, CTYPE_TOUPPER)
__libc_tsd_define (extern, const int32_t *, CTYPE_TOLOWER)
+
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
__ctype_b_loc (void)
{
- const uint16_t **tablep = __libc_tsd_address (const uint16_t *, CTYPE_B);
- if (__builtin_expect (*tablep == NULL, 0))
- *tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
- return tablep;
+ return __libc_tsd_address (const uint16_t *, CTYPE_B);
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_toupper_loc (void)
{
- const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
- if (__builtin_expect (*tablep == NULL, 0))
- *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
- return tablep;
+ return __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_tolower_loc (void)
{
- const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
- if (__builtin_expect (*tablep == NULL, 0))
- *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
- return tablep;
+ return __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
}
# endif /* Not NOT_IN_libc. */
diff --git a/libc/include/dlfcn.h b/libc/include/dlfcn.h
index af92483f5..9e76d3560 100644
--- a/libc/include/dlfcn.h
+++ b/libc/include/dlfcn.h
@@ -10,6 +10,7 @@
#define __RTLD_CALLMAP 0x10000000
#define __RTLD_AUDIT 0x08000000
#define __RTLD_SECURE 0x04000000 /* Apply additional security checks. */
+#define __RTLD_NOIFUNC 0x02000000 /* Suppress calling ifunc functions. */
#define __LM_ID_CALLER -2
diff --git a/libc/include/errno.h b/libc/include/errno.h
index 80c7b6ec1..98c608052 100644
--- a/libc/include/errno.h
+++ b/libc/include/errno.h
@@ -21,15 +21,13 @@ extern int rtld_errno attribute_hidden;
# include <tls.h>
-# if USE___THREAD
-# undef errno
-# ifndef NOT_IN_libc
-# define errno __libc_errno
-# else
-# define errno errno /* For #ifndef errno tests. */
-# endif
-extern __thread int errno attribute_tls_model_ie;
+# undef errno
+# ifndef NOT_IN_libc
+# define errno __libc_errno
+# else
+# define errno errno /* For #ifndef errno tests. */
# endif
+extern __thread int errno attribute_tls_model_ie;
# endif /* RTLD_PRIVATE_ERRNO */
diff --git a/libc/include/libc-symbols.h b/libc/include/libc-symbols.h
index b6ac4eac4..bc6731f7d 100644
--- a/libc/include/libc-symbols.h
+++ b/libc/include/libc-symbols.h
@@ -216,11 +216,6 @@
# define internal_function /* empty */
#endif
-/* Prepare for the case that `__builtin_expect' is not available. */
-#ifndef HAVE_BUILTIN_EXPECT
-# define __builtin_expect(expr, val) (expr)
-#endif
-
/* Determine the return address. */
#define RETURN_ADDRESS(nr) \
__builtin_extract_return_addr (__builtin_return_address (nr))
@@ -481,11 +476,7 @@ for linking")
# define attribute_hidden
#endif
-#ifdef HAVE_TLS_MODEL_ATTRIBUTE
-# define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
-#else
-# define attribute_tls_model_ie
-#endif
+#define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
#define attribute_relro __attribute__ ((section (".data.rel.ro")))
@@ -815,22 +806,12 @@ for linking")
# define libnss_nisplus_hidden_data_ver(local, name)
#endif
-#ifdef HAVE_BUILTIN_REDIRECTION
-# define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
-# define libc_hidden_builtin_def(name) libc_hidden_def (name)
-# define libc_hidden_builtin_weak(name) libc_hidden_weak (name)
-# define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name)
-# ifdef __ASSEMBLER__
-# define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
-# endif
-#else
-# define libc_hidden_builtin_proto(name, attrs...)
-# define libc_hidden_builtin_def(name)
-# define libc_hidden_builtin_weak(name)
-# define libc_hidden_builtin_ver(local, name)
-# ifdef __ASSEMBLER__
-# define HIDDEN_BUILTIN_JUMPTARGET(name) JUMPTARGET(name)
-# endif
+#define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
+#define libc_hidden_builtin_def(name) libc_hidden_def (name)
+#define libc_hidden_builtin_weak(name) libc_hidden_weak (name)
+#define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name)
+#ifdef __ASSEMBLER__
+# define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
#endif
#if defined NOT_IN_libc && defined IS_IN_libutil
diff --git a/libc/include/math.h b/libc/include/math.h
index eb29ef1a5..393488017 100644
--- a/libc/include/math.h
+++ b/libc/include/math.h
@@ -31,4 +31,8 @@ libm_hidden_proto (__expl)
libm_hidden_proto (__expm1l)
# endif
+extern int __isinf_ns (double);
+extern int __isinf_nsf (float);
+extern int __isinf_nsl (long double);
+
#endif
diff --git a/libc/include/netdb.h b/libc/include/netdb.h
index b75c317b9..384d6a99d 100644
--- a/libc/include/netdb.h
+++ b/libc/include/netdb.h
@@ -2,29 +2,19 @@
#include <resolv/netdb.h>
/* Macros for accessing h_errno from inside libc. */
+# undef h_errno
# ifdef _LIBC_REENTRANT
# include <tls.h>
-# if USE___THREAD
-# undef h_errno
-# ifndef NOT_IN_libc
-# define h_errno __libc_h_errno
-# else
-# define h_errno h_errno /* For #ifndef h_errno tests. */
-# endif
-extern __thread int h_errno attribute_tls_model_ie;
-# define __set_h_errno(x) (h_errno = (x))
+# ifndef NOT_IN_libc
+# define h_errno __libc_h_errno
# else
-static inline int
-__set_h_errno (int __err)
-{
- return *__h_errno_location () = __err;
-}
+# define h_errno h_errno /* For #ifndef h_errno tests. */
# endif
+extern __thread int h_errno attribute_tls_model_ie;
# else
-# undef h_errno
-# define __set_h_errno(x) (h_errno = (x))
extern int h_errno;
# endif /* _LIBC_REENTRANT */
+# define __set_h_errno(x) (h_errno = (x))
libc_hidden_proto (hstrerror)
libc_hidden_proto (innetgr)
diff --git a/libc/include/resolv.h b/libc/include/resolv.h
index 7ab7f8779..30ea8776b 100644
--- a/libc/include/resolv.h
+++ b/libc/include/resolv.h
@@ -15,14 +15,12 @@
# ifdef _LIBC_REENTRANT
# include <tls.h>
-# if USE___THREAD
-# undef _res
-# ifndef NOT_IN_libc
-# define __resp __libc_resp
-# endif
-# define _res (*__resp)
-extern __thread struct __res_state *__resp attribute_tls_model_ie;
+# undef _res
+# ifndef NOT_IN_libc
+# define __resp __libc_resp
# endif
+# define _res (*__resp)
+extern __thread struct __res_state *__resp attribute_tls_model_ie;
# else
# ifndef __BIND_NOSTATIC
# undef _res
diff --git a/libc/include/tls.h b/libc/include/tls.h
deleted file mode 100644
index 1642456a7..000000000
--- a/libc/include/tls.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* This file defines USE___THREAD to 1 or 0 to cut down on the #if mess. */
-
-#ifndef _include_tls_h
-#define _include_tls_h 1
-
-#include_next <tls.h>
-
-#if HAVE___THREAD && (!defined NOT_IN_libc || defined IS_IN_libpthread)
-
-# define USE___THREAD 1
-
-#else
-
-# define USE___THREAD 0
-
-#endif
-
-#endif
diff --git a/libc/inet/getnetgrent_r.c b/libc/inet/getnetgrent_r.c
index 6aaba7b03..197dd37a5 100644
--- a/libc/inet/getnetgrent_r.c
+++ b/libc/inet/getnetgrent_r.c
@@ -28,6 +28,7 @@
#include "netgroup.h"
#include "nsswitch.h"
#include <sysdep.h>
+#include <nscd/nscd_proto.h>
/* Protect above variable against multiple uses at the same time. */
@@ -101,7 +102,7 @@ endnetgrent_hook (struct __netgrent *datap)
{
enum nss_status (*endfct) (struct __netgrent *);
- if (datap->nip == NULL)
+ if (datap->nip == NULL || datap->nip == (service_user *) -1l)
return;
endfct = __nss_lookup_function (datap->nip, "endnetgrent");
@@ -189,8 +190,21 @@ setnetgrent (const char *group)
__libc_lock_lock (lock);
+ if (__nss_not_use_nscd_netgroup > 0
+ && ++__nss_not_use_nscd_netgroup > NSS_NSCD_RETRY)
+ __nss_not_use_nscd_netgroup = 0;
+
+ if (!__nss_not_use_nscd_netgroup
+ && !__nss_database_custom[NSS_DBSIDX_netgroup])
+ {
+ result = __nscd_setnetgrent (group, &dataset);
+ if (result >= 0)
+ goto out;
+ }
+
result = internal_setnetgrent (group, &dataset);
+ out:
__libc_lock_unlock (lock);
return result;
@@ -226,6 +240,26 @@ int internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
char *buffer, size_t buflen, int *errnop);
libc_hidden_proto (internal_getnetgrent_r)
+
+static enum nss_status
+nscd_getnetgrent (struct __netgrent *datap, char *buffer, size_t buflen,
+ int *errnop)
+{
+ if (datap->cursor >= datap->data + datap->data_size)
+ return NSS_STATUS_UNAVAIL;
+
+ datap->type = triple_val;
+ datap->val.triple.host = datap->cursor;
+ datap->cursor = (char *) __rawmemchr (datap->cursor, '\0') + 1;
+ datap->val.triple.user = datap->cursor;
+ datap->cursor = (char *) __rawmemchr (datap->cursor, '\0') + 1;
+ datap->val.triple.domain = datap->cursor;
+ datap->cursor = (char *) __rawmemchr (datap->cursor, '\0') + 1;
+
+ return NSS_STATUS_SUCCESS;
+}
+
+
int
internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
struct __netgrent *datap,
@@ -239,9 +273,18 @@ internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
/* Run through available functions, starting with the same function last
run. We will repeat each function as long as it succeeds, and then go
on to the next service action. */
- int no_more = (datap->nip == NULL
- || (fct = __nss_lookup_function (datap->nip, "getnetgrent_r"))
- == NULL);
+ int no_more = datap->nip == NULL;
+ if (! no_more)
+ {
+ if (datap->nip == (service_user *) -1l)
+ fct = nscd_getnetgrent;
+ else
+ {
+ fct = __nss_lookup_function (datap->nip, "getnetgrent_r");
+ no_more = fct == NULL;
+ }
+ }
+
while (! no_more)
{
status = DL_CALL_FCT (*fct, (datap, buffer, buflen, &errno));
@@ -342,6 +385,18 @@ int
innetgr (const char *netgroup, const char *host, const char *user,
const char *domain)
{
+ if (__nss_not_use_nscd_netgroup > 0
+ && ++__nss_not_use_nscd_netgroup > NSS_NSCD_RETRY)
+ __nss_not_use_nscd_netgroup = 0;
+
+ if (!__nss_not_use_nscd_netgroup
+ && !__nss_database_custom[NSS_DBSIDX_netgroup])
+ {
+ int result = __nscd_innetgr (netgroup, host, user, domain);
+ if (result >= 0)
+ return result;
+ }
+
union
{
enum nss_status (*f) (const char *, struct __netgrent *);
@@ -453,7 +508,7 @@ innetgr (const char *netgroup, const char *host, const char *user,
entry.needed_groups = tmp->next;
tmp->next = entry.known_groups;
entry.known_groups = tmp;
- current_group = entry.known_groups->name;
+ current_group = tmp->name;
continue;
}
diff --git a/libc/inet/herrno-loc.c b/libc/inet/herrno-loc.c
index fd6deeb33..1c2002bee 100644
--- a/libc/inet/herrno-loc.c
+++ b/libc/inet/herrno-loc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 97, 98, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 97, 98, 2002, 2011 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
@@ -19,10 +19,6 @@
#include <netdb.h>
#include <tls.h>
-#if ! USE___THREAD
-# undef h_errno
-extern int h_errno;
-#endif
/* When threaded, h_errno may be a per-thread variable. */
int *
diff --git a/libc/inet/herrno.c b/libc/inet/herrno.c
index 9ff30a191..59706cdc0 100644
--- a/libc/inet/herrno.c
+++ b/libc/inet/herrno.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,97,98,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996,97,98,2002,2003,2011 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
@@ -25,23 +25,7 @@
/* We need to have the error status variable of the resolver
accessible in the libc. */
-#if USE___THREAD
__thread int h_errno;
extern __thread int __libc_h_errno __attribute__ ((alias ("h_errno")))
attribute_hidden;
-# define h_errno __libc_h_errno
-#else
-/* This differs from plain `int h_errno;' in that it doesn't create
- a common definition, but a plain symbol that resides in .bss,
- which can have an alias. */
-int h_errno __attribute__((section (".bss")));
-weak_alias (h_errno, _h_errno)
-
-/* We declare these with compat_symbol so that they are not
- visible at link time. Programs must use the accessor functions. */
-# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
-# include <shlib-compat.h>
-compat_symbol (libc, h_errno, h_errno, GLIBC_2_0);
-compat_symbol (libc, _h_errno, _h_errno, GLIBC_2_0);
-# endif
-#endif
+#define h_errno __libc_h_errno
diff --git a/libc/intl/Makefile b/libc/intl/Makefile
index 5ea97035b..c3cc4bd53 100644
--- a/libc/intl/Makefile
+++ b/libc/intl/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2003, 2005, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1995-2003, 2005, 2008, 2011 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
@@ -54,9 +54,6 @@ generated-dirs := domaindir localedir
ifneq (no,$(BISON))
plural.c: plural.y
$(BISON) $(BISONFLAGS) $@ $^
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -m'$(BISON) $(BISONFLAGS) $@ $^' $@
-endif
endif
$(objpfx)plural.o: plural.c
diff --git a/libc/intl/gettextP.h b/libc/intl/gettextP.h
index f1aa329e4..381e0f18e 100644
--- a/libc/intl/gettextP.h
+++ b/libc/intl/gettextP.h
@@ -1,5 +1,5 @@
/* Header describing internals of libintl library.
- Copyright (C) 1995-1999, 2000, 2001, 2004-2005, 2007
+ Copyright (C) 1995-1999, 2000, 2001, 2004-2005, 2007, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
@@ -54,12 +54,6 @@
# define attribute_hidden
#endif
-/* Tell the compiler when a conditional or integer expression is
- almost always true or almost always false. */
-#ifndef HAVE_BUILTIN_EXPECT
-# define __builtin_expect(expr, val) (expr)
-#endif
-
#ifndef W
# define W(flag, data) ((flag) ? SWAP (data) : (data))
#endif
diff --git a/libc/intl/loadinfo.h b/libc/intl/loadinfo.h
index 2c1b44cec..52abfc3c6 100644
--- a/libc/intl/loadinfo.h
+++ b/libc/intl/loadinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2002-2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -44,12 +44,6 @@
# define internal_function
#endif
-/* Tell the compiler when a conditional or integer expression is
- almost always true or almost always false. */
-#ifndef HAVE_BUILTIN_EXPECT
-# define __builtin_expect(expr, val) (expr)
-#endif
-
/* Encoding of locale name parts. */
#define XPG_NORM_CODESET 1
#define XPG_CODESET 2
diff --git a/libc/intl/plural.c b/libc/intl/plural.c
index 506c295ee..dc89c343d 100644
--- a/libc/intl/plural.c
+++ b/libc/intl/plural.c
@@ -1,14 +1,14 @@
-/* A Bison parser, made by GNU Bison 2.3. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010, 2011 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -47,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -55,43 +53,28 @@
/* Pure parsers. */
#define YYPURE 1
+/* Push parsers. */
+#define YYPUSH 0
+
+/* Pull parsers. */
+#define YYPULL 1
+
/* Using locations. */
#define YYLSP_NEEDED 0
/* Substitute the variable and function names. */
-#define yyparse __gettextparse
-#define yylex __gettextlex
-#define yyerror __gettexterror
-#define yylval __gettextlval
-#define yychar __gettextchar
-#define yydebug __gettextdebug
-#define yynerrs __gettextnerrs
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- EQUOP2 = 258,
- CMPOP2 = 259,
- ADDOP2 = 260,
- MULOP2 = 261,
- NUMBER = 262
- };
-#endif
-/* Tokens. */
-#define EQUOP2 258
-#define CMPOP2 259
-#define ADDOP2 260
-#define MULOP2 261
-#define NUMBER 262
-
-
+#define yyparse __gettextparse
+#define yylex __gettextlex
+#define yyerror __gettexterror
+#define yylval __gettextlval
+#define yychar __gettextchar
+#define yydebug __gettextdebug
+#define yynerrs __gettextnerrs
/* Copy the first part of user declarations. */
+
+/* Line 189 of yacc.c */
#line 1 "plural.y"
/* Expression parsing for plural form selection.
@@ -140,6 +123,9 @@
#define YYPARSE_PARAM arg
+/* Line 189 of yacc.c */
+#line 128 "plural.c"
+
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -158,25 +144,48 @@
# define YYTOKEN_TABLE 0
#endif
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ EQUOP2 = 258,
+ CMPOP2 = 259,
+ ADDOP2 = 260,
+ MULOP2 = 261,
+ NUMBER = 262
+ };
+#endif
+
+
+
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 50 "plural.y"
{
+
+/* Line 214 of yacc.c */
+#line 50 "plural.y"
+
unsigned long int num;
enum operator op;
struct expression *exp;
-}
-/* Line 193 of yacc.c. */
-#line 171 "plural.c"
- YYSTYPE;
+
+
+
+/* Line 214 of yacc.c */
+#line 179 "plural.c"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
#endif
-
/* Copy the second part of user declarations. */
+
+/* Line 264 of yacc.c */
#line 56 "plural.y"
/* Prototypes for local functions. */
@@ -277,8 +286,8 @@ new_exp_3 (op, bexp, tbranch, fbranch)
-/* Line 216 of yacc.c. */
-#line 282 "plural.c"
+/* Line 264 of yacc.c */
+#line 291 "plural.c"
#ifdef short
# undef short
@@ -328,7 +337,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -353,14 +362,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
-YYID (int i)
+YYID (int yyi)
#else
static int
-YYID (i)
- int i;
+YYID (yyi)
+ int yyi;
#endif
{
- return i;
+ return yyi;
}
#endif
@@ -441,9 +450,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- };
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -477,12 +486,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack) \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
@@ -683,9 +692,18 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -742,7 +760,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -853,17 +871,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else
static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
+yy_stack_print (yybottom, yytop)
+ yytype_int16 *yybottom;
+ yytype_int16 *yytop;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
YYFPRINTF (stderr, "\n");
}
@@ -897,11 +918,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- fprintf (stderr, " $%d = ", yyi + 1);
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
- );
- fprintf (stderr, "\n");
+ );
+ YYFPRINTF (stderr, "\n");
}
}
@@ -1181,10 +1202,8 @@ yydestruct (yymsg, yytype, yyvaluep)
break;
}
}
-
/* Prevent warnings from -Wmissing-prototypes. */
-
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
@@ -1203,10 +1222,9 @@ int yyparse ();
-
-/*----------.
-| yyparse. |
-`----------*/
+/*-------------------------.
+| yyparse or yypush_parse. |
+`-------------------------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1230,74 +1248,75 @@ yyparse ()
#endif
#endif
{
- /* The look-ahead symbol. */
+/* The lookahead symbol. */
int yychar;
-/* The semantic value of the look-ahead symbol. */
+/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
-/* Number of syntax errors so far. */
-int yynerrs;
-
- int yystate;
- int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
+ /* Number of syntax errors so far. */
+ int yynerrs;
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
+ /* The stacks and their tools:
+ `yyss': related to states.
+ `yyvs': related to semantic values.
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
- YYSIZE_T yystacksize = YYINITDEPTH;
+ YYSIZE_T yystacksize;
+ int yyn;
+ int yyresult;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
+ yytoken = 0;
+ yyss = yyssa;
+ yyvs = yyvsa;
+ yystacksize = YYINITDEPTH;
+
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
-
yyssp = yyss;
yyvsp = yyvs;
@@ -1327,7 +1346,6 @@ int yynerrs;
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
-
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
@@ -1335,7 +1353,6 @@ int yynerrs;
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
-
&yystacksize);
yyss = yyss1;
@@ -1358,9 +1375,8 @@ int yynerrs;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@@ -1371,7 +1387,6 @@ int yynerrs;
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
-
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@@ -1381,6 +1396,9 @@ int yynerrs;
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
goto yybackup;
/*-----------.
@@ -1389,16 +1407,16 @@ int yynerrs;
yybackup:
/* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
+ lookahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to look-ahead token. */
+ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@@ -1430,20 +1448,16 @@ yybackup:
goto yyreduce;
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the look-ahead token. */
+ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
@@ -1482,96 +1496,121 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 2:
+ case 2:
+
+/* Line 1464 of yacc.c */
#line 176 "plural.y"
{
if ((yyvsp[(1) - (1)].exp) == NULL)
YYABORT;
((struct parse_args *) arg)->res = (yyvsp[(1) - (1)].exp);
- }
+ ;}
break;
case 3:
+
+/* Line 1464 of yacc.c */
#line 184 "plural.y"
{
(yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp));
- }
+ ;}
break;
case 4:
+
+/* Line 1464 of yacc.c */
#line 188 "plural.y"
{
(yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
- }
+ ;}
break;
case 5:
+
+/* Line 1464 of yacc.c */
#line 192 "plural.y"
{
(yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
- }
+ ;}
break;
case 6:
+
+/* Line 1464 of yacc.c */
#line 196 "plural.y"
{
(yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
- }
+ ;}
break;
case 7:
+
+/* Line 1464 of yacc.c */
#line 200 "plural.y"
{
(yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
- }
+ ;}
break;
case 8:
+
+/* Line 1464 of yacc.c */
#line 204 "plural.y"
{
(yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
- }
+ ;}
break;
case 9:
+
+/* Line 1464 of yacc.c */
#line 208 "plural.y"
{
(yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
- }
+ ;}
break;
case 10:
+
+/* Line 1464 of yacc.c */
#line 212 "plural.y"
{
(yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp));
- }
+ ;}
break;
case 11:
+
+/* Line 1464 of yacc.c */
#line 216 "plural.y"
{
(yyval.exp) = new_exp_0 (var);
- }
+ ;}
break;
case 12:
+
+/* Line 1464 of yacc.c */
#line 220 "plural.y"
{
if (((yyval.exp) = new_exp_0 (num)) != NULL)
(yyval.exp)->val.num = (yyvsp[(1) - (1)].num);
- }
+ ;}
break;
case 13:
+
+/* Line 1464 of yacc.c */
#line 225 "plural.y"
{
(yyval.exp) = (yyvsp[(2) - (3)].exp);
- }
+ ;}
break;
-/* Line 1267 of yacc.c. */
-#line 1575 "plural.c"
+
+/* Line 1464 of yacc.c */
+#line 1614 "plural.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -1582,7 +1621,6 @@ yyreduce:
*++yyvsp = yyval;
-
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -1647,7 +1685,7 @@ yyerrlab:
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse look-ahead token after an
+ /* If just tried and failed to reuse lookahead token after an
error, discard it. */
if (yychar <= YYEOF)
@@ -1664,7 +1702,7 @@ yyerrlab:
}
}
- /* Else will try to reuse look-ahead token after shifting the error
+ /* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
@@ -1721,9 +1759,6 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
*++yyvsp = yylval;
@@ -1748,7 +1783,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -1759,7 +1794,7 @@ yyexhaustedlab:
#endif
yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
+ if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
@@ -1785,6 +1820,8 @@ yyreturn:
}
+
+/* Line 1684 of yacc.c */
#line 230 "plural.y"
@@ -1967,4 +2004,3 @@ yyerror (str)
{
/* Do nothing. We don't print error messages here. */
}
-
diff --git a/libc/libio/genops.c b/libc/libio/genops.c
index 481fbc52b..5d21c4240 100644
--- a/libc/libio/genops.c
+++ b/libc/libio/genops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007
+/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -471,7 +471,7 @@ _IO_default_xsputn (f, data, n)
f->_IO_write_ptr += count;
#endif
s += count;
- }
+ }
else if (count)
{
char *p = f->_IO_write_ptr;
@@ -479,9 +479,9 @@ _IO_default_xsputn (f, data, n)
for (i = count; --i >= 0; )
*p++ = *s++;
f->_IO_write_ptr = p;
- }
+ }
more -= count;
- }
+ }
if (more == 0 || _IO_OVERFLOW (f, (unsigned char) *s++) == EOF)
break;
more--;
@@ -534,9 +534,9 @@ _IO_default_xsgetn (fp, data, n)
while (--i >= 0)
*s++ = *p++;
fp->_IO_read_ptr = p;
- }
- more -= count;
- }
+ }
+ more -= count;
+ }
if (more == 0 || __underflow (fp) == EOF)
break;
}
@@ -959,7 +959,7 @@ _IO_unbuffer_write (void)
int cnt;
#define MAXTRIES 2
for (cnt = 0; cnt < MAXTRIES; ++cnt)
- if (_IO_lock_trylock (*fp->_lock) == 0)
+ if (fp->_lock == NULL || _IO_lock_trylock (*fp->_lock) == 0)
break;
else
/* Give the other thread time to finish up its use of the
@@ -978,7 +978,7 @@ _IO_unbuffer_write (void)
_IO_SETBUF (fp, NULL, 0);
- if (cnt < MAXTRIES)
+ if (cnt < MAXTRIES && fp->_lock != NULL)
_IO_lock_unlock (*fp->_lock);
}
diff --git a/libc/libio/iofwide.c b/libc/libio/iofwide.c
index c9326f80b..af8787586 100644
--- a/libc/libio/iofwide.c
+++ b/libc/libio/iofwide.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2003, 2005, 2011 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
@@ -474,7 +474,6 @@ do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep,
const unsigned char *cp = (const unsigned char *) from_start;
wchar_t to_buf[max];
struct __gconv_step *gs = codecvt->__cd_in.__cd.__steps;
- int status;
size_t dummy;
codecvt->__cd_in.__cd.__data[0].__outbuf = (unsigned char *) to_buf;
@@ -487,10 +486,10 @@ do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep,
PTR_DEMANGLE (fct);
#endif
- status = DL_CALL_FCT (fct,
- (gs, codecvt->__cd_in.__cd.__data, &cp,
- (const unsigned char *) from_end, NULL,
- &dummy, 0, 0));
+ DL_CALL_FCT (fct,
+ (gs, codecvt->__cd_in.__cd.__data, &cp,
+ (const unsigned char *) from_end, NULL,
+ &dummy, 0, 0));
result = cp - (const unsigned char *) from_start;
#else
diff --git a/libc/locale/Makefile b/libc/locale/Makefile
index 3f0d0daa7..0186978ba 100644
--- a/libc/locale/Makefile
+++ b/libc/locale/Makefile
@@ -102,9 +102,6 @@ $(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o)
C-translit.h: C-translit.h.in gen-translit.pl
$(PERL) gen-translit.pl < $< > $@.tmp
mv -f $@.tmp $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
-endif
localepath = "$(localedir):$(i18ndir)"
diff --git a/libc/locale/global-locale.c b/libc/locale/global-locale.c
index 63d1238fb..c5681a736 100644
--- a/libc/locale/global-locale.c
+++ b/libc/locale/global-locale.c
@@ -1,5 +1,5 @@
/* Locale object representing the global locale controlled by setlocale.
- Copyright (C) 2002, 2006, 2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2008, 2010, 2011 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
@@ -60,16 +60,6 @@ struct __locale_struct _nl_global_locale attribute_hidden =
};
#include <tls.h>
-#if HAVE___THREAD
+
/* The tsd macros don't permit an initializer. */
__thread __locale_t __libc_tsd_LOCALE = &_nl_global_locale;
-#else
-__libc_tsd_define (, __locale_t, LOCALE)
-/* This is a bad kludge presuming the variable name used by the macros.
- Using typeof makes sure to barf if we do not match the macro definition.
- This ifndef is a further bad kludge for Hurd, where there is an explicit
- initialization. */
-# ifndef _HURD_THREADVAR_H
-__typeof (__libc_tsd_LOCALE_data) __libc_tsd_LOCALE_data = &_nl_global_locale;
-# endif
-#endif
diff --git a/libc/locale/localeinfo.h b/libc/locale/localeinfo.h
index 72e9d3a6e..6cf05b215 100644
--- a/libc/locale/localeinfo.h
+++ b/libc/locale/localeinfo.h
@@ -1,5 +1,5 @@
/* Declarations for internal libc locale interfaces
- Copyright (C) 1995-2003, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 1995-2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -216,7 +216,7 @@ __libc_tsd_define (extern, __locale_t, LOCALE)
unused. We can manage this playing some tricks with weak references.
But with thread-local locale settings, it becomes quite ungainly unless
we can use __thread variables. So only in that case do we attempt this. */
-#if !defined SHARED && defined HAVE___THREAD && defined HAVE_WEAK_SYMBOLS
+#if !defined SHARED && defined HAVE_WEAK_SYMBOLS
# include <tls.h>
# define NL_CURRENT_INDIRECT 1
#endif
diff --git a/libc/locale/programs/locarchive.c b/libc/locale/programs/locarchive.c
index bb90e1706..fe74f37d4 100644
--- a/libc/locale/programs/locarchive.c
+++ b/libc/locale/programs/locarchive.c
@@ -74,6 +74,29 @@ static const char *locnames[] =
/* Size of the reserved address space area. */
#define RESERVE_MMAP_SIZE 512 * 1024 * 1024
+/* To prepare for enlargements of the mmaped area reserve some address
+ space. On some machines, being a file mapping rather than an anonymous
+ mapping affects the address selection. So do this mapping from the
+ actual file, even though it's only a dummy to reserve address space. */
+static void *
+prepare_address_space (int fd, size_t total, size_t *reserved, int *xflags)
+{
+ if (total < RESERVE_MMAP_SIZE)
+ {
+ void *p = mmap64 (NULL, RESERVE_MMAP_SIZE, PROT_NONE, MAP_SHARED, fd, 0);
+ if (p != MAP_FAILED)
+ {
+ *reserved = RESERVE_MMAP_SIZE;
+ *xflags = MAP_FIXED;
+ return p;
+ }
+ }
+
+ *reserved = total;
+ *xflags = 0;
+ return NULL;
+}
+
static void
create_archive (const char *archivefname, struct locarhandle *ah)
@@ -81,7 +104,6 @@ create_archive (const char *archivefname, struct locarhandle *ah)
int fd;
char fname[strlen (archivefname) + sizeof (".XXXXXX")];
struct locarhead head;
- void *p;
size_t total;
strcpy (stpcpy (fname, archivefname), ".XXXXXX");
@@ -129,19 +151,9 @@ create_archive (const char *archivefname, struct locarhandle *ah)
error (EXIT_FAILURE, errval, _("cannot resize archive file"));
}
- /* To prepare for enlargements of the mmaped area reserve some
- address space. */
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
- {
- p = NULL;
- reserved = total;
- }
+ size_t reserved;
+ int xflags;
+ void *p = prepare_address_space (fd, total, &reserved, &xflags);
/* Map the header and all the administration data structures. */
p = mmap64 (p, total, PROT_READ | PROT_WRITE, MAP_SHARED | xflags, fd, 0);
@@ -297,7 +309,6 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
int fd;
struct locarhead newhead;
size_t total;
- void *p;
unsigned int cnt, loccnt;
struct namehashent *oldnamehashtab;
struct locarhandle new_ah;
@@ -391,19 +402,9 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
error (EXIT_FAILURE, errval, _("cannot resize archive file"));
}
- /* To prepare for enlargements of the mmaped area reserve some
- address space. */
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- if (total < reserved
- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
- {
- p = NULL;
- reserved = total;
- }
+ size_t reserved;
+ int xflags;
+ void *p = prepare_address_space (fd, total, &reserved, &xflags);
/* Map the header and all the administration data structures. */
p = mmap64 (p, total, PROT_READ | PROT_WRITE, MAP_SHARED | xflags, fd, 0);
@@ -606,20 +607,9 @@ open_archive (struct locarhandle *ah, bool readonly)
ah->fd = fd;
ah->mmaped = st.st_size;
- /* To prepare for enlargements of the mmaped area reserve some
- address space. */
- size_t reserved = RESERVE_MMAP_SIZE;
- int xflags = 0;
- void *p;
- if (st.st_size < reserved
- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
- -1, 0)) != MAP_FAILED))
- xflags = MAP_FIXED;
- else
- {
- p = NULL;
- reserved = st.st_size;
- }
+ size_t reserved;
+ int xflags;
+ void *p = prepare_address_space (fd, st.st_size, &reserved, &xflags);
/* Map the entire file. We might need to compare the category data
in the file with the newly added data. */
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index e0e22070f..dc2b8a04b 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-15 Ulrich Drepper <drepper@gmail.com>
+
+ * Makefile (tests): Add tst-setlocale2:
+ (LOCALES): Add tr_TR.ISO-8859-9;
+ (tst-setlocale2-ENV): Define.
+ * tst-setlocale2.c: New file.
+
2011-07-02 Roland McGrath <roland@hack.frob.com>
* tests-mbwc/tst_funcs.h (TST_DECL_VARS, TST_HEAD_LOCALE):
diff --git a/libc/localedata/Makefile b/libc/localedata/Makefile
index 7818a26ce..6830b1d71 100644
--- a/libc/localedata/Makefile
+++ b/libc/localedata/Makefile
@@ -109,7 +109,7 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
- tst-strfmon1 tst-sscanf tst-strptime bug-setlocale1
+ tst-strfmon1 tst-sscanf tst-strptime bug-setlocale1 tst-setlocale2
ifeq (yesy,$(build-shared)$(OPTION_EGLIBC_LOCALE_CODE))
ifneq (no,$(PERL))
tests: $(objpfx)mtrace-tst-leaks
@@ -152,7 +152,7 @@ LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 ja_JP.SJIS fr_FR.ISO-8859-1 \
vi_VN.TCVN5712-1 nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 \
tr_TR.UTF-8 cs_CZ.UTF-8 zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 \
- ja_JP.UTF-8 si_LK.UTF-8
+ ja_JP.UTF-8 si_LK.UTF-8 tr_TR.ISO-8859-9
LOCALE_SRCS := $(shell echo "$(LOCALES)"|sed 's/\([^ .]*\)[^ ]*/\1/g')
CHARMAPS := $(shell echo "$(LOCALES)" | \
sed -e 's/[^ .]*[.]\([^ ]*\)/\1/g' -e s/SJIS/SHIFT_JIS/g)
@@ -332,6 +332,7 @@ $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
bug-setlocale1-ENV = LOCPATH=$(common-objpfx)localedata
bug-setlocale1-ARGS = $(common-objpfx)
+tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata
$(objdir)/iconvdata/gconv-modules:
$(MAKE) -C ../iconvdata subdir=iconvdata $@
diff --git a/libc/localedata/tst-setlocale2.c b/libc/localedata/tst-setlocale2.c
new file mode 100644
index 000000000..a4eb11fb3
--- /dev/null
+++ b/libc/localedata/tst-setlocale2.c
@@ -0,0 +1,76 @@
+#include <ctype.h>
+#include <locale.h>
+#include <stdio.h>
+#include <wctype.h>
+
+
+static int
+do_test (void)
+{
+ const char *loc = "de_DE.ISO-8859-1";
+ if (setlocale (LC_ALL, loc) == NULL)
+ {
+ printf ("cannot set %s locale\n", loc);
+ return 1;
+ }
+ printf ("selected locale %s\n", loc);
+
+ wint_t win = 0xe4;
+ wint_t wex = 0xc4;
+ wint_t wch = towupper (win);
+ if (wch != wex)
+ {
+ printf ("towupper(%x) = %x, expected %x\n", win, wch, wex);
+ return 1;
+ }
+ wch = toupper (win);
+ if (wch != wex)
+ {
+ printf ("toupper(%x) = %x, expected %x\n", win, wch, wex);
+ return 1;
+ }
+
+ win = 0x69;
+ wex = 0x49;
+ wch = towupper (win);
+ if (wch != wex)
+ {
+ printf ("towupper(%x) = %x, expected %x\n", win, wch, wex);
+ return 1;
+ }
+ wch = toupper (win);
+ if (wch != wex)
+ {
+ printf ("toupper(%x) = %x, expected %x\n", win, wch, wex);
+ return 1;
+ }
+
+ loc = "tr_TR.ISO-8859-9";
+ if (setlocale (LC_ALL, loc) == NULL)
+ {
+ printf ("cannot set %s locale\n", loc);
+ return 1;
+ }
+ printf ("selected locale %s\n", loc);
+
+ win = 0x69;
+ wex = 0x130;
+ wch = towupper (win);
+ if (wch != wex)
+ {
+ printf ("towupper(%x) = %x, expected %x\n", win, wch, wex);
+ return 1;
+ }
+ wch = toupper (win);
+ wex = 0xdd;
+ if (wch != wex)
+ {
+ printf ("toupper(%x) = %x, expected %x\n", win, wch, wex);
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/mach/devstream.c b/libc/mach/devstream.c
index 1c51695a8..ebc4b9329 100644
--- a/libc/mach/devstream.c
+++ b/libc/mach/devstream.c
@@ -1,6 +1,6 @@
/* stdio on a Mach device port.
Translates \n to \r\n on output, echos and translates \r to \n on input.
- Copyright (C) 1992,93,94,96,97,2000 Free Software Foundation, Inc.
+ Copyright (C) 1992,93,94,96,97,2000,2011 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
@@ -120,12 +120,10 @@ dealloc_ref (void *cookie)
return 0;
}
-#ifndef USE_IN_LIBIO
#define cookie_io_functions_t __io_functions
#define write __write
#define read __read
#define close __close
-#endif
FILE *
mach_open_devstream (mach_port_t dev, const char *mode)
diff --git a/libc/malloc/Makefile b/libc/malloc/Makefile
index d4d86c16b..f15975b36 100644
--- a/libc/malloc/Makefile
+++ b/libc/malloc/Makefile
@@ -133,7 +133,7 @@ endif
tst-mcheck-ENV = MALLOC_CHECK_=3
-CPPFLAGS-malloc.c += -DPER_THREAD -DATOMIC_FASTBINS
+CPPFLAGS-malloc.c += -DPER_THREAD
# Uncomment this for test releases. For public releases it is too expensive.
#CPPFLAGS-malloc.o += -DMALLOC_DEBUG=1
diff --git a/libc/malloc/arena.c b/libc/malloc/arena.c
index 59e96dbf0..9114fd28e 100644
--- a/libc/malloc/arena.c
+++ b/libc/malloc/arena.c
@@ -1,5 +1,5 @@
/* Malloc implementation for multiple threads without lock contention.
- Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2009,2010
+ Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2009,2010,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
@@ -53,8 +53,7 @@
/* A heap is a single contiguous memory region holding (coalesceable)
malloc_chunks. It is allocated with mmap() and always starts at an
- address aligned to HEAP_MAX_SIZE. Not used unless compiling with
- USE_ARENAS. */
+ address aligned to HEAP_MAX_SIZE. */
typedef struct _heap_info {
mstate ar_ptr; /* Arena for this heap. */
@@ -77,9 +76,9 @@ extern int sanity_check_heap_info_alignment[(sizeof (heap_info)
/* Thread specific data */
static tsd_key_t arena_key;
-static mutex_t list_lock;
+static mutex_t list_lock = MUTEX_INITIALIZER;
#ifdef PER_THREAD
-static size_t narenas;
+static size_t narenas = 1;
static mstate free_list;
#endif
@@ -98,7 +97,6 @@ int __malloc_initialized = -1;
/**************************************************************************/
-#if USE_ARENAS
/* arena_get() acquires an arena and locks the corresponding mutex.
First, try the one last locked successfully by this thread. (This
@@ -114,19 +112,19 @@ int __malloc_initialized = -1;
} while(0)
#define arena_lookup(ptr) do { \
- Void_t *vptr = NULL; \
+ void *vptr = NULL; \
ptr = (mstate)tsd_getspecific(arena_key, vptr); \
} while(0)
#ifdef PER_THREAD
-#define arena_lock(ptr, size) do { \
+# define arena_lock(ptr, size) do { \
if(ptr) \
(void)mutex_lock(&ptr->mutex); \
else \
ptr = arena_get2(ptr, (size)); \
} while(0)
#else
-#define arena_lock(ptr, size) do { \
+# define arena_lock(ptr, size) do { \
if(ptr && !mutex_trylock(&ptr->mutex)) { \
THREAD_STAT(++(ptr->stat_lock_direct)); \
} else \
@@ -141,45 +139,16 @@ int __malloc_initialized = -1;
#define arena_for_chunk(ptr) \
(chunk_non_main_arena(ptr) ? heap_for_ptr(ptr)->ar_ptr : &main_arena)
-#else /* !USE_ARENAS */
-
-/* There is only one arena, main_arena. */
-
-#if THREAD_STATS
-#define arena_get(ar_ptr, sz) do { \
- ar_ptr = &main_arena; \
- if(!mutex_trylock(&ar_ptr->mutex)) \
- ++(ar_ptr->stat_lock_direct); \
- else { \
- (void)mutex_lock(&ar_ptr->mutex); \
- ++(ar_ptr->stat_lock_wait); \
- } \
-} while(0)
-#else
-#define arena_get(ar_ptr, sz) do { \
- ar_ptr = &main_arena; \
- (void)mutex_lock(&ar_ptr->mutex); \
-} while(0)
-#endif
-#define arena_for_chunk(ptr) (&main_arena)
-
-#endif /* USE_ARENAS */
/**************************************************************************/
-#ifndef NO_THREADS
-
/* atfork support. */
static __malloc_ptr_t (*save_malloc_hook) (size_t __size,
__const __malloc_ptr_t);
-# if !defined _LIBC || (defined SHARED && !USE___THREAD)
-static __malloc_ptr_t (*save_memalign_hook) (size_t __align, size_t __size,
- __const __malloc_ptr_t);
-# endif
static void (*save_free_hook) (__malloc_ptr_t __ptr,
__const __malloc_ptr_t);
-static Void_t* save_arena;
+static void* save_arena;
#ifdef ATFORK_MEM
ATFORK_MEM;
@@ -188,16 +157,16 @@ ATFORK_MEM;
/* Magic value for the thread-specific arena pointer when
malloc_atfork() is in use. */
-#define ATFORK_ARENA_PTR ((Void_t*)-1)
+#define ATFORK_ARENA_PTR ((void*)-1)
/* The following hooks are used while the `atfork' handling mechanism
is active. */
-static Void_t*
-malloc_atfork(size_t sz, const Void_t *caller)
+static void*
+malloc_atfork(size_t sz, const void *caller)
{
- Void_t *vptr = NULL;
- Void_t *victim;
+ void *vptr = NULL;
+ void *victim;
tsd_getspecific(arena_key, vptr);
if(vptr == ATFORK_ARENA_PTR) {
@@ -221,9 +190,9 @@ malloc_atfork(size_t sz, const Void_t *caller)
}
static void
-free_atfork(Void_t* mem, const Void_t *caller)
+free_atfork(void* mem, const void *caller)
{
- Void_t *vptr = NULL;
+ void *vptr = NULL;
mstate ar_ptr;
mchunkptr p; /* chunk corresponding to mem */
@@ -232,27 +201,15 @@ free_atfork(Void_t* mem, const Void_t *caller)
p = mem2chunk(mem); /* do not bother to replicate free_check here */
-#if HAVE_MMAP
if (chunk_is_mmapped(p)) /* release mmapped memory. */
{
munmap_chunk(p);
return;
}
-#endif
-#ifdef ATOMIC_FASTBINS
ar_ptr = arena_for_chunk(p);
tsd_getspecific(arena_key, vptr);
_int_free(ar_ptr, p, vptr == ATFORK_ARENA_PTR);
-#else
- ar_ptr = arena_for_chunk(p);
- tsd_getspecific(arena_key, vptr);
- if(vptr != ATFORK_ARENA_PTR)
- (void)mutex_lock(&ar_ptr->mutex);
- _int_free(ar_ptr, p);
- if(vptr != ATFORK_ARENA_PTR)
- (void)mutex_unlock(&ar_ptr->mutex);
-#endif
}
@@ -274,7 +231,7 @@ ptmalloc_lock_all (void)
return;
if (mutex_trylock(&list_lock))
{
- Void_t *my_arena;
+ void *my_arena;
tsd_getspecific(arena_key, my_arena);
if (my_arena == ATFORK_ARENA_PTR)
/* This is the same thread which already locks the global list.
@@ -334,11 +291,9 @@ ptmalloc_unlock_all2 (void)
if(__malloc_initialized < 1)
return;
-#if defined _LIBC || defined MALLOC_HOOKS
tsd_setspecific(arena_key, save_arena);
__malloc_hook = save_malloc_hook;
__free_hook = save_free_hook;
-#endif
#ifdef PER_THREAD
free_list = NULL;
#endif
@@ -363,10 +318,7 @@ ptmalloc_unlock_all2 (void)
#endif
-#endif /* !defined NO_THREADS */
-
/* Initialization routine. */
-#ifdef _LIBC
#include <string.h>
extern char **_environ;
@@ -400,29 +352,9 @@ next_env_entry (char ***position)
return result;
}
-#endif /* _LIBC */
-
-/* Set up basic state so that _int_malloc et al can work. */
-static void
-ptmalloc_init_minimal (void)
-{
-#if DEFAULT_TOP_PAD != 0
- mp_.top_pad = DEFAULT_TOP_PAD;
-#endif
- mp_.n_mmaps_max = DEFAULT_MMAP_MAX;
- mp_.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
- mp_.trim_threshold = DEFAULT_TRIM_THRESHOLD;
- mp_.pagesize = malloc_getpagesize;
-#ifdef PER_THREAD
-# define NARENAS_FROM_NCORES(n) ((n) * (sizeof(long) == 4 ? 2 : 8))
- mp_.arena_test = NARENAS_FROM_NCORES (1);
- narenas = 1;
-#endif
-}
-#ifdef _LIBC
-# ifdef SHARED
+#ifdef SHARED
static void *
__failing_morecore (ptrdiff_t d)
{
@@ -431,86 +363,15 @@ __failing_morecore (ptrdiff_t d)
extern struct dl_open_hook *_dl_open_hook;
libc_hidden_proto (_dl_open_hook);
-# endif
-
-# if defined SHARED && !USE___THREAD
-/* This is called by __pthread_initialize_minimal when it needs to use
- malloc to set up the TLS state. We cannot do the full work of
- ptmalloc_init (below) until __pthread_initialize_minimal has finished,
- so it has to switch to using the special startup-time hooks while doing
- those allocations. */
-void
-__libc_malloc_pthread_startup (bool first_time)
-{
- if (first_time)
- {
- ptmalloc_init_minimal ();
- save_malloc_hook = __malloc_hook;
- save_memalign_hook = __memalign_hook;
- save_free_hook = __free_hook;
- __malloc_hook = malloc_starter;
- __memalign_hook = memalign_starter;
- __free_hook = free_starter;
- }
- else
- {
- __malloc_hook = save_malloc_hook;
- __memalign_hook = save_memalign_hook;
- __free_hook = save_free_hook;
- }
-}
-# endif
#endif
static void
ptmalloc_init (void)
{
-#if __STD_C
- const char* s;
-#else
- char* s;
-#endif
- int secure = 0;
-
if(__malloc_initialized >= 0) return;
__malloc_initialized = 0;
-#ifdef _LIBC
-# if defined SHARED && !USE___THREAD
- /* ptmalloc_init_minimal may already have been called via
- __libc_malloc_pthread_startup, above. */
- if (mp_.pagesize == 0)
-# endif
-#endif
- ptmalloc_init_minimal();
-
-#ifndef NO_THREADS
-# if defined _LIBC
- /* We know __pthread_initialize_minimal has already been called,
- and that is enough. */
-# define NO_STARTER
-# endif
-# ifndef NO_STARTER
- /* With some threads implementations, creating thread-specific data
- or initializing a mutex may call malloc() itself. Provide a
- simple starter version (realloc() won't work). */
- save_malloc_hook = __malloc_hook;
- save_memalign_hook = __memalign_hook;
- save_free_hook = __free_hook;
- __malloc_hook = malloc_starter;
- __memalign_hook = memalign_starter;
- __free_hook = free_starter;
-# ifdef _LIBC
- /* Initialize the pthreads interface. */
- if (__pthread_initialize != NULL)
- __pthread_initialize();
-# endif /* !defined _LIBC */
-# endif /* !defined NO_STARTER */
-#endif /* !defined NO_THREADS */
- mutex_init(&main_arena.mutex);
- main_arena.next = &main_arena;
-
-#if defined _LIBC && defined SHARED
+#ifdef SHARED
/* In case this libc copy is in a non-default namespace, never use brk.
Likewise if dlopened from statically linked program. */
Dl_info di;
@@ -522,22 +383,10 @@ ptmalloc_init (void)
__morecore = __failing_morecore;
#endif
- mutex_init(&list_lock);
tsd_key_create(&arena_key, NULL);
- tsd_setspecific(arena_key, (Void_t *)&main_arena);
+ tsd_setspecific(arena_key, (void *)&main_arena);
thread_atfork(ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2);
-#ifndef NO_THREADS
-# ifndef NO_STARTER
- __malloc_hook = save_malloc_hook;
- __memalign_hook = save_memalign_hook;
- __free_hook = save_free_hook;
-# else
-# undef NO_STARTER
-# endif
-#endif
-#ifdef _LIBC
- secure = __libc_enable_secure;
- s = NULL;
+ const char *s = NULL;
if (__builtin_expect (_environ != NULL, 1))
{
char **runp = _environ;
@@ -561,7 +410,7 @@ ptmalloc_init (void)
s = &envline[7];
break;
case 8:
- if (! secure)
+ if (! __builtin_expect (__libc_enable_secure, 0))
{
if (memcmp (envline, "TOP_PAD_", 8) == 0)
mALLOPt(M_TOP_PAD, atoi(&envline[9]));
@@ -570,7 +419,7 @@ ptmalloc_init (void)
}
break;
case 9:
- if (! secure)
+ if (! __builtin_expect (__libc_enable_secure, 0))
{
if (memcmp (envline, "MMAP_MAX_", 9) == 0)
mALLOPt(M_MMAP_MAX, atoi(&envline[10]));
@@ -582,7 +431,7 @@ ptmalloc_init (void)
break;
#ifdef PER_THREAD
case 10:
- if (! secure)
+ if (! __builtin_expect (__libc_enable_secure, 0))
{
if (memcmp (envline, "ARENA_TEST", 10) == 0)
mALLOPt(M_ARENA_TEST, atoi(&envline[11]));
@@ -590,7 +439,7 @@ ptmalloc_init (void)
break;
#endif
case 15:
- if (! secure)
+ if (! __builtin_expect (__libc_enable_secure, 0))
{
if (memcmp (envline, "TRIM_THRESHOLD_", 15) == 0)
mALLOPt(M_TRIM_THRESHOLD, atoi(&envline[16]));
@@ -603,22 +452,6 @@ ptmalloc_init (void)
}
}
}
-#else
- if (! secure)
- {
- if((s = getenv("MALLOC_TRIM_THRESHOLD_")))
- mALLOPt(M_TRIM_THRESHOLD, atoi(s));
- if((s = getenv("MALLOC_TOP_PAD_")))
- mALLOPt(M_TOP_PAD, atoi(s));
- if((s = getenv("MALLOC_PERTURB_")))
- mALLOPt(M_PERTURB, atoi(s));
- if((s = getenv("MALLOC_MMAP_THRESHOLD_")))
- mALLOPt(M_MMAP_THRESHOLD, atoi(s));
- if((s = getenv("MALLOC_MMAP_MAX_")))
- mALLOPt(M_MMAP_MAX, atoi(s));
- }
- s = getenv("MALLOC_CHECK_");
-#endif
if(s && s[0]) {
mALLOPt(M_CHECK_ACTION, (int)(s[0] - '0'));
if (check_action != 0)
@@ -640,18 +473,12 @@ thread_atfork_static(ptmalloc_lock_all, ptmalloc_unlock_all, \
/* Managing heaps and arenas (for concurrent threads) */
-#if USE_ARENAS
-
#if MALLOC_DEBUG > 1
/* Print the complete contents of a single heap to stderr. */
static void
-#if __STD_C
dump_heap(heap_info *heap)
-#else
-dump_heap(heap) heap_info *heap;
-#endif
{
char *ptr;
mchunkptr p;
@@ -692,13 +519,9 @@ static char *aligned_heap_area;
static heap_info *
internal_function
-#if __STD_C
new_heap(size_t size, size_t top_pad)
-#else
-new_heap(size, top_pad) size_t size, top_pad;
-#endif
{
- size_t page_mask = malloc_getpagesize - 1;
+ size_t page_mask = GLRO(dl_pagesize) - 1;
char *p1, *p2;
unsigned long ul;
heap_info *h;
@@ -766,13 +589,9 @@ new_heap(size, top_pad) size_t size, top_pad;
multiple of the page size. */
static int
-#if __STD_C
grow_heap(heap_info *h, long diff)
-#else
-grow_heap(h, diff) heap_info *h; long diff;
-#endif
{
- size_t page_mask = malloc_getpagesize - 1;
+ size_t page_mask = GLRO(dl_pagesize) - 1;
long new_size;
diff = (diff + page_mask) & ~page_mask;
@@ -794,11 +613,7 @@ grow_heap(h, diff) heap_info *h; long diff;
/* Shrink a heap. */
static int
-#if __STD_C
shrink_heap(heap_info *h, long diff)
-#else
-shrink_heap(h, diff) heap_info *h; long diff;
-#endif
{
long new_size;
@@ -807,21 +622,15 @@ shrink_heap(h, diff) heap_info *h; long diff;
return -1;
/* Try to re-map the extra heap space freshly to save memory, and
make it inaccessible. */
-#ifdef _LIBC
if (__builtin_expect (__libc_enable_secure, 0))
-#else
- if (1)
-#endif
{
if((char *)MMAP((char *)h + new_size, diff, PROT_NONE,
MAP_PRIVATE|MAP_FIXED) == (char *) MAP_FAILED)
return -2;
h->mprotect_size = new_size;
}
-#ifdef _LIBC
else
madvise ((char *)h + new_size, diff, MADV_DONTNEED);
-#endif
/*fprintf(stderr, "shrink %p %08lx\n", h, new_size);*/
h->size = new_size;
@@ -839,14 +648,10 @@ shrink_heap(h, diff) heap_info *h; long diff;
static int
internal_function
-#if __STD_C
heap_trim(heap_info *heap, size_t pad)
-#else
-heap_trim(heap, pad) heap_info *heap; size_t pad;
-#endif
{
mstate ar_ptr = heap->ar_ptr;
- unsigned long pagesz = mp_.pagesize;
+ unsigned long pagesz = GLRO(dl_pagesize);
mchunkptr top_chunk = top(ar_ptr), p, bck, fwd;
heap_info *prev_heap;
long new_size, top_size, extra;
@@ -919,11 +724,6 @@ _int_new_arena(size_t size)
/*a->next = NULL;*/
a->system_mem = a->max_system_mem = h->size;
arena_mem += h->size;
-#ifdef NO_THREADS
- if((unsigned long)(mp_.mmapped_mem + arena_mem + main_arena.system_mem) >
- mp_.max_total_mem)
- mp_.max_total_mem = mp_.mmapped_mem + arena_mem + main_arena.system_mem;
-#endif
/* Set up the top chunk, with proper alignment. */
ptr = (char *)(a + 1);
@@ -933,7 +733,7 @@ _int_new_arena(size_t size)
top(a) = (mchunkptr)ptr;
set_head(top(a), (((char*)h + h->size) - ptr) | PREV_INUSE);
- tsd_setspecific(arena_key, (Void_t *)a);
+ tsd_setspecific(arena_key, (void *)a);
mutex_init(&a->mutex);
(void)mutex_lock(&a->mutex);
@@ -974,7 +774,7 @@ get_free_list (void)
if (result != NULL)
{
(void)mutex_lock(&result->mutex);
- tsd_setspecific(arena_key, (Void_t *)result);
+ tsd_setspecific(arena_key, (void *)result);
THREAD_STAT(++(result->stat_lock_loop));
}
}
@@ -1029,7 +829,7 @@ reused_arena (void)
(void)mutex_lock(&result->mutex);
out:
- tsd_setspecific(arena_key, (Void_t *)result);
+ tsd_setspecific(arena_key, (void *)result);
THREAD_STAT(++(result->stat_lock_loop));
next_to_use = result->next;
@@ -1039,11 +839,7 @@ reused_arena (void)
static mstate
internal_function
-#if __STD_C
arena_get2(mstate a_tsd, size_t size)
-#else
-arena_get2(a_tsd, size) mstate a_tsd; size_t size;
-#endif
{
mstate a;
@@ -1073,7 +869,7 @@ arena_get2(a_tsd, size) mstate a_tsd; size_t size;
if (retried)
(void)mutex_unlock(&list_lock);
THREAD_STAT(++(a->stat_lock_loop));
- tsd_setspecific(arena_key, (Void_t *)a);
+ tsd_setspecific(arena_key, (void *)a);
return a;
}
a = a->next;
@@ -1105,7 +901,7 @@ arena_get2(a_tsd, size) mstate a_tsd; size_t size;
static void __attribute__ ((section ("__libc_thread_freeres_fn")))
arena_thread_freeres (void)
{
- Void_t *vptr = NULL;
+ void *vptr = NULL;
mstate a = tsd_getspecific(arena_key, vptr);
tsd_setspecific(arena_key, NULL);
@@ -1120,8 +916,6 @@ arena_thread_freeres (void)
text_set_element (__libc_thread_subfreeres, arena_thread_freeres);
#endif
-#endif /* USE_ARENAS */
-
/*
* Local variables:
* c-basic-offset: 2
diff --git a/libc/malloc/hooks.c b/libc/malloc/hooks.c
index 4b1a996eb..fc46e7d95 100644
--- a/libc/malloc/hooks.c
+++ b/libc/malloc/hooks.c
@@ -25,26 +25,16 @@
/* Hooks for debugging versions. The initial hooks just call the
initialization routine, then do the normal work. */
-static Void_t*
-#if __STD_C
+static void*
malloc_hook_ini(size_t sz, const __malloc_ptr_t caller)
-#else
-malloc_hook_ini(sz, caller)
- size_t sz; const __malloc_ptr_t caller;
-#endif
{
__malloc_hook = NULL;
ptmalloc_init();
return public_mALLOc(sz);
}
-static Void_t*
-#if __STD_C
-realloc_hook_ini(Void_t* ptr, size_t sz, const __malloc_ptr_t caller)
-#else
-realloc_hook_ini(ptr, sz, caller)
- Void_t* ptr; size_t sz; const __malloc_ptr_t caller;
-#endif
+static void*
+realloc_hook_ini(void* ptr, size_t sz, const __malloc_ptr_t caller)
{
__malloc_hook = NULL;
__realloc_hook = NULL;
@@ -52,13 +42,8 @@ realloc_hook_ini(ptr, sz, caller)
return public_rEALLOc(ptr, sz);
}
-static Void_t*
-#if __STD_C
+static void*
memalign_hook_ini(size_t alignment, size_t sz, const __malloc_ptr_t caller)
-#else
-memalign_hook_ini(alignment, sz, caller)
- size_t alignment; size_t sz; const __malloc_ptr_t caller;
-#endif
{
__memalign_hook = NULL;
ptmalloc_init();
@@ -108,13 +93,9 @@ __malloc_check_init()
/* Instrument a chunk with overrun detector byte(s) and convert it
into a user pointer with requested size sz. */
-static Void_t*
+static void*
internal_function
-#if __STD_C
-mem2mem_check(Void_t *ptr, size_t sz)
-#else
-mem2mem_check(ptr, sz) Void_t *ptr; size_t sz;
-#endif
+mem2mem_check(void *ptr, size_t sz)
{
mchunkptr p;
unsigned char* m_ptr = (unsigned char*)BOUNDED_N(ptr, sz);
@@ -133,7 +114,7 @@ mem2mem_check(ptr, sz) Void_t *ptr; size_t sz;
m_ptr[i] = 0xFF;
}
m_ptr[sz] = MAGICBYTE(p);
- return (Void_t*)m_ptr;
+ return (void*)m_ptr;
}
/* Convert a pointer to be free()d or realloc()ed to a valid chunk
@@ -141,11 +122,7 @@ mem2mem_check(ptr, sz) Void_t *ptr; size_t sz;
static mchunkptr
internal_function
-#if __STD_C
-mem2chunk_check(Void_t* mem, unsigned char **magic_p)
-#else
-mem2chunk_check(mem, magic_p) Void_t* mem; unsigned char **magic_p;
-#endif
+mem2chunk_check(void* mem, unsigned char **magic_p)
{
mchunkptr p;
INTERNAL_SIZE_T sz, c;
@@ -170,7 +147,7 @@ mem2chunk_check(mem, magic_p) Void_t* mem; unsigned char **magic_p;
if(c<=0 || sz<(c+2*SIZE_SZ)) return NULL;
}
} else {
- unsigned long offset, page_mask = malloc_getpagesize-1;
+ unsigned long offset, page_mask = GLRO(dl_pagesize)-1;
/* mmap()ed chunks have MALLOC_ALIGNMENT or higher power-of-two
alignment relative to the beginning of a page. Check this
@@ -200,16 +177,12 @@ mem2chunk_check(mem, magic_p) Void_t* mem; unsigned char **magic_p;
static int
internal_function
-#if __STD_C
top_check(void)
-#else
-top_check()
-#endif
{
mchunkptr t = top(&main_arena);
char* brk, * new_brk;
INTERNAL_SIZE_T front_misalign, sbrk_size;
- unsigned long pagesz = malloc_getpagesize;
+ unsigned long pagesz = GLRO(dl_pagesize);
if (t == initial_top(&main_arena) ||
(!chunk_is_mmapped(t) &&
@@ -231,7 +204,7 @@ top_check()
new_brk = (char*)(MORECORE (sbrk_size));
if (new_brk == (char*)(MORECORE_FAILURE))
{
- MALLOC_FAILURE_ACTION;
+ __set_errno (ENOMEM);
return -1;
}
/* Call the `morecore' hook if necessary. */
@@ -246,17 +219,13 @@ top_check()
return 0;
}
-static Void_t*
-#if __STD_C
-malloc_check(size_t sz, const Void_t *caller)
-#else
-malloc_check(sz, caller) size_t sz; const Void_t *caller;
-#endif
+static void*
+malloc_check(size_t sz, const void *caller)
{
- Void_t *victim;
+ void *victim;
if (sz+1 == 0) {
- MALLOC_FAILURE_ACTION;
+ __set_errno (ENOMEM);
return NULL;
}
@@ -267,11 +236,7 @@ malloc_check(sz, caller) size_t sz; const Void_t *caller;
}
static void
-#if __STD_C
-free_check(Void_t* mem, const Void_t *caller)
-#else
-free_check(mem, caller) Void_t* mem; const Void_t *caller;
-#endif
+free_check(void* mem, const void *caller)
{
mchunkptr p;
@@ -284,38 +249,24 @@ free_check(mem, caller) Void_t* mem; const Void_t *caller;
malloc_printerr(check_action, "free(): invalid pointer", mem);
return;
}
-#if HAVE_MMAP
if (chunk_is_mmapped(p)) {
(void)mutex_unlock(&main_arena.mutex);
munmap_chunk(p);
return;
}
-#endif
-#if 0 /* Erase freed memory. */
- memset(mem, 0, chunksize(p) - (SIZE_SZ+1));
-#endif
-#ifdef ATOMIC_FASTBINS
_int_free(&main_arena, p, 1);
-#else
- _int_free(&main_arena, p);
-#endif
(void)mutex_unlock(&main_arena.mutex);
}
-static Void_t*
-#if __STD_C
-realloc_check(Void_t* oldmem, size_t bytes, const Void_t *caller)
-#else
-realloc_check(oldmem, bytes, caller)
- Void_t* oldmem; size_t bytes; const Void_t *caller;
-#endif
+static void*
+realloc_check(void* oldmem, size_t bytes, const void *caller)
{
INTERNAL_SIZE_T nb;
- Void_t* newmem = 0;
+ void* newmem = 0;
unsigned char *magic_p;
if (bytes+1 == 0) {
- MALLOC_FAILURE_ACTION;
+ __set_errno (ENOMEM);
return NULL;
}
if (oldmem == 0) return malloc_check(bytes, NULL);
@@ -335,7 +286,6 @@ realloc_check(oldmem, bytes, caller)
checked_request2size(bytes+1, nb);
(void)mutex_lock(&main_arena.mutex);
-#if HAVE_MMAP
if (chunk_is_mmapped(oldp)) {
#if HAVE_MREMAP
mchunkptr newp = mremap_chunk(oldp, nb);
@@ -358,27 +308,12 @@ realloc_check(oldmem, bytes, caller)
}
}
} else {
-#endif /* HAVE_MMAP */
if (top_check() >= 0) {
INTERNAL_SIZE_T nb;
checked_request2size(bytes + 1, nb);
newmem = _int_realloc(&main_arena, oldp, oldsize, nb);
}
-#if 0 /* Erase freed memory. */
- if(newmem)
- newp = mem2chunk(newmem);
- nb = chunksize(newp);
- if(oldp<newp || oldp>=chunk_at_offset(newp, nb)) {
- memset((char*)oldmem + 2*sizeof(mbinptr), 0,
- oldsize - (2*sizeof(mbinptr)+2*SIZE_SZ+1));
- } else if(nb > oldsize+SIZE_SZ) {
- memset((char*)BOUNDED_N(chunk2mem(newp), bytes) + oldsize,
- 0, nb - (oldsize+SIZE_SZ));
- }
-#endif
-#if HAVE_MMAP
}
-#endif
/* mem2chunk_check changed the magic byte in the old chunk.
If newmem is NULL, then the old chunk will still be used though,
@@ -390,21 +325,16 @@ realloc_check(oldmem, bytes, caller)
return mem2mem_check(newmem, bytes);
}
-static Void_t*
-#if __STD_C
-memalign_check(size_t alignment, size_t bytes, const Void_t *caller)
-#else
-memalign_check(alignment, bytes, caller)
- size_t alignment; size_t bytes; const Void_t *caller;
-#endif
+static void*
+memalign_check(size_t alignment, size_t bytes, const void *caller)
{
- Void_t* mem;
+ void* mem;
if (alignment <= MALLOC_ALIGNMENT) return malloc_check(bytes, NULL);
if (alignment < MINSIZE) alignment = MINSIZE;
if (bytes+1 == 0) {
- MALLOC_FAILURE_ACTION;
+ __set_errno (ENOMEM);
return NULL;
}
(void)mutex_lock(&main_arena.mutex);
@@ -414,77 +344,6 @@ memalign_check(alignment, bytes, caller)
return mem2mem_check(mem, bytes);
}
-#ifndef NO_THREADS
-
-# ifdef _LIBC
-# if USE___THREAD || !defined SHARED
- /* These routines are never needed in this configuration. */
-# define NO_STARTER
-# endif
-# endif
-
-# ifdef NO_STARTER
-# undef NO_STARTER
-# else
-
-/* The following hooks are used when the global initialization in
- ptmalloc_init() hasn't completed yet. */
-
-static Void_t*
-#if __STD_C
-malloc_starter(size_t sz, const Void_t *caller)
-#else
-malloc_starter(sz, caller) size_t sz; const Void_t *caller;
-#endif
-{
- Void_t* victim;
-
- victim = _int_malloc(&main_arena, sz);
-
- return victim ? BOUNDED_N(victim, sz) : 0;
-}
-
-static Void_t*
-#if __STD_C
-memalign_starter(size_t align, size_t sz, const Void_t *caller)
-#else
-memalign_starter(align, sz, caller) size_t align, sz; const Void_t *caller;
-#endif
-{
- Void_t* victim;
-
- victim = _int_memalign(&main_arena, align, sz);
-
- return victim ? BOUNDED_N(victim, sz) : 0;
-}
-
-static void
-#if __STD_C
-free_starter(Void_t* mem, const Void_t *caller)
-#else
-free_starter(mem, caller) Void_t* mem; const Void_t *caller;
-#endif
-{
- mchunkptr p;
-
- if(!mem) return;
- p = mem2chunk(mem);
-#if HAVE_MMAP
- if (chunk_is_mmapped(p)) {
- munmap_chunk(p);
- return;
- }
-#endif
-#ifdef ATOMIC_FASTBINS
- _int_free(&main_arena, p, 1);
-#else
- _int_free(&main_arena, p);
-#endif
-}
-
-# endif /* !defiend NO_STARTER */
-#endif /* NO_THREADS */
-
/* Get/set state: malloc_get_state() records the current state of all
malloc variables (_except_ for the actual heap contents and `hook'
@@ -529,7 +388,7 @@ struct malloc_save_state {
unsigned long narenas;
};
-Void_t*
+void*
public_gET_STATe(void)
{
struct malloc_save_state* ms;
@@ -564,11 +423,7 @@ public_gET_STATe(void)
ms->mmap_threshold = mp_.mmap_threshold;
ms->check_action = check_action;
ms->max_sbrked_mem = main_arena.max_system_mem;
-#ifdef NO_THREADS
- ms->max_total_mem = mp_.max_total_mem;
-#else
ms->max_total_mem = 0;
-#endif
ms->n_mmaps = mp_.n_mmaps;
ms->max_n_mmaps = mp_.max_n_mmaps;
ms->mmapped_mem = mp_.mmapped_mem;
@@ -581,11 +436,11 @@ public_gET_STATe(void)
ms->narenas = narenas;
#endif
(void)mutex_unlock(&main_arena.mutex);
- return (Void_t*)ms;
+ return (void*)ms;
}
int
-public_sET_STATe(Void_t* msptr)
+public_sET_STATe(void* msptr)
{
struct malloc_save_state* ms = (struct malloc_save_state*)msptr;
size_t i;
@@ -656,9 +511,6 @@ public_sET_STATe(Void_t* msptr)
mp_.mmap_threshold = ms->mmap_threshold;
check_action = ms->check_action;
main_arena.max_system_mem = ms->max_sbrked_mem;
-#ifdef NO_THREADS
- mp_.max_total_mem = ms->max_total_mem;
-#endif
mp_.n_mmaps = ms->n_mmaps;
mp_.max_n_mmaps = ms->max_n_mmaps;
mp_.mmapped_mem = ms->mmapped_mem;
diff --git a/libc/malloc/malloc.c b/libc/malloc/malloc.c
index dccb6cc4f..864c7d908 100644
--- a/libc/malloc/malloc.c
+++ b/libc/malloc/malloc.c
@@ -74,20 +74,20 @@
Standard (ANSI/SVID/...) functions:
malloc(size_t n);
calloc(size_t n_elements, size_t element_size);
- free(Void_t* p);
- realloc(Void_t* p, size_t n);
+ free(void* p);
+ realloc(void* p, size_t n);
memalign(size_t alignment, size_t n);
valloc(size_t n);
mallinfo()
mallopt(int parameter_number, int parameter_value)
Additional functions:
- independent_calloc(size_t n_elements, size_t size, Void_t* chunks[]);
- independent_comalloc(size_t n_elements, size_t sizes[], Void_t* chunks[]);
+ independent_calloc(size_t n_elements, size_t size, void* chunks[]);
+ independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
pvalloc(size_t n);
- cfree(Void_t* p);
+ cfree(void* p);
malloc_trim(size_t pad);
- malloc_usable_size(Void_t* p);
+ malloc_usable_size(void* p);
malloc_stats();
* Vital statistics:
@@ -145,7 +145,7 @@
failure action and then return null. (Requests may also
also fail because a system is out of memory.)
- Thread-safety: thread-safe unless NO_THREADS is defined
+ Thread-safety: thread-safe
Compliance: I believe it is compliant with the 1997 Single Unix Specification
Also SVID/XPG, ANSI C, and probably others as well.
@@ -154,8 +154,7 @@
People have reported using previous versions of this malloc on all
versions of Unix, sometimes by tweaking some of the defines
- below. It has been tested most extensively on Solaris and
- Linux. It is also reported to work on WIN32 platforms.
+ below. It has been tested most extensively on Solaris and Linux.
People also report using it in stand-alone embedded systems.
The implementation is in straight, hand-tuned ANSI C. It is not
@@ -170,19 +169,7 @@
Compilation Environment options:
- __STD_C derived from C compiler defines
- WIN32 NOT defined
- HAVE_MEMCPY defined
- USE_MEMCPY 1 if HAVE_MEMCPY is defined
- HAVE_MMAP defined as 1
- MMAP_CLEARS 1
HAVE_MREMAP 0 unless linux defined
- USE_ARENAS the same as HAVE_MMAP
- malloc_getpagesize derived from system #includes, or 4096 if not
- HAVE_USR_INCLUDE_MALLOC_H NOT defined
- LACKS_UNISTD_H NOT defined unless WIN32
- LACKS_SYS_PARAM_H NOT defined unless WIN32
- LACKS_SYS_MMAN_H NOT defined unless WIN32
Changing default word sizes:
@@ -197,7 +184,6 @@
USE_MALLOC_LOCK NOT defined
MALLOC_DEBUG NOT defined
REALLOC_ZERO_BYTES_FREES 1
- MALLOC_FAILURE_ACTION errno = ENOMEM, if __STD_C defined, else no-op
TRIM_FASTBINS 0
Options for customizing MORECORE:
@@ -221,69 +207,32 @@
probably don't want to touch unless you are extending or adapting malloc. */
/*
- __STD_C should be nonzero if using ANSI-standard C compiler, a C++
- compiler, or a C compiler sufficiently close to ANSI to get away
- with it.
+ void* is the pointer type that malloc should say it returns
*/
-#ifndef __STD_C
-#if defined(__STDC__) || defined(__cplusplus)
-#define __STD_C 1
-#else
-#define __STD_C 0
-#endif
-#endif /*__STD_C*/
-
-
-/*
- Void_t* is the pointer type that malloc should say it returns
-*/
-
-#ifndef Void_t
-#if (__STD_C || defined(WIN32))
-#define Void_t void
-#else
-#define Void_t char
-#endif
-#endif /*Void_t*/
+#ifndef void
+#define void void
+#endif /*void*/
-#if __STD_C
#include <stddef.h> /* for size_t */
#include <stdlib.h> /* for getenv(), abort() */
-#else
-#include <sys/types.h>
-#endif
#include <malloc-machine.h>
-#ifdef _LIBC
-#ifdef ATOMIC_FASTBINS
#include <atomic.h>
-#endif
#include <stdio-common/_itoa.h>
#include <bits/wordsize.h>
#include <sys/sysinfo.h>
-#endif
+
+#include <ldsodefs.h>
#ifdef __cplusplus
extern "C" {
#endif
-/* define LACKS_UNISTD_H if your system does not have a <unistd.h>. */
-
-/* #define LACKS_UNISTD_H */
-
-#ifndef LACKS_UNISTD_H
#include <unistd.h>
-#endif
-
-/* define LACKS_SYS_PARAM_H if your system does not have a <sys/param.h>. */
-
-/* #define LACKS_SYS_PARAM_H */
-
-
#include <stdio.h> /* needed for malloc_stats */
-#include <errno.h> /* needed for optional MALLOC_FAILURE_ACTION */
+#include <errno.h>
/* For uintptr_t. */
#include <stdint.h>
@@ -486,7 +435,6 @@ __malloc_assert (const char *assertion, const char *file, unsigned int line,
#define public_gET_STATe dlget_state
#define public_sET_STATe dlset_state
#else /* USE_DL_PREFIX */
-#ifdef _LIBC
/* Special defines for the GNU C library. */
#define public_cALLOc __libc_calloc
@@ -506,7 +454,6 @@ __malloc_assert (const char *assertion, const char *file, unsigned int line,
#define public_iCOMALLOc __libc_independent_comalloc
#define public_gET_STATe __malloc_get_state
#define public_sET_STATe __malloc_set_state
-#define malloc_getpagesize __getpagesize()
#define open __open
#define mmap __mmap
#define munmap __munmap
@@ -515,79 +462,13 @@ __malloc_assert (const char *assertion, const char *file, unsigned int line,
#define MORECORE (*__morecore)
#define MORECORE_FAILURE 0
-Void_t * __default_morecore (ptrdiff_t);
-Void_t *(*__morecore)(ptrdiff_t) = __default_morecore;
-
-#else /* !_LIBC */
-#define public_cALLOc calloc
-#define public_fREe free
-#define public_cFREe cfree
-#define public_mALLOc malloc
-#define public_mEMALIGn memalign
-#define public_rEALLOc realloc
-#define public_vALLOc valloc
-#define public_pVALLOc pvalloc
-#define public_mALLINFo mallinfo
-#define public_mALLOPt mallopt
-#define public_mTRIm malloc_trim
-#define public_mSTATs malloc_stats
-#define public_mUSABLe malloc_usable_size
-#define public_iCALLOc independent_calloc
-#define public_iCOMALLOc independent_comalloc
-#define public_gET_STATe malloc_get_state
-#define public_sET_STATe malloc_set_state
-#endif /* _LIBC */
-#endif /* USE_DL_PREFIX */
-
-#ifndef _LIBC
-#define __builtin_expect(expr, val) (expr)
-
-#define fwrite(buf, size, count, fp) _IO_fwrite (buf, size, count, fp)
-#endif
-
-/*
- HAVE_MEMCPY should be defined if you are not otherwise using
- ANSI STD C, but still have memcpy and memset in your C library
- and want to use them in calloc and realloc. Otherwise simple
- macro versions are defined below.
-
- USE_MEMCPY should be defined as 1 if you actually want to
- have memset and memcpy called. People report that the macro
- versions are faster than libc versions on some systems.
-
- Even if USE_MEMCPY is set to 1, loops to copy/clear small chunks
- (of <= 36 bytes) are manually unrolled in realloc and calloc.
-*/
-
-#define HAVE_MEMCPY
-
-#ifndef USE_MEMCPY
-#ifdef HAVE_MEMCPY
-#define USE_MEMCPY 1
-#else
-#define USE_MEMCPY 0
-#endif
-#endif
+void * __default_morecore (ptrdiff_t);
+void *(*__morecore)(ptrdiff_t) = __default_morecore;
+#endif /* USE_DL_PREFIX */
-#if (__STD_C || defined(HAVE_MEMCPY))
-#ifdef _LIBC
-# include <string.h>
-#else
-#ifdef WIN32
-/* On Win32 memset and memcpy are already declared in windows.h */
-#else
-#if __STD_C
-void* memset(void*, int, size_t);
-void* memcpy(void*, const void*, size_t);
-#else
-Void_t* memset();
-Void_t* memcpy();
-#endif
-#endif
-#endif
-#endif
+#include <string.h>
/* Force a value to be in a register and stop the compiler referring
@@ -597,38 +478,10 @@ Void_t* memcpy();
/*
- MALLOC_FAILURE_ACTION is the action to take before "return 0" when
- malloc fails to be able to return memory, either because memory is
- exhausted or because of illegal arguments.
-
- By default, sets errno if running on STD_C platform, else does nothing.
-*/
-
-#ifndef MALLOC_FAILURE_ACTION
-#if __STD_C
-#define MALLOC_FAILURE_ACTION \
- errno = ENOMEM;
-
-#else
-#define MALLOC_FAILURE_ACTION
-#endif
-#endif
-
-/*
MORECORE-related declarations. By default, rely on sbrk
*/
-#ifdef LACKS_UNISTD_H
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-#if __STD_C
-extern Void_t* sbrk(ptrdiff_t);
-#else
-extern Void_t* sbrk();
-#endif
-#endif
-#endif
-
/*
MORECORE is the name of the routine to call to obtain more memory
from the system. See below for general guidance on writing
@@ -689,49 +542,16 @@ extern Void_t* sbrk();
/*
- Define HAVE_MMAP as true to optionally make malloc() use mmap() to
- allocate very large blocks. These will be returned to the
- operating system immediately after a free(). Also, if mmap
- is available, it is used as a backup strategy in cases where
- MORECORE fails to provide space from system.
-
- This malloc is best tuned to work with mmap for large requests.
- If you do not have mmap, operations involving very large chunks (1MB
- or so) may be slower than you'd like.
-*/
-
-#ifndef HAVE_MMAP
-#define HAVE_MMAP 1
-
-/*
- Standard unix mmap using /dev/zero clears memory so calloc doesn't
- need to.
-*/
-
-#ifndef MMAP_CLEARS
-#define MMAP_CLEARS 1
-#endif
-
-#else /* no mmap */
-#ifndef MMAP_CLEARS
-#define MMAP_CLEARS 0
-#endif
-#endif
-
-
-/*
MMAP_AS_MORECORE_SIZE is the minimum mmap size argument to use if
- sbrk fails, and mmap is used as a backup (which is done only if
- HAVE_MMAP). The value must be a multiple of page size. This
- backup strategy generally applies only when systems have "holes" in
- address space, so sbrk cannot perform contiguous expansion, but
- there is still space available on system. On systems for which
- this is known to be useful (i.e. most linux kernels), this occurs
- only when programs allocate huge amounts of memory. Between this,
- and the fact that mmap regions tend to be limited, the size should
- be large, to avoid too many mmap calls and thus avoid running out
- of kernel resources.
-*/
+ sbrk fails, and mmap is used as a backup. The value must be a
+ multiple of page size. This backup strategy generally applies only
+ when systems have "holes" in address space, so sbrk cannot perform
+ contiguous expansion, but there is still space available on system.
+ On systems for which this is known to be useful (i.e. most linux
+ kernels), this occurs only when programs allocate huge amounts of
+ memory. Between this, and the fact that mmap regions tend to be
+ limited, the size should be large, to avoid too many mmap calls and
+ thus avoid running out of kernel resources. */
#ifndef MMAP_AS_MORECORE_SIZE
#define MMAP_AS_MORECORE_SIZE (1024 * 1024)
@@ -750,81 +570,8 @@ extern Void_t* sbrk();
#define HAVE_MREMAP 0
#endif
-#endif /* HAVE_MMAP */
-
-/* Define USE_ARENAS to enable support for multiple `arenas'. These
- are allocated using mmap(), are necessary for threads and
- occasionally useful to overcome address space limitations affecting
- sbrk(). */
-
-#ifndef USE_ARENAS
-#define USE_ARENAS HAVE_MMAP
-#endif
-
-
-/*
- The system page size. To the extent possible, this malloc manages
- memory from the system in page-size units. Note that this value is
- cached during initialization into a field of malloc_state. So even
- if malloc_getpagesize is a function, it is only called once.
-
- The following mechanics for getpagesize were adapted from bsd/gnu
- getpagesize.h. If none of the system-probes here apply, a value of
- 4096 is used, which should be OK: If they don't apply, then using
- the actual value probably doesn't impact performance.
-*/
-
-
-#ifndef malloc_getpagesize
-
-#ifndef LACKS_UNISTD_H
-# include <unistd.h>
-#endif
+#endif /* HAVE_MREMAP */
-# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */
-# ifndef _SC_PAGE_SIZE
-# define _SC_PAGE_SIZE _SC_PAGESIZE
-# endif
-# endif
-
-# ifdef _SC_PAGE_SIZE
-# define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
-# else
-# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
- extern size_t getpagesize();
-# define malloc_getpagesize getpagesize()
-# else
-# ifdef WIN32 /* use supplied emulation of getpagesize */
-# define malloc_getpagesize getpagesize()
-# else
-# ifndef LACKS_SYS_PARAM_H
-# include <sys/param.h>
-# endif
-# ifdef EXEC_PAGESIZE
-# define malloc_getpagesize EXEC_PAGESIZE
-# else
-# ifdef NBPG
-# ifndef CLSIZE
-# define malloc_getpagesize NBPG
-# else
-# define malloc_getpagesize (NBPG * CLSIZE)
-# endif
-# else
-# ifdef NBPC
-# define malloc_getpagesize NBPC
-# else
-# ifdef PAGESIZE
-# define malloc_getpagesize PAGESIZE
-# else /* just guess */
-# define malloc_getpagesize (4096)
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-#endif
/*
This version of malloc supports the standard SVID/XPG mallinfo
@@ -840,25 +587,8 @@ extern Void_t* sbrk();
bunch of fields that are not even meaningful in this version of
malloc. These fields are are instead filled by mallinfo() with
other numbers that might be of interest.
-
- HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
- /usr/include/malloc.h file that includes a declaration of struct
- mallinfo. If so, it is included; else an SVID2/XPG2 compliant
- version is declared below. These must be precisely the same for
- mallinfo() to work. The original SVID version of this struct,
- defined on most systems with mallinfo, declares all fields as
- ints. But some others define as unsigned long. If your system
- defines the fields using a type of different width than listed here,
- you must #include your system version and #define
- HAVE_USR_INCLUDE_MALLOC_H.
*/
-/* #define HAVE_USR_INCLUDE_MALLOC_H */
-
-#ifdef HAVE_USR_INCLUDE_MALLOC_H
-#include "/usr/include/malloc.h"
-#endif
-
/* ---------- description of public routines ------------ */
@@ -876,17 +606,11 @@ extern Void_t* sbrk();
differs across systems, but is in all cases less than the maximum
representable value of a size_t.
*/
-#if __STD_C
-Void_t* public_mALLOc(size_t);
-#else
-Void_t* public_mALLOc();
-#endif
-#ifdef libc_hidden_proto
+void* public_mALLOc(size_t);
libc_hidden_proto (public_mALLOc)
-#endif
/*
- free(Void_t* p)
+ free(void* p)
Releases the chunk of memory pointed to by p, that had been previously
allocated using malloc or a related routine such as realloc.
It has no effect if p is null. It can have arbitrary (i.e., bad!)
@@ -896,28 +620,18 @@ libc_hidden_proto (public_mALLOc)
when possible, automatically trigger operations that give
back unused memory to the system, thus reducing program footprint.
*/
-#if __STD_C
-void public_fREe(Void_t*);
-#else
-void public_fREe();
-#endif
-#ifdef libc_hidden_proto
+void public_fREe(void*);
libc_hidden_proto (public_fREe)
-#endif
/*
calloc(size_t n_elements, size_t element_size);
Returns a pointer to n_elements * element_size bytes, with all locations
set to zero.
*/
-#if __STD_C
-Void_t* public_cALLOc(size_t, size_t);
-#else
-Void_t* public_cALLOc();
-#endif
+void* public_cALLOc(size_t, size_t);
/*
- realloc(Void_t* p, size_t n)
+ realloc(void* p, size_t n)
Returns a pointer to a chunk of size n that contains the same data
as does chunk p up to the minimum of (n, p's size) bytes, or null
if no space is available.
@@ -943,14 +657,8 @@ Void_t* public_cALLOc();
The old unix realloc convention of allowing the last-free'd chunk
to be used as an argument to realloc is not supported.
*/
-#if __STD_C
-Void_t* public_rEALLOc(Void_t*, size_t);
-#else
-Void_t* public_rEALLOc();
-#endif
-#ifdef libc_hidden_proto
+void* public_rEALLOc(void*, size_t);
libc_hidden_proto (public_rEALLOc)
-#endif
/*
memalign(size_t alignment, size_t n);
@@ -964,25 +672,15 @@ libc_hidden_proto (public_rEALLOc)
Overreliance on memalign is a sure way to fragment space.
*/
-#if __STD_C
-Void_t* public_mEMALIGn(size_t, size_t);
-#else
-Void_t* public_mEMALIGn();
-#endif
-#ifdef libc_hidden_proto
+void* public_mEMALIGn(size_t, size_t);
libc_hidden_proto (public_mEMALIGn)
-#endif
/*
valloc(size_t n);
Equivalent to memalign(pagesize, n), where pagesize is the page
size of the system. If the pagesize is unknown, 4096 is used.
*/
-#if __STD_C
-Void_t* public_vALLOc(size_t);
-#else
-Void_t* public_vALLOc();
-#endif
+void* public_vALLOc(size_t);
@@ -1007,11 +705,7 @@ Void_t* public_vALLOc();
M_MMAP_THRESHOLD -3 128*1024 any (or 0 if no MMAP support)
M_MMAP_MAX -4 65536 any (0 disables use of mmap)
*/
-#if __STD_C
int public_mALLOPt(int, int);
-#else
-int public_mALLOPt();
-#endif
/*
@@ -1037,137 +731,7 @@ int public_mALLOPt();
be kept as longs, the reported values may wrap around zero and
thus be inaccurate.
*/
-#if __STD_C
struct mallinfo public_mALLINFo(void);
-#else
-struct mallinfo public_mALLINFo();
-#endif
-
-#ifndef _LIBC
-/*
- independent_calloc(size_t n_elements, size_t element_size, Void_t* chunks[]);
-
- independent_calloc is similar to calloc, but instead of returning a
- single cleared space, it returns an array of pointers to n_elements
- independent elements that can hold contents of size elem_size, each
- of which starts out cleared, and can be independently freed,
- realloc'ed etc. The elements are guaranteed to be adjacently
- allocated (this is not guaranteed to occur with multiple callocs or
- mallocs), which may also improve cache locality in some
- applications.
-
- The "chunks" argument is optional (i.e., may be null, which is
- probably the most typical usage). If it is null, the returned array
- is itself dynamically allocated and should also be freed when it is
- no longer needed. Otherwise, the chunks array must be of at least
- n_elements in length. It is filled in with the pointers to the
- chunks.
-
- In either case, independent_calloc returns this pointer array, or
- null if the allocation failed. If n_elements is zero and "chunks"
- is null, it returns a chunk representing an array with zero elements
- (which should be freed if not wanted).
-
- Each element must be individually freed when it is no longer
- needed. If you'd like to instead be able to free all at once, you
- should instead use regular calloc and assign pointers into this
- space to represent elements. (In this case though, you cannot
- independently free elements.)
-
- independent_calloc simplifies and speeds up implementations of many
- kinds of pools. It may also be useful when constructing large data
- structures that initially have a fixed number of fixed-sized nodes,
- but the number is not known at compile time, and some of the nodes
- may later need to be freed. For example:
-
- struct Node { int item; struct Node* next; };
-
- struct Node* build_list() {
- struct Node** pool;
- int n = read_number_of_nodes_needed();
- if (n <= 0) return 0;
- pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
- if (pool == 0) die();
- // organize into a linked list...
- struct Node* first = pool[0];
- for (i = 0; i < n-1; ++i)
- pool[i]->next = pool[i+1];
- free(pool); // Can now free the array (or not, if it is needed later)
- return first;
- }
-*/
-#if __STD_C
-Void_t** public_iCALLOc(size_t, size_t, Void_t**);
-#else
-Void_t** public_iCALLOc();
-#endif
-
-/*
- independent_comalloc(size_t n_elements, size_t sizes[], Void_t* chunks[]);
-
- independent_comalloc allocates, all at once, a set of n_elements
- chunks with sizes indicated in the "sizes" array. It returns
- an array of pointers to these elements, each of which can be
- independently freed, realloc'ed etc. The elements are guaranteed to
- be adjacently allocated (this is not guaranteed to occur with
- multiple callocs or mallocs), which may also improve cache locality
- in some applications.
-
- The "chunks" argument is optional (i.e., may be null). If it is null
- the returned array is itself dynamically allocated and should also
- be freed when it is no longer needed. Otherwise, the chunks array
- must be of at least n_elements in length. It is filled in with the
- pointers to the chunks.
-
- In either case, independent_comalloc returns this pointer array, or
- null if the allocation failed. If n_elements is zero and chunks is
- null, it returns a chunk representing an array with zero elements
- (which should be freed if not wanted).
-
- Each element must be individually freed when it is no longer
- needed. If you'd like to instead be able to free all at once, you
- should instead use a single regular malloc, and assign pointers at
- particular offsets in the aggregate space. (In this case though, you
- cannot independently free elements.)
-
- independent_comallac differs from independent_calloc in that each
- element may have a different size, and also that it does not
- automatically clear elements.
-
- independent_comalloc can be used to speed up allocation in cases
- where several structs or objects must always be allocated at the
- same time. For example:
-
- struct Head { ... }
- struct Foot { ... }
-
- void send_message(char* msg) {
- int msglen = strlen(msg);
- size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
- void* chunks[3];
- if (independent_comalloc(3, sizes, chunks) == 0)
- die();
- struct Head* head = (struct Head*)(chunks[0]);
- char* body = (char*)(chunks[1]);
- struct Foot* foot = (struct Foot*)(chunks[2]);
- // ...
- }
-
- In general though, independent_comalloc is worth using only for
- larger values of n_elements. For small values, you probably won't
- detect enough difference from series of malloc calls to bother.
-
- Overuse of independent_comalloc can increase overall memory usage,
- since it cannot reuse existing noncontiguous small chunks that
- might be available for some of the elements.
-*/
-#if __STD_C
-Void_t** public_iCOMALLOc(size_t, size_t*, Void_t**);
-#else
-Void_t** public_iCOMALLOc();
-#endif
-
-#endif /* _LIBC */
/*
@@ -1175,25 +739,17 @@ Void_t** public_iCOMALLOc();
Equivalent to valloc(minimum-page-that-holds(n)), that is,
round up n to nearest pagesize.
*/
-#if __STD_C
-Void_t* public_pVALLOc(size_t);
-#else
-Void_t* public_pVALLOc();
-#endif
+void* public_pVALLOc(size_t);
/*
- cfree(Void_t* p);
+ cfree(void* p);
Equivalent to free(p).
cfree is needed/defined on some systems that pair it with calloc,
for odd historical reasons (such as: cfree is used in example
code in the first edition of K&R).
*/
-#if __STD_C
-void public_cFREe(Void_t*);
-#else
-void public_cFREe();
-#endif
+void public_cFREe(void*);
/*
malloc_trim(size_t pad);
@@ -1219,14 +775,10 @@ void public_cFREe();
On systems that do not support "negative sbrks", it will always
return 0.
*/
-#if __STD_C
int public_mTRIm(size_t);
-#else
-int public_mTRIm();
-#endif
/*
- malloc_usable_size(Void_t* p);
+ malloc_usable_size(void* p);
Returns the number of bytes you can actually use in
an allocated chunk, which may be more than you requested (although
@@ -1240,11 +792,7 @@ int public_mTRIm();
assert(malloc_usable_size(p) >= 256);
*/
-#if __STD_C
-size_t public_mUSABLe(Void_t*);
-#else
-size_t public_mUSABLe();
-#endif
+size_t public_mUSABLe(void*);
/*
malloc_stats();
@@ -1266,11 +814,7 @@ size_t public_mUSABLe();
More information can be obtained by calling mallinfo.
*/
-#if __STD_C
void public_mSTATs(void);
-#else
-void public_mSTATs();
-#endif
/*
malloc_get_state(void);
@@ -1278,32 +822,22 @@ void public_mSTATs();
Returns the state of all malloc variables in an opaque data
structure.
*/
-#if __STD_C
-Void_t* public_gET_STATe(void);
-#else
-Void_t* public_gET_STATe();
-#endif
+void* public_gET_STATe(void);
/*
- malloc_set_state(Void_t* state);
+ malloc_set_state(void* state);
Restore the state of all malloc variables from data obtained with
malloc_get_state().
*/
-#if __STD_C
-int public_sET_STATe(Void_t*);
-#else
-int public_sET_STATe();
-#endif
+int public_sET_STATe(void*);
-#ifdef _LIBC
/*
posix_memalign(void **memptr, size_t alignment, size_t size);
POSIX wrapper like memalign(), checking for validity of size.
*/
int __posix_memalign(void **, size_t, size_t);
-#endif
/* mallopt tuning options */
@@ -1569,19 +1103,13 @@ int __posix_memalign(void **, size_t, size_t);
performance.
The default is set to a value that serves only as a safeguard.
- Setting to 0 disables use of mmap for servicing large requests. If
- HAVE_MMAP is not set, the default value is 0, and attempts to set it
- to non-zero values in mallopt will fail.
+ Setting to 0 disables use of mmap for servicing large requests.
*/
#define M_MMAP_MAX -4
#ifndef DEFAULT_MMAP_MAX
-#if HAVE_MMAP
#define DEFAULT_MMAP_MAX (65536)
-#else
-#define DEFAULT_MMAP_MAX (0)
-#endif
#endif
#ifdef __cplusplus
@@ -1610,89 +1138,42 @@ typedef struct malloc_chunk* mchunkptr;
/* Internal routines. */
-#if __STD_C
-
-static Void_t* _int_malloc(mstate, size_t);
-#ifdef ATOMIC_FASTBINS
+static void* _int_malloc(mstate, size_t);
static void _int_free(mstate, mchunkptr, int);
-#else
-static void _int_free(mstate, mchunkptr);
-#endif
-static Void_t* _int_realloc(mstate, mchunkptr, INTERNAL_SIZE_T,
+static void* _int_realloc(mstate, mchunkptr, INTERNAL_SIZE_T,
INTERNAL_SIZE_T);
-static Void_t* _int_memalign(mstate, size_t, size_t);
-static Void_t* _int_valloc(mstate, size_t);
-static Void_t* _int_pvalloc(mstate, size_t);
-/*static Void_t* cALLOc(size_t, size_t);*/
-#ifndef _LIBC
-static Void_t** _int_icalloc(mstate, size_t, size_t, Void_t**);
-static Void_t** _int_icomalloc(mstate, size_t, size_t*, Void_t**);
-#endif
+static void* _int_memalign(mstate, size_t, size_t);
+static void* _int_valloc(mstate, size_t);
+static void* _int_pvalloc(mstate, size_t);
+/*static void* cALLOc(size_t, size_t);*/
static int mTRIm(mstate, size_t);
-static size_t mUSABLe(Void_t*);
+static size_t mUSABLe(void*);
static void mSTATs(void);
static int mALLOPt(int, int);
static struct mallinfo mALLINFo(mstate);
static void malloc_printerr(int action, const char *str, void *ptr);
-static Void_t* internal_function mem2mem_check(Void_t *p, size_t sz);
+static void* internal_function mem2mem_check(void *p, size_t sz);
static int internal_function top_check(void);
static void internal_function munmap_chunk(mchunkptr p);
#if HAVE_MREMAP
static mchunkptr internal_function mremap_chunk(mchunkptr p, size_t new_size);
#endif
-static Void_t* malloc_check(size_t sz, const Void_t *caller);
-static void free_check(Void_t* mem, const Void_t *caller);
-static Void_t* realloc_check(Void_t* oldmem, size_t bytes,
- const Void_t *caller);
-static Void_t* memalign_check(size_t alignment, size_t bytes,
- const Void_t *caller);
-#ifndef NO_THREADS
-# ifdef _LIBC
-# if USE___THREAD || !defined SHARED
- /* These routines are never needed in this configuration. */
-# define NO_STARTER
-# endif
-# endif
-# ifdef NO_STARTER
-# undef NO_STARTER
-# else
-static Void_t* malloc_starter(size_t sz, const Void_t *caller);
-static Void_t* memalign_starter(size_t aln, size_t sz, const Void_t *caller);
-static void free_starter(Void_t* mem, const Void_t *caller);
-# endif
-static Void_t* malloc_atfork(size_t sz, const Void_t *caller);
-static void free_atfork(Void_t* mem, const Void_t *caller);
-#endif
-
-#else
-
-static Void_t* _int_malloc();
-static void _int_free();
-static Void_t* _int_realloc();
-static Void_t* _int_memalign();
-static Void_t* _int_valloc();
-static Void_t* _int_pvalloc();
-/*static Void_t* cALLOc();*/
-static Void_t** _int_icalloc();
-static Void_t** _int_icomalloc();
-static int mTRIm();
-static size_t mUSABLe();
-static void mSTATs();
-static int mALLOPt();
-static struct mallinfo mALLINFo();
-
-#endif
-
-
+static void* malloc_check(size_t sz, const void *caller);
+static void free_check(void* mem, const void *caller);
+static void* realloc_check(void* oldmem, size_t bytes,
+ const void *caller);
+static void* memalign_check(size_t alignment, size_t bytes,
+ const void *caller);
+/* These routines are never needed in this configuration. */
+static void* malloc_atfork(size_t sz, const void *caller);
+static void free_atfork(void* mem, const void *caller);
/* ------------- Optional versions of memcopy ---------------- */
-#if USE_MEMCPY
-
/*
Note: memcpy is ONLY invoked with non-overlapping regions,
so the (usually slower) memmove is not needed.
@@ -1701,58 +1182,12 @@ static struct mallinfo mALLINFo();
#define MALLOC_COPY(dest, src, nbytes) memcpy(dest, src, nbytes)
#define MALLOC_ZERO(dest, nbytes) memset(dest, 0, nbytes)
-#else /* !USE_MEMCPY */
-
-/* Use Duff's device for good zeroing/copying performance. */
-
-#define MALLOC_ZERO(charp, nbytes) \
-do { \
- INTERNAL_SIZE_T* mzp = (INTERNAL_SIZE_T*)(charp); \
- unsigned long mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T); \
- long mcn; \
- if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \
- switch (mctmp) { \
- case 0: for(;;) { *mzp++ = 0; \
- case 7: *mzp++ = 0; \
- case 6: *mzp++ = 0; \
- case 5: *mzp++ = 0; \
- case 4: *mzp++ = 0; \
- case 3: *mzp++ = 0; \
- case 2: *mzp++ = 0; \
- case 1: *mzp++ = 0; if(mcn <= 0) break; mcn--; } \
- } \
-} while(0)
-
-#define MALLOC_COPY(dest,src,nbytes) \
-do { \
- INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) src; \
- INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) dest; \
- unsigned long mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T); \
- long mcn; \
- if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \
- switch (mctmp) { \
- case 0: for(;;) { *mcdst++ = *mcsrc++; \
- case 7: *mcdst++ = *mcsrc++; \
- case 6: *mcdst++ = *mcsrc++; \
- case 5: *mcdst++ = *mcsrc++; \
- case 4: *mcdst++ = *mcsrc++; \
- case 3: *mcdst++ = *mcsrc++; \
- case 2: *mcdst++ = *mcsrc++; \
- case 1: *mcdst++ = *mcsrc++; if(mcn <= 0) break; mcn--; } \
- } \
-} while(0)
-
-#endif
/* ------------------ MMAP support ------------------ */
-#if HAVE_MMAP
-
#include <fcntl.h>
-#ifndef LACKS_SYS_MMAN_H
#include <sys/mman.h>
-#endif
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
# define MAP_ANONYMOUS MAP_ANON
@@ -1792,9 +1227,6 @@ static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
#endif
-#endif /* HAVE_MMAP */
-
-
/*
----------------------- Chunk representations -----------------------
*/
@@ -1913,7 +1345,7 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/* conversion from malloc headers to user pointers, and back */
-#define chunk2mem(p) ((Void_t*)((char*)(p) + 2*SIZE_SZ))
+#define chunk2mem(p) ((void*)((char*)(p) + 2*SIZE_SZ))
#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - 2*SIZE_SZ))
/* The smallest possible chunk */
@@ -1954,7 +1386,7 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#define checked_request2size(req, sz) \
if (REQUEST_OUT_OF_RANGE(req)) { \
- MALLOC_FAILURE_ACTION; \
+ __set_errno (ENOMEM); \
return 0; \
} \
(sz) = request2size(req);
@@ -2050,8 +1482,8 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
below. There are no other static variables, except in two optional
cases:
* If USE_MALLOC_LOCK is defined, the mALLOC_MUTEx declared above.
- * If HAVE_MMAP is true, but mmap doesn't support
- MAP_ANONYMOUS, a dummy file descriptor for mmap.
+ * If mmap doesn't support MAP_ANONYMOUS, a dummy file descriptor
+ for mmap.
Beware of lots of tricks that minimize the total bookkeeping space
requirements. The result is a little over 1K bytes (for 4byte
@@ -2318,13 +1750,8 @@ typedef struct malloc_chunk* mfastbinptr;
#define FASTCHUNKS_BIT (1U)
#define have_fastchunks(M) (((M)->flags & FASTCHUNKS_BIT) == 0)
-#ifdef ATOMIC_FASTBINS
#define clear_fastchunks(M) catomic_or (&(M)->flags, FASTCHUNKS_BIT)
#define set_fastchunks(M) catomic_and (&(M)->flags, ~FASTCHUNKS_BIT)
-#else
-#define clear_fastchunks(M) ((M)->flags |= FASTCHUNKS_BIT)
-#define set_fastchunks(M) ((M)->flags &= ~FASTCHUNKS_BIT)
-#endif
/*
NONCONTIGUOUS_BIT indicates that MORECORE does not return contiguous
@@ -2418,9 +1845,6 @@ struct malloc_par {
dynamic behavior. */
int no_dyn_threshold;
- /* Cache malloc_getpagesize */
- unsigned int pagesize;
-
/* Statistics */
INTERNAL_SIZE_T mmapped_mem;
/*INTERNAL_SIZE_T sbrked_mem;*/
@@ -2438,11 +1862,25 @@ struct malloc_par {
before using. This malloc relies on the property that malloc_state
is initialized to all zeroes (as is true of C statics). */
-static struct malloc_state main_arena;
+static struct malloc_state main_arena =
+ {
+ .mutex = MUTEX_INITIALIZER,
+ .next = &main_arena
+ };
/* There is only one instance of the malloc parameters. */
-static struct malloc_par mp_;
+static struct malloc_par mp_ =
+ {
+ .top_pad = DEFAULT_TOP_PAD,
+ .n_mmaps_max = DEFAULT_MMAP_MAX,
+ .mmap_threshold = DEFAULT_MMAP_THRESHOLD,
+ .trim_threshold = DEFAULT_TRIM_THRESHOLD,
+#ifdef PER_THREAD
+# define NARENAS_FROM_NCORES(n) ((n) * (sizeof(long) == 4 ? 2 : 8))
+ .arena_test = NARENAS_FROM_NCORES (1)
+#endif
+ };
#ifdef PER_THREAD
@@ -2465,11 +1903,7 @@ static INTERNAL_SIZE_T global_max_fast;
optimization at all. (Inlining it in malloc_consolidate is fine though.)
*/
-#if __STD_C
static void malloc_init_state(mstate av)
-#else
-static void malloc_init_state(av) mstate av;
-#endif
{
int i;
mbinptr bin;
@@ -2495,19 +1929,9 @@ static void malloc_init_state(av) mstate av;
Other internal utilities operating on mstates
*/
-#if __STD_C
-static Void_t* sYSMALLOc(INTERNAL_SIZE_T, mstate);
+static void* sYSMALLOc(INTERNAL_SIZE_T, mstate);
static int sYSTRIm(size_t, mstate);
static void malloc_consolidate(mstate);
-#ifndef _LIBC
-static Void_t** iALLOc(mstate, size_t, size_t*, int, Void_t**);
-#endif
-#else
-static Void_t* sYSMALLOc();
-static int sYSTRIm();
-static void malloc_consolidate();
-static Void_t** iALLOc();
-#endif
/* -------------- Early definitions for debugging hooks ---------------- */
@@ -2515,21 +1939,17 @@ static Void_t** iALLOc();
/* Define and initialize the hook variables. These weak definitions must
appear before any use of the variables in a function (arena.c uses one). */
#ifndef weak_variable
-#ifndef _LIBC
-#define weak_variable /**/
-#else
/* In GNU libc we want the hook variables to be weak definitions to
avoid a problem with Emacs. */
-#define weak_variable weak_function
-#endif
+# define weak_variable weak_function
#endif
/* Forward declarations. */
-static Void_t* malloc_hook_ini __MALLOC_P ((size_t sz,
+static void* malloc_hook_ini __MALLOC_P ((size_t sz,
const __malloc_ptr_t caller));
-static Void_t* realloc_hook_ini __MALLOC_P ((Void_t* ptr, size_t sz,
+static void* realloc_hook_ini __MALLOC_P ((void* ptr, size_t sz,
const __malloc_ptr_t caller));
-static Void_t* memalign_hook_ini __MALLOC_P ((size_t alignment, size_t sz,
+static void* memalign_hook_ini __MALLOC_P ((size_t alignment, size_t sz,
const __malloc_ptr_t caller));
void weak_variable (*__malloc_initialize_hook) (void) = NULL;
@@ -2598,11 +2018,7 @@ static int perturb_byte;
Properties of all chunks
*/
-#if __STD_C
static void do_check_chunk(mstate av, mchunkptr p)
-#else
-static void do_check_chunk(av, p) mstate av; mchunkptr p;
-#endif
{
unsigned long sz = chunksize(p);
/* min and max possible addresses assuming contiguous allocation */
@@ -2627,19 +2043,14 @@ static void do_check_chunk(av, p) mstate av; mchunkptr p;
}
else {
-#if HAVE_MMAP
/* address is outside main heap */
if (contiguous(av) && av->top != initial_top(av)) {
assert(((char*)p) < min_address || ((char*)p) >= max_address);
}
/* chunk is page-aligned */
- assert(((p->prev_size + sz) & (mp_.pagesize-1)) == 0);
+ assert(((p->prev_size + sz) & (GLRO(dl_pagesize)-1)) == 0);
/* mem is aligned */
assert(aligned_OK(chunk2mem(p)));
-#else
- /* force an appropriate assert violation if debug set */
- assert(!chunk_is_mmapped(p));
-#endif
}
}
@@ -2647,11 +2058,7 @@ static void do_check_chunk(av, p) mstate av; mchunkptr p;
Properties of free chunks
*/
-#if __STD_C
static void do_check_free_chunk(mstate av, mchunkptr p)
-#else
-static void do_check_free_chunk(av, p) mstate av; mchunkptr p;
-#endif
{
INTERNAL_SIZE_T sz = p->size & ~(PREV_INUSE|NON_MAIN_ARENA);
mchunkptr next = chunk_at_offset(p, sz);
@@ -2685,11 +2092,7 @@ static void do_check_free_chunk(av, p) mstate av; mchunkptr p;
Properties of inuse chunks
*/
-#if __STD_C
static void do_check_inuse_chunk(mstate av, mchunkptr p)
-#else
-static void do_check_inuse_chunk(av, p) mstate av; mchunkptr p;
-#endif
{
mchunkptr next;
@@ -2726,12 +2129,7 @@ static void do_check_inuse_chunk(av, p) mstate av; mchunkptr p;
Properties of chunks recycled from fastbins
*/
-#if __STD_C
static void do_check_remalloced_chunk(mstate av, mchunkptr p, INTERNAL_SIZE_T s)
-#else
-static void do_check_remalloced_chunk(av, p, s)
-mstate av; mchunkptr p; INTERNAL_SIZE_T s;
-#endif
{
INTERNAL_SIZE_T sz = p->size & ~(PREV_INUSE|NON_MAIN_ARENA);
@@ -2759,12 +2157,7 @@ mstate av; mchunkptr p; INTERNAL_SIZE_T s;
Properties of nonrecycled chunks at the point they are malloced
*/
-#if __STD_C
static void do_check_malloced_chunk(mstate av, mchunkptr p, INTERNAL_SIZE_T s)
-#else
-static void do_check_malloced_chunk(av, p, s)
-mstate av; mchunkptr p; INTERNAL_SIZE_T s;
-#endif
{
/* same as recycled case ... */
do_check_remalloced_chunk(av, p, s);
@@ -2816,7 +2209,7 @@ static void do_check_malloc_state(mstate av)
return;
/* pagesize is a power of 2 */
- assert((mp_.pagesize & (mp_.pagesize-1)) == 0);
+ assert((GLRO(dl_pagesize) & (GLRO(dl_pagesize)-1)) == 0);
/* A contiguous main_arena is consistent with sbrk_base. */
if (av == &main_arena && contiguous(av))
@@ -2928,10 +2321,6 @@ static void do_check_malloc_state(mstate av)
/* sanity checks for statistics */
-#ifdef NO_THREADS
- assert(total <= (unsigned long)(mp_.max_total_mem));
- assert(mp_.n_mmaps >= 0);
-#endif
assert(mp_.n_mmaps <= mp_.max_n_mmaps);
assert((unsigned long)(av->system_mem) <=
@@ -2939,11 +2328,6 @@ static void do_check_malloc_state(mstate av)
assert((unsigned long)(mp_.mmapped_mem) <=
(unsigned long)(mp_.max_mmapped_mem));
-
-#ifdef NO_THREADS
- assert((unsigned long)(mp_.max_total_mem) >=
- (unsigned long)(mp_.mmapped_mem) + (unsigned long)(av->system_mem));
-#endif
}
#endif
@@ -2961,11 +2345,7 @@ static void do_check_malloc_state(mstate av)
be extended or replaced.
*/
-#if __STD_C
-static Void_t* sYSMALLOc(INTERNAL_SIZE_T nb, mstate av)
-#else
-static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
-#endif
+static void* sYSMALLOc(INTERNAL_SIZE_T nb, mstate av)
{
mchunkptr old_top; /* incoming value of av->top */
INTERNAL_SIZE_T old_size; /* its size */
@@ -2987,12 +2367,10 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
unsigned long sum; /* for updating stats */
- size_t pagemask = mp_.pagesize - 1;
+ size_t pagemask = GLRO(dl_pagesize) - 1;
bool tried_mmap = false;
-#if HAVE_MMAP
-
/*
If have mmap, and the request size meets the mmap threshold, and
the system supports mmap, and there are few enough currently
@@ -3010,14 +2388,10 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
Round up size to nearest page. For mmapped chunks, the overhead
is one SIZE_SZ unit larger than for normal chunks, because there
is no following chunk whose prev_size field could be used.
- */
-#if 1
- /* See the front_misalign handling below, for glibc there is no
- need for further alignments. */
+
+ See the front_misalign handling below, for glibc there is no
+ need for further alignments. */
size = (nb + SIZE_SZ + pagemask) & ~pagemask;
-#else
- size = (nb + SIZE_SZ + MALLOC_ALIGN_MASK + pagemask) & ~pagemask;
-#endif
tried_mmap = true;
/* Don't try if size wraps around 0 */
@@ -3033,27 +2407,14 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
returned start address to meet alignment requirements here
and in memalign(), and still be able to compute proper
address argument for later munmap in free() and realloc().
- */
-#if 1
- /* For glibc, chunk2mem increases the address by 2*SIZE_SZ and
- MALLOC_ALIGN_MASK is 2*SIZE_SZ-1. Each mmap'ed area is page
- aligned and therefore definitely MALLOC_ALIGN_MASK-aligned. */
+ For glibc, chunk2mem increases the address by 2*SIZE_SZ and
+ MALLOC_ALIGN_MASK is 2*SIZE_SZ-1. Each mmap'ed area is page
+ aligned and therefore definitely MALLOC_ALIGN_MASK-aligned. */
assert (((INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK) == 0);
-#else
- front_misalign = (INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK;
- if (front_misalign > 0) {
- correction = MALLOC_ALIGNMENT - front_misalign;
- p = (mchunkptr)(mm + correction);
- p->prev_size = correction;
- set_head(p, (size - correction) |IS_MMAPPED);
- }
- else
-#endif
- {
- p = (mchunkptr)mm;
- set_head(p, size|IS_MMAPPED);
- }
+
+ p = (mchunkptr)mm;
+ set_head(p, size|IS_MMAPPED);
/* update statistics */
@@ -3063,11 +2424,6 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
sum = mp_.mmapped_mem += size;
if (sum > (unsigned long)(mp_.max_mmapped_mem))
mp_.max_mmapped_mem = sum;
-#ifdef NO_THREADS
- sum += av->system_mem;
- if (sum > (unsigned long)(mp_.max_total_mem))
- mp_.max_total_mem = sum;
-#endif
check_chunk(av, p);
@@ -3075,7 +2431,6 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
}
}
}
-#endif
/* Record incoming configuration of top */
@@ -3098,11 +2453,6 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
/* Precondition: not enough current space to satisfy nb request */
assert((unsigned long)(old_size) < (unsigned long)(nb + MINSIZE));
-#ifndef ATOMIC_FASTBINS
- /* Precondition: all fastbins are consolidated */
- assert(!have_fastchunks(av));
-#endif
-
if (av != &main_arena) {
@@ -3116,10 +2466,6 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
&& grow_heap(old_heap, MINSIZE + nb - old_size) == 0) {
av->system_mem += old_heap->size - old_heap_size;
arena_mem += old_heap->size - old_heap_size;
-#if 0
- if(mmapped_mem + arena_mem + sbrked_mem > max_total_mem)
- max_total_mem = mmapped_mem + arena_mem + sbrked_mem;
-#endif
set_head(old_top, (((char *)old_heap + old_heap->size) - (char *)old_top)
| PREV_INUSE);
}
@@ -3129,10 +2475,6 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
heap->prev = old_heap;
av->system_mem += heap->size;
arena_mem += heap->size;
-#if 0
- if((unsigned long)(mmapped_mem + arena_mem + sbrked_mem) > max_total_mem)
- max_total_mem = mmapped_mem + arena_mem + sbrked_mem;
-#endif
/* Set up the new top. */
top(av) = chunk_at_offset(heap, sizeof(*heap));
set_head(top(av), (heap->size - sizeof(*heap)) | PREV_INUSE);
@@ -3147,11 +2489,7 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
set_head(chunk_at_offset(old_top, old_size), (2*SIZE_SZ)|PREV_INUSE);
set_foot(chunk_at_offset(old_top, old_size), (2*SIZE_SZ));
set_head(old_top, old_size|PREV_INUSE|NON_MAIN_ARENA);
-#ifdef ATOMIC_FASTBINS
_int_free(av, old_top, 1);
-#else
- _int_free(av, old_top);
-#endif
} else {
set_head(old_top, (old_size + 2*SIZE_SZ)|PREV_INUSE);
set_foot(old_top, (old_size + 2*SIZE_SZ));
@@ -3211,7 +2549,6 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
segregated mmap region.
*/
-#if HAVE_MMAP
/* Cannot merge with old top, so add its size back in */
if (contiguous(av))
size = (size + old_size + pagemask) & ~pagemask;
@@ -3240,7 +2577,6 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
set_noncontiguous(av);
}
}
-#endif
}
if (brk != (char*)(MORECORE_FAILURE)) {
@@ -3393,24 +2729,12 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
/* If possible, release the rest. */
if (old_size >= MINSIZE) {
-#ifdef ATOMIC_FASTBINS
_int_free(av, old_top, 1);
-#else
- _int_free(av, old_top);
-#endif
}
}
}
}
-
- /* Update statistics */
-#ifdef NO_THREADS
- sum = av->system_mem + mp_.mmapped_mem;
- if (sum > (unsigned long)(mp_.max_total_mem))
- mp_.max_total_mem = sum;
-#endif
-
}
} /* if (av != &main_arena) */
@@ -3435,7 +2759,7 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
}
/* catch all failure paths */
- MALLOC_FAILURE_ACTION;
+ __set_errno (ENOMEM);
return 0;
}
@@ -3449,11 +2773,7 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
returns 1 if it actually released any memory, else 0.
*/
-#if __STD_C
static int sYSTRIm(size_t pad, mstate av)
-#else
-static int sYSTRIm(pad, av) size_t pad; mstate av;
-#endif
{
long top_size; /* Amount of top-most memory */
long extra; /* Amount to release */
@@ -3462,7 +2782,7 @@ static int sYSTRIm(pad, av) size_t pad; mstate av;
char* new_brk; /* address returned by post-check sbrk call */
size_t pagesz;
- pagesz = mp_.pagesize;
+ pagesz = GLRO(dl_pagesize);
top_size = chunksize(av->top);
/* Release in pagesize units, keeping at least one page */
@@ -3510,23 +2830,13 @@ static int sYSTRIm(pad, av) size_t pad; mstate av;
return 0;
}
-#ifdef HAVE_MMAP
-
static void
internal_function
-#if __STD_C
munmap_chunk(mchunkptr p)
-#else
-munmap_chunk(p) mchunkptr p;
-#endif
{
INTERNAL_SIZE_T size = chunksize(p);
assert (chunk_is_mmapped(p));
-#if 0
- assert(! ((char*)p >= mp_.sbrk_base && (char*)p < mp_.sbrk_base + mp_.sbrked_mem));
- assert((mp_.n_mmaps > 0));
-#endif
uintptr_t block = (uintptr_t) p - p->prev_size;
size_t total_size = p->prev_size + size;
@@ -3535,7 +2845,7 @@ munmap_chunk(p) mchunkptr p;
page size. But gcc does not recognize the optimization possibility
(in the moment at least) so we combine the two values into one before
the bit test. */
- if (__builtin_expect (((block | total_size) & (mp_.pagesize - 1)) != 0, 0))
+ if (__builtin_expect (((block | total_size) & (GLRO(dl_pagesize) - 1)) != 0, 0))
{
malloc_printerr (check_action, "munmap_chunk(): invalid pointer",
chunk2mem (p));
@@ -3555,23 +2865,15 @@ munmap_chunk(p) mchunkptr p;
static mchunkptr
internal_function
-#if __STD_C
mremap_chunk(mchunkptr p, size_t new_size)
-#else
-mremap_chunk(p, new_size) mchunkptr p; size_t new_size;
-#endif
{
- size_t page_mask = mp_.pagesize - 1;
+ size_t page_mask = GLRO(dl_pagesize) - 1;
INTERNAL_SIZE_T offset = p->prev_size;
INTERNAL_SIZE_T size = chunksize(p);
char *cp;
assert (chunk_is_mmapped(p));
-#if 0
- assert(! ((char*)p >= mp_.sbrk_base && (char*)p < mp_.sbrk_base + mp_.sbrked_mem));
- assert((mp_.n_mmaps > 0));
-#endif
- assert(((size + offset) & (mp_.pagesize-1)) == 0);
+ assert(((size + offset) & (GLRO(dl_pagesize)-1)) == 0);
/* Note the extra SIZE_SZ overhead as in mmap_chunk(). */
new_size = (new_size + offset + SIZE_SZ + page_mask) & ~page_mask;
@@ -3596,25 +2898,18 @@ mremap_chunk(p, new_size) mchunkptr p; size_t new_size;
mp_.mmapped_mem += new_size;
if ((unsigned long)mp_.mmapped_mem > (unsigned long)mp_.max_mmapped_mem)
mp_.max_mmapped_mem = mp_.mmapped_mem;
-#ifdef NO_THREADS
- if ((unsigned long)(mp_.mmapped_mem + arena_mem + main_arena.system_mem) >
- mp_.max_total_mem)
- mp_.max_total_mem = mp_.mmapped_mem + arena_mem + main_arena.system_mem;
-#endif
return p;
}
#endif /* HAVE_MREMAP */
-#endif /* HAVE_MMAP */
-
/*------------------------ Public wrappers. --------------------------------*/
-Void_t*
+void*
public_mALLOc(size_t bytes)
{
mstate ar_ptr;
- Void_t *victim;
+ void *victim;
__malloc_ptr_t (*hook) (size_t, __const __malloc_ptr_t)
= force_reg (__malloc_hook);
@@ -3622,37 +2917,6 @@ public_mALLOc(size_t bytes)
return (*hook)(bytes, RETURN_ADDRESS (0));
arena_lookup(ar_ptr);
-#if 0
- // XXX We need double-word CAS and fastbins must be extended to also
- // XXX hold a generation counter for each entry.
- if (ar_ptr) {
- INTERNAL_SIZE_T nb; /* normalized request size */
- checked_request2size(bytes, nb);
- if (nb <= get_max_fast ()) {
- long int idx = fastbin_index(nb);
- mfastbinptr* fb = &fastbin (ar_ptr, idx);
- mchunkptr pp = *fb;
- mchunkptr v;
- do
- {
- v = pp;
- if (v == NULL)
- break;
- }
- while ((pp = catomic_compare_and_exchange_val_acq (fb, v->fd, v)) != v);
- if (v != 0) {
- if (__builtin_expect (fastbin_index (chunksize (v)) != idx, 0))
- malloc_printerr (check_action, "malloc(): memory corruption (fast)",
- chunk2mem (v));
- check_remalloced_chunk(ar_ptr, v, nb);
- void *p = chunk2mem(v);
- if (__builtin_expect (perturb_byte, 0))
- alloc_perturb (p, bytes);
- return p;
- }
- }
- }
-#endif
arena_lock(ar_ptr, bytes);
if(!ar_ptr)
@@ -3667,7 +2931,6 @@ public_mALLOc(size_t bytes)
victim = _int_malloc(ar_ptr, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
-#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0, bytes);
(void)mutex_unlock(&main_arena.mutex);
@@ -3675,7 +2938,6 @@ public_mALLOc(size_t bytes)
victim = _int_malloc(ar_ptr, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
-#endif
}
} else
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3683,12 +2945,10 @@ public_mALLOc(size_t bytes)
ar_ptr == arena_for_chunk(mem2chunk(victim)));
return victim;
}
-#ifdef libc_hidden_def
libc_hidden_def(public_mALLOc)
-#endif
void
-public_fREe(Void_t* mem)
+public_fREe(void* mem)
{
mstate ar_ptr;
mchunkptr p; /* chunk corresponding to mem */
@@ -3705,7 +2965,6 @@ public_fREe(Void_t* mem)
p = mem2chunk(mem);
-#if HAVE_MMAP
if (chunk_is_mmapped(p)) /* release mmapped memory. */
{
/* see if the dynamic brk/mmap threshold needs adjusting */
@@ -3719,37 +2978,19 @@ public_fREe(Void_t* mem)
munmap_chunk(p);
return;
}
-#endif
ar_ptr = arena_for_chunk(p);
-#ifdef ATOMIC_FASTBINS
_int_free(ar_ptr, p, 0);
-#else
-# if THREAD_STATS
- if(!mutex_trylock(&ar_ptr->mutex))
- ++(ar_ptr->stat_lock_direct);
- else {
- (void)mutex_lock(&ar_ptr->mutex);
- ++(ar_ptr->stat_lock_wait);
- }
-# else
- (void)mutex_lock(&ar_ptr->mutex);
-# endif
- _int_free(ar_ptr, p);
- (void)mutex_unlock(&ar_ptr->mutex);
-#endif
}
-#ifdef libc_hidden_def
libc_hidden_def (public_fREe)
-#endif
-Void_t*
-public_rEALLOc(Void_t* oldmem, size_t bytes)
+void*
+public_rEALLOc(void* oldmem, size_t bytes)
{
mstate ar_ptr;
INTERNAL_SIZE_T nb; /* padded request size */
- Void_t* newp; /* chunk to return */
+ void* newp; /* chunk to return */
__malloc_ptr_t (*hook) (__malloc_ptr_t, size_t, __const __malloc_ptr_t) =
force_reg (__realloc_hook);
@@ -3781,10 +3022,9 @@ public_rEALLOc(Void_t* oldmem, size_t bytes)
checked_request2size(bytes, nb);
-#if HAVE_MMAP
if (chunk_is_mmapped(oldp))
{
- Void_t* newmem;
+ void* newmem;
#if HAVE_MREMAP
newp = mremap_chunk(oldp, nb);
@@ -3799,7 +3039,6 @@ public_rEALLOc(Void_t* oldmem, size_t bytes)
munmap_chunk(oldp);
return newmem;
}
-#endif
ar_ptr = arena_for_chunk(oldp);
#if THREAD_STATS
@@ -3813,9 +3052,9 @@ public_rEALLOc(Void_t* oldmem, size_t bytes)
(void)mutex_lock(&ar_ptr->mutex);
#endif
-#if !defined NO_THREADS && !defined PER_THREAD
+#if !defined PER_THREAD
/* As in malloc(), remember this arena for the next allocation. */
- tsd_setspecific(arena_key, (Void_t *)ar_ptr);
+ tsd_setspecific(arena_key, (void *)ar_ptr);
#endif
newp = _int_realloc(ar_ptr, oldp, oldsize, nb);
@@ -3831,36 +3070,19 @@ public_rEALLOc(Void_t* oldmem, size_t bytes)
if (newp != NULL)
{
MALLOC_COPY (newp, oldmem, oldsize - SIZE_SZ);
-#ifdef ATOMIC_FASTBINS
_int_free(ar_ptr, oldp, 0);
-#else
-# if THREAD_STATS
- if(!mutex_trylock(&ar_ptr->mutex))
- ++(ar_ptr->stat_lock_direct);
- else {
- (void)mutex_lock(&ar_ptr->mutex);
- ++(ar_ptr->stat_lock_wait);
- }
-# else
- (void)mutex_lock(&ar_ptr->mutex);
-# endif
- _int_free(ar_ptr, oldp);
- (void)mutex_unlock(&ar_ptr->mutex);
-#endif
}
}
return newp;
}
-#ifdef libc_hidden_def
libc_hidden_def (public_rEALLOc)
-#endif
-Void_t*
+void*
public_mEMALIGn(size_t alignment, size_t bytes)
{
mstate ar_ptr;
- Void_t *p;
+ void *p;
__malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
__const __malloc_ptr_t)) =
@@ -3887,7 +3109,6 @@ public_mEMALIGn(size_t alignment, size_t bytes)
p = _int_memalign(ar_ptr, alignment, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
-#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
mstate prev = ar_ptr->next ? ar_ptr : 0;
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3896,7 +3117,6 @@ public_mEMALIGn(size_t alignment, size_t bytes)
p = _int_memalign(ar_ptr, alignment, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
-#endif
}
} else
(void)mutex_unlock(&ar_ptr->mutex);
@@ -3904,20 +3124,18 @@ public_mEMALIGn(size_t alignment, size_t bytes)
ar_ptr == arena_for_chunk(mem2chunk(p)));
return p;
}
-#ifdef libc_hidden_def
libc_hidden_def (public_mEMALIGn)
-#endif
-Void_t*
+void*
public_vALLOc(size_t bytes)
{
mstate ar_ptr;
- Void_t *p;
+ void *p;
if(__malloc_initialized < 0)
ptmalloc_init ();
- size_t pagesz = mp_.pagesize;
+ size_t pagesz = GLRO(dl_pagesize);
__malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
__const __malloc_ptr_t)) =
@@ -3938,14 +3156,12 @@ public_vALLOc(size_t bytes)
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
-#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0, bytes);
if(ar_ptr) {
p = _int_memalign(ar_ptr, pagesz, bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
-#endif
}
}
assert(!p || chunk_is_mmapped(mem2chunk(p)) ||
@@ -3954,17 +3170,17 @@ public_vALLOc(size_t bytes)
return p;
}
-Void_t*
+void*
public_pVALLOc(size_t bytes)
{
mstate ar_ptr;
- Void_t *p;
+ void *p;
if(__malloc_initialized < 0)
ptmalloc_init ();
- size_t pagesz = mp_.pagesize;
- size_t page_mask = mp_.pagesize - 1;
+ size_t pagesz = GLRO(dl_pagesize);
+ size_t page_mask = GLRO(dl_pagesize) - 1;
size_t rounded_bytes = (bytes + page_mask) & ~(page_mask);
__malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
@@ -3984,7 +3200,6 @@ public_pVALLOc(size_t bytes)
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
} else {
-#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
ar_ptr = arena_get2(ar_ptr->next ? ar_ptr : 0,
bytes + 2*pagesz + MINSIZE);
@@ -3992,7 +3207,6 @@ public_pVALLOc(size_t bytes)
p = _int_memalign(ar_ptr, pagesz, rounded_bytes);
(void)mutex_unlock(&ar_ptr->mutex);
}
-#endif
}
}
assert(!p || chunk_is_mmapped(mem2chunk(p)) ||
@@ -4001,13 +3215,13 @@ public_pVALLOc(size_t bytes)
return p;
}
-Void_t*
+void*
public_cALLOc(size_t n, size_t elem_size)
{
mstate av;
mchunkptr oldtop, p;
INTERNAL_SIZE_T bytes, sz, csz, oldtopsize;
- Void_t* mem;
+ void* mem;
unsigned long clearsize;
unsigned long nclears;
INTERNAL_SIZE_T* d;
@@ -4018,7 +3232,7 @@ public_cALLOc(size_t n, size_t elem_size)
(((INTERNAL_SIZE_T) 1) << (8 * sizeof (INTERNAL_SIZE_T) / 2))
if (__builtin_expect ((n | elem_size) >= HALF_INTERNAL_SIZE_T, 0)) {
if (elem_size != 0 && bytes / elem_size != n) {
- MALLOC_FAILURE_ACTION;
+ __set_errno (ENOMEM);
return 0;
}
}
@@ -4030,12 +3244,7 @@ public_cALLOc(size_t n, size_t elem_size)
mem = (*hook)(sz, RETURN_ADDRESS (0));
if(mem == 0)
return 0;
-#ifdef HAVE_MEMCPY
return memset(mem, 0, sz);
-#else
- while(sz > 0) ((char*)mem)[--sz] = 0; /* rather inefficient */
- return mem;
-#endif
}
sz = bytes;
@@ -4077,7 +3286,6 @@ public_cALLOc(size_t n, size_t elem_size)
mem = _int_malloc(&main_arena, sz);
(void)mutex_unlock(&main_arena.mutex);
} else {
-#if USE_ARENAS
/* ... or sbrk() has failed and there is still a chance to mmap() */
(void)mutex_lock(&main_arena.mutex);
av = arena_get2(av->next ? av : 0, sz);
@@ -4086,21 +3294,18 @@ public_cALLOc(size_t n, size_t elem_size)
mem = _int_malloc(av, sz);
(void)mutex_unlock(&av->mutex);
}
-#endif
}
if (mem == 0) return 0;
}
p = mem2chunk(mem);
/* Two optional cases in which clearing not necessary */
-#if HAVE_MMAP
if (chunk_is_mmapped (p))
{
if (__builtin_expect (perturb_byte, 0))
MALLOC_ZERO (mem, sz);
return mem;
}
-#endif
csz = chunksize(p);
@@ -4143,45 +3348,6 @@ public_cALLOc(size_t n, size_t elem_size)
return mem;
}
-#ifndef _LIBC
-
-Void_t**
-public_iCALLOc(size_t n, size_t elem_size, Void_t** chunks)
-{
- mstate ar_ptr;
- Void_t** m;
-
- arena_get(ar_ptr, n*elem_size);
- if(!ar_ptr)
- return 0;
-
- m = _int_icalloc(ar_ptr, n, elem_size, chunks);
- (void)mutex_unlock(&ar_ptr->mutex);
- return m;
-}
-
-Void_t**
-public_iCOMALLOc(size_t n, size_t sizes[], Void_t** chunks)
-{
- mstate ar_ptr;
- Void_t** m;
-
- arena_get(ar_ptr, 0);
- if(!ar_ptr)
- return 0;
-
- m = _int_icomalloc(ar_ptr, n, sizes, chunks);
- (void)mutex_unlock(&ar_ptr->mutex);
- return m;
-}
-
-void
-public_cFREe(Void_t* m)
-{
- public_fREe(m);
-}
-
-#endif /* _LIBC */
int
public_mTRIm(size_t s)
@@ -4206,7 +3372,7 @@ public_mTRIm(size_t s)
}
size_t
-public_mUSABLe(Void_t* m)
+public_mUSABLe(void* m)
{
size_t result;
@@ -4244,7 +3410,7 @@ public_mALLOPt(int p, int v)
------------------------------ malloc ------------------------------
*/
-static Void_t*
+static void*
_int_malloc(mstate av, size_t bytes)
{
INTERNAL_SIZE_T nb; /* normalized request size */
@@ -4287,7 +3453,6 @@ _int_malloc(mstate av, size_t bytes)
if ((unsigned long)(nb) <= (unsigned long)(get_max_fast ())) {
idx = fastbin_index(nb);
mfastbinptr* fb = &fastbin (av, idx);
-#ifdef ATOMIC_FASTBINS
mchunkptr pp = *fb;
do
{
@@ -4297,9 +3462,6 @@ _int_malloc(mstate av, size_t bytes)
}
while ((pp = catomic_compare_and_exchange_val_acq (fb, victim->fd, victim))
!= victim);
-#else
- victim = *fb;
-#endif
if (victim != 0) {
if (__builtin_expect (fastbin_index (chunksize (victim)) != idx, 0))
{
@@ -4308,9 +3470,6 @@ _int_malloc(mstate av, size_t bytes)
malloc_printerr (check_action, errstr, chunk2mem (victim));
return NULL;
}
-#ifndef ATOMIC_FASTBINS
- *fb = victim->fd;
-#endif
check_remalloced_chunk(av, victim, nb);
void *p = chunk2mem(victim);
if (__builtin_expect (perturb_byte, 0))
@@ -4715,7 +3874,6 @@ _int_malloc(mstate av, size_t bytes)
return p;
}
-#ifdef ATOMIC_FASTBINS
/* When we are using atomic ops to free fast chunks we can get
here for all block sizes. */
else if (have_fastchunks(av)) {
@@ -4726,19 +3884,6 @@ _int_malloc(mstate av, size_t bytes)
else
idx = largebin_index(nb);
}
-#else
- /*
- If there is space available in fastbins, consolidate and retry,
- to possibly avoid expanding memory. This can occur only if nb is
- in smallbin range so we didn't consolidate upon entry.
- */
-
- else if (have_fastchunks(av)) {
- assert(in_smallbin_range(nb));
- malloc_consolidate(av);
- idx = smallbin_index(nb); /* restore original bin index */
- }
-#endif
/*
Otherwise, relay to handle system-dependent cases
@@ -4757,11 +3902,7 @@ _int_malloc(mstate av, size_t bytes)
*/
static void
-#ifdef ATOMIC_FASTBINS
_int_free(mstate av, mchunkptr p, int have_lock)
-#else
-_int_free(mstate av, mchunkptr p)
-#endif
{
INTERNAL_SIZE_T size; /* its size */
mfastbinptr* fb; /* associated fastbin */
@@ -4773,9 +3914,7 @@ _int_free(mstate av, mchunkptr p)
mchunkptr fwd; /* misc temp for linking */
const char *errstr = NULL;
-#ifdef ATOMIC_FASTBINS
int locked = 0;
-#endif
size = chunksize(p);
@@ -4788,10 +3927,8 @@ _int_free(mstate av, mchunkptr p)
{
errstr = "free(): invalid pointer";
errout:
-#ifdef ATOMIC_FASTBINS
if (! have_lock && locked)
(void)mutex_unlock(&av->mutex);
-#endif
malloc_printerr (check_action, errstr, chunk2mem(p));
return;
}
@@ -4824,7 +3961,6 @@ _int_free(mstate av, mchunkptr p)
|| __builtin_expect (chunksize (chunk_at_offset (p, size))
>= av->system_mem, 0))
{
-#ifdef ATOMIC_FASTBINS
/* We might not have a lock at this point and concurrent modifications
of system_mem might have let to a false positive. Redo the test
after getting the lock. */
@@ -4835,18 +3971,15 @@ _int_free(mstate av, mchunkptr p)
chunk_at_offset (p, size)->size <= 2 * SIZE_SZ
|| chunksize (chunk_at_offset (p, size)) >= av->system_mem;
}))
-#endif
{
errstr = "free(): invalid next size (fast)";
goto errout;
}
-#ifdef ATOMIC_FASTBINS
if (! have_lock)
{
(void)mutex_unlock(&av->mutex);
locked = 0;
}
-#endif
}
if (__builtin_expect (perturb_byte, 0))
@@ -4856,7 +3989,6 @@ _int_free(mstate av, mchunkptr p)
unsigned int idx = fastbin_index(size);
fb = &fastbin (av, idx);
-#ifdef ATOMIC_FASTBINS
mchunkptr fd;
mchunkptr old = *fb;
unsigned int old_idx = ~0u;
@@ -4880,24 +4012,6 @@ _int_free(mstate av, mchunkptr p)
errstr = "invalid fastbin entry (free)";
goto errout;
}
-#else
- /* Another simple check: make sure the top of the bin is not the
- record we are going to add (i.e., double free). */
- if (__builtin_expect (*fb == p, 0))
- {
- errstr = "double free or corruption (fasttop)";
- goto errout;
- }
- if (*fb != NULL
- && __builtin_expect (fastbin_index(chunksize(*fb)) != idx, 0))
- {
- errstr = "invalid fastbin entry (free)";
- goto errout;
- }
-
- p->fd = *fb;
- *fb = p;
-#endif
}
/*
@@ -4905,21 +4019,19 @@ _int_free(mstate av, mchunkptr p)
*/
else if (!chunk_is_mmapped(p)) {
-#ifdef ATOMIC_FASTBINS
if (! have_lock) {
-# if THREAD_STATS
+#if THREAD_STATS
if(!mutex_trylock(&av->mutex))
++(av->stat_lock_direct);
else {
(void)mutex_lock(&av->mutex);
++(av->stat_lock_wait);
}
-# else
+#else
(void)mutex_lock(&av->mutex);
-# endif
+#endif
locked = 1;
}
-#endif
nextchunk = chunk_at_offset(p, size);
@@ -5049,25 +4161,17 @@ _int_free(mstate av, mchunkptr p)
}
}
-#ifdef ATOMIC_FASTBINS
if (! have_lock) {
assert (locked);
(void)mutex_unlock(&av->mutex);
}
-#endif
}
/*
- If the chunk was allocated via mmap, release via munmap(). Note
- that if HAVE_MMAP is false but chunk_is_mmapped is true, then
- user must have overwritten memory. There's nothing we can do to
- catch this error unless MALLOC_DEBUG is set, in which case
- check_inuse_chunk (above) will have triggered error.
+ If the chunk was allocated via mmap, release via munmap().
*/
else {
-#if HAVE_MMAP
munmap_chunk (p);
-#endif
}
}
@@ -5085,11 +4189,7 @@ _int_free(mstate av, mchunkptr p)
initialization code.
*/
-#if __STD_C
static void malloc_consolidate(mstate av)
-#else
-static void malloc_consolidate(av) mstate av;
-#endif
{
mfastbinptr* fb; /* current fastbin being consolidated */
mfastbinptr* maxfb; /* last fastbin (for loop control) */
@@ -5125,26 +4225,11 @@ static void malloc_consolidate(av) mstate av;
reused anyway.
*/
-#if 0
- /* It is wrong to limit the fast bins to search using get_max_fast
- because, except for the main arena, all the others might have
- blocks in the high fast bins. It's not worth it anyway, just
- search all bins all the time. */
- maxfb = &fastbin (av, fastbin_index(get_max_fast ()));
-#else
maxfb = &fastbin (av, NFASTBINS - 1);
-#endif
fb = &fastbin (av, 0);
do {
-#ifdef ATOMIC_FASTBINS
p = atomic_exchange_acq (fb, 0);
-#else
- p = *fb;
-#endif
if (p != 0) {
-#ifndef ATOMIC_FASTBINS
- *fb = 0;
-#endif
do {
check_inuse_chunk(av, p);
nextp = p->fd;
@@ -5206,13 +4291,13 @@ static void malloc_consolidate(av) mstate av;
------------------------------ realloc ------------------------------
*/
-Void_t*
+void*
_int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize,
INTERNAL_SIZE_T nb)
{
mchunkptr newp; /* chunk to return */
INTERNAL_SIZE_T newsize; /* its size */
- Void_t* newmem; /* corresponding user mem */
+ void* newmem; /* corresponding user mem */
mchunkptr next; /* next contiguous chunk after oldp */
@@ -5242,215 +4327,130 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize,
check_inuse_chunk(av, oldp);
/* All callers already filter out mmap'ed chunks. */
-#if 0
- if (!chunk_is_mmapped(oldp))
-#else
assert (!chunk_is_mmapped(oldp));
-#endif
- {
- next = chunk_at_offset(oldp, oldsize);
- INTERNAL_SIZE_T nextsize = chunksize(next);
- if (__builtin_expect (next->size <= 2 * SIZE_SZ, 0)
- || __builtin_expect (nextsize >= av->system_mem, 0))
- {
- errstr = "realloc(): invalid next size";
- goto errout;
- }
+ next = chunk_at_offset(oldp, oldsize);
+ INTERNAL_SIZE_T nextsize = chunksize(next);
+ if (__builtin_expect (next->size <= 2 * SIZE_SZ, 0)
+ || __builtin_expect (nextsize >= av->system_mem, 0))
+ {
+ errstr = "realloc(): invalid next size";
+ goto errout;
+ }
+
+ if ((unsigned long)(oldsize) >= (unsigned long)(nb)) {
+ /* already big enough; split below */
+ newp = oldp;
+ newsize = oldsize;
+ }
+
+ else {
+ /* Try to expand forward into top */
+ if (next == av->top &&
+ (unsigned long)(newsize = oldsize + nextsize) >=
+ (unsigned long)(nb + MINSIZE)) {
+ set_head_size(oldp, nb | (av != &main_arena ? NON_MAIN_ARENA : 0));
+ av->top = chunk_at_offset(oldp, nb);
+ set_head(av->top, (newsize - nb) | PREV_INUSE);
+ check_inuse_chunk(av, oldp);
+ return chunk2mem(oldp);
+ }
- if ((unsigned long)(oldsize) >= (unsigned long)(nb)) {
- /* already big enough; split below */
+ /* Try to expand forward into next chunk; split off remainder below */
+ else if (next != av->top &&
+ !inuse(next) &&
+ (unsigned long)(newsize = oldsize + nextsize) >=
+ (unsigned long)(nb)) {
newp = oldp;
- newsize = oldsize;
+ unlink(next, bck, fwd);
}
+ /* allocate, copy, free */
else {
- /* Try to expand forward into top */
- if (next == av->top &&
- (unsigned long)(newsize = oldsize + nextsize) >=
- (unsigned long)(nb + MINSIZE)) {
- set_head_size(oldp, nb | (av != &main_arena ? NON_MAIN_ARENA : 0));
- av->top = chunk_at_offset(oldp, nb);
- set_head(av->top, (newsize - nb) | PREV_INUSE);
- check_inuse_chunk(av, oldp);
- return chunk2mem(oldp);
- }
+ newmem = _int_malloc(av, nb - MALLOC_ALIGN_MASK);
+ if (newmem == 0)
+ return 0; /* propagate failure */
- /* Try to expand forward into next chunk; split off remainder below */
- else if (next != av->top &&
- !inuse(next) &&
- (unsigned long)(newsize = oldsize + nextsize) >=
- (unsigned long)(nb)) {
+ newp = mem2chunk(newmem);
+ newsize = chunksize(newp);
+
+ /*
+ Avoid copy if newp is next chunk after oldp.
+ */
+ if (newp == next) {
+ newsize += oldsize;
newp = oldp;
- unlink(next, bck, fwd);
}
-
- /* allocate, copy, free */
else {
- newmem = _int_malloc(av, nb - MALLOC_ALIGN_MASK);
- if (newmem == 0)
- return 0; /* propagate failure */
-
- newp = mem2chunk(newmem);
- newsize = chunksize(newp);
-
/*
- Avoid copy if newp is next chunk after oldp.
+ Unroll copy of <= 36 bytes (72 if 8byte sizes)
+ We know that contents have an odd number of
+ INTERNAL_SIZE_T-sized words; minimally 3.
*/
- if (newp == next) {
- newsize += oldsize;
- newp = oldp;
- }
- else {
- /*
- Unroll copy of <= 36 bytes (72 if 8byte sizes)
- We know that contents have an odd number of
- INTERNAL_SIZE_T-sized words; minimally 3.
- */
- copysize = oldsize - SIZE_SZ;
- s = (INTERNAL_SIZE_T*)(chunk2mem(oldp));
- d = (INTERNAL_SIZE_T*)(newmem);
- ncopies = copysize / sizeof(INTERNAL_SIZE_T);
- assert(ncopies >= 3);
+ copysize = oldsize - SIZE_SZ;
+ s = (INTERNAL_SIZE_T*)(chunk2mem(oldp));
+ d = (INTERNAL_SIZE_T*)(newmem);
+ ncopies = copysize / sizeof(INTERNAL_SIZE_T);
+ assert(ncopies >= 3);
- if (ncopies > 9)
- MALLOC_COPY(d, s, copysize);
+ if (ncopies > 9)
+ MALLOC_COPY(d, s, copysize);
- else {
- *(d+0) = *(s+0);
- *(d+1) = *(s+1);
- *(d+2) = *(s+2);
- if (ncopies > 4) {
- *(d+3) = *(s+3);
- *(d+4) = *(s+4);
- if (ncopies > 6) {
- *(d+5) = *(s+5);
- *(d+6) = *(s+6);
- if (ncopies > 8) {
- *(d+7) = *(s+7);
- *(d+8) = *(s+8);
- }
+ else {
+ *(d+0) = *(s+0);
+ *(d+1) = *(s+1);
+ *(d+2) = *(s+2);
+ if (ncopies > 4) {
+ *(d+3) = *(s+3);
+ *(d+4) = *(s+4);
+ if (ncopies > 6) {
+ *(d+5) = *(s+5);
+ *(d+6) = *(s+6);
+ if (ncopies > 8) {
+ *(d+7) = *(s+7);
+ *(d+8) = *(s+8);
}
}
}
-
-#ifdef ATOMIC_FASTBINS
- _int_free(av, oldp, 1);
-#else
- _int_free(av, oldp);
-#endif
- check_inuse_chunk(av, newp);
- return chunk2mem(newp);
}
- }
- }
-
- /* If possible, free extra space in old or extended chunk */
-
- assert((unsigned long)(newsize) >= (unsigned long)(nb));
- remainder_size = newsize - nb;
-
- if (remainder_size < MINSIZE) { /* not enough extra to split off */
- set_head_size(newp, newsize | (av != &main_arena ? NON_MAIN_ARENA : 0));
- set_inuse_bit_at_offset(newp, newsize);
- }
- else { /* split remainder */
- remainder = chunk_at_offset(newp, nb);
- set_head_size(newp, nb | (av != &main_arena ? NON_MAIN_ARENA : 0));
- set_head(remainder, remainder_size | PREV_INUSE |
- (av != &main_arena ? NON_MAIN_ARENA : 0));
- /* Mark remainder as inuse so free() won't complain */
- set_inuse_bit_at_offset(remainder, remainder_size);
-#ifdef ATOMIC_FASTBINS
- _int_free(av, remainder, 1);
-#else
- _int_free(av, remainder);
-#endif
+ _int_free(av, oldp, 1);
+ check_inuse_chunk(av, newp);
+ return chunk2mem(newp);
+ }
}
-
- check_inuse_chunk(av, newp);
- return chunk2mem(newp);
}
-#if 0
- /*
- Handle mmap cases
- */
-
- else {
-#if HAVE_MMAP
-
-#if HAVE_MREMAP
- INTERNAL_SIZE_T offset = oldp->prev_size;
- size_t pagemask = mp_.pagesize - 1;
- char *cp;
- unsigned long sum;
-
- /* Note the extra SIZE_SZ overhead */
- newsize = (nb + offset + SIZE_SZ + pagemask) & ~pagemask;
-
- /* don't need to remap if still within same page */
- if (oldsize == newsize - offset)
- return chunk2mem(oldp);
-
- cp = (char*)mremap((char*)oldp - offset, oldsize + offset, newsize, 1);
-
- if (cp != MAP_FAILED) {
+ /* If possible, free extra space in old or extended chunk */
- newp = (mchunkptr)(cp + offset);
- set_head(newp, (newsize - offset)|IS_MMAPPED);
+ assert((unsigned long)(newsize) >= (unsigned long)(nb));
- assert(aligned_OK(chunk2mem(newp)));
- assert((newp->prev_size == offset));
+ remainder_size = newsize - nb;
- /* update statistics */
- sum = mp_.mmapped_mem += newsize - oldsize;
- if (sum > (unsigned long)(mp_.max_mmapped_mem))
- mp_.max_mmapped_mem = sum;
-#ifdef NO_THREADS
- sum += main_arena.system_mem;
- if (sum > (unsigned long)(mp_.max_total_mem))
- mp_.max_total_mem = sum;
-#endif
-
- return chunk2mem(newp);
- }
-#endif
-
- /* Note the extra SIZE_SZ overhead. */
- if ((unsigned long)(oldsize) >= (unsigned long)(nb + SIZE_SZ))
- newmem = chunk2mem(oldp); /* do nothing */
- else {
- /* Must alloc, copy, free. */
- newmem = _int_malloc(av, nb - MALLOC_ALIGN_MASK);
- if (newmem != 0) {
- MALLOC_COPY(newmem, chunk2mem(oldp), oldsize - 2*SIZE_SZ);
-#ifdef ATOMIC_FASTBINS
- _int_free(av, oldp, 1);
-#else
- _int_free(av, oldp);
-#endif
- }
- }
- return newmem;
-
-#else
- /* If !HAVE_MMAP, but chunk_is_mmapped, user must have overwritten mem */
- check_malloc_state(av);
- MALLOC_FAILURE_ACTION;
- return 0;
-#endif
+ if (remainder_size < MINSIZE) { /* not enough extra to split off */
+ set_head_size(newp, newsize | (av != &main_arena ? NON_MAIN_ARENA : 0));
+ set_inuse_bit_at_offset(newp, newsize);
}
-#endif
+ else { /* split remainder */
+ remainder = chunk_at_offset(newp, nb);
+ set_head_size(newp, nb | (av != &main_arena ? NON_MAIN_ARENA : 0));
+ set_head(remainder, remainder_size | PREV_INUSE |
+ (av != &main_arena ? NON_MAIN_ARENA : 0));
+ /* Mark remainder as inuse so free() won't complain */
+ set_inuse_bit_at_offset(remainder, remainder_size);
+ _int_free(av, remainder, 1);
+ }
+
+ check_inuse_chunk(av, newp);
+ return chunk2mem(newp);
}
/*
------------------------------ memalign ------------------------------
*/
-static Void_t*
+static void*
_int_memalign(mstate av, size_t alignment, size_t bytes)
{
INTERNAL_SIZE_T nb; /* padded request size */
@@ -5526,11 +4526,7 @@ _int_memalign(mstate av, size_t alignment, size_t bytes)
(av != &main_arena ? NON_MAIN_ARENA : 0));
set_inuse_bit_at_offset(newp, newsize);
set_head_size(p, leadsize | (av != &main_arena ? NON_MAIN_ARENA : 0));
-#ifdef ATOMIC_FASTBINS
_int_free(av, p, 1);
-#else
- _int_free(av, p);
-#endif
p = newp;
assert (newsize >= nb &&
@@ -5546,11 +4542,7 @@ _int_memalign(mstate av, size_t alignment, size_t bytes)
set_head(remainder, remainder_size | PREV_INUSE |
(av != &main_arena ? NON_MAIN_ARENA : 0));
set_head_size(p, nb);
-#ifdef ATOMIC_FASTBINS
_int_free(av, remainder, 1);
-#else
- _int_free(av, remainder);
-#endif
}
}
@@ -5558,249 +4550,17 @@ _int_memalign(mstate av, size_t alignment, size_t bytes)
return chunk2mem(p);
}
-#if 0
-/*
- ------------------------------ calloc ------------------------------
-*/
-
-#if __STD_C
-Void_t* cALLOc(size_t n_elements, size_t elem_size)
-#else
-Void_t* cALLOc(n_elements, elem_size) size_t n_elements; size_t elem_size;
-#endif
-{
- mchunkptr p;
- unsigned long clearsize;
- unsigned long nclears;
- INTERNAL_SIZE_T* d;
-
- Void_t* mem = mALLOc(n_elements * elem_size);
-
- if (mem != 0) {
- p = mem2chunk(mem);
-
-#if MMAP_CLEARS
- if (!chunk_is_mmapped(p)) /* don't need to clear mmapped space */
-#endif
- {
- /*
- Unroll clear of <= 36 bytes (72 if 8byte sizes)
- We know that contents have an odd number of
- INTERNAL_SIZE_T-sized words; minimally 3.
- */
-
- d = (INTERNAL_SIZE_T*)mem;
- clearsize = chunksize(p) - SIZE_SZ;
- nclears = clearsize / sizeof(INTERNAL_SIZE_T);
- assert(nclears >= 3);
-
- if (nclears > 9)
- MALLOC_ZERO(d, clearsize);
-
- else {
- *(d+0) = 0;
- *(d+1) = 0;
- *(d+2) = 0;
- if (nclears > 4) {
- *(d+3) = 0;
- *(d+4) = 0;
- if (nclears > 6) {
- *(d+5) = 0;
- *(d+6) = 0;
- if (nclears > 8) {
- *(d+7) = 0;
- *(d+8) = 0;
- }
- }
- }
- }
- }
- }
- return mem;
-}
-#endif /* 0 */
-
-#ifndef _LIBC
-/*
- ------------------------- independent_calloc -------------------------
-*/
-
-Void_t**
-#if __STD_C
-_int_icalloc(mstate av, size_t n_elements, size_t elem_size, Void_t* chunks[])
-#else
-_int_icalloc(av, n_elements, elem_size, chunks)
-mstate av; size_t n_elements; size_t elem_size; Void_t* chunks[];
-#endif
-{
- size_t sz = elem_size; /* serves as 1-element array */
- /* opts arg of 3 means all elements are same size, and should be cleared */
- return iALLOc(av, n_elements, &sz, 3, chunks);
-}
-
-/*
- ------------------------- independent_comalloc -------------------------
-*/
-
-Void_t**
-#if __STD_C
-_int_icomalloc(mstate av, size_t n_elements, size_t sizes[], Void_t* chunks[])
-#else
-_int_icomalloc(av, n_elements, sizes, chunks)
-mstate av; size_t n_elements; size_t sizes[]; Void_t* chunks[];
-#endif
-{
- return iALLOc(av, n_elements, sizes, 0, chunks);
-}
-
-
-/*
- ------------------------------ ialloc ------------------------------
- ialloc provides common support for independent_X routines, handling all of
- the combinations that can result.
-
- The opts arg has:
- bit 0 set if all elements are same size (using sizes[0])
- bit 1 set if elements should be zeroed
-*/
-
-
-static Void_t**
-#if __STD_C
-iALLOc(mstate av, size_t n_elements, size_t* sizes, int opts, Void_t* chunks[])
-#else
-iALLOc(av, n_elements, sizes, opts, chunks)
-mstate av; size_t n_elements; size_t* sizes; int opts; Void_t* chunks[];
-#endif
-{
- INTERNAL_SIZE_T element_size; /* chunksize of each element, if all same */
- INTERNAL_SIZE_T contents_size; /* total size of elements */
- INTERNAL_SIZE_T array_size; /* request size of pointer array */
- Void_t* mem; /* malloced aggregate space */
- mchunkptr p; /* corresponding chunk */
- INTERNAL_SIZE_T remainder_size; /* remaining bytes while splitting */
- Void_t** marray; /* either "chunks" or malloced ptr array */
- mchunkptr array_chunk; /* chunk for malloced ptr array */
- int mmx; /* to disable mmap */
- INTERNAL_SIZE_T size;
- INTERNAL_SIZE_T size_flags;
- size_t i;
-
- /* Ensure initialization/consolidation */
- if (have_fastchunks(av)) malloc_consolidate(av);
-
- /* compute array length, if needed */
- if (chunks != 0) {
- if (n_elements == 0)
- return chunks; /* nothing to do */
- marray = chunks;
- array_size = 0;
- }
- else {
- /* if empty req, must still return chunk representing empty array */
- if (n_elements == 0)
- return (Void_t**) _int_malloc(av, 0);
- marray = 0;
- array_size = request2size(n_elements * (sizeof(Void_t*)));
- }
-
- /* compute total element size */
- if (opts & 0x1) { /* all-same-size */
- element_size = request2size(*sizes);
- contents_size = n_elements * element_size;
- }
- else { /* add up all the sizes */
- element_size = 0;
- contents_size = 0;
- for (i = 0; i != n_elements; ++i)
- contents_size += request2size(sizes[i]);
- }
-
- /* subtract out alignment bytes from total to minimize overallocation */
- size = contents_size + array_size - MALLOC_ALIGN_MASK;
-
- /*
- Allocate the aggregate chunk.
- But first disable mmap so malloc won't use it, since
- we would not be able to later free/realloc space internal
- to a segregated mmap region.
- */
- mmx = mp_.n_mmaps_max; /* disable mmap */
- mp_.n_mmaps_max = 0;
- mem = _int_malloc(av, size);
- mp_.n_mmaps_max = mmx; /* reset mmap */
- if (mem == 0)
- return 0;
-
- p = mem2chunk(mem);
- assert(!chunk_is_mmapped(p));
- remainder_size = chunksize(p);
-
- if (opts & 0x2) { /* optionally clear the elements */
- MALLOC_ZERO(mem, remainder_size - SIZE_SZ - array_size);
- }
-
- size_flags = PREV_INUSE | (av != &main_arena ? NON_MAIN_ARENA : 0);
-
- /* If not provided, allocate the pointer array as final part of chunk */
- if (marray == 0) {
- array_chunk = chunk_at_offset(p, contents_size);
- marray = (Void_t**) (chunk2mem(array_chunk));
- set_head(array_chunk, (remainder_size - contents_size) | size_flags);
- remainder_size = contents_size;
- }
-
- /* split out elements */
- for (i = 0; ; ++i) {
- marray[i] = chunk2mem(p);
- if (i != n_elements-1) {
- if (element_size != 0)
- size = element_size;
- else
- size = request2size(sizes[i]);
- remainder_size -= size;
- set_head(p, size | size_flags);
- p = chunk_at_offset(p, size);
- }
- else { /* the final element absorbs any overallocation slop */
- set_head(p, remainder_size | size_flags);
- break;
- }
- }
-
-#if MALLOC_DEBUG
- if (marray != chunks) {
- /* final element must have exactly exhausted chunk */
- if (element_size != 0)
- assert(remainder_size == element_size);
- else
- assert(remainder_size == request2size(sizes[i]));
- check_inuse_chunk(av, mem2chunk(marray));
- }
-
- for (i = 0; i != n_elements; ++i)
- check_inuse_chunk(av, mem2chunk(marray[i]));
-#endif
-
- return marray;
-}
-#endif /* _LIBC */
-
/*
------------------------------ valloc ------------------------------
*/
-static Void_t*
-#if __STD_C
+static void*
_int_valloc(mstate av, size_t bytes)
-#else
-_int_valloc(av, bytes) mstate av; size_t bytes;
-#endif
{
/* Ensure initialization/consolidation */
if (have_fastchunks(av)) malloc_consolidate(av);
- return _int_memalign(av, mp_.pagesize, bytes);
+ return _int_memalign(av, GLRO(dl_pagesize), bytes);
}
/*
@@ -5808,18 +4568,14 @@ _int_valloc(av, bytes) mstate av; size_t bytes;
*/
-static Void_t*
-#if __STD_C
+static void*
_int_pvalloc(mstate av, size_t bytes)
-#else
-_int_pvalloc(av, bytes) mstate av, size_t bytes;
-#endif
{
size_t pagesz;
/* Ensure initialization/consolidation */
if (have_fastchunks(av)) malloc_consolidate(av);
- pagesz = mp_.pagesize;
+ pagesz = GLRO(dl_pagesize);
return _int_memalign(av, pagesz, (bytes + pagesz - 1) & ~(pagesz - 1));
}
@@ -5828,16 +4584,12 @@ _int_pvalloc(av, bytes) mstate av, size_t bytes;
------------------------------ malloc_trim ------------------------------
*/
-#if __STD_C
static int mTRIm(mstate av, size_t pad)
-#else
-static int mTRIm(av, pad) mstate av; size_t pad;
-#endif
{
/* Ensure initialization/consolidation */
malloc_consolidate (av);
- const size_t ps = mp_.pagesize;
+ const size_t ps = GLRO(dl_pagesize);
int psindex = bin_index (ps);
const size_t psm1 = ps - 1;
@@ -5891,11 +4643,7 @@ static int mTRIm(av, pad) mstate av; size_t pad;
------------------------- malloc_usable_size -------------------------
*/
-#if __STD_C
-size_t mUSABLe(Void_t* mem)
-#else
-size_t mUSABLe(mem) Void_t* mem;
-#endif
+size_t mUSABLe(void* mem)
{
mchunkptr p;
if (mem != 0) {
@@ -5983,11 +4731,9 @@ void mSTATs()
if(__malloc_initialized < 0)
ptmalloc_init ();
-#ifdef _LIBC
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-#endif
for (i=0, ar_ptr = &main_arena;; i++) {
(void)mutex_lock(&ar_ptr->mutex);
mi = mALLINFo(ar_ptr);
@@ -6009,21 +4755,12 @@ void mSTATs()
ar_ptr = ar_ptr->next;
if(ar_ptr == &main_arena) break;
}
-#if HAVE_MMAP
fprintf(stderr, "Total (incl. mmap):\n");
-#else
- fprintf(stderr, "Total:\n");
-#endif
fprintf(stderr, "system bytes = %10u\n", system_b);
fprintf(stderr, "in use bytes = %10u\n", in_use_b);
-#ifdef NO_THREADS
- fprintf(stderr, "max system bytes = %10u\n", (unsigned int)mp_.max_total_mem);
-#endif
-#if HAVE_MMAP
fprintf(stderr, "max mmap regions = %10u\n", (unsigned int)mp_.max_n_mmaps);
fprintf(stderr, "max mmap bytes = %10lu\n",
(unsigned long)mp_.max_mmapped_mem);
-#endif
#if THREAD_STATS
fprintf(stderr, "heaps created = %10d\n", stat_n_heaps);
fprintf(stderr, "locked directly = %10ld\n", stat_lock_direct);
@@ -6032,10 +4769,8 @@ void mSTATs()
fprintf(stderr, "locked total = %10ld\n",
stat_lock_direct + stat_lock_loop + stat_lock_wait);
#endif
-#ifdef _LIBC
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
_IO_funlockfile (stderr);
-#endif
}
@@ -6043,11 +4778,7 @@ void mSTATs()
------------------------------ mallopt ------------------------------
*/
-#if __STD_C
int mALLOPt(int param_number, int value)
-#else
-int mALLOPt(param_number, value) int param_number; int value;
-#endif
{
mstate av = &main_arena;
int res = 1;
@@ -6078,22 +4809,15 @@ int mALLOPt(param_number, value) int param_number; int value;
break;
case M_MMAP_THRESHOLD:
-#if USE_ARENAS
/* Forbid setting the threshold too high. */
if((unsigned long)value > HEAP_MAX_SIZE/2)
res = 0;
else
-#endif
mp_.mmap_threshold = value;
mp_.no_dyn_threshold = 1;
break;
case M_MMAP_MAX:
-#if !HAVE_MMAP
- if (value != 0)
- res = 0;
- else
-#endif
mp_.n_mmaps_max = value;
mp_.no_dyn_threshold = 1;
break;
@@ -6183,10 +4907,10 @@ int mALLOPt(param_number, value) int param_number; int value;
work across all reasonable possibilities.
Additionally, if MORECORE ever returns failure for a positive
- request, and HAVE_MMAP is true, then mmap is used as a noncontiguous
- system allocator. This is a useful backup strategy for systems with
- holes in address spaces -- in this case sbrk cannot contiguously
- expand the heap, but mmap may be able to map noncontiguous space.
+ request, then mmap is used as a noncontiguous system allocator. This
+ is a useful backup strategy for systems with holes in address spaces
+ -- in this case sbrk cannot contiguously expand the heap, but mmap
+ may be able to map noncontiguous space.
If you'd like mmap to ALWAYS be used, you can define MORECORE to be
a function that always returns MORECORE_FAILURE.
@@ -6288,8 +5012,7 @@ malloc_printerr(int action, const char *str, void *ptr)
abort ();
}
-#ifdef _LIBC
-# include <sys/param.h>
+#include <sys/param.h>
/* We need a wrapper function for one of the additions of POSIX. */
int
@@ -6532,7 +5255,6 @@ weak_alias (__malloc_trim, malloc_trim)
weak_alias (__malloc_get_state, malloc_get_state)
weak_alias (__malloc_set_state, malloc_set_state)
-#endif /* _LIBC */
/* ------------------------------------------------------------
History:
diff --git a/libc/malloc/obstack.h b/libc/malloc/obstack.h
index 449070e7f..467789147 100644
--- a/libc/malloc/obstack.h
+++ b/libc/malloc/obstack.h
@@ -1,5 +1,5 @@
/* obstack.h - object stack macros
- Copyright (C) 1988-1994,1996-1999,2003,2004,2005,2009
+ Copyright (C) 1988-1994,1996-1999,2003,2004,2005,2009,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -496,9 +496,9 @@ __extension__ \
( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \
((((h)->temp.tempint > 0 \
&& (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \
- ? (int) ((h)->next_free = (h)->object_base \
- = (h)->temp.tempint + (char *) (h)->chunk) \
- : (((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0)))
+ ? (((h)->next_free = (h)->object_base \
+ = (h)->temp.tempint + (char *) (h)->chunk), 0) \
+ : ((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0)))
#endif /* not __GNUC__ or not __STDC__ */
diff --git a/libc/malloc/set-freeres.c b/libc/malloc/set-freeres.c
index 6123141ed..dfd4641a7 100644
--- a/libc/malloc/set-freeres.c
+++ b/libc/malloc/set-freeres.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999-2003,2011 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
@@ -21,9 +21,7 @@
#include <set-hooks.h>
#include <libc-internal.h>
-#ifdef USE_IN_LIBIO
-# include "../libio/libioP.h"
-#endif
+#include "../libio/libioP.h"
DEFINE_HOOK (__libc_subfreeres, (void));
@@ -40,9 +38,7 @@ __libc_freeres (void)
{
void * const *p;
-#ifdef USE_IN_LIBIO
_IO_cleanup ();
-#endif
RUN_HOOK (__libc_subfreeres, ());
diff --git a/libc/manual/libc.texinfo b/libc/manual/libc.texinfo
index 5456f77f3..214ef169b 100644
--- a/libc/manual/libc.texinfo
+++ b/libc/manual/libc.texinfo
@@ -20,9 +20,9 @@
@comment %**end of header (This is for running Texinfo on a region.)
@c sold 0.06/1.09, print run out 21may96
-@set EDITION 0.12
-@set VERSION 2.8
-@set UPDATED 2007-10-27
+@set EDITION 0.13
+@set VERSION 2.14
+@set UPDATED 2011-07-19
@set ISBN 1-882114-55-8
@copying
diff --git a/libc/manual/signal.texi b/libc/manual/signal.texi
index 6cdae1502..7bd7a63b0 100644
--- a/libc/manual/signal.texi
+++ b/libc/manual/signal.texi
@@ -1544,8 +1544,8 @@ for the parts of the program that update important data structures.
Blocking the signal delays its delivery until it is unblocked, once the
critical updating is finished. @xref{Blocking Signals}.
-The other way to re-initialize the crucial data structures in the signal
-handler, or make their values consistent.
+The other way is to re-initialize the crucial data structures in the
+signal handler, or to make their values consistent.
Here is a rather schematic example showing the reinitialization of one
global variable.
diff --git a/libc/manual/string.texi b/libc/manual/string.texi
index 2fe60395e..f7d4ebea1 100644
--- a/libc/manual/string.texi
+++ b/libc/manual/string.texi
@@ -1249,10 +1249,10 @@ strncmp ("hello, world", "hello, stupid world!!!", 5)
@comment GNU
@deftypefun int strverscmp (const char *@var{s1}, const char *@var{s2})
The @code{strverscmp} function compares the string @var{s1} against
-@var{s2}, considering them as holding indices/version numbers. Return
-value follows the same conventions as found in the @code{strverscmp}
-function. In fact, if @var{s1} and @var{s2} contain no digits,
-@code{strverscmp} behaves like @code{strcmp}.
+@var{s2}, considering them as holding indices/version numbers. The
+return value follows the same conventions as found in the
+@code{strcmp} function. In fact, if @var{s1} and @var{s2} contain no
+digits, @code{strverscmp} behaves like @code{strcmp}.
Basically, we compare strings normally (character by character), until
we find a digit in each string - then we enter a special comparison
diff --git a/libc/math/Makefile b/libc/math/Makefile
index 7900a8470..95fd6b066 100644
--- a/libc/math/Makefile
+++ b/libc/math/Makefile
@@ -1,5 +1,4 @@
-# Copyright (C) 1996-2001,2002,2003,2004,2005,2006
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2006,2011 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
@@ -27,7 +26,8 @@ include ../option-groups.mak
headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
- bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h
+ bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
+ bits/math-finite.h
# Internal header files.
distribute := math_ldbl.h math_private.h machine/asm.h
@@ -62,7 +62,7 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \
s_catan s_casin s_ccos s_csin s_ctan s_ctanh s_cacos \
s_casinh s_cacosh s_catanh s_csqrt s_cpow s_cproj s_clog10 \
s_fma s_lrint s_llrint s_lround s_llround e_exp10 w_log2 \
- $(calls:s_%=m_%)
+ s_isinf_ns $(calls:s_%=m_%)
include ../Makeconfig
diff --git a/libc/math/Versions b/libc/math/Versions
index 39c47626f..09888510b 100644
--- a/libc/math/Versions
+++ b/libc/math/Versions
@@ -168,4 +168,34 @@ libm {
# puts exp2l in GLIBC_2.1, which will override this entry.
exp2l;
}
+ GLIBC_2.15 {
+ # Optimized -ffinite-math-only entry points
+ __acos_finite; __acosf_finite; __acosl_finite;
+ __acosh_finite; __acoshf_finite; __acoshl_finite;
+ __asin_finite; __asinf_finite; __asinl_finite;
+ __atan2_finite; __atan2f_finite; __atan2l_finite;
+ __atanh_finite; __atanhf_finite; __atanhl_finite;
+ __cosh_finite; __coshf_finite; __coshl_finite;
+ __exp10_finite; __exp10f_finite; __exp10l_finite;
+ __exp2_finite; __exp2f_finite; __exp2l_finite;
+ __fmod_finite; __fmodf_finite; __fmodl_finite;
+ __hypot_finite; __hypotf_finite; __hypotl_finite;
+ __j0_finite; __j0f_finite; __j0l_finite;
+ __y0_finite; __y0f_finite; __y0l_finite;
+ __j1_finite; __j1f_finite; __j1l_finite;
+ __y1_finite; __y1f_finite; __y1l_finite;
+ __jn_finite; __jnf_finite; __jnl_finite;
+ __yn_finite; __ynf_finite; __ynl_finite;
+ __lgamma_r_finite; __lgammaf_r_finite; __lgammal_r_finite;
+ __log_finite; __logf_finite; __logl_finite;
+ __log10_finite; __log10f_finite; __log10l_finite;
+ __log2_finite; __log2f_finite; __log2l_finite;
+ __pow_finite; __powf_finite; __powl_finite;
+ __remainder_finite; __remainderf_finite; __remainderl_finite;
+ __scalb_finite; __scalbf_finite; __scalbl_finite;
+ __sinh_finite; __sinhf_finite; __sinhl_finite;
+ __sqrt_finite; __sqrtf_finite; __sqrtl_finite;
+ __gamma_r_finite; __gammaf_r_finite; __gammal_r_finite;
+ __exp_finite; __expf_finite; __expl_finite;
+ }
}
diff --git a/libc/math/bits/math-finite.h b/libc/math/bits/math-finite.h
new file mode 100644
index 000000000..7443d26ad
--- /dev/null
+++ b/libc/math/bits/math-finite.h
@@ -0,0 +1,322 @@
+/* Entry points to finite-math-only compiler runs.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/math-finite.h> directly; include <math.h> instead."
+#endif
+
+/* acos. */
+extern double acos (double) __asm__ ("__acos_finite");
+extern float acosf (float) __asm__ ("__acosf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double acosl (long double) __asm__ ("__acosl_finite");
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+/* acosh. */
+extern double acosh (double) __asm__ ("__acosh_finite");
+extern float acoshf (float) __asm__ ("__acoshf_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double acoshl (long double) __asm__ ("__acoshl_finite");
+# endif
+#endif
+
+/* asin. */
+extern double asin (double) __asm__ ("__asin_finite");
+extern float asinf (float) __asm__ ("__asinf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double asinl (long double) __asm__ ("__asinl_finite");
+#endif
+
+/* atan2. */
+extern double atan2 (double, double) __asm__ ("__atan2_finite");
+extern float atan2f (float, float) __asm__ ("__atan2f_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double atan2l (long double, long double) __asm__ ("__atan2l_finite");
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+/* atanh. */
+extern double atanh (double) __asm__ ("__atanh_finite");
+extern float atanhf (float) __asm__ ("__atanhf_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double atanhl (long double) __asm__ ("__atanhl_finite");
+# endif
+#endif
+
+/* cosh. */
+extern double cosh (double) __asm__ ("__cosh_finite");
+extern float coshf (float) __asm__ ("__coshf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double coshl (long double) __asm__ ("__coshl_finite");
+#endif
+
+/* exp. */
+extern double exp (double) __asm__ ("__exp_finite");
+extern float expf (float) __asm__ ("__expf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double expl (long double) __asm__ ("__expl_finite");
+#endif
+
+#ifdef __USE_GNU
+/* exp10. */
+extern double exp10 (double) __asm__ ("__exp10_finite");
+extern float exp10f (float) __asm__ ("__exp10f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double exp10l (long double) __asm__ ("__exp10l_finite");
+# endif
+
+/* pow10. */
+extern double pow10 (double) __asm__ ("__exp10_finite");
+extern float pow10f (float) __asm__ ("__exp10f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double pow10l (long double) __asm__ ("__exp10l_finite");
+# endif
+#endif
+
+#ifdef __USE_ISOC99
+/* exp2. */
+extern double exp2 (double) __asm__ ("__exp2_finite");
+extern float exp2f (float) __asm__ ("__exp2f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double exp2l (long double) __asm__ ("__exp2l_finite");
+# endif
+#endif
+
+/* fmod. */
+extern double fmod (double, double) __asm__ ("__fmod_finite");
+extern float fmodf (float, float) __asm__ ("__fmodf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double fmodl (long double, long double) __asm__ ("__fmodl_finite");
+#endif
+
+#ifdef __USE_ISOC99
+/* hypot. */
+extern double hypot (double, double) __asm__ ("__hypot_finite");
+extern float hypotf (float, float) __asm__ ("__hypotf_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double hypotl (long double, long double) __asm__ ("__hypotl_finite");
+# endif
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* j0. */
+extern double j0 (double) __asm__ ("__j0_finite");
+extern float j0f (float) __asm__ ("__j0f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double j0l (long double) __asm__ ("__j0l_finite");
+# endif
+
+/* y0. */
+extern double y0 (double) __asm__ ("__y0_finite");
+extern float y0f (float) __asm__ ("__y0f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double y0l (long double) __asm__ ("__y0l_finite");
+# endif
+
+/* j1. */
+extern double j1 (double) __asm__ ("__j1_finite");
+extern float j1f (float) __asm__ ("__j1f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double j1l (long double) __asm__ ("__j1l_finite");
+# endif
+
+/* y1. */
+extern double y1 (double) __asm__ ("__y1_finite");
+extern float y1f (float) __asm__ ("__y1f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double y1l (long double) __asm__ ("__y1l_finite");
+# endif
+
+/* jn. */
+extern double jn (int, double) __asm__ ("__jn_finite");
+extern float jnf (int, float) __asm__ ("__jnf_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double jnl (int, long double) __asm__ ("__jnl_finite");
+# endif
+
+/* yn. */
+extern double yn (int, double) __asm__ ("__yn_finite");
+extern float ynf (int, float) __asm__ ("__ynf_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double ynl (int, long double) __asm__ ("__ynl_finite");
+# endif
+#endif
+
+#ifdef __USE_MISC
+/* lgamma_r. */
+extern double lgamma_r (double, int *) __asm__ ("__lgamma_r_finite");
+extern float lgammaf_r (float, int *) __asm__ ("__lgammaf_r_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double lgammal_r (long double, int *) __asm__ ("__lgammal_r_finite");
+# endif
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+/* lgamma. */
+__extern_always_inline double lgamma (double __d)
+{
+# ifdef __USE_ISOC99
+ int __local_signgam = 0;
+ return lgamma_r (__d, &__local_signgam);
+# else
+ return lgamma_r (__d, &signgam);
+# endif
+}
+__extern_always_inline float lgammaf (float __d)
+{
+# ifdef __USE_ISOC99
+ int __local_signgam = 0;
+ return lgammaf_r (__d, &__local_signgam);
+# else
+ return lgammaf_r (__d, &signgam);
+# endif
+}
+# ifdef __MATH_DECLARE_LDOUBLE
+__extern_always_inline long double lgammal (long double __d)
+{
+# ifdef __USE_ISOC99
+ int __local_signgam = 0;
+ return lgammal_r (__d, &__local_signgam);
+# else
+ return lgammal_r (__d, &signgam);
+# endif
+}
+# endif
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* gamma. */
+__extern_always_inline double gamma (double __d)
+{
+# ifdef __USE_ISOC99
+ int __local_signgam = 0;
+ return lgamma_r (__d, &__local_signgam);
+# else
+ return lgamma_r (__d, &signgam);
+# endif
+}
+__extern_always_inline float gammaf (float __d)
+{
+# ifdef __USE_ISOC99
+ int __local_signgam = 0;
+ return lgammaf_r (__d, &__local_signgam);
+# else
+ return lgammaf_r (__d, &signgam);
+# endif
+}
+# ifdef __MATH_DECLARE_LDOUBLE
+__extern_always_inline long double gammal (long double __d)
+{
+# ifdef __USE_ISOC99
+ int __local_signgam = 0;
+ return lgammal_r (__d, &__local_signgam);
+# else
+ return lgammal_r (__d, &signgam);
+# endif
+}
+# endif
+#endif
+
+/* log. */
+extern double log (double) __asm__ ("__log_finite");
+extern float logf (float) __asm__ ("__logf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double logl (long double) __asm__ ("__logl_finite");
+#endif
+
+/* log10. */
+extern double log10 (double) __asm__ ("__log10_finite");
+extern float log10f (float) __asm__ ("__log10f_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double log10l (long double) __asm__ ("__log10l_finite");
+#endif
+
+#ifdef __USE_ISOC99
+/* log2. */
+extern double log2 (double) __asm__ ("__log2_finite");
+extern float log2f (float) __asm__ ("__log2f_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double log2l (long double) __asm__ ("__log2l_finite");
+# endif
+#endif
+
+/* pow. */
+extern double pow (double, double) __asm__ ("__pow_finite");
+extern float powf (float, float) __asm__ ("__powf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double powl (long double, long double) __asm__ ("__powl_finite");
+#endif
+
+/* remainder. */
+extern double remainder (double, double) __asm__ ("__remainder_finite");
+extern float remainderf (float, float) __asm__ ("__remainderf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double remainderl (long double, long double) __asm__ ("__remainderl_finite");
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* scalb. */
+extern double scalb (double, double) __asm__ ("__scalb_finite");
+extern float scalbf (float, float) __asm__ ("__scalbf_finite");
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double scalbl (long double, long double) __asm__ ("__scalbl_finite");
+# endif
+#endif
+
+/* sinh. */
+extern double sinh (double) __asm__ ("__sinh_finite");
+extern float sinhf (float) __asm__ ("__sinhf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double sinhl (long double) __asm__ ("__sinhl_finite");
+#endif
+
+/* sqrt. */
+extern double sqrt (double) __asm__ ("__sqrt_finite");
+extern float sqrtf (float) __asm__ ("__sqrtf_finite");
+#ifdef __MATH_DECLARE_LDOUBLE
+extern long double sqrtl (long double) __asm__ ("__sqrtl_finite");
+#endif
+
+#ifdef __USE_ISOC99
+/* tgamma. */
+extern double __gamma_r_finite (double, int *);
+__extern_always_inline double tgamma (double __d)
+{
+ int __local_signgam = 0;
+ double __res = __gamma_r_finite (__d, &__local_signgam);
+ return __local_signgam < 0 ? -__res : __res;
+}
+extern float __gammaf_r_finite (float, int *);
+__extern_always_inline float tgammaf (float __d)
+{
+ int __local_signgam = 0;
+ float __res = __gammaf_r_finite (__d, &__local_signgam);
+ return __local_signgam < 0 ? -__res : __res;
+}
+# ifdef __MATH_DECLARE_LDOUBLE
+extern long double __gammal_r_finite (long double, int *);
+__extern_always_inline long double tgammal (long double __d)
+{
+ int __local_signgam = 0;
+ long double __res = __gammal_r_finite (__d, &__local_signgam);
+ return __local_signgam < 0 ? -__res : __res;
+}
+# endif
+#endif
diff --git a/libc/math/bits/mathcalls.h b/libc/math/bits/mathcalls.h
index 64da6276f..4f22abf74 100644
--- a/libc/math/bits/mathcalls.h
+++ b/libc/math/bits/mathcalls.h
@@ -1,5 +1,5 @@
/* Prototype declarations for math functions; helper file for <math.h>.
- Copyright (C) 1996-2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1996-2002, 2003, 2006, 2011 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
@@ -113,7 +113,8 @@ __MATHCALL (log,, (_Mdouble_ __x));
__MATHCALL (log10,, (_Mdouble_ __x));
/* Break VALUE into integral and fractional parts. */
-__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
+__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr))
+ __attribute__ ((__nonnull__ (2)));
_Mdouble_END_NAMESPACE
#ifdef __USE_GNU
diff --git a/libc/math/divtc3.c b/libc/math/divtc3.c
index d974ae645..72bca66d4 100644
--- a/libc/math/divtc3.c
+++ b/libc/math/divtc3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@redhat.com>, 2005.
@@ -55,17 +55,19 @@ __divtc3 (long double a, long double b, long double c, long double d)
x = __copysignl (INFINITY, c) * a;
y = __copysignl (INFINITY, c) * b;
}
- else if ((isinf (a) || isinf (b)) && isfinite (c) && isfinite (d))
+ else if ((__isinf_nsl (a) || __isinf_nsl (b))
+ && isfinite (c) && isfinite (d))
{
- a = __copysignl (isinf (a) ? 1 : 0, a);
- b = __copysignl (isinf (b) ? 1 : 0, b);
+ a = __copysignl (__isinf_nsl (a) ? 1 : 0, a);
+ b = __copysignl (__isinf_nsl (b) ? 1 : 0, b);
x = INFINITY * (a * c + b * d);
y = INFINITY * (b * c - a * d);
}
- else if ((isinf (c) || isinf (d)) && isfinite (a) && isfinite (b))
+ else if ((__isinf_nsl (c) || __isinf_nsl (d))
+ && isfinite (a) && isfinite (b))
{
- c = __copysignl (isinf (c) ? 1 : 0, c);
- d = __copysignl (isinf (d) ? 1 : 0, d);
+ c = __copysignl (__isinf_nsl (c) ? 1 : 0, c);
+ d = __copysignl (__isinf_nsl (d) ? 1 : 0, d);
x = 0.0 * (a * c + b * d);
y = 0.0 * (b * c - a * d);
}
diff --git a/libc/math/e_acoshl.c b/libc/math/e_acoshl.c
index 2c2fbe8eb..490fd10fd 100644
--- a/libc/math/e_acoshl.c
+++ b/libc/math/e_acoshl.c
@@ -9,6 +9,7 @@ __ieee754_acoshl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_acoshl, __acoshl_finite)
stub_warning (acoshl)
#include <stub-tag.h>
diff --git a/libc/math/e_acosl.c b/libc/math/e_acosl.c
index d844d885b..55d9ab0f6 100644
--- a/libc/math/e_acosl.c
+++ b/libc/math/e_acosl.c
@@ -9,6 +9,7 @@ __ieee754_acosl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_acosl, __acosl_finite)
stub_warning (acosl)
#include <stub-tag.h>
diff --git a/libc/math/e_asinl.c b/libc/math/e_asinl.c
index 3b26f030e..8e6c47e70 100644
--- a/libc/math/e_asinl.c
+++ b/libc/math/e_asinl.c
@@ -9,6 +9,7 @@ __ieee754_asinl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_asinl, __asinl_finite)
stub_warning (asinl)
#include <stub-tag.h>
diff --git a/libc/math/e_atan2l.c b/libc/math/e_atan2l.c
index 0caed8a32..8ca37622f 100644
--- a/libc/math/e_atan2l.c
+++ b/libc/math/e_atan2l.c
@@ -9,6 +9,7 @@ __ieee754_atan2l (long double x, long double y)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_atan2l, __atan2l_finite)
stub_warning (atan2l)
#include <stub-tag.h>
diff --git a/libc/math/e_atanhl.c b/libc/math/e_atanhl.c
index 625d42db3..26c52e793 100644
--- a/libc/math/e_atanhl.c
+++ b/libc/math/e_atanhl.c
@@ -9,6 +9,7 @@ __ieee754_atanhl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_atanhl, __atanhl_finite)
stub_warning (__ieee754_atanhl)
#include <stub-tag.h>
diff --git a/libc/math/e_coshl.c b/libc/math/e_coshl.c
index 0da319b78..92bfd7a18 100644
--- a/libc/math/e_coshl.c
+++ b/libc/math/e_coshl.c
@@ -9,6 +9,7 @@ __ieee754_coshl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_coshl, __coshl_finite)
stub_warning (__ieee754_coshl)
#include <stub-tag.h>
diff --git a/libc/math/e_exp10.c b/libc/math/e_exp10.c
index a3eccbb9e..ce14ea5f1 100644
--- a/libc/math/e_exp10.c
+++ b/libc/math/e_exp10.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -18,7 +18,7 @@
02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
double
@@ -28,3 +28,4 @@ __ieee754_exp10 (double arg)
replaced sometime (soon?). */
return __ieee754_exp (M_LN10 * arg);
}
+strong_alias (__ieee754_exp10, __exp10_finite)
diff --git a/libc/math/e_exp10f.c b/libc/math/e_exp10f.c
index 7d06d074b..68e9723b8 100644
--- a/libc/math/e_exp10f.c
+++ b/libc/math/e_exp10f.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -18,7 +18,7 @@
02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
float
@@ -28,3 +28,4 @@ __ieee754_exp10f (float arg)
replaced sometime (soon?). */
return __ieee754_expf (M_LN10 * arg);
}
+strong_alias (__ieee754_exp10f, __exp10f_finite)
diff --git a/libc/math/e_exp10l.c b/libc/math/e_exp10l.c
index 56f0cfec2..6bd859fde 100644
--- a/libc/math/e_exp10l.c
+++ b/libc/math/e_exp10l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -18,7 +18,7 @@
02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
long double
@@ -28,3 +28,4 @@ __ieee754_exp10l (long double arg)
replaced sometime (soon?). */
return __ieee754_expl (M_LN10l * arg);
}
+strong_alias (__ieee754_exp10l, __exp10l_finite)
diff --git a/libc/math/e_exp2l.c b/libc/math/e_exp2l.c
index 7e598d8d2..e7e493933 100644
--- a/libc/math/e_exp2l.c
+++ b/libc/math/e_exp2l.c
@@ -1,5 +1,5 @@
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__ieee754_exp2l (long double x)
@@ -8,3 +8,4 @@ __ieee754_exp2l (long double x)
replaced sometime (soon?). */
return __ieee754_expl (M_LN2l * x);
}
+strong_alias (__ieee754_exp2l, __exp2l_finite)
diff --git a/libc/math/e_expl.c b/libc/math/e_expl.c
index f9467c38a..5ba6eb584 100644
--- a/libc/math/e_expl.c
+++ b/libc/math/e_expl.c
@@ -9,6 +9,7 @@ __ieee754_expl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_expl, __expl_finite)
stub_warning (expl)
#include <stub-tag.h>
diff --git a/libc/math/e_fmodl.c b/libc/math/e_fmodl.c
index 380da24e4..dbd361ebc 100644
--- a/libc/math/e_fmodl.c
+++ b/libc/math/e_fmodl.c
@@ -9,6 +9,7 @@ __ieee754_fmodl (long double x, long double y)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_fmodl, __fmodl_finite)
stub_warning (fmodl)
#include <stub-tag.h>
diff --git a/libc/math/e_gammal_r.c b/libc/math/e_gammal_r.c
index 1c45c8421..c0ae70426 100644
--- a/libc/math/e_gammal_r.c
+++ b/libc/math/e_gammal_r.c
@@ -10,6 +10,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_gammal_r, __gammal_r_finite)
stub_warning (__ieee754_gammal_r)
#include <stub-tag.h>
diff --git a/libc/math/e_hypotl.c b/libc/math/e_hypotl.c
index 07df22eb3..73bad6277 100644
--- a/libc/math/e_hypotl.c
+++ b/libc/math/e_hypotl.c
@@ -9,6 +9,7 @@ __ieee754_hypotl (long double x, long double y)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_hypotl, __hypotl_finite)
stub_warning (__ieee754_hypotl)
#include <stub-tag.h>
diff --git a/libc/math/e_j0l.c b/libc/math/e_j0l.c
index 1bf0a1de7..eb01ba67c 100644
--- a/libc/math/e_j0l.c
+++ b/libc/math/e_j0l.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__ieee754_j0l (long double x)
@@ -10,6 +10,7 @@ __ieee754_j0l (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_j0l, __j0l_finite)
stub_warning (j0l)
@@ -20,6 +21,7 @@ __ieee754_y0l (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_y0l, __y0l_finite)
stub_warning (y0l)
#include <stub-tag.h>
diff --git a/libc/math/e_j1l.c b/libc/math/e_j1l.c
index 656abeba5..7701f49ff 100644
--- a/libc/math/e_j1l.c
+++ b/libc/math/e_j1l.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__ieee754_j1l (long double x)
@@ -10,6 +10,7 @@ __ieee754_j1l (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_j1l, __j1l_finite)
stub_warning (j1l)
@@ -20,6 +21,7 @@ __ieee754_y1l (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_y1l, __y1l_finite)
stub_warning (y1l)
#include <stub-tag.h>
diff --git a/libc/math/e_jnl.c b/libc/math/e_jnl.c
index 1bfc0695a..059b1db6b 100644
--- a/libc/math/e_jnl.c
+++ b/libc/math/e_jnl.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__ieee754_jnl (int n, long double x)
@@ -10,6 +10,7 @@ __ieee754_jnl (int n, long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_jnl, __jnl_finite)
stub_warning (jnl)
@@ -20,6 +21,7 @@ __ieee754_ynl (int n, long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_ynl, __ynl_finite)
stub_warning (ynl)
#include <stub-tag.h>
diff --git a/libc/math/e_lgammal_r.c b/libc/math/e_lgammal_r.c
index 1784b2663..92e7700e2 100644
--- a/libc/math/e_lgammal_r.c
+++ b/libc/math/e_lgammal_r.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__ieee754_lgammal_r (long double x, int *signgamp)
@@ -11,6 +11,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
stub_warning (lgammal)
stub_warning (lgammal_r)
diff --git a/libc/math/e_log10l.c b/libc/math/e_log10l.c
index 5bc264b32..2c7ff72c2 100644
--- a/libc/math/e_log10l.c
+++ b/libc/math/e_log10l.c
@@ -9,6 +9,7 @@ __ieee754_log10l (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_log10l, __log10l_finite)
stub_warning (log10l)
#include <stub-tag.h>
diff --git a/libc/math/e_log2l.c b/libc/math/e_log2l.c
index 681904bfb..95929c360 100644
--- a/libc/math/e_log2l.c
+++ b/libc/math/e_log2l.c
@@ -9,6 +9,7 @@ __ieee754_log2l (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_log2l, __log2l_finite)
stub_warning (log2l)
#include <stub-tag.h>
diff --git a/libc/math/e_logl.c b/libc/math/e_logl.c
index 9ba9cfc79..95608ab55 100644
--- a/libc/math/e_logl.c
+++ b/libc/math/e_logl.c
@@ -9,6 +9,7 @@ __ieee754_logl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_logl, __logl_finite)
stub_warning (logl)
#include <stub-tag.h>
diff --git a/libc/math/e_powl.c b/libc/math/e_powl.c
index afc2248b6..ab79b1a4b 100644
--- a/libc/math/e_powl.c
+++ b/libc/math/e_powl.c
@@ -9,6 +9,7 @@ __ieee754_powl (long double x, long double y)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_powl, __powl_finite)
stub_warning (powl)
#include <stub-tag.h>
diff --git a/libc/math/e_rem_pio2l.c b/libc/math/e_rem_pio2l.c
index 617215516..7fa515df2 100644
--- a/libc/math/e_rem_pio2l.c
+++ b/libc/math/e_rem_pio2l.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
int
__ieee754_rem_pio2l (long double x, long double *y)
diff --git a/libc/math/e_scalb.c b/libc/math/e_scalb.c
index 606af5372..3b81dd565 100644
--- a/libc/math/e_scalb.c
+++ b/libc/math/e_scalb.c
@@ -1,71 +1,59 @@
-/* @(#)e_scalb.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_scalb.c,v 1.6 1995/05/10 20:46:09 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-/*
- * __ieee754_scalb(x, fn) is provide for
- * passing various standard test suite. One
- * should use scalbn() instead.
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
-#ifdef _SCALB_INT
-#ifdef __STDC__
- double __ieee754_scalb(double x, int fn)
-#else
- double __ieee754_scalb(x,fn)
- double x; int fn;
-#endif
-#else
-#ifdef __STDC__
- double __ieee754_scalb(double x, double fn)
-#else
- double __ieee754_scalb(x,fn)
- double x, fn;
-#endif
-#endif
+static double
+__attribute__ ((noinline))
+invalid_fn (double x, double fn)
{
-#ifdef _SCALB_INT
- return __scalbn(x,fn);
-#else
- if (__isnan(x)||__isnan(fn)) return x*fn;
- if (!__finite(fn)) {
- if(fn>0.0) return x*fn;
- else if (x == 0)
- return x;
- else if (!__finite (x))
- {
-# ifdef FE_INVALID
- feraiseexcept (FE_INVALID);
-# endif
- return __nan ("");
- }
- else return x/(-fn);
- }
- if (__rint(fn)!=fn)
- {
-# ifdef FE_INVALID
- feraiseexcept (FE_INVALID);
-# endif
- return __nan ("");
- }
- if ( fn > 65000.0) return __scalbn(x, 65000);
- if (-fn > 65000.0) return __scalbn(x,-65000);
- return __scalbn(x,(int)fn);
-#endif
+ if (__rint (fn) != fn)
+ {
+ feraiseexcept (FE_INVALID);
+ return __nan ("");
+ }
+ else if (fn > 65000.0)
+ return __scalbn (x, 65000);
+ else
+ return __scalbn (x,-65000);
+}
+
+
+double
+__ieee754_scalb (double x, double fn)
+{
+ if (__builtin_expect (__isnan (x), 0))
+ return x * fn;
+ if (__builtin_expect (!__finite (fn), 0))
+ {
+ if (__isnan (fn) || fn > 0.0)
+ return x * fn;
+ if (x == 0.0)
+ return x;
+ return x / -fn;
+ }
+ if (__builtin_expect ((double) (int) fn != fn, 0))
+ return invalid_fn (x, fn);
+
+ return __scalbn (x, (int) fn);
}
+strong_alias (__ieee754_scalb, __scalb_finite)
diff --git a/libc/math/e_scalbf.c b/libc/math/e_scalbf.c
index 95a72eb56..61847d9a5 100644
--- a/libc/math/e_scalbf.c
+++ b/libc/math/e_scalbf.c
@@ -1,68 +1,59 @@
-/* e_scalbf.c -- float version of e_scalb.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_scalbf.c,v 1.3 1995/05/10 20:46:12 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
-#ifdef _SCALB_INT
-#ifdef __STDC__
- float __ieee754_scalbf(float x, int fn)
-#else
- float __ieee754_scalbf(x,fn)
- float x; int fn;
-#endif
-#else
-#ifdef __STDC__
- float __ieee754_scalbf(float x, float fn)
-#else
- float __ieee754_scalbf(x,fn)
- float x, fn;
-#endif
-#endif
+static float
+__attribute__ ((noinline))
+invalid_fn (float x, float fn)
{
-#ifdef _SCALB_INT
- return __scalbnf(x,fn);
-#else
- if (__isnanf(x)||__isnanf(fn)) return x*fn;
- if (!__finitef(fn)) {
- if(fn>(float)0.0) return x*fn;
- else if (x == 0)
- return x;
- else if (!__finitef (x))
- {
-# ifdef FE_INVALID
- feraiseexcept (FE_INVALID);
-# endif
- return __nanf ("");
- }
- else return x/(-fn);
- }
- if (__rintf(fn)!=fn)
- {
-# ifdef FE_INVALID
- feraiseexcept (FE_INVALID);
-# endif
- return __nanf ("");
- }
- if ( fn > (float)65000.0) return __scalbnf(x, 65000);
- if (-fn > (float)65000.0) return __scalbnf(x,-65000);
- return __scalbnf(x,(int)fn);
-#endif
+ if (__rintf (fn) != fn)
+ {
+ feraiseexcept (FE_INVALID);
+ return __nan ("");
+ }
+ else if (fn > 65000.0f)
+ return __scalbnf (x, 65000);
+ else
+ return __scalbnf (x,-65000);
+}
+
+
+float
+__ieee754_scalbf (float x, float fn)
+{
+ if (__builtin_expect (__isnanf (x), 0))
+ return x * fn;
+ if (__builtin_expect (!__finitef (fn), 0))
+ {
+ if (__isnanf (fn) || fn > 0.0f)
+ return x * fn;
+ if (x == 0.0f)
+ return x;
+ return x / -fn;
+ }
+ if (__builtin_expect ((float) (int) fn != fn, 0))
+ return invalid_fn (x, fn);
+
+ return __scalbnf (x, (int) fn);
}
+strong_alias (__ieee754_scalbf, __scalbf_finite)
diff --git a/libc/math/e_scalbl.c b/libc/math/e_scalbl.c
index 1f5677d9f..6b36b7122 100644
--- a/libc/math/e_scalbl.c
+++ b/libc/math/e_scalbl.c
@@ -1,75 +1,59 @@
-/* e_scalbl.c -- long double version of s_scalb.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * __ieee754_scalbl(x, fn) is provide for
- * passing various standard test suite. One
- * should use scalbnl() instead.
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef _SCALB_INT
-#ifdef __STDC__
- long double __ieee754_scalbl(long double x, int fn)
-#else
- long double __ieee754_scalbl(x,fn)
- long double x; int fn;
-#endif
-#else
-#ifdef __STDC__
- long double __ieee754_scalbl(long double x, long double fn)
-#else
- long double __ieee754_scalbl(x,fn)
- long double x, fn;
-#endif
-#endif
+
+static long double
+__attribute__ ((noinline))
+invalid_fn (long double x, long double fn)
+{
+ if (__rintl (fn) != fn)
+ {
+ feraiseexcept (FE_INVALID);
+ return __nan ("");
+ }
+ else if (fn > 65000.0L)
+ return __scalbnl (x, 65000);
+ else
+ return __scalbnl (x,-65000);
+}
+
+
+long double
+__ieee754_scalbl (long double x, long double fn)
{
-#ifdef _SCALB_INT
- return __scalbnl(x,fn);
-#else
- if (__isnanl(x)||__isnanl(fn)) return x*fn;
- if (!__finitel(fn)) {
- if(fn>0.0) return x*fn;
- else if (x == 0)
- return x;
- else if (!__finitel (x))
- {
-# ifdef FE_INVALID
- feraiseexcept (FE_INVALID);
-# endif
- return __nanl ("");
- }
- else return x/(-fn);
- }
- if (__rintl(fn)!=fn)
- {
-# ifdef FE_INVALID
- feraiseexcept (FE_INVALID);
-# endif
- return __nanl ("");
- }
- if ( fn > 65000.0) return __scalbnl(x, 65000);
- if (-fn > 65000.0) return __scalbnl(x,-65000);
- return __scalbnl(x,(int)fn);
-#endif
+ if (__builtin_expect (__isnanl (x), 0))
+ return x * fn;
+ if (__builtin_expect (!__finitel (fn), 0))
+ {
+ if (__isnanl (fn) || fn > 0.0L)
+ return x * fn;
+ if (x == 0.0L)
+ return x;
+ return x / -fn;
+ }
+ if (__builtin_expect ((long double) (int) fn != fn, 0))
+ return invalid_fn (x, fn);
+
+ return __scalbnl (x, (int) fn);
}
+strong_alias (__ieee754_scalbl, __scalbl_finite)
diff --git a/libc/math/e_sinhl.c b/libc/math/e_sinhl.c
index 4cec79cb2..fc756c9eb 100644
--- a/libc/math/e_sinhl.c
+++ b/libc/math/e_sinhl.c
@@ -9,6 +9,7 @@ __ieee754_sinhl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_sinhl, __sinhl_finite)
stub_warning (__ieee754_sinhl)
#include <stub-tag.h>
diff --git a/libc/math/e_sqrtl.c b/libc/math/e_sqrtl.c
index 7680bdb14..af9c2b51b 100644
--- a/libc/math/e_sqrtl.c
+++ b/libc/math/e_sqrtl.c
@@ -9,6 +9,7 @@ __ieee754_sqrtl (long double x)
__set_errno (ENOSYS);
return 0.0;
}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
stub_warning (sqrtl)
#include <stub-tag.h>
diff --git a/libc/math/k_cosl.c b/libc/math/k_cosl.c
index 29b83d627..bf3708b15 100644
--- a/libc/math/k_cosl.c
+++ b/libc/math/k_cosl.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__kernel_cosl (long double x, long double y)
diff --git a/libc/math/k_sinl.c b/libc/math/k_sinl.c
index ea1d71f61..e95c71c4c 100644
--- a/libc/math/k_sinl.c
+++ b/libc/math/k_sinl.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__kernel_sinl (long double x, long double y, int iy)
diff --git a/libc/math/k_tanl.c b/libc/math/k_tanl.c
index 9993c6b99..891d3ab40 100644
--- a/libc/math/k_tanl.c
+++ b/libc/math/k_tanl.c
@@ -1,7 +1,7 @@
#include <math.h>
#include <stdio.h>
#include <errno.h>
-#include "math_private.h"
+#include <math_private.h>
long double
__kernel_tanl (long double x, long double y, int iy)
diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc
index 453088528..f1ecdcd78 100644
--- a/libc/math/libm-test.inc
+++ b/libc/math/libm-test.inc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1997.
@@ -191,7 +191,7 @@ static FLOAT max_error, real_max_error, imag_max_error;
#if __OPTION_EGLIBC_LIBM_BIG
#define MANT_DIG CHOOSE ((LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1), \
- (LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1))
+ (LDBL_MANT_DIG-1), (DBL_MANT_DIG-1), (FLT_MANT_DIG-1))
#else
/* Reduce precision to which the results are checked against
expected values. */
@@ -3298,6 +3298,16 @@ jn_test (void)
TEST_ff_f (jn, 10, 2.0, 0.251538628271673670963516093751820639e-6L);
TEST_ff_f (jn, 10, 10.0, 0.207486106633358857697278723518753428L);
+ /* BZ #11589 .*/
+ TEST_ff_f (jn, 2, 2.4048255576957729, 0.43175480701968038399746111312430703L);
+ TEST_ff_f (jn, 3, 2.4048255576957729, 0.19899990535769083404042146764530813L);
+ TEST_ff_f (jn, 4, 2.4048255576957729, 0.647466661641779720084932282551219891E-1L);
+ TEST_ff_f (jn, 5, 2.4048255576957729, 0.163892432048058525099230549946147698E-1L);
+ TEST_ff_f (jn, 6, 2.4048255576957729, 0.34048184720278336646673682895929161E-2L);
+ TEST_ff_f (jn, 7, 2.4048255576957729, 0.60068836573295394221291569249883076E-3L);
+ TEST_ff_f (jn, 8, 2.4048255576957729, 0.92165786705344923232879022467054148E-4L);
+ TEST_ff_f (jn, 9, 2.4048255576957729, 0.12517270977961513005428966643852564E-4L)
+
END (jn);
}
@@ -4399,6 +4409,7 @@ lround_test (void)
TEST_f_l (lround, 1073741824.01, 1073741824);
# if LONG_MAX > 281474976710656
TEST_f_l (lround, 281474976710656.025, 281474976710656);
+ TEST_f_l (llround, -3.65309740835E17, -365309740835000000);
# endif
TEST_f_l (lround, 2097152.5, 2097153);
TEST_f_l (lround, -2097152.5, -2097153);
@@ -4942,11 +4953,27 @@ remainder_test (void)
START (remainder);
+ errno = 0;
TEST_ff_f (remainder, 1, 0, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for remainder(1, 0) = EDOM ", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_ff_f (remainder, 1, minus_zero, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for remainder(1, -0) = EDOM ", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_ff_f (remainder, plus_infty, 1, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for remainder(INF, 1) = EDOM ", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_ff_f (remainder, minus_infty, 1, nan_value, INVALID_EXCEPTION);
+ check_int ("errno for remainder(-INF, 1) = EDOM ", errno, EDOM, 0, 0, 0);
+ errno = 0;
TEST_ff_f (remainder, nan_value, nan_value, nan_value);
+ check_int ("errno for remainder(NAN, NAN) unchanged", errno, 0, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (remainder, 0, nan_value, nan_value);
+ check_int ("errno for remainder(0, NAN) unchanged", errno, 0, 0, 0, 0);
+ errno = 0;
+ TEST_ff_f (remainder, nan_value, 0, nan_value);
+ check_int ("errno for remainder(NaN, 0) unchanged", errno, 0, 0, 0, 0);
TEST_ff_f (remainder, 1.625, 1.0, -0.375);
TEST_ff_f (remainder, -1.625, 1.0, 0.375);
diff --git a/libc/math/math.h b/libc/math/math.h
index 272cea719..7b5988114 100644
--- a/libc/math/math.h
+++ b/libc/math/math.h
@@ -1,5 +1,5 @@
/* Declarations for math functions.
- Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006, 2009
+ Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006, 2009, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -64,10 +64,10 @@ __BEGIN_DECLS
#define __MATHDECL_1(type, function,suffix, args) \
extern type __MATH_PRECNAME(function,suffix) args __THROW
-#define _Mdouble_ double
+#define _Mdouble_ double
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
-# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
-# define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD
+#define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD
+#define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD
#include <bits/mathcalls.h>
#undef _Mdouble_
#undef _Mdouble_BEGIN_NAMESPACE
@@ -83,7 +83,7 @@ __BEGIN_DECLS
# ifndef _Mfloat_
# define _Mfloat_ float
# endif
-# define _Mdouble_ _Mfloat_
+# define _Mdouble_ _Mfloat_
# ifdef __STDC__
# define __MATH_PRECNAME(name,r) name##f##r
# else
@@ -134,7 +134,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
# ifndef _Mlong_double_
# define _Mlong_double_ long double
# endif
-# define _Mdouble_ _Mlong_double_
+# define _Mdouble_ _Mlong_double_
# ifdef __STDC__
# define __MATH_PRECNAME(name,r) name##l##r
# else
@@ -142,6 +142,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
# endif
# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
+# define __MATH_DECLARE_LDOUBLE 1
# include <bits/mathcalls.h>
# undef _Mdouble_
# undef _Mdouble_BEGIN_NAMESPACE
@@ -420,6 +421,12 @@ extern int matherr (struct exception *__exc);
# include <bits/mathinline.h>
#endif
+/* Define special entry points to use when the compiler got told to
+ only expect finite results. */
+#if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0
+# include <bits/math-finite.h>
+#endif
+
#ifdef __USE_ISOC99
/* If we've still got undefined comparison macros, provide defaults. */
diff --git a/libc/math/math_private.h b/libc/math/math_private.h
index e5ca61f0b..4cb81ea41 100644
--- a/libc/math/math_private.h
+++ b/libc/math/math_private.h
@@ -202,6 +202,7 @@ extern double __ieee754_scalb (double,double);
/* fdlibm kernel function */
extern double __kernel_standard (double,double,int);
+extern float __kernel_standard_f (float,float,int);
extern double __kernel_sin (double,double,int);
extern double __kernel_cos (double,double);
extern double __kernel_tan (double,double,int);
@@ -357,4 +358,48 @@ extern void __docos (double __x, double __dx, double __v[]);
#define math_force_eval(x) __asm __volatile ("" : : "m" (x))
#endif
+
+/* The standards only specify one variant of the fenv.h interfaces.
+ But at least for some architectures we can be more efficient if we
+ know what operations are going to be performed. Therefore we
+ define additional interfaces. By default they refer to the normal
+ interfaces. */
+#define libc_fegetround() fegetround ()
+#define libc_fegetroundf() fegetround ()
+#define libc_fegetroundl() fegetround ()
+
+#define libc_fesetround(r) (void) fesetround (r)
+#define libc_fesetroundf(r) (void) fesetround (r)
+#define libc_fesetroundl(r) (void) fesetround (r)
+
+#define libc_feholdexcept(e) (void) feholdexcept (e)
+#define libc_feholdexceptf(e) (void) feholdexcept (e)
+#define libc_feholdexceptl(e) (void) feholdexcept (e)
+
+#define libc_feholdexcept_setround(e, r) \
+ do { feholdexcept (e); fesetround (r); } while (0)
+#define libc_feholdexcept_setroundf(e, r) \
+ do { feholdexcept (e); fesetround (r); } while (0)
+#define libc_feholdexcept_setroundl(e, r) \
+ do { feholdexcept (e); fesetround (r); } while (0)
+
+#define libc_fetestexcept(e) fetestexcept (e)
+#define libc_fetestexceptf(e) fetestexcept (e)
+#define libc_fetestexceptl(e) fetestexcept (e)
+
+#define libc_fesetenv(e) (void) fesetenv (e)
+#define libc_fesetenvf(e) (void) fesetenv (e)
+#define libc_fesetenvl(e) (void) fesetenv (e)
+
+#define libc_feupdateenv(e) (void) feupdateenv (e)
+#define libc_feupdateenvf(e) (void) feupdateenv (e)
+#define libc_feupdateenvl(e) (void) feupdateenv (e)
+
+#define __nan(str) \
+ (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
+#define __nanf(str) \
+ (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
+#define __nanl(str) \
+ (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
+
#endif /* _MATH_PRIVATE_H_ */
diff --git a/libc/math/multc3.c b/libc/math/multc3.c
index 6369f48f2..351dccf80 100644
--- a/libc/math/multc3.c
+++ b/libc/math/multc3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@redhat.com>, 2005.
@@ -39,28 +39,29 @@ __multc3 (long double a, long double b, long double c, long double d)
{
/* Recover infinities that computed as NaN + iNaN. */
bool recalc = 0;
- if (isinf (a) || isinf (b))
+ if (__isinf_nsl (a) || __isinf_nsl (b))
{
/* z is infinite. "Box" the infinity and change NaNs in
the other factor to 0. */
- a = __copysignl (isinf (a) ? 1 : 0, a);
- b = __copysignl (isinf (b) ? 1 : 0, b);
+ a = __copysignl (__isinf_nsl (a) ? 1 : 0, a);
+ b = __copysignl (__isinf_nsl (b) ? 1 : 0, b);
if (isnan (c)) c = __copysignl (0, c);
if (isnan (d)) d = __copysignl (0, d);
recalc = 1;
}
- if (isinf (c) || isinf (d))
+ if (__isinf_nsl (c) || __isinf_nsl (d))
{
/* w is infinite. "Box" the infinity and change NaNs in
the other factor to 0. */
- c = __copysignl (isinf (c) ? 1 : 0, c);
- d = __copysignl (isinf (d) ? 1 : 0, d);
+ c = __copysignl (__isinf_nsl (c) ? 1 : 0, c);
+ d = __copysignl (__isinf_nsl (d) ? 1 : 0, d);
if (isnan (a)) a = __copysignl (0, a);
if (isnan (b)) b = __copysignl (0, b);
recalc = 1;
}
if (!recalc
- && (isinf (ac) || isinf (bd) || isinf (ad) || isinf (bc)))
+ && (__isinf_nsl (ac) || __isinf_nsl (bd)
+ || __isinf_nsl (ad) || __isinf_nsl (bc)))
{
/* Recover infinities from overflow by changing NaNs to 0. */
if (isnan (a)) a = __copysignl (0, a);
diff --git a/libc/math/s_cacosh.c b/libc/math/s_cacosh.c
index ada7ca5af..bec6d3827 100644
--- a/libc/math/s_cacosh.c
+++ b/libc/math/s_cacosh.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole cosine for double value.
- Copyright (C) 1997, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ double
diff --git a/libc/math/s_cacoshf.c b/libc/math/s_cacoshf.c
index a062ffc6f..0d6bd75dd 100644
--- a/libc/math/s_cacoshf.c
+++ b/libc/math/s_cacoshf.c
@@ -21,7 +21,7 @@
#include <complex.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
__cacoshf (__complex__ float x)
diff --git a/libc/math/s_cacoshl.c b/libc/math/s_cacoshl.c
index da23c8d8a..36f7a5f70 100644
--- a/libc/math/s_cacoshl.c
+++ b/libc/math/s_cacoshl.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole cosine for long double value.
- Copyright (C) 1997, 1998, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ long double
diff --git a/libc/math/s_casin.c b/libc/math/s_casin.c
index 2d5b06cf7..02a215ab5 100644
--- a/libc/math/s_casin.c
+++ b/libc/math/s_casin.c
@@ -1,5 +1,5 @@
/* Return arc sine of complex double value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ double
@@ -33,7 +34,7 @@ __casin (__complex__ double x)
{
res = x;
}
- else if (__isinf (__real__ x) || __isinf (__imag__ x))
+ else if (__isinf_ns (__real__ x) || __isinf_ns (__imag__ x))
{
__real__ res = __nan ("");
__imag__ res = __copysign (HUGE_VAL, __imag__ x);
diff --git a/libc/math/s_casinf.c b/libc/math/s_casinf.c
index 5278dbbf7..56c618fcf 100644
--- a/libc/math/s_casinf.c
+++ b/libc/math/s_casinf.c
@@ -1,5 +1,5 @@
/* Return arc sine of complex float value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ float
@@ -33,7 +34,7 @@ __casinf (__complex__ float x)
{
res = x;
}
- else if (__isinff (__real__ x) || __isinff (__imag__ x))
+ else if (__isinf_nsf (__real__ x) || __isinf_nsf (__imag__ x))
{
__real__ res = __nanf ("");
__imag__ res = __copysignf (HUGE_VALF, __imag__ x);
diff --git a/libc/math/s_casinh.c b/libc/math/s_casinh.c
index a574add70..db340ac1b 100644
--- a/libc/math/s_casinh.c
+++ b/libc/math/s_casinh.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole sine for double value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ double
diff --git a/libc/math/s_casinhf.c b/libc/math/s_casinhf.c
index 7037ab937..f545d8e2e 100644
--- a/libc/math/s_casinhf.c
+++ b/libc/math/s_casinhf.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole sine for float value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ float
diff --git a/libc/math/s_casinhl.c b/libc/math/s_casinhl.c
index 376b2347a..b8e391829 100644
--- a/libc/math/s_casinhl.c
+++ b/libc/math/s_casinhl.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole sine for long double value.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ long double
diff --git a/libc/math/s_casinl.c b/libc/math/s_casinl.c
index f303c05ae..431e9a241 100644
--- a/libc/math/s_casinl.c
+++ b/libc/math/s_casinl.c
@@ -1,5 +1,5 @@
/* Return arc sine of complex long double value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <complex.h>
#include <math.h>
+#include <math_private.h>
__complex__ long double
@@ -33,7 +34,7 @@ __casinl (__complex__ long double x)
{
res = x;
}
- else if (__isinfl (__real__ x) || __isinfl (__imag__ x))
+ else if (__isinf_nsl (__real__ x) || __isinf_nsl (__imag__ x))
{
__real__ res = __nanl ("");
__imag__ res = __copysignl (HUGE_VALL, __imag__ x);
diff --git a/libc/math/s_catan.c b/libc/math/s_catan.c
index 1d0673ad6..1a458a383 100644
--- a/libc/math/s_catan.c
+++ b/libc/math/s_catan.c
@@ -1,5 +1,5 @@
/* Return arc tangent of complex double value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -31,7 +30,7 @@ __catan (__complex__ double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (rcls == FP_INFINITE)
{
@@ -57,7 +56,7 @@ __catan (__complex__ double x)
__imag__ res = __nan ("");
}
}
- else if (rcls == FP_ZERO && icls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
res = x;
}
diff --git a/libc/math/s_catanf.c b/libc/math/s_catanf.c
index 25eec2b1b..defcf18c6 100644
--- a/libc/math/s_catanf.c
+++ b/libc/math/s_catanf.c
@@ -1,5 +1,5 @@
/* Return arc tangent of complex float value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -31,7 +30,7 @@ __catanf (__complex__ float x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (rcls == FP_INFINITE)
{
@@ -57,7 +56,7 @@ __catanf (__complex__ float x)
__imag__ res = __nanf ("");
}
}
- else if (rcls == FP_ZERO && icls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
res = x;
}
diff --git a/libc/math/s_catanh.c b/libc/math/s_catanh.c
index e15c073f9..22ade15fa 100644
--- a/libc/math/s_catanh.c
+++ b/libc/math/s_catanh.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole tangent for double value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -31,7 +30,7 @@ __catanh (__complex__ double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (icls == FP_INFINITE)
{
@@ -52,20 +51,18 @@ __catanh (__complex__ double x)
__imag__ res = __nan ("");
}
}
- else if (rcls == FP_ZERO && icls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
res = x;
}
else
{
- double i2, num, den;
-
- i2 = __imag__ x * __imag__ x;
+ double i2 = __imag__ x * __imag__ x;
- num = 1.0 + __real__ x;
+ double num = 1.0 + __real__ x;
num = i2 + num * num;
- den = 1.0 - __real__ x;
+ double den = 1.0 - __real__ x;
den = i2 + den * den;
__real__ res = 0.25 * (__ieee754_log (num) - __ieee754_log (den));
diff --git a/libc/math/s_catanhf.c b/libc/math/s_catanhf.c
index d2422e611..f3d07f235 100644
--- a/libc/math/s_catanhf.c
+++ b/libc/math/s_catanhf.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole tangent for float value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -31,7 +30,7 @@ __catanhf (__complex__ float x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (icls == FP_INFINITE)
{
@@ -52,20 +51,18 @@ __catanhf (__complex__ float x)
__imag__ res = __nanf ("");
}
}
- else if (rcls == FP_ZERO && icls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
res = x;
}
else
{
- float i2, num, den;
-
- i2 = __imag__ x * __imag__ x;
+ float i2 = __imag__ x * __imag__ x;
- num = 1.0 + __real__ x;
+ float num = 1.0 + __real__ x;
num = i2 + num * num;
- den = 1.0 - __real__ x;
+ float den = 1.0 - __real__ x;
den = i2 + den * den;
__real__ res = 0.25 * (__ieee754_logf (num) - __ieee754_logf (den));
diff --git a/libc/math/s_catanhl.c b/libc/math/s_catanhl.c
index c3fb0ce5f..af48f1a55 100644
--- a/libc/math/s_catanhl.c
+++ b/libc/math/s_catanhl.c
@@ -1,5 +1,5 @@
/* Return arc hyperbole tangent for long double value.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -31,7 +30,7 @@ __catanhl (__complex__ long double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (icls == FP_INFINITE)
{
@@ -52,20 +51,18 @@ __catanhl (__complex__ long double x)
__imag__ res = __nanl ("");
}
}
- else if (rcls == FP_ZERO && icls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
res = x;
}
else
{
- long double i2, num, den;
-
- i2 = __imag__ x * __imag__ x;
+ long double i2 = __imag__ x * __imag__ x;
- num = 1.0 + __real__ x;
+ long double num = 1.0 + __real__ x;
num = i2 + num * num;
- den = 1.0 - __real__ x;
+ long double den = 1.0 - __real__ x;
den = i2 + den * den;
__real__ res = 0.25 * (__ieee754_logl (num) - __ieee754_logl (den));
diff --git a/libc/math/s_catanl.c b/libc/math/s_catanl.c
index 6cb45e5be..47df85cc7 100644
--- a/libc/math/s_catanl.c
+++ b/libc/math/s_catanl.c
@@ -1,5 +1,5 @@
/* Return arc tangent of complex long double value.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -31,7 +30,7 @@ __catanl (__complex__ long double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (rcls == FP_INFINITE)
{
@@ -57,7 +56,7 @@ __catanl (__complex__ long double x)
__imag__ res = __nanl ("");
}
}
- else if (rcls == FP_ZERO && icls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
res = x;
}
diff --git a/libc/math/s_ccos.c b/libc/math/s_ccos.c
index 1b244d707..4612eb33c 100644
--- a/libc/math/s_ccos.c
+++ b/libc/math/s_ccos.c
@@ -1,5 +1,5 @@
/* Return cosine of complex double value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,57 +21,18 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
+#include <math_private.h>
__complex__ double
__ccos (__complex__ double x)
{
- __complex__ double res;
+ __complex__ double y;
- if (!isfinite (__real__ x) || __isnan (__imag__ x))
- {
- if (__real__ x == 0.0 || __imag__ x == 0.0)
- {
- __real__ res = __nan ("");
- __imag__ res = 0.0;
+ __real__ y = -__imag__ x;
+ __imag__ y = __real__ x;
-#ifdef FE_INVALID
- if (__isinf (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else if (__isinf (__imag__ x))
- {
- __real__ res = HUGE_VAL;
- __imag__ res = __nan ("");
-
-#ifdef FE_INVALID
- if (__isinf (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else
- {
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
-
-#ifdef FE_INVALID
- if (isfinite (__imag__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- }
- else
- {
- __complex__ double y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- res = __ccosh (y);
- }
-
- return res;
+ return __ccosh (y);
}
weak_alias (__ccos, ccos)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/s_ccosf.c b/libc/math/s_ccosf.c
index 4b154deac..1ee932486 100644
--- a/libc/math/s_ccosf.c
+++ b/libc/math/s_ccosf.c
@@ -1,5 +1,5 @@
/* Return cosine of complex float value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,57 +21,18 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
+#include <math_private.h>
__complex__ float
__ccosf (__complex__ float x)
{
- __complex__ float res;
+ __complex__ float y;
- if (!isfinite (__real__ x) || __isnanf (__imag__ x))
- {
- if (__real__ x == 0.0 || __imag__ x == 0.0)
- {
- __real__ res = __nanf ("");
- __imag__ res = 0.0;
+ __real__ y = -__imag__ x;
+ __imag__ y = __real__ x;
-#ifdef FE_INVALID
- if (__isinff (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else if (__isinff (__imag__ x))
- {
- __real__ res = HUGE_VALF;
- __imag__ res = __nanf ("");
-
-#ifdef FE_INVALID
- if (__isinff (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else
- {
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
-
-#ifdef FE_INVALID
- if (isfinite (__imag__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- }
- else
- {
- __complex__ float y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- res = __ccoshf (y);
- }
-
- return res;
+ return __ccoshf (y);
}
#ifndef __ccosf
weak_alias (__ccosf, ccosf)
diff --git a/libc/math/s_ccosh.c b/libc/math/s_ccosh.c
index f5b29db24..c10e5d899 100644
--- a/libc/math/s_ccosh.c
+++ b/libc/math/s_ccosh.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function for double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -32,10 +32,10 @@ __ccosh (__complex__ double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
double sinh_val = __ieee754_sinh (__real__ x);
@@ -52,22 +52,14 @@ __ccosh (__complex__ double x)
__imag__ retval = __real__ x == 0.0 ? 0.0 : __nan ("");
__real__ retval = __nan ("") + __nan ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
else if (rcls == FP_INFINITE)
{
/* Real part is infinite. */
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = HUGE_VAL;
- __imag__ retval = __imag__ x * __copysign (1.0, __real__ x);
- }
- else if (icls > FP_ZERO)
+ if (__builtin_expect (icls > FP_ZERO, 1))
{
/* Imaginary part is finite. */
double sinix, cosix;
@@ -78,16 +70,20 @@ __ccosh (__complex__ double x)
__imag__ retval = (__copysign (HUGE_VAL, sinix)
* __copysign (1.0, __real__ x));
}
+ else if (icls == FP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = HUGE_VAL;
+ __imag__ retval = __imag__ x * __copysign (1.0, __real__ x);
+ }
else
{
/* The addition raises the invalid exception. */
__real__ retval = HUGE_VAL;
__imag__ retval = __nan ("") + __nan ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ccoshf.c b/libc/math/s_ccoshf.c
index f400d34f0..6aae5d854 100644
--- a/libc/math/s_ccoshf.c
+++ b/libc/math/s_ccoshf.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function for float.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -32,10 +32,10 @@ __ccoshf (__complex__ float x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
float sinh_val = __ieee754_sinhf (__real__ x);
@@ -52,22 +52,14 @@ __ccoshf (__complex__ float x)
__imag__ retval = __real__ x == 0.0 ? 0.0 : __nanf ("");
__real__ retval = __nanf ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
- else if (rcls == FP_INFINITE)
+ else if (__builtin_expect (rcls == FP_INFINITE, 1))
{
/* Real part is infinite. */
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = HUGE_VALF;
- __imag__ retval = __imag__ x * __copysignf (1.0, __real__ x);
- }
- else if (icls > FP_ZERO)
+ if (__builtin_expect (icls > FP_ZERO, 1))
{
/* Imaginary part is finite. */
float sinix, cosix;
@@ -78,6 +70,12 @@ __ccoshf (__complex__ float x)
__imag__ retval = (__copysignf (HUGE_VALF, sinix)
* __copysignf (1.0, __real__ x));
}
+ else if (icls == FP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = HUGE_VALF;
+ __imag__ retval = __imag__ x * __copysignf (1.0, __real__ x);
+ }
else
{
/* The addition raises the invalid exception. */
diff --git a/libc/math/s_ccoshl.c b/libc/math/s_ccoshl.c
index 61ffb49ca..ed1bc459d 100644
--- a/libc/math/s_ccoshl.c
+++ b/libc/math/s_ccoshl.c
@@ -1,5 +1,5 @@
/* Complex cosine hyperbole function for long double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -32,10 +32,10 @@ __ccoshl (__complex__ long double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
long double sinh_val = __ieee754_sinhl (__real__ x);
@@ -52,22 +52,14 @@ __ccoshl (__complex__ long double x)
__imag__ retval = __real__ x == 0.0 ? 0.0 : __nanl ("");
__real__ retval = __nanl ("") + __nanl ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
- else if (rcls == FP_INFINITE)
+ else if (__builtin_expect (rcls == FP_INFINITE, 1))
{
/* Real part is infinite. */
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = HUGE_VALL;
- __imag__ retval = __imag__ x * __copysignl (1.0, __real__ x);
- }
- else if (icls > FP_ZERO)
+ if (__builtin_expect (icls > FP_ZERO, 1))
{
/* Imaginary part is finite. */
long double sinix, cosix;
@@ -78,16 +70,20 @@ __ccoshl (__complex__ long double x)
__imag__ retval = (__copysignl (HUGE_VALL, sinix)
* __copysignl (1.0, __real__ x));
}
+ else if (icls == FP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = HUGE_VALL;
+ __imag__ retval = __imag__ x * __copysignl (1.0, __real__ x);
+ }
else
{
/* The addition raises the invalid exception. */
__real__ retval = HUGE_VALL;
__imag__ retval = __nanl ("") + __nanl ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ccosl.c b/libc/math/s_ccosl.c
index 4ebe2c347..153a60b08 100644
--- a/libc/math/s_ccosl.c
+++ b/libc/math/s_ccosl.c
@@ -1,5 +1,5 @@
/* Return cosine of complex long double value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,56 +21,17 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
+#include <math_private.h>
__complex__ long double
__ccosl (__complex__ long double x)
{
- __complex__ long double res;
+ __complex__ long double y;
- if (!isfinite (__real__ x) || __isnanl (__imag__ x))
- {
- if (__real__ x == 0.0 || __imag__ x == 0.0)
- {
- __real__ res = __nanl ("");
- __imag__ res = 0.0;
+ __real__ y = -__imag__ x;
+ __imag__ y = __real__ x;
-#ifdef FE_INVALID
- if (__isinfl (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else if (__isinfl (__imag__ x))
- {
- __real__ res = HUGE_VALL;
- __imag__ res = __nanl ("");
-
-#ifdef FE_INVALID
- if (__isinfl (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
-
-#ifdef FE_INVALID
- if (isfinite (__imag__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- }
- else
- {
- __complex__ long double y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- res = __ccoshl (y);
- }
-
- return res;
+ return __ccoshl (y);
}
weak_alias (__ccosl, ccosl)
diff --git a/libc/math/s_cexp.c b/libc/math/s_cexp.c
index 5a299b768..0d1ec2985 100644
--- a/libc/math/s_cexp.c
+++ b/libc/math/s_cexp.c
@@ -1,5 +1,5 @@
/* Return value of complex exponential function for double complex value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -32,10 +31,10 @@ __cexp (__complex__ double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
double exp_val = __ieee754_exp (__real__ x);
@@ -61,15 +60,13 @@ __cexp (__complex__ double x)
__real__ retval = __nan ("");
__imag__ retval = __nan ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
- else if (rcls == FP_INFINITE)
+ else if (__builtin_expect (rcls == FP_INFINITE, 1))
{
/* Real part is infinite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
double value = signbit (__real__ x) ? 0.0 : HUGE_VAL;
@@ -95,10 +92,8 @@ __cexp (__complex__ double x)
__real__ retval = HUGE_VAL;
__imag__ retval = __nan ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
@@ -112,10 +107,8 @@ __cexp (__complex__ double x)
__real__ retval = __nan ("");
__imag__ retval = __nan ("");
-#ifdef FE_INVALID
if (rcls != FP_NAN || icls != FP_NAN)
feraiseexcept (FE_INVALID);
-#endif
}
return retval;
diff --git a/libc/math/s_cexpf.c b/libc/math/s_cexpf.c
index 7b68fc365..652fe3d5b 100644
--- a/libc/math/s_cexpf.c
+++ b/libc/math/s_cexpf.c
@@ -1,5 +1,5 @@
/* Return value of complex exponential function for float complex value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -32,10 +31,10 @@ __cexpf (__complex__ float x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
float exp_val = __ieee754_expf (__real__ x);
@@ -61,15 +60,13 @@ __cexpf (__complex__ float x)
__real__ retval = __nanf ("");
__imag__ retval = __nanf ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
- else if (rcls == FP_INFINITE)
+ else if (__builtin_expect (rcls == FP_INFINITE, 1))
{
/* Real part is infinite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
float value = signbit (__real__ x) ? 0.0 : HUGE_VALF;
@@ -95,10 +92,8 @@ __cexpf (__complex__ float x)
__real__ retval = HUGE_VALF;
__imag__ retval = __nanf ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
@@ -112,10 +107,8 @@ __cexpf (__complex__ float x)
__real__ retval = __nanf ("");
__imag__ retval = __nanf ("");
-#ifdef FE_INVALID
if (rcls != FP_NAN || icls != FP_NAN)
feraiseexcept (FE_INVALID);
-#endif
}
return retval;
diff --git a/libc/math/s_cexpl.c b/libc/math/s_cexpl.c
index cf6bc974a..6bb56c02f 100644
--- a/libc/math/s_cexpl.c
+++ b/libc/math/s_cexpl.c
@@ -1,5 +1,5 @@
/* Return value of complex exponential function for long double complex value.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -32,10 +31,10 @@ __cexpl (__complex__ long double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
long double exp_val = __ieee754_expl (__real__ x);
@@ -61,15 +60,13 @@ __cexpl (__complex__ long double x)
__real__ retval = __nanl ("");
__imag__ retval = __nanl ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
- else if (rcls == FP_INFINITE)
+ else if (__builtin_expect (rcls == FP_INFINITE, 1))
{
/* Real part is infinite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
long double value = signbit (__real__ x) ? 0.0 : HUGE_VALL;
@@ -95,10 +92,8 @@ __cexpl (__complex__ long double x)
__real__ retval = HUGE_VALL;
__imag__ retval = __nanl ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
@@ -112,10 +107,8 @@ __cexpl (__complex__ long double x)
__real__ retval = __nanl ("");
__imag__ retval = __nanl ("");
-#ifdef FE_INVALID
if (rcls != FP_NAN || icls != FP_NAN)
feraiseexcept (FE_INVALID);
-#endif
}
return retval;
diff --git a/libc/math/s_clog.c b/libc/math/s_clog.c
index f796024b4..ba27140b4 100644
--- a/libc/math/s_clog.c
+++ b/libc/math/s_clog.c
@@ -1,5 +1,5 @@
/* Compute complex natural logarithm.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -31,7 +30,7 @@ __clog (__complex__ double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls == FP_ZERO && icls == FP_ZERO)
+ if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -39,7 +38,7 @@ __clog (__complex__ double x)
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabs (__real__ x);
}
- else if (rcls != FP_NAN && icls != FP_NAN)
+ else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
__real__ result = __ieee754_log (__ieee754_hypot (__real__ x,
diff --git a/libc/math/s_clog10.c b/libc/math/s_clog10.c
index 62c2ca724..4b741fab5 100644
--- a/libc/math/s_clog10.c
+++ b/libc/math/s_clog10.c
@@ -1,5 +1,5 @@
/* Compute complex base 10 logarithm.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -31,7 +30,7 @@ __clog10 (__complex__ double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls == FP_ZERO && icls == FP_ZERO)
+ if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -39,7 +38,7 @@ __clog10 (__complex__ double x)
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabs (__real__ x);
}
- else if (rcls != FP_NAN && icls != FP_NAN)
+ else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
__real__ result = __ieee754_log10 (__ieee754_hypot (__real__ x,
diff --git a/libc/math/s_clog10f.c b/libc/math/s_clog10f.c
index eed81f368..fe38f9e8d 100644
--- a/libc/math/s_clog10f.c
+++ b/libc/math/s_clog10f.c
@@ -1,5 +1,5 @@
/* Compute complex base 10 logarithm.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -31,7 +30,7 @@ __clog10f (__complex__ float x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls == FP_ZERO && icls == FP_ZERO)
+ if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -39,7 +38,7 @@ __clog10f (__complex__ float x)
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsf (__real__ x);
}
- else if (rcls != FP_NAN && icls != FP_NAN)
+ else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
__real__ result = __ieee754_log10f (__ieee754_hypotf (__real__ x,
diff --git a/libc/math/s_clog10l.c b/libc/math/s_clog10l.c
index f901543d0..990913e7b 100644
--- a/libc/math/s_clog10l.c
+++ b/libc/math/s_clog10l.c
@@ -1,5 +1,5 @@
/* Compute complex base 10 logarithm.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -31,7 +30,7 @@ __clog10l (__complex__ long double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls == FP_ZERO && icls == FP_ZERO)
+ if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
@@ -39,7 +38,7 @@ __clog10l (__complex__ long double x)
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsl (__real__ x);
}
- else if (rcls != FP_NAN && icls != FP_NAN)
+ else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
__real__ result = __ieee754_log10l (__ieee754_hypotl (__real__ x,
diff --git a/libc/math/s_clogf.c b/libc/math/s_clogf.c
index 21e3b57b7..fdda83e54 100644
--- a/libc/math/s_clogf.c
+++ b/libc/math/s_clogf.c
@@ -1,5 +1,5 @@
/* Compute complex natural logarithm.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,7 +21,7 @@
#include <complex.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -31,7 +31,7 @@ __clogf (__complex__ float x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls == FP_ZERO && icls == FP_ZERO)
+ if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PI : 0.0;
@@ -39,7 +39,7 @@ __clogf (__complex__ float x)
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsf (__real__ x);
}
- else if (rcls != FP_NAN && icls != FP_NAN)
+ else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
__real__ result = __ieee754_logf (__ieee754_hypotf (__real__ x,
diff --git a/libc/math/s_clogl.c b/libc/math/s_clogl.c
index 43118f768..396ba9180 100644
--- a/libc/math/s_clogl.c
+++ b/libc/math/s_clogl.c
@@ -1,5 +1,5 @@
/* Compute complex natural logarithm.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,8 +20,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -31,7 +30,7 @@ __clogl (__complex__ long double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls == FP_ZERO && icls == FP_ZERO)
+ if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
{
/* Real and imaginary part are 0.0. */
__imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
@@ -39,7 +38,7 @@ __clogl (__complex__ long double x)
/* Yes, the following line raises an exception. */
__real__ result = -1.0 / fabsl (__real__ x);
}
- else if (rcls != FP_NAN && icls != FP_NAN)
+ else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
{
/* Neither real nor imaginary part is NaN. */
__real__ result = __ieee754_logl (__ieee754_hypotl (__real__ x,
diff --git a/libc/math/s_csin.c b/libc/math/s_csin.c
index eb380e2c3..07a78c438 100644
--- a/libc/math/s_csin.c
+++ b/libc/math/s_csin.c
@@ -1,5 +1,5 @@
/* Complex sine function for double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -35,10 +35,10 @@ __csin (__complex__ double x)
__real__ x = fabs (__real__ x);
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
double sinh_val = __ieee754_sinh (__imag__ x);
@@ -61,19 +61,15 @@ __csin (__complex__ double x)
__real__ retval = __nan ("");
__imag__ retval = __imag__ x;
-#ifdef FE_INVALID
if (rcls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
__real__ retval = __nan ("");
__imag__ retval = __nan ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
}
@@ -107,10 +103,8 @@ __csin (__complex__ double x)
__real__ retval = __nan ("");
__imag__ retval = HUGE_VAL;
-#ifdef FE_INVALID
if (rcls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_csinf.c b/libc/math/s_csinf.c
index 8004743bd..4f4dfb8ea 100644
--- a/libc/math/s_csinf.c
+++ b/libc/math/s_csinf.c
@@ -1,5 +1,5 @@
/* Complex sine function for float.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -35,10 +35,10 @@ __csinf (__complex__ float x)
__real__ x = fabsf (__real__ x);
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
float sinh_val = __ieee754_sinhf (__imag__ x);
@@ -61,19 +61,15 @@ __csinf (__complex__ float x)
__real__ retval = __nanf ("");
__imag__ retval = __imag__ x;
-#ifdef FE_INVALID
if (rcls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
__real__ retval = __nanf ("");
__imag__ retval = __nanf ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
}
@@ -107,10 +103,8 @@ __csinf (__complex__ float x)
__real__ retval = __nanf ("");
__imag__ retval = HUGE_VALF;
-#ifdef FE_INVALID
if (rcls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_csinh.c b/libc/math/s_csinh.c
index f0e0cc61f..2eec065a8 100644
--- a/libc/math/s_csinh.c
+++ b/libc/math/s_csinh.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function for double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -35,10 +35,10 @@ __csinh (__complex__ double x)
__real__ x = fabs (__real__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
double sinh_val = __ieee754_sinh (__real__ x);
@@ -61,32 +61,22 @@ __csinh (__complex__ double x)
__real__ retval = __copysign (0.0, negate ? -1.0 : 1.0);
__imag__ retval = __nan ("") + __nan ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
__real__ retval = __nan ("");
__imag__ retval = __nan ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
}
else if (rcls == FP_INFINITE)
{
/* Real part is infinite. */
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = negate ? -HUGE_VAL : HUGE_VAL;
- __imag__ retval = __imag__ x;
- }
- else if (icls > FP_ZERO)
+ if (__builtin_expect (icls > FP_ZERO, 1))
{
/* Imaginary part is finite. */
double sinix, cosix;
@@ -99,16 +89,20 @@ __csinh (__complex__ double x)
if (negate)
__real__ retval = -__real__ retval;
}
+ else if (icls == FP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = negate ? -HUGE_VAL : HUGE_VAL;
+ __imag__ retval = __imag__ x;
+ }
else
{
/* The addition raises the invalid exception. */
__real__ retval = HUGE_VAL;
__imag__ retval = __nan ("") + __nan ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_csinhf.c b/libc/math/s_csinhf.c
index e4bb70426..51e837b14 100644
--- a/libc/math/s_csinhf.c
+++ b/libc/math/s_csinhf.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function for float.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -35,10 +35,10 @@ __csinhf (__complex__ float x)
__real__ x = fabsf (__real__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
float sinh_val = __ieee754_sinhf (__real__ x);
@@ -61,32 +61,22 @@ __csinhf (__complex__ float x)
__real__ retval = __copysignf (0.0, negate ? -1.0 : 1.0);
__imag__ retval = __nanf ("") + __nanf ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
__real__ retval = __nanf ("");
__imag__ retval = __nanf ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
}
- else if (rcls == FP_INFINITE)
+ else if (__builtin_expect (rcls == FP_INFINITE, 1))
{
/* Real part is infinite. */
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = negate ? -HUGE_VALF : HUGE_VALF;
- __imag__ retval = __imag__ x;
- }
- else if (icls > FP_ZERO)
+ if (__builtin_expect (icls > FP_ZERO, 1))
{
/* Imaginary part is finite. */
float sinix, cosix;
@@ -99,6 +89,12 @@ __csinhf (__complex__ float x)
if (negate)
__real__ retval = -__real__ retval;
}
+ else if (icls == FP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = negate ? -HUGE_VALF : HUGE_VALF;
+ __imag__ retval = __imag__ x;
+ }
else
{
/* The addition raises the invalid exception. */
diff --git a/libc/math/s_csinhl.c b/libc/math/s_csinhl.c
index 226075634..d2964f8a2 100644
--- a/libc/math/s_csinhl.c
+++ b/libc/math/s_csinhl.c
@@ -1,5 +1,5 @@
/* Complex sine hyperbole function for long double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -35,10 +35,10 @@ __csinhl (__complex__ long double x)
__real__ x = fabsl (__real__ x);
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
long double sinh_val = __ieee754_sinhl (__real__ x);
@@ -61,32 +61,22 @@ __csinhl (__complex__ long double x)
__real__ retval = __copysignl (0.0, negate ? -1.0 : 1.0);
__imag__ retval = __nanl ("") + __nanl ("");
-#ifdef FE_INVALID
if (icls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
__real__ retval = __nanl ("");
__imag__ retval = __nanl ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
}
- else if (rcls == FP_INFINITE)
+ else if (__builtin_expect (rcls == FP_INFINITE, 1))
{
/* Real part is infinite. */
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = negate ? -HUGE_VALL : HUGE_VALL;
- __imag__ retval = __imag__ x;
- }
- else if (icls > FP_ZERO)
+ if (__builtin_expect (icls > FP_ZERO, 1))
{
/* Imaginary part is finite. */
long double sinix, cosix;
@@ -99,6 +89,12 @@ __csinhl (__complex__ long double x)
if (negate)
__real__ retval = -__real__ retval;
}
+ else if (icls == FP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = negate ? -HUGE_VALL : HUGE_VALL;
+ __imag__ retval = __imag__ x;
+ }
else
{
/* The addition raises the invalid exception. */
diff --git a/libc/math/s_csinl.c b/libc/math/s_csinl.c
index f7a1c4360..300035c69 100644
--- a/libc/math/s_csinl.c
+++ b/libc/math/s_csinl.c
@@ -1,5 +1,5 @@
/* Complex sine function for long double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -35,10 +35,10 @@ __csinl (__complex__ long double x)
__real__ x = fabsl (__real__ x);
- if (icls >= FP_ZERO)
+ if (__builtin_expect (icls >= FP_ZERO, 1))
{
/* Imaginary part is finite. */
- if (rcls >= FP_ZERO)
+ if (__builtin_expect (rcls >= FP_ZERO, 1))
{
/* Real part is finite. */
long double sinh_val = __ieee754_sinhl (__imag__ x);
@@ -61,19 +61,15 @@ __csinl (__complex__ long double x)
__real__ retval = __nanl ("");
__imag__ retval = __imag__ x;
-#ifdef FE_INVALID
if (rcls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
else
{
__real__ retval = __nanl ("");
__imag__ retval = __nanl ("");
-#ifdef FE_INVALID
feraiseexcept (FE_INVALID);
-#endif
}
}
}
@@ -107,10 +103,8 @@ __csinl (__complex__ long double x)
__real__ retval = __nanl ("");
__imag__ retval = HUGE_VALL;
-#ifdef FE_INVALID
if (rcls == FP_INFINITE)
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_csqrt.c b/libc/math/s_csqrt.c
index 04ed410a1..1691a01ec 100644
--- a/libc/math/s_csqrt.c
+++ b/libc/math/s_csqrt.c
@@ -1,5 +1,5 @@
/* Complex square root of double value.
- Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -32,7 +31,7 @@ __csqrt (__complex__ double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (icls == FP_INFINITE)
{
@@ -61,7 +60,7 @@ __csqrt (__complex__ double x)
}
else
{
- if (icls == FP_ZERO)
+ if (__builtin_expect (icls == FP_ZERO, 0))
{
if (__real__ x < 0.0)
{
@@ -75,7 +74,7 @@ __csqrt (__complex__ double x)
__imag__ res = __copysign (0.0, __imag__ x);
}
}
- else if (rcls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO, 0))
{
double r = __ieee754_sqrt (0.5 * fabs (__imag__ x));
diff --git a/libc/math/s_csqrtf.c b/libc/math/s_csqrtf.c
index 2fba69ce1..1613192a5 100644
--- a/libc/math/s_csqrtf.c
+++ b/libc/math/s_csqrtf.c
@@ -1,5 +1,5 @@
/* Complex square root of float value.
- Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -32,7 +31,7 @@ __csqrtf (__complex__ float x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (icls == FP_INFINITE)
{
@@ -61,7 +60,7 @@ __csqrtf (__complex__ float x)
}
else
{
- if (icls == FP_ZERO)
+ if (__builtin_expect (icls == FP_ZERO, 0))
{
if (__real__ x < 0.0)
{
@@ -75,7 +74,7 @@ __csqrtf (__complex__ float x)
__imag__ res = __copysignf (0.0, __imag__ x);
}
}
- else if (rcls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO, 0))
{
float r = __ieee754_sqrtf (0.5 * fabsf (__imag__ x));
diff --git a/libc/math/s_csqrtl.c b/libc/math/s_csqrtl.c
index 9d00946c5..9b93ef66b 100644
--- a/libc/math/s_csqrtl.c
+++ b/libc/math/s_csqrtl.c
@@ -1,5 +1,5 @@
/* Complex square root of long double value.
- Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -32,7 +31,7 @@ __csqrtl (__complex__ long double x)
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
+ if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
{
if (icls == FP_INFINITE)
{
@@ -61,7 +60,7 @@ __csqrtl (__complex__ long double x)
}
else
{
- if (icls == FP_ZERO)
+ if (__builtin_expect (icls == FP_ZERO, 0))
{
if (__real__ x < 0.0)
{
@@ -75,7 +74,7 @@ __csqrtl (__complex__ long double x)
__imag__ res = __copysignl (0.0, __imag__ x);
}
}
- else if (rcls == FP_ZERO)
+ else if (__builtin_expect (rcls == FP_ZERO, 0))
{
long double r = __ieee754_sqrtl (0.5 * fabsl (__imag__ x));
diff --git a/libc/math/s_ctan.c b/libc/math/s_ctan.c
index 0464ab86d..41958516f 100644
--- a/libc/math/s_ctan.c
+++ b/libc/math/s_ctan.c
@@ -1,5 +1,5 @@
/* Complex tangent function for double.
- Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -30,9 +30,9 @@ __ctan (__complex__ double x)
{
__complex__ double res;
- if (!isfinite (__real__ x) || !isfinite (__imag__ x))
+ if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
{
- if (__isinf (__imag__ x))
+ if (__isinf_ns (__imag__ x))
{
__real__ res = __copysign (0.0, __real__ x);
__imag__ res = __copysign (1.0, __imag__ x);
@@ -46,10 +46,8 @@ __ctan (__complex__ double x)
__real__ res = __nan ("");
__imag__ res = __nan ("");
-#ifdef FE_INVALID
- if (__isinf (__real__ x))
+ if (__isinf_ns (__real__ x))
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ctanf.c b/libc/math/s_ctanf.c
index 58d9d1329..7063e38d8 100644
--- a/libc/math/s_ctanf.c
+++ b/libc/math/s_ctanf.c
@@ -1,5 +1,5 @@
/* Complex tangent function for float.
- Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -30,9 +29,9 @@ __ctanf (__complex__ float x)
{
__complex__ float res;
- if (!isfinite (__real__ x) || !isfinite (__imag__ x))
+ if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
{
- if (__isinff (__imag__ x))
+ if (__isinf_nsf (__imag__ x))
{
__real__ res = __copysignf (0.0, __real__ x);
__imag__ res = __copysignf (1.0, __imag__ x);
@@ -46,10 +45,8 @@ __ctanf (__complex__ float x)
__real__ res = __nanf ("");
__imag__ res = __nanf ("");
-#ifdef FE_INVALID
- if (__isinff (__real__ x))
+ if (__isinf_nsf (__real__ x))
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ctanh.c b/libc/math/s_ctanh.c
index fe38dae29..9d31c43cd 100644
--- a/libc/math/s_ctanh.c
+++ b/libc/math/s_ctanh.c
@@ -1,5 +1,5 @@
/* Complex hyperbole tangent for double.
- Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ double
@@ -30,9 +29,9 @@ __ctanh (__complex__ double x)
{
__complex__ double res;
- if (!isfinite (__real__ x) || !isfinite (__imag__ x))
+ if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
{
- if (__isinf (__real__ x))
+ if (__isinf_ns (__real__ x))
{
__real__ res = __copysign (1.0, __real__ x);
__imag__ res = __copysign (0.0, __imag__ x);
@@ -46,10 +45,8 @@ __ctanh (__complex__ double x)
__real__ res = __nan ("");
__imag__ res = __nan ("");
-#ifdef FE_INVALID
- if (__isinf (__imag__ x))
+ if (__isinf_ns (__imag__ x))
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ctanhf.c b/libc/math/s_ctanhf.c
index c331dbaab..6cb3a2cc9 100644
--- a/libc/math/s_ctanhf.c
+++ b/libc/math/s_ctanhf.c
@@ -1,5 +1,5 @@
/* Complex hyperbole tangent for float.
- Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ float
@@ -30,9 +29,9 @@ __ctanhf (__complex__ float x)
{
__complex__ float res;
- if (!isfinite (__real__ x) || !isfinite (__imag__ x))
+ if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
{
- if (__isinff (__real__ x))
+ if (__isinf_nsf (__real__ x))
{
__real__ res = __copysignf (1.0, __real__ x);
__imag__ res = __copysignf (0.0, __imag__ x);
@@ -46,10 +45,8 @@ __ctanhf (__complex__ float x)
__real__ res = __nanf ("");
__imag__ res = __nanf ("");
-#ifdef FE_INVALID
- if (__isinff (__imag__ x))
+ if (__isinf_nsf (__imag__ x))
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ctanhl.c b/libc/math/s_ctanhl.c
index 77ca8f871..0c4641714 100644
--- a/libc/math/s_ctanhl.c
+++ b/libc/math/s_ctanhl.c
@@ -1,5 +1,5 @@
/* Complex hyperbole tangent for long double.
- Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,8 +21,7 @@
#include <complex.h>
#include <fenv.h>
#include <math.h>
-
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -30,9 +29,9 @@ __ctanhl (__complex__ long double x)
{
__complex__ long double res;
- if (!isfinite (__real__ x) || !isfinite (__imag__ x))
+ if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
{
- if (__isinfl (__real__ x))
+ if (__isinf_nsl (__real__ x))
{
__real__ res = __copysignl (1.0, __real__ x);
__imag__ res = __copysignl (0.0, __imag__ x);
@@ -46,10 +45,8 @@ __ctanhl (__complex__ long double x)
__real__ res = __nanl ("");
__imag__ res = __nanl ("");
-#ifdef FE_INVALID
- if (__isinfl (__imag__ x))
+ if (__isinf_nsl (__imag__ x))
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ctanl.c b/libc/math/s_ctanl.c
index 89379a5ff..6f49c57c9 100644
--- a/libc/math/s_ctanl.c
+++ b/libc/math/s_ctanl.c
@@ -1,5 +1,5 @@
/* Complex tangent function for long double.
- Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
__complex__ long double
@@ -30,9 +30,9 @@ __ctanl (__complex__ long double x)
{
__complex__ long double res;
- if (!isfinite (__real__ x) || !isfinite (__imag__ x))
+ if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0))
{
- if (__isinfl (__imag__ x))
+ if (__isinf_nsl (__imag__ x))
{
__real__ res = __copysignl (0.0, __real__ x);
__imag__ res = __copysignl (1.0, __imag__ x);
@@ -46,10 +46,8 @@ __ctanl (__complex__ long double x)
__real__ res = __nanl ("");
__imag__ res = __nanl ("");
-#ifdef FE_INVALID
- if (__isinfl (__real__ x))
+ if (__isinf_nsl (__real__ x))
feraiseexcept (FE_INVALID);
-#endif
}
}
else
diff --git a/libc/math/s_ldexp.c b/libc/math/s_ldexp.c
index 62e123cd0..e99021776 100644
--- a/libc/math/s_ldexp.c
+++ b/libc/math/s_ldexp.c
@@ -15,7 +15,7 @@ static char rcsid[] = "$NetBSD: s_ldexp.c,v 1.6 1995/05/10 20:47:40 jtc Exp $";
#endif
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#include <errno.h>
#ifdef __STDC__
diff --git a/libc/math/s_ldexpf.c b/libc/math/s_ldexpf.c
index 1ea5e09f8..f312bfe5f 100644
--- a/libc/math/s_ldexpf.c
+++ b/libc/math/s_ldexpf.c
@@ -18,7 +18,7 @@ static char rcsid[] = "$NetBSD: s_ldexpf.c,v 1.3 1995/05/10 20:47:42 jtc Exp $";
#endif
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#include <errno.h>
#ifdef __STDC__
diff --git a/libc/math/s_ldexpl.c b/libc/math/s_ldexpl.c
index df8b29f94..6a9ea4655 100644
--- a/libc/math/s_ldexpl.c
+++ b/libc/math/s_ldexpl.c
@@ -19,7 +19,7 @@ static char rcsid[] = "$NetBSD: $";
#endif
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#include <errno.h>
#ifdef __STDC__
diff --git a/libc/math/s_nan.c b/libc/math/s_nan.c
index 9b2c50558..97f9d898a 100644
--- a/libc/math/s_nan.c
+++ b/libc/math/s_nan.c
@@ -25,6 +25,7 @@
#include <ieee754.h>
+#undef __nan
double
__nan (const char *tagp)
{
diff --git a/libc/math/s_nanf.c b/libc/math/s_nanf.c
index 2e1b1eb91..6161bcdd2 100644
--- a/libc/math/s_nanf.c
+++ b/libc/math/s_nanf.c
@@ -25,6 +25,7 @@
#include <ieee754.h>
+#undef __nanf
float
__nanf (const char *tagp)
{
diff --git a/libc/math/s_nanl.c b/libc/math/s_nanl.c
index 9709b9238..1db246426 100644
--- a/libc/math/s_nanl.c
+++ b/libc/math/s_nanl.c
@@ -25,6 +25,7 @@
#include <ieee754.h>
+#undef __nanl
long double
__nanl (const char *tagp)
{
diff --git a/libc/math/s_significand.c b/libc/math/s_significand.c
index 4a02dbcba..197bc9c6e 100644
--- a/libc/math/s_significand.c
+++ b/libc/math/s_significand.c
@@ -21,7 +21,7 @@ static char rcsid[] = "$NetBSD: s_significand.c,v 1.6 1995/05/10 20:48:11 jtc Ex
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
double __significand(double x)
diff --git a/libc/math/s_significandf.c b/libc/math/s_significandf.c
index 69de1e6b0..7cbb961ea 100644
--- a/libc/math/s_significandf.c
+++ b/libc/math/s_significandf.c
@@ -18,7 +18,7 @@ static char rcsid[] = "$NetBSD: s_significandf.c,v 1.3 1995/05/10 20:48:13 jtc E
#endif
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
float __significandf(float x)
diff --git a/libc/math/s_significandl.c b/libc/math/s_significandl.c
index 238b79ae5..fab5b9fc8 100644
--- a/libc/math/s_significandl.c
+++ b/libc/math/s_significandl.c
@@ -25,7 +25,7 @@ static char rcsid[] = "$NetBSD: $";
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
long double __significandl(long double x)
diff --git a/libc/math/w_acos.c b/libc/math/w_acos.c
index f4e6e3c91..617cfdae4 100644
--- a/libc/math/w_acos.c
+++ b/libc/math/w_acos.c
@@ -1,45 +1,39 @@
-/* @(#)w_acos.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_acos.c,v 1.6 1995/05/10 20:48:26 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrap_acos(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __acos(double x) /* wrapper acos */
-#else
- double __acos(x) /* wrapper acos */
- double x;
-#endif
+/* wrapper acos */
+double
+__acos (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_acos(x);
-#else
- double z;
- z = __ieee754_acos(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- if(fabs(x)>1.0) {
- return __kernel_standard(x,x,1); /* acos(|x|>1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabs (x) > 1.0, 0) && _LIB_VERSION != _IEEE_)
+ {
+ /* acos(|x|>1) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 1);
+ }
+
+ return __ieee754_acos (x);
}
weak_alias (__acos, acos)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_acosf.c b/libc/math/w_acosf.c
index a8998efb8..bb3aae001 100644
--- a/libc/math/w_acosf.c
+++ b/libc/math/w_acosf.c
@@ -1,48 +1,38 @@
-/* w_acosf.c -- float version of w_acos.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_acosf.c,v 1.3 1995/05/10 20:48:29 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrap_acosf(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __acosf(float x) /* wrapper acosf */
-#else
- float __acosf(x) /* wrapper acosf */
- float x;
-#endif
+/* wrapper acosf */
+float
+__acosf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_acosf(x);
-#else
- float z;
- z = __ieee754_acosf(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- if(fabsf(x)>(float)1.0) {
- /* acosf(|x|>1) */
- return (float)__kernel_standard((double)x,(double)x,101);
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsf (x) > 1.0f, 0) && _LIB_VERSION != _IEEE_)
+ {
+ /* acos(|x|>1) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (x, x, 101);
+ }
+
+ return __ieee754_acosf (x);
}
weak_alias (__acosf, acosf)
diff --git a/libc/math/w_acosh.c b/libc/math/w_acosh.c
index e8322ec66..50201b4d2 100644
--- a/libc/math/w_acosh.c
+++ b/libc/math/w_acosh.c
@@ -1,44 +1,35 @@
-/* @(#)w_acosh.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_acosh.c,v 1.6 1995/05/10 20:48:31 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper acosh(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __acosh(double x) /* wrapper acosh */
-#else
- double __acosh(x) /* wrapper acosh */
- double x;
-#endif
+
+/* wrapper acosh */
+double
+__acosh (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_acosh(x);
-#else
- double z;
- z = __ieee754_acosh(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- if(x<1.0) {
- return __kernel_standard(x,x,29); /* acosh(x<1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x < 1.0, 0) && _LIB_VERSION != _IEEE_)
+ /* acosh(x<1) */
+ return __kernel_standard (x, x, 29);
+
+ return __ieee754_acosh (x);
}
weak_alias (__acosh, acosh)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_acoshf.c b/libc/math/w_acoshf.c
index 62f94b80e..2b07824a0 100644
--- a/libc/math/w_acoshf.c
+++ b/libc/math/w_acoshf.c
@@ -1,48 +1,34 @@
-/* w_acoshf.c -- float version of w_acosh.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- *
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_acoshf.c,v 1.3 1995/05/10 20:48:33 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper acoshf(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __acoshf(float x) /* wrapper acoshf */
-#else
- float __acoshf(x) /* wrapper acoshf */
- float x;
-#endif
+
+/* wrapper acoshf */
+float
+__acoshf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_acoshf(x);
-#else
- float z;
- z = __ieee754_acoshf(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- if(x<(float)1.0) {
- /* acosh(x<1) */
- return (float)__kernel_standard((double)x,(double)x,129);
- } else
- return z;
-#endif
+ if (__builtin_expect (x < 1.0f, 0) && _LIB_VERSION != _IEEE_)
+ /* acosh(x<1) */
+ return __kernel_standard_f (x, x, 129);
+
+ return __ieee754_acoshf (x);
}
weak_alias (__acoshf, acoshf)
diff --git a/libc/math/w_acoshl.c b/libc/math/w_acoshl.c
index ae67911ae..0f7068a96 100644
--- a/libc/math/w_acoshl.c
+++ b/libc/math/w_acoshl.c
@@ -1,47 +1,34 @@
-/* w_acoshl.c -- long double version of w_acosh.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper acoshl(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __acoshl(long double x) /* wrapper acosh */
-#else
- long double __acoshl(x) /* wrapper acosh */
- long double x;
-#endif
+
+/* wrapper acosl */
+long double
+__acoshl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_acoshl(x);
-#else
- long double z;
- z = __ieee754_acoshl(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- if(x<1.0) {
- return __kernel_standard(x,x,229); /* acoshl(x<1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x < 1.0L, 0) && _LIB_VERSION != _IEEE_)
+ /* acosh(x<1) */
+ return __kernel_standard (x, x, 229);
+
+ return __ieee754_acoshl (x);
}
weak_alias (__acoshl, acoshl)
diff --git a/libc/math/w_acosl.c b/libc/math/w_acosl.c
index 9ab4de899..dd1039ec8 100644
--- a/libc/math/w_acosl.c
+++ b/libc/math/w_acosl.c
@@ -1,48 +1,38 @@
-/* w_acosl.c -- long double version of w_acos.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrap_acosl(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __acosl(long double x) /* wrapper acos */
-#else
- long double __acosl(x) /* wrapper acos */
- long double x;
-#endif
+/* wrapper acosl */
+long double
+__acosl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_acosl(x);
-#else
- long double z;
- z = __ieee754_acosl(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- if(fabsl(x)>1.0) {
- return __kernel_standard(x,x,201); /* acosl(|x|>1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsl (x) > 1.0L, 0) && _LIB_VERSION != _IEEE_)
+ {
+ /* acos(|x|>1) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 201);
+ }
+
+ return __ieee754_acosl (x);
}
weak_alias (__acosl, acosl)
diff --git a/libc/math/w_asin.c b/libc/math/w_asin.c
index d531fbd26..feb5c6aaf 100644
--- a/libc/math/w_asin.c
+++ b/libc/math/w_asin.c
@@ -1,46 +1,39 @@
-/* @(#)w_asin.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_asin.c,v 1.6 1995/05/10 20:48:35 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-/*
- * wrapper asin(x)
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __asin(double x) /* wrapper asin */
-#else
- double __asin(x) /* wrapper asin */
- double x;
-#endif
+/* wrapper asin */
+double
+__asin (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_asin(x);
-#else
- double z;
- z = __ieee754_asin(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- if(fabs(x)>1.0) {
- return __kernel_standard(x,x,2); /* asin(|x|>1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabs (x) > 1.0, 0) && _LIB_VERSION != _IEEE_)
+ {
+ /* asin(|x|>1) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 2);
+ }
+
+ return __ieee754_asin (x);
}
weak_alias (__asin, asin)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_asinf.c b/libc/math/w_asinf.c
index b19b5c54e..1a21dc389 100644
--- a/libc/math/w_asinf.c
+++ b/libc/math/w_asinf.c
@@ -1,49 +1,38 @@
-/* w_asinf.c -- float version of w_asin.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_asinf.c,v 1.3 1995/05/10 20:48:37 jtc Exp $";
-#endif
-
-/*
- * wrapper asinf(x)
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __asinf(float x) /* wrapper asinf */
-#else
- float __asinf(x) /* wrapper asinf */
- float x;
-#endif
+/* wrapper asinf */
+float
+__asinf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_asinf(x);
-#else
- float z;
- z = __ieee754_asinf(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- if(fabsf(x)>(float)1.0) {
- /* asinf(|x|>1) */
- return (float)__kernel_standard((double)x,(double)x,102);
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsf (x) > 1.0f, 0) && _LIB_VERSION != _IEEE_)
+ {
+ /* asin(|x|>1) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (x, x, 102);
+ }
+
+ return __ieee754_asinf (x);
}
weak_alias (__asinf, asinf)
diff --git a/libc/math/w_asinl.c b/libc/math/w_asinl.c
index fb5ee35fc..a9f14fbd6 100644
--- a/libc/math/w_asinl.c
+++ b/libc/math/w_asinl.c
@@ -1,49 +1,38 @@
-/* w_asinl.c -- long double version of w_asin.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
-/*
- * wrapper asinl(x)
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __asinl(long double x) /* wrapper asinl */
-#else
- long double __asinl(x) /* wrapper asinl */
- long double x;
-#endif
+/* wrapper asinl */
+long double
+__asinl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_asinl(x);
-#else
- long double z;
- z = __ieee754_asinl(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- if(fabsl(x)>1.0) {
- return __kernel_standard(x,x,202); /* asinl(|x|>1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsl (x) > 1.0L, 0) && _LIB_VERSION != _IEEE_)
+ {
+ /* asin(|x|>1) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 202);
+ }
+
+ return __ieee754_asinl (x);
}
weak_alias (__asinl, asinl)
diff --git a/libc/math/w_atan2.c b/libc/math/w_atan2.c
index f0a10d410..7d61c7279 100644
--- a/libc/math/w_atan2.c
+++ b/libc/math/w_atan2.c
@@ -1,44 +1,37 @@
-/* @(#)w_atan2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_atan2.c,v 1.6 1995/05/10 20:48:39 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
/*
* wrapper atan2(y,x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __atan2(double y, double x) /* wrapper atan2 */
-#else
- double __atan2(y,x) /* wrapper atan2 */
- double y,x;
-#endif
+double
+__atan2 (double y, double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_atan2(y,x);
-#else
- double z;
- z = __ieee754_atan2(y,x);
- if(_LIB_VERSION != _SVID_||__isnan(x)||__isnan(y)) return z;
- if(x==0.0&&y==0.0)
- return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */
- return z;
-#endif
+ if (__builtin_expect (x == 0.0 && y == 0.0, 0) && _LIB_VERSION == _SVID_)
+ return __kernel_standard (y, x, 3); /* atan2(+-0,+-0) */
+
+ return __ieee754_atan2 (y, x);
}
weak_alias (__atan2, atan2)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_atan2f.c b/libc/math/w_atan2f.c
index efb08f076..b3c65bfcb 100644
--- a/libc/math/w_atan2f.c
+++ b/libc/math/w_atan2f.c
@@ -1,46 +1,36 @@
-/* w_atan2f.c -- float version of w_atan2.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_atan2f.c,v 1.3 1995/05/10 20:48:42 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
/*
* wrapper atan2f(y,x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __atan2f(float y, float x) /* wrapper atan2f */
-#else
- float __atan2f(y,x) /* wrapper atan2 */
- float y,x;
-#endif
+float
+__atan2f (float y, float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_atan2f(y,x);
-#else
- float z;
- z = __ieee754_atan2f(y,x);
- if(_LIB_VERSION != _SVID_||__isnanf(x)||__isnanf(y)) return z;
- if(x==0.0&&y==0.0)
- return __kernel_standard(y,x,103); /* atan2(+-0,+-0) */
- return z;
-#endif
+ if (__builtin_expect (x == 0.0f && y == 0.0f, 0) && _LIB_VERSION == _SVID_)
+ return __kernel_standard_f (y, x, 103); /* atan2(+-0,+-0) */
+
+ return __ieee754_atan2f (y, x);
}
weak_alias (__atan2f, atan2f)
diff --git a/libc/math/w_atan2l.c b/libc/math/w_atan2l.c
index 9672e9615..c4854993a 100644
--- a/libc/math/w_atan2l.c
+++ b/libc/math/w_atan2l.c
@@ -1,47 +1,36 @@
-/* w_atan2l.c -- long double version of w_atan2.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
/*
* wrapper atan2l(y,x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __atan2l(long double y, long double x) /* wrapper atan2l */
-#else
- long double __atan2l(y,x) /* wrapper atan2l */
- long double y,x;
-#endif
+long double
+__atan2l (long double y, long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_atan2l(y,x);
-#else
- long double z;
- z = __ieee754_atan2l(y,x);
- if(_LIB_VERSION != _SVID_||__isnanl(x)||__isnanl(y)) return z;
- if(x==0.0&&y==0.0)
- return __kernel_standard(y,x,203); /* atan2(+-0,+-0) */
- return z;
-#endif
+ if (__builtin_expect (x == 0.0L && y == 0.0L, 0) && _LIB_VERSION == _SVID_)
+ return __kernel_standard (y, x, 203); /* atan2(+-0,+-0) */
+
+ return __ieee754_atan2l (y, x);
}
weak_alias (__atan2l, atan2l)
diff --git a/libc/math/w_atanh.c b/libc/math/w_atanh.c
index b81f65c31..61ea0d875 100644
--- a/libc/math/w_atanh.c
+++ b/libc/math/w_atanh.c
@@ -1,49 +1,37 @@
-/* @(#)w_atanh.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_atanh.c,v 1.6 1995/05/10 20:48:43 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper atanh(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __atanh(double x) /* wrapper atanh */
-#else
- double __atanh(x) /* wrapper atanh */
- double x;
-#endif
+/* wrapper atanh */
+double
+__atanh (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_atanh(x);
-#else
- double z,y;
- z = __ieee754_atanh(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- y = fabs(x);
- if(y>=1.0) {
- if(y>1.0)
- return __kernel_standard(x,x,30); /* atanh(|x|>1) */
- else
- return __kernel_standard(x,x,31); /* atanh(|x|==1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabs (x) >= 1.0, 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x,
+ fabs (x) > 1.0
+ ? 30 /* atanh(|x|>1) */
+ : 31); /* atanh(|x|==1) */
+
+ return __ieee754_atanh (x);
}
weak_alias (__atanh, atanh)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_atanhf.c b/libc/math/w_atanhf.c
index 52a144c05..fd1dbaeee 100644
--- a/libc/math/w_atanhf.c
+++ b/libc/math/w_atanhf.c
@@ -1,53 +1,36 @@
-/* w_atanhf.c -- float version of w_atanh.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_atanhf.c,v 1.3 1995/05/10 20:48:45 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper atanhf(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __atanhf(float x) /* wrapper atanhf */
-#else
- float __atanhf(x) /* wrapper atanhf */
- float x;
-#endif
+/* wrapper atanhf */
+float
+__atanhf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_atanhf(x);
-#else
- float z,y;
- z = __ieee754_atanhf(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- y = fabsf(x);
- if(y>=(float)1.0) {
- if(y>(float)1.0)
- /* atanhf(|x|>1) */
- return (float)__kernel_standard((double)x,(double)x,130);
- else
- /* atanhf(|x|==1) */
- return (float)__kernel_standard((double)x,(double)x,131);
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsf (x) >= 1.0f, 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x,
+ fabsf (x) > 1.0f
+ ? 130 /* atanh(|x|>1) */
+ : 131); /* atanh(|x|==1) */
+
+ return __ieee754_atanhf (x);
}
weak_alias (__atanhf, atanhf)
diff --git a/libc/math/w_atanhl.c b/libc/math/w_atanhl.c
index 5ce53b847..7c958f131 100644
--- a/libc/math/w_atanhl.c
+++ b/libc/math/w_atanhl.c
@@ -1,52 +1,36 @@
-/* w_atanhl.c -- long double version of w_atanh.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper atanhl(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __atanhl(long double x) /* wrapper atanhl */
-#else
- long double __atanhl(x) /* wrapper atanhl */
- long double x;
-#endif
+/* wrapper atanhl */
+long double
+__atanhl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_atanhl(x);
-#else
- long double z,y;
- z = __ieee754_atanhl(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- y = fabsl(x);
- if(y>=1.0) {
- if(y>1.0)
- return __kernel_standard(x,x,230); /* atanhl(|x|>1) */
- else
- return __kernel_standard(x,x,231); /* atanhl(|x|==1) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsl (x) >= 1.0L, 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x,
+ fabsl (x) > 1.0L
+ ? 230 /* atanh(|x|>1) */
+ : 231); /* atanh(|x|==1) */
+
+ return __ieee754_atanhl (x);
}
weak_alias (__atanhl, atanhl)
diff --git a/libc/math/w_cosh.c b/libc/math/w_cosh.c
index 033a03405..57010781b 100644
--- a/libc/math/w_cosh.c
+++ b/libc/math/w_cosh.c
@@ -1,4 +1,4 @@
-/* @(#)w_cosh.c 5.1 93/09/24 */
+/* Optimizations bu Ulrich Drepper <drepper@gmail.com>, 2011 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -10,35 +10,22 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_cosh.c,v 1.6 1995/05/10 20:48:47 jtc Exp $";
-#endif
-
/*
* wrapper cosh(x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __cosh(double x) /* wrapper cosh */
-#else
- double __cosh(x) /* wrapper cosh */
- double x;
-#endif
+double
+__cosh (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_cosh(x);
-#else
- double z;
- z = __ieee754_cosh(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- if(!__finite(z) && __finite(x)) {
- return __kernel_standard(x,x,5); /* cosh overflow */
- } else
- return z;
-#endif
+ double z = __ieee754_cosh (x);
+ if (__builtin_expect (!__finite (z), 0) && __finite (x)
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 5); /* cosh overflow */
+
+ return z;
}
weak_alias (__cosh, cosh)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_coshf.c b/libc/math/w_coshf.c
index 8e24ca9ad..df1f68120 100644
--- a/libc/math/w_coshf.c
+++ b/libc/math/w_coshf.c
@@ -1,5 +1,6 @@
/* w_coshf.c -- float version of w_cosh.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Optimizations by Ulrich Drepper <drepper@gmail.com>, 2011.
*/
/*
@@ -8,40 +9,26 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_coshf.c,v 1.3 1995/05/10 20:48:49 jtc Exp $";
-#endif
-
-/*
+/*
* wrapper coshf(x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __coshf(float x) /* wrapper coshf */
-#else
- float __coshf(x) /* wrapper coshf */
- float x;
-#endif
+float
+__coshf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_coshf(x);
-#else
- float z;
- z = __ieee754_coshf(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- if(!__finite(z) && __finite(x)) {
- /* cosh overflow */
- return (float)__kernel_standard((double)x,(double)x,105);
- } else
- return z;
-#endif
+ float z = __ieee754_coshf (x);
+ if (__builtin_expect (!__finitef (z), 0) && __finitef (x)
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 105); /* cosh overflow */
+
+ return z;
}
weak_alias (__coshf, coshf)
diff --git a/libc/math/w_coshl.c b/libc/math/w_coshl.c
index 52b8d9352..abca8b05f 100644
--- a/libc/math/w_coshl.c
+++ b/libc/math/w_coshl.c
@@ -1,6 +1,7 @@
/* w_acoshl.c -- long double version of w_acosh.c.
* Conversion to long double by Ulrich Drepper,
* Cygnus Support, drepper@cygnus.com.
+ * Optimizations bu Ulrich Drepper <drepper@gmail.com>, 2011.
*/
/*
@@ -14,34 +15,21 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/*
* wrapper coshl(x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __coshl(long double x) /* wrapper coshl */
-#else
- long double __coshl(x) /* wrapper coshl */
- long double x;
-#endif
+long double
+__coshl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_coshl(x);
-#else
- long double z;
- z = __ieee754_coshl(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- if(!__finitel(z) && __finitel(x)) {
- return __kernel_standard(x,x,205); /* cosh overflow */
- } else
- return z;
-#endif
+ long double z = __ieee754_coshl (x);
+ if (__builtin_expect (!__finitel (z), 0) && __finitel (x)
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 205); /* cosh overflow */
+
+ return z;
}
weak_alias (__coshl, coshl)
diff --git a/libc/math/w_dremf.c b/libc/math/w_dremf.c
index c3d391d63..4ec4baffd 100644
--- a/libc/math/w_dremf.c
+++ b/libc/math/w_dremf.c
@@ -6,7 +6,7 @@
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
float
__dremf(x, y)
diff --git a/libc/math/w_exp10.c b/libc/math/w_exp10.c
index 9447d8fa2..830b08df1 100644
--- a/libc/math/w_exp10.c
+++ b/libc/math/w_exp10.c
@@ -1,44 +1,40 @@
-/* @(#)w_exp10.c
- * Conversion to exp10 by Ulrich Drepper <drepper@cygnus.com>.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
/*
* wrapper exp10(x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __exp10(double x) /* wrapper exp10 */
-#else
- double __exp10(x) /* wrapper exp10 */
- double x;
-#endif
+double
+__exp10 (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_exp10(x);
-#else
- double z;
- z = __ieee754_exp10(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(!__finite(z) && __finite(x)) {
- /* exp10 overflow (46) if x > 0, underflow (47) if x < 0. */
- return __kernel_standard(x,x,46+!!__signbit(x));
- }
- return z;
-#endif
+ double z = __ieee754_exp10 (x);
+ if (__builtin_expect (!__finite (z), 0)
+ && __finite (x) && _LIB_VERSION != _IEEE_)
+ /* exp10 overflow (46) if x > 0, underflow (47) if x < 0. */
+ return __kernel_standard (x, x, 46 + !!__signbit (x));
+
+ return z;
}
weak_alias (__exp10, exp10)
strong_alias (__exp10, __pow10)
diff --git a/libc/math/w_exp10f.c b/libc/math/w_exp10f.c
index 78e71be06..6fd52f9a3 100644
--- a/libc/math/w_exp10f.c
+++ b/libc/math/w_exp10f.c
@@ -1,45 +1,40 @@
-/* w_exp10f.c -- float version of w_exp10.c.
- * Conversion to exp10 by Ulrich Drepper <drepper@cygnus.com>.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
/*
- * wrapper expf10(x)
+ * wrapper exp10f(x)
*/
#include <math.h>
-#include "math_private.h"
-
-#ifdef __STDC__
- float __exp10f(float x) /* wrapper exp10f */
-#else
- float __exp10f(x) /* wrapper exp10f */
- float x;
-#endif
+#include <math_private.h>
+
+float
+__exp10f (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_exp10f(x);
-#else
- float z;
- z = __ieee754_exp10f(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(!__finitef(z) && __finitef(x)) {
- /* exp10f overflow (146) if x > 0, underflow (147) if x < 0. */
- return (float)__kernel_standard((double) x, (double) x,
- 146+!!__signbitf(x));
- }
- return z;
-#endif
+ float z = __ieee754_exp10f (x);
+ if (__builtin_expect (!__finitef (z), 0)
+ && __finitef (x) && _LIB_VERSION != _IEEE_)
+ /* exp10f overflow (146) if x > 0, underflow (147) if x < 0. */
+ return __kernel_standard_f (x, x, 146 + !!__signbitf (x));
+
+ return z;
}
weak_alias (__exp10f, exp10f)
strong_alias (__exp10f, __pow10f)
diff --git a/libc/math/w_exp10l.c b/libc/math/w_exp10l.c
index 368ed7730..0cda27c76 100644
--- a/libc/math/w_exp10l.c
+++ b/libc/math/w_exp10l.c
@@ -1,45 +1,40 @@
-/* w_exp10l.c -- long double version of w_exp10.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
/*
* wrapper exp10l(x)
*/
#include <math.h>
-#include "math_private.h"
-
-#ifdef __STDC__
- long double __exp10l(long double x) /* wrapper exp10 */
-#else
- long double __exp10l(x) /* wrapper exp10 */
- long double x;
-#endif
+#include <math_private.h>
+
+long double
+__exp10l (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_exp10l(x);
-#else
- long double z;
- z = __ieee754_exp10l(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(!__finitel(z) && __finitel(x)) {
- /* exp10 overflow (246) if x > 0, underflow (247) if x < 0. */
- return __kernel_standard(x,x,246+__signbitl(x));
- }
- return z;
-#endif
+ long double z = __ieee754_exp10l (x);
+ if (__builtin_expect (!__finitel (z), 0)
+ && __finitel (x) && _LIB_VERSION != _IEEE_)
+ /* exp10l overflow (246) if x > 0, underflow (247) if x < 0. */
+ return __kernel_standard (x, x, 246 + !!__signbitl (x));
+
+ return z;
}
weak_alias (__exp10l, exp10l)
strong_alias (__exp10l, __pow10l)
diff --git a/libc/math/w_exp2.c b/libc/math/w_exp2.c
index 446e5ea91..bf223265c 100644
--- a/libc/math/w_exp2.c
+++ b/libc/math/w_exp2.c
@@ -4,30 +4,20 @@
#include <float.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-static const double o_threshold= (double) DBL_MAX_EXP;
-static const double u_threshold= (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
+static const double o_threshold = (double) DBL_MAX_EXP;
+static const double u_threshold = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
double
-__exp2 (double x) /* wrapper exp2 */
+__exp2 (double x)
{
-#ifdef _IEEE_LIBM
+ if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
+ && _LIB_VERSION != _IEEE_ && __finite (x))
+ /* exp2 overflow: 44, exp2 underflow: 45 */
+ return __kernel_standard (x, x, 44 + (x <= o_threshold));
+
return __ieee754_exp2 (x);
-#else
- double z;
- z = __ieee754_exp2 (x);
- if (_LIB_VERSION != _IEEE_ && __finite (x))
- {
- if (x > o_threshold)
- /* exp2 overflow */
- return __kernel_standard (x, x, 44);
- else if (x <= u_threshold)
- /* exp2 underflow */
- return __kernel_standard (x, x, 45);
- }
- return z;
-#endif
}
weak_alias (__exp2, exp2)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_exp2f.c b/libc/math/w_exp2f.c
index 9120c88b6..7215fcaf4 100644
--- a/libc/math/w_exp2f.c
+++ b/libc/math/w_exp2f.c
@@ -4,29 +4,19 @@
#include <float.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-static const float o_threshold= (float) FLT_MAX_EXP;
-static const float u_threshold= (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
+static const float o_threshold = (float) FLT_MAX_EXP;
+static const float u_threshold = (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
float
-__exp2f (float x) /* wrapper exp2f */
+__exp2f (float x)
{
-#ifdef _IEEE_LIBM
+ if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
+ && _LIB_VERSION != _IEEE_ && __finitef (x))
+ /* exp2 overflow: 144, exp2 underflow: 145 */
+ return __kernel_standard_f (x, x, 144 + (x <= o_threshold));
+
return __ieee754_exp2f (x);
-#else
- float z;
- z = __ieee754_exp2f (x);
- if (_LIB_VERSION != _IEEE_ && __finitef (x))
- {
- if (x > o_threshold)
- /* exp2 overflow */
- return (float) __kernel_standard ((double) x, (double) x, 144);
- else if (x <= u_threshold)
- /* exp2 underflow */
- return (float) __kernel_standard ((double) x, (double) x, 145);
- }
- return z;
-#endif
}
weak_alias (__exp2f, exp2f)
diff --git a/libc/math/w_exp2l.c b/libc/math/w_exp2l.c
index fea5425ac..ac8d231e2 100644
--- a/libc/math/w_exp2l.c
+++ b/libc/math/w_exp2l.c
@@ -4,28 +4,20 @@
#include <float.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
static const long double o_threshold = (long double) LDBL_MAX_EXP;
static const long double u_threshold
= (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG - 1);
long double
-__exp2l (long double x) /* wrapper exp2l */
+__exp2l (long double x)
{
-#ifdef _IEEE_LIBM
+ if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
+ && _LIB_VERSION != _IEEE_ && __finitel (x))
+ /* exp2 overflow: 244, exp2 underflow: 245 */
+ return __kernel_standard (x, x, 244 + (x <= o_threshold));
+
return __ieee754_exp2l (x);
-#else
- long double z;
- z = __ieee754_exp2l (x);
- if (_LIB_VERSION != _IEEE_ && __finitel (x))
- {
- if (x > o_threshold)
- return __kernel_standard (x, x, 244); /* exp2l overflow */
- else if (x <= u_threshold)
- return __kernel_standard (x, x, 245); /* exp2l underflow */
- }
- return z;
-#endif
}
weak_alias (__exp2l, exp2l)
diff --git a/libc/math/w_fmod.c b/libc/math/w_fmod.c
index ca01cf2ac..d38ae8c5a 100644
--- a/libc/math/w_fmod.c
+++ b/libc/math/w_fmod.c
@@ -1,46 +1,35 @@
-/* @(#)w_fmod.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_fmod.c,v 1.6 1995/05/10 20:48:55 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-/*
- * wrapper fmod(x,y)
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#include <math.h>
-#include "math_private.h"
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <math.h>
+#include <math_private.h>
-#ifdef __STDC__
- double __fmod(double x, double y) /* wrapper fmod */
-#else
- double __fmod(x,y) /* wrapper fmod */
- double x,y;
-#endif
+/* wrapper fmod */
+double
+__fmod (double x, double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_fmod(x,y);
-#else
- double z;
- z = __ieee754_fmod(x,y);
- if(_LIB_VERSION == _IEEE_ ||__isnan(y)||__isnan(x)) return z;
- if(__isinf(x)||y==0.0) {
- /* fmod(+-Inf,y) or fmod(x,0) */
- return __kernel_standard(x,y,27);
- } else
- return z;
-#endif
+ if (__builtin_expect (__isinf_ns (x) || y == 0.0, 0)
+ && _LIB_VERSION != _IEEE_ && !__isnan (y) && !__isnan (x))
+ /* fmod(+-Inf,y) or fmod(x,0) */
+ return __kernel_standard (x, y, 27);
+
+ return __ieee754_fmod (x, y);
}
weak_alias (__fmod, fmod)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_fmodf.c b/libc/math/w_fmodf.c
index e2e869a3c..c0370cf6f 100644
--- a/libc/math/w_fmodf.c
+++ b/libc/math/w_fmodf.c
@@ -1,48 +1,34 @@
-/* w_fmodf.c -- float version of w_fmod.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_fmodf.c,v 1.3 1995/05/10 20:48:57 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper fmodf(x,y)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-
-#ifdef __STDC__
- float __fmodf(float x, float y) /* wrapper fmodf */
-#else
- float __fmodf(x,y) /* wrapper fmodf */
- float x,y;
-#endif
+/* wrapper fmodf */
+float
+__fmodf (float x, float y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_fmodf(x,y);
-#else
- float z;
- z = __ieee754_fmodf(x,y);
- if(_LIB_VERSION == _IEEE_ ||__isnanf(y)||__isnanf(x)) return z;
- if(__isinff(x)||y==(float)0.0) {
- /* fmodf(+-Inf,y) or fmodf(x,0) */
- return (float)__kernel_standard((double)x,(double)y,127);
- } else
- return z;
-#endif
+ if (__builtin_expect (__isinf_nsf (x) || y == 0.0f, 0)
+ && _LIB_VERSION != _IEEE_ && !__isnanf (y) && !__isnanf (x))
+ /* fmod(+-Inf,y) or fmod(x,0) */
+ return __kernel_standard_f (x, y, 127);
+
+ return __ieee754_fmodf (x, y);
}
weak_alias (__fmodf, fmodf)
diff --git a/libc/math/w_fmodl.c b/libc/math/w_fmodl.c
index c39b2852f..d236fb9fd 100644
--- a/libc/math/w_fmodl.c
+++ b/libc/math/w_fmodl.c
@@ -1,49 +1,34 @@
-/* w_fmodl.c -- long double version of w_fmod.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper fmodl(x,y)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-
-#ifdef __STDC__
- long double __fmodl(long double x, long double y)/* wrapper fmodl */
-#else
- long double __fmodl(x,y) /* wrapper fmodl */
- long double x,y;
-#endif
+/* wrapper fmodl */
+long double
+__fmodl (long double x, long double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_fmodl(x,y);
-#else
- long double z;
- z = __ieee754_fmodl(x,y);
- if(_LIB_VERSION == _IEEE_ ||__isnanl(y)||__isnanl(x)) return z;
- if(__isinfl(x)||y==0.0) {
- /* fmodl(+-Inf,y) or fmodl(x,0) */
- return __kernel_standard(x,y,227);
- } else
- return z;
-#endif
+ if (__builtin_expect (__isinf_nsl (x) || y == 0.0L, 0)
+ && _LIB_VERSION != _IEEE_ && !__isnanl (y) && !__isnanl (x))
+ /* fmod(+-Inf,y) or fmod(x,0) */
+ return __kernel_standard (x, y, 227);
+
+ return __ieee754_fmodl (x, y);
}
weak_alias (__fmodl, fmodl)
diff --git a/libc/math/w_hypot.c b/libc/math/w_hypot.c
index ab929f78a..2c6de2860 100644
--- a/libc/math/w_hypot.c
+++ b/libc/math/w_hypot.c
@@ -10,36 +10,23 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_hypot.c,v 1.6 1995/05/10 20:49:07 jtc Exp $";
-#endif
-
/*
* wrapper hypot(x,y)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __hypot(double x, double y)/* wrapper hypot */
-#else
- double __hypot(x,y) /* wrapper hypot */
- double x,y;
-#endif
+double
+__hypot (double x, double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_hypot(x,y);
-#else
- double z;
- z = __ieee754_hypot(x,y);
- if(_LIB_VERSION == _IEEE_) return z;
- if((!__finite(z))&&__finite(x)&&__finite(y))
- return __kernel_standard(x,y,4); /* hypot overflow */
- else
- return z;
-#endif
+ double z = __ieee754_hypot(x,y);
+ if(__builtin_expect(!__finite(z), 0)
+ && __finite(x) && __finite(y) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard(x, y, 4); /* hypot overflow */
+
+ return z;
}
weak_alias (__hypot, hypot)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_hypotf.c b/libc/math/w_hypotf.c
index b6be39e39..6042b8802 100644
--- a/libc/math/w_hypotf.c
+++ b/libc/math/w_hypotf.c
@@ -8,41 +8,28 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_hypotf.c,v 1.3 1995/05/10 20:49:09 jtc Exp $";
-#endif
-
/*
* wrapper hypotf(x,y)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __hypotf(float x, float y) /* wrapper hypotf */
-#else
- float __hypotf(x,y) /* wrapper hypotf */
- float x,y;
-#endif
+float
+__hypotf(float x, float y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_hypotf(x,y);
-#else
- float z;
- z = __ieee754_hypotf(x,y);
- if(_LIB_VERSION == _IEEE_) return z;
- if((!__finitef(z))&&__finitef(x)&&__finitef(y))
+ float z = __ieee754_hypotf(x,y);
+ if(__builtin_expect(!__finitef(z), 0)
+ && __finitef(x) && __finitef(y) && _LIB_VERSION != _IEEE_)
/* hypot overflow */
- return (float)__kernel_standard((double)x,(double)y,104);
- else
- return z;
-#endif
+ return __kernel_standard_f(x, y, 104);
+
+ return z;
}
weak_alias (__hypotf, hypotf)
diff --git a/libc/math/w_hypotl.c b/libc/math/w_hypotl.c
index 916afbd41..522eb63c3 100644
--- a/libc/math/w_hypotl.c
+++ b/libc/math/w_hypotl.c
@@ -14,35 +14,23 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/*
* wrapper hypotl(x,y)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __hypotl(long double x, long double y)/* wrapper hypotl */
-#else
- long double __hypotl(x,y) /* wrapper hypotl */
- long double x,y;
-#endif
+long double
+__hypotl(long double x, long double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_hypotl(x,y);
-#else
long double z;
z = __ieee754_hypotl(x,y);
- if(_LIB_VERSION == _IEEE_) return z;
- if((!__finitel(z))&&__finitel(x)&&__finitel(y))
- return __kernel_standard(x,y,204); /* hypot overflow */
- else
- return z;
-#endif
+ if(__builtin_expect(!__finitel(z), 0)
+ && __finitel(x) && __finitel(y) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard(x, y, 204); /* hypot overflow */
+
+ return z;
}
weak_alias (__hypotl, hypotl)
diff --git a/libc/math/w_j0.c b/libc/math/w_j0.c
index 5ab3544aa..361352048 100644
--- a/libc/math/w_j0.c
+++ b/libc/math/w_j0.c
@@ -1,75 +1,63 @@
-/* @(#)w_j0.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_j0.c,v 1.6 1995/05/10 20:49:11 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper j0(double x), y0(double x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double j0(double x) /* wrapper j0 */
-#else
- double j0(x) /* wrapper j0 */
- double x;
-#endif
+
+/* wrapper j0 */
+double
+j0 (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_j0(x);
-#else
- double z = __ieee754_j0(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- if(fabs(x)>X_TLOSS) {
- return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ /* j0(|x|>X_TLOSS) */
+ return __kernel_standard (x, x, 34);
+
+ return __ieee754_j0 (x);
}
#ifdef NO_LONG_DOUBLE
strong_alias (j0, j0l)
#endif
-#ifdef __STDC__
- double y0(double x) /* wrapper y0 */
-#else
- double y0(x) /* wrapper y0 */
- double x;
-#endif
+/* wrapper y0 */
+double
+y0 (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_y0(x);
-#else
- double z;
- z = __ieee754_y0(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
- if(x <= 0.0){
- if(x==0.0)
- /* d= -one/(x-x); */
- return __kernel_standard(x,x,8);
- else
- /* d = zero/(x-x); */
- return __kernel_standard(x,x,9);
- }
- if(x>X_TLOSS) {
- return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 9);
+ }
+ else if (x == 0.0)
+ /* d = -one/(x-x) */
+ return __kernel_standard (x, x, 8);
+ else
+ /* y0(x>X_TLOSS) */
+ return __kernel_standard (x, x, 35);
+ }
+
+ return __ieee754_y0 (x);
}
#ifdef NO_LONG_DOUBLE
strong_alias (y0, y0l)
diff --git a/libc/math/w_j0f.c b/libc/math/w_j0f.c
index bb2b82f06..ff1ac3ca3 100644
--- a/libc/math/w_j0f.c
+++ b/libc/math/w_j0f.c
@@ -1,74 +1,60 @@
-/* w_j0f.c -- float version of w_j0.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_j0f.c,v 1.3 1995/05/10 20:49:13 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper j0f(float x), y0f(float x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float j0f(float x) /* wrapper j0f */
-#else
- float j0f(x) /* wrapper j0f */
- float x;
-#endif
+
+/* wrapper j0f */
+float
+j0f (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_j0f(x);
-#else
- float z = __ieee754_j0f(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- if(fabsf(x)>(float)X_TLOSS) {
- /* j0f(|x|>X_TLOSS) */
- return (float)__kernel_standard((double)x,(double)x,134);
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsf (x) > (float) X_TLOSS, 0)
+ && _LIB_VERSION != _IEEE_)
+ /* j0(|x|>X_TLOSS) */
+ return __kernel_standard_f (x, x, 134);
+
+ return __ieee754_j0f (x);
}
-#ifdef __STDC__
- float y0f(float x) /* wrapper y0f */
-#else
- float y0f(x) /* wrapper y0f */
- float x;
-#endif
+
+/* wrapper y0f */
+float
+y0f (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_y0f(x);
-#else
- float z;
- z = __ieee754_y0f(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
- if(x <= (float)0.0){
- if(x==(float)0.0)
- /* d= -one/(x-x); */
- return (float)__kernel_standard((double)x,(double)x,108);
- else
- /* d = zero/(x-x); */
- return (float)__kernel_standard((double)x,(double)x,109);
- }
- if(x>(float)X_TLOSS) {
- /* y0(x>X_TLOSS) */
- return (float)__kernel_standard((double)x,(double)x,135);
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
+ && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0f)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (x, x, 109);
+ }
+ else if (x == 0.0f)
+ /* d = -one/(x-x) */
+ return __kernel_standard_f (x, x, 108);
+ else
+ /* y0(x>X_TLOSS) */
+ return __kernel_standard_f (x, x, 135);
+ }
+
+ return __ieee754_y0f (x);
}
diff --git a/libc/math/w_j0l.c b/libc/math/w_j0l.c
index 1ec6e9e0c..a16363d53 100644
--- a/libc/math/w_j0l.c
+++ b/libc/math/w_j0l.c
@@ -1,76 +1,60 @@
-/* w_j0l.c -- long double version of w_j0.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper j0l(long double x), y0l(long double x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __j0l(long double x) /* wrapper j0l */
-#else
- long double __j0l(x) /* wrapper j0 */
- long double x;
-#endif
+
+/* wrapper j0l */
+long double
+__j0l (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_j0l(x);
-#else
- long double z = __ieee754_j0l(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- if(fabsl(x)>X_TLOSS) {
- return __kernel_standard(x,x,234); /* j0(|x|>X_TLOSS) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsl (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ /* j0(|x|>X_TLOSS) */
+ return __kernel_standard (x, x, 234);
+
+ return __ieee754_j0l (x);
}
weak_alias (__j0l, j0l)
-#ifdef __STDC__
- long double __y0l(long double x) /* wrapper y0l */
-#else
- long double __y0l(x) /* wrapper y0 */
- long double x;
-#endif
+
+/* wrapper y0l */
+long double
+__y0l (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_y0l(x);
-#else
- long double z;
- z = __ieee754_y0l(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x) ) return z;
- if(x <= 0.0){
- if(x==0.0)
- /* d= -one/(x-x); */
- return __kernel_standard(x,x,208);
- else
- /* d = zero/(x-x); */
- return __kernel_standard(x,x,209);
- }
- if(x>X_TLOSS) {
- return __kernel_standard(x,x,235); /* y0(x>X_TLOSS) */
- } else
- return z;
-#endif
-}
+ if (__builtin_expect (x <= 0.0L || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0L)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 209);
+ }
+ else if (x == 0.0L)
+ /* d = -one/(x-x) */
+ return __kernel_standard (x, x, 208);
+ else
+ /* y0(x>X_TLOSS) */
+ return __kernel_standard (x, x, 235);
+ }
+ return __ieee754_y0l (x);
+}
weak_alias (__y0l, y0l)
diff --git a/libc/math/w_j1.c b/libc/math/w_j1.c
index db8c4ce33..09cacb82c 100644
--- a/libc/math/w_j1.c
+++ b/libc/math/w_j1.c
@@ -1,76 +1,63 @@
-/* @(#)w_j1.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_j1.c,v 1.6 1995/05/10 20:49:15 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper of j1,y1
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double j1(double x) /* wrapper j1 */
-#else
- double j1(x) /* wrapper j1 */
- double x;
-#endif
+
+/* wrapper j1 */
+double
+j1 (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_j1(x);
-#else
- double z;
- z = __ieee754_j1(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
- if(fabs(x)>X_TLOSS) {
- return __kernel_standard(x,x,36); /* j1(|x|>X_TLOSS) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ /* j1(|x|>X_TLOSS) */
+ return __kernel_standard (x, x, 36);
+
+ return __ieee754_j1 (x);
}
#ifdef NO_LONG_DOUBLE
strong_alias (j1, j1l)
#endif
-#ifdef __STDC__
- double y1(double x) /* wrapper y1 */
-#else
- double y1(x) /* wrapper y1 */
- double x;
-#endif
+/* wrapper y1 */
+double
+y1 (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_y1(x);
-#else
- double z;
- z = __ieee754_y1(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
- if(x <= 0.0){
- if(x==0.0)
- /* d= -one/(x-x); */
- return __kernel_standard(x,x,10);
- else
- /* d = zero/(x-x); */
- return __kernel_standard(x,x,11);
- }
- if(x>X_TLOSS) {
- return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 11);
+ }
+ else if (x == 0.0)
+ /* d = -one/(x-x) */
+ return __kernel_standard (x, x, 10);
+ else
+ /* y1(x>X_TLOSS) */
+ return __kernel_standard (x, x, 37);
+ }
+
+ return __ieee754_y1 (x);
}
#ifdef NO_LONG_DOUBLE
strong_alias (y1, y1l)
diff --git a/libc/math/w_j1f.c b/libc/math/w_j1f.c
index 35b186206..40a2cf302 100644
--- a/libc/math/w_j1f.c
+++ b/libc/math/w_j1f.c
@@ -1,75 +1,59 @@
-/* w_j1f.c -- float version of w_j1.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_j1f.c,v 1.3 1995/05/10 20:49:17 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper of j1f,y1f
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float j1f(float x) /* wrapper j1f */
-#else
- float j1f(x) /* wrapper j1f */
- float x;
-#endif
+
+/* wrapper j1f */
+float
+j1f (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_j1f(x);
-#else
- float z;
- z = __ieee754_j1f(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
- if(fabsf(x)>(float)X_TLOSS) {
- /* j1(|x|>X_TLOSS) */
- return (float)__kernel_standard((double)x,(double)x,136);
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsf (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ /* j1(|x|>X_TLOSS) */
+ return __kernel_standard_f (x, x, 136);
+
+ return __ieee754_j1f (x);
}
-#ifdef __STDC__
- float y1f(float x) /* wrapper y1f */
-#else
- float y1f(x) /* wrapper y1f */
- float x;
-#endif
+
+/* wrapper y1f */
+float
+y1f (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_y1f(x);
-#else
- float z;
- z = __ieee754_y1f(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
- if(x <= (float)0.0){
- if(x==(float)0.0)
- /* d= -one/(x-x); */
- return (float)__kernel_standard((double)x,(double)x,110);
- else
- /* d = zero/(x-x); */
- return (float)__kernel_standard((double)x,(double)x,111);
- }
- if(x>(float)X_TLOSS) {
- /* y1(x>X_TLOSS) */
- return (float)__kernel_standard((double)x,(double)x,137);
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
+ && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0f)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (x, x, 111);
+ }
+ else if (x == 0.0f)
+ /* d = -one/(x-x) */
+ return __kernel_standard_f (x, x, 110);
+ else
+ /* y1(x>X_TLOSS) */
+ return __kernel_standard_f (x, x, 137);
+ }
+
+ return __ieee754_y1f (x);
}
diff --git a/libc/math/w_j1l.c b/libc/math/w_j1l.c
index 7bd31ad99..91b56e332 100644
--- a/libc/math/w_j1l.c
+++ b/libc/math/w_j1l.c
@@ -1,76 +1,60 @@
-/* w_j1l.c -- long double version of w_j1.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper of j1l,y1l
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __j1l(long double x) /* wrapper j1l */
-#else
- long double __j1l(x) /* wrapper j1l */
- long double x;
-#endif
+
+/* wrapper j1l */
+long double
+__j1l (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_j1l(x);
-#else
- long double z;
- z = __ieee754_j1l(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x) ) return z;
- if(fabsl(x)>X_TLOSS) {
- return __kernel_standard(x,x,236); /* j1(|x|>X_TLOSS) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsl (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ /* j1(|x|>X_TLOSS) */
+ return __kernel_standard (x, x, 236);
+
+ return __ieee754_j1l (x);
}
weak_alias (__j1l, j1l)
-#ifdef __STDC__
- long double __y1l(long double x) /* wrapper y1l */
-#else
- long double __y1l(x) /* wrapper y1l */
- long double x;
-#endif
+
+/* wrapper y1l */
+long double
+__y1l (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_y1l(x);
-#else
- long double z;
- z = __ieee754_y1l(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x) ) return z;
- if(x <= 0.0){
- if(x==0.0)
- /* d= -one/(x-x); */
- return __kernel_standard(x,x,210);
- else
- /* d = zero/(x-x); */
- return __kernel_standard(x,x,211);
- }
- if(x>X_TLOSS) {
- return __kernel_standard(x,x,237); /* y1(x>X_TLOSS) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0L || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0L)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 211);
+ }
+ else if (x == 0.0L)
+ /* d = -one/(x-x) */
+ return __kernel_standard (x, x, 210);
+ else
+ /* y1(x>X_TLOSS) */
+ return __kernel_standard (x, x, 237);
+ }
+
+ return __ieee754_y1l (x);
}
weak_alias (__y1l, y1l)
diff --git a/libc/math/w_jn.c b/libc/math/w_jn.c
index 3a28443dc..36fb44816 100644
--- a/libc/math/w_jn.c
+++ b/libc/math/w_jn.c
@@ -1,98 +1,63 @@
-/* @(#)w_jn.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_jn.c,v 1.6 1995/05/10 20:49:19 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper jn(int n, double x), yn(int n, double x)
- * floating point Bessel's function of the 1st and 2nd kind
- * of order n
- *
- * Special cases:
- * y0(0)=y1(0)=yn(n,0) = -inf with division by zero signal;
- * y0(-ve)=y1(-ve)=yn(n,-ve) are NaN with invalid signal.
- * Note 2. About jn(n,x), yn(n,x)
- * For n=0, j0(x) is called,
- * for n=1, j1(x) is called,
- * for n<x, forward recursion us used starting
- * from values of j0(x) and j1(x).
- * for n>x, a continued fraction approximation to
- * j(n,x)/j(n-1,x) is evaluated and then backward
- * recursion is used starting from a supposed value
- * for j(n,x). The resulting value of j(0,x) is
- * compared with the actual value to correct the
- * supposed value of j(n,x).
- *
- * yn(n,x) is similar in all respects, except
- * that forward recursion is used for all
- * values of n>1.
- *
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double jn(int n, double x) /* wrapper jn */
-#else
- double jn(n,x) /* wrapper jn */
- double x; int n;
-#endif
+
+/* wrapper jn */
+double
+jn (int n, double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_jn(n,x);
-#else
- double z;
- z = __ieee754_jn(n,x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
- if(fabs(x)>X_TLOSS) {
- return __kernel_standard((double)n,x,38); /* jn(|x|>X_TLOSS,n) */
- } else
- return z;
-#endif
+ if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ /* jn(n,|x|>X_TLOSS) */
+ return __kernel_standard (n, x, 38);
+
+ return __ieee754_jn (n, x);
}
#ifdef NO_LONG_DOUBLE
strong_alias (jn, jnl)
#endif
-#ifdef __STDC__
- double yn(int n, double x) /* wrapper yn */
-#else
- double yn(n,x) /* wrapper yn */
- double x; int n;
-#endif
+/* wrapper yn */
+double
+yn (int n, double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_yn(n,x);
-#else
- double z;
- z = __ieee754_yn(n,x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
- if(x <= 0.0){
- if(x==0.0)
- /* d= -one/(x-x); */
- return __kernel_standard((double)n,x,12);
- else
- /* d = zero/(x-x); */
- return __kernel_standard((double)n,x,13);
- }
- if(x>X_TLOSS) {
- return __kernel_standard((double)n,x,39); /* yn(x>X_TLOSS,n) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (n, x, 13);
+ }
+ else if (x == 0.0)
+ /* d = -one/(x-x) */
+ return __kernel_standard (n, x, 12);
+ else
+ /* yn(n,x>X_TLOSS) */
+ return __kernel_standard (n, x, 39);
+ }
+
+ return __ieee754_yn (n, x);
}
#ifdef NO_LONG_DOUBLE
strong_alias (yn, ynl)
diff --git a/libc/math/w_jnf.c b/libc/math/w_jnf.c
index 628701d7f..7b359558f 100644
--- a/libc/math/w_jnf.c
+++ b/libc/math/w_jnf.c
@@ -1,71 +1,60 @@
-/* w_jnf.c -- float version of w_jn.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_jnf.c,v 1.3 1995/05/10 20:49:21 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
-#ifdef __STDC__
- float jnf(int n, float x) /* wrapper jnf */
-#else
- float jnf(n,x) /* wrapper jnf */
- float x; int n;
-#endif
+/* wrapper jnf */
+float
+jnf (int n, float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_jnf(n,x);
-#else
- float z;
- z = __ieee754_jnf(n,x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
- if(fabsf(x)>(float)X_TLOSS) {
- /* jn(|x|>X_TLOSS,n) */
- return (float)__kernel_standard((double)n,(double)x,138);
- } else
- return z;
-#endif
+ if (__builtin_expect (fabsf (x) > (float) X_TLOSS, 0)
+ && _LIB_VERSION != _IEEE_)
+ /* jn(n,|x|>X_TLOSS) */
+ return __kernel_standard_f (n, x, 138);
+
+ return __ieee754_jnf (n, x);
}
-#ifdef __STDC__
- float ynf(int n, float x) /* wrapper ynf */
-#else
- float ynf(n,x) /* wrapper ynf */
- float x; int n;
-#endif
+
+/* wrapper ynf */
+float
+ynf (int n, float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_ynf(n,x);
-#else
- float z;
- z = __ieee754_ynf(n,x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
- if(x <= (float)0.0){
- if(x==(float)0.0)
- /* d= -one/(x-x); */
- return (float)__kernel_standard((double)n,(double)x,112);
- else
- /* d = zero/(x-x); */
- return (float)__kernel_standard((double)n,(double)x,113);
- }
- if(x>(float)X_TLOSS) {
- /* yn(x>X_TLOSS,n) */
- return (float)__kernel_standard((double)n,(double)x,139);
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
+ && _LIB_VERSION != _IEEE_)
+ {
+ if (x < 0.0f)
+ {
+ /* d = zero/(x-x) */
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (n, x, 113);
+ }
+ else if (x == 0.0)
+ /* d = -one/(x-x) */
+ return __kernel_standard_f (n, x, 112);
+ else
+ /* yn(n,x>X_TLOSS) */
+ return __kernel_standard_f (n, x, 139);
+ }
+
+ return __ieee754_ynf (n, x);
}
diff --git a/libc/math/w_jnl.c b/libc/math/w_jnl.c
index 4bb4d6b62..1dd9ae151 100644
--- a/libc/math/w_jnl.c
+++ b/libc/math/w_jnl.c
@@ -45,7 +45,7 @@ static char rcsid[] = "$NetBSD: $";
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
#ifdef __STDC__
long double __jnl(int n, long double x) /* wrapper jnl */
diff --git a/libc/math/w_lgamma.c b/libc/math/w_lgamma.c
index ab75f7599..17c546059 100644
--- a/libc/math/w_lgamma.c
+++ b/libc/math/w_lgamma.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_lgamma.c,v 1.6 1995/05/10 20:49:24 jtc Exp $";
-#endif
-
/* double lgamma(double x)
* Return the logarithm of the Gamma function of x.
*
@@ -21,33 +17,26 @@ static char rcsid[] = "$NetBSD: w_lgamma.c,v 1.6 1995/05/10 20:49:24 jtc Exp $";
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __lgamma(double x)
-#else
- double __lgamma(x)
- double x;
-#endif
+double
+__lgamma(double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_lgamma_r(x,&signgam);
-#else
- double y;
int local_signgam = 0;
- y = __ieee754_lgamma_r(x,&local_signgam);
- if (_LIB_VERSION != _ISOC_)
- /* ISO C99 does not define the global variable. */
- signgam = local_signgam;
- if(_LIB_VERSION == _IEEE_) return y;
- if(!__finite(y)&&__finite(x)) {
- if(__floor(x)==x&&x<=0.0)
- return __kernel_standard(x,x,15); /* lgamma pole */
- else
- return __kernel_standard(x,x,14); /* lgamma overflow */
- } else
- return y;
-#endif
+ double y = __ieee754_lgamma_r(x,
+ _LIB_VERSION != _ISOC_
+ /* ISO C99 does not define the
+ global variable. */
+ ? &signgam
+ : &local_signgam);
+ if(__builtin_expect(!__finite(y), 0)
+ && __finite(x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard(x, x,
+ __floor(x)==x&&x<=0.0
+ ? 15 /* lgamma pole */
+ : 14); /* lgamma overflow */
+
+ return y;
}
weak_alias (__lgamma, lgamma)
strong_alias (__lgamma, __gamma)
diff --git a/libc/math/w_lgamma_r.c b/libc/math/w_lgamma_r.c
index 17a7d013e..9d00f58ab 100644
--- a/libc/math/w_lgamma_r.c
+++ b/libc/math/w_lgamma_r.c
@@ -10,39 +10,26 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_lgamma_r.c,v 1.6 1995/05/10 20:49:27 jtc Exp $";
-#endif
-
/*
* wrapper double lgamma_r(double x, int *signgamp)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */
-#else
- double __lgamma_r(x,signgamp) /* wrapper lgamma_r */
- double x; int *signgamp;
-#endif
+double
+__lgamma_r(double x, int *signgamp)
{
-#ifdef _IEEE_LIBM
- return __ieee754_lgamma_r(x,signgamp);
-#else
- double y;
- y = __ieee754_lgamma_r(x,signgamp);
- if(_LIB_VERSION == _IEEE_) return y;
- if(!__finite(y)&&__finite(x)) {
- if(__floor(x)==x&&x<=0.0)
- return __kernel_standard(x,x,15); /* lgamma pole */
- else
- return __kernel_standard(x,x,14); /* lgamma overflow */
- } else
- return y;
-#endif
+ double y = __ieee754_lgamma_r(x,signgamp);
+ if(__builtin_expect(!__finite(y), 0)
+ && __finite(x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard(x, x,
+ __floor(x)==x&&x<=0.0
+ ? 15 /* lgamma pole */
+ : 14); /* lgamma overflow */
+
+ return y;
}
weak_alias (__lgamma_r, lgamma_r)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_lgammaf.c b/libc/math/w_lgammaf.c
index 7c3c058d7..f3166dfd3 100644
--- a/libc/math/w_lgammaf.c
+++ b/libc/math/w_lgammaf.c
@@ -13,40 +13,27 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_lgammaf.c,v 1.3 1995/05/10 20:49:30 jtc Exp $";
-#endif
-
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __lgammaf(float x)
-#else
- float __lgammaf(x)
- float x;
-#endif
+float
+__lgammaf(float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_lgammaf_r(x,&signgam);
-#else
- float y;
int local_signgam = 0;
- y = __ieee754_lgammaf_r(x,&local_signgam);
- if (_LIB_VERSION != _ISOC_)
- /* ISO C99 does not define the global variable. */
- signgam = local_signgam;
- if(_LIB_VERSION == _IEEE_) return y;
- if(!__finitef(y)&&__finitef(x)) {
- if(__floorf(x)==x&&x<=(float)0.0)
- /* lgamma pole */
- return (float)__kernel_standard((double)x,(double)x,115);
- else
- /* lgamma overflow */
- return (float)__kernel_standard((double)x,(double)x,114);
- } else
- return y;
-#endif
+ float y = __ieee754_lgammaf_r(x,
+ _LIB_VERSION != _ISOC_
+ /* ISO C99 does not define the
+ global variable. */
+ ? &signgam
+ : &local_signgam);
+ if(__builtin_expect(!__finitef(y), 0)
+ && __finitef(x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f(x, x,
+ __floorf(x)==x&&x<=0.0f
+ ? 115 /* lgamma pole */
+ : 114); /* lgamma overflow */
+
+ return y;
}
weak_alias (__lgammaf, lgammaf)
strong_alias (__lgammaf, __gammaf)
diff --git a/libc/math/w_lgammaf_r.c b/libc/math/w_lgammaf_r.c
index a32c32563..683fe72dc 100644
--- a/libc/math/w_lgammaf_r.c
+++ b/libc/math/w_lgammaf_r.c
@@ -8,45 +8,30 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_lgammaf_r.c,v 1.3 1995/05/10 20:49:32 jtc Exp $";
-#endif
-
-/*
+/*
* wrapper float lgammaf_r(float x, int *signgamp)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __lgammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
-#else
- float __lgammaf_r(x,signgamp) /* wrapper lgammaf_r */
- float x; int *signgamp;
-#endif
+float
+__lgammaf_r(float x, int *signgamp)
{
-#ifdef _IEEE_LIBM
- return __ieee754_lgammaf_r(x,signgamp);
-#else
- float y;
- y = __ieee754_lgammaf_r(x,signgamp);
- if(_LIB_VERSION == _IEEE_) return y;
- if(!__finitef(y)&&__finitef(x)) {
- if(__floorf(x)==x&&x<=(float)0.0)
- /* lgamma pole */
- return (float)__kernel_standard((double)x,(double)x,115);
- else
- /* lgamma overflow */
- return (float)__kernel_standard((double)x,(double)x,114);
- } else
- return y;
-#endif
-}
+ float y = __ieee754_lgammaf_r(x,signgamp);
+ if(__builtin_expect(!__finitef(y), 0)
+ && __finitef(x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f(x, x,
+ __floorf(x)==x&&x<=0.0f
+ ? 115 /* lgamma pole */
+ : 114); /* lgamma overflow */
+
+ return y;
+}
weak_alias (__lgammaf_r, lgammaf_r)
diff --git a/libc/math/w_lgammal.c b/libc/math/w_lgammal.c
index f250e5038..7df38e761 100644
--- a/libc/math/w_lgammal.c
+++ b/libc/math/w_lgammal.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* long double lgammal(long double x)
* Return the logarithm of the Gamma function of x.
*
@@ -25,33 +21,26 @@ static char rcsid[] = "$NetBSD: $";
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __lgammal(long double x)
-#else
- long double __lgammal(x)
- long double x;
-#endif
+long double
+__lgammal(long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_lgammal_r(x,&signgam);
-#else
- long double y;
int local_signgam = 0;
- y = __ieee754_lgammal_r(x,&local_signgam);
- if (_LIB_VERSION != _ISOC_)
- /* ISO C99 does not define the global variable. */
- signgam = local_signgam;
- if(_LIB_VERSION == _IEEE_) return y;
- if(!__finitel(y)&&__finitel(x)) {
- if(__floorl(x)==x&&x<=0.0)
- return __kernel_standard(x,x,215); /* lgamma pole */
- else
- return __kernel_standard(x,x,214); /* lgamma overflow */
- } else
- return y;
-#endif
+ long double y = __ieee754_lgammal_r(x,
+ _LIB_VERSION != _ISOC_
+ /* ISO C99 does not define the
+ global variable. */
+ ? &signgam
+ : &local_signgam);
+ if(__builtin_expect(!__finitel(y), 0)
+ && __finitel(x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard(x, x,
+ __floorl(x)==x&&x<=0.0L
+ ? 215 /* lgamma pole */
+ : 214); /* lgamma overflow */
+
+ return y;
}
weak_alias (__lgammal, lgammal)
strong_alias (__lgammal, __gammal)
diff --git a/libc/math/w_lgammal_r.c b/libc/math/w_lgammal_r.c
index 2dfea8a46..ec3428486 100644
--- a/libc/math/w_lgammal_r.c
+++ b/libc/math/w_lgammal_r.c
@@ -14,39 +14,25 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/*
* wrapper long double lgammal_r(long double x, int *signgamp)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __lgammal_r(long double x, int *signgamp)
- /* wrapper lgamma_r */
-#else
- long double __lgammal_r(x,signgamp) /* wrapper lgamma_r */
- long double x; int *signgamp;
-#endif
+long double
+__lgammal_r(long double x, int *signgamp)
{
-#ifdef _IEEE_LIBM
- return __ieee754_lgammal_r(x,signgamp);
-#else
- long double y;
- y = __ieee754_lgammal_r(x,signgamp);
- if(_LIB_VERSION == _IEEE_) return y;
- if(!__finitel(y)&&__finitel(x)) {
- if(__floorl(x)==x&&x<=0.0)
- return __kernel_standard(x,x,215); /* lgamma pole */
- else
- return __kernel_standard(x,x,214); /* lgamma overflow */
- } else
- return y;
-#endif
+ long double y = __ieee754_lgammal_r(x,signgamp);
+ if(__builtin_expect(!__finitel(y), 0)
+ && __finitel(x) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard(x, x,
+ __floorl(x)==x&&x<=0.0
+ ? 215 /* lgamma pole */
+ : 214); /* lgamma overflow */
+
+ return y;
}
weak_alias (__lgammal_r, lgammal_r)
diff --git a/libc/math/w_log.c b/libc/math/w_log.c
index 6f6f74fd1..b43af792c 100644
--- a/libc/math/w_log.c
+++ b/libc/math/w_log.c
@@ -1,45 +1,46 @@
-/* @(#)w_log.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_log.c,v 1.6 1995/05/10 20:49:33 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper log(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __log(double x) /* wrapper log */
-#else
- double __log(x) /* wrapper log */
- double x;
-#endif
+/* wrapper log(x) */
+double
+__log (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_log(x);
-#else
- double z;
- z = __ieee754_log(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x) || x > 0.0) return z;
- if(x==0.0)
- return __kernel_standard(x,x,16); /* log(0) */
- else
- return __kernel_standard(x,x,17); /* log(x<0) */
-#endif
+ if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard (x, x, 16); /* log(0) */
+ }
+ else
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 17); /* log(x<0) */
+ }
+ }
+
+ return __ieee754_log (x);
}
weak_alias (__log, log)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_log10.c b/libc/math/w_log10.c
index 9425db3dd..75ae580c9 100644
--- a/libc/math/w_log10.c
+++ b/libc/math/w_log10.c
@@ -1,48 +1,46 @@
-/* @(#)w_log10.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_log10.c,v 1.6 1995/05/10 20:49:35 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper log10(X)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __log10(double x) /* wrapper log10 */
-#else
- double __log10(x) /* wrapper log10 */
- double x;
-#endif
+/* wrapper log10(x) */
+double
+__log10 (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_log10(x);
-#else
- double z;
- z = __ieee754_log10(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- if(x<=0.0) {
- if(x==0.0)
- return __kernel_standard(x,x,18); /* log10(0) */
- else
- return __kernel_standard(x,x,19); /* log10(x<0) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard (x, x, 18); /* log10(0) */
+ }
+ else
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 19); /* log10(x<0) */
+ }
+ }
+
+ return __ieee754_log10 (x);
}
weak_alias (__log10, log10)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_log10f.c b/libc/math/w_log10f.c
index c63fcd1ec..3426e2d05 100644
--- a/libc/math/w_log10f.c
+++ b/libc/math/w_log10f.c
@@ -1,52 +1,45 @@
-/* w_log10f.c -- float version of w_log10.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_log10f.c,v 1.3 1995/05/10 20:49:37 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper log10f(X)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __log10f(float x) /* wrapper log10f */
-#else
- float __log10f(x) /* wrapper log10f */
- float x;
-#endif
+/* wrapper log10f(x) */
+float
+__log10f (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_log10f(x);
-#else
- float z;
- z = __ieee754_log10f(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- if(x<=(float)0.0) {
- if(x==(float)0.0)
- /* log10(0) */
- return (float)__kernel_standard((double)x,(double)x,118);
- else
- /* log10(x<0) */
- return (float)__kernel_standard((double)x,(double)x,119);
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0f)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard_f (x, x, 118); /* log10(0) */
+ }
+ else
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (x, x, 119); /* log10(x<0) */
+ }
+ }
+
+ return __ieee754_log10f (x);
}
weak_alias (__log10f, log10f)
diff --git a/libc/math/w_log10l.c b/libc/math/w_log10l.c
index 25c051d37..6f81f3961 100644
--- a/libc/math/w_log10l.c
+++ b/libc/math/w_log10l.c
@@ -1,51 +1,45 @@
-/* w_log10l.c -- long double version of w_log10.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper log10l(X)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __log10l(long double x) /* wrapper log10l */
-#else
- long double __log10l(x) /* wrapper log10l */
- long double x;
-#endif
+/* wrapper log10l(x) */
+long double
+__log10l (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_log10l(x);
-#else
- long double z;
- z = __ieee754_log10l(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- if(x<=0.0) {
- if(x==0.0)
- return __kernel_standard(x,x,218); /* log10(0) */
- else
- return __kernel_standard(x,x,219); /* log10(x<0) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0L)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard (x, x, 218); /* log10(0) */
+ }
+ else
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 219); /* log10(x<0) */
+ }
+ }
+
+ return __ieee754_log10l (x);
}
weak_alias (__log10l, log10l)
diff --git a/libc/math/w_log2.c b/libc/math/w_log2.c
index d56a6ee66..6d420438d 100644
--- a/libc/math/w_log2.c
+++ b/libc/math/w_log2.c
@@ -1,29 +1,46 @@
-/*
- * wrapper log2(X)
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
+/* wrapper log2(x) */
double
-__log2 (double x) /* wrapper log2 */
+__log2 (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_log2 (x);
-#else
- double z;
- z = __ieee754_log2 (x);
- if (_LIB_VERSION == _IEEE_ || __isnan (x)) return z;
- if (x <= 0.0)
+ if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
{
if (x == 0.0)
- return __kernel_standard (x, x, 48); /* log2 (0) */
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard (x, x, 48); /* log2(0) */
+ }
else
- return __kernel_standard (x, x, 49); /* log2 (x < 0) */
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 49); /* log2(x<0) */
+ }
}
- else
- return z;
-#endif
+
+ return __ieee754_log2 (x);
}
weak_alias (__log2, log2)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_log2f.c b/libc/math/w_log2f.c
index ec8d29716..7c64ad8b8 100644
--- a/libc/math/w_log2f.c
+++ b/libc/math/w_log2f.c
@@ -1,30 +1,45 @@
-/*
- * wrapper log2(X)
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
+/* wrapper log2f(x) */
float
-__log2f (float x) /* wrapper log2f */
+__log2f (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_log2f (x);
-#else
- float z;
- z = __ieee754_log2f (x);
- if (_LIB_VERSION == _IEEE_ || __isnanf (x)) return z;
- if (x <= 0.0f)
+ if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
{
- if (x == 0.0f)
- /* log2f (0) */
- return __kernel_standard ((double) x, (double) x, 148);
+ if (x == 0.0)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard_f (x, x, 148); /* log2(0) */
+ }
else
- /* log2f (x < 0) */
- return __kernel_standard ((double) x, (double) x, 149);
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (x, x, 149); /* log2(x<0) */
+ }
}
- else
- return z;
-#endif
+
+ return __ieee754_log2f (x);
}
weak_alias (__log2f, log2f)
diff --git a/libc/math/w_log2l.c b/libc/math/w_log2l.c
index b1d8706f2..f589768b1 100644
--- a/libc/math/w_log2l.c
+++ b/libc/math/w_log2l.c
@@ -1,28 +1,45 @@
-/*
- * wrapper log2l(X)
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
+/* wrapper log2l(x) */
long double
-__log2l (long double x) /* wrapper log2l */
+__log2l (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_log2l (x);
-#else
- long double z;
- z = __ieee754_log2l (x);
- if (_LIB_VERSION == _IEEE_ || __isnanl (x)) return z;
- if (x <= 0.0)
+ if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
{
- if (x == 0.0)
- return __kernel_standard (x, x, 248); /* log2l (0) */
+ if (x == 0.0L)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard (x, x, 248); /* log2(0) */
+ }
else
- return __kernel_standard (x, x, 249); /* log2l (x < 0) */
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 249); /* log2(x<0) */
+ }
}
- else
- return z;
-#endif
+
+ return __ieee754_log2l (x);
}
weak_alias (__log2l, log2l)
diff --git a/libc/math/w_logf.c b/libc/math/w_logf.c
index 46d974911..52b9befd1 100644
--- a/libc/math/w_logf.c
+++ b/libc/math/w_logf.c
@@ -1,49 +1,45 @@
-/* w_logf.c -- float version of w_log.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_logf.c,v 1.3 1995/05/10 20:49:40 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper logf(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __logf(float x) /* wrapper logf */
-#else
- float __logf(x) /* wrapper logf */
- float x;
-#endif
+/* wrapper logf(x) */
+float
+__logf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_logf(x);
-#else
- float z;
- z = __ieee754_logf(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x) || x > (float)0.0) return z;
- if(x==(float)0.0)
- /* logf(0) */
- return (float)__kernel_standard((double)x,(double)x,116);
- else
- /* logf(x<0) */
- return (float)__kernel_standard((double)x,(double)x,117);
-#endif
+ if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0f)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard_f (x, x, 116); /* log(0) */
+ }
+ else
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard_f (x, x, 117); /* log(x<0) */
+ }
+ }
+
+ return __ieee754_logf (x);
}
weak_alias (__logf, logf)
diff --git a/libc/math/w_logl.c b/libc/math/w_logl.c
index 5a38f2003..9f2bdf06c 100644
--- a/libc/math/w_logl.c
+++ b/libc/math/w_logl.c
@@ -1,48 +1,45 @@
-/* w_logl.c -- long double version of w_log.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper logl(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <fenv.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __logl(long double x) /* wrapper logl */
-#else
- long double __logl(x) /* wrapper logl */
- long double x;
-#endif
+/* wrapper logl(x) */
+long double
+__logl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_logl(x);
-#else
- long double z;
- z = __ieee754_logl(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x) || x > 0.0) return z;
- if(x==0.0)
- return __kernel_standard(x,x,216); /* log(0) */
- else
- return __kernel_standard(x,x,217); /* log(x<0) */
-#endif
+ if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0L)
+ {
+ feraiseexcept (FE_DIVBYZERO);
+ return __kernel_standard (x, x, 216); /* log(0) */
+ }
+ else
+ {
+ feraiseexcept (FE_INVALID);
+ return __kernel_standard (x, x, 217); /* log(x<0) */
+ }
+ }
+
+ return __ieee754_logl (x);
}
weak_alias (__logl, logl)
diff --git a/libc/math/w_pow.c b/libc/math/w_pow.c
index 707cffcc4..4993c232a 100644
--- a/libc/math/w_pow.c
+++ b/libc/math/w_pow.c
@@ -1,67 +1,76 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-/* @(#)w_pow.c 5.2 93/10/01 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper pow(x,y) return x**y
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __pow(double x, double y) /* wrapper pow */
-#else
- double __pow(x,y) /* wrapper pow */
- double x,y;
-#endif
+/* wrapper pow */
+double
+__pow (double x, double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_pow(x,y);
-#else
- double z;
- z=__ieee754_pow(x,y);
- if(_LIB_VERSION == _IEEE_|| __isnan(y)) return z;
- if(__isnan(x)) {
- if(y==0.0)
- return __kernel_standard(x,y,42); /* pow(NaN,0.0) */
- else
- return z;
- }
- if(x==0.0) {
- if(y==0.0)
- return __kernel_standard(x,y,20); /* pow(0.0,0.0) */
- if(__finite(y)&&y<0.0) {
- if (signbit (x) && signbit (z))
- return __kernel_standard(x,y,23); /* pow(-0.0,negative) */
+ double z = __ieee754_pow (x, y);
+ if (__builtin_expect (!__finite (z), 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ {
+ if (__isnan (x))
+ {
+ if (y == 0.0)
+ /* pow(NaN,0.0) */
+ return __kernel_standard (x, y, 42);
+ }
+ else if (__finite (x) && __finite (y))
+ {
+ if (__isnan (z))
+ /* pow neg**non-int */
+ return __kernel_standard (x, y, 24);
+ else if (x == 0.0 && y < 0.0)
+ {
+ if (signbit (x) && signbit (z))
+ /* pow(-0.0,negative) */
+ return __kernel_standard (x, y, 23);
+ else
+ /* pow(+0.0,negative) */
+ return __kernel_standard (x, y, 43);
+ }
else
- return __kernel_standard(x,y,43); /* pow(+0.0,negative) */
+ /* pow overflow */
+ return __kernel_standard (x, y, 21);
}
- return z;
}
- if(!__finite(z)) {
- if(__finite(x)&&__finite(y)) {
- if(__isnan(z))
- return __kernel_standard(x,y,24); /* pow neg**non-int */
- else
- return __kernel_standard(x,y,21); /* pow overflow */
- }
+ }
+ else if (__builtin_expect (z == 0.0, 0) && __finite (x) && __finite (y)
+ && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0)
+ {
+ if (y == 0.0)
+ /* pow(0.0,0.0) */
+ return __kernel_standard (x, y, 20);
}
- if(z==0.0&&__finite(x)&&__finite(y))
- return __kernel_standard(x,y,22); /* pow underflow */
- return z;
-#endif
+ else
+ /* pow underflow */
+ return __kernel_standard (x, y, 22);
+ }
+
+ return z;
}
weak_alias (__pow, pow)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_powf.c b/libc/math/w_powf.c
index 2480fe559..c0406f4c1 100644
--- a/libc/math/w_powf.c
+++ b/libc/math/w_powf.c
@@ -1,77 +1,75 @@
-/* w_powf.c -- float version of w_pow.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_powf.c,v 1.3 1995/05/10 20:49:41 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper powf(x,y) return x**y
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __powf(float x, float y) /* wrapper powf */
-#else
- float __powf(x,y) /* wrapper powf */
- float x,y;
-#endif
+/* wrapper powf */
+float
+__powf (float x, float y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_powf(x,y);
-#else
- float z;
- z=__ieee754_powf(x,y);
- if(_LIB_VERSION == _IEEE_|| __isnanf(y)) return z;
- if(__isnanf(x)) {
- if(y==(float)0.0)
- /* powf(NaN,0.0) */
- return (float)__kernel_standard((double)x,(double)y,142);
- else
- return z;
- }
- if(x==(float)0.0) {
- if(y==(float)0.0)
- /* powf(0.0,0.0) */
- return (float)__kernel_standard((double)x,(double)y,120);
- if(__finitef(y)&&y<(float)0.0) {
- if (signbit (x) && signbit (z))
- /* powf(0.0,negative) */
- return (float)__kernel_standard((double)x,(double)y,123);
+ float z = __ieee754_powf (x, y);
+ if (__builtin_expect (!__finitef (z), 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ {
+ if (__isnanf (x))
+ {
+ if (y == 0.0f)
+ /* pow(NaN,0.0) */
+ return __kernel_standard_f (x, y, 142);
+ }
+ else if (__finitef (x) && __finitef (y))
+ {
+ if (__isnanf (z))
+ /* pow neg**non-int */
+ return __kernel_standard_f (x, y, 124);
+ else if (x == 0.0f && y < 0.0f)
+ {
+ if (signbit (x) && signbit (z))
+ /* pow(-0.0,negative) */
+ return __kernel_standard_f (x, y, 123);
+ else
+ /* pow(+0.0,negative) */
+ return __kernel_standard_f (x, y, 143);
+ }
else
- return (float)__kernel_standard((double)x,(double)y,143);
+ /* pow overflow */
+ return __kernel_standard_f (x, y, 121);
}
- return z;
}
- if(!__finitef(z)) {
- if(__finitef(x)&&__finitef(y)) {
- if(__isnanf(z))
- /* powf neg**non-int */
- return (float)__kernel_standard((double)x,(double)y,124);
- else
- /* powf overflow */
- return (float)__kernel_standard((double)x,(double)y,121);
- }
+ }
+ else if (__builtin_expect (z == 0.0f, 0) && __finitef (x) && __finitef (y)
+ && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0f)
+ {
+ if (y == 0.0f)
+ /* pow(0.0,0.0) */
+ return __kernel_standard_f (x, y, 120);
}
- if(z==(float)0.0&&__finitef(x)&&__finitef(y))
- /* powf underflow */
- return (float)__kernel_standard((double)x,(double)y,122);
- return z;
-#endif
+ else
+ /* pow underflow */
+ return __kernel_standard_f (x, y, 122);
+ }
+
+ return z;
}
weak_alias (__powf, powf)
diff --git a/libc/math/w_powl.c b/libc/math/w_powl.c
index d8be7b7b0..1ad581ad9 100644
--- a/libc/math/w_powl.c
+++ b/libc/math/w_powl.c
@@ -1,68 +1,75 @@
-/* w_powl.c -- long double version of w_pow.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-/*
- * wrapper powl(x,y) return x**y
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __powl(long double x, long double y)/* wrapper powl */
-#else
- long double __powl(x,y) /* wrapper powl */
- long double x,y;
-#endif
+/* wrapper powl */
+long double
+__powl (long double x, long double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_powl(x,y);
-#else
- long double z;
- z=__ieee754_powl(x,y);
- if(_LIB_VERSION == _IEEE_|| __isnanl(y)) return z;
- if(__isnanl(x)) {
- if(y==0.0)
- return __kernel_standard(x,y,242); /* pow(NaN,0.0) */
- else
- return z;
- }
- if(x==0.0) {
- if(y==0.0)
- return __kernel_standard(x,y,220); /* pow(0.0,0.0) */
- if(__finitel(y)&&y<0.0) {
- if (signbit (x) && signbit (z))
- return __kernel_standard(x,y,223); /* pow(-0.0,negative) */
+ long double z = __ieee754_powl (x, y);
+ if (__builtin_expect (!__finitel (z), 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ {
+ if (__isnanl (x))
+ {
+ if (y == 0.0L)
+ /* pow(NaN,0.0) */
+ return __kernel_standard (x, y, 242);
+ }
+ else if (__finitel (x) && __finitel (y))
+ {
+ if (__isnanl (z))
+ /* pow neg**non-int */
+ return __kernel_standard (x, y, 224);
+ else if (x == 0.0L && y < 0.0L)
+ {
+ if (signbit (x) && signbit (z))
+ /* pow(-0.0,negative) */
+ return __kernel_standard (x, y, 223);
+ else
+ /* pow(+0.0,negative) */
+ return __kernel_standard (x, y, 243);
+ }
else
- return __kernel_standard(x,y,243); /* pow(+0.0,negative) */
+ /* pow overflow */
+ return __kernel_standard (x, y, 221);
}
- return z;
}
- if(!__finitel(z)) {
- if(__finitel(x)&&__finitel(y)) {
- if(__isnanl(z))
- return __kernel_standard(x,y,224); /* pow neg**non-int */
- else
- return __kernel_standard(x,y,221); /* pow overflow */
- }
+ }
+ else if (__builtin_expect (z == 0.0L, 0) && __finitel (x) && __finitel (y)
+ && _LIB_VERSION != _IEEE_)
+ {
+ if (x == 0.0L)
+ {
+ if (y == 0.0L)
+ /* pow(0.0,0.0) */
+ return __kernel_standard (x, y, 220);
}
- if(z==0.0&&__finitel(x)&&__finitel(y))
- return __kernel_standard(x,y,222); /* pow underflow */
- return z;
-#endif
+ else
+ /* pow underflow */
+ return __kernel_standard (x, y, 222);
+ }
+
+ return z;
}
weak_alias (__powl, powl)
diff --git a/libc/math/w_remainder.c b/libc/math/w_remainder.c
index 9d7a7c538..524cbf582 100644
--- a/libc/math/w_remainder.c
+++ b/libc/math/w_remainder.c
@@ -1,44 +1,36 @@
-/* @(#)w_remainder.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_remainder.c,v 1.6 1995/05/10 20:49:44 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper remainder(x,p)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __remainder(double x, double y) /* wrapper remainder */
-#else
- double __remainder(x,y) /* wrapper remainder */
- double x,y;
-#endif
+
+/* wrapper remainder */
+double
+__remainder (double x, double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_remainder(x,y);
-#else
- double z;
- z = __ieee754_remainder(x,y);
- if(_LIB_VERSION == _IEEE_ || __isnan(y)) return z;
- if(y==0.0)
- return __kernel_standard(x,y,28); /* remainder(x,0) */
- else
- return z;
-#endif
+ if (((__builtin_expect (y == 0.0, 0) && ! __isnan (x))
+ || (__builtin_expect (__isinf_ns (x), 0) && ! __isnan (y)))
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, y, 28); /* remainder domain */
+
+ return __ieee754_remainder (x, y);
}
weak_alias (__remainder, remainder)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_remainderf.c b/libc/math/w_remainderf.c
index 486e626c2..9bddf6f61 100644
--- a/libc/math/w_remainderf.c
+++ b/libc/math/w_remainderf.c
@@ -1,47 +1,35 @@
-/* w_remainderf.c -- float version of w_remainder.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_remainderf.c,v 1.3 1995/05/10 20:49:46 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper remainderf(x,p)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __remainderf(float x, float y) /* wrapper remainder */
-#else
- float __remainderf(x,y) /* wrapper remainder */
- float x,y;
-#endif
+
+/* wrapper remainderf */
+float
+__remainderf (float x, float y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_remainderf(x,y);
-#else
- float z;
- z = __ieee754_remainderf(x,y);
- if(_LIB_VERSION == _IEEE_ || __isnanf(y)) return z;
- if(y==(float)0.0)
- /* remainder(x,0) */
- return (float)__kernel_standard((double)x,(double)y,128);
- else
- return z;
-#endif
+ if (((__builtin_expect (y == 0.0f, 0) && ! __isnanf (x))
+ || (__builtin_expect (__isinf_nsf (x), 0) && ! __isnanf (y)))
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, y, 128); /* remainder domain */
+
+ return __ieee754_remainderf (x, y);
}
weak_alias (__remainderf, remainderf)
diff --git a/libc/math/w_remainderl.c b/libc/math/w_remainderl.c
index 7635fb936..66a141328 100644
--- a/libc/math/w_remainderl.c
+++ b/libc/math/w_remainderl.c
@@ -1,48 +1,35 @@
-/* w_remainderl.c -- long double version of w_remainder.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper remainderl(x,p)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __remainderl(long double x, long double y)
- /* wrapper remainderl */
-#else
- long double __remainderl(x,y) /* wrapper remainder */
- long double x,y;
-#endif
+
+/* wrapper remainderl */
+long double
+__remainderl (long double x, long double y)
{
-#ifdef _IEEE_LIBM
- return __ieee754_remainderl(x,y);
-#else
- long double z;
- z = __ieee754_remainderl(x,y);
- if(_LIB_VERSION == _IEEE_ || __isnanl(y)) return z;
- if(y==0.0)
- return __kernel_standard(x,y,228); /* remainder(x,0) */
- else
- return z;
-#endif
+ if (((__builtin_expect (y == 0.0L, 0) && ! __isnanl (x))
+ || (__builtin_expect (__isinf_nsl (x), 0) && ! __isnanl (y)))
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, y, 228); /* remainder domain */
+
+ return __ieee754_remainderl (x, y);
}
weak_alias (__remainderl, remainderl)
diff --git a/libc/math/w_scalb.c b/libc/math/w_scalb.c
index 0086c2adf..91f3658a6 100644
--- a/libc/math/w_scalb.c
+++ b/libc/math/w_scalb.c
@@ -1,62 +1,54 @@
-/* @(#)w_scalb.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-/*
- * wrapper scalb(double x, double fn) is provide for
- * passing various standard test suite. One
- * should use scalbn() instead.
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#include <math.h>
-#include "math_private.h"
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <errno.h>
+#include <math.h>
+#include <math_private.h>
-#ifdef __STDC__
-#ifdef _SCALB_INT
- double __scalb(double x, int fn) /* wrapper scalb */
-#else
- double __scalb(double x, double fn) /* wrapper scalb */
-#endif
-#else
- double __scalb(x,fn) /* wrapper scalb */
-#ifdef _SCALB_INT
- double x; int fn;
-#else
- double x,fn;
-#endif
-#endif
+
+static double
+__attribute__ ((noinline))
+sysv_scalb (double x, double fn)
{
-#ifdef _IEEE_LIBM
- return __ieee754_scalb(x,fn);
-#else
- double z;
- z = __ieee754_scalb(x,fn);
- if(_LIB_VERSION != _SVID_) return z;
- if(!(__finite(z)||__isnan(z))&&__finite(x)) {
- return __kernel_standard(x,(double)fn,32); /* scalb overflow */
- }
- if(z==0.0&&z!=x) {
- return __kernel_standard(x,(double)fn,33); /* scalb underflow */
- }
-#ifndef _SCALB_INT
- if(!__finite(fn)) __set_errno (ERANGE);
-#endif
- return z;
-#endif
+ double z = __ieee754_scalb (x, fn);
+
+ if (__builtin_expect (__isinf (z), 0))
+ {
+ if (__finite (x))
+ return __kernel_standard (x, fn, 32); /* scalb overflow */
+ else
+ __set_errno (ERANGE);
+ }
+ else if (__builtin_expect (z == 0.0, 0) && z != x)
+ return __kernel_standard (x, fn, 33); /* scalb underflow */
+
+ return z;
+}
+
+
+/* Wrapper scalb */
+double
+__scalb (double x, double fn)
+{
+ return (__builtin_expect (_LIB_VERSION == _SVID_, 0)
+ ? sysv_scalb (x, fn)
+ : __ieee754_scalb (x, fn));
}
weak_alias (__scalb, scalb)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_scalbf.c b/libc/math/w_scalbf.c
index 60cb5670e..b8ee3f1b4 100644
--- a/libc/math/w_scalbf.c
+++ b/libc/math/w_scalbf.c
@@ -1,66 +1,53 @@
-/* w_scalbf.c -- float version of w_scalb.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_scalbf.c,v 1.3 1995/05/10 20:49:50 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper scalbf(float x, float fn) is provide for
- * passing various standard test suite. One
- * should use scalbn() instead.
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <errno.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
+
+static float
+__attribute__ ((noinline))
+sysv_scalbf (float x, float fn)
+{
+ float z = __ieee754_scalbf (x, fn);
+
+ if (__builtin_expect (__isinff (z), 0))
+ {
+ if (__finitef (x))
+ return __kernel_standard_f (x, fn, 132); /* scalb overflow */
+ else
+ __set_errno (ERANGE);
+ }
+ else if (__builtin_expect (z == 0.0f, 0) && z != x)
+ return __kernel_standard_f (x, fn, 133); /* scalb underflow */
+
+ return z;
+}
-#include <errno.h>
-#ifdef __STDC__
-#ifdef _SCALB_INT
- float __scalbf(float x, int fn) /* wrapper scalbf */
-#else
- float __scalbf(float x, float fn) /* wrapper scalbf */
-#endif
-#else
- float __scalbf(x,fn) /* wrapper scalbf */
-#ifdef _SCALB_INT
- float x; int fn;
-#else
- float x,fn;
-#endif
-#endif
+/* Wrapper scalbf */
+float
+__scalbf (float x, float fn)
{
-#ifdef _IEEE_LIBM
- return __ieee754_scalbf(x,fn);
-#else
- float z;
- z = __ieee754_scalbf(x,fn);
- if(_LIB_VERSION != _SVID_) return z;
- if(!(__finitef(z)||__isnanf(z))&&__finitef(x)) {
- /* scalbf overflow */
- return (float)__kernel_standard((double)x,(double)fn,132);
- }
- if(z==(float)0.0&&z!=x) {
- /* scalbf underflow */
- return (float)__kernel_standard((double)x,(double)fn,133);
- }
-#ifndef _SCALB_INT
- if(!__finitef(fn)) __set_errno (ERANGE);
-#endif
- return z;
-#endif
+ return (__builtin_expect (_LIB_VERSION == _SVID_, 0)
+ ? sysv_scalbf (x, fn)
+ : __ieee754_scalbf (x, fn));
}
weak_alias (__scalbf, scalbf)
diff --git a/libc/math/w_scalbl.c b/libc/math/w_scalbl.c
index c8a45d460..33fc725e5 100644
--- a/libc/math/w_scalbl.c
+++ b/libc/math/w_scalbl.c
@@ -1,65 +1,53 @@
-/* w_scalbl.c -- long double version of w_scalb.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper scalbl(long double x, long double fn) is provide for
- * passing various standard test suite. One
- * should use scalbnl() instead.
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <errno.h>
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
+
+
+static long double
+__attribute__ ((noinline))
+sysv_scalbl (long double x, long double fn)
+{
+ long double z = __ieee754_scalbl (x, fn);
+
+ if (__builtin_expect (__isinfl (z), 0))
+ {
+ if (__finitel (x))
+ return __kernel_standard (x, fn, 232); /* scalb overflow */
+ else
+ __set_errno (ERANGE);
+ }
+ else if (__builtin_expect (z == 0.0L, 0) && z != x)
+ return __kernel_standard (x, fn, 233); /* scalb underflow */
+
+ return z;
+}
-#include <errno.h>
-#ifdef __STDC__
-#ifdef _SCALB_INT
- long double __scalbl(long double x, int fn) /* wrapper scalbl */
-#else
- long double __scalbl(long double x, long double fn)/* wrapper scalbl */
-#endif
-#else
- long double __scalbl(x,fn) /* wrapper scalbl */
-#ifdef _SCALB_INT
- long double x; int fn;
-#else
- long double x,fn;
-#endif
-#endif
+/* Wrapper scalbl */
+long double
+__scalbl (long double x, long double fn)
{
-#ifdef _IEEE_LIBM
- return __ieee754_scalbl(x,fn);
-#else
- long double z;
- z = __ieee754_scalbl(x,fn);
- if(_LIB_VERSION != _SVID_) return z;
- if(!(__finitel(z)||__isnanl(z))&&__finitel(x)) {
- return __kernel_standard(x,(double)fn,232); /* scalb overflow */
- }
- if(z==0.0&&z!=x) {
- return __kernel_standard(x,(double)fn,233); /* scalb underflow */
- }
-#ifndef _SCALB_INT
- if(!__finitel(fn)) __set_errno (ERANGE);
-#endif
- return z;
-#endif
+ return (__builtin_expect (_LIB_VERSION == _SVID_, 0)
+ ? sysv_scalbl (x, fn)
+ : __ieee754_scalbl (x, fn));
}
weak_alias (__scalbl, scalbl)
diff --git a/libc/math/w_sinh.c b/libc/math/w_sinh.c
index 5bde8a2dd..34ad2d862 100644
--- a/libc/math/w_sinh.c
+++ b/libc/math/w_sinh.c
@@ -10,35 +10,22 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_sinh.c,v 1.6 1995/05/10 20:49:51 jtc Exp $";
-#endif
-
/*
* wrapper sinh(x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __sinh(double x) /* wrapper sinh */
-#else
- double __sinh(x) /* wrapper sinh */
- double x;
-#endif
+double
+__sinh (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_sinh(x);
-#else
- double z;
- z = __ieee754_sinh(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(!__finite(z)&&__finite(x)) {
- return __kernel_standard(x,x,25); /* sinh overflow */
- } else
- return z;
-#endif
+ double z = __ieee754_sinh (x);
+ if (__builtin_expect (!__finite (z), 0) && __finite (x)
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 25); /* sinh overflow */
+
+ return z;
}
weak_alias (__sinh, sinh)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_sinhf.c b/libc/math/w_sinhf.c
index c29c46620..1347e9172 100644
--- a/libc/math/w_sinhf.c
+++ b/libc/math/w_sinhf.c
@@ -8,40 +8,26 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_sinhf.c,v 1.3 1995/05/10 20:49:54 jtc Exp $";
-#endif
-
-/*
+/*
* wrapper sinhf(x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __sinhf(float x) /* wrapper sinhf */
-#else
- float __sinhf(x) /* wrapper sinhf */
- float x;
-#endif
+float
+__sinhf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_sinhf(x);
-#else
- float z;
- z = __ieee754_sinhf(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(!__finitef(z)&&__finitef(x)) {
- /* sinhf overflow */
- return (float)__kernel_standard((double)x,(double)x,125);
- } else
- return z;
-#endif
+ float z = __ieee754_sinhf (x);
+ if (__builtin_expect (!__finitef (z), 0) && __finitef (x)
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 125); /* sinhf overflow */
+
+ return z;
}
weak_alias (__sinhf, sinhf)
diff --git a/libc/math/w_sinhl.c b/libc/math/w_sinhl.c
index 19eb774d6..5e65cf9b9 100644
--- a/libc/math/w_sinhl.c
+++ b/libc/math/w_sinhl.c
@@ -14,34 +14,21 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/*
* wrapper sinhl(x)
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __sinhl(long double x) /* wrapper sinhl */
-#else
- long double __sinhl(x) /* wrapper sinhl */
- long double x;
-#endif
+long double
+__sinhl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_sinhl(x);
-#else
- long double z;
- z = __ieee754_sinhl(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(!__finitel(z)&&__finitel(x)) {
- return __kernel_standard(x,x,225); /* sinh overflow */
- } else
- return z;
-#endif
+ long double z = __ieee754_sinhl (x);
+ if (__builtin_expect (!__finitel (z), 0) && __finitel (x)
+ && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 225); /* sinh overflow */
+
+ return z;
}
weak_alias (__sinhl, sinhl)
diff --git a/libc/math/w_sqrt.c b/libc/math/w_sqrt.c
index 41ab1d18b..8a435ef48 100644
--- a/libc/math/w_sqrt.c
+++ b/libc/math/w_sqrt.c
@@ -1,44 +1,34 @@
-/* @(#)w_sqrt.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_sqrt.c,v 1.6 1995/05/10 20:49:55 jtc Exp $";
-#endif
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper sqrt(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __sqrt(double x) /* wrapper sqrt */
-#else
- double __sqrt(x) /* wrapper sqrt */
- double x;
-#endif
+
+/* wrapper sqrt */
+double
+__sqrt (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrt(x);
-#else
- double z;
- z = __ieee754_sqrt(x);
- if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
- if(x<0.0) {
- return __kernel_standard(x,x,26); /* sqrt(negative) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x < 0.0, 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 26); /* sqrt(negative) */
+
+ return __ieee754_sqrt (x);
}
weak_alias (__sqrt, sqrt)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_sqrtf.c b/libc/math/w_sqrtf.c
index 21beb550f..fc088b622 100644
--- a/libc/math/w_sqrtf.c
+++ b/libc/math/w_sqrtf.c
@@ -1,47 +1,33 @@
-/* w_sqrtf.c -- float version of w_sqrt.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_sqrtf.c,v 1.3 1995/05/10 20:49:59 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper sqrtf(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __sqrtf(float x) /* wrapper sqrtf */
-#else
- float sqrt(x) /* wrapper sqrtf */
- float x;
-#endif
+
+/* wrapper sqrtf */
+float
+__sqrtf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrtf(x);
-#else
- float z;
- z = __ieee754_sqrtf(x);
- if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
- if(x<(float)0.0) {
- /* sqrtf(negative) */
- return (float)__kernel_standard((double)x,(double)x,126);
- } else
- return z;
-#endif
+ if (__builtin_expect (x < 0.0f, 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 126); /* sqrt(negative) */
+
+ return __ieee754_sqrtf (x);
}
weak_alias (__sqrtf, sqrtf)
diff --git a/libc/math/w_sqrtl.c b/libc/math/w_sqrtl.c
index 0b03eebe1..0c446295c 100644
--- a/libc/math/w_sqrtl.c
+++ b/libc/math/w_sqrtl.c
@@ -1,47 +1,33 @@
-/* w_sqrtl.c -- long double version of w_sqrt.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-/*
- * wrapper sqrtl(x)
- */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __sqrtl(long double x) /* wrapper sqrtl */
-#else
- long double __sqrtl(x) /* wrapper sqrtl */
- long double x;
-#endif
+
+/* wrapper sqrtl */
+long double
+__sqrtl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_sqrtl(x);
-#else
- long double z;
- z = __ieee754_sqrtl(x);
- if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
- if(x<0.0) {
- return __kernel_standard(x,x,226); /* sqrt(negative) */
- } else
- return z;
-#endif
+ if (__builtin_expect (x < 0.0L, 0) && _LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 226); /* sqrt(negative) */
+
+ return __ieee754_sqrtl (x);
}
weak_alias (__sqrtl, sqrtl)
diff --git a/libc/math/w_tgamma.c b/libc/math/w_tgamma.c
index 3ce6e77b4..976b5fb95 100644
--- a/libc/math/w_tgamma.c
+++ b/libc/math/w_tgamma.c
@@ -10,35 +10,22 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_gamma.c,v 1.7 1995/11/20 22:06:43 jtc Exp $";
-#endif
-
/* double gamma(double x)
* Return the logarithm of the Gamma function of x or the Gamma function of x,
* depending on the library mode.
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- double __tgamma(double x)
-#else
- double __tgamma(x)
- double x;
-#endif
+double
+__tgamma(double x)
{
- double y;
int local_signgam;
- y = __ieee754_gamma_r(x,&local_signgam);
- if (local_signgam < 0) y = -y;
-#ifdef _IEEE_LIBM
- return y;
-#else
- if(_LIB_VERSION == _IEEE_) return y;
+ double y = __ieee754_gamma_r(x,&local_signgam);
- if(!__finite(y)&&__finite(x)) {
+ if(__builtin_expect(!__finite(y), 0)&&__finite(x)
+ && _LIB_VERSION != _IEEE_) {
if (x == 0.0)
return __kernel_standard(x,x,50); /* tgamma pole */
else if(__floor(x)==x&&x<0.0)
@@ -46,8 +33,7 @@ static char rcsid[] = "$NetBSD: w_gamma.c,v 1.7 1995/11/20 22:06:43 jtc Exp $";
else
return __kernel_standard(x,x,40); /* tgamma overflow */
}
- return y;
-#endif
+ return local_signgam < 0 ? -y : y;
}
weak_alias (__tgamma, tgamma)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/math/w_tgammaf.c b/libc/math/w_tgammaf.c
index d3698059e..48141354e 100644
--- a/libc/math/w_tgammaf.c
+++ b/libc/math/w_tgammaf.c
@@ -13,41 +13,27 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_gammaf.c,v 1.4 1995/11/20 22:06:48 jtc Exp $";
-#endif
-
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- float __tgammaf(float x)
-#else
- float __tgammaf(x)
- float x;
-#endif
+float
+__tgammaf(float x)
{
- float y;
int local_signgam;
- y = __ieee754_gammaf_r(x,&local_signgam);
- if (local_signgam < 0) y = -y;
-#ifdef _IEEE_LIBM
- return y;
-#else
- if(_LIB_VERSION == _IEEE_) return y;
+ float y = __ieee754_gammaf_r(x,&local_signgam);
- if(!__finitef(y)&&__finitef(x)) {
+ if(__builtin_expect(!__finitef(y), 0) && __finitef(x)
+ && _LIB_VERSION != _IEEE_) {
if (x == (float)0.0)
/* tgammaf pole */
- return (float)__kernel_standard((double)x,(double)x,150);
- else if(__floorf(x)==x&&x<(float)0.0)
+ return __kernel_standard_f(x, x, 150);
+ else if(__floorf(x)==x&&x<0.0f)
/* tgammaf domain */
- return (float)__kernel_standard((double)x,(double)x,141);
+ return __kernel_standard_f(x, x, 141);
else
/* tgammaf overflow */
- return (float)__kernel_standard((double)x,(double)x,140);
+ return __kernel_standard_f(x, x, 140);
}
- return y;
-#endif
+ return local_signgam < 0 ? - y : y;
}
weak_alias (__tgammaf, tgammaf)
diff --git a/libc/math/w_tgammal.c b/libc/math/w_tgammal.c
index 75970a34d..6910f923a 100644
--- a/libc/math/w_tgammal.c
+++ b/libc/math/w_tgammal.c
@@ -14,42 +14,28 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* long double gammal(double x)
* Return the Gamma function of x.
*/
#include <math.h>
-#include "math_private.h"
+#include <math_private.h>
-#ifdef __STDC__
- long double __tgammal(long double x)
-#else
- long double __tgammal(x)
- long double x;
-#endif
+long double
+__tgammal(long double x)
{
- long double y;
int local_signgam;
- y = __ieee754_gammal_r(x,&local_signgam);
- if (local_signgam < 0) y = -y;
-#ifdef _IEEE_LIBM
- return y;
-#else
- if(_LIB_VERSION == _IEEE_) return y;
+ long double y = __ieee754_gammal_r(x,&local_signgam);
- if(!__finitel(y)&&__finitel(x)) {
+ if(__builtin_expect(!__finitel(y), 0) && __finitel(x)
+ && _LIB_VERSION != _IEEE_) {
if(x==0.0)
return __kernel_standard(x,x,250); /* tgamma pole */
- else if(__floorl(x)==x&&x<0.0)
+ else if(__floorl(x)==x&&x<0.0L)
return __kernel_standard(x,x,241); /* tgamma domain */
else
return __kernel_standard(x,x,240); /* tgamma overflow */
}
- return y;
-#endif
+ return local_signgam < 0 ? - y : y;
}
weak_alias (__tgammal, tgammal)
diff --git a/libc/misc/Makefile b/libc/misc/Makefile
index f52c9a3c6..dc88e748d 100644
--- a/libc/misc/Makefile
+++ b/libc/misc/Makefile
@@ -35,7 +35,8 @@ headers := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
sys/select.h ustat.h sys/ustat.h bits/ustat.h sys/sysinfo.h \
regexp.h bits/select.h bits/mman.h sys/xattr.h \
syslog.h sys/syslog.h \
- bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h
+ bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \
+ bits/select2.h
routines := brk sbrk sstk ioctl \
readv writev preadv preadv64 pwritev pwritev64 \
diff --git a/libc/misc/bits/select2.h b/libc/misc/bits/select2.h
new file mode 100644
index 000000000..37c4827f1
--- /dev/null
+++ b/libc/misc/bits/select2.h
@@ -0,0 +1,34 @@
+/* Checking macros for select functions.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SELECT_H
+# error "Never include <bits/select2.h> directly; use <sys/select.h> instead."
+#endif
+
+/* Helper functions to issue warnings and errors when needed. */
+extern unsigned long int __fdelt_chk (unsigned long int __d);
+extern unsigned long int __fdelt_warn (unsigned long int __d)
+ __warnattr ("bit outside of fd_set selected");
+#undef __FD_ELT
+#define __FD_ELT(d) \
+ ({ unsigned long int __d = d; \
+ (__builtin_constant_p (__d) \
+ ? (__d >= __FD_SETSIZE \
+ ? __fdelt_warn (__d) : (__d / __NFDBITS)) \
+ : __fdelt_chk (__d)); })
diff --git a/libc/misc/err.c b/libc/misc/err.c
index 6d67c72d2..8dde6edb9 100644
--- a/libc/misc/err.c
+++ b/libc/misc/err.c
@@ -1,5 +1,5 @@
/* 4.4BSD utility functions for error messages.
- Copyright (C) 1995,96,98,2001,02 Free Software Foundation, Inc.
+ Copyright (C) 1995,1996,1998,2001,2002,2011 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
@@ -25,11 +25,9 @@
#include <stdio.h>
#include <gnu/option-groups.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#include <wchar.h>
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
extern char *__progname;
@@ -41,12 +39,11 @@ extern char *__progname;
va_end (ap); \
}
-#ifdef USE_IN_LIBIO
#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
static void
convert_and_print (const char *format, __gnuc_va_list ap)
{
-# define ALLOCA_LIMIT 2000
+#define ALLOCA_LIMIT 2000
size_t len;
wchar_t *wformat = NULL;
mbstate_t st;
@@ -88,13 +85,11 @@ convert_and_print (const char *format, __gnuc_va_list ap)
__vfwprintf (stderr, wformat, ap);
}
#endif
-#endif
void
vwarnx (const char *format, __gnuc_va_list ap)
{
flockfile (stderr);
-#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
{
#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
@@ -106,7 +101,6 @@ vwarnx (const char *format, __gnuc_va_list ap)
#endif
}
else
-#endif
{
fprintf (stderr, "%s: ", __progname);
if (format)
@@ -123,7 +117,6 @@ vwarn (const char *format, __gnuc_va_list ap)
int error = errno;
flockfile (stderr);
-#ifdef USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
{
#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
@@ -140,7 +133,6 @@ vwarn (const char *format, __gnuc_va_list ap)
#endif
}
else
-#endif
{
fprintf (stderr, "%s: ", __progname);
if (format)
diff --git a/libc/misc/getttyent.c b/libc/misc/getttyent.c
index 756017089..6d789c4e2 100644
--- a/libc/misc/getttyent.c
+++ b/libc/misc/getttyent.c
@@ -37,10 +37,8 @@ static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93";
#include <ctype.h>
#include <string.h>
-#ifdef USE_IN_LIBIO
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
static char zapchar;
static FILE *tf;
diff --git a/libc/misc/mntent_r.c b/libc/misc/mntent_r.c
index 6959f0e21..0e9835c61 100644
--- a/libc/misc/mntent_r.c
+++ b/libc/misc/mntent_r.c
@@ -25,10 +25,8 @@
#include <string.h>
#include <sys/types.h>
-#ifdef USE_IN_LIBIO
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
#undef __setmntent
#undef __endmntent
diff --git a/libc/misc/sys/cdefs.h b/libc/misc/sys/cdefs.h
index 165a94a64..72073e855 100644
--- a/libc/misc/sys/cdefs.h
+++ b/libc/misc/sys/cdefs.h
@@ -38,18 +38,27 @@
#ifdef __GNUC__
+/* All functions, except those with callbacks, are leaf functions. */
+# if __GNUC_PREREQ (4, 6) && !defined _LIBC
+# define __LEAF , __leaf__
+# define __LEAF_ATTR __attribute__ ((__leaf__))
+# else
+# define __LEAF
+# define __LEAF_ATTR
+# endif
+
/* GCC can always grok prototypes. For C++ programs we add throw()
to help it optimize the function calls. But this works only with
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
as non-throwing using a function attribute since programs can use
the -fexceptions options for C code as well. */
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
-# define __THROW __attribute__ ((__nothrow__))
-# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+# define __THROW __attribute__ ((__nothrow__ __LEAF))
+# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
# else
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
-# define __NTH(fct) fct throw ()
+# define __NTH(fct) __LEAF_ATTR fct throw ()
# else
# define __THROW
# define __NTH(fct) fct
diff --git a/libc/misc/sys/select.h b/libc/misc/sys/select.h
index f4a37be55..97f2b3d65 100644
--- a/libc/misc/sys/select.h
+++ b/libc/misc/sys/select.h
@@ -1,5 +1,5 @@
/* `fd_set' type and related macros, and `select'/`pselect' declarations.
- Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1996-2003, 2009, 2011 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
@@ -54,14 +54,12 @@ typedef __suseconds_t suseconds_t;
/* The fd_set member is required to be an array of longs. */
typedef long int __fd_mask;
-/* Some versions of <linux/posix_types.h> define these macros. */
+/* Some versions of <linux/posix_types.h> define this macros. */
#undef __NFDBITS
-#undef __FDELT
-#undef __FDMASK
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
#define __NFDBITS (8 * (int) sizeof (__fd_mask))
-#define __FDELT(d) ((d) / __NFDBITS)
-#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
+#define __FD_ELT(d) ((d) / __NFDBITS)
+#define __FD_MASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
/* fd_set for select and pselect. */
typedef struct
@@ -125,6 +123,12 @@ extern int pselect (int __nfds, fd_set *__restrict __readfds,
const __sigset_t *__restrict __sigmask);
#endif
+
+/* Define some inlines helping to catch common problems. */
+#if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__
+# include <bits/select2.h>
+#endif
+
__END_DECLS
#endif /* sys/select.h */
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index caae5dcf3..7b0676381 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,78 @@
+2011-10-23 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/i386/tls.h: Remove #include <list.h>.
+
+2011-10-15 Ulrich Drepper <drepper@gmail.com>
+
+ * pthread_create.c (start_thread): Call __ctype_init.
+
+2011-09-15 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/pthread/list.h: Define only list_t if __need_list_t is
+ defined.
+ (list_add): Add atomic_write_barrier.
+ * descr.h: Define __need_list_t before including <list.h>.
+ * nptl-init.c: Include <list.h>
+ * allocatestack.c: Likewise.
+
+2011-09-11 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/i386/tls.h: Remove HAVE_TLS_SUPPORT test.
+ * sysdeps/ia64/tls.h: Likewise.
+ * sysdeps/powerpc/tls.h: Likewise.
+ * sysdeps/s390/tls.h: Likewise.
+ * sysdeps/sh/tls.h: Likewise.
+ * sysdeps/sparc/tls.h: Likewise.
+ * sysdeps/x86_64/tls.h: Likewise.
+
+2011-09-10 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/pthread/malloc-machine.h: Define MUTEX_INITIALIZER.
+
+ * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Don't handle
+ !USE___THREAD.
+ * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
+ * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
+
+ * tst-tls1.c: Support for __thread is now mandatory.
+ * tst-tls2.c: Likewise.
+ * tst-tls3.c: Likewise.
+ * tst-tls3mod.c: Likewise.
+ * tst-tls4.c: Likewise.
+ * tst-tls4moda.c: Likewise.
+ * tst-tls4modb.c: Likewise.
+ * tst-tls5.h: Likewise.
+
+2011-09-08 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #12403]
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+ (pthread_rwlock_timedwrlock): Use correct macro in test.
+ Patch by H.J. Lu <hongjiu.lu@intel.com>.
+
+2011-09-06 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
+ use gettimeofday vsyscall, just call gettimeofday.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
+ Simplify __vdso_clock_gettime use.
+
2011-09-05 David S. Miller <davem@davemloft.net>
* sysdeps/unix/sysv/linux/sem_timedwait.c (do_futex_timed_wait):
diff --git a/libc/nptl/allocatestack.c b/libc/nptl/allocatestack.c
index 23d2ce559..36b4aa16f 100644
--- a/libc/nptl/allocatestack.c
+++ b/libc/nptl/allocatestack.c
@@ -28,6 +28,7 @@
#include <dl-sysdep.h>
#include <dl-tls.h>
#include <tls.h>
+#include <list.h>
#include <lowlevellock.h>
#include <kernel-features.h>
diff --git a/libc/nptl/descr.h b/libc/nptl/descr.h
index 9c366e740..e57e29e31 100644
--- a/libc/nptl/descr.h
+++ b/libc/nptl/descr.h
@@ -26,6 +26,7 @@
#include <stdbool.h>
#include <sys/types.h>
#include <hp-timing.h>
+#define __need_list_t
#include <list.h>
#include <lowlevellock.h>
#include <pthreaddef.h>
diff --git a/libc/nptl/nptl-init.c b/libc/nptl/nptl-init.c
index 33492c160..db45cab23 100644
--- a/libc/nptl/nptl-init.c
+++ b/libc/nptl/nptl-init.c
@@ -29,6 +29,7 @@
#include <atomic.h>
#include <ldsodefs.h>
#include <tls.h>
+#include <list.h>
#include <fork.h>
#include <version.h>
#include <shlib-compat.h>
diff --git a/libc/nptl/pthread_create.c b/libc/nptl/pthread_create.c
index 649cdae8f..499e92e88 100644
--- a/libc/nptl/pthread_create.c
+++ b/libc/nptl/pthread_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007,2008,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007,2008,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <ctype.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -242,6 +243,9 @@ start_thread (void *arg)
__resp = &pd->res;
#endif
+ /* Initialize pointers to locale data. */
+ __ctype_init ();
+
/* Allow setxid from now onwards. */
if (__builtin_expect (atomic_exchange_acq (&pd->setxid_futex, 0) == -2, 0))
lll_futex_wake (&pd->setxid_futex, 1, LLL_PRIVATE);
diff --git a/libc/nptl/sysdeps/i386/tls.h b/libc/nptl/sysdeps/i386/tls.h
index f23977e73..3d7433897 100644
--- a/libc/nptl/sysdeps/i386/tls.h
+++ b/libc/nptl/sysdeps/i386/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. nptl/i386 version.
- Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2009, 2011 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
@@ -26,7 +26,6 @@
# include <stddef.h>
# include <stdint.h>
# include <stdlib.h>
-# include <list.h>
# include <sysdep.h>
# include <kernel-features.h>
@@ -70,11 +69,6 @@ typedef struct
#endif
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
/* Alignment requirement for the stack. For IA-32 this is governed by
the SSE memory functions. */
#define STACK_ALIGN 16
@@ -261,7 +255,7 @@ union user_desc_init
The contained asm must *not* be marked volatile since otherwise
assignments like
- pthread_descr self = thread_self();
+ pthread_descr self = thread_self();
do not get optimized away. */
# define THREAD_SELF \
({ struct pthread *__self; \
diff --git a/libc/nptl/sysdeps/ia64/tls.h b/libc/nptl/sysdeps/ia64/tls.h
index 936ff01a7..c2a092663 100644
--- a/libc/nptl/sysdeps/ia64/tls.h
+++ b/libc/nptl/sysdeps/ia64/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. nptl/IA-64 version.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -56,11 +56,6 @@ register struct pthread *__thread_self __asm__("r13");
#endif
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
/* Alignment requirement for the stack. */
#define STACK_ALIGN 16
diff --git a/libc/nptl/sysdeps/powerpc/tls.h b/libc/nptl/sysdeps/powerpc/tls.h
index 0f4d5290d..09f7484c8 100644
--- a/libc/nptl/sysdeps/powerpc/tls.h
+++ b/libc/nptl/sysdeps/powerpc/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/PowerPC version.
- Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2006, 2007, 2011 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
@@ -43,11 +43,6 @@ typedef union dtv
#endif /* __ASSEMBLER__ */
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
#ifndef __ASSEMBLER__
/* Get system call information. */
diff --git a/libc/nptl/sysdeps/pthread/list.h b/libc/nptl/sysdeps/pthread/list.h
index 6ddccb9fb..cfc4abad3 100644
--- a/libc/nptl/sysdeps/pthread/list.h
+++ b/libc/nptl/sysdeps/pthread/list.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -18,27 +18,39 @@
02111-1307 USA. */
#ifndef _LIST_H
-#define _LIST_H 1
+
+#ifndef __need_list_t
+# define _LIST_H 1
+#endif
/* The definitions of this file are adopted from those which can be
found in the Linux kernel headers to enable people familiar with
the latter find their way in these sources as well. */
+#if defined __need_list_t || defined _LIST_H
+# ifndef __list_t_defined
+# define __list_t_defined
/* Basic type for the double-link list. */
typedef struct list_head
{
struct list_head *next;
struct list_head *prev;
} list_t;
+# endif
+# undef __need_list_t
+#endif
+
+#ifdef _LIST_H
+# include <atomic.h>
/* Define a variable with the head and tail of the list. */
-#define LIST_HEAD(name) \
+# define LIST_HEAD(name) \
list_t name = { &(name), &(name) }
/* Initialize a new list head. */
-#define INIT_LIST_HEAD(ptr) \
+# define INIT_LIST_HEAD(ptr) \
(ptr)->next = (ptr)->prev = (ptr)
@@ -49,6 +61,7 @@ list_add (list_t *newp, list_t *head)
newp->next = head->next;
newp->prev = head;
head->next->prev = newp;
+ atomic_write_barrier ();
head->next = newp;
}
@@ -78,26 +91,28 @@ list_splice (list_t *add, list_t *head)
/* Get typed element from list at a given position. */
-#define list_entry(ptr, type, member) \
+# define list_entry(ptr, type, member) \
((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
/* Iterate forward over the elements of the list. */
-#define list_for_each(pos, head) \
+# define list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
/* Iterate forward over the elements of the list. */
-#define list_for_each_prev(pos, head) \
+# define list_for_each_prev(pos, head) \
for (pos = (head)->prev; pos != (head); pos = pos->prev)
/* Iterate backwards over the elements list. The list elements can be
removed from the list while doing this. */
-#define list_for_each_prev_safe(pos, p, head) \
+# define list_for_each_prev_safe(pos, p, head) \
for (pos = (head)->prev, p = pos->prev; \
pos != (head); \
pos = p, p = pos->prev)
+#endif /* _LIST_H */
+
#endif /* list.h */
diff --git a/libc/nptl/sysdeps/pthread/malloc-machine.h b/libc/nptl/sysdeps/pthread/malloc-machine.h
index e99aaa781..73503aee0 100644
--- a/libc/nptl/sysdeps/pthread/malloc-machine.h
+++ b/libc/nptl/sysdeps/pthread/malloc-machine.h
@@ -1,6 +1,6 @@
/* Basic platform-independent macro definitions for mutexes,
thread-specific data and parameters for malloc.
- Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2007, 2008, 2011 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
@@ -32,6 +32,7 @@ __libc_lock_define (typedef, mutex_t)
#define mutex_lock(m) __libc_lock_lock (*(m))
#define mutex_trylock(m) __libc_lock_trylock (*(m))
#define mutex_unlock(m) __libc_lock_unlock (*(m))
+#define MUTEX_INITIALIZER LLL_LOCK_INITIALIZER
/* This is defined by newer gcc version unique for each module. */
extern void *__dso_handle __attribute__ ((__weak__));
diff --git a/libc/nptl/sysdeps/s390/tls.h b/libc/nptl/sysdeps/s390/tls.h
index 2b38ed4e7..52fe351fb 100644
--- a/libc/nptl/sysdeps/s390/tls.h
+++ b/libc/nptl/sysdeps/s390/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/s390 version.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2011 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
@@ -66,11 +66,6 @@ typedef struct
#endif
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
/* Alignment requirement for the stack. For IA-32 this is governed by
the SSE memory functions. */
#define STACK_ALIGN 16
diff --git a/libc/nptl/sysdeps/sh/tls.h b/libc/nptl/sysdeps/sh/tls.h
index a2d4d565f..908e45587 100644
--- a/libc/nptl/sysdeps/sh/tls.h
+++ b/libc/nptl/sysdeps/sh/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/SH version.
- Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2006, 2007, 2011 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
@@ -55,11 +55,6 @@ typedef struct
#endif /* __ASSEMBLER__ */
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
#ifndef __ASSEMBLER__
/* Get system call information. */
@@ -116,7 +111,7 @@ typedef struct
/* Return the thread descriptor for the current thread.
The contained asm must *not* be marked volatile since otherwise
assignments like
- struct pthread *self = thread_self();
+ struct pthread *self = thread_self();
do not get optimized away. */
# define THREAD_SELF \
({ struct pthread *__self; \
diff --git a/libc/nptl/sysdeps/sparc/tls.h b/libc/nptl/sysdeps/sparc/tls.h
index dc1b3868c..64ede5a89 100644
--- a/libc/nptl/sysdeps/sparc/tls.h
+++ b/libc/nptl/sysdeps/sparc/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. NPTL/sparc version.
- Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2006, 2007, 2011 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
@@ -65,10 +65,6 @@ typedef struct
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
#ifndef __ASSEMBLER__
/* Get system call information. */
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
index 86992c877..9f3e63520 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2008,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -81,18 +81,13 @@ __new_sem_post:
4:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
-#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
+#ifdef NO_TLS_DIRECT_SEG_REFS
movl errno@gotntpoff(%ebx), %edx
addl %gs:0, %edx
movl $EINVAL, (%edx)
-# else
+#else
movl errno@gotntpoff(%ebx), %edx
movl $EINVAL, %gs:(%edx)
-# endif
-#else
- call __errno_location@plt
- movl $EINVAL, (%eax)
#endif
orl $-1, %eax
@@ -107,18 +102,13 @@ __new_sem_post:
5:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
-#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
+#ifdef NO_TLS_DIRECT_SEG_REFS
movl errno@gotntpoff(%ebx), %edx
addl %gs:0, %edx
movl $EOVERFLOW, (%edx)
-# else
+#else
movl errno@gotntpoff(%ebx), %edx
movl $EOVERFLOW, %gs:(%edx)
-# endif
-#else
- call __errno_location@plt
- movl $EOVERFLOW, (%eax)
#endif
orl $-1, %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
index 18013a8df..ee46ab936 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005, 2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -154,18 +154,13 @@ sem_timedwait:
4:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
-#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
+#ifdef NO_TLS_DIRECT_SEG_REFS
movl errno@gotntpoff(%ebx), %edx
addl %gs:0, %edx
movl %esi, (%edx)
-# else
+#else
movl errno@gotntpoff(%ebx), %edx
movl %esi, %gs:(%edx)
-# endif
-#else
- call __errno_location@plt
- movl %esi, (%eax)
#endif
movl 28(%esp), %ebx /* Load semaphore address. */
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
index 2d49934f0..18adb9a09 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -49,18 +49,13 @@ __new_sem_trywait:
3:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ecx
-#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
+#ifdef NO_TLS_DIRECT_SEG_REFS
movl errno@gotntpoff(%ecx), %edx
addl %gs:0, %edx
movl $EAGAIN, (%edx)
-# else
+#else
movl errno@gotntpoff(%ecx), %edx
movl $EAGAIN, %gs:(%edx)
-# endif
-#else
- call __errno_location@plt
- movl $EAGAIN, (%eax)
#endif
orl $-1, %eax
ret
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
index 93c0a64a9..fb8a39843 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -114,18 +114,13 @@ __new_sem_wait:
8:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
-#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
+#ifdef NO_TLS_DIRECT_SEG_REFS
movl errno@gotntpoff(%ebx), %edx
addl %gs:0, %edx
movl %esi, (%edx)
-# else
+#else
movl errno@gotntpoff(%ebx), %edx
movl %esi, %gs:(%edx)
-# endif
-#else
- call __errno_location@plt
- movl %esi, (%eax)
#endif
orl $-1, %eax
@@ -228,13 +223,13 @@ sem_wait_cleanup:
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 8
.byte 0x83 # DW_CFA_offset %ebx
- .uleb128 2
+ .uleb128 2
.byte 4 # DW_CFA_advance_loc4
.long .Lpush_esi-.Lpush_ebx
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 12
.byte 0x86 # DW_CFA_offset %esi
- .uleb128 3
+ .uleb128 3
.byte 4 # DW_CFA_advance_loc4
.long .Lsub_esp-.Lpush_esi
.byte 14 # DW_CFA_def_cfa_offset
@@ -250,9 +245,9 @@ sem_wait_cleanup:
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 16
.byte 0x83 # DW_CFA_offset %ebx
- .uleb128 2
+ .uleb128 2
.byte 0x86 # DW_CFA_offset %esi
- .uleb128 3
+ .uleb128 3
.align 4
.LENDFDE:
@@ -333,18 +328,13 @@ __old_sem_wait:
4:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
-#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
+#ifdef NO_TLS_DIRECT_SEG_REFS
movl errno@gotntpoff(%ebx), %edx
addl %gs:0, %edx
movl %esi, (%edx)
-# else
+#else
movl errno@gotntpoff(%ebx), %edx
movl %esi, %gs:(%edx)
-# endif
-#else
- call __errno_location@plt
- movl %esi, (%eax)
#endif
orl $-1, %eax
jmp 5b
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
index c4d52860d..8687ba46a 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
@@ -27,13 +27,12 @@
# undef PSEUDO
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSDEP_CANCEL_ERRNO __libc_errno
-# else
-# define SYSDEP_CANCEL_ERRNO errno
-# endif
-# define SYSDEP_CANCEL_ERROR(args) \
+# ifndef NOT_IN_libc
+# define SYSDEP_CANCEL_ERRNO __libc_errno
+# else
+# define SYSDEP_CANCEL_ERRNO errno
+# endif
+# define SYSDEP_CANCEL_ERROR(args) \
.section .gnu.linkonce.t.__syscall_error_##args, "ax"; \
.align 32; \
.proc __syscall_error_##args; \
@@ -53,28 +52,6 @@ __syscall_error_##args: \
add loc4 = loc4, r13;; \
st4 [loc4] = loc3; \
mov ar.pfs = loc0
-# else
-# define SYSDEP_CANCEL_ERROR(args) \
-.section .gnu.linkonce.t.__syscall_error_##args, "ax"; \
- .align 32; \
- .proc __syscall_error_##args; \
- .global __syscall_error_##args; \
- .hidden __syscall_error_##args; \
- .size __syscall_error_##args, 64; \
-__syscall_error_##args: \
- .prologue; \
- .regstk args, 5, args, 0; \
- .save ar.pfs, loc0; \
- .save rp, loc1; \
- .body; \
- mov loc4 = r1;; \
- br.call.sptk.many b0 = __errno_location;; \
- st4 [r8] = loc3; \
- mov r1 = loc4; \
- mov rp = loc1; \
- mov r8 = -1; \
- mov ar.pfs = loc0
-# endif
# ifndef USE_DL_SYSINFO
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S
index 4a154fc64..c3dd6825f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2008, 2011 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
@@ -65,7 +65,7 @@ __new_sem_post:
3:
mov #EOVERFLOW, r2
-4:
+4:
mov.l r12, @-r15
mov.l r8, @-r15
sts.l pr, @-r15
@@ -73,7 +73,6 @@ __new_sem_post:
mov.l .Lgot3, r12
add r0, r12
-#if USE___THREAD
mov.l .Lerrno3, r0
stc gbr, r1
mov.l @(r0, r12), r0
@@ -84,14 +83,6 @@ __new_sem_post:
.long errno@GOTTPOFF
.Lexit:
mov.l r2, @r0
-#else
- mov r2, r8
- mov.l .Lerrloc3, r1
- bsrf r1
- nop
-.Lerrloc3b:
- mov r8, @r0
-#endif
lds.l @r15+, pr
mov.l @r15+, r8
mov.l @r15+, r12
@@ -103,9 +94,5 @@ __new_sem_post:
.long SEM_VALUE_MAX
.Lgot3:
.long _GLOBAL_OFFSET_TABLE_
-#if !USE___THREAD
-.Lerrloc3:
- .long __errno_location@PLT-(.Lerrloc3b-.)
-#endif
.size __new_sem_post,.-__new_sem_post
versioned_symbol(libpthread, __new_sem_post, sem_post, GLIBC_2_1)
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S
index 7924e8759..d57986150 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2011 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
@@ -131,7 +131,7 @@ sem_timedwait:
mov r10, r4
bsrf r1
mov r0, r10
-.Ldisable0b:
+.Ldisable0b:
mov r10, r0
.LcleanupEND:
@@ -173,7 +173,6 @@ sem_timedwait:
mov.l .Lgot2, r12
add r0, r12
-#if USE___THREAD
mov.l .Lerrno2, r0
stc gbr, r1
mov.l @(r0, r12), r0
@@ -181,14 +180,8 @@ sem_timedwait:
add r1, r0
.align 2
.Lerrno2:
- .long errno@GOTTPOFF
+ .long errno@GOTTPOFF
.Lexit:
-#else
- mov.l .Lerrloc2, r1
- bsrf r1
- nop
-.Lerrloc2b:
-#endif
mov.l r10, @r0
DEC (@(NWAITERS,r8), r2)
bra 10b
@@ -201,10 +194,6 @@ sem_timedwait:
.long 1000000000
.Lgot2:
.long _GLOBAL_OFFSET_TABLE_
-#if !USE___THREAD
-.Lerrloc2:
- .long __errno_location@PLT-(.Lerrloc2b-.)
-#endif
.Lenable0:
.long __pthread_enable_asynccancel-.Lenable0b
.Ldisable0:
@@ -213,7 +202,7 @@ sem_timedwait:
.type sem_wait_cleanup,@function
sem_wait_cleanup:
- DEC (@(NWAITERS,r8), r2)
+ DEC (@(NWAITERS,r8), r2)
.LcallUR:
mov.l .Lresume, r1
#ifdef PIC
@@ -314,25 +303,25 @@ sem_wait_cleanup:
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 4
.byte 0x88 ! DW_CFA_offset r8
- .uleb128 1
+ .uleb128 1
.byte 4 ! DW_CFA_advance_loc4
.ualong .Lpush_r9-.Lpush_r8
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 8
.byte 0x89 ! DW_CFA_offset r9
- .uleb128 2
+ .uleb128 2
.byte 4 ! DW_CFA_advance_loc4
.ualong .Lpush_r10-.Lpush_r9
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 12
.byte 0x8a ! DW_CFA_offset r10
- .uleb128 3
+ .uleb128 3
.byte 4 ! DW_CFA_advance_loc4
.ualong .Lpush_r12-.Lpush_r10
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 16
.byte 0x8c ! DW_CFA_offset r12
- .uleb128 4
+ .uleb128 4
.byte 4 ! DW_CFA_advance_loc4
.ualong .Lpush_pr-.Lpush_r12
.byte 14 ! DW_CFA_def_cfa_offset
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S
index 835e37db9..183aac6bc 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_trywait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2011 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
@@ -57,7 +57,6 @@ __new_sem_trywait:
mov.l .Lgot1, r12
add r0, r12
-#if USE___THREAD
mov.l .Lerrno1, r0
stc gbr, r1
mov.l @(r0, r12), r0
@@ -67,12 +66,6 @@ __new_sem_trywait:
.Lerrno1:
.long errno@GOTTPOFF
.Lexit:
-#else
- mov.l .Lerrloc1, r1
- bsrf r1
- nop
-.Lerrloc1b:
-#endif
mov.l r8, @r0
lds.l @r15+, pr
mov.l @r15+, r8
@@ -83,9 +76,5 @@ __new_sem_trywait:
.align 2
.Lgot1:
.long _GLOBAL_OFFSET_TABLE_
-#if !USE___THREAD
-.Lerrloc1:
- .long __errno_location@PLT-(.Lerrloc1b-.)
-#endif
.size __new_sem_trywait,.-__new_sem_trywait
versioned_symbol(libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1)
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S
index 6ef7fcf0c..aed8609fd 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2011 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
@@ -68,7 +68,7 @@ __new_sem_wait:
.Lafter_ret:
1:
INC (@(NWAITERS,r8),r2)
-
+
.LcleanupSTART:
6:
mov.l .Lenable0, r1
@@ -96,7 +96,7 @@ __new_sem_wait:
mov r10, r4
bsrf r1
mov r0, r10
-.Ldisable0b:
+.Ldisable0b:
mov r10, r0
.LcleanupEND:
@@ -131,7 +131,6 @@ __new_sem_wait:
mov.l .Lgot0, r12
add r0, r12
-#if USE___THREAD
mov.l .Lerrno0, r0
stc gbr, r1
mov.l @(r0, r12), r0
@@ -141,12 +140,6 @@ __new_sem_wait:
.Lerrno0:
.long errno@GOTTPOFF
.Lexit:
-#else
- mov.l .Lerrloc0, r1
- bsrf r1
- nop
-.Lerrloc0b:
-#endif
mov.l r8, @r0
bra 9b
mov #-1, r0
@@ -154,10 +147,6 @@ __new_sem_wait:
.align 2
.Lgot0:
.long _GLOBAL_OFFSET_TABLE_
-#if !USE___THREAD
-.Lerrloc0:
- .long __errno_location@PLT-(.Lerrloc0b-.)
-#endif
.Lenable0:
.long __pthread_enable_asynccancel-.Lenable0b
.Ldisable0:
@@ -168,7 +157,7 @@ __new_sem_wait:
.type sem_wait_cleanup,@function
sem_wait_cleanup:
- DEC (@(NWAITERS,r8), r2)
+ DEC (@(NWAITERS,r8), r2)
.LcallUR:
mov.l .Lresume, r1
#ifdef PIC
@@ -269,25 +258,25 @@ sem_wait_cleanup:
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 4
.byte 0x88 ! DW_CFA_offset r8
- .uleb128 1
+ .uleb128 1
.byte 4 ! DW_CFA_advance_loc4
.ualong .Lpush_r10-.Lpush_r8
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 8
.byte 0x8a ! DW_CFA_offset r10
- .uleb128 2
+ .uleb128 2
.byte 4 ! DW_CFA_advance_loc4
.ualong .Lpush_r12-.Lpush_r10
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 12
.byte 0x8c ! DW_CFA_offset r12
- .uleb128 3
+ .uleb128 3
.byte 4 ! DW_CFA_advance_loc4
.ualong .Lpush_pr-.Lpush_r12
.byte 14 ! DW_CFA_def_cfa_offset
.uleb128 16
.byte 0x91 ! DW_CFA_offset pr
- .uleb128 4
+ .uleb128 4
.align 4
.LENDFDE:
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 3195db259..018da0cc5 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -68,10 +68,6 @@
#endif
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
-
.globl __lll_lock_wait_private
.type __lll_lock_wait_private,@function
.hidden __lll_lock_wait_private
@@ -250,10 +246,9 @@ __lll_timedlock_wait:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- /* This is a regular function call, all caller-save registers
- might be clobbered. */
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
@@ -402,8 +397,9 @@ __lll_timedwait_tid:
/* Get current time. */
2: movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
index 5218a4f57..b7b8b3498 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002=2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2011=2007, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -50,9 +50,6 @@
orl $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
#endif
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.globl __lll_robust_lock_wait
.type __lll_robust_lock_wait,@function
@@ -219,10 +216,9 @@ __lll_robust_timedlock_wait:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- /* This is a regular function call, all caller-save registers
- might be clobbered. */
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 48ea8b967..d11b29746 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -26,9 +26,6 @@
#include <kernel-features.h>
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
@@ -453,13 +450,11 @@ __pthread_cond_timedwait:
movq __vdso_clock_gettime@GOTPCREL(%rip), %rax
movq (%rax), %rax
PTR_DEMANGLE (%rax)
- jz 26f
call *%rax
- jmp 27f
-# endif
-26: movl $__NR_clock_gettime, %eax
+# else
+ movl $__NR_clock_gettime, %eax
syscall
-27:
+# endif
# ifndef __ASSUME_POSIX_TIMERS
cmpq $-ENOSYS, %rax
je 19f
@@ -473,8 +468,9 @@ __pthread_cond_timedwait:
# else
leaq 24(%rsp), %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 40(%rsp), %rax
@@ -611,8 +607,9 @@ __pthread_cond_timedwait:
/* clock_gettime not available. */
19: leaq 32(%rsp), %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 40(%rsp), %rax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
index f5d055c77..0e6a6ee8b 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005,2007,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,10 +23,6 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl pthread_rwlock_timedrdlock
@@ -123,8 +119,9 @@ pthread_rwlock_timedrdlock:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index 6ed8b49bd..57168d9b0 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010, 2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,10 +24,6 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl pthread_rwlock_timedwrlock
@@ -120,8 +117,9 @@ pthread_rwlock_timedwrlock:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
@@ -192,7 +190,7 @@ pthread_rwlock_timedwrlock:
7: movq %rdx, %rax
-#ifndef __ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
addq $16, %rsp
cfi_adjust_cfa_offset(-16)
popq %r14
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
index 979b1bf1d..4691e4d68 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2008,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -62,29 +62,15 @@ sem_post:
retq
1:
-#if USE___THREAD
movl $EINVAL, %eax
-#else
- callq __errno_location@plt
- movl $EINVAL, %edx
-#endif
jmp 4f
3:
-#if USE___THREAD
movl $EOVERFLOW, %eax
-#else
- callq __errno_location@plt
- movl $EOVERFLOW, %edx
-#endif
4:
-#if USE___THREAD
movq errno@gottpoff(%rip), %rdx
movl %eax, %fs:(%rdx)
-#else
- movl %edx, (%rax)
-#endif
orl $-1, %eax
retq
.size sem_post,.-sem_post
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
index ca49cb89d..576a49496 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2005,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -24,10 +24,6 @@
#include <pthread-errnos.h>
#include <structsem.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl sem_timedwait
@@ -147,39 +143,24 @@ sem_timedwait:
cfi_adjust_cfa_offset(8)
3: negq %r9
-#if USE___THREAD
movq errno@gottpoff(%rip), %rdx
movl %r9d, %fs:(%rdx)
-#else
- callq __errno_location@plt
- movl %r9d, (%rax)
-#endif
orl $-1, %eax
jmp 15b
cfi_adjust_cfa_offset(-8)
6:
-#if USE___THREAD
movq errno@gottpoff(%rip), %rdx
movl $EINVAL, %fs:(%rdx)
-#else
- callq __errno_location@plt
- movl $EINVAL, (%rax)
-#endif
orl $-1, %eax
retq
16:
-#if USE___THREAD
movq errno@gottpoff(%rip), %rdx
movl $ETIMEDOUT, %fs:(%rdx)
-#else
- callq __errno_location@plt
- movl $ETIMEDOUT, (%rax)
-#endif
orl $-1, %eax
@@ -212,9 +193,10 @@ sem_timedwait:
addq $1, NWAITERS(%r12)
7: xorl %esi, %esi
- movq %rsp, %rdi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ movq %rsp,%rdi
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
@@ -306,13 +288,8 @@ sem_timedwait:
cfi_rel_offset(%r14, STACKFRAME)
33: negq %r14
36:
-#if USE___THREAD
movq errno@gottpoff(%rip), %rdx
movl %r14d, %fs:(%rdx)
-#else
- callq __errno_location@plt
- movl %r14d, (%rax)
-#endif
orl $-1, %eax
jmp 45b
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S
index a5719cadd..64652c46f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_trywait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -41,13 +41,8 @@ sem_trywait:
retq
1:
-#if USE___THREAD
movq errno@gottpoff(%rip), %rdx
movl $EAGAIN, %fs:(%rdx)
-#else
- callq __errno_location@plt
- movl $EAGAIN, (%rax)
-#endif
orl $-1, %eax
retq
.size sem_trywait,.-sem_trywait
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
index 2cf6ec10a..3ea714a75 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -125,14 +125,8 @@ sem_wait:
cfi_adjust_cfa_offset(8)
4: negq %rcx
-#if USE___THREAD
movq errno@gottpoff(%rip), %rdx
movl %ecx, %fs:(%rdx)
-#else
-# error "not supported. %rcx and %rdi must be preserved"
- callq __errno_location@plt
- movl %ecx, (%rax)
-#endif
orl $-1, %eax
jmp 9b
diff --git a/libc/nptl/sysdeps/x86_64/tls.h b/libc/nptl/sysdeps/x86_64/tls.h
index 41b5e6daa..95e022b0e 100644
--- a/libc/nptl/sysdeps/x86_64/tls.h
+++ b/libc/nptl/sysdeps/x86_64/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. nptl/x86_64 version.
- Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2008, 2009, 2011 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
@@ -80,11 +80,6 @@ typedef struct
#endif
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
/* Alignment requirement for the stack. */
#define STACK_ALIGN 16
diff --git a/libc/nptl/tst-tls1.c b/libc/nptl/tst-tls1.c
index 4e191222a..f79db4a1c 100644
--- a/libc/nptl/tst-tls1.c
+++ b/libc/nptl/tst-tls1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -22,7 +22,6 @@
#include <stdlib.h>
-#if HAVE___THREAD
struct test_s
{
int a;
@@ -52,19 +51,11 @@ tf (void *arg)
return NULL;
}
-#endif
int
do_test (void)
{
-#if !HAVE___THREAD
-
- puts ("No __thread support in compiler, test skipped.");
-
- return 0;
-#else
-
if (s.a != INIT_A || s.b != INIT_B)
{
puts ("initial value of s in main thread wrong");
@@ -114,7 +105,6 @@ do_test (void)
}
return 0;
-#endif
}
diff --git a/libc/nptl/tst-tls2.c b/libc/nptl/tst-tls2.c
index 73ed33eb6..ff3ab3a02 100644
--- a/libc/nptl/tst-tls2.c
+++ b/libc/nptl/tst-tls2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <unistd.h>
-#if HAVE___THREAD
#define N 10
static pthread_t th[N];
@@ -106,18 +105,11 @@ tf (void *arg)
return NULL;
}
-#endif
+
int
do_test (void)
{
-#if !HAVE___THREAD
-
- puts ("No __thread support in compiler, test skipped.");
-
- return 0;
-#else
-
if (pthread_barrier_init (&b, NULL, N + 1) != 0)
{
puts ("barrier_init failed");
@@ -207,7 +199,6 @@ do_test (void)
}
return 0;
-#endif
}
diff --git a/libc/nptl/tst-tls3.c b/libc/nptl/tst-tls3.c
index 8c2663bb0..87883b0bd 100644
--- a/libc/nptl/tst-tls3.c
+++ b/libc/nptl/tst-tls3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -73,13 +73,6 @@ int nsigs;
int
do_test (void)
{
-#if !HAVE___THREAD
-
- puts ("No __thread support in compiler, test skipped.");
-
- return 0;
-#else
-
if ((uintptr_t) pthread_self () & (TCB_ALIGNMENT - 1))
{
puts ("initial thread's struct pthread not aligned enough");
@@ -206,7 +199,6 @@ do_test (void)
}
return 0;
-#endif
}
diff --git a/libc/nptl/tst-tls3mod.c b/libc/nptl/tst-tls3mod.c
index 4cb96452e..8ca9956d6 100644
--- a/libc/nptl/tst-tls3mod.c
+++ b/libc/nptl/tst-tls3mod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -26,7 +26,6 @@
#include <unistd.h>
#include <pthreaddef.h>
-#if HAVE___THREAD
extern pthread_barrier_t b;
@@ -88,5 +87,3 @@ tf (void *arg)
return NULL;
}
-
-#endif
diff --git a/libc/nptl/tst-tls4.c b/libc/nptl/tst-tls4.c
index 52775dee8..d33c97216 100644
--- a/libc/nptl/tst-tls4.c
+++ b/libc/nptl/tst-tls4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -25,7 +25,6 @@
#include <unistd.h>
#include <tls.h>
-#if HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
#define N 3
@@ -181,11 +180,4 @@ do_test (void)
#define TIMEOUT 5
#define TEST_FUNCTION do_test ()
-
-#else
-
-#define TEST_FUNCTION 0
-
-#endif
-
#include "../test-skeleton.c"
diff --git a/libc/nptl/tst-tls4moda.c b/libc/nptl/tst-tls4moda.c
index ff7ee5604..4f16a3691 100644
--- a/libc/nptl/tst-tls4moda.c
+++ b/libc/nptl/tst-tls4moda.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -22,7 +22,6 @@
#include <unistd.h>
#include <tls.h>
-#if HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
static __thread unsigned char foo [32]
__attribute__ ((tls_model ("initial-exec"), aligned (sizeof (void *))));
@@ -35,7 +34,7 @@ test1 (void)
for (s = 0; s < sizeof (foo); ++s)
{
if (foo [s])
- abort ();
+ abort ();
foo [s] = s;
}
}
@@ -48,9 +47,7 @@ test2 (void)
for (s = 0; s < sizeof (foo); ++s)
{
if (foo [s] != s)
- abort ();
+ abort ();
foo [s] = sizeof (foo) - s;
}
}
-
-#endif
diff --git a/libc/nptl/tst-tls4modb.c b/libc/nptl/tst-tls4modb.c
index 99f3b5405..10cca08fb 100644
--- a/libc/nptl/tst-tls4modb.c
+++ b/libc/nptl/tst-tls4modb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -22,7 +22,6 @@
#include <unistd.h>
#include <tls.h>
-#if HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE
static int i;
int bar;
@@ -44,7 +43,7 @@ test1 (void)
for (s = 0; s < sizeof (foo) / sizeof (void *); ++s)
{
if (foo [s])
- abort ();
+ abort ();
foo [s] = &foo[s];
}
}
@@ -57,9 +56,7 @@ test2 (void)
for (s = 0; s < sizeof (foo) / sizeof (void *); ++s)
{
if (foo [s] != &foo [s])
- abort ();
+ abort ();
foo [s] = &foo [s ^ 1];
}
}
-
-#endif
diff --git a/libc/nptl/tst-tls5.h b/libc/nptl/tst-tls5.h
index 9a76ab782..12f68b819 100644
--- a/libc/nptl/tst-tls5.h
+++ b/libc/nptl/tst-tls5.h
@@ -2,7 +2,6 @@
#include <stdlib.h>
#include <tls.h>
-#if HAVE___THREAD
struct tls_obj
{
@@ -24,5 +23,3 @@ tls_register_##x (void) \
tls_registry[i].size = sizeof (x); \
tls_registry[i].align = __alignof__ (x); \
}
-
-#endif
diff --git a/libc/nptl_db/ChangeLog b/libc/nptl_db/ChangeLog
index f79fc18e4..81ebfcdfc 100644
--- a/libc/nptl_db/ChangeLog
+++ b/libc/nptl_db/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-15 Andreas Schwab <schwab@redhat.com>
+
+ * thread_dbP.h: Include <list.h>
+
2009-08-23 Roland McGrath <roland@redhat.com>
* td_ta_map_lwp2thr.c (__td_ta_lookup_th_unique): Move ta_ok check
diff --git a/libc/nptl_db/thread_dbP.h b/libc/nptl_db/thread_dbP.h
index e5db9bf94..54f5fc833 100644
--- a/libc/nptl_db/thread_dbP.h
+++ b/libc/nptl_db/thread_dbP.h
@@ -1,5 +1,5 @@
/* Private header for thread debug library
- Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2007, 2011 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
@@ -29,6 +29,7 @@
#include "proc_service.h"
#include "thread_db.h"
#include "../nptl/pthreadP.h" /* This is for *_BITMASK only. */
+#include <list.h>
/* Indeces for the symbol names. */
enum
diff --git a/libc/nscd/Makefile b/libc/nscd/Makefile
index a61a42a26..b9c7339be 100644
--- a/libc/nscd/Makefile
+++ b/libc/nscd/Makefile
@@ -25,7 +25,7 @@ subdir := nscd
routines-$(OPTION_EGLIBC_INET) += \
nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
- nscd_initgroups nscd_getserv_r
+ nscd_initgroups nscd_getserv_r nscd_netgroup
aux-$(OPTION_EGLIBC_INET) += nscd_helper
include ../Makeconfig
@@ -37,7 +37,8 @@ nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm3_r \
getsrvbynm_r getsrvbypt_r servicescache \
dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
- xmalloc xstrdup aicache initgrcache gai res_hconf
+ xmalloc xstrdup aicache initgrcache gai res_hconf \
+ netgroupcache
ifneq (y,$(OPTION_EGLIBC_NIS))
# If we haven't build libnsl.so, then we'll need to include our
# own copy of nis_hash.
@@ -130,6 +131,7 @@ CFLAGS-getsrvbynm_r.c += $(nscd-cflags)
CFLAGS-getsrvbypt_r.c += $(nscd-cflags)
CFLAGS-res_hconf.c += $(nscd-cflags)
CFLAGS-nis_hash.c += $(nscd-cflags)
+CFLAGS-netgroupcache.c += $(nscd-cflags)
ifeq (yesyes,$(have-fpie)$(build-shared))
LDFLAGS-nscd = -Wl,-z,now
diff --git a/libc/nscd/cache.c b/libc/nscd/cache.c
index 58f0bcc5f..507ca7846 100644
--- a/libc/nscd/cache.c
+++ b/libc/nscd/cache.c
@@ -60,7 +60,9 @@ static time_t (*const readdfcts[LASTREQ]) (struct database_dyn *,
[GETAI] = readdhstai,
[INITGROUPS] = readdinitgroups,
[GETSERVBYNAME] = readdservbyname,
- [GETSERVBYPORT] = readdservbyport
+ [GETSERVBYPORT] = readdservbyport,
+ [GETNETGRENT] = readdgetnetgrent,
+ [INNETGR] = readdinnetgr
};
@@ -70,7 +72,7 @@ static time_t (*const readdfcts[LASTREQ]) (struct database_dyn *,
This function must be called with the read-lock held. */
struct datahead *
-cache_search (request_type type, void *key, size_t len,
+cache_search (request_type type, const void *key, size_t len,
struct database_dyn *table, uid_t owner)
{
unsigned long int hash = __nis_hash (key, len) % table->head->module;
diff --git a/libc/nscd/connections.c b/libc/nscd/connections.c
index 6e48869c6..2b5c7ef53 100644
--- a/libc/nscd/connections.c
+++ b/libc/nscd/connections.c
@@ -57,11 +57,6 @@
#endif
-/* Wrapper functions with error checking for standard functions. */
-extern void *xmalloc (size_t n);
-extern void *xcalloc (size_t n, size_t s);
-extern void *xrealloc (void *o, size_t n);
-
/* Support to run nscd as an unprivileged user */
const char *server_user;
static uid_t server_uid;
@@ -100,7 +95,10 @@ const char *const serv2str[LASTREQ] =
[INITGROUPS] = "INITGROUPS",
[GETSERVBYNAME] = "GETSERVBYNAME",
[GETSERVBYPORT] = "GETSERVBYPORT",
- [GETFDSERV] = "GETFDSERV"
+ [GETFDSERV] = "GETFDSERV",
+ [GETNETGRENT] = "GETNETGRENT",
+ [INNETGR] = "INNETGR",
+ [GETFDNETGR] = "GETFDNETGR"
};
/* The control data structures for the services. */
@@ -181,6 +179,25 @@ struct database_dyn dbs[lastdb] =
.wr_fd = -1,
.ro_fd = -1,
.mmap_used = false
+ },
+ [netgrdb] = {
+ .lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
+ .prune_lock = PTHREAD_MUTEX_INITIALIZER,
+ .prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
+ .enabled = 0,
+ .check_file = 1,
+ .persistent = 0,
+ .propagate = 0, /* Not used. */
+ .shared = 0,
+ .max_db_size = DEFAULT_MAX_DB_SIZE,
+ .suggested_module = DEFAULT_SUGGESTED_MODULE,
+ .db_filename = _PATH_NSCD_NETGROUP_DB,
+ .disabled_iov = &netgroup_iov_disabled,
+ .postimeout = 28800,
+ .negtimeout = 20,
+ .wr_fd = -1,
+ .ro_fd = -1,
+ .mmap_used = false
}
};
@@ -210,7 +227,10 @@ static struct
[INITGROUPS] = { true, &dbs[grpdb] },
[GETSERVBYNAME] = { true, &dbs[servdb] },
[GETSERVBYPORT] = { true, &dbs[servdb] },
- [GETFDSERV] = { false, &dbs[servdb] }
+ [GETFDSERV] = { false, &dbs[servdb] },
+ [GETNETGRENT] = { true, &dbs[netgrdb] },
+ [INNETGR] = { true, &dbs[netgrdb] },
+ [GETFDNETGR] = { false, &dbs[netgrdb] }
};
@@ -355,7 +375,8 @@ check_use (const char *data, nscd_ssize_t first_free, uint8_t *usemap,
static int
verify_persistent_db (void *mem, struct database_pers_head *readhead, int dbnr)
{
- assert (dbnr == pwddb || dbnr == grpdb || dbnr == hstdb || dbnr == servdb);
+ assert (dbnr == pwddb || dbnr == grpdb || dbnr == hstdb || dbnr == servdb
+ || dbnr == netgrdb);
time_t now = time (NULL);
@@ -891,7 +912,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"),
void
register_traced_file (size_t dbidx, struct traced_file *finfo)
{
- if (! dbs[dbidx].check_file)
+ if (! dbs[dbidx].enabled || ! dbs[dbidx].check_file)
return;
if (__builtin_expect (debug_level > 0, 0))
@@ -1230,6 +1251,14 @@ request from '%s' [%ld] not handled due to missing permission"),
addservbyport (db, fd, req, key, uid);
break;
+ case GETNETGRENT:
+ addgetnetgrent (db, fd, req, key, uid);
+ break;
+
+ case INNETGR:
+ addinnetgr (db, fd, req, key, uid);
+ break;
+
case GETSTAT:
case SHUTDOWN:
case INVALIDATE:
@@ -1276,6 +1305,7 @@ request from '%s' [%ld] not handled due to missing permission"),
case GETFDGR:
case GETFDHST:
case GETFDSERV:
+ case GETFDNETGR:
#ifdef SCM_RIGHTS
send_ro_fd (reqinfo[req->type].db, key, fd);
#endif
diff --git a/libc/nscd/grpcache.c b/libc/nscd/grpcache.c
index 8a2f80ccd..e9607c6f1 100644
--- a/libc/nscd/grpcache.c
+++ b/libc/nscd/grpcache.c
@@ -117,6 +117,8 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
if (fd != -1)
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
+ else
+ written = total;
/* If we cannot permanently store the result, so be it. */
if (db->negtimeout == 0)
diff --git a/libc/nscd/netgroupcache.c b/libc/nscd/netgroupcache.c
new file mode 100644
index 000000000..02cda1364
--- /dev/null
+++ b/libc/nscd/netgroupcache.c
@@ -0,0 +1,669 @@
+/* Cache handling for netgroup lookup.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <alloca.h>
+#include <assert.h>
+#include <errno.h>
+#include <libintl.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include "../inet/netgroup.h"
+#include "nscd.h"
+#include "dbg_log.h"
+#ifdef HAVE_SENDFILE
+# include <kernel-features.h>
+#endif
+
+
+/* This is the standard reply in case the service is disabled. */
+static const netgroup_response_header disabled =
+{
+ .version = NSCD_VERSION,
+ .found = -1,
+ .nresults = 0,
+ .result_len = 0
+};
+
+/* This is the struct describing how to write this record. */
+const struct iovec netgroup_iov_disabled =
+{
+ .iov_base = (void *) &disabled,
+ .iov_len = sizeof (disabled)
+};
+
+
+/* This is the standard reply in case we haven't found the dataset. */
+static const netgroup_response_header notfound =
+{
+ .version = NSCD_VERSION,
+ .found = 0,
+ .nresults = 0,
+ .result_len = 0
+};
+
+
+struct dataset
+{
+ struct datahead head;
+ netgroup_response_header resp;
+ char strdata[0];
+};
+
+
+static time_t
+addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
+ const char *key, uid_t uid, struct hashentry *he,
+ struct datahead *dh, struct dataset **resultp)
+{
+ if (__builtin_expect (debug_level > 0, 0))
+ {
+ if (he == NULL)
+ dbg_log (_("Haven't found \"%s\" in netgroup cache!"), key);
+ else
+ dbg_log (_("Reloading \"%s\" in netgroup cache!"), key);
+ }
+
+ static service_user *netgroup_database;
+ time_t timeout;
+ struct dataset *dataset;
+ bool cacheable = false;
+ ssize_t total;
+
+ char *key_copy = NULL;
+ struct __netgrent data;
+ size_t buflen = MAX (1024, sizeof (*dataset) + req->key_len);
+ size_t buffilled = sizeof (*dataset);
+ char *buffer = NULL;
+ size_t nentries = 0;
+ bool use_malloc = false;
+ size_t group_len = strlen (key) + 1;
+ union
+ {
+ struct name_list elem;
+ char mem[sizeof (struct name_list) + group_len];
+ } first_needed;
+
+ if (netgroup_database == NULL
+ && __nss_database_lookup ("netgroup", NULL, NULL, &netgroup_database))
+ {
+ /* No such service. */
+ total = sizeof (notfound);
+ timeout = time (NULL) + db->negtimeout;
+
+ if (fd != -1)
+ TEMP_FAILURE_RETRY (send (fd, &notfound, total, MSG_NOSIGNAL));
+
+ dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1);
+ /* If we cannot permanently store the result, so be it. */
+ if (dataset != NULL)
+ {
+ dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
+ dataset->head.recsize = total;
+ dataset->head.notfound = true;
+ dataset->head.nreloads = 0;
+ dataset->head.usable = true;
+
+ /* Compute the timeout time. */
+ timeout = dataset->head.timeout = time (NULL) + db->negtimeout;
+ dataset->head.ttl = db->negtimeout;
+
+ /* This is the reply. */
+ memcpy (&dataset->resp, &notfound, total);
+
+ /* Copy the key data. */
+ memcpy (dataset->strdata, key, req->key_len);
+
+ cacheable = true;
+ }
+
+ goto writeout;
+ }
+
+ memset (&data, '\0', sizeof (data));
+ buffer = alloca (buflen);
+ first_needed.elem.next = &first_needed.elem;
+ memcpy (first_needed.elem.name, key, group_len);
+ data.needed_groups = &first_needed.elem;
+
+ while (data.needed_groups != NULL)
+ {
+ /* Add the next group to the list of those which are known. */
+ struct name_list *this_group = data.needed_groups->next;
+ if (this_group == data.needed_groups)
+ data.needed_groups = NULL;
+ else
+ data.needed_groups->next = this_group->next;
+ this_group->next = data.known_groups;
+ data.known_groups = this_group;
+
+ union
+ {
+ enum nss_status (*f) (const char *, struct __netgrent *);
+ void *ptr;
+ } setfct;
+
+ service_user *nip = netgroup_database;
+ int no_more = __nss_lookup (&nip, "setnetgrent", NULL, &setfct.ptr);
+ while (!no_more)
+ {
+ enum nss_status status
+ = DL_CALL_FCT (*setfct.f, (data.known_groups->name, &data));
+
+ if (status == NSS_STATUS_SUCCESS)
+ {
+ union
+ {
+ enum nss_status (*f) (struct __netgrent *, char *, size_t,
+ int *);
+ void *ptr;
+ } getfct;
+ getfct.ptr = __nss_lookup_function (nip, "getnetgrent_r");
+ if (getfct.f != NULL)
+ while (1)
+ {
+ int e;
+ status = getfct.f (&data, buffer + buffilled,
+ buflen - buffilled, &e);
+ if (status == NSS_STATUS_RETURN)
+ /* This was the last one for this group. Look
+ at next group if available. */
+ break;
+ if (status == NSS_STATUS_SUCCESS)
+ {
+ if (data.type == triple_val)
+ {
+ const char *nhost = data.val.triple.host;
+ const char *nuser = data.val.triple.user;
+ const char *ndomain = data.val.triple.domain;
+
+ if (data.val.triple.host > data.val.triple.user
+ || data.val.triple.user > data.val.triple.domain)
+ {
+ const char *last = MAX (nhost,
+ MAX (nuser, ndomain));
+ size_t bufused = (last + strlen (last) + 1
+ - buffer);
+
+ /* We have to make temporary copies. */
+ size_t hostlen = strlen (nhost) + 1;
+ size_t userlen = strlen (nuser) + 1;
+ size_t domainlen = strlen (ndomain) + 1;
+ size_t needed = hostlen + userlen + domainlen;
+
+ if (buflen - req->key_len - bufused < needed)
+ {
+ size_t newsize = MAX (2 * buflen,
+ buflen + 2 * needed);
+ if (use_malloc || newsize > 1024 * 1024)
+ {
+ buflen = newsize;
+ char *newbuf = xrealloc (use_malloc
+ ? buffer
+ : NULL,
+ buflen);
+
+ buffer = newbuf;
+ use_malloc = true;
+ }
+ else
+ extend_alloca (buffer, buflen, newsize);
+ }
+
+ nhost = memcpy (buffer + bufused,
+ nhost, hostlen);
+ nuser = memcpy ((char *) nhost + hostlen,
+ nuser, userlen);
+ ndomain = memcpy ((char *) nuser + userlen,
+ ndomain, domainlen);
+ }
+
+ char *wp = buffer + buffilled;
+ wp = stpcpy (wp, nhost) + 1;
+ wp = stpcpy (wp, nuser) + 1;
+ wp = stpcpy (wp, ndomain) + 1;
+ buffilled = wp - buffer;
+ ++nentries;
+ }
+ else
+ {
+ /* Check that the group has not been
+ requested before. */
+ struct name_list *runp = data.needed_groups;
+ if (runp != NULL)
+ while (1)
+ {
+ if (strcmp (runp->name, data.val.group) == 0)
+ break;
+
+ runp = runp->next;
+ if (runp == data.needed_groups)
+ {
+ runp = NULL;
+ break;
+ }
+ }
+
+ if (runp == NULL)
+ {
+ runp = data.known_groups;
+ while (runp != NULL)
+ if (strcmp (runp->name, data.val.group) == 0)
+ break;
+ else
+ runp = runp->next;
+ }
+
+ if (runp == NULL)
+ {
+ /* A new group is requested. */
+ size_t namelen = strlen (data.val.group) + 1;
+ struct name_list *newg = alloca (sizeof (*newg)
+ + namelen);
+ memcpy (newg->name, data.val.group, namelen);
+ if (data.needed_groups == NULL)
+ data.needed_groups = newg->next = newg;
+ else
+ {
+ newg->next = data.needed_groups->next;
+ data.needed_groups->next = newg;
+ data.needed_groups = newg;
+ }
+ }
+ }
+ }
+ else if (status == NSS_STATUS_UNAVAIL && e == ERANGE)
+ {
+ size_t newsize = 2 * buflen;
+ if (use_malloc || newsize > 1024 * 1024)
+ {
+ buflen = newsize;
+ char *newbuf = xrealloc (use_malloc
+ ? buffer : NULL, buflen);
+
+ buffer = newbuf;
+ use_malloc = true;
+ }
+ else
+ extend_alloca (buffer, buflen, newsize);
+ }
+ }
+
+ enum nss_status (*endfct) (struct __netgrent *);
+ endfct = __nss_lookup_function (nip, "endnetgrent");
+ if (endfct != NULL)
+ (void) DL_CALL_FCT (*endfct, (&data));
+
+ break;
+ }
+
+ no_more = __nss_next2 (&nip, "setnetgrent", NULL, &setfct.ptr,
+ status, 0);
+ }
+ }
+
+ total = buffilled;
+
+ /* Fill in the dataset. */
+ dataset = (struct dataset *) buffer;
+ dataset->head.allocsize = total + req->key_len;
+ dataset->head.recsize = total - offsetof (struct dataset, resp);
+ dataset->head.notfound = false;
+ dataset->head.nreloads = he == NULL ? 0 : (dh->nreloads + 1);
+ dataset->head.usable = true;
+ dataset->head.ttl = db->postimeout;
+ timeout = dataset->head.timeout = time (NULL) + dataset->head.ttl;
+
+ dataset->resp.version = NSCD_VERSION;
+ dataset->resp.found = 1;
+ dataset->resp.nresults = nentries;
+ dataset->resp.result_len = buffilled - sizeof (*dataset);
+
+ assert (buflen - buffilled >= req->key_len);
+ key_copy = memcpy (buffer + buffilled, key, req->key_len);
+ buffilled += req->key_len;
+
+ /* Now we can determine whether on refill we have to create a new
+ record or not. */
+ if (he != NULL)
+ {
+ assert (fd == -1);
+
+ if (dataset->head.allocsize == dh->allocsize
+ && dataset->head.recsize == dh->recsize
+ && memcmp (&dataset->resp, dh->data,
+ dh->allocsize - offsetof (struct dataset, resp)) == 0)
+ {
+ /* The data has not changed. We will just bump the timeout
+ value. Note that the new record has been allocated on
+ the stack and need not be freed. */
+ dh->timeout = dataset->head.timeout;
+ dh->ttl = dataset->head.ttl;
+ ++dh->nreloads;
+ dataset = (struct dataset *) dh;
+
+ goto out;
+ }
+ }
+
+ {
+ struct dataset *newp
+ = (struct dataset *) mempool_alloc (db, total + req->key_len, 1);
+ if (__builtin_expect (newp != NULL, 1))
+ {
+ /* Adjust pointer into the memory block. */
+ key_copy = (char *) newp + (key_copy - buffer);
+
+ dataset = memcpy (newp, dataset, total + req->key_len);
+ cacheable = true;
+
+ if (he != NULL)
+ /* Mark the old record as obsolete. */
+ dh->usable = false;
+ }
+ }
+
+ if (he == NULL && fd != -1)
+ {
+ /* We write the dataset before inserting it to the database
+ since while inserting this thread might block and so would
+ unnecessarily let the receiver wait. */
+ writeout:
+#ifdef HAVE_SENDFILE
+ if (__builtin_expect (db->mmap_used, 1) && cacheable)
+ {
+ assert (db->wr_fd != -1);
+ assert ((char *) &dataset->resp > (char *) db->data);
+ assert ((char *) dataset - (char *) db->head + total
+ <= (sizeof (struct database_pers_head)
+ + db->head->module * sizeof (ref_t)
+ + db->head->data_size));
+# ifndef __ASSUME_SENDFILE
+ ssize_t written =
+# endif
+ sendfileall (fd, db->wr_fd, (char *) &dataset->resp
+ - (char *) db->head, dataset->head.recsize);
+# ifndef __ASSUME_SENDFILE
+ if (written == -1 && errno == ENOSYS)
+ goto use_write;
+# endif
+ }
+ else
+#endif
+ {
+#if defined HAVE_SENDFILE && !defined __ASSUME_SENDFILE
+ use_write:
+#endif
+ writeall (fd, &dataset->resp, dataset->head.recsize);
+ }
+ }
+
+ if (cacheable)
+ {
+ /* If necessary, we also propagate the data to disk. */
+ if (db->persistent)
+ {
+ // XXX async OK?
+ uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1;
+ msync ((void *) pval,
+ ((uintptr_t) dataset & pagesize_m1) + total + req->key_len,
+ MS_ASYNC);
+ }
+
+ (void) cache_add (req->type, key_copy, req->key_len, &dataset->head,
+ true, db, uid, he == NULL);
+
+ pthread_rwlock_unlock (&db->lock);
+
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+
+ out:
+ if (use_malloc)
+ free (buffer);
+
+ *resultp = dataset;
+
+ return timeout;
+}
+
+
+static time_t
+addinnetgrX (struct database_dyn *db, int fd, request_header *req,
+ char *key, uid_t uid, struct hashentry *he,
+ struct datahead *dh)
+{
+ const char *group = key;
+ key = (char *) rawmemchr (key, '\0') + 1;
+ size_t group_len = key - group - 1;
+ const char *host = *key++ ? key : NULL;
+ if (host != NULL)
+ key = (char *) rawmemchr (key, '\0') + 1;
+ const char *user = *key++ ? key : NULL;
+ if (user != NULL)
+ key = (char *) rawmemchr (key, '\0') + 1;
+ const char *domain = *key++ ? key : NULL;
+
+ if (__builtin_expect (debug_level > 0, 0))
+ {
+ if (he == NULL)
+ dbg_log (_("Haven't found \"%s (%s,%s,%s)\" in netgroup cache!"),
+ group, host ?: "", user ?: "", domain ?: "");
+ else
+ dbg_log (_("Reloading \"%s (%s,%s,%s)\" in netgroup cache!"),
+ group, host ?: "", user ?: "", domain ?: "");
+ }
+
+ struct dataset *result = (struct dataset *) cache_search (GETNETGRENT,
+ group, group_len,
+ db, uid);
+ time_t timeout;
+ if (result != NULL)
+ timeout = result->head.timeout;
+ else
+ {
+ request_header req_get =
+ {
+ .type = GETNETGRENT,
+ .key_len = group_len
+ };
+ timeout = addgetnetgrentX (db, -1, &req_get, group, uid, NULL, NULL,
+ &result);
+ }
+
+ struct indataset
+ {
+ struct datahead head;
+ innetgroup_response_header resp;
+ } *dataset
+ = (struct indataset *) mempool_alloc (db,
+ sizeof (*dataset) + req->key_len,
+ 1);
+ struct indataset dataset_mem;
+ bool cacheable = true;
+ if (__builtin_expect (dataset == NULL, 0))
+ {
+ cacheable = false;
+ dataset = &dataset_mem;
+ }
+
+ dataset->head.allocsize = sizeof (*dataset) + req->key_len;
+ dataset->head.recsize = sizeof (innetgroup_response_header);
+ dataset->head.notfound = result->head.notfound;
+ dataset->head.nreloads = he == NULL ? 0 : (dh->nreloads + 1);
+ dataset->head.usable = true;
+ dataset->head.ttl = result->head.ttl;
+ dataset->head.timeout = timeout;
+
+ dataset->resp.version = NSCD_VERSION;
+ dataset->resp.found = result->resp.found;
+ /* Until we find a matching entry the result is 0. */
+ dataset->resp.result = 0;
+
+ char *key_copy = memcpy ((char *) (dataset + 1), group, req->key_len);
+
+ if (dataset->resp.found)
+ {
+ const char *triplets = (const char *) (&result->resp + 1);
+
+ for (nscd_ssize_t i = result->resp.nresults; i > 0; --i)
+ {
+ bool success = true;
+
+ if (host != NULL)
+ success = strcmp (host, triplets) == 0;
+ triplets = (const char *) rawmemchr (triplets, '\0') + 1;
+
+ if (success && user != NULL)
+ success = strcmp (user, triplets) == 0;
+ triplets = (const char *) rawmemchr (triplets, '\0') + 1;
+
+ if (success && (domain == NULL || strcmp (domain, triplets) == 0))
+ {
+ dataset->resp.result = 1;
+ break;
+ }
+ triplets = (const char *) rawmemchr (triplets, '\0') + 1;
+ }
+ }
+
+ if (he != NULL && dh->data[0].innetgroupdata.result == dataset->resp.result)
+ {
+ /* The data has not changed. We will just bump the timeout
+ value. Note that the new record has been allocated on
+ the stack and need not be freed. */
+ dh->timeout = timeout;
+ dh->ttl = dataset->head.ttl;
+ ++dh->nreloads;
+ return timeout;
+ }
+
+ if (he == NULL)
+ {
+ /* We write the dataset before inserting it to the database
+ since while inserting this thread might block and so would
+ unnecessarily let the receiver wait. */
+ assert (fd != -1);
+
+#ifdef HAVE_SENDFILE
+ if (__builtin_expect (db->mmap_used, 1) && cacheable)
+ {
+ assert (db->wr_fd != -1);
+ assert ((char *) &dataset->resp > (char *) db->data);
+ assert ((char *) dataset - (char *) db->head + sizeof (*dataset)
+ <= (sizeof (struct database_pers_head)
+ + db->head->module * sizeof (ref_t)
+ + db->head->data_size));
+# ifndef __ASSUME_SENDFILE
+ ssize_t written =
+# endif
+ sendfileall (fd, db->wr_fd,
+ (char *) &dataset->resp - (char *) db->head,
+ sizeof (innetgroup_response_header));
+# ifndef __ASSUME_SENDFILE
+ if (written == -1 && errno == ENOSYS)
+ goto use_write;
+# endif
+ }
+ else
+ {
+# ifndef __ASSUME_SENDFILE
+ use_write:
+# endif
+#endif
+ writeall (fd, &dataset->resp, sizeof (innetgroup_response_header));
+ }
+ }
+
+ if (cacheable)
+ {
+ /* If necessary, we also propagate the data to disk. */
+ if (db->persistent)
+ {
+ // XXX async OK?
+ uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1;
+ msync ((void *) pval,
+ ((uintptr_t) dataset & pagesize_m1) + sizeof (*dataset)
+ + req->key_len,
+ MS_ASYNC);
+ }
+
+ (void) cache_add (req->type, key_copy, req->key_len, &dataset->head,
+ true, db, uid, he == NULL);
+
+ pthread_rwlock_unlock (&db->lock);
+
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+
+ return timeout;
+}
+
+
+void
+addgetnetgrent (struct database_dyn *db, int fd, request_header *req,
+ void *key, uid_t uid)
+{
+ struct dataset *ignore;
+
+ addgetnetgrentX (db, fd, req, key, uid, NULL, NULL, &ignore);
+}
+
+
+time_t
+readdgetnetgrent (struct database_dyn *db, struct hashentry *he,
+ struct datahead *dh)
+{
+ request_header req =
+ {
+ .type = GETNETGRENT,
+ .key_len = he->len
+ };
+ struct dataset *ignore;
+
+ return addgetnetgrentX (db, -1, &req, db->data + he->key, he->owner, he, dh,
+ &ignore);
+}
+
+
+void
+addinnetgr (struct database_dyn *db, int fd, request_header *req,
+ void *key, uid_t uid)
+{
+ addinnetgrX (db, fd, req, key, uid, NULL, NULL);
+}
+
+
+time_t
+readdinnetgr (struct database_dyn *db, struct hashentry *he,
+ struct datahead *dh)
+{
+ request_header req =
+ {
+ .type = INNETGR,
+ .key_len = he->len
+ };
+
+ return addinnetgrX (db, -1, &req, db->data + he->key, he->owner, he, dh);
+}
diff --git a/libc/nscd/nscd-client.h b/libc/nscd/nscd-client.h
index 482b052d1..caad26a9c 100644
--- a/libc/nscd/nscd-client.h
+++ b/libc/nscd/nscd-client.h
@@ -70,6 +70,9 @@ typedef enum
GETSERVBYNAME,
GETSERVBYPORT,
GETFDSERV,
+ GETNETGRENT,
+ INNETGR,
+ GETFDNETGR,
LASTREQ
} request_type;
@@ -171,6 +174,24 @@ typedef struct
} serv_response_header;
+/* Structure send in reply to netgroup query. Note that this struct is
+ sent also if the service is disabled or there is no record found. */
+typedef struct
+{
+ int32_t version;
+ int32_t found;
+ nscd_ssize_t nresults;
+ nscd_ssize_t result_len;
+} netgroup_response_header;
+
+typedef struct
+{
+ int32_t version;
+ int32_t found;
+ int32_t result;
+} innetgroup_response_header;
+
+
/* Type for offsets in data part of database. */
typedef uint32_t ref_t;
/* Value for invalid/no reference. */
@@ -210,6 +231,8 @@ struct datahead
ai_response_header aidata;
initgr_response_header initgrdata;
serv_response_header servdata;
+ netgroup_response_header netgroupdata;
+ innetgroup_response_header innetgroupdata;
nscd_ssize_t align1;
nscd_time_t align2;
} data[0];
diff --git a/libc/nscd/nscd.conf b/libc/nscd/nscd.conf
index ada88e6a3..39b875912 100644
--- a/libc/nscd/nscd.conf
+++ b/libc/nscd/nscd.conf
@@ -77,3 +77,12 @@
persistent services yes
shared services yes
max-db-size services 33554432
+
+ enable-cache netgroup yes
+ positive-time-to-live netgroup 28800
+ negative-time-to-live netgroup 20
+ suggested-size netgroup 211
+ check-files netgroup yes
+ persistent netgroup yes
+ shared netgroup yes
+ max-db-size netgroup 33554432
diff --git a/libc/nscd/nscd.h b/libc/nscd/nscd.h
index c15e88bb6..fdaf01bfb 100644
--- a/libc/nscd/nscd.h
+++ b/libc/nscd/nscd.h
@@ -38,6 +38,7 @@ typedef enum
grpdb,
hstdb,
servdb,
+ netgrdb,
lastdb
} dbtype;
@@ -116,6 +117,7 @@ struct database_dyn
#define _PATH_NSCD_GROUP_DB "/var/db/nscd/group"
#define _PATH_NSCD_HOSTS_DB "/var/db/nscd/hosts"
#define _PATH_NSCD_SERVICES_DB "/var/db/nscd/services"
+#define _PATH_NSCD_NETGROUP_DB "/var/db/nscd/netgroup"
/* Path used when not using persistent storage. */
#define _PATH_NSCD_XYZ_DB_TMP "/var/run/nscd/dbXXXXXX"
@@ -149,6 +151,7 @@ extern const struct iovec pwd_iov_disabled;
extern const struct iovec grp_iov_disabled;
extern const struct iovec hst_iov_disabled;
extern const struct iovec serv_iov_disabled;
+extern const struct iovec netgroup_iov_disabled;
/* Initial number of threads to run. */
@@ -197,6 +200,11 @@ extern gid_t old_gid;
/* Prototypes for global functions. */
+/* Wrapper functions with error checking for standard functions. */
+extern void *xmalloc (size_t n);
+extern void *xcalloc (size_t n, size_t s);
+extern void *xrealloc (void *o, size_t n);
+
/* nscd.c */
extern void termination_handler (int signum) __attribute__ ((__noreturn__));
extern int nscd_open_socket (void);
@@ -216,8 +224,8 @@ extern void send_stats (int fd, struct database_dyn dbs[lastdb]);
extern int receive_print_stats (void) __attribute__ ((__noreturn__));
/* cache.c */
-extern struct datahead *cache_search (request_type, void *key, size_t len,
- struct database_dyn *table,
+extern struct datahead *cache_search (request_type, const void *key,
+ size_t len, struct database_dyn *table,
uid_t owner);
extern int cache_add (int type, const void *key, size_t len,
struct datahead *packet, bool first,
@@ -286,6 +294,16 @@ extern void addservbyport (struct database_dyn *db, int fd,
extern time_t readdservbyport (struct database_dyn *db, struct hashentry *he,
struct datahead *dh);
+/* netgroupcache.c */
+extern void addinnetgr (struct database_dyn *db, int fd, request_header *req,
+ void *key, uid_t uid);
+extern time_t readdinnetgr (struct database_dyn *db, struct hashentry *he,
+ struct datahead *dh);
+extern void addgetnetgrent (struct database_dyn *db, int fd,
+ request_header *req, void *key, uid_t uid);
+extern time_t readdgetnetgrent (struct database_dyn *db, struct hashentry *he,
+ struct datahead *dh);
+
/* mem.c */
extern void *mempool_alloc (struct database_dyn *db, size_t len,
int data_alloc);
diff --git a/libc/nscd/nscd_conf.c b/libc/nscd/nscd_conf.c
index 3b6cbb0b1..98b59280c 100644
--- a/libc/nscd/nscd_conf.c
+++ b/libc/nscd/nscd_conf.c
@@ -43,7 +43,8 @@ const char *const dbnames[lastdb] =
[pwddb] = "passwd",
[grpdb] = "group",
[hstdb] = "hosts",
- [servdb] = "services"
+ [servdb] = "services",
+ [netgrdb] = "netgroup"
};
diff --git a/libc/nscd/nscd_netgroup.c b/libc/nscd/nscd_netgroup.c
new file mode 100644
index 000000000..8457cec9d
--- /dev/null
+++ b/libc/nscd/nscd_netgroup.c
@@ -0,0 +1,290 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <alloca.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <not-cancel.h>
+
+#include "nscd-client.h"
+#include "nscd_proto.h"
+
+int __nss_not_use_nscd_netgroup;
+
+
+libc_locked_map_ptr (static, map_handle);
+/* Note that we only free the structure if necessary. The memory
+ mapping is not removed since it is not visible to the malloc
+ handling. */
+libc_freeres_fn (pw_map_free)
+{
+ if (map_handle.mapped != NO_MAPPING)
+ {
+ void *p = map_handle.mapped;
+ map_handle.mapped = NO_MAPPING;
+ free (p);
+ }
+}
+
+
+int
+__nscd_setnetgrent (const char *group, struct __netgrent *datap)
+{
+ int gc_cycle;
+ int nretries = 0;
+ size_t group_len = strlen (group);
+
+ /* If the mapping is available, try to search there instead of
+ communicating with the nscd. */
+ struct mapped_database *mapped;
+ mapped = __nscd_get_map_ref (GETFDNETGR, "netgroup", &map_handle, &gc_cycle);
+
+ retry:;
+ char *respdata = NULL;
+ int retval = -1;
+ netgroup_response_header netgroup_resp;
+
+ if (mapped != NO_MAPPING)
+ {
+ struct datahead *found = __nscd_cache_search (GETNETGRENT, group,
+ group_len, mapped,
+ sizeof netgroup_resp);
+ if (found != NULL)
+ {
+ respdata = (char *) (&found->data[0].netgroupdata + 1);
+ netgroup_resp = found->data[0].netgroupdata;
+ /* Now check if we can trust pw_resp fields. If GC is
+ in progress, it can contain anything. */
+ if (mapped->head->gc_cycle != gc_cycle)
+ {
+ retval = -2;
+ goto out;
+ }
+ }
+ }
+
+ int sock = -1;
+ if (respdata == NULL)
+ {
+ sock = __nscd_open_socket (group, group_len, GETNETGRENT,
+ &netgroup_resp, sizeof (netgroup_resp));
+ if (sock == -1)
+ {
+ /* nscd not running or wrong version. */
+ __nss_not_use_nscd_netgroup = 1;
+ goto out;
+ }
+ }
+
+ if (netgroup_resp.found == 1)
+ {
+ size_t datalen = netgroup_resp.result_len;
+
+ /* If we do not have to read the data here it comes from the
+ mapped data and does not have to be freed. */
+ if (respdata == NULL)
+ {
+ /* The data will come via the socket. */
+ respdata = malloc (datalen);
+ if (respdata == NULL)
+ goto out_close;
+
+ if ((size_t) __readall (sock, respdata, datalen) != datalen)
+ {
+ free (respdata);
+ goto out_close;
+ }
+ }
+
+ datap->data = respdata;
+ datap->data_size = datalen;
+ datap->cursor = respdata;
+ datap->first = 1;
+ datap->nip = (service_user *) -1l;
+ datap->known_groups = NULL;
+ datap->needed_groups = NULL;
+
+ retval = 1;
+ }
+ else
+ {
+ if (__builtin_expect (netgroup_resp.found == -1, 0))
+ {
+ /* The daemon does not cache this database. */
+ __nss_not_use_nscd_netgroup = 1;
+ goto out_close;
+ }
+
+ /* Set errno to 0 to indicate no error, just no found record. */
+ __set_errno (0);
+ /* Even though we have not found anything, the result is zero. */
+ retval = 0;
+ }
+
+ out_close:
+ if (sock != -1)
+ close_not_cancel_no_status (sock);
+ out:
+ if (__nscd_drop_map_ref (mapped, &gc_cycle) != 0)
+ {
+ /* When we come here this means there has been a GC cycle while we
+ were looking for the data. This means the data might have been
+ inconsistent. Retry if possible. */
+ if ((gc_cycle & 1) != 0 || ++nretries == 5 || retval == -1)
+ {
+ /* nscd is just running gc now. Disable using the mapping. */
+ if (atomic_decrement_val (&mapped->counter) == 0)
+ __nscd_unmap (mapped);
+ mapped = NO_MAPPING;
+ }
+
+ if (retval != -1)
+ goto retry;
+ }
+
+ return retval;
+}
+
+
+int
+__nscd_innetgr (const char *netgroup, const char *host, const char *user,
+ const char *domain)
+{
+ size_t key_len = (strlen (netgroup) + strlen (host ?: "")
+ + strlen (user ?: "") + strlen (domain ?: "") + 7);
+ char *key;
+ bool use_alloca = __libc_use_alloca (key_len);
+ if (use_alloca)
+ key = alloca (key_len);
+ else
+ {
+ key = malloc (key_len);
+ if (key == NULL)
+ return -1;
+ }
+ char *wp = stpcpy (key, netgroup) + 1;
+ if (host != NULL)
+ {
+ *wp++ = '\1';
+ wp = stpcpy (wp, host) + 1;
+ }
+ else
+ *wp++ = '\0';
+ if (user != NULL)
+ {
+ *wp++ = '\1';
+ wp = stpcpy (wp, user) + 1;
+ }
+ else
+ *wp++ = '\0';
+ if (domain != NULL)
+ {
+ *wp++ = '\1';
+ wp = stpcpy (wp, domain) + 1;
+ }
+ else
+ *wp++ = '\0';
+ key_len = wp - key;
+
+ /* If the mapping is available, try to search there instead of
+ communicating with the nscd. */
+ int gc_cycle;
+ int nretries = 0;
+ struct mapped_database *mapped;
+ mapped = __nscd_get_map_ref (GETFDNETGR, "netgroup", &map_handle, &gc_cycle);
+
+ retry:;
+ int retval = -1;
+ innetgroup_response_header innetgroup_resp;
+ int sock = -1;
+
+ if (mapped != NO_MAPPING)
+ {
+ struct datahead *found = __nscd_cache_search (INNETGR, key,
+ key_len, mapped,
+ sizeof innetgroup_resp);
+ if (found != NULL)
+ {
+ innetgroup_resp = found->data[0].innetgroupdata;
+ /* Now check if we can trust pw_resp fields. If GC is
+ in progress, it can contain anything. */
+ if (mapped->head->gc_cycle != gc_cycle)
+ {
+ retval = -2;
+ goto out;
+ }
+
+ goto found_entry;
+ }
+ }
+
+ sock = __nscd_open_socket (key, key_len, INNETGR,
+ &innetgroup_resp, sizeof (innetgroup_resp));
+ if (sock == -1)
+ {
+ /* nscd not running or wrong version. */
+ __nss_not_use_nscd_netgroup = 1;
+ goto out;
+ }
+
+ found_entry:
+ if (innetgroup_resp.found == 1)
+ retval = innetgroup_resp.result;
+ else
+ {
+ if (__builtin_expect (innetgroup_resp.found == -1, 0))
+ {
+ /* The daemon does not cache this database. */
+ __nss_not_use_nscd_netgroup = 1;
+ goto out_close;
+ }
+
+ /* Set errno to 0 to indicate no error, just no found record. */
+ __set_errno (0);
+ /* Even though we have not found anything, the result is zero. */
+ retval = 0;
+ }
+
+ out_close:
+ if (sock != -1)
+ close_not_cancel_no_status (sock);
+ out:
+ if (__nscd_drop_map_ref (mapped, &gc_cycle) != 0)
+ {
+ /* When we come here this means there has been a GC cycle while we
+ were looking for the data. This means the data might have been
+ inconsistent. Retry if possible. */
+ if ((gc_cycle & 1) != 0 || ++nretries == 5 || retval == -1)
+ {
+ /* nscd is just running gc now. Disable using the mapping. */
+ if (atomic_decrement_val (&mapped->counter) == 0)
+ __nscd_unmap (mapped);
+ mapped = NO_MAPPING;
+ }
+
+ if (retval != -1)
+ goto retry;
+ }
+
+ if (! use_alloca)
+ free (key);
+
+ return retval;
+}
diff --git a/libc/nscd/nscd_proto.h b/libc/nscd/nscd_proto.h
index 573ca2b2e..742c154fa 100644
--- a/libc/nscd/nscd_proto.h
+++ b/libc/nscd/nscd_proto.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2000, 2002, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2000,2002,2004,2007,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -36,6 +36,7 @@ extern int __nss_not_use_nscd_passwd attribute_hidden;
extern int __nss_not_use_nscd_group attribute_hidden;
extern int __nss_not_use_nscd_hosts attribute_hidden;
extern int __nss_not_use_nscd_services attribute_hidden;
+extern int __nss_not_use_nscd_netgroup attribute_hidden;
extern int __nscd_getpwnam_r (const char *name, struct passwd *resultbuf,
char *buffer, size_t buflen,
@@ -71,5 +72,9 @@ extern int __nscd_getservbyname_r (const char *name, const char *proto,
extern int __nscd_getservbyport_r (int port, const char *proto,
struct servent *result_buf, char *buf,
size_t buflen, struct servent **result);
+extern int __nscd_innetgr (const char *netgroup, const char *host,
+ const char *user, const char *domain);
+extern int __nscd_setnetgrent (const char *group, struct __netgrent *datap);
+
#endif /* _NSCD_PROTO_H */
diff --git a/libc/nscd/selinux.c b/libc/nscd/selinux.c
index e07a454bf..f618640dd 100644
--- a/libc/nscd/selinux.c
+++ b/libc/nscd/selinux.c
@@ -1,5 +1,5 @@
/* SELinux access controls for nscd.
- Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004,2005,2006,2007,2009,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Matthew Rickard <mjricka@epoch.ncsc.mil>, 2004.
@@ -46,7 +46,7 @@
int selinux_enabled;
/* Define mappings of access vector permissions to request types. */
-static const int perms[LASTREQ] =
+static const access_vector_t perms[LASTREQ] =
{
[GETPWBYNAME] = NSCD__GETPWD,
[GETPWBYUID] = NSCD__GETPWD,
@@ -69,6 +69,11 @@ static const int perms[LASTREQ] =
[GETSERVBYPORT] = NSCD__GETSERV,
[GETFDSERV] = NSCD__SHMEMSERV,
#endif
+#ifdef NSCD__GETNETGRP
+ [GETNETGRENT] = NSCD__GETNETGRP,
+ [INNETGR] = NSCD__GETNETGRP,
+ [GETFDNETGR] = NSCD__SHMEMNETGRP,
+#endif
};
/* Store an entry ref to speed AVC decisions. */
diff --git a/libc/nss/Versions b/libc/nss/Versions
index 666915d6b..d13d57007 100644
--- a/libc/nss/Versions
+++ b/libc/nss/Versions
@@ -12,7 +12,7 @@ libc {
__nss_disable_nscd; __nss_lookup_function; _nss_files_parse_sgent;
__nss_passwd_lookup2; __nss_group_lookup2; __nss_hosts_lookup2;
- __nss_services_lookup2; __nss_next2;
+ __nss_services_lookup2; __nss_next2; __nss_lookup;
}
}
diff --git a/libc/nss/getent.c b/libc/nss/getent.c
index fd55c67d3..fc0d685f0 100644
--- a/libc/nss/getent.c
+++ b/libc/nss/getent.c
@@ -478,7 +478,6 @@ static int
netgroup_keys (int number, char *key[])
{
int result = 0;
- int i;
if (number == 0)
{
@@ -486,18 +485,28 @@ netgroup_keys (int number, char *key[])
return 3;
}
- for (i = 0; i < number; ++i)
+ if (number == 4)
+ {
+ char *host = strcmp (key[1], "*") == 0 ? NULL : key[1];
+ char *user = strcmp (key[2], "*") == 0 ? NULL : key[2];
+ char *domain = strcmp (key[3], "*") == 0 ? NULL : key[3];
+
+ printf ("%-21s (%s,%s,%s) = %d\n",
+ key[0], host ?: "", user ?: "", domain ?: "",
+ innetgr (key[0], host, user, domain));
+ }
+ else if (number == 1)
{
- if (!setnetgrent (key[i]))
+ if (!setnetgrent (key[0]))
result = 2;
else
{
char *p[3];
- printf ("%-21s", key[i]);
+ printf ("%-21s", key[0]);
while (getnetgrent (p, p + 1, p + 2))
- printf (" (%s, %s, %s)", p[0] ?: " ", p[1] ?: "", p[2] ?: "");
+ printf (" (%s,%s,%s)", p[0] ?: " ", p[1] ?: "", p[2] ?: "");
putchar_unlocked ('\n');
}
}
diff --git a/libc/nss/nss_files/files-init.c b/libc/nss/nss_files/files-init.c
index cc6822d30..7012ab2b5 100644
--- a/libc/nss/nss_files/files-init.c
+++ b/libc/nss/nss_files/files-init.c
@@ -20,53 +20,39 @@
#include <nscd/nscd.h>
-static union
-{
- struct traced_file file;
- char buf[sizeof (struct traced_file) + sizeof ("/etc/passwd")];
-} pwd_traced_file;
-
-static union
-{
- struct traced_file file;
- char buf[sizeof (struct traced_file) + sizeof ("/etc/group")];
-} grp_traced_file;
-
-static union
-{
- struct traced_file file;
- char buf[sizeof (struct traced_file) + sizeof ("/etc/hosts")];
-} hst_traced_file;
-
-static union
-{
- struct traced_file file;
- char buf[sizeof (struct traced_file) + sizeof ("/etc/resolv.conf")];
-} resolv_traced_file;
-
-static union
-{
- struct traced_file file;
- char buf[sizeof (struct traced_file) + sizeof ("/etc/services")];
-} serv_traced_file;
+#define TF(id, filename, ...) \
+static union \
+{ \
+ struct traced_file file; \
+ char buf[sizeof (struct traced_file) + sizeof (filename)]; \
+} id##_traced_file = \
+ { \
+ .file = \
+ { \
+ .fname = filename, ## __VA_ARGS__ \
+ } \
+ }
+
+TF (pwd, "/etc/passwd");
+TF (grp, "/etc/group");
+TF (hst, "/etc/hosts");
+TF (resolv, "/etc/resolv.conf", .call_res_init = 1);
+TF (serv, "/etc/services");
+TF (netgr, "/etc/netgroup");
void
_nss_files_init (void (*cb) (size_t, struct traced_file *))
{
- strcpy (pwd_traced_file.file.fname, "/etc/passwd");
cb (pwddb, &pwd_traced_file.file);
- strcpy (grp_traced_file.file.fname, "/etc/group");
cb (grpdb, &grp_traced_file.file);
- strcpy (hst_traced_file.file.fname, "/etc/hosts");
cb (hstdb, &hst_traced_file.file);
- resolv_traced_file.file.call_res_init = 1;
- strcpy (resolv_traced_file.file.fname, "/etc/resolv.conf");
cb (hstdb, &resolv_traced_file.file);
- strcpy (serv_traced_file.file.fname, "/etc/services");
cb (servdb, &serv_traced_file.file);
+
+ cb (netgrdb, &netgr_traced_file.file);
}
diff --git a/libc/nss/nss_files/files-initgroups.c b/libc/nss/nss_files/files-initgroups.c
index 113abf282..c343b35e5 100644
--- a/libc/nss/nss_files/files-initgroups.c
+++ b/libc/nss/nss_files/files-initgroups.c
@@ -52,8 +52,10 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
gid_t *groups = *groupsp;
/* We have to iterate over the entire file. */
- while (!feof_unlocked (stream))
+ while (1)
{
+ fpos_t pos;
+ fgetpos (stream, &pos);
ssize_t n = getline (&line, &linelen, stream);
if (n < 0)
{
@@ -64,9 +66,8 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
}
struct group grp;
- int res;
- while ((res = _nss_files_parse_grent (line, &grp, buffer, buflen,
- errnop)) == -1)
+ int res = _nss_files_parse_grent (line, &grp, buffer, buflen, errnop);
+ if (res == -1)
{
size_t newbuflen = 2 * buflen;
if (buffer_use_malloc || ! __libc_use_alloca (buflen + newbuflen))
@@ -85,6 +86,9 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
}
else
buffer = extend_alloca (buffer, buflen, newbuflen);
+ /* Reread current line, the parser has clobbered it. */
+ fsetpos (stream, &pos);
+ continue;
}
if (res > 0 && grp.gr_gid != group)
diff --git a/libc/nss/nsswitch.c b/libc/nss/nsswitch.c
index 1dd3c4dc0..06995bda6 100644
--- a/libc/nss/nsswitch.c
+++ b/libc/nss/nsswitch.c
@@ -187,7 +187,7 @@ __nss_database_lookup (const char *database, const char *alternate_name,
unlock_nsswitch;
- return 0;
+ return *ni != NULL ? 0 : -1;
}
libc_hidden_def (__nss_database_lookup)
@@ -216,6 +216,7 @@ __nss_lookup (service_user **ni, const char *fct_name, const char *fct2_name,
return *fctp != NULL ? 0 : (*ni)->next == NULL ? 1 : -1;
}
+libc_hidden_def (__nss_lookup)
/* -1 == not found
@@ -425,7 +426,10 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
will be passed to `known_compare' (above). */
found = __tsearch (&fct_name, &ni->known.tree, &known_compare);
- if (*found != &fct_name)
+ if (found == NULL)
+ /* This means out-of-memory. */
+ result = NULL;
+ else if (*found != &fct_name)
{
/* The search found an existing structure in the tree. */
result = ((known_function *) *found)->fct_ptr;
@@ -445,6 +449,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
/* Oops. We can't instantiate this node properly.
Remove it from the tree. */
__tdelete (&fct_name, &ni->known.tree, &known_compare);
+ free (known);
result = NULL;
}
else
@@ -456,11 +461,8 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
#if !defined DO_STATIC_NSS || defined SHARED
/* Load the appropriate library. */
if (nss_load_library (ni) != 0)
- {
- /* This only happens when out of memory. */
- free (known);
- goto remove_from_tree;
- }
+ /* This only happens when out of memory. */
+ goto remove_from_tree;
if (ni->library->lib_handle == (void *) -1l)
/* Library not found => function not found. */
@@ -887,6 +889,7 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
__nss_not_use_nscd_group = -1;
__nss_not_use_nscd_hosts = -1;
__nss_not_use_nscd_services = -1;
+ __nss_not_use_nscd_netgroup = -1;
}
#endif /* __OPTION_EGLIBC_INET */
#endif
diff --git a/libc/nss/nsswitch.h b/libc/nss/nsswitch.h
index 01df28c9b..3f814b4f0 100644
--- a/libc/nss/nsswitch.h
+++ b/libc/nss/nsswitch.h
@@ -135,7 +135,8 @@ libc_hidden_proto (__nss_database_lookup)
position is remembered in NI. The function returns a value < 0 if
an error occurred or no such function exists. */
extern int __nss_lookup (service_user **ni, const char *fct_name,
- const char *fct2_name, void **fctp) attribute_hidden;
+ const char *fct2_name, void **fctp);
+libc_hidden_proto (__nss_lookup)
/* Determine the next step in the lookup process according to the
result STATUS of the call to the last function returned by
diff --git a/libc/po/Makefile b/libc/po/Makefile
index 4d2f40652..55314e0b4 100644
--- a/libc/po/Makefile
+++ b/libc/po/Makefile
@@ -74,9 +74,6 @@ libc.pot: header.pot libc.pot.files
-f $(objdir)/tmp-libc.pot-files po/$@.new
rm $(objdir)/tmp-libc.pot-files
mv -f $@.new $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) ci -m'Regenerated from source files' $@
-endif
po-sed-cmd = \
'/\/tst-/d;$(foreach S,[ch] cxx sh ksh bash,$(subst .,\.,/.$S\(.in\)*$$/p;))'
@@ -116,9 +113,6 @@ ifneq (,$(pofiles))
chmod 444 $@
linguas: $(pofiles:$(podir)/%=%)
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -m'Copied from $(podir)' $^
-endif
linguas.mo: $(pofiles:$(podir)/%.po=%.mo)
endif
diff --git a/libc/po/ca.po b/libc/po/ca.po
index 0872dcbb5..de0d80e2c 100644
--- a/libc/po/ca.po
+++ b/libc/po/ca.po
@@ -1,7 +1,7 @@
# Catalan messages for GNU libc.
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
# This file is distributed under the same license as the glibc package.
-# Ivan Vilata i Balaguer <ivan@selidor.net>, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2009.
+# Ivan Vilata i Balaguer <ivan@selidor.net>, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2009, 2011.
#
# Sóc Ivan, aquestes són les convencions que adopte per a la 2.4:
#
@@ -47,11 +47,12 @@
# bonic, excepte quan quede realment horrend o porte a confusió).
msgid ""
msgstr ""
-"Project-Id-Version: libc 2.9.90\n"
-"POT-Creation-Date: 2009-02-06 12:40-0800\n"
-"PO-Revision-Date: 2009-04-20 15:27+0200\n"
+"Project-Id-Version: libc 2.14\n"
+"POT-Creation-Date: 2011-05-31 00:06-0400\n"
+"PO-Revision-Date: 2011-09-30 12:49+0200\n"
"Last-Translator: Ivan Vilata i Balaguer <ivan@selidor.net>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
+"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -133,15 +134,19 @@ msgstr "%s: Sobren arguments\n"
msgid "(PROGRAM ERROR) Option should have been recognized!?"
msgstr "(ERROR DEL PROGRAMA) L’opció hauria d’haver estat reconeguda!?"
-#: assert/assert-perr.c:57
+#: assert/assert-perr.c:37
#, c-format
msgid "%s%s%s:%u: %s%sUnexpected error: %s.\n"
msgstr "%s%s%s:%u: %s%sError inesperat: %s.\n"
-#: assert/assert.c:57
+#: assert/assert.c:105
#, c-format
-msgid "%s%s%s:%u: %s%sAssertion `%s' failed.\n"
-msgstr "%s%s%s:%u: %s%sL’asserció «%s» ha fallat.\n"
+msgid ""
+"%s%s%s:%u: %s%sAssertion `%s' failed.\n"
+"%n"
+msgstr ""
+"%s%s%s:%u: %s%sL’asserció «%s» ha fallat.\n"
+"%n"
#: catgets/gencat.c:110 catgets/gencat.c:114 nscd/nscd.c:100 nss/makedb.c:61
msgid "NAME"
@@ -180,14 +185,13 @@ msgstr ""
"[FITXER_EIXIDA [FITXER_ENTRADA]…]"
#: catgets/gencat.c:232 debug/pcprofiledump.c:208 debug/xtrace.sh:58
-#: elf/ldconfig.c:302 elf/ldd.bash.in:56 elf/sln.c:86 elf/sprof.c:360
-#: iconv/iconv_prog.c:408 iconv/iconvconfig.c:380 locale/programs/locale.c:278
-#: locale/programs/localedef.c:371 login/programs/pt_chown.c:88
-#: malloc/memusage.sh:65 malloc/memusagestat.c:533 nscd/nscd.c:415
-#: nss/getent.c:842 nss/makedb.c:231 posix/getconf.c:1030
-#: sunrpc/rpc_main.c:1494 sunrpc/rpcinfo.c:699
+#: elf/ldconfig.c:302 elf/ldd.bash.in:56 elf/sln.c:86 elf/sotruss.ksh:49
+#: elf/sprof.c:371 iconv/iconv_prog.c:408 iconv/iconvconfig.c:380
+#: locale/programs/locale.c:278 locale/programs/localedef.c:371
+#: login/programs/pt_chown.c:92 malloc/memusage.sh:65
+#: malloc/memusagestat.c:539 nscd/nscd.c:415 nss/getent.c:918 nss/makedb.c:231
+#: posix/getconf.c:1122 sunrpc/rpc_main.c:1492 sunrpc/rpcinfo.c:691
#: sysdeps/unix/sysv/linux/lddlibc4.c:62
-#, c-format
msgid ""
"For bug reporting instructions, please see:\n"
"<http://www.gnu.org/software/libc/bugs.html>.\n"
@@ -196,11 +200,11 @@ msgstr ""
"<http://www.gnu.org/software/libc/bugs.html>.\n"
#: catgets/gencat.c:246 debug/pcprofiledump.c:222 debug/xtrace.sh:66
-#: elf/ldconfig.c:316 elf/ldd.bash.in:39 elf/sprof.c:375
+#: elf/ldconfig.c:316 elf/ldd.bash.in:39 elf/sotruss.ksh:76 elf/sprof.c:386
#: iconv/iconv_prog.c:423 iconv/iconvconfig.c:395 locale/programs/locale.c:293
-#: locale/programs/localedef.c:387 login/programs/pt_chown.c:59
-#: malloc/memusage.sh:73 malloc/memusagestat.c:551 nscd/nscd.c:429
-#: nss/getent.c:81 nss/makedb.c:245 posix/getconf.c:1012
+#: locale/programs/localedef.c:387 login/programs/pt_chown.c:63
+#: malloc/memusage.sh:73 malloc/memusagestat.c:557 nscd/nscd.c:429
+#: nss/getent.c:87 nss/makedb.c:245 posix/getconf.c:1104
#: sysdeps/unix/sysv/linux/lddlibc4.c:69
#, c-format
msgid ""
@@ -214,11 +218,11 @@ msgstr ""
"ADEQUACIÓ PER A UN PROPÒSIT PARTICULAR.\n"
#: catgets/gencat.c:251 debug/pcprofiledump.c:227 debug/xtrace.sh:70
-#: elf/ldconfig.c:321 elf/sprof.c:381 iconv/iconv_prog.c:428
+#: elf/ldconfig.c:321 elf/sprof.c:392 iconv/iconv_prog.c:428
#: iconv/iconvconfig.c:400 locale/programs/locale.c:298
#: locale/programs/localedef.c:392 malloc/memusage.sh:77
-#: malloc/memusagestat.c:556 nscd/nscd.c:434 nss/getent.c:86 nss/makedb.c:250
-#: posix/getconf.c:1017
+#: malloc/memusagestat.c:562 nscd/nscd.c:434 nss/getent.c:92 nss/makedb.c:250
+#: posix/getconf.c:1109
#, c-format
msgid "Written by %s.\n"
msgstr "Escrit per %s.\n"
@@ -347,13 +351,13 @@ msgstr "la mida del punter no és vàlida"
msgid "Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\\n"
msgstr "Forma d’ús: xtrace [OPCIÓ]… PROGRAMA [OPCIÓ_DE_PROGRAMA]…\\n"
-#: debug/xtrace.sh:33
-msgid "Try \\`xtrace --help' for more information.\\n"
-msgstr "Proveu «xtrace --help» per a obtenir més informació.\\n"
+#: debug/xtrace.sh:33 malloc/memusage.sh:27
+msgid "Try \\`%s --help' or `%s --usage' for more information.\\n"
+msgstr "Proveu «%s --help» o «%s --usage» per a obtenir més informació.\\n"
#: debug/xtrace.sh:39
-msgid "xtrace: option \\`$1' requires an argument.\\n"
-msgstr "xtrace: l’opció «$1» necessita un argument\\n"
+msgid "%s: option '%s' requires an argument.\\n"
+msgstr "%s: l’opció «%s» necessita un argument\\n"
#: debug/xtrace.sh:46
msgid ""
@@ -440,7 +444,7 @@ msgstr "SO desconegut"
msgid ", OS ABI: %s %d.%d.%d"
msgstr ", ABI del SO: %s %d.%d.%d"
-#: elf/cache.c:134 elf/ldconfig.c:1289
+#: elf/cache.c:134 elf/ldconfig.c:1305
#, c-format
msgid "Can't open cache file %s\n"
msgstr "no s’ha pogut obrir el fitxer «%s» de memòria cau\n"
@@ -481,11 +485,11 @@ msgstr "no s’ha pogut canviar els drets d’accés de «%s» a %#o"
msgid "Renaming of %s to %s failed"
msgstr "no s’ha pogut reanomenar «%s» a «%s»"
-#: elf/dl-close.c:378 elf/dl-open.c:460
+#: elf/dl-close.c:387 elf/dl-open.c:397
msgid "cannot create scope list"
msgstr "no s’ha pogut crear la llista d’àmbits"
-#: elf/dl-close.c:725
+#: elf/dl-close.c:767
msgid "shared object not open"
msgstr "l’objecte compartit no és obert"
@@ -495,7 +499,7 @@ msgstr "l’objecte compartit no és obert"
msgid "DST not allowed in SUID/SGID programs"
msgstr "no es permeten components cadena dinàmica (DST) en programes SUID/SGID"
-#: elf/dl-deps.c:127 elf/dl-open.c:282
+#: elf/dl-deps.c:127
msgid "empty dynamic string token substitution"
msgstr "la substitució del component cadena dinàmica és buida"
@@ -510,13 +514,13 @@ msgstr "no s’ha pogut carregar l’objecte auxiliar «%s» perquè la substitu
msgid "cannot allocate dependency list"
msgstr "no s’ha pogut reservar la llista de dependències"
-#: elf/dl-deps.c:510 elf/dl-deps.c:565
+#: elf/dl-deps.c:514 elf/dl-deps.c:574
msgid "cannot allocate symbol search list"
msgstr "no s’ha pogut reservar la llista de cerca de símbols"
# ivb (2002/10/21)
# ivb LD_TRACE_PRELINKING és una variable d'entorn, no és part del filtre.
-#: elf/dl-deps.c:550
+#: elf/dl-deps.c:554
msgid "Filters not supported with LD_TRACE_PRELINKING"
msgstr "LD_TRACE_PRELINKING no permet l’ús de filtres"
@@ -540,217 +544,226 @@ msgstr "no s’han pogut mapar pàgines per a la taula «fptr»"
msgid "internal error: symidx out of range of fptr table"
msgstr "error intern: «symidx» és fora de rang respecte la taula «fptr»"
-#: elf/dl-load.c:372
+#: elf/dl-load.c:471
msgid "cannot allocate name record"
msgstr "no s’ha pogut reservar el registre de nom"
-#: elf/dl-load.c:474 elf/dl-load.c:582 elf/dl-load.c:667 elf/dl-load.c:780
+#: elf/dl-load.c:548 elf/dl-load.c:664 elf/dl-load.c:749 elf/dl-load.c:862
msgid "cannot create cache for search path"
msgstr "no s’ha pogut crear la memòria cau dels camins de cerca"
-#: elf/dl-load.c:565
+#: elf/dl-load.c:639
msgid "cannot create RUNPATH/RPATH copy"
msgstr "no s’ha pogut crear una còpia de RUNPATH o RPATH"
-#: elf/dl-load.c:653
+#: elf/dl-load.c:735
msgid "cannot create search path array"
msgstr "no s’ha pogut crear el vector de camins de cerca"
-#: elf/dl-load.c:864
+#: elf/dl-load.c:931
msgid "cannot stat shared object"
msgstr "ha fallat stat() sobre l’objecte compartit"
# ivb (2001/10/28)
# ivb Es refereix a /dev/zero .
-#: elf/dl-load.c:934
+#: elf/dl-load.c:1009
msgid "cannot open zero fill device"
msgstr "no s’ha pogut obrir el dispositiu de zeros"
-#: elf/dl-load.c:979 elf/dl-load.c:2215
+#: elf/dl-load.c:1055 elf/dl-load.c:2313
msgid "cannot create shared object descriptor"
msgstr "no s’ha pogut crear el descriptor d’objecte compartit"
-#: elf/dl-load.c:998 elf/dl-load.c:1647 elf/dl-load.c:1739
+#: elf/dl-load.c:1074 elf/dl-load.c:1730 elf/dl-load.c:1833
msgid "cannot read file data"
msgstr "no s’han pogut llegir les dades del fitxer"
-#: elf/dl-load.c:1042
+#: elf/dl-load.c:1120
msgid "ELF load command alignment not page-aligned"
msgstr "l’alineament de l’ordre ELF de càrrega no està alineada amb la pàgina"
-#: elf/dl-load.c:1049
+#: elf/dl-load.c:1127
msgid "ELF load command address/offset not properly aligned"
msgstr "l’adreça o desplaçament de l’ordre ELF de càrrega no està correctament alineada"
-#: elf/dl-load.c:1132
+#: elf/dl-load.c:1210
msgid "cannot allocate TLS data structures for initial thread"
msgstr "no s’han pogut reservar les estructures de dades TLS per al fil inicial"
-#: elf/dl-load.c:1155
+#: elf/dl-load.c:1233
msgid "cannot handle TLS data"
msgstr "no es pot tractar amb dades TLS"
-#: elf/dl-load.c:1174
+#: elf/dl-load.c:1252
msgid "object file has no loadable segments"
msgstr "el fitxer objecte no té segments carregables"
-#: elf/dl-load.c:1210
+#: elf/dl-load.c:1288
msgid "failed to map segment from shared object"
msgstr "no s’ha pogut mapar un segment de l’objecte compartit"
-#: elf/dl-load.c:1236
+#: elf/dl-load.c:1314
msgid "cannot dynamically load executable"
msgstr "no s’ha pogut carregar dinàmicament l’executable"
-#: elf/dl-load.c:1298
+#: elf/dl-load.c:1376
msgid "cannot change memory protections"
msgstr "no s’han pogut canviar les proteccions de memòria"
-#: elf/dl-load.c:1317
+#: elf/dl-load.c:1395
msgid "cannot map zero-fill pages"
msgstr "no s’han pogut mapar les pàgines plenes de zeros"
-#: elf/dl-load.c:1331
+#: elf/dl-load.c:1409
msgid "object file has no dynamic section"
msgstr "el fitxer objecte no té secció dinàmica"
-#: elf/dl-load.c:1354
+#: elf/dl-load.c:1432
msgid "shared object cannot be dlopen()ed"
msgstr "ha fallat dlopen() sobre l’objecte compartit"
-#: elf/dl-load.c:1367
+#: elf/dl-load.c:1445
msgid "cannot allocate memory for program header"
msgstr "no s’ha pogut reservar memòria per a la capçalera del programa"
-#: elf/dl-load.c:1384 elf/dl-open.c:218
+#: elf/dl-load.c:1462 elf/dl-open.c:180
msgid "invalid caller"
msgstr "la biblioteca que ha fet la crida no és vàlida"
-#: elf/dl-load.c:1423
+#: elf/dl-load.c:1501
msgid "cannot enable executable stack as shared object requires"
msgstr "no s’ha pogut habilitar la pila executable a requeriment de l’objecte compartit"
-#: elf/dl-load.c:1436
+#: elf/dl-load.c:1514
msgid "cannot close file descriptor"
msgstr "no s’ha pogut tancar un descriptor de fitxer"
-#: elf/dl-load.c:1647
+#: elf/dl-load.c:1730
msgid "file too short"
msgstr "el fitxer és massa curt"
-#: elf/dl-load.c:1676
+#: elf/dl-load.c:1766
msgid "invalid ELF header"
msgstr "la capçalera ELF no és vàlida"
-#: elf/dl-load.c:1688
+#: elf/dl-load.c:1778
msgid "ELF file data encoding not big-endian"
msgstr "la codificació de les dades del fitxer ELF no és bigâ€endian"
-#: elf/dl-load.c:1690
+#: elf/dl-load.c:1780
msgid "ELF file data encoding not little-endian"
msgstr "la codificació de les dades del fitxer ELF no és littleâ€endian"
-#: elf/dl-load.c:1694
+#: elf/dl-load.c:1784
msgid "ELF file version ident does not match current one"
msgstr "la identificació de la versió del fitxer ELF no concorda amb l’actual"
# ivb (2001/11(06)
# ivb ABI = Application Binary Interface (interfície binària d'aplicació)
-#: elf/dl-load.c:1698
+#: elf/dl-load.c:1788
msgid "ELF file OS ABI invalid"
msgstr "l’ABI de sistema operatiu del fitxer ELF no és vàlida"
-#: elf/dl-load.c:1700
+#: elf/dl-load.c:1791
msgid "ELF file ABI version invalid"
msgstr "la versió de l’ABI del fitxer ELF no és vàlida"
-#: elf/dl-load.c:1703
+#: elf/dl-load.c:1794
+msgid "nonzero padding in e_ident"
+msgstr "el replè d’«e_ident» no conté només zeros"
+
+#: elf/dl-load.c:1797
msgid "internal error"
msgstr "error intern"
-#: elf/dl-load.c:1710
+#: elf/dl-load.c:1804
msgid "ELF file version does not match current one"
msgstr "la versió del fitxer ELF no concorda amb l’actual"
-#: elf/dl-load.c:1718
+#: elf/dl-load.c:1812
msgid "only ET_DYN and ET_EXEC can be loaded"
msgstr "només es poden carregar els tipus ET_DYN i ET_EXEC"
# ivb (2001/11/01)
# ivb La traducció completa de «phentsize» vindria a ser: mida d'entrada
# ivb de taula de la capçalera de programa.
-#: elf/dl-load.c:1724
+#: elf/dl-load.c:1818
msgid "ELF file's phentsize not the expected size"
msgstr "el valor de «phentsize» del fitxer ELF no és l’esperat"
-#: elf/dl-load.c:2231
+#: elf/dl-load.c:2332
msgid "wrong ELF class: ELFCLASS64"
msgstr "la classe ELF no és vàlida: ELFCLASS64"
-#: elf/dl-load.c:2232
+#: elf/dl-load.c:2333
msgid "wrong ELF class: ELFCLASS32"
msgstr "la classe ELF no és vàlida: ELFCLASS32"
-#: elf/dl-load.c:2235
+#: elf/dl-load.c:2336
msgid "cannot open shared object file"
msgstr "no s’ha pogut obrir el fitxer objecte compartit"
-#: elf/dl-lookup.c:356
+#: elf/dl-lookup.c:757
msgid "relocation error"
msgstr "error de reubicació"
-#: elf/dl-lookup.c:384
+#: elf/dl-lookup.c:785
msgid "symbol lookup error"
msgstr "error en cercar el símbol"
-#: elf/dl-open.c:114
+#: elf/dl-open.c:115
msgid "cannot extend global scope"
msgstr "no s’ha pogut estendre l’àmbit global"
# ivb (2002/10/29)
# ivb TLS = Thread Local Storage
-#: elf/dl-open.c:512
+#: elf/dl-open.c:440
msgid "TLS generation counter wrapped! Please report this."
msgstr "El comptador de generació de TLS s’ha esgotat! Per favor, informeu d’açò."
-#: elf/dl-open.c:549
+# Cas general. ivb
+#: elf/dl-open.c:462
+msgid "cannot load any more object with static TLS"
+msgstr "no es poden carregar més objectes amb el TLS estàtic"
+
+#: elf/dl-open.c:511
msgid "invalid mode for dlopen()"
msgstr "el mode de dlopen() no és vàlid"
-#: elf/dl-open.c:566
+#: elf/dl-open.c:528
msgid "no more namespaces available for dlmopen()"
msgstr "no resten espais de noms disponibles per a dlmopen()"
-#: elf/dl-open.c:579
+#: elf/dl-open.c:547
msgid "invalid target namespace in dlmopen()"
msgstr "l’espai de noms destí de dlmopen() no és vàlid"
-#: elf/dl-reloc.c:121
+#: elf/dl-reloc.c:120
msgid "cannot allocate memory in static TLS block"
msgstr "no s’ha pogut reservar memòria al bloc TLS estàtic"
-#: elf/dl-reloc.c:211
+#: elf/dl-reloc.c:212
msgid "cannot make segment writable for relocation"
msgstr "no s’ha pogut fer escrivible el segment per a reubicarâ€lo"
# ivb (2002/10/21)
# ivb PLT = Procedure Linkage Table, Taula d'Enllaçat de Procediments
# ivb PLTREL = tipus de reubicació usada per la PLT
-#: elf/dl-reloc.c:277
+#: elf/dl-reloc.c:275
#, c-format
msgid "%s: no PLTREL found in object %s\n"
msgstr "%s: no s’ha trobat el PLTREL de l’objecte «%s»\n"
-#: elf/dl-reloc.c:288
+#: elf/dl-reloc.c:286
#, c-format
msgid "%s: out of memory to store relocation results for %s\n"
msgstr "%s: no resta memòria per a guardar els resultats de reubicar «%s»\n"
-#: elf/dl-reloc.c:304
+#: elf/dl-reloc.c:302
msgid "cannot restore segment prot after reloc"
msgstr "no s’ha pogut restaurar la protecció del segment després de reubicarâ€lo"
-#: elf/dl-reloc.c:329
+#: elf/dl-reloc.c:331
msgid "cannot apply additional memory protection after relocation"
msgstr "no s’ha pogut protegir la memòria després de reubicar"
@@ -758,14 +771,18 @@ msgstr "no s’ha pogut protegir la memòria després de reubicar"
msgid "RTLD_NEXT used in code not dynamically loaded"
msgstr "s’ha emprat RTLD_NEXT en un codi no carregat dinàmicament"
-#: elf/dl-sysdep.c:481 elf/dl-sysdep.c:493
+#: elf/dl-sysdep.c:488 elf/dl-sysdep.c:500
msgid "cannot create capability list"
msgstr "no s’ha pogut crear la llista de capacitats"
-#: elf/dl-tls.c:864
+#: elf/dl-tls.c:861
msgid "cannot create TLS data structures"
msgstr "no s’han pogut crear les estructures de dades TLS"
+#: elf/dl-version.c:172
+msgid "version lookup error"
+msgstr "error en cercar la versió"
+
#: elf/dl-version.c:303
msgid "cannot allocate version reference table"
msgstr "no s’ha pogut reservar la taula de referències de versions"
@@ -845,151 +862,151 @@ msgstr "s’ha indicat el camí «%s» més d’una volta"
msgid "%s is not a known library type"
msgstr "«%s» no és un tipus conegut de biblioteca"
-#: elf/ldconfig.c:404
+#: elf/ldconfig.c:407
#, c-format
msgid "Can't stat %s"
msgstr "ha fallat stat() sobre «%s»"
-#: elf/ldconfig.c:478
+#: elf/ldconfig.c:481
#, c-format
msgid "Can't stat %s\n"
msgstr "ha fallat stat() sobre «%s»\n"
-#: elf/ldconfig.c:488
+#: elf/ldconfig.c:491
#, c-format
msgid "%s is not a symbolic link\n"
msgstr "«%s» no és un enllaç simbòlic\n"
-#: elf/ldconfig.c:507
+#: elf/ldconfig.c:510
#, c-format
msgid "Can't unlink %s"
msgstr "no s’ha pogut desenllaçar «%s»"
-#: elf/ldconfig.c:513
+#: elf/ldconfig.c:516
#, c-format
msgid "Can't link %s to %s"
msgstr "no s’ha pogut crear un enllaç des de «%s» cap a «%s»"
# ivb (2001/10/28)
# ivb Es refereix a un enllaç -> masculí.
-#: elf/ldconfig.c:519
+#: elf/ldconfig.c:522
msgid " (changed)\n"
msgstr " (canviat)\n"
# ivb (2001/10/28)
# ivb Es refereix a fer o no l'enllaç, no importa el gènere.
-#: elf/ldconfig.c:521
+#: elf/ldconfig.c:524
msgid " (SKIPPED)\n"
msgstr " (SALTAT)\n"
-#: elf/ldconfig.c:576
+#: elf/ldconfig.c:579
#, c-format
msgid "Can't find %s"
msgstr "no s’ha pogut trobar «%s»"
-#: elf/ldconfig.c:592 elf/ldconfig.c:765 elf/ldconfig.c:813 elf/ldconfig.c:847
+#: elf/ldconfig.c:595 elf/ldconfig.c:768 elf/ldconfig.c:827 elf/ldconfig.c:861
#, c-format
msgid "Cannot lstat %s"
msgstr "ha fallat lstat() sobre «%s»"
-#: elf/ldconfig.c:599
+#: elf/ldconfig.c:602
#, c-format
msgid "Ignored file %s since it is not a regular file."
msgstr "es descarta el fitxer «%s» que no és un fitxer ordinari"
-#: elf/ldconfig.c:608
+#: elf/ldconfig.c:611
#, c-format
msgid "No link created since soname could not be found for %s"
msgstr "no s’ha creat l’enllaç perquè no s’ha trobat el nom d’objecte compartit de «%s»"
-#: elf/ldconfig.c:691
+#: elf/ldconfig.c:694
#, c-format
msgid "Can't open directory %s"
msgstr "no s’ha pogut obrir el directori «%s»"
-#: elf/ldconfig.c:779
-#, c-format
-msgid "Cannot stat %s"
-msgstr "ha fallat stat() sobre «%s»"
-
-#: elf/ldconfig.c:834 elf/readlib.c:91
+#: elf/ldconfig.c:786 elf/ldconfig.c:848 elf/readlib.c:91
#, c-format
msgid "Input file %s not found.\n"
msgstr "no s’ha trobat el fitxer d’entrada «%s»\n"
-#: elf/ldconfig.c:908
+#: elf/ldconfig.c:793
+#, c-format
+msgid "Cannot stat %s"
+msgstr "ha fallat stat() sobre «%s»"
+
+#: elf/ldconfig.c:922
#, c-format
msgid "libc5 library %s in wrong directory"
msgstr "la biblioteca «%s» per a libc5 es troba en un directori incorrecte"
-#: elf/ldconfig.c:911
+#: elf/ldconfig.c:925
#, c-format
msgid "libc6 library %s in wrong directory"
msgstr "la biblioteca «%s» per a libc6 es troba en un directori incorrecte"
-#: elf/ldconfig.c:914
+#: elf/ldconfig.c:928
#, c-format
msgid "libc4 library %s in wrong directory"
msgstr "la biblioteca «%s» per a libc4 es troba en un directori incorrecte"
-#: elf/ldconfig.c:942
+#: elf/ldconfig.c:956
#, c-format
msgid "libraries %s and %s in directory %s have same soname but different type."
msgstr "les biblioteques «%s» i «%s» del directori «%s» tenen el mateix nom d’objecte compartit però diferent tipus."
-#: elf/ldconfig.c:1051
+#: elf/ldconfig.c:1065
#, c-format
msgid "Can't open configuration file %s"
msgstr "no s’ha pogut obrir el fitxer «%s» de configuració"
-#: elf/ldconfig.c:1115
+#: elf/ldconfig.c:1129
#, c-format
msgid "%s:%u: bad syntax in hwcap line"
msgstr "%s:%u: la sintaxi de la línia «hwcap» no és vàlida"
-#: elf/ldconfig.c:1121
+#: elf/ldconfig.c:1135
#, c-format
msgid "%s:%u: hwcap index %lu above maximum %u"
msgstr "%s:%u: la «hwcap» amb índex %lu està sobre el màxim %u"
# La substitució final és per un nom. ivb
-#: elf/ldconfig.c:1128 elf/ldconfig.c:1136
+#: elf/ldconfig.c:1142 elf/ldconfig.c:1150
#, c-format
msgid "%s:%u: hwcap index %lu already defined as %s"
msgstr "%s:%u: la «hwcap» amb índex %lu ja ha estat definida com a «%s»"
-#: elf/ldconfig.c:1139
+#: elf/ldconfig.c:1153
#, c-format
msgid "%s:%u: duplicate hwcap %lu %s"
msgstr "%s:%u: la «hwcap» %lu amb nom «%s» està duplicada"
-#: elf/ldconfig.c:1161
+#: elf/ldconfig.c:1175
#, c-format
msgid "need absolute file name for configuration file when using -r"
msgstr "cal indicar el camí absolut del fitxer de configuració en emprar «-r»"
-#: elf/ldconfig.c:1168 locale/programs/xmalloc.c:70 malloc/obstack.c:434
-#: malloc/obstack.c:436 posix/getconf.c:985 posix/getconf.c:1177
+#: elf/ldconfig.c:1182 locale/programs/xmalloc.c:70 malloc/obstack.c:434
+#: malloc/obstack.c:436 posix/getconf.c:1077 posix/getconf.c:1297
#, c-format
msgid "memory exhausted"
msgstr "la memòria s’ha exhaurit"
-#: elf/ldconfig.c:1198
+#: elf/ldconfig.c:1214
#, c-format
msgid "%s:%u: cannot read directory %s"
msgstr "%s:%u: no s’ha pogut llegir el directori «%s»"
-#: elf/ldconfig.c:1242
+#: elf/ldconfig.c:1258
#, c-format
msgid "relative path `%s' used to build cache"
msgstr "s’ha indicat el camí relatiu «%s» per a construir la memòria cau"
-#: elf/ldconfig.c:1268
+#: elf/ldconfig.c:1284
#, c-format
msgid "Can't chdir to /"
msgstr "no s’ha pogut canviar al directori arrel"
-#: elf/ldconfig.c:1310
+#: elf/ldconfig.c:1325
#, c-format
msgid "Can't open cache file directory %s\n"
msgstr "no s’ha pogut obrir el directori «%s» de fitxers de memòria cau\n"
@@ -1043,7 +1060,7 @@ msgstr "El fitxer o directori no existeix"
# ivb (2001/10/31)
# ivb Cal tenir en compte que «ordinary» a l'anglés és cosa pler diferent ;)
-#: elf/ldd.bash.in:153 inet/rcmd.c:483
+#: elf/ldd.bash.in:153 inet/rcmd.c:488
msgid "not regular file"
msgstr "no és un fitxer ordinari"
@@ -1160,6 +1177,67 @@ msgstr "%s: el destí no és vàlid: %s\n"
msgid "Invalid link from \"%s\" to \"%s\": %s\n"
msgstr "l’enllaç des de «%s» cap a «%s» no és vàlid: %s\n"
+#: elf/sotruss.ksh:33
+#, sh-format
+msgid ""
+"Usage: sotruss [OPTION...] [--] EXECUTABLE [EXECUTABLE-OPTION...]\n"
+" -F, --from FROMLIST trace calls from objects on FORMLIST\n"
+" -T, --to TOLIST trace calls to objects on TOLIST\n"
+"\n"
+" -e, --exit also show exits from the function calls\n"
+" -f, --follow trace child processes\n"
+" -o, --output FILENAME write output to FILENAME (or FILENAME.$PID in case\n"
+"\t\t\t -f is also used) instead of standard error\n"
+"\n"
+" --help print this help and exit\n"
+" --version print version information and exit"
+msgstr ""
+"Forma d’ús: sotruss [OPCIÓ…] [--] EXECUTABLE [OPCIÓ_EXECUTABLE…]\n"
+"\n"
+" -F, --from LLISTA_DE Traça les crides dels objectes de la LLISTA_DE.\n"
+" -T, --to LLISTA_A Traça les crides als objectes de la LLISTA_A.\n"
+"\n"
+" -e, --exit També mostra les eixides de les crides a funcions.\n"
+" -f, --follow Traça els processos fill.\n"
+" -o, --output FITXER Escriu l’eixida al FITXER (o a FITXER.$PID si s’empra\n"
+" l’opció «-f») en lloc de l’eixida estàndard d’errors.\n"
+"\n"
+" --help Mostra aquesta ajuda i surt.\n"
+" --version Mostra informació sobre la versió i surt."
+
+#: elf/sotruss.ksh:46
+msgid "Mandatory arguments to long options are also mandatory for any corresponding\\nshort options.\\n"
+msgstr "Els arguments obligatoris o opcionals per a les opcions llargues també ho són\\nper a les opcions curtes corresponents.\\n"
+
+#: elf/sotruss.ksh:56
+msgid "%s: option requires an argument -- '%s'\\n"
+msgstr "%s: l’opció «%c» necessita un argument\\n"
+
+#: elf/sotruss.ksh:57 elf/sotruss.ksh:68 elf/sotruss.ksh:134
+msgid "Try \\`%s --help' or \\`%s --usage' for more information.\\n"
+msgstr "Proveu «%s --help» o «%s --usage» per a obtenir més informació.\\n"
+
+#: elf/sotruss.ksh:62
+msgid "%s: option is ambiguous; possibilities:"
+msgstr "%s: l’opció és ambígua; possibilitats:"
+
+#: elf/sotruss.ksh:80
+msgid "Written by %s.\\n"
+msgstr "Escrit per %s.\\n"
+
+#: elf/sotruss.ksh:87
+msgid ""
+"Usage: %s [-ef] [-F FROMLIST] [-o FILENAME] [-T TOLIST] [--exit]\n"
+"\t [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]\\n"
+msgstr ""
+"Forma d’ús: %s [-ef] [-F LLISTA_DE] [-o FITXER] [-T LLISTA_A]\n"
+" [--exit] [--follow]\n"
+" [--from LLISTA_DE] [--output FITXER] [--to LLISTA_A]\\n"
+
+#: elf/sotruss.ksh:133
+msgid "%s: unrecognized option '%c%s'\\n"
+msgstr "%s: l’opció «%c%s» no és reconeguda\\n"
+
# Més ajudes. ivb
#: elf/sprof.c:77
msgid "Output selection:"
@@ -1185,92 +1263,92 @@ msgstr "Llig i mostra les dades de perfilat d’un objecte compartit."
msgid "SHOBJ [PROFDATA]"
msgstr "OBJECTE_COMPARTIT [DADES_PERFILAT]"
-#: elf/sprof.c:420
+#: elf/sprof.c:431
#, c-format
msgid "failed to load shared object `%s'"
msgstr "no s’ha pogut carregar l’objecte compartit «%s»"
-#: elf/sprof.c:429
+#: elf/sprof.c:440
#, c-format
msgid "cannot create internal descriptors"
msgstr "no s’han pogut crear els descriptors interns"
-#: elf/sprof.c:548
+#: elf/sprof.c:559
#, c-format
msgid "Reopening shared object `%s' failed"
msgstr "no s’ha pogut reobrir l’objecte compartit «%s»"
-#: elf/sprof.c:555 elf/sprof.c:649
+#: elf/sprof.c:566 elf/sprof.c:660
#, c-format
msgid "reading of section headers failed"
msgstr "la lectura de les capçaleres de secció ha fallat"
-#: elf/sprof.c:563 elf/sprof.c:657
+#: elf/sprof.c:574 elf/sprof.c:668
#, c-format
msgid "reading of section header string table failed"
msgstr "la lectura de la taula de cadenes de capçalera de secció ha fallat"
-#: elf/sprof.c:589
+#: elf/sprof.c:600
#, c-format
msgid "*** Cannot read debuginfo file name: %m\n"
msgstr "*** No s’ha pogut llegir el nom del fitxer d’informació de depuració: %m\n"
-#: elf/sprof.c:609
+#: elf/sprof.c:620
#, c-format
msgid "cannot determine file name"
msgstr "no s’ha pogut determinar un nom de fitxer"
-#: elf/sprof.c:642
+#: elf/sprof.c:653
#, c-format
msgid "reading of ELF header failed"
msgstr "la lectura de la capçalera ELF ha fallat"
-#: elf/sprof.c:678
+#: elf/sprof.c:689
#, c-format
msgid "*** The file `%s' is stripped: no detailed analysis possible\n"
msgstr "*** El fitxer «%s» no conté símbols: no és possible l’anàlisi detallada\n"
-#: elf/sprof.c:708
+#: elf/sprof.c:719
#, c-format
msgid "failed to load symbol data"
msgstr "no s’han pogut carregar les dades simbòliques"
-#: elf/sprof.c:775
+#: elf/sprof.c:784
#, c-format
msgid "cannot load profiling data"
msgstr "no s’han pogut carregar les dades de perfilat"
-#: elf/sprof.c:784
+#: elf/sprof.c:793
#, c-format
msgid "while stat'ing profiling data file"
msgstr "en cridar stat() sobre el fitxer de dades de perfilat"
-#: elf/sprof.c:792
+#: elf/sprof.c:801
#, c-format
msgid "profiling data file `%s' does not match shared object `%s'"
msgstr "el fitxer «%s» de dades de perfilat no correspon a l’objecte compartit «%s»"
-#: elf/sprof.c:803
+#: elf/sprof.c:812
#, c-format
msgid "failed to mmap the profiling data file"
msgstr "ha fallat mmap() sobre el fitxer de dades de perfilat"
-#: elf/sprof.c:811
+#: elf/sprof.c:820
#, c-format
msgid "error while closing the profiling data file"
msgstr "error en tancar el fitxer de dades de perfilat"
-#: elf/sprof.c:820 elf/sprof.c:890
+#: elf/sprof.c:829 elf/sprof.c:927
#, c-format
msgid "cannot create internal descriptor"
msgstr "no s’ha pogut crear un descriptor intern"
-#: elf/sprof.c:866
+#: elf/sprof.c:903
#, c-format
msgid "`%s' is no correct profile data file for `%s'"
msgstr "«%s» no és un fitxer vàlid de perfilat de «%s»"
-#: elf/sprof.c:1047 elf/sprof.c:1105
+#: elf/sprof.c:1084 elf/sprof.c:1142
#, c-format
msgid "cannot allocate symbol data"
msgstr "no s’han pogut reservar les dades de símbols"
@@ -1464,68 +1542,68 @@ msgstr "en inserir a l’arbre de cerca"
msgid "cannot generate output file"
msgstr "no s’ha pogut generar el fitxer d’eixida"
-#: inet/rcmd.c:157
+#: inet/rcmd.c:163
msgid "rcmd: Cannot allocate memory\n"
msgstr "rcmd: no s’ha pogut reservar memòria\n"
-#: inet/rcmd.c:172
+#: inet/rcmd.c:178
msgid "rcmd: socket: All ports in use\n"
msgstr "rcmd: socket: tots els ports estan sent emprats\n"
-#: inet/rcmd.c:200
+#: inet/rcmd.c:206
#, c-format
msgid "connect to address %s: "
msgstr "connexió amb l’adreça «%s»: "
-#: inet/rcmd.c:213
+#: inet/rcmd.c:219
#, c-format
msgid "Trying %s...\n"
msgstr "S’està provant amb «%s»…\n"
-#: inet/rcmd.c:249
+#: inet/rcmd.c:255
#, c-format
msgid "rcmd: write (setting up stderr): %m\n"
msgstr "rcmd: write (en preparar l’eixida estàndard d’errors): %m\n"
-#: inet/rcmd.c:265
+#: inet/rcmd.c:271
#, c-format
msgid "rcmd: poll (setting up stderr): %m\n"
msgstr "rcmd: poll (en preparar l’eixida estàndard d’errors): %m\n"
-#: inet/rcmd.c:268
+#: inet/rcmd.c:274
msgid "poll: protocol failure in circuit setup\n"
msgstr "poll: fallada del protocol en configurar el circuit\n"
-#: inet/rcmd.c:301
+#: inet/rcmd.c:306
msgid "socket: protocol failure in circuit setup\n"
msgstr "socket: fallada del protocol en configurar el circuit\n"
-#: inet/rcmd.c:325
+#: inet/rcmd.c:330
#, c-format
msgid "rcmd: %s: short read"
msgstr "rcmd: %s: lectura incompleta"
-#: inet/rcmd.c:481
+#: inet/rcmd.c:486
msgid "lstat failed"
msgstr "ha fallat lstat()"
-#: inet/rcmd.c:488
+#: inet/rcmd.c:493
msgid "cannot open"
msgstr "no s’ha pogut obrir"
-#: inet/rcmd.c:490
+#: inet/rcmd.c:495
msgid "fstat failed"
msgstr "ha fallat fstat()"
-#: inet/rcmd.c:492
+#: inet/rcmd.c:497
msgid "bad owner"
msgstr "el propietari no és vàlid"
-#: inet/rcmd.c:494
+#: inet/rcmd.c:499
msgid "writeable by other than owner"
msgstr "és modificable per altres que no en són el propietari"
-#: inet/rcmd.c:496
+#: inet/rcmd.c:501
msgid "hard linked somewhere"
msgstr "té un enllaç fort en altre lloc"
@@ -1648,8 +1726,8 @@ msgid "no symbolic name given for end of range"
msgstr "no s’ha indicat un nom simbòlic per a la fi del rang"
#: locale/programs/charmap.c:610 locale/programs/ld-address.c:602
-#: locale/programs/ld-collate.c:2767 locale/programs/ld-collate.c:3924
-#: locale/programs/ld-ctype.c:2232 locale/programs/ld-ctype.c:2984
+#: locale/programs/ld-collate.c:2769 locale/programs/ld-collate.c:3927
+#: locale/programs/ld-ctype.c:2257 locale/programs/ld-ctype.c:3009
#: locale/programs/ld-identification.c:452
#: locale/programs/ld-measurement.c:238 locale/programs/ld-messages.c:332
#: locale/programs/ld-monetary.c:943 locale/programs/ld-name.c:307
@@ -1676,8 +1754,8 @@ msgid "%s: error in state machine"
msgstr "%s: error a la màquina d’estats"
#: locale/programs/charmap.c:850 locale/programs/ld-address.c:618
-#: locale/programs/ld-collate.c:2764 locale/programs/ld-collate.c:4117
-#: locale/programs/ld-ctype.c:2229 locale/programs/ld-ctype.c:3001
+#: locale/programs/ld-collate.c:2766 locale/programs/ld-collate.c:4120
+#: locale/programs/ld-ctype.c:2254 locale/programs/ld-ctype.c:3026
#: locale/programs/ld-identification.c:468
#: locale/programs/ld-measurement.c:254 locale/programs/ld-messages.c:348
#: locale/programs/ld-monetary.c:959 locale/programs/ld-name.c:323
@@ -1698,7 +1776,7 @@ msgstr "el caràcter «%s» no és conegut"
msgid "number of bytes for byte sequence of beginning and end of range not the same: %d vs %d"
msgstr "el nombre d’octets de les seqüències d’inici i final del rang no són iguals: %d i %d"
-#: locale/programs/charmap.c:993 locale/programs/ld-collate.c:3044
+#: locale/programs/charmap.c:993 locale/programs/ld-collate.c:3046
#: locale/programs/repertoire.c:419
msgid "invalid names for character range"
msgstr "els noms del rang de caràcters no són vàlids"
@@ -1723,8 +1801,8 @@ msgstr "el límit superior del rang és menor que l’inferior"
msgid "resulting bytes for range not representable."
msgstr "els octets resultants del rang no són representables"
-#: locale/programs/ld-address.c:135 locale/programs/ld-collate.c:1556
-#: locale/programs/ld-ctype.c:420 locale/programs/ld-identification.c:133
+#: locale/programs/ld-address.c:135 locale/programs/ld-collate.c:1558
+#: locale/programs/ld-ctype.c:421 locale/programs/ld-identification.c:133
#: locale/programs/ld-measurement.c:94 locale/programs/ld-messages.c:97
#: locale/programs/ld-monetary.c:194 locale/programs/ld-name.c:94
#: locale/programs/ld-numeric.c:98 locale/programs/ld-paper.c:91
@@ -1792,7 +1870,7 @@ msgid "%s: numeric country code `%d' not valid"
msgstr "%s: el codi numèric de país «%d» no és vàlid"
#: locale/programs/ld-address.c:510 locale/programs/ld-address.c:547
-#: locale/programs/ld-address.c:585 locale/programs/ld-ctype.c:2608
+#: locale/programs/ld-address.c:585 locale/programs/ld-ctype.c:2633
#: locale/programs/ld-identification.c:364
#: locale/programs/ld-measurement.c:221 locale/programs/ld-messages.c:301
#: locale/programs/ld-monetary.c:701 locale/programs/ld-monetary.c:736
@@ -1814,8 +1892,8 @@ msgstr "%s: el camp «%s» ha estat declarat més d’una volta"
msgid "%s: unknown character in field `%s'"
msgstr "%s: el camp «%s» conté un caràcter desconegut"
-#: locale/programs/ld-address.c:599 locale/programs/ld-collate.c:3922
-#: locale/programs/ld-ctype.c:2981 locale/programs/ld-identification.c:449
+#: locale/programs/ld-address.c:599 locale/programs/ld-collate.c:3925
+#: locale/programs/ld-ctype.c:3006 locale/programs/ld-identification.c:449
#: locale/programs/ld-measurement.c:235 locale/programs/ld-messages.c:330
#: locale/programs/ld-monetary.c:941 locale/programs/ld-name.c:305
#: locale/programs/ld-numeric.c:366 locale/programs/ld-paper.c:239
@@ -1824,12 +1902,12 @@ msgstr "%s: el camp «%s» conté un caràcter desconegut"
msgid "%s: incomplete `END' line"
msgstr "%s: la línia «END» és incompleta"
-#: locale/programs/ld-address.c:609 locale/programs/ld-collate.c:542
-#: locale/programs/ld-collate.c:594 locale/programs/ld-collate.c:890
-#: locale/programs/ld-collate.c:903 locale/programs/ld-collate.c:2733
-#: locale/programs/ld-collate.c:2754 locale/programs/ld-collate.c:4107
-#: locale/programs/ld-ctype.c:1960 locale/programs/ld-ctype.c:2219
-#: locale/programs/ld-ctype.c:2806 locale/programs/ld-ctype.c:2992
+#: locale/programs/ld-address.c:609 locale/programs/ld-collate.c:544
+#: locale/programs/ld-collate.c:596 locale/programs/ld-collate.c:892
+#: locale/programs/ld-collate.c:905 locale/programs/ld-collate.c:2735
+#: locale/programs/ld-collate.c:2756 locale/programs/ld-collate.c:4110
+#: locale/programs/ld-ctype.c:1985 locale/programs/ld-ctype.c:2244
+#: locale/programs/ld-ctype.c:2831 locale/programs/ld-ctype.c:3017
#: locale/programs/ld-identification.c:459
#: locale/programs/ld-measurement.c:245 locale/programs/ld-messages.c:339
#: locale/programs/ld-monetary.c:950 locale/programs/ld-name.c:314
@@ -1839,476 +1917,476 @@ msgstr "%s: la línia «END» és incompleta"
msgid "%s: syntax error"
msgstr "%s: error de sintaxi"
-#: locale/programs/ld-collate.c:417
+#: locale/programs/ld-collate.c:419
#, c-format
msgid "`%.*s' already defined in charmap"
msgstr "«%.*s» ja ha estat definit al mapa de caràcters"
-#: locale/programs/ld-collate.c:426
+#: locale/programs/ld-collate.c:428
#, c-format
msgid "`%.*s' already defined in repertoire"
msgstr "«%.*s» ja ha estat definit al repertori"
-#: locale/programs/ld-collate.c:433
+#: locale/programs/ld-collate.c:435
#, c-format
msgid "`%.*s' already defined as collating symbol"
msgstr "«%.*s» ja ha estat definit com a símbol d’ordenació"
-#: locale/programs/ld-collate.c:440
+#: locale/programs/ld-collate.c:442
#, c-format
msgid "`%.*s' already defined as collating element"
msgstr "«%.*s» ja ha estat definit com a element d’ordenació"
-#: locale/programs/ld-collate.c:471 locale/programs/ld-collate.c:497
+#: locale/programs/ld-collate.c:473 locale/programs/ld-collate.c:499
#, c-format
msgid "%s: `forward' and `backward' are mutually excluding each other"
msgstr "%s: «forward» i «backward» són mútuament excloents"
-#: locale/programs/ld-collate.c:481 locale/programs/ld-collate.c:507
-#: locale/programs/ld-collate.c:523
+#: locale/programs/ld-collate.c:483 locale/programs/ld-collate.c:509
+#: locale/programs/ld-collate.c:525
#, c-format
msgid "%s: `%s' mentioned more than once in definition of weight %d"
msgstr "%s: s’ha mencionat «%s» més d’una volta a la definició de pes %d"
-#: locale/programs/ld-collate.c:579
+#: locale/programs/ld-collate.c:581
#, c-format
msgid "%s: too many rules; first entry only had %d"
msgstr "%s: sobren regles; la primera entrada només en tenia %d"
-#: locale/programs/ld-collate.c:615
+#: locale/programs/ld-collate.c:617
#, c-format
msgid "%s: not enough sorting rules"
msgstr "%s: no hi ha suficients regles d’ordenació"
-#: locale/programs/ld-collate.c:780
+#: locale/programs/ld-collate.c:782
#, c-format
msgid "%s: empty weight string not allowed"
msgstr "%s: no es permet la cadena buida com a nom de pes"
-#: locale/programs/ld-collate.c:875
+#: locale/programs/ld-collate.c:877
#, c-format
msgid "%s: weights must use the same ellipsis symbol as the name"
msgstr "%s: els pesos han d’emprar el mateix símbol d’eŀlipsi que el nom"
-#: locale/programs/ld-collate.c:931
+#: locale/programs/ld-collate.c:933
#, c-format
msgid "%s: too many values"
msgstr "%s: sobren valors"
-#: locale/programs/ld-collate.c:1051 locale/programs/ld-collate.c:1226
+#: locale/programs/ld-collate.c:1053 locale/programs/ld-collate.c:1228
#, c-format
msgid "order for `%.*s' already defined at %s:%Zu"
msgstr "l’ordre de «%.*s» ja ha estat definit a %s:%Zu"
-#: locale/programs/ld-collate.c:1101
+#: locale/programs/ld-collate.c:1103
#, c-format
msgid "%s: the start and the end symbol of a range must stand for characters"
msgstr "%s: els símbols inicial i final d’un rang han de representar caràcters"
-#: locale/programs/ld-collate.c:1128
+#: locale/programs/ld-collate.c:1130
#, c-format
msgid "%s: byte sequences of first and last character must have the same length"
msgstr "%s: les seqüències d’octets del primer i darrer caràcter han de tenir la mateixa longitud"
-#: locale/programs/ld-collate.c:1170
+#: locale/programs/ld-collate.c:1172
#, c-format
msgid "%s: byte sequence of first character of range is not lower than that of the last character"
msgstr "%s: la seqüència d’octets del primer caràcter del rang no és menor que la del darrer caràcter"
-#: locale/programs/ld-collate.c:1295
+#: locale/programs/ld-collate.c:1297
#, c-format
msgid "%s: symbolic range ellipsis must not directly follow `order_start'"
msgstr "%s: un rang simbòlic amb eŀlipsi no pot anar just darrere d’«order_start»"
-#: locale/programs/ld-collate.c:1299
+#: locale/programs/ld-collate.c:1301
#, c-format
msgid "%s: symbolic range ellipsis must not be directly followed by `order_end'"
msgstr "%s: un rang simbòlic amb eŀlipsi no pot anar just davant d’«order_end»"
-#: locale/programs/ld-collate.c:1319 locale/programs/ld-ctype.c:1477
+#: locale/programs/ld-collate.c:1321 locale/programs/ld-ctype.c:1502
#, c-format
msgid "`%s' and `%.*s' are not valid names for symbolic range"
msgstr "«%s» i «%.*s» no són noms vàlids de rangs simbòlics"
-#: locale/programs/ld-collate.c:1369 locale/programs/ld-collate.c:3858
+#: locale/programs/ld-collate.c:1371 locale/programs/ld-collate.c:3861
#, c-format
msgid "%s: order for `%.*s' already defined at %s:%Zu"
msgstr "%s: l’ordre de «%.*s» ja ha estat definit a %s:%Zu"
-#: locale/programs/ld-collate.c:1378
+#: locale/programs/ld-collate.c:1380
#, c-format
msgid "%s: `%s' must be a character"
msgstr "%s: «%s» ha de ser un caràcter"
-#: locale/programs/ld-collate.c:1573
+#: locale/programs/ld-collate.c:1575
#, c-format
msgid "%s: `position' must be used for a specific level in all sections or none"
msgstr "%s: cal emprar «position» per a un nivell específic a totes les seccions o a cap"
-#: locale/programs/ld-collate.c:1598
+#: locale/programs/ld-collate.c:1600
#, c-format
msgid "symbol `%s' not defined"
msgstr "el símbol «%s» no ha estat definit"
-#: locale/programs/ld-collate.c:1674 locale/programs/ld-collate.c:1780
+#: locale/programs/ld-collate.c:1676 locale/programs/ld-collate.c:1782
#, c-format
msgid "symbol `%s' has the same encoding as"
msgstr "el símbol «%s» té la mateixa codificació que"
-#: locale/programs/ld-collate.c:1678 locale/programs/ld-collate.c:1784
+#: locale/programs/ld-collate.c:1680 locale/programs/ld-collate.c:1786
#, c-format
msgid "symbol `%s'"
msgstr "el símbol «%s»"
-#: locale/programs/ld-collate.c:1826
+#: locale/programs/ld-collate.c:1828
#, c-format
msgid "no definition of `UNDEFINED'"
msgstr "no s’ha definit «UNDEFINED»"
-#: locale/programs/ld-collate.c:1855
+#: locale/programs/ld-collate.c:1857
#, c-format
msgid "too many errors; giving up"
msgstr "hi ha massa errors: s’abandona"
-#: locale/programs/ld-collate.c:2659 locale/programs/ld-collate.c:4046
+#: locale/programs/ld-collate.c:2661 locale/programs/ld-collate.c:4049
#, c-format
msgid "%s: nested conditionals not supported"
msgstr "%s: no es permeten els condicionals niats"
-#: locale/programs/ld-collate.c:2677
+#: locale/programs/ld-collate.c:2679
#, c-format
msgid "%s: more then one 'else'"
msgstr "%s: hi ha més d’una clàusula «else»"
-#: locale/programs/ld-collate.c:2852
+#: locale/programs/ld-collate.c:2854
#, c-format
msgid "%s: duplicate definition of `%s'"
msgstr "%s: la definició de «%s» és duplicada"
-#: locale/programs/ld-collate.c:2888
+#: locale/programs/ld-collate.c:2890
#, c-format
msgid "%s: duplicate declaration of section `%s'"
msgstr "%s: la declaració de la secció «%s» és duplicada"
-#: locale/programs/ld-collate.c:3024
+#: locale/programs/ld-collate.c:3026
#, c-format
msgid "%s: unknown character in collating symbol name"
msgstr "%s: el nom del símbol d’ordenació conté un caràcter desconegut"
-#: locale/programs/ld-collate.c:3153
+#: locale/programs/ld-collate.c:3155
#, c-format
msgid "%s: unknown character in equivalent definition name"
msgstr "%s: el nom de la definició equivalent conté un caràcter desconegut"
-#: locale/programs/ld-collate.c:3164
+#: locale/programs/ld-collate.c:3166
#, c-format
msgid "%s: unknown character in equivalent definition value"
msgstr "%s: el valor de la definició equivalent conté un caràcter desconegut"
-#: locale/programs/ld-collate.c:3174
+#: locale/programs/ld-collate.c:3176
#, c-format
msgid "%s: unknown symbol `%s' in equivalent definition"
msgstr "%s: la definició equivalent conté el símbol desconegut «%s»"
-#: locale/programs/ld-collate.c:3183
+#: locale/programs/ld-collate.c:3185
msgid "error while adding equivalent collating symbol"
msgstr "error en afegir un símbol d’ordenació equivalent"
-#: locale/programs/ld-collate.c:3221
+#: locale/programs/ld-collate.c:3223
#, c-format
msgid "duplicate definition of script `%s'"
msgstr "la definició de l’escriptura «%s» és duplicada"
-#: locale/programs/ld-collate.c:3269
+#: locale/programs/ld-collate.c:3271
#, c-format
msgid "%s: unknown section name `%.*s'"
msgstr "%s: el nom de secció «%.*s» no és conegut"
-#: locale/programs/ld-collate.c:3298
+#: locale/programs/ld-collate.c:3300
#, c-format
msgid "%s: multiple order definitions for section `%s'"
msgstr "%s: hi ha múltiples definicions d’ordre de la secció «%s»"
-#: locale/programs/ld-collate.c:3326
+#: locale/programs/ld-collate.c:3328
#, c-format
msgid "%s: invalid number of sorting rules"
msgstr "%s: el nombre de regles d’ordenació no és vàlid"
-#: locale/programs/ld-collate.c:3353
+#: locale/programs/ld-collate.c:3355
#, c-format
msgid "%s: multiple order definitions for unnamed section"
msgstr "%s: hi ha múltiples definicions d’ordre a la secció sense nom"
-#: locale/programs/ld-collate.c:3407 locale/programs/ld-collate.c:3537
-#: locale/programs/ld-collate.c:3900
+#: locale/programs/ld-collate.c:3410 locale/programs/ld-collate.c:3540
+#: locale/programs/ld-collate.c:3903
#, c-format
msgid "%s: missing `order_end' keyword"
msgstr "%s: manca la paraula clau «order_end»"
-#: locale/programs/ld-collate.c:3470
+#: locale/programs/ld-collate.c:3473
#, c-format
msgid "%s: order for collating symbol %.*s not yet defined"
msgstr "%s: l’ordre del símbol d’ordenació «%.*s» encara no ha estat definit"
-#: locale/programs/ld-collate.c:3488
+#: locale/programs/ld-collate.c:3491
#, c-format
msgid "%s: order for collating element %.*s not yet defined"
msgstr "%s: l’ordre de l’element d’ordenació «%.*s» encara no ha estat definit"
-#: locale/programs/ld-collate.c:3499
+#: locale/programs/ld-collate.c:3502
#, c-format
msgid "%s: cannot reorder after %.*s: symbol not known"
msgstr "%s: no s’ha pogut reordenar després de «%.*s»: el símbol no és conegut"
-#: locale/programs/ld-collate.c:3551 locale/programs/ld-collate.c:3912
+#: locale/programs/ld-collate.c:3554 locale/programs/ld-collate.c:3915
#, c-format
msgid "%s: missing `reorder-end' keyword"
msgstr "%s: manca la paraula clau «reorder-end»"
-#: locale/programs/ld-collate.c:3585 locale/programs/ld-collate.c:3783
+#: locale/programs/ld-collate.c:3588 locale/programs/ld-collate.c:3786
#, c-format
msgid "%s: section `%.*s' not known"
msgstr "%s: la secció «%.*s» no és coneguda"
-#: locale/programs/ld-collate.c:3650
+#: locale/programs/ld-collate.c:3653
#, c-format
msgid "%s: bad symbol <%.*s>"
msgstr "%s: el símbol <%.*s> no és vàlid"
-#: locale/programs/ld-collate.c:3846
+#: locale/programs/ld-collate.c:3849
#, c-format
msgid "%s: cannot have `%s' as end of ellipsis range"
msgstr "%s: «%s» no es pot trobar al final d’un rang amb eŀlipsi"
-#: locale/programs/ld-collate.c:3896
+#: locale/programs/ld-collate.c:3899
#, c-format
msgid "%s: empty category description not allowed"
msgstr "%s: no es permet una descripció buida de la categoria"
-#: locale/programs/ld-collate.c:3915
+#: locale/programs/ld-collate.c:3918
#, c-format
msgid "%s: missing `reorder-sections-end' keyword"
msgstr "%s: manca la paraula clau «reorder-sections-end»"
-#: locale/programs/ld-collate.c:4079
+#: locale/programs/ld-collate.c:4082
#, c-format
msgid "%s: '%s' without matching 'ifdef' or 'ifndef'"
msgstr "%s: s’ha trobat un «%s» sense el corresponent «ifdef» o «ifndef»"
-#: locale/programs/ld-collate.c:4097
+#: locale/programs/ld-collate.c:4100
#, c-format
msgid "%s: 'endif' without matching 'ifdef' or 'ifndef'"
msgstr "%s: s’ha trobat un «endif» sense el corresponent «ifdef» o «ifndef»"
-#: locale/programs/ld-ctype.c:439
+#: locale/programs/ld-ctype.c:440
#, c-format
msgid "No character set name specified in charmap"
msgstr "no s’ha indicat cap nom de joc de caràcters al mapa de caràcters"
-#: locale/programs/ld-ctype.c:468
+#: locale/programs/ld-ctype.c:469
#, c-format
msgid "character L'\\u%0*x' in class `%s' must be in class `%s'"
msgstr "el caràcter L«\\u%0*x» de la classe «%s» ha de ser a la classe «%s»"
-#: locale/programs/ld-ctype.c:483
+#: locale/programs/ld-ctype.c:484
#, c-format
msgid "character L'\\u%0*x' in class `%s' must not be in class `%s'"
msgstr "el caràcter L«\\u%0*x» de la classe «%s» no ha de ser a la classe «%s»"
-#: locale/programs/ld-ctype.c:497 locale/programs/ld-ctype.c:555
+#: locale/programs/ld-ctype.c:498 locale/programs/ld-ctype.c:556
#, c-format
msgid "internal error in %s, line %u"
msgstr "error intern a «%s», línia %u"
-#: locale/programs/ld-ctype.c:526
+#: locale/programs/ld-ctype.c:527
#, c-format
msgid "character '%s' in class `%s' must be in class `%s'"
msgstr "el caràcter «%s» de la classe «%s» ha de ser a la classe «%s»"
-#: locale/programs/ld-ctype.c:542
+#: locale/programs/ld-ctype.c:543
#, c-format
msgid "character '%s' in class `%s' must not be in class `%s'"
msgstr "el caràcter «%s» de la classe «%s» no ha de ser a la classe «%s»"
-#: locale/programs/ld-ctype.c:572 locale/programs/ld-ctype.c:610
+#: locale/programs/ld-ctype.c:573 locale/programs/ld-ctype.c:611
#, c-format
msgid "<SP> character not in class `%s'"
msgstr "el caràcter <SP> no és a la classe «%s»"
-#: locale/programs/ld-ctype.c:584 locale/programs/ld-ctype.c:621
+#: locale/programs/ld-ctype.c:585 locale/programs/ld-ctype.c:622
#, c-format
msgid "<SP> character must not be in class `%s'"
msgstr "el caràcter <SP> no ha de ser a la classe «%s»"
-#: locale/programs/ld-ctype.c:599
+#: locale/programs/ld-ctype.c:600
#, c-format
msgid "character <SP> not defined in character map"
msgstr "el caràcter <SP> no ha estat definit a la taula de caràcters"
-#: locale/programs/ld-ctype.c:714
+#: locale/programs/ld-ctype.c:736
#, c-format
msgid "`digit' category has not entries in groups of ten"
msgstr "les entrades de la categoria «digit» no estan agrupades de deu en deu"
-#: locale/programs/ld-ctype.c:763
+#: locale/programs/ld-ctype.c:785
#, c-format
msgid "no input digits defined and none of the standard names in the charmap"
msgstr "no s’han definit dígits d’entrada i cap dels noms estàndard es troba al mapa de caràcters"
-#: locale/programs/ld-ctype.c:828
+#: locale/programs/ld-ctype.c:850
#, c-format
msgid "not all characters used in `outdigit' are available in the charmap"
msgstr "no tots els caràcters emprats a «outdigit» es troben al mapa de caràcters"
-#: locale/programs/ld-ctype.c:845
+#: locale/programs/ld-ctype.c:867
#, c-format
msgid "not all characters used in `outdigit' are available in the repertoire"
msgstr "no tots els caràcters emprats a «outdigit» es troben al repertori"
-#: locale/programs/ld-ctype.c:1245
+#: locale/programs/ld-ctype.c:1270
#, c-format
msgid "character class `%s' already defined"
msgstr "la classe de caràcters «%s» ja ha estat definida"
-#: locale/programs/ld-ctype.c:1251
+#: locale/programs/ld-ctype.c:1276
#, c-format
msgid "implementation limit: no more than %Zd character classes allowed"
msgstr "límit d’implementació: no es permeten més de %Zd classes de caràcters"
-#: locale/programs/ld-ctype.c:1277
+#: locale/programs/ld-ctype.c:1302
#, c-format
msgid "character map `%s' already defined"
msgstr "el mapa de caràcters «%s» ja ha estat definit"
-#: locale/programs/ld-ctype.c:1283
+#: locale/programs/ld-ctype.c:1308
#, c-format
msgid "implementation limit: no more than %d character maps allowed"
msgstr "límit d’implementació: no es permeten més de %d taules de caràcters"
-#: locale/programs/ld-ctype.c:1548 locale/programs/ld-ctype.c:1673
-#: locale/programs/ld-ctype.c:1779 locale/programs/ld-ctype.c:2471
-#: locale/programs/ld-ctype.c:3467
+#: locale/programs/ld-ctype.c:1573 locale/programs/ld-ctype.c:1698
+#: locale/programs/ld-ctype.c:1804 locale/programs/ld-ctype.c:2496
+#: locale/programs/ld-ctype.c:3492
#, c-format
msgid "%s: field `%s' does not contain exactly ten entries"
msgstr "%s: el camp «%s» no conté deu entrades exactament"
-#: locale/programs/ld-ctype.c:1576 locale/programs/ld-ctype.c:2150
+#: locale/programs/ld-ctype.c:1601 locale/programs/ld-ctype.c:2175
#, c-format
msgid "to-value <U%0*X> of range is smaller than from-value <U%0*X>"
msgstr "el valor final <U%0*X> del rang és menor que l’inicial <U%0*X>"
-#: locale/programs/ld-ctype.c:1703
+#: locale/programs/ld-ctype.c:1728
msgid "start and end character sequence of range must have the same length"
msgstr "les seqüències de caràcters inicial i final del rang han de tenir la mateixa longitud"
-#: locale/programs/ld-ctype.c:1710
+#: locale/programs/ld-ctype.c:1735
msgid "to-value character sequence is smaller than from-value sequence"
msgstr "la seqüència de caràcters final és menor que la seqüència inicial"
-#: locale/programs/ld-ctype.c:2070 locale/programs/ld-ctype.c:2121
+#: locale/programs/ld-ctype.c:2095 locale/programs/ld-ctype.c:2146
msgid "premature end of `translit_ignore' definition"
msgstr "fi prematura de la definició «translit_ignore»"
-#: locale/programs/ld-ctype.c:2076 locale/programs/ld-ctype.c:2127
-#: locale/programs/ld-ctype.c:2169
+#: locale/programs/ld-ctype.c:2101 locale/programs/ld-ctype.c:2152
+#: locale/programs/ld-ctype.c:2194
msgid "syntax error"
msgstr "error de sintaxi"
-#: locale/programs/ld-ctype.c:2303
+#: locale/programs/ld-ctype.c:2328
#, c-format
msgid "%s: syntax error in definition of new character class"
msgstr "%s: error de sintaxi a la definició de nova classe de caràcters"
-#: locale/programs/ld-ctype.c:2318
+#: locale/programs/ld-ctype.c:2343
#, c-format
msgid "%s: syntax error in definition of new character map"
msgstr "%s: error de sintaxi a la definició de nou mapa de caràcters"
-#: locale/programs/ld-ctype.c:2493
+#: locale/programs/ld-ctype.c:2518
msgid "ellipsis range must be marked by two operands of same type"
msgstr "el rang amb eŀlipsi ha d’estar marcat per dos operands del mateix tipus"
-#: locale/programs/ld-ctype.c:2502
+#: locale/programs/ld-ctype.c:2527
msgid "with symbolic name range values the absolute ellipsis `...' must not be used"
msgstr "no s’ha d’emprar l’eŀlipsi absoluta «...» amb els valors de rang de noms simbòlics"
-#: locale/programs/ld-ctype.c:2517
+#: locale/programs/ld-ctype.c:2542
msgid "with UCS range values one must use the hexadecimal symbolic ellipsis `..'"
msgstr "cal emprar l’eŀlipsi simbòlica hexadecimal «..» amb els valors de rang UCS"
-#: locale/programs/ld-ctype.c:2531
+#: locale/programs/ld-ctype.c:2556
msgid "with character code range values one must use the absolute ellipsis `...'"
msgstr "cal emprar l’eŀlispi absoluta «...» amb els valors de rang de codis de caràcters"
-#: locale/programs/ld-ctype.c:2682
+#: locale/programs/ld-ctype.c:2707
#, c-format
msgid "duplicated definition for mapping `%s'"
msgstr "la definició del mapa «%s» és duplicada"
-#: locale/programs/ld-ctype.c:2768 locale/programs/ld-ctype.c:2912
+#: locale/programs/ld-ctype.c:2793 locale/programs/ld-ctype.c:2937
#, c-format
msgid "%s: `translit_start' section does not end with `translit_end'"
msgstr "%s: la secció «translit_start» no acaba amb «translit_end»"
-#: locale/programs/ld-ctype.c:2863
+#: locale/programs/ld-ctype.c:2888
#, c-format
msgid "%s: duplicate `default_missing' definition"
msgstr "%s: la definició de «default_missing» és duplicada"
-#: locale/programs/ld-ctype.c:2868
+#: locale/programs/ld-ctype.c:2893
msgid "previous definition was here"
msgstr "la definició prèvia es troba ací"
-#: locale/programs/ld-ctype.c:2890
+#: locale/programs/ld-ctype.c:2915
#, c-format
msgid "%s: no representable `default_missing' definition found"
msgstr "%s: no s’ha trobat cap definició representable de «default_missing»"
-#: locale/programs/ld-ctype.c:3043 locale/programs/ld-ctype.c:3127
-#: locale/programs/ld-ctype.c:3147 locale/programs/ld-ctype.c:3168
-#: locale/programs/ld-ctype.c:3189 locale/programs/ld-ctype.c:3210
-#: locale/programs/ld-ctype.c:3231 locale/programs/ld-ctype.c:3271
-#: locale/programs/ld-ctype.c:3292 locale/programs/ld-ctype.c:3359
-#: locale/programs/ld-ctype.c:3401 locale/programs/ld-ctype.c:3426
+#: locale/programs/ld-ctype.c:3068 locale/programs/ld-ctype.c:3152
+#: locale/programs/ld-ctype.c:3172 locale/programs/ld-ctype.c:3193
+#: locale/programs/ld-ctype.c:3214 locale/programs/ld-ctype.c:3235
+#: locale/programs/ld-ctype.c:3256 locale/programs/ld-ctype.c:3296
+#: locale/programs/ld-ctype.c:3317 locale/programs/ld-ctype.c:3384
+#: locale/programs/ld-ctype.c:3426 locale/programs/ld-ctype.c:3451
#, c-format
msgid "%s: character `%s' not defined while needed as default value"
msgstr "%s: el caràcter «%s», necessari com a valor per defecte, no ha estat definit"
-#: locale/programs/ld-ctype.c:3048 locale/programs/ld-ctype.c:3132
-#: locale/programs/ld-ctype.c:3152 locale/programs/ld-ctype.c:3173
-#: locale/programs/ld-ctype.c:3194 locale/programs/ld-ctype.c:3215
-#: locale/programs/ld-ctype.c:3236 locale/programs/ld-ctype.c:3276
-#: locale/programs/ld-ctype.c:3297 locale/programs/ld-ctype.c:3364
+#: locale/programs/ld-ctype.c:3073 locale/programs/ld-ctype.c:3157
+#: locale/programs/ld-ctype.c:3177 locale/programs/ld-ctype.c:3198
+#: locale/programs/ld-ctype.c:3219 locale/programs/ld-ctype.c:3240
+#: locale/programs/ld-ctype.c:3261 locale/programs/ld-ctype.c:3301
+#: locale/programs/ld-ctype.c:3322 locale/programs/ld-ctype.c:3389
#, c-format
msgid "%s: character `%s' in charmap not representable with one byte"
msgstr "%s: el caràcter «%s» del mapa de caràcters no es pot representar amb un sol octet"
-#: locale/programs/ld-ctype.c:3408 locale/programs/ld-ctype.c:3433
+#: locale/programs/ld-ctype.c:3433 locale/programs/ld-ctype.c:3458
#, c-format
msgid "%s: character `%s' needed as default value not representable with one byte"
msgstr "%s: el caràcter «%s», necessari com a valor per defecte, no es pot representar amb un sol octet"
-#: locale/programs/ld-ctype.c:3489
+#: locale/programs/ld-ctype.c:3514
#, c-format
msgid "no output digits defined and none of the standard names in the charmap"
msgstr "no s’han definit dígits d’eixida i cap del noms estàndard es troba al mapa de caràcters"
-#: locale/programs/ld-ctype.c:3780
+#: locale/programs/ld-ctype.c:3805
#, c-format
msgid "%s: transliteration data from locale `%s' not available"
msgstr "%s: les dades de transliteració del locale «%s» no es troben disponibles"
-#: locale/programs/ld-ctype.c:3881
+#: locale/programs/ld-ctype.c:3906
#, c-format
msgid "%s: table for class \"%s\": %lu bytes\n"
msgstr "%s: taula de la classe «%s»: %lu octets\n"
-#: locale/programs/ld-ctype.c:3950
+#: locale/programs/ld-ctype.c:3975
#, c-format
msgid "%s: table for map \"%s\": %lu bytes\n"
msgstr "%s: taula del mapa «%s»: %lu octets\n"
-#: locale/programs/ld-ctype.c:4083
+#: locale/programs/ld-ctype.c:4108
#, c-format
msgid "%s: table for width: %lu bytes\n"
msgstr "%s: taula d’amplada: %lu bytes\n"
@@ -2502,6 +2580,11 @@ msgstr "el símbol «%.*s» no es troba al mapa de caràcters"
msgid "symbol `%.*s' not in repertoire map"
msgstr "el símbol «%.*s» no es troba al mapa de repertori"
+#: locale/programs/locale-spec.c:131
+#, c-format
+msgid "unknown name \"%s\""
+msgstr "el nom «%s» no és conegut"
+
#: locale/programs/locale.c:74
msgid "System information:"
msgstr "Informació del sistema:"
@@ -2684,8 +2767,8 @@ msgstr "no s’han pogut escriure els fitxers d’eixida a «%s»"
#, c-format
msgid ""
"System's directory for character maps : %s\n"
-" repertoire maps: %s\n"
-" locale path : %s\n"
+"\t\t repertoire maps: %s\n"
+"\t\t locale path : %s\n"
"%s"
msgstr ""
"Directori del sistema de mapes de caràcters: %s\n"
@@ -2703,91 +2786,96 @@ msgstr "hi ha dependències circulars entre les definicions dels locales"
msgid "cannot add already read locale `%s' a second time"
msgstr "no es pot afegir una altra volta el locale ja llegit «%s»"
-#: locale/programs/locarchive.c:88 locale/programs/locarchive.c:261
+#: locale/programs/locarchive.c:92 locale/programs/locarchive.c:338
#, c-format
msgid "cannot create temporary file"
msgstr "no s’ha pogut crear un fitxer temporal"
-#: locale/programs/locarchive.c:118 locale/programs/locarchive.c:307
+#: locale/programs/locarchive.c:122 locale/programs/locarchive.c:384
#, c-format
msgid "cannot initialize archive file"
msgstr "no s’ha pogut iniciar el fitxer arxiu"
-#: locale/programs/locarchive.c:125 locale/programs/locarchive.c:314
+#: locale/programs/locarchive.c:129 locale/programs/locarchive.c:391
#, c-format
msgid "cannot resize archive file"
msgstr "no s’ha pogut redimensionar el fitxer arxiu"
-#: locale/programs/locarchive.c:134 locale/programs/locarchive.c:323
-#: locale/programs/locarchive.c:527
+#: locale/programs/locarchive.c:152 locale/programs/locarchive.c:414
+#: locale/programs/locarchive.c:633
#, c-format
msgid "cannot map archive header"
msgstr "no s’ha pogut mapar la capçalera de l’arxiu"
# ivb (2002/10/21)
# ivb Un «locale archive» conté diversos locales -> «arxiu de locales».
-#: locale/programs/locarchive.c:156
+#: locale/programs/locarchive.c:174
#, c-format
msgid "failed to create new locale archive"
msgstr "no s’ha pogut crear el nou arxiu de locales"
-#: locale/programs/locarchive.c:168
+#: locale/programs/locarchive.c:186
#, c-format
msgid "cannot change mode of new locale archive"
msgstr "no s’ha pogut canviar el mode del nou arxiu de locales"
-#: locale/programs/locarchive.c:255
+#: locale/programs/locarchive.c:285
+#, c-format
+msgid "cannot read data from locale archive"
+msgstr "no s’han pogut llegir les dades de l’arxiu de locales"
+
+#: locale/programs/locarchive.c:318
#, c-format
msgid "cannot map locale archive file"
msgstr "no s’ha pogut mapar el fitxer arxiu de locales"
-#: locale/programs/locarchive.c:331
+#: locale/programs/locarchive.c:422
#, c-format
msgid "cannot lock new archive"
msgstr "no s’ha pogut blocar el nou arxiu"
-#: locale/programs/locarchive.c:396
+#: locale/programs/locarchive.c:488
#, c-format
msgid "cannot extend locale archive file"
msgstr "no s’ha pogut estendre el fitxer arxiu de locales"
-#: locale/programs/locarchive.c:405
+#: locale/programs/locarchive.c:497
#, c-format
msgid "cannot change mode of resized locale archive"
msgstr "no s’ha pogut canviar el mode de l’arxiu de locales redimensionat"
-#: locale/programs/locarchive.c:413
+#: locale/programs/locarchive.c:505
#, c-format
msgid "cannot rename new archive"
msgstr "no s’ha pogut reanomenar el nou arxiu"
-#: locale/programs/locarchive.c:466
+#: locale/programs/locarchive.c:558
#, c-format
msgid "cannot open locale archive \"%s\""
msgstr "no s’ha pogut obrir l’arxiu «%s» de locales"
-#: locale/programs/locarchive.c:471
+#: locale/programs/locarchive.c:563
#, c-format
msgid "cannot stat locale archive \"%s\""
msgstr "ha fallat stat() sobre l’arxiu «%s» de locales"
-#: locale/programs/locarchive.c:490
+#: locale/programs/locarchive.c:582
#, c-format
msgid "cannot lock locale archive \"%s\""
msgstr "no s’ha pogut blocar l’arxiu «%s» de locales"
-#: locale/programs/locarchive.c:513
+#: locale/programs/locarchive.c:605
#, c-format
msgid "cannot read archive header"
msgstr "no s’ha pogut llegir la capçalera de l’arxiu"
-#: locale/programs/locarchive.c:573
+#: locale/programs/locarchive.c:680
#, c-format
msgid "locale '%s' already exists"
msgstr "el locale «%s» ja existeix"
-#: locale/programs/locarchive.c:804 locale/programs/locarchive.c:819
-#: locale/programs/locarchive.c:831 locale/programs/locarchive.c:843
+#: locale/programs/locarchive.c:942 locale/programs/locarchive.c:957
+#: locale/programs/locarchive.c:969 locale/programs/locarchive.c:981
#: locale/programs/locfile.c:344
#, c-format
msgid "cannot add to locale archive"
@@ -2795,44 +2883,44 @@ msgstr "no s’ha pogut afegir a l’arxiu de locales"
# ivb (2002/10/21)
# ivb El fitxer conté àlies de diversos locales (locale.alias).
-#: locale/programs/locarchive.c:998
+#: locale/programs/locarchive.c:1139
#, c-format
msgid "locale alias file `%s' not found"
msgstr "no s’ha trobat el fitxer «%s» d’àlies de locales"
# ivb (2002/10/21)
# ivb És un missatge, no un error.
-#: locale/programs/locarchive.c:1142
+#: locale/programs/locarchive.c:1289
#, c-format
msgid "Adding %s\n"
msgstr "S’està afegint «%s»\n"
-#: locale/programs/locarchive.c:1148
+#: locale/programs/locarchive.c:1295
#, c-format
msgid "stat of \"%s\" failed: %s: ignored"
msgstr "ha fallat stat() sobre «%s»: %s: es descarta"
-#: locale/programs/locarchive.c:1154
+#: locale/programs/locarchive.c:1301
#, c-format
msgid "\"%s\" is no directory; ignored"
msgstr "«%s» no és un directori: es descarta"
-#: locale/programs/locarchive.c:1161
+#: locale/programs/locarchive.c:1308
#, c-format
msgid "cannot open directory \"%s\": %s: ignored"
msgstr "no s’ha pogut obrir el directori «%s»: %s: es descarta"
-#: locale/programs/locarchive.c:1233
+#: locale/programs/locarchive.c:1380
#, c-format
msgid "incomplete set of locale files in \"%s\""
msgstr "el joc de fitxers de locale a «%s» no és complet"
-#: locale/programs/locarchive.c:1297
+#: locale/programs/locarchive.c:1444
#, c-format
msgid "cannot read all files in \"%s\": ignored"
msgstr "no s’han pogut llegir tots els fitxers de «%s»: es descarta"
-#: locale/programs/locarchive.c:1367
+#: locale/programs/locarchive.c:1514
#, c-format
msgid "locale \"%s\" not in archive"
msgstr "el locale «%s» no es troba a l’arxiu"
@@ -2900,12 +2988,12 @@ msgstr "no s’ha pogut afegir el nou mapa de repertori"
msgid "repertoire map file `%s' not found"
msgstr "no s’ha trobat el fitxer «%s» de mapa de repertori"
-#: login/programs/pt_chown.c:74
+#: login/programs/pt_chown.c:78
#, c-format
msgid "Set the owner, group and access permission of the slave pseudo terminal corresponding to the master pseudo terminal passed on file descriptor `%d'. This is the helper program for the `grantpt' function. It is not intended to be run directly from the command line.\n"
msgstr "Estableix el propietari, grup i permissos d’accés del pseudoâ€terminal esclau corresponent al pseudoâ€terminal mestre passat en el descriptor de fitxer %d. Aquest és el programa auxiliar per a la funció grantpt(), i no està pensat per a ser executat directament des de la línia d’ordres.\n"
-#: login/programs/pt_chown.c:84
+#: login/programs/pt_chown.c:88
#, c-format
msgid ""
"The owner is set to the current user, the group is set to `%s', and the access permission is set to `%o'.\n"
@@ -2916,43 +3004,39 @@ msgstr ""
"\n"
"%s"
-#: login/programs/pt_chown.c:161
+#: login/programs/pt_chown.c:192
#, c-format
msgid "too many arguments"
msgstr "sobren arguments"
-#: login/programs/pt_chown.c:169
+#: login/programs/pt_chown.c:200
#, c-format
msgid "needs to be installed setuid `root'"
msgstr "ha d’estar instaŀlat amb setuid a «root»"
-#: malloc/mcheck.c:330
+#: malloc/mcheck.c:350
msgid "memory is consistent, library is buggy\n"
msgstr "la memòria és consistent; la biblioteca té errors\n"
-#: malloc/mcheck.c:333
+#: malloc/mcheck.c:353
msgid "memory clobbered before allocated block\n"
msgstr "s’ha sobreescrit la memòria d’abans del bloc reservat\n"
-#: malloc/mcheck.c:336
+#: malloc/mcheck.c:356
msgid "memory clobbered past end of allocated block\n"
msgstr "s’ha sobreescrit la memòria de després del bloc reservat\n"
-#: malloc/mcheck.c:339
+#: malloc/mcheck.c:359
msgid "block freed twice\n"
msgstr "s’ha alliberat el bloc dues voltes\n"
-#: malloc/mcheck.c:342
+#: malloc/mcheck.c:362
msgid "bogus mcheck_status, library is buggy\n"
msgstr "el valor d’«mcheck_status» és estrany; la biblioteca té errors\n"
-#: malloc/memusage.sh:27
-msgid "Try \\`memusage --help' for more information."
-msgstr "Proveu «memusage --help» per a obtenir més informació."
-
#: malloc/memusage.sh:33
-msgid "memusage: option \\`$1' requires an argument"
-msgstr "memusage: l’opció «$1» necessita un argument"
+msgid "%s: option '%s' requires an argument\\n"
+msgstr "%s: l’opció «%s» necessita un argument\\n"
#: malloc/memusage.sh:39
msgid ""
@@ -3009,14 +3093,17 @@ msgstr ""
"opcions curtes corresponents.\n"
"\n"
-# Resumit com la resta. ivb
#: malloc/memusage.sh:101
msgid ""
"Syntax: memusage [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]\n"
-" [--buffer=SIZE] [--no-timer] [--time-based] [--total]\n"
-" [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]\n"
-" PROGRAM [PROGRAMOPTION]..."
-msgstr "Sintaxi: memusage [OPCIÓ]… PROGRAMA [OPCIÓ_DE_PROGRAMA]…"
+"\t [--buffer=SIZE] [--no-timer] [--time-based] [--total]\n"
+"\t [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]\n"
+"\t PROGRAM [PROGRAMOPTION]..."
+msgstr ""
+"Forma d’ús: memusage [--data=FITXER] [--progname=NOM] [--png=FITXER]\n"
+" [--unbuffered] [--buffer=MIDA] [--no-timer] [--time-based]\n"
+" [--total] [--title=CADENA] [--x-size=MIDA] [--y-size=MIDA]\n"
+" PROGRAMA [OPCIÓ_DE_PROGRAMA]…"
#: malloc/memusage.sh:193
msgid "memusage: option \\`${1##*=}' is ambiguous"
@@ -3071,7 +3158,7 @@ msgstr "error desconegut del sistema"
msgid "unable to free arguments"
msgstr "no s’han pogut alliberar els arguments"
-#: nis/nis_error.h:1 nis/ypclnt.c:833 nis/ypclnt.c:921 posix/regcomp.c:133
+#: nis/nis_error.h:1 nis/ypclnt.c:833 nis/ypclnt.c:921 posix/regcomp.c:132
#: sysdeps/gnu/errlist.c:20
msgid "Success"
msgstr "Èxit"
@@ -3722,13 +3809,13 @@ msgid "yp_update: cannot get server address\n"
msgstr "yp_update: no s’ha pogut obtenir l’adreça del servidor\n"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/aicache.c:82 nscd/hstcache.c:481
+#: nscd/aicache.c:83 nscd/hstcache.c:492
#, c-format
msgid "Haven't found \"%s\" in hosts cache!"
msgstr "no s’ha trobat «%s» a la memòria cau de «hosts»"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/aicache.c:84 nscd/hstcache.c:483
+#: nscd/aicache.c:85 nscd/hstcache.c:494
#, c-format
msgid "Reloading \"%s\" in hosts cache!"
msgstr "es torna a carregar «%s» a la memòria cau de «hosts»"
@@ -3746,128 +3833,128 @@ msgstr "s’afegeix una nova entrada «%s» de tipus %s a la memòria cau de «%
msgid " (first)"
msgstr " (primer)"
-#: nscd/cache.c:286 nscd/connections.c:866
+#: nscd/cache.c:276 nscd/connections.c:861
#, c-format
msgid "cannot stat() file `%s': %s"
msgstr "ha fallat stat() sobre el fitxer «%s»: %s"
-#: nscd/cache.c:328
+#: nscd/cache.c:318
#, c-format
msgid "pruning %s cache; time %ld"
msgstr "neteja de la memòria cau de «%s», hora %ld"
# La 2a. és de l’estil de «GETPWBYNAME». ivb
-#: nscd/cache.c:357
+#: nscd/cache.c:347
#, c-format
msgid "considering %s entry \"%s\", timeout %<PRIu64>"
msgstr "es considera l’entrada %s «%s», expiració %<PRIu64>"
-#: nscd/connections.c:570
+#: nscd/connections.c:565
#, c-format
msgid "invalid persistent database file \"%s\": %s"
msgstr "el fitxer de base de dades persistent «%s» no és vàlid: %s"
-#: nscd/connections.c:578
+#: nscd/connections.c:573
msgid "uninitialized header"
msgstr "la capçalera no es troba iniciada"
-#: nscd/connections.c:583
+#: nscd/connections.c:578
msgid "header size does not match"
msgstr "la mida de la capçalera no concorda"
-#: nscd/connections.c:593
+#: nscd/connections.c:588
msgid "file size does not match"
msgstr "la mida del fitxer no concorda"
-#: nscd/connections.c:610
+#: nscd/connections.c:605
msgid "verification failed"
msgstr "la verificació ha fallat"
-#: nscd/connections.c:624
+#: nscd/connections.c:619
#, c-format
msgid "suggested size of table for database %s larger than the persistent database's table"
msgstr "la mida de taula suggerida per a la base de dades «%s» és major que la de la base de dades persistent"
-#: nscd/connections.c:635 nscd/connections.c:720
+#: nscd/connections.c:630 nscd/connections.c:715
#, c-format
msgid "cannot create read-only descriptor for \"%s\"; no mmap"
msgstr "no s’ha pogut crear un descriptor de només lectura per a «%s»; no s’emprarà mmap()"
-#: nscd/connections.c:651
+#: nscd/connections.c:646
#, c-format
msgid "cannot access '%s'"
msgstr "no s’ha pogut accedir a «%s»"
-#: nscd/connections.c:699
+#: nscd/connections.c:694
#, c-format
msgid "database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"
msgstr "la base de dades de «%s» està corrupta o sent emprada concurrentment; elimineu «%s» manualment si cal i reinicieu"
-#: nscd/connections.c:706
+#: nscd/connections.c:701
#, c-format
msgid "cannot create %s; no persistent database used"
msgstr "no s’ha pogut crear «%s»; no s’emprarà una base de dades persistent"
-#: nscd/connections.c:709
+#: nscd/connections.c:704
#, c-format
msgid "cannot create %s; no sharing possible"
msgstr "no s’ha pogut crear «%s»; no es podrà compartir"
-#: nscd/connections.c:780
+#: nscd/connections.c:775
#, c-format
msgid "cannot write to database file %s: %s"
msgstr "no s’ha pogut escriure al fitxer de base de dades «%s»: %s"
-#: nscd/connections.c:819
+#: nscd/connections.c:814
#, c-format
msgid "cannot set socket to close on exec: %s; disabling paranoia mode"
msgstr "no s’ha pogut indicar que el connector es tanque en fer exec(): %s; s’inhabilita el mode paranoic"
-#: nscd/connections.c:902
+#: nscd/connections.c:897
#, c-format
msgid "cannot open socket: %s"
msgstr "no s’ha pogut obrir el connector: %s"
-#: nscd/connections.c:922
+#: nscd/connections.c:917
#, c-format
msgid "cannot change socket to nonblocking mode: %s"
msgstr "no s’ha pogut canviar el connector al mode no blocador: %s"
-#: nscd/connections.c:930
+#: nscd/connections.c:925
#, c-format
msgid "cannot set socket to close on exec: %s"
msgstr "no s’ha pogut indicar que el connector es tanque en fer exec(): %s"
-#: nscd/connections.c:943
+#: nscd/connections.c:938
#, c-format
msgid "cannot enable socket to accept connections: %s"
msgstr "no s’ha pogut habilitar el connector per a acceptar connexions: %s"
-#: nscd/connections.c:1043
+#: nscd/connections.c:1039
#, c-format
msgid "provide access to FD %d, for %s"
msgstr "es proporciona accés al descriptor de fitxer %d, per a «%s»"
-#: nscd/connections.c:1055
+#: nscd/connections.c:1051
#, c-format
msgid "cannot handle old request version %d; current version is %d"
msgstr "no s’ha pogut atendre la petició amb versió antiga %d; la versió actual és %d"
-#: nscd/connections.c:1077
+#: nscd/connections.c:1073
#, c-format
msgid "request from %ld not handled due to missing permission"
msgstr "no s’atén la petició de %ld per manca de permissos"
-#: nscd/connections.c:1082
+#: nscd/connections.c:1078
#, c-format
msgid "request from '%s' [%ld] not handled due to missing permission"
msgstr "no s’atén la petició de «%s» (%ld) per manca de permissos"
-#: nscd/connections.c:1087
+#: nscd/connections.c:1083
msgid "request not handled due to missing permission"
msgstr "no s’atén la petició per manca de permissos"
-#: nscd/connections.c:1125 nscd/connections.c:1178
+#: nscd/connections.c:1121 nscd/connections.c:1174
#, c-format
msgid "cannot write result: %s"
msgstr "no s’ha pogut escriure el resultat: %s"
@@ -3877,139 +3964,139 @@ msgstr "no s’ha pogut escriure el resultat: %s"
# ivb dimoni «nscd» per consultar la memòria cau o invalidar-la. Per
# ivb això faig servir «programa de control» (com «ndc» amb «named» o
# ivb «chronyc» amb «chronyd»).
-#: nscd/connections.c:1261
+#: nscd/connections.c:1257
#, c-format
msgid "error getting caller's id: %s"
msgstr "error en obtenir l’identificador del programa de control: %s"
-#: nscd/connections.c:1320
+#: nscd/connections.c:1316
#, c-format
msgid "cannot open /proc/self/cmdline: %s; disabling paranoia mode"
msgstr "no s’ha pogut obrir «/proc/self/cmdline»: %s; s’inhabilita el mode paranoic"
-#: nscd/connections.c:1334
+#: nscd/connections.c:1330
#, c-format
msgid "cannot read /proc/self/cmdline: %s; disabling paranoia mode"
msgstr "no s’ha pogut llegir «/proc/self/cmdline»: %s; s’inhabilita el mode paranoic"
-#: nscd/connections.c:1374
+#: nscd/connections.c:1370
#, c-format
msgid "cannot change to old UID: %s; disabling paranoia mode"
msgstr "no s’ha pogut tornar a l’UID vell: %s; s’inhabilita el mode paranoic"
-#: nscd/connections.c:1384
+#: nscd/connections.c:1380
#, c-format
msgid "cannot change to old GID: %s; disabling paranoia mode"
msgstr "no s’ha pogut tornar al GID vell: %s; s’inhabilita el mode paranoic"
-#: nscd/connections.c:1397
+#: nscd/connections.c:1393
#, c-format
msgid "cannot change to old working directory: %s; disabling paranoia mode"
msgstr "no s’ha pogut tornar al directori vell de treball: %s; s’inhabilita el mode paranoic"
-#: nscd/connections.c:1429
+#: nscd/connections.c:1439
#, c-format
msgid "re-exec failed: %s; disabling paranoia mode"
msgstr "ha fallat la reexecució: %s; s’inhabilita el mode paranoic"
-#: nscd/connections.c:1438
+#: nscd/connections.c:1448
#, c-format
msgid "cannot change current working directory to \"/\": %s"
msgstr "no s’ha pogut canviar el directori de treball a «/»: %s"
-#: nscd/connections.c:1644
+#: nscd/connections.c:1641
#, c-format
msgid "short read while reading request: %s"
msgstr "lectura incompleta en llegir la petició: %s"
-#: nscd/connections.c:1677
+#: nscd/connections.c:1674
#, c-format
msgid "key length in request too long: %d"
msgstr "la longitud de la clau de la petició és massa gran: %d"
-#: nscd/connections.c:1690
+#: nscd/connections.c:1687
#, c-format
msgid "short read while reading request key: %s"
msgstr "lectura incompleta en llegir la clau de la petició: %s"
-#: nscd/connections.c:1699
+#: nscd/connections.c:1696
#, c-format
msgid "handle_request: request received (Version = %d) from PID %ld"
msgstr "handle_request: s’ha rebut una petició (amb versió %d) del PID %ld"
-#: nscd/connections.c:1704
+#: nscd/connections.c:1701
#, c-format
msgid "handle_request: request received (Version = %d)"
msgstr "handle_request: s’ha rebut una petició (amb versió %d)"
-#: nscd/connections.c:1903 nscd/connections.c:2101
+#: nscd/connections.c:1901 nscd/connections.c:2099
#, c-format
msgid "disabled inotify after read error %d"
msgstr "s’inhabilita «inotify» per l’error de lectura amb codi %d"
-#: nscd/connections.c:2230
+#: nscd/connections.c:2228
msgid "could not initialize conditional variable"
msgstr "no s’ha pogut iniciar la variable condicional"
-#: nscd/connections.c:2238
+#: nscd/connections.c:2236
msgid "could not start clean-up thread; terminating"
msgstr "no s’ha pogut iniciar el fil d’execució de neteja; s’està finalitzant"
-#: nscd/connections.c:2252
+#: nscd/connections.c:2250
msgid "could not start any worker thread; terminating"
msgstr "no s’ha pogut iniciar cap fil d’execució treballador; s’està finalitzant"
-#: nscd/connections.c:2303 nscd/connections.c:2304 nscd/connections.c:2321
-#: nscd/connections.c:2330 nscd/connections.c:2348 nscd/connections.c:2359
-#: nscd/connections.c:2370
+#: nscd/connections.c:2301 nscd/connections.c:2302 nscd/connections.c:2319
+#: nscd/connections.c:2328 nscd/connections.c:2346 nscd/connections.c:2357
+#: nscd/connections.c:2368
#, c-format
msgid "Failed to run nscd as user '%s'"
msgstr "no s’ha pogut executar «nscd» com a l’usuari «%s»"
-#: nscd/connections.c:2322
+#: nscd/connections.c:2320
#, c-format
msgid "initial getgrouplist failed"
msgstr "ha fallat getgrouplist() inicial"
-#: nscd/connections.c:2331
+#: nscd/connections.c:2329
#, c-format
msgid "getgrouplist failed"
msgstr "ha fallat getgrouplist()"
-#: nscd/connections.c:2349
+#: nscd/connections.c:2347
#, c-format
msgid "setgroups failed"
msgstr "ha fallat setgroups()"
-#: nscd/grpcache.c:395 nscd/hstcache.c:430 nscd/initgrcache.c:416
-#: nscd/pwdcache.c:400 nscd/servicescache.c:343
+#: nscd/grpcache.c:383 nscd/hstcache.c:439 nscd/initgrcache.c:406
+#: nscd/pwdcache.c:378 nscd/servicescache.c:332
#, c-format
msgid "short write in %s: %s"
msgstr "escriptura incompleta a «%s»: %s"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/grpcache.c:438 nscd/initgrcache.c:78
+#: nscd/grpcache.c:428 nscd/initgrcache.c:78
#, c-format
msgid "Haven't found \"%s\" in group cache!"
msgstr "no s’ha trobat «%s» a la memòria cau de «group»"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/grpcache.c:440 nscd/initgrcache.c:80
+#: nscd/grpcache.c:430 nscd/initgrcache.c:80
#, c-format
msgid "Reloading \"%s\" in group cache!"
msgstr "es torna a carregar «%s» a la memòria cau de «group»"
-#: nscd/grpcache.c:517
+#: nscd/grpcache.c:509
#, c-format
msgid "Invalid numeric gid \"%s\"!"
msgstr "«%s» no és un identificador numèric de grup vàlid"
-#: nscd/mem.c:457
+#: nscd/mem.c:431
#, c-format
msgid "freed %zu bytes in %s cache"
msgstr "s’han alliberat %zu octets de la memòria cau de «%s»"
-#: nscd/mem.c:594
+#: nscd/mem.c:574
#, c-format
msgid "no more memory for database '%s'"
msgstr "no resta memòria per a la base de dades «%s»"
@@ -4061,7 +4148,7 @@ msgstr "Empra una memòria cau diferent per a cada usuari."
msgid "Name Service Cache Daemon."
msgstr "Dimoni de memòria cau del servei de noms."
-#: nscd/nscd.c:147 nss/getent.c:876 nss/makedb.c:123
+#: nscd/nscd.c:147 nss/getent.c:952 nss/makedb.c:123
#, c-format
msgid "wrong number of arguments"
msgstr "el nombre d’arguments és incorrecte"
@@ -4090,7 +4177,7 @@ msgstr "no s’ha pogut canviar el directori de treball a «/»"
msgid "Could not create log file"
msgstr "no s’ha pogut crear el fitxer de registre"
-#: nscd/nscd.c:305 nscd/nscd.c:330 nscd/nscd_stat.c:172
+#: nscd/nscd.c:305 nscd/nscd.c:330 nscd/nscd_stat.c:174
#, c-format
msgid "Only root is allowed to use this option!"
msgstr "només root pot emprar aquesta opció"
@@ -4100,7 +4187,7 @@ msgstr "només root pot emprar aquesta opció"
msgid "'%s' is not a known database"
msgstr "«%s» no és una base de dades coneguda"
-#: nscd/nscd.c:370 nscd/nscd_stat.c:191
+#: nscd/nscd.c:370 nscd/nscd_stat.c:193
#, c-format
msgid "write incomplete"
msgstr "escriptura incompleta"
@@ -4165,35 +4252,35 @@ msgstr "no s’ha pogut obtenir el directori de treball actual: %s; s’inhabili
msgid "maximum file size for %s database too small"
msgstr "la mida màxima de fitxer per a la base de dades «%s» és massa menuda"
-#: nscd/nscd_stat.c:141
+#: nscd/nscd_stat.c:143
#, c-format
msgid "cannot write statistics: %s"
msgstr "no s’han pogut escriure les estadístiques: %s"
-#: nscd/nscd_stat.c:156
+#: nscd/nscd_stat.c:158
msgid "yes"
msgstr "sí"
-#: nscd/nscd_stat.c:157
+#: nscd/nscd_stat.c:159
msgid "no"
msgstr "no"
-#: nscd/nscd_stat.c:168
+#: nscd/nscd_stat.c:170
#, c-format
msgid "Only root or %s is allowed to use this option!"
msgstr "només root o %s pot emprar aquesta opció"
-#: nscd/nscd_stat.c:179
+#: nscd/nscd_stat.c:181
#, c-format
msgid "nscd not running!\n"
msgstr "nscd no està en marxa\n"
-#: nscd/nscd_stat.c:203
+#: nscd/nscd_stat.c:205
#, c-format
msgid "cannot read statistics data"
msgstr "no s’han pogut llegir les dades estadístiques"
-#: nscd/nscd_stat.c:206
+#: nscd/nscd_stat.c:208
#, c-format
msgid ""
"nscd configuration:\n"
@@ -4204,28 +4291,28 @@ msgstr ""
"\n"
"%15d nivell de depuració del servidor\n"
-#: nscd/nscd_stat.c:230
+#: nscd/nscd_stat.c:232
#, c-format
msgid "%3ud %2uh %2um %2lus server runtime\n"
msgstr "%3ud %2uh %2um %2lus de funcionament del servidor\n"
-#: nscd/nscd_stat.c:233
+#: nscd/nscd_stat.c:235
#, c-format
msgid " %2uh %2um %2lus server runtime\n"
msgstr " %2uh %2um %2lus de funcionament del servidor\n"
-#: nscd/nscd_stat.c:235
+#: nscd/nscd_stat.c:237
#, c-format
msgid " %2um %2lus server runtime\n"
msgstr " %2um %2lus de funcionament del servidor\n"
-#: nscd/nscd_stat.c:237
+#: nscd/nscd_stat.c:239
#, c-format
msgid " %2lus server runtime\n"
msgstr " %2lus de funcionament del servidor\n"
# FIXME: interval, not internal. ivb
-#: nscd/nscd_stat.c:239
+#: nscd/nscd_stat.c:241
#, c-format
msgid ""
"%15d current number of threads\n"
@@ -4233,15 +4320,17 @@ msgid ""
"%15lu number of times clients had to wait\n"
"%15s paranoia mode enabled\n"
"%15lu restart internal\n"
+"%15u reload count\n"
msgstr ""
"%15d nombre actual de fils d’execució\n"
"%15d nombre màxim de fils d’execució\n"
"%15lu voltes que algun client ha hagut d’esperar\n"
"%15s s’ha habilitat el mode paranoic?\n"
"%15lu interval entre reinicis\n"
+"%15u nombre de recàrregues\n"
# El primer camp és passwd, group, shadow... ivb
-#: nscd/nscd_stat.c:273
+#: nscd/nscd_stat.c:276
#, c-format
msgid ""
"\n"
@@ -4293,18 +4382,18 @@ msgstr ""
"%15s comprovar «/etc/%s» per si hi ha hagut canvis?\n"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/pwdcache.c:443
+#: nscd/pwdcache.c:423
#, c-format
msgid "Haven't found \"%s\" in password cache!"
msgstr "no s’ha trobat «%s» a la memòria cau de «passwd»"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/pwdcache.c:445
+#: nscd/pwdcache.c:425
#, c-format
msgid "Reloading \"%s\" in password cache!"
msgstr "es torna a carregar «%s» a la memòria cau de «passwd»"
-#: nscd/pwdcache.c:523
+#: nscd/pwdcache.c:506
#, c-format
msgid "Invalid numeric uid \"%s\"!"
msgstr "«%s» no és un identificador numèric d’usuari vàlid"
@@ -4412,45 +4501,49 @@ msgstr ""
"%15u fallades de CAV\n"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/servicescache.c:390
+#: nscd/servicescache.c:381
#, c-format
msgid "Haven't found \"%s\" in services cache!"
msgstr "no s’ha trobat «%s» a la memòria cau de «services»"
# El nom de la base de dades s’usa més a sovint que la descripció. ivb
-#: nscd/servicescache.c:392
+#: nscd/servicescache.c:383
#, c-format
msgid "Reloading \"%s\" in services cache!"
msgstr "es torna a carregar «%s» a la memòria cau de «services»"
-#: nss/getent.c:52
+#: nss/getent.c:54
msgid "database [key ...]"
msgstr "BASE_DE_DADES [CLAU…]"
# Més ajudes. ivb
-#: nss/getent.c:57
+#: nss/getent.c:59
msgid "Service configuration to be used"
msgstr "Configuració a emprar del servei."
-#: nss/getent.c:62
+#: nss/getent.c:60
+msgid "disable IDN encoding"
+msgstr "Inhabilita la codificació IDN."
+
+#: nss/getent.c:65
msgid "Get entries from administrative database."
msgstr "Obté entrades de les bases de dades d’administració."
-#: nss/getent.c:143 nss/getent.c:408
+#: nss/getent.c:149 nss/getent.c:479
#, c-format
msgid "Enumeration not supported on %s\n"
msgstr "no es permet l’enumeració sobre «%s»\n"
-#: nss/getent.c:794
+#: nss/getent.c:866
#, c-format
msgid "Unknown database name"
msgstr "el nom de la base de dades no és conegut"
-#: nss/getent.c:820
+#: nss/getent.c:896
msgid "Supported databases:\n"
msgstr "Bases de dades acceptades:\n"
-#: nss/getent.c:886
+#: nss/getent.c:962
#, c-format
msgid "Unknown database: %s\n"
msgstr "la base de dades no és coneguda: %s\n"
@@ -4514,18 +4607,18 @@ msgstr "problemes en llegir «%s»"
msgid "while reading database"
msgstr "en llegir la base de dades"
-#: posix/getconf.c:945
+#: posix/getconf.c:1036
#, c-format
msgid "Usage: %s [-v specification] variable_name [pathname]\n"
msgstr "Forma d’ús: %s [-v ESPECIFICACIÓ] NOM_DE_VARIABLE [CAMÃ]\n"
# S’alinea amb el nom de programa de dalt. ivb
-#: posix/getconf.c:948
+#: posix/getconf.c:1039
#, c-format
msgid " %s -a [pathname]\n"
msgstr " %s -a [CAMÃ]\n"
-#: posix/getconf.c:1023
+#: posix/getconf.c:1115
#, c-format
msgid ""
"Usage: getconf [-v SPEC] VAR\n"
@@ -4544,144 +4637,148 @@ msgstr ""
"de compiŀlació indicat.\n"
"\n"
-#: posix/getconf.c:1081
+#: posix/getconf.c:1173
#, c-format
msgid "unknown specification \"%s\""
msgstr "l’especificació «%s» no és coneguda"
-#: posix/getconf.c:1109
+#: posix/getconf.c:1225
#, c-format
msgid "Couldn't execute %s"
msgstr "no s’ha pogut executar «%s»"
# ivb (2001/11/01)
# ivb Es refereix a variables de configuració -> femení.
-#: posix/getconf.c:1149 posix/getconf.c:1165
+#: posix/getconf.c:1269 posix/getconf.c:1285
msgid "undefined"
msgstr "indefinida"
-#: posix/getconf.c:1187
+#: posix/getconf.c:1307
#, c-format
msgid "Unrecognized variable `%s'"
msgstr "la variable «%s» no és reconeguda"
-#: posix/getopt.c:570 posix/getopt.c:586
+#: posix/getopt.c:594 posix/getopt.c:623
#, c-format
-msgid "%s: option '%s' is ambiguous\n"
-msgstr "%s: l’opció «%s» és ambígua\n"
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: l’opció «%s» és ambígua; possibilitats:"
-#: posix/getopt.c:619 posix/getopt.c:623
+#: posix/getopt.c:664 posix/getopt.c:668
#, c-format
msgid "%s: option '--%s' doesn't allow an argument\n"
msgstr "%s: l’opció «--%s» no admet arguments\n"
-#: posix/getopt.c:632 posix/getopt.c:637
+#: posix/getopt.c:677 posix/getopt.c:682
#, c-format
msgid "%s: option '%c%s' doesn't allow an argument\n"
msgstr "%s: l’opció «%c%s» no admet arguments\n"
-#: posix/getopt.c:680 posix/getopt.c:699 posix/getopt.c:1002
-#: posix/getopt.c:1021
+#: posix/getopt.c:725 posix/getopt.c:744
#, c-format
-msgid "%s: option '%s' requires an argument\n"
-msgstr "%s: l’opció «%s» necessita un argument\n"
+msgid "%s: option '--%s' requires an argument\n"
+msgstr "%s: l’opció «--%s» necessita un argument\n"
-#: posix/getopt.c:737 posix/getopt.c:740
+#: posix/getopt.c:782 posix/getopt.c:785
#, c-format
msgid "%s: unrecognized option '--%s'\n"
msgstr "%s: l’opció «--%s» no és reconeguda\n"
-#: posix/getopt.c:748 posix/getopt.c:751
+#: posix/getopt.c:793 posix/getopt.c:796
#, c-format
msgid "%s: unrecognized option '%c%s'\n"
msgstr "%s: l’opció «%c%s» no és reconeguda\n"
-#: posix/getopt.c:800 posix/getopt.c:803
+#: posix/getopt.c:845 posix/getopt.c:848
#, c-format
msgid "%s: invalid option -- '%c'\n"
msgstr "%s: l’opció «%c» no és vàlida\n"
-#: posix/getopt.c:853 posix/getopt.c:870 posix/getopt.c:1073
-#: posix/getopt.c:1091
+#: posix/getopt.c:898 posix/getopt.c:915 posix/getopt.c:1123
+#: posix/getopt.c:1141
#, c-format
msgid "%s: option requires an argument -- '%c'\n"
msgstr "%s: l’opció «%c» necessita un argument\n"
-#: posix/getopt.c:923 posix/getopt.c:939
+#: posix/getopt.c:971 posix/getopt.c:987
#, c-format
msgid "%s: option '-W %s' is ambiguous\n"
msgstr "%s: l’opció «-W %s» és ambígua\n"
-#: posix/getopt.c:963 posix/getopt.c:981
+#: posix/getopt.c:1011 posix/getopt.c:1029
#, c-format
msgid "%s: option '-W %s' doesn't allow an argument\n"
msgstr "%s: l’opció «-W %s» no admet arguments\n"
-#: posix/regcomp.c:136
+#: posix/getopt.c:1050 posix/getopt.c:1068
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: l’opció «-W %s» necessita un argument\n"
+
+#: posix/regcomp.c:135
msgid "No match"
msgstr "No hi ha cap coincidència"
-#: posix/regcomp.c:139
+#: posix/regcomp.c:138
msgid "Invalid regular expression"
msgstr "L’expressió regular no és vàlida"
-#: posix/regcomp.c:142
+#: posix/regcomp.c:141
msgid "Invalid collation character"
msgstr "El caràcter d’ordenació no és vàlid"
-#: posix/regcomp.c:145
+#: posix/regcomp.c:144
msgid "Invalid character class name"
msgstr "El nom de la classe de caràcters no és vàlid"
-#: posix/regcomp.c:148
+#: posix/regcomp.c:147
msgid "Trailing backslash"
msgstr "Hi ha una barra invertida sobrant al final"
-#: posix/regcomp.c:151
+#: posix/regcomp.c:150
msgid "Invalid back reference"
msgstr "La referència cap enrere no és vàlida"
-#: posix/regcomp.c:154
+#: posix/regcomp.c:153
msgid "Unmatched [ or [^"
msgstr "«[» o «[^» desaparellat"
-#: posix/regcomp.c:157
+#: posix/regcomp.c:156
msgid "Unmatched ( or \\("
msgstr "«(» o «\\(» desaparellat"
-#: posix/regcomp.c:160
+#: posix/regcomp.c:159
msgid "Unmatched \\{"
msgstr "«\\{» desaparellat"
-#: posix/regcomp.c:163
+#: posix/regcomp.c:162
msgid "Invalid content of \\{\\}"
msgstr "El contingut de «\\{\\}» no és vàlid"
-#: posix/regcomp.c:166
+#: posix/regcomp.c:165
msgid "Invalid range end"
msgstr "El final del rang no és vàlid"
-#: posix/regcomp.c:169
+#: posix/regcomp.c:168
msgid "Memory exhausted"
msgstr "La memòria s’ha exhaurit"
-#: posix/regcomp.c:172
+#: posix/regcomp.c:171
msgid "Invalid preceding regular expression"
msgstr "L’expressió regular precedent és incorrecta"
-#: posix/regcomp.c:175
+#: posix/regcomp.c:174
msgid "Premature end of regular expression"
msgstr "Fi prematura de l’expressió regular"
-#: posix/regcomp.c:178
+#: posix/regcomp.c:177
msgid "Regular expression too big"
msgstr "L’expressió regular és massa llarga"
-#: posix/regcomp.c:181
+#: posix/regcomp.c:180
msgid "Unmatched ) or \\)"
msgstr "«)» o «\\)» desaparellat"
-#: posix/regcomp.c:681
+#: posix/regcomp.c:680
msgid "No previous regular expression"
msgstr "No hi ha expressió regular prèvia"
@@ -4745,6 +4842,187 @@ msgstr "%s: línia %d: l’ordre «%s» no és vàlida\n"
msgid "%s: line %d: ignoring trailing garbage `%s'\n"
msgstr "%s: línia %d: es descarta la brossa «%s» al final de la línia\n"
+#: stdio-common/psiginfo-data.h:2
+msgid "Illegal opcode"
+msgstr "El codi d’operació no és permès"
+
+#: stdio-common/psiginfo-data.h:3
+msgid "Illegal operand"
+msgstr "L’operand no és permès"
+
+#: stdio-common/psiginfo-data.h:4
+msgid "Illegal addressing mode"
+msgstr "El mode d’adreçament no és permès"
+
+#: stdio-common/psiginfo-data.h:5
+msgid "Illegal trap"
+msgstr "La trampa no és permesa"
+
+#: stdio-common/psiginfo-data.h:6
+msgid "Privileged opcode"
+msgstr "El codi d’operació és privilegiat"
+
+#: stdio-common/psiginfo-data.h:7
+msgid "Privileged register"
+msgstr "El registre és privilegiat"
+
+#: stdio-common/psiginfo-data.h:8
+msgid "Coprocessor error"
+msgstr "Error del coprocessador"
+
+#: stdio-common/psiginfo-data.h:9
+msgid "Internal stack error"
+msgstr "Error intern de la pila"
+
+#: stdio-common/psiginfo-data.h:12
+msgid "Integer divide by zero"
+msgstr "Divisió entera per zero"
+
+#: stdio-common/psiginfo-data.h:13
+msgid "Integer overflow"
+msgstr "Desbordament enter"
+
+#: stdio-common/psiginfo-data.h:14
+msgid "Floating-point divide by zero"
+msgstr "Divisió de coma flotant per zero"
+
+#: stdio-common/psiginfo-data.h:15
+msgid "Floating-point overflow"
+msgstr "Desbordament de coma flotant"
+
+#: stdio-common/psiginfo-data.h:16
+msgid "Floating-point underflow"
+msgstr "Subdesbordament de coma flotant"
+
+#: stdio-common/psiginfo-data.h:17
+msgid "Floating-poing inexact result"
+msgstr "El resultat de coma flotant és inexacte"
+
+#: stdio-common/psiginfo-data.h:18
+msgid "Invalid floating-point operation"
+msgstr "L’operació de coma flotant no és vàlida"
+
+#: stdio-common/psiginfo-data.h:19
+msgid "Subscript out of range"
+msgstr "El subíndex és fora de rang"
+
+#: stdio-common/psiginfo-data.h:22
+msgid "Address not mapped to object"
+msgstr "L’adreça no es troba mapada a un objecte"
+
+#: stdio-common/psiginfo-data.h:23
+msgid "Invalid permissions for mapped object"
+msgstr "Els permissos no són vàlids per a l’objecte mapat"
+
+#: stdio-common/psiginfo-data.h:26
+msgid "Invalid address alignment"
+msgstr "L’alineació de l’adreça no és vàlida"
+
+#: stdio-common/psiginfo-data.h:27
+msgid "Nonexisting physical address"
+msgstr "L’adreça física no existeix"
+
+#: stdio-common/psiginfo-data.h:28
+msgid "Object-specific hardware error"
+msgstr "Error de maquinari específic de l’objecte"
+
+#: stdio-common/psiginfo-data.h:31
+msgid "Process breakpoint"
+msgstr "Punt de ruptura en el procés"
+
+#: stdio-common/psiginfo-data.h:32
+msgid "Process trace trap"
+msgstr "Trampa de traçat del procés"
+
+#: stdio-common/psiginfo-data.h:35
+msgid "Child has exited"
+msgstr "Un fill ha eixit"
+
+#: stdio-common/psiginfo-data.h:36
+msgid "Child has terminated abnormally and did not create a core file"
+msgstr "Un fill ha eixit abnormalment i no ha creat un fitxer de bolcat"
+
+#: stdio-common/psiginfo-data.h:37
+msgid "Child hat terminated abnormally and created a core file"
+msgstr "Un fill ha eixit abnormalment i ha creat un fitxer de bolcat"
+
+#: stdio-common/psiginfo-data.h:38
+msgid "Traced child has trapped"
+msgstr "Un fill ha disparat una trampa de traçat"
+
+#: stdio-common/psiginfo-data.h:39
+msgid "Child has stopped"
+msgstr "Un fill s’ha aturat"
+
+#: stdio-common/psiginfo-data.h:40
+msgid "Stopped child has continued"
+msgstr "Un fill aturat ha continuat"
+
+#: stdio-common/psiginfo-data.h:43
+msgid "Data input available"
+msgstr "Hi ha dades disponibles a l’entrada"
+
+#: stdio-common/psiginfo-data.h:44
+msgid "Output buffers available"
+msgstr "Hi ha memòria intermèdia disponible a l’eixida"
+
+#: stdio-common/psiginfo-data.h:45
+msgid "Input message available"
+msgstr "Hi ha un missatge disponible a l’entrada"
+
+#: stdio-common/psiginfo-data.h:46
+msgid "I/O error"
+msgstr "Error d’E/S"
+
+#: stdio-common/psiginfo-data.h:47
+msgid "High priority input available"
+msgstr "Hi ha dades d’alta prioritat disponibles a l’entrada"
+
+#: stdio-common/psiginfo-data.h:48
+msgid "Device disconnected"
+msgstr "El dispositiu ha estat desconnectat"
+
+#: stdio-common/psiginfo.c:145
+msgid "Signal sent by kill()"
+msgstr "Senyal enviat per kill()"
+
+#: stdio-common/psiginfo.c:148
+msgid "Signal sent by sigqueue()"
+msgstr "Senyal enviat per sigqueue()"
+
+#: stdio-common/psiginfo.c:151
+msgid "Signal generated by the expiration of a timer"
+msgstr "Senyal generat en expirar un temporitzador"
+
+#: stdio-common/psiginfo.c:154
+msgid "Signal generated by the completion of an asynchronous I/O request"
+msgstr "Senyal generat en completar una petició d’E/S asíncrona"
+
+#: stdio-common/psiginfo.c:158
+msgid "Signal generated by the arrival of a message on an empty message queue"
+msgstr "Senyal generat en arribar un missatge a una cua de missatges buida"
+
+#: stdio-common/psiginfo.c:163
+msgid "Signal sent by tkill()"
+msgstr "Senyal enviat per tkill()"
+
+#: stdio-common/psiginfo.c:168
+msgid "Signal generated by the completion of an asynchronous name lookup request"
+msgstr "Senyal generat en completar una petició asíncrona de consulta de nom"
+
+#: stdio-common/psiginfo.c:174
+msgid "Signal generated by the completion of an I/O request"
+msgstr "Senyal generat en completar una petició d’E/S"
+
+#: stdio-common/psiginfo.c:180
+msgid "Signal sent by the kernel"
+msgstr "Senyal enviat pel nucli"
+
+#: stdio-common/psiginfo.c:204
+#, c-format
+msgid "Unknown signal %d\n"
+msgstr "Senyal desconegut %d\n"
+
#: stdio-common/psignal.c:51
#, c-format
msgid "%s%sUnknown signal %d\n"
@@ -4754,7 +5032,7 @@ msgstr "%s%sSenyal desconegut %d\n"
msgid "Unknown signal"
msgstr "Senyal desconegut"
-#: string/_strerror.c:45 sysdeps/mach/_strerror.c:87
+#: string/_strerror.c:47 sysdeps/mach/_strerror.c:87
msgid "Unknown error "
msgstr "Error desconegut "
@@ -4772,164 +5050,164 @@ msgstr "Senyal de temps real %d"
msgid "Unknown signal %d"
msgstr "Senyal desconegut %d"
-#: sunrpc/auth_unix.c:114 sunrpc/clnt_tcp.c:131 sunrpc/clnt_udp.c:143
-#: sunrpc/clnt_unix.c:128 sunrpc/svc_tcp.c:179 sunrpc/svc_tcp.c:218
-#: sunrpc/svc_udp.c:153 sunrpc/svc_unix.c:176 sunrpc/svc_unix.c:215
-#: sunrpc/xdr.c:566 sunrpc/xdr.c:718 sunrpc/xdr_array.c:106
-#: sunrpc/xdr_rec.c:156 sunrpc/xdr_ref.c:85
+#: sunrpc/auth_unix.c:113 sunrpc/clnt_tcp.c:125 sunrpc/clnt_udp.c:136
+#: sunrpc/clnt_unix.c:126 sunrpc/svc_tcp.c:173 sunrpc/svc_tcp.c:218
+#: sunrpc/svc_udp.c:147 sunrpc/svc_unix.c:174 sunrpc/svc_unix.c:215
+#: sunrpc/xdr.c:632 sunrpc/xdr.c:792 sunrpc/xdr_array.c:100
+#: sunrpc/xdr_rec.c:154 sunrpc/xdr_ref.c:79
msgid "out of memory\n"
msgstr "no resta memòria\n"
# ivb (2001/11/01)
# ivb D'acord amb un comentari del propi fitxer.
-#: sunrpc/auth_unix.c:350
+#: sunrpc/auth_unix.c:351
msgid "auth_unix.c: Fatal marshalling problem"
msgstr "auth_none.c: error fatal de preserialització"
-#: sunrpc/clnt_perr.c:105 sunrpc/clnt_perr.c:121
+#: sunrpc/clnt_perr.c:98 sunrpc/clnt_perr.c:114
#, c-format
msgid "%s: %s; low version = %lu, high version = %lu"
msgstr "%s: %s; versió menor = %lu, versió major = %lu"
-#: sunrpc/clnt_perr.c:112
+#: sunrpc/clnt_perr.c:105
#, c-format
msgid "%s: %s; why = %s\n"
msgstr "%s: %s; causa = %s\n"
-#: sunrpc/clnt_perr.c:114
+#: sunrpc/clnt_perr.c:107
#, c-format
msgid "%s: %s; why = (unknown authentication error - %d)\n"
msgstr "%s: %s; causa = (error desconegut d’autenticació: %d)\n"
-#: sunrpc/clnt_perr.c:159
+#: sunrpc/clnt_perr.c:156
msgid "RPC: Success"
msgstr "RPC: Èxit"
-#: sunrpc/clnt_perr.c:162
+#: sunrpc/clnt_perr.c:159
msgid "RPC: Can't encode arguments"
msgstr "RPC: No s’han pogut codificar els arguments"
-#: sunrpc/clnt_perr.c:166
+#: sunrpc/clnt_perr.c:163
msgid "RPC: Can't decode result"
msgstr "RPC: No s’ha pogut descodificar el resultat"
-#: sunrpc/clnt_perr.c:170
+#: sunrpc/clnt_perr.c:167
msgid "RPC: Unable to send"
msgstr "RPC: No s’ha pogut fer l’enviament"
-#: sunrpc/clnt_perr.c:174
+#: sunrpc/clnt_perr.c:171
msgid "RPC: Unable to receive"
msgstr "RPC: No s’ha pogut rebre"
-#: sunrpc/clnt_perr.c:178
+#: sunrpc/clnt_perr.c:175
msgid "RPC: Timed out"
msgstr "RPC: S’ha excedit el temps"
-#: sunrpc/clnt_perr.c:182
+#: sunrpc/clnt_perr.c:179
msgid "RPC: Incompatible versions of RPC"
msgstr "RPC: Les versions d’RPC són incompatibles"
-#: sunrpc/clnt_perr.c:186
+#: sunrpc/clnt_perr.c:183
msgid "RPC: Authentication error"
msgstr "RPC: Error d’autenticació"
-#: sunrpc/clnt_perr.c:190
+#: sunrpc/clnt_perr.c:187
msgid "RPC: Program unavailable"
msgstr "RPC: El programa no es troba disponible"
-#: sunrpc/clnt_perr.c:194
+#: sunrpc/clnt_perr.c:191
msgid "RPC: Program/version mismatch"
msgstr "RPC: No hi ha coincidència programa/versió"
-#: sunrpc/clnt_perr.c:198
+#: sunrpc/clnt_perr.c:195
msgid "RPC: Procedure unavailable"
msgstr "RPC: El procediment no es troba disponible"
-#: sunrpc/clnt_perr.c:202
+#: sunrpc/clnt_perr.c:199
msgid "RPC: Server can't decode arguments"
msgstr "RPC: El servidor no ha pogut descodificar els arguments"
-#: sunrpc/clnt_perr.c:206
+#: sunrpc/clnt_perr.c:203
msgid "RPC: Remote system error"
msgstr "RPC: Error al sistema remot"
-#: sunrpc/clnt_perr.c:210
+#: sunrpc/clnt_perr.c:207
msgid "RPC: Unknown host"
msgstr "RPC: L’estació no és coneguda"
-#: sunrpc/clnt_perr.c:214
+#: sunrpc/clnt_perr.c:211
msgid "RPC: Unknown protocol"
msgstr "RPC: El protocol no és conegut"
-#: sunrpc/clnt_perr.c:218
+#: sunrpc/clnt_perr.c:215
msgid "RPC: Port mapper failure"
msgstr "RPC: Fallada del mapador de ports"
-#: sunrpc/clnt_perr.c:222
+#: sunrpc/clnt_perr.c:219
msgid "RPC: Program not registered"
msgstr "RPC: El programa no s’ha donat d’alta"
-#: sunrpc/clnt_perr.c:226
+#: sunrpc/clnt_perr.c:223
msgid "RPC: Failed (unspecified error)"
msgstr "RPC: Ha fallat (error no especificat)"
-#: sunrpc/clnt_perr.c:267
+#: sunrpc/clnt_perr.c:264
msgid "RPC: (unknown error code)"
msgstr "RPC: (codi d’error desconegut)"
-#: sunrpc/clnt_perr.c:330
+#: sunrpc/clnt_perr.c:336
msgid "Authentication OK"
msgstr "L’autenticació és vàlida"
-#: sunrpc/clnt_perr.c:333
+#: sunrpc/clnt_perr.c:339
msgid "Invalid client credential"
msgstr "La credencial donada pel client no és vàlida"
-#: sunrpc/clnt_perr.c:337
+#: sunrpc/clnt_perr.c:343
msgid "Server rejected credential"
msgstr "El servidor ha rebutjat la credencial"
-#: sunrpc/clnt_perr.c:341
+#: sunrpc/clnt_perr.c:347
msgid "Invalid client verifier"
msgstr "El verificador del client no és vàlid"
-#: sunrpc/clnt_perr.c:345
+#: sunrpc/clnt_perr.c:351
msgid "Server rejected verifier"
msgstr "El servidor ha rebutjat el verificador"
-#: sunrpc/clnt_perr.c:349
+#: sunrpc/clnt_perr.c:355
msgid "Client credential too weak"
msgstr "La credencial del client és massa fluixa"
-#: sunrpc/clnt_perr.c:353
+#: sunrpc/clnt_perr.c:359
msgid "Invalid server verifier"
msgstr "El verificador del servidor no és vàlid"
-#: sunrpc/clnt_perr.c:357
+#: sunrpc/clnt_perr.c:363
msgid "Failed (unspecified error)"
msgstr "Ha fallat (no s’especifica l’error)"
-#: sunrpc/clnt_raw.c:117
+#: sunrpc/clnt_raw.c:115
msgid "clnt_raw.c: fatal header serialization error"
msgstr "clnt_raw.c: error fatal de serialització de capçaleres"
-#: sunrpc/pm_getmaps.c:83
+#: sunrpc/pm_getmaps.c:77
msgid "pmap_getmaps.c: rpc problem"
msgstr "pmap_getmaps.c: problema d’RPC"
-#: sunrpc/pmap_clnt.c:129
+#: sunrpc/pmap_clnt.c:127
msgid "Cannot register service"
msgstr "no s’ha pogut donar d’alta el servei"
-#: sunrpc/pmap_rmt.c:248
+#: sunrpc/pmap_rmt.c:243
msgid "Cannot create socket for broadcast rpc"
msgstr "no s’ha pogut crear el connector per a la crida RPC de difusió"
-#: sunrpc/pmap_rmt.c:255
+#: sunrpc/pmap_rmt.c:250
msgid "Cannot set socket option SO_BROADCAST"
msgstr "no s’ha pogut establir l’opció SO_BROADCAST per al connector"
-#: sunrpc/pmap_rmt.c:307
+#: sunrpc/pmap_rmt.c:302
msgid "Cannot send broadcast packet"
msgstr "no s’ha pogut enviar el paquet de difusió"
@@ -4937,461 +5215,461 @@ msgstr "no s’ha pogut enviar el paquet de difusió"
# ivb Això és que fa una difusió pura i dura enviant paquets a cada
# ivb destinació i fa __poll() per veure si algú ha respost. Si __poll
# ivb falla, mostra aquest missatge.
-#: sunrpc/pmap_rmt.c:332
+#: sunrpc/pmap_rmt.c:327
msgid "Broadcast poll problem"
msgstr "problema amb el sondeig de la difusió"
-#: sunrpc/pmap_rmt.c:345
+#: sunrpc/pmap_rmt.c:340
msgid "Cannot receive reply to broadcast"
msgstr "no s’ha pogut rebre una resposta a la difusió"
-#: sunrpc/rpc_main.c:290
+#: sunrpc/rpc_main.c:288
#, c-format
msgid "%s: output would overwrite %s\n"
msgstr "%s: l’eixida sobreescriuria «%s»\n"
-#: sunrpc/rpc_main.c:297
+#: sunrpc/rpc_main.c:295
#, c-format
msgid "%s: unable to open %s: %m\n"
msgstr "%s: no s’ha pogut obrir «%s»: %m\n"
-#: sunrpc/rpc_main.c:309
+#: sunrpc/rpc_main.c:307
#, c-format
msgid "%s: while writing output %s: %m"
msgstr "%s: en escriure a l’eixida «%s»: %m"
-#: sunrpc/rpc_main.c:344
+#: sunrpc/rpc_main.c:342
#, c-format
msgid "cannot find C preprocessor: %s \n"
msgstr "no s’ha pogut trobar el preprocessador de C: %s\n"
-#: sunrpc/rpc_main.c:352
+#: sunrpc/rpc_main.c:350
msgid "cannot find any C preprocessor (cpp)\n"
msgstr "no s’ha pogut trobar cap preprocessador de C (cpp)\n"
-#: sunrpc/rpc_main.c:421
+#: sunrpc/rpc_main.c:419
#, c-format
msgid "%s: C preprocessor failed with signal %d\n"
msgstr "%s: el preprocessador de C ha fallat amb el senyal %d\n"
-#: sunrpc/rpc_main.c:424
+#: sunrpc/rpc_main.c:422
#, c-format
msgid "%s: C preprocessor failed with exit code %d\n"
msgstr "%s: el preprocessador de C ha fallat amb el codi d’eixida %d\n"
-#: sunrpc/rpc_main.c:464
+#: sunrpc/rpc_main.c:462
#, c-format
msgid "illegal nettype: `%s'\n"
msgstr "el tipus de xarxa no és permès: «%s»\n"
-#: sunrpc/rpc_main.c:1130
+#: sunrpc/rpc_main.c:1128
#, c-format
msgid "rpcgen: too many defines\n"
msgstr "rpcgen: hi ha massa definicions\n"
-#: sunrpc/rpc_main.c:1142
+#: sunrpc/rpc_main.c:1140
#, c-format
msgid "rpcgen: arglist coding error\n"
msgstr "rpcgen: error en codificar els arguments\n"
#. TRANS: the file will not be removed; this is an
#. TRANS: informative message.
-#: sunrpc/rpc_main.c:1175
+#: sunrpc/rpc_main.c:1173
#, c-format
msgid "file `%s' already exists and may be overwritten\n"
msgstr "el fitxer «%s» ja existeix i podria ser sobreescrit\n"
-#: sunrpc/rpc_main.c:1220
+#: sunrpc/rpc_main.c:1218
#, c-format
msgid "Cannot specify more than one input file!\n"
msgstr "no es pot especificar més d’un fitxer d’entrada\n"
-#: sunrpc/rpc_main.c:1394
+#: sunrpc/rpc_main.c:1392
#, c-format
msgid "This implementation doesn't support newstyle or MT-safe code!\n"
msgstr "aquesta implementació no accepta l’estil nou ni el codi compatible amb MT\n"
-#: sunrpc/rpc_main.c:1403
+#: sunrpc/rpc_main.c:1401
#, c-format
msgid "Cannot use netid flag with inetd flag!\n"
msgstr "no es pot emprar l’opció IDXARXA («-n») amb l’opció d’inetd («-I»)\n"
-#: sunrpc/rpc_main.c:1415
+#: sunrpc/rpc_main.c:1413
#, c-format
msgid "Cannot use netid flag without TIRPC!\n"
msgstr "no es pot emprar l’opció IDXARXA («-n») sense TIRPC\n"
-#: sunrpc/rpc_main.c:1422
+#: sunrpc/rpc_main.c:1420
#, c-format
msgid "Cannot use table flags with newstyle!\n"
msgstr "no es poden emprar opcions de taula amb l’estil nou («-N»)\n"
-#: sunrpc/rpc_main.c:1441
+#: sunrpc/rpc_main.c:1439
#, c-format
msgid "\"infile\" is required for template generation flags.\n"
msgstr "cal FITXER_ENTRADA per als senyaladors de generació de plantilles\n"
-#: sunrpc/rpc_main.c:1446
+#: sunrpc/rpc_main.c:1444
#, c-format
msgid "Cannot have more than one file generation flag!\n"
msgstr "no es pot tenir més d’un senyalador de generació de fitxers\n"
-#: sunrpc/rpc_main.c:1455
+#: sunrpc/rpc_main.c:1453
#, c-format
msgid "usage: %s infile\n"
msgstr "Forma d’ús: %s FITXER_ENTRADA\n"
-#: sunrpc/rpc_main.c:1456
+#: sunrpc/rpc_main.c:1454
#, c-format
msgid "\t%s [-abkCLNTM][-Dname[=value]] [-i size] [-I [-K seconds]] [-Y path] infile\n"
msgstr ""
" %s [-abkCLNTM] [-DNOM[=VALOR]] [-i MIDA] [-I [-K SEGONS]]\n"
" [-Y CAMÃ] FITXER_ENTRADA\n"
-#: sunrpc/rpc_main.c:1458
+#: sunrpc/rpc_main.c:1456
#, c-format
msgid "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o outfile] [infile]\n"
msgstr ""
" %s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o FITXER_EIXIDA]\n"
" [FITXER_ENTRADA]\n"
-#: sunrpc/rpc_main.c:1460
+#: sunrpc/rpc_main.c:1458
#, c-format
msgid "\t%s [-s nettype]* [-o outfile] [infile]\n"
msgstr " %s [-s TIPUS_DE_XARXA]… [-o FITXER_EIXIDA] [FITXER_ENTRADA]\n"
-#: sunrpc/rpc_main.c:1461
+#: sunrpc/rpc_main.c:1459
#, c-format
msgid "\t%s [-n netid]* [-o outfile] [infile]\n"
msgstr " %s [-n IDXARXA]… [-o FITXER_EIXIDA] [FITXER_ENTRADA]\n"
-#: sunrpc/rpc_main.c:1469
+#: sunrpc/rpc_main.c:1467
#, c-format
msgid "options:\n"
msgstr ""
"Opcions:\n"
"\n"
-#: sunrpc/rpc_main.c:1470
+#: sunrpc/rpc_main.c:1468
#, c-format
msgid "-a\t\tgenerate all files, including samples\n"
msgstr " -a Genera tots els fitxers, incloent els exemples.\n"
-#: sunrpc/rpc_main.c:1471
+#: sunrpc/rpc_main.c:1469
#, c-format
msgid "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n"
msgstr ""
" -b Mode de compatibilitat cap enrere (genera codi per a\n"
" SunOS 4.1).\n"
-#: sunrpc/rpc_main.c:1472
+#: sunrpc/rpc_main.c:1470
#, c-format
msgid "-c\t\tgenerate XDR routines\n"
msgstr " -c Genera rutines XDR.\n"
-#: sunrpc/rpc_main.c:1473
+#: sunrpc/rpc_main.c:1471
#, c-format
msgid "-C\t\tANSI C mode\n"
msgstr " -C Mode ANSI C.\n"
-#: sunrpc/rpc_main.c:1474
+#: sunrpc/rpc_main.c:1472
#, c-format
msgid "-Dname[=value]\tdefine a symbol (same as #define)\n"
msgstr " -DNOM[=VALOR] Defineix un símbol (equival a «#define»).\n"
-#: sunrpc/rpc_main.c:1475
+#: sunrpc/rpc_main.c:1473
#, c-format
msgid "-h\t\tgenerate header file\n"
msgstr " -h Genera un fitxer de capçaleres.\n"
-#: sunrpc/rpc_main.c:1476
+#: sunrpc/rpc_main.c:1474
#, c-format
msgid "-i size\t\tsize at which to start generating inline code\n"
msgstr " -i MIDA Indica la MIDA on començar a generar codi en línia.\n"
-#: sunrpc/rpc_main.c:1477
+#: sunrpc/rpc_main.c:1475
#, c-format
msgid "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n"
msgstr ""
" -I Genera codi de compatibilitat amb «inetd» per al\n"
" servidor (per a SunOS 4.1).\n"
-#: sunrpc/rpc_main.c:1478
+#: sunrpc/rpc_main.c:1476
#, c-format
msgid "-K seconds\tserver exits after K seconds of inactivity\n"
msgstr ""
" -K SEGONS Fa que el servidor isca després del nombre indicat de\n"
" SEGONS d’inactivitat.\n"
-#: sunrpc/rpc_main.c:1479
+#: sunrpc/rpc_main.c:1477
#, c-format
msgid "-l\t\tgenerate client side stubs\n"
msgstr " -l Genera esquelets per a la part del client.\n"
-#: sunrpc/rpc_main.c:1480
+#: sunrpc/rpc_main.c:1478
#, c-format
msgid "-L\t\tserver errors will be printed to syslog\n"
msgstr " -L Fa que els errors del servidor s’envien a «syslog».\n"
-#: sunrpc/rpc_main.c:1481
+#: sunrpc/rpc_main.c:1479
#, c-format
msgid "-m\t\tgenerate server side stubs\n"
msgstr " -m Genera esquelets per a la part del servidor.\n"
-#: sunrpc/rpc_main.c:1482
+#: sunrpc/rpc_main.c:1480
#, c-format
msgid "-M\t\tgenerate MT-safe code\n"
msgstr " -M Genera codi compatible amb múltiples fils d’execució.\n"
# Sembla que «netid» és una expressió de la jerga RPC. ivb
-#: sunrpc/rpc_main.c:1483
+#: sunrpc/rpc_main.c:1481
#, c-format
msgid "-n netid\tgenerate server code that supports named netid\n"
msgstr " -n NETID Genera codi compatible amb el NETID indicat.\n"
-#: sunrpc/rpc_main.c:1484
+#: sunrpc/rpc_main.c:1482
#, c-format
msgid "-N\t\tsupports multiple arguments and call-by-value\n"
msgstr " -N Permet arguments múltiples i pas d’arguments per valor.\n"
-#: sunrpc/rpc_main.c:1485
+#: sunrpc/rpc_main.c:1483
#, c-format
msgid "-o outfile\tname of the output file\n"
msgstr " -o FITXER_EIXIDA Nom del fitxer d’eixida.\n"
-#: sunrpc/rpc_main.c:1486
+#: sunrpc/rpc_main.c:1484
#, c-format
msgid "-s nettype\tgenerate server code that supports named nettype\n"
msgstr ""
" -s TIPUS_DE_XARXA Genera codi de servidor compatible amb el TIPUS_DE_XARXA\n"
" indicat.\n"
-#: sunrpc/rpc_main.c:1487
+#: sunrpc/rpc_main.c:1485
#, c-format
msgid "-Sc\t\tgenerate sample client code that uses remote procedures\n"
msgstr ""
" -Sc Genera codi d’exemple per a un client que empra\n"
" procediments remots.\n"
-#: sunrpc/rpc_main.c:1488
+#: sunrpc/rpc_main.c:1486
#, c-format
msgid "-Ss\t\tgenerate sample server code that defines remote procedures\n"
msgstr ""
" -Ss Genera codi d’exemple per a un servidor que defineix\n"
" procediments remots.\n"
-#: sunrpc/rpc_main.c:1489
+#: sunrpc/rpc_main.c:1487
#, c-format
msgid "-Sm \t\tgenerate makefile template \n"
msgstr " -Sm Genera una plantilla de fitxer «Makefile».\n"
-#: sunrpc/rpc_main.c:1490
+#: sunrpc/rpc_main.c:1488
#, c-format
msgid "-t\t\tgenerate RPC dispatch table\n"
msgstr " -t Genera una taula de despatxat de crides RPC.\n"
-#: sunrpc/rpc_main.c:1491
+#: sunrpc/rpc_main.c:1489
#, c-format
msgid "-T\t\tgenerate code to support RPC dispatch tables\n"
msgstr ""
" -T Genera codi per a treballar amb taules de despatxat de\n"
" crides RPC.\n"
-#: sunrpc/rpc_main.c:1492
+#: sunrpc/rpc_main.c:1490
#, c-format
msgid "-Y path\t\tdirectory name to find C preprocessor (cpp)\n"
msgstr " -Y CAMÃ Directori on es troba el preprocessador de C (cpp).\n"
-#: sunrpc/rpc_scan.c:114
+#: sunrpc/rpc_scan.c:112
msgid "constant or identifier expected"
msgstr "cal una constant o un identificador"
-#: sunrpc/rpc_scan.c:310
+#: sunrpc/rpc_scan.c:308
msgid "illegal character in file: "
msgstr "hi ha un caràcter no permès al fitxer: "
-#: sunrpc/rpc_scan.c:349 sunrpc/rpc_scan.c:375
+#: sunrpc/rpc_scan.c:347 sunrpc/rpc_scan.c:373
msgid "unterminated string constant"
msgstr "la constant cadena no està acabada"
-#: sunrpc/rpc_scan.c:381
+#: sunrpc/rpc_scan.c:379
msgid "empty char string"
msgstr "la cadena de caràcters és buida"
-#: sunrpc/rpc_scan.c:523 sunrpc/rpc_scan.c:533
+#: sunrpc/rpc_scan.c:521 sunrpc/rpc_scan.c:531
msgid "preprocessor error"
msgstr "error del preprocessador"
-#: sunrpc/rpcinfo.c:254 sunrpc/rpcinfo.c:400
+#: sunrpc/rpcinfo.c:246 sunrpc/rpcinfo.c:392
#, c-format
msgid "program %lu is not available\n"
msgstr "el programa %lu no es troba disponible\n"
-#: sunrpc/rpcinfo.c:281 sunrpc/rpcinfo.c:327 sunrpc/rpcinfo.c:350
-#: sunrpc/rpcinfo.c:424 sunrpc/rpcinfo.c:470 sunrpc/rpcinfo.c:493
-#: sunrpc/rpcinfo.c:527
+#: sunrpc/rpcinfo.c:273 sunrpc/rpcinfo.c:319 sunrpc/rpcinfo.c:342
+#: sunrpc/rpcinfo.c:416 sunrpc/rpcinfo.c:462 sunrpc/rpcinfo.c:485
+#: sunrpc/rpcinfo.c:519
#, c-format
msgid "program %lu version %lu is not available\n"
msgstr "el programa %lu, versió %lu, no es troba disponible\n"
-#: sunrpc/rpcinfo.c:532
+#: sunrpc/rpcinfo.c:524
#, c-format
msgid "program %lu version %lu ready and waiting\n"
msgstr "el programa %lu, versió %lu, es troba llest i esperant\n"
-#: sunrpc/rpcinfo.c:573 sunrpc/rpcinfo.c:580
+#: sunrpc/rpcinfo.c:565 sunrpc/rpcinfo.c:572
msgid "rpcinfo: can't contact portmapper"
msgstr "rpcinfo: no s’ha pogut contactar amb el mapador de ports"
-#: sunrpc/rpcinfo.c:587
+#: sunrpc/rpcinfo.c:579
msgid "No remote programs registered.\n"
msgstr "no hi ha cap programa remot donat d’alta\n"
-#: sunrpc/rpcinfo.c:591
+#: sunrpc/rpcinfo.c:583
msgid " program vers proto port\n"
msgstr " programa vers proto port\n"
# ivb (2001/10/28)
# ivb Es refereix al nom d'una estació -> masculí.
-#: sunrpc/rpcinfo.c:630
+#: sunrpc/rpcinfo.c:622
msgid "(unknown)"
msgstr "(desconegut)"
-#: sunrpc/rpcinfo.c:654
+#: sunrpc/rpcinfo.c:646
#, c-format
msgid "rpcinfo: broadcast failed: %s\n"
msgstr "rpcinfo: la difusió ha fallat: %s\n"
-#: sunrpc/rpcinfo.c:675
+#: sunrpc/rpcinfo.c:667
msgid "Sorry. You are not root\n"
msgstr "ho sent, no sou root\n"
-#: sunrpc/rpcinfo.c:682
+#: sunrpc/rpcinfo.c:674
#, c-format
msgid "rpcinfo: Could not delete registration for prog %s version %s\n"
msgstr "rpcinfo: no s’ha pogut donar de baixa el programa «%s», versió %s\n"
-#: sunrpc/rpcinfo.c:691
+#: sunrpc/rpcinfo.c:683
msgid "Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"
msgstr "Forma d’ús: rpcinfo [-n NÚMPORT] -u ESTACIÓ NÚMPROGRAMA [NÚMVERSIÓ]\n"
-#: sunrpc/rpcinfo.c:693
+#: sunrpc/rpcinfo.c:685
msgid " rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"
msgstr " rpcinfo [-n NÚMPORT] -t ESTACIÓ NÚMPROGRAMA [NÚMVERSIÓ]\n"
-#: sunrpc/rpcinfo.c:695
+#: sunrpc/rpcinfo.c:687
msgid " rpcinfo -p [ host ]\n"
msgstr " rpcinfo -p [ESTACIÓ]\n"
-#: sunrpc/rpcinfo.c:696
+#: sunrpc/rpcinfo.c:688
msgid " rpcinfo -b prognum versnum\n"
msgstr " rpcinfo -b NÚMPROGRAMA NÚMVERSIÓ\n"
-#: sunrpc/rpcinfo.c:697
+#: sunrpc/rpcinfo.c:689
msgid " rpcinfo -d prognum versnum\n"
msgstr " rpcinfo -d NÚMPROGRAMA NÚMVERSIÓ\n"
-#: sunrpc/rpcinfo.c:722
+#: sunrpc/rpcinfo.c:714
#, c-format
msgid "rpcinfo: %s is unknown service\n"
msgstr "rpcinfo: el servei «%s» no és conegut\n"
-#: sunrpc/rpcinfo.c:759
+#: sunrpc/rpcinfo.c:751
#, c-format
msgid "rpcinfo: %s is unknown host\n"
msgstr "rpcinfo: l’estació «%s» no és coneguda\n"
-#: sunrpc/svc_run.c:70
+#: sunrpc/svc_run.c:71
msgid "svc_run: - out of memory"
msgstr "svc_run: no resta memòria"
# ivb (2001/10/28)
# ivb «-» no es refereix a l'entrada estàndard.
-#: sunrpc/svc_run.c:90
+#: sunrpc/svc_run.c:91
msgid "svc_run: - poll failed"
msgstr "svc_run: ha fallat poll()"
-#: sunrpc/svc_simple.c:87
+#: sunrpc/svc_simple.c:81
#, c-format
msgid "can't reassign procedure number %ld\n"
msgstr "no s’ha pogut reassignar el procediment número %ld\n"
-#: sunrpc/svc_simple.c:97
+#: sunrpc/svc_simple.c:91
msgid "couldn't create an rpc server\n"
msgstr "no s’ha pogut crear un servidor RPC\n"
-#: sunrpc/svc_simple.c:105
+#: sunrpc/svc_simple.c:99
#, c-format
msgid "couldn't register prog %ld vers %ld\n"
msgstr "no s’ha pogut donar d’alta el programa %ld amb versió %ld\n"
-#: sunrpc/svc_simple.c:113
+#: sunrpc/svc_simple.c:107
msgid "registerrpc: out of memory\n"
msgstr "registerrpc: no resta memòria\n"
-#: sunrpc/svc_simple.c:173
+#: sunrpc/svc_simple.c:168
#, c-format
msgid "trouble replying to prog %d\n"
msgstr "no s’ha pogut respondre al programa %d\n"
-#: sunrpc/svc_simple.c:182
+#: sunrpc/svc_simple.c:177
#, c-format
msgid "never registered prog %d\n"
msgstr "el programa %d mai no s’ha donat d’alta\n"
-#: sunrpc/svc_tcp.c:155
+#: sunrpc/svc_tcp.c:149
msgid "svc_tcp.c - tcp socket creation problem"
msgstr "svc_tcp.c: problemes en crear un connector TCP"
-#: sunrpc/svc_tcp.c:170
+#: sunrpc/svc_tcp.c:164
msgid "svc_tcp.c - cannot getsockname or listen"
msgstr "svc_tcp.c: ha fallat getsockname() o listen()"
-#: sunrpc/svc_udp.c:128
+#: sunrpc/svc_udp.c:122
msgid "svcudp_create: socket creation problem"
msgstr "svcudp_create: problemes en crear un connector"
-#: sunrpc/svc_udp.c:142
+#: sunrpc/svc_udp.c:136
msgid "svcudp_create - cannot getsockname"
msgstr "svcudp_create: ha fallat getsockname()"
-#: sunrpc/svc_udp.c:175
+#: sunrpc/svc_udp.c:168
msgid "svcudp_create: xp_pad is too small for IP_PKTINFO\n"
msgstr "svcudp_create: «xp_pad» és massa menut per a IP_PKTINFO\n"
-#: sunrpc/svc_udp.c:475
+#: sunrpc/svc_udp.c:476
msgid "enablecache: cache already enabled"
msgstr "enablecache: la memòria cau ja està habilitada"
-#: sunrpc/svc_udp.c:481
+#: sunrpc/svc_udp.c:482
msgid "enablecache: could not allocate cache"
msgstr "enablecache: no s’ha pogut reservar espai per a la memòria cau"
-#: sunrpc/svc_udp.c:490
+#: sunrpc/svc_udp.c:491
msgid "enablecache: could not allocate cache data"
msgstr "enablecache: no s’ha pogut reservar espai per a les dades de la memòria cau"
-#: sunrpc/svc_udp.c:498
+#: sunrpc/svc_udp.c:499
msgid "enablecache: could not allocate cache fifo"
msgstr "enablecache: no s’ha pogut reservar la cua FIFO de la memòria cau"
-#: sunrpc/svc_udp.c:533
+#: sunrpc/svc_udp.c:535
msgid "cache_set: victim not found"
msgstr "cache_set: no s’ha trobat la víctima"
-#: sunrpc/svc_udp.c:544
+#: sunrpc/svc_udp.c:546
msgid "cache_set: victim alloc failed"
msgstr "cache_set: no s’ha pogut reservar la víctima"
-#: sunrpc/svc_udp.c:551
+#: sunrpc/svc_udp.c:553
msgid "cache_set: could not allocate new rpc_buffer"
msgstr "cache_set: no s’ha pogut reservar un nou «rpc_buffer»"
-#: sunrpc/svc_unix.c:150
+#: sunrpc/svc_unix.c:148
msgid "svc_unix.c - AF_UNIX socket creation problem"
msgstr "svc_unix.c: problemes en crear un connector AF_UNIX"
-#: sunrpc/svc_unix.c:166
+#: sunrpc/svc_unix.c:164
msgid "svc_unix.c - cannot getsockname or listen"
msgstr "svc_unix.c: ha fallat getsockname() o listen()"
@@ -6381,6 +6659,11 @@ msgstr "El propietari ha mort"
msgid "State not recoverable"
msgstr "L’estat no és recuperable"
+# RFKill és el nom d’un subsistema de Linux. ivb
+#: sysdeps/gnu/errlist.c:1461
+msgid "Operation not possible due to RF-kill"
+msgstr "L’operació no és possible degut a RFKill"
+
# ivb (2001/10/28)
# ivb Codi -> sembla que aquesta és la traducció correcta, ja que tracta
# ivb d'identificar l'error dins un vector de sistemes d'errors del mach. (?)
@@ -6493,44 +6776,51 @@ msgstr "no s’ha pogut obrir «%s»"
msgid "cannot read header from `%s'"
msgstr "no s’ha pogut llegir la capçalera de «%s»"
-#: timezone/zdump.c:210
+#: timezone/zdump.c:215
msgid "lacks alphabetic at start"
msgstr "no comença per un caràcter alfabètic"
-#: timezone/zdump.c:212
+#: timezone/zdump.c:217
msgid "has fewer than 3 alphabetics"
msgstr "té menys de 3 caràcters alfabètics"
-#: timezone/zdump.c:214
+#: timezone/zdump.c:219
msgid "has more than 6 alphabetics"
msgstr "té més de 6 caràcters alfabètics"
-#: timezone/zdump.c:222
+#: timezone/zdump.c:227
msgid "differs from POSIX standard"
msgstr "difereix de l’estàndard POSIX"
# FIXME: language-dependent
# La cadena final és una de les anteriors. ivb
-#: timezone/zdump.c:228
+#: timezone/zdump.c:233
#, c-format
msgid "%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"
msgstr "%1$s: avís: l’abreviatura «%3$s» de la zona «%2$s» %4$s\n"
-#: timezone/zdump.c:279
+#: timezone/zdump.c:242
#, c-format
-msgid "%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"
-msgstr "%s: la forma d’ús és %s [--version] [-v] [-c [ANY_INF,]ANY_SUP] NOM_DE_ZONA…\n"
+msgid ""
+"%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"
+"\n"
+"Report bugs to tz@elsie.nci.nih.gov.\n"
+msgstr ""
+"%s: forma d’ús: %s [--version] [--help] [-v] [-c [ANY_INF,]ANY_SUP]\n"
+"\tNOM_DE_ZONA…\n"
+"\n"
+"Informeu dels errors a tz@elsie.nci.nih.gov.\n"
-#: timezone/zdump.c:296
+#: timezone/zdump.c:311
#, c-format
msgid "%s: wild -c argument %s\n"
msgstr "%s: l’argument de l’opció «-c» no és vàlid: %s\n"
-#: timezone/zdump.c:387
+#: timezone/zdump.c:398
msgid "Error writing to standard output"
msgstr "error en escriure a l’eixida estàndard"
-#: timezone/zdump.c:410
+#: timezone/zdump.c:421
#, c-format
msgid "%s: use of -v on system with floating time_t other than float or double\n"
msgstr "%s: no es pot emprar «-v» ja que «time_t» en aquest sistema és un tipus flotant diferent de «float» i «double»\n"
@@ -6561,348 +6851,352 @@ msgstr "avís: "
#: timezone/zic.c:459
#, c-format
msgid ""
-"%s: usage is %s [ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n"
+"%s: usage is %s [ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n"
"\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"
+"\n"
+"Report bugs to tz@elsie.nci.nih.gov.\n"
msgstr ""
-"%s: forma d’ús: %s [--version] [-s] [-v] [-l localtime] [-p posixrules]\n"
-"\t[-d DIRECTORI] [-L FITXER_SEGONS_INTERCALARS] [-y yearistype]\n"
-"\t[FITXER…]\n"
+"%s: forma d’ús: %s [--version] [--help] [-s] [-v] [-l localtime]\n"
+"\t[-p posixrules] [-d DIRECTORI] [-L FITXER_SEGONS_INTERCALARS]\n"
+"\t[-y yearistype] [FITXER…]\n"
+"\n"
+"Informeu dels errors a tz@elsie.nci.nih.gov.\n"
-#: timezone/zic.c:494
+#: timezone/zic.c:496
msgid "wild compilation-time specification of zic_t"
msgstr "l’especificació de «zic_t» en temps de compiŀlació no és vàlida"
-#: timezone/zic.c:511
+#: timezone/zic.c:515
#, c-format
msgid "%s: More than one -d option specified\n"
msgstr "%s: s’ha indicat l’opció «-d» més d’una volta\n"
-#: timezone/zic.c:521
+#: timezone/zic.c:525
#, c-format
msgid "%s: More than one -l option specified\n"
msgstr "%s: s’ha indicat l’opció «-l» més d’una volta\n"
-#: timezone/zic.c:531
+#: timezone/zic.c:535
#, c-format
msgid "%s: More than one -p option specified\n"
msgstr "%s: s’ha indicat l’opció «-p» més d’una volta\n"
-#: timezone/zic.c:541
+#: timezone/zic.c:545
#, c-format
msgid "%s: More than one -y option specified\n"
msgstr "%s: s’ha indicat l’opció «-y» més d’una volta\n"
-#: timezone/zic.c:551
+#: timezone/zic.c:555
#, c-format
msgid "%s: More than one -L option specified\n"
msgstr "%s: s’ha indicat l’opció «-L» més d’una volta\n"
-#: timezone/zic.c:600
+#: timezone/zic.c:604
msgid "link to link"
msgstr "enllaç a un altre enllaç"
-#: timezone/zic.c:665
+#: timezone/zic.c:669
msgid "hard link failed, symbolic link used"
msgstr "no s’ha pogut crear un enllaç fort, se n’ha emprat un de simbòlic"
-#: timezone/zic.c:673
+#: timezone/zic.c:677
#, c-format
msgid "%s: Can't link from %s to %s: %s\n"
msgstr "%s: no s’ha pogut crear un enllaç des de «%s» cap a «%s»: %s\n"
-#: timezone/zic.c:745 timezone/zic.c:747
+#: timezone/zic.c:749 timezone/zic.c:751
msgid "same rule name in multiple files"
msgstr "el mateix nom de regla és repetit a diversos fitxers"
-#: timezone/zic.c:788
+#: timezone/zic.c:792
msgid "unruly zone"
msgstr "la zona no té regles"
-#: timezone/zic.c:795
+#: timezone/zic.c:799
#, c-format
msgid "%s in ruleless zone"
msgstr "«%s» en una zona sense regles"
-#: timezone/zic.c:816
+#: timezone/zic.c:820
msgid "standard input"
msgstr "entrada estàndard"
-#: timezone/zic.c:821
+#: timezone/zic.c:825
#, c-format
msgid "%s: Can't open %s: %s\n"
msgstr "%s: no s’ha pogut obrir «%s»: %s\n"
-#: timezone/zic.c:832
+#: timezone/zic.c:836
msgid "line too long"
msgstr "la línia és massa llarga"
-#: timezone/zic.c:852
+#: timezone/zic.c:856
msgid "input line of unknown type"
msgstr "la línia introduïda pertany a un tipus desconegut"
-#: timezone/zic.c:868
+#: timezone/zic.c:872
#, c-format
msgid "%s: Leap line in non leap seconds file %s\n"
msgstr "%s: línia «Leap» en fitxer no de segons intercalars «%s»\n"
-#: timezone/zic.c:875 timezone/zic.c:1312 timezone/zic.c:1334
+#: timezone/zic.c:879 timezone/zic.c:1316 timezone/zic.c:1338
#, c-format
msgid "%s: panic: Invalid l_value %d\n"
msgstr "%s: pànic: el valor esquerre %d no és vàlid\n"
-#: timezone/zic.c:883
+#: timezone/zic.c:887
#, c-format
msgid "%s: Error reading %s\n"
msgstr "%s: error en llegir «%s»\n"
-#: timezone/zic.c:890
+#: timezone/zic.c:894
#, c-format
msgid "%s: Error closing %s: %s\n"
msgstr "%s: error en tancar «%s»: %s\n"
-#: timezone/zic.c:895
+#: timezone/zic.c:899
msgid "expected continuation line not found"
msgstr "cal una línia de continuació, però se’n troba cap"
-#: timezone/zic.c:939 timezone/zic.c:2476 timezone/zic.c:2495
+#: timezone/zic.c:943 timezone/zic.c:2480 timezone/zic.c:2499
msgid "time overflow"
msgstr "desbordament de l’hora"
-#: timezone/zic.c:943
+#: timezone/zic.c:947
msgid "24:00 not handled by pre-1998 versions of zic"
msgstr "les versions de «zic» anteriors a 1998 no admeten «24:00»"
-#: timezone/zic.c:946
+#: timezone/zic.c:950
msgid "values over 24 hours not handled by pre-2007 versions of zic"
msgstr "les versions de «zic» anteriors a 2007 no admeten valors majors que 24 hores"
-#: timezone/zic.c:959
+#: timezone/zic.c:963
msgid "wrong number of fields on Rule line"
msgstr "el nombre de camps de la línia «Rule» és incorrecte"
-#: timezone/zic.c:963
+#: timezone/zic.c:967
msgid "nameless rule"
msgstr "la regla no té nom"
-#: timezone/zic.c:968
+#: timezone/zic.c:972
msgid "invalid saved time"
msgstr "el temps estalviat no és vàlid"
-#: timezone/zic.c:989
+#: timezone/zic.c:993
msgid "wrong number of fields on Zone line"
msgstr "el nombre de camps de la línia «Zone» no és correcte"
-#: timezone/zic.c:995
+#: timezone/zic.c:999
#, c-format
msgid "\"Zone %s\" line and -l option are mutually exclusive"
msgstr "la línia «Zone %s» i l’opció «-l» són mútuament excloents"
-#: timezone/zic.c:1003
+#: timezone/zic.c:1007
#, c-format
msgid "\"Zone %s\" line and -p option are mutually exclusive"
msgstr "la línia «Zone %s» i l’opció «-p» són mútuament excloents"
-#: timezone/zic.c:1015
+#: timezone/zic.c:1019
#, c-format
msgid "duplicate zone name %s (file \"%s\", line %d)"
msgstr "el nom de zona «%s» (fitxer «%s», línia %d) és duplicat"
-#: timezone/zic.c:1031
+#: timezone/zic.c:1035
msgid "wrong number of fields on Zone continuation line"
msgstr "el nombre de camps de la línia de continuació de «Zone» no és correcte"
-#: timezone/zic.c:1071
+#: timezone/zic.c:1075
msgid "invalid UTC offset"
msgstr "el desplaçament d’UTC no és vàlid"
-#: timezone/zic.c:1074
+#: timezone/zic.c:1078
msgid "invalid abbreviation format"
msgstr "el format de l’abreviatura no és vàlid"
-#: timezone/zic.c:1103
+#: timezone/zic.c:1107
msgid "Zone continuation line end time is not after end time of previous line"
msgstr "el temps final de la línia de continuació de «Zone» no ve darrere del temps final de la línia anterior"
-#: timezone/zic.c:1131
+#: timezone/zic.c:1135
msgid "wrong number of fields on Leap line"
msgstr "el nombre de camps de la línia «Leap» no és correcte"
-#: timezone/zic.c:1140
+#: timezone/zic.c:1144
msgid "invalid leaping year"
msgstr "l’any bixest no és vàlid"
-#: timezone/zic.c:1160 timezone/zic.c:1266
+#: timezone/zic.c:1164 timezone/zic.c:1270
msgid "invalid month name"
msgstr "el nom del mes no és vàlid"
-#: timezone/zic.c:1173 timezone/zic.c:1379 timezone/zic.c:1393
+#: timezone/zic.c:1177 timezone/zic.c:1383 timezone/zic.c:1397
msgid "invalid day of month"
msgstr "el dia del mes no és vàlid"
-#: timezone/zic.c:1178
+#: timezone/zic.c:1182
msgid "time before zero"
msgstr "l’hora és anterior a zero"
-#: timezone/zic.c:1182
+#: timezone/zic.c:1186
msgid "time too small"
msgstr "l’hora és massa menuda"
-#: timezone/zic.c:1186
+#: timezone/zic.c:1190
msgid "time too large"
msgstr "l’hora és massa gran"
-#: timezone/zic.c:1190 timezone/zic.c:1295
+#: timezone/zic.c:1194 timezone/zic.c:1299
msgid "invalid time of day"
msgstr "l’hora del dia no és vàlida"
-#: timezone/zic.c:1209
+#: timezone/zic.c:1213
msgid "illegal CORRECTION field on Leap line"
msgstr "el camp de correcció de la línia de «Leap» no és vàlid"
-#: timezone/zic.c:1214
+#: timezone/zic.c:1218
msgid "illegal Rolling/Stationary field on Leap line"
msgstr "el camp «Rolling/Stationary» de la línia «Leap» no és vàlid"
-#: timezone/zic.c:1230
+#: timezone/zic.c:1234
msgid "wrong number of fields on Link line"
msgstr "el nombre de camps de la línia «Link» no és correcte"
# El nom del camp no és una paraula clau del fitxer. ivb
-#: timezone/zic.c:1234
+#: timezone/zic.c:1238
msgid "blank FROM field on Link line"
msgstr "el camp d’inici de la línia «Link» és buit"
# El nom del camp no és una paraula clau del fitxer. ivb
-#: timezone/zic.c:1238
+#: timezone/zic.c:1242
msgid "blank TO field on Link line"
msgstr "el camp d’acabament de la línia «Link» és buit"
-#: timezone/zic.c:1316
+#: timezone/zic.c:1320
msgid "invalid starting year"
msgstr "l’any de començament no és vàlid"
-#: timezone/zic.c:1338
+#: timezone/zic.c:1342
msgid "invalid ending year"
msgstr "l’any d’acabament no és vàlid"
-#: timezone/zic.c:1342
+#: timezone/zic.c:1346
msgid "starting year greater than ending year"
msgstr "l’any de començament és major que el d’acabament"
-#: timezone/zic.c:1349
+#: timezone/zic.c:1353
msgid "typed single year"
msgstr "s’ha especificat un sol any"
-#: timezone/zic.c:1384
+#: timezone/zic.c:1388
msgid "invalid weekday name"
msgstr "el nom del dia de la setmana no és vàlid"
-#: timezone/zic.c:1562
+#: timezone/zic.c:1566
#, c-format
msgid "%s: Can't remove %s: %s\n"
msgstr "%s: no s’ha pogut eliminar «%s»: %s\n"
-#: timezone/zic.c:1572
+#: timezone/zic.c:1576
#, c-format
msgid "%s: Can't create %s: %s\n"
msgstr "%s: no s’ha pogut crear «%s»: %s\n"
-#: timezone/zic.c:1722
+#: timezone/zic.c:1726
#, c-format
msgid "%s: Error writing %s\n"
msgstr "%s: error en escriure «%s»\n"
-#: timezone/zic.c:2015
+#: timezone/zic.c:2019
msgid "no POSIX environment variable for zone"
msgstr "no s’ha establert una variable d’entorn POSIX per a la zona"
-#: timezone/zic.c:2172
+#: timezone/zic.c:2176
msgid "can't determine time zone abbreviation to use just after until time"
msgstr "no s’ha pogut determinar l’abreviatura de zona horària a emprar just després de la data límit (until)"
-#: timezone/zic.c:2218
+#: timezone/zic.c:2222
msgid "too many transitions?!"
msgstr "hi ha massa transicions?!"
-#: timezone/zic.c:2237
+#: timezone/zic.c:2241
msgid "internal error - addtype called with bad isdst"
msgstr "error intern: s’ha cridat addtype() amb un valor erroni per a «isdst»"
-#: timezone/zic.c:2241
+#: timezone/zic.c:2245
msgid "internal error - addtype called with bad ttisstd"
msgstr "error intern: s’ha cridat addtype() amb un valor erroni per a «ttisstd»"
-#: timezone/zic.c:2245
+#: timezone/zic.c:2249
msgid "internal error - addtype called with bad ttisgmt"
msgstr "error intern: s’ha cridat addtype() amb un valor erroni per a «ttisgmt»"
-#: timezone/zic.c:2264
+#: timezone/zic.c:2268
msgid "too many local time types"
msgstr "hi ha massa tipus d’hora local"
-#: timezone/zic.c:2268
+#: timezone/zic.c:2272
msgid "UTC offset out of range"
msgstr "el desplaçament respecte UTC és fora de rang"
-#: timezone/zic.c:2296
+#: timezone/zic.c:2300
msgid "too many leap seconds"
msgstr "hi ha massa segons intercalars"
-#: timezone/zic.c:2302
+#: timezone/zic.c:2306
msgid "repeated leap second moment"
msgstr "el moment de segon intercalar és repetit"
-#: timezone/zic.c:2354
+#: timezone/zic.c:2358
msgid "Wild result from command execution"
msgstr "l’execució de l’ordre ha donat un resultat estrany"
-#: timezone/zic.c:2355
+#: timezone/zic.c:2359
#, c-format
msgid "%s: command was '%s', result was %d\n"
msgstr "%s: l’ordre ha estat «%s», el resultat ha estat %d\n"
# ivb (2001/10/30)
# ivb Es refereix a les cometes dobles «"».
-#: timezone/zic.c:2453
+#: timezone/zic.c:2457
msgid "Odd number of quotation marks"
msgstr "el nombre de cometes és senar"
-#: timezone/zic.c:2542
+#: timezone/zic.c:2546
msgid "use of 2/29 in non leap-year"
msgstr "s’ha emprat el dia 29 de febrer en un any no bixest"
-#: timezone/zic.c:2577
+#: timezone/zic.c:2581
msgid "rule goes past start/end of month--will not work with pre-2004 versions of zic"
msgstr "la regla va més enllà de l’inici o fi del mes; no funcionarà en les versions de «zic» anteriors a 2004"
-#: timezone/zic.c:2609
+#: timezone/zic.c:2613
msgid "time zone abbreviation lacks alphabetic at start"
msgstr "l’abreviatura de la zona horària no comença per un caràcter alfabètic"
-#: timezone/zic.c:2611
+#: timezone/zic.c:2615
msgid "time zone abbreviation has more than 3 alphabetics"
msgstr "l’abreviatura de la zona horària té més de 3 caràcters alfabètics"
-#: timezone/zic.c:2613
+#: timezone/zic.c:2617
msgid "time zone abbreviation has too many alphabetics"
msgstr "l’abreviatura de la zona horària té massa caràcters alfabètics"
-#: timezone/zic.c:2623
+#: timezone/zic.c:2627
msgid "time zone abbreviation differs from POSIX standard"
msgstr "l’abreviatura de la zona horària difereix de l’estàndard POSIX"
-#: timezone/zic.c:2635
+#: timezone/zic.c:2639
msgid "too many, or too long, time zone abbreviations"
msgstr "hi ha massa abreviatures de zona horària (o són massa llargues)"
-#: timezone/zic.c:2676
+#: timezone/zic.c:2680
#, c-format
msgid "%s: Can't create directory %s: %s\n"
msgstr "%s: no s’ha pogut crear el directori «%s»: %s\n"
# ivb (2001/10/28)
# ivb Resulta d'assignar un «int» a un «long».
-#: timezone/zic.c:2698
+#: timezone/zic.c:2702
#, c-format
msgid "%s: %d did not sign extend correctly\n"
msgstr "%s: el signe de %d no s’ha estès correctament\n"
diff --git a/libc/po/it.po b/libc/po/it.po
index 4334bc900..9c3f5b919 100644
--- a/libc/po/it.po
+++ b/libc/po/it.po
@@ -1,18 +1,19 @@
# Italian translation of GNU libc.
-# Copyright (C) 1999, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2010, 2011 Free Software Foundation, Inc.
# This file is distributed under the same license as the glibc package.
#
# Marco d'Itri <md@linux.it>, 1999.
-# Sergio Zanchetta <primes2h@ubuntu.com>, 2010.
+# Sergio Zanchetta <primes2h@ubuntu.com>, 2010, 2011.
#
msgid ""
msgstr ""
-"Project-Id-Version: libc-2.11.1\n"
+"Project-Id-Version: libc-2.14\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-02-06 12:40-0800\n"
-"PO-Revision-Date: 2010-11-30 11:33+0100\n"
+"POT-Creation-Date: 2011-05-31 00:06-0400\n"
+"PO-Revision-Date: 2011-10-17 14:21+0200\n"
"Last-Translator: Sergio Zanchetta <primes2h@ubuntu.com>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
+"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -35,7 +36,7 @@ msgstr "Spazzatura in ARGP_HELP_FMT: %s"
#: argp/argp-help.c:1215
msgid "Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options."
-msgstr "Gli argomenti obbligatori o facoltativi per le opzioni lunghe lo sono anche per tutte le corrispondenti opzioni corte."
+msgstr "Gli argomenti obbligatori o facoltativi per le opzioni lunghe lo sono anche per tutte le relative opzioni corte."
#: argp/argp-help.c:1601
msgid "Usage:"
@@ -97,15 +98,19 @@ msgstr "%s: troppi argomenti\n"
msgid "(PROGRAM ERROR) Option should have been recognized!?"
msgstr "(ERRORE DEL PROGRAMMA) L'opzione avrebbe dovuto essere riconosciuta."
-#: assert/assert-perr.c:57
+#: assert/assert-perr.c:37
#, c-format
msgid "%s%s%s:%u: %s%sUnexpected error: %s.\n"
msgstr "%s%s%s:%u: %s%serrore inatteso: %s.\n"
-#: assert/assert.c:57
+#: assert/assert.c:105
#, c-format
-msgid "%s%s%s:%u: %s%sAssertion `%s' failed.\n"
-msgstr "%s%s%s:%u: %s%sasserzione \"%s\" non riuscita.\n"
+msgid ""
+"%s%s%s:%u: %s%sAssertion `%s' failed.\n"
+"%n"
+msgstr ""
+"%s%s%s:%u: %s%sasserzione \"%s\" non riuscita.\n"
+"%n"
#: catgets/gencat.c:110 catgets/gencat.c:114 nscd/nscd.c:100 nss/makedb.c:61
msgid "NAME"
@@ -144,14 +149,13 @@ msgstr ""
"[FILE-OUTPUT [FILE-INPUT]...]"
#: catgets/gencat.c:232 debug/pcprofiledump.c:208 debug/xtrace.sh:58
-#: elf/ldconfig.c:302 elf/ldd.bash.in:56 elf/sln.c:86 elf/sprof.c:360
-#: iconv/iconv_prog.c:408 iconv/iconvconfig.c:380 locale/programs/locale.c:278
-#: locale/programs/localedef.c:371 login/programs/pt_chown.c:88
-#: malloc/memusage.sh:65 malloc/memusagestat.c:533 nscd/nscd.c:415
-#: nss/getent.c:842 nss/makedb.c:231 posix/getconf.c:1030
-#: sunrpc/rpc_main.c:1494 sunrpc/rpcinfo.c:699
+#: elf/ldconfig.c:302 elf/ldd.bash.in:56 elf/sln.c:86 elf/sotruss.ksh:49
+#: elf/sprof.c:371 iconv/iconv_prog.c:408 iconv/iconvconfig.c:380
+#: locale/programs/locale.c:278 locale/programs/localedef.c:371
+#: login/programs/pt_chown.c:92 malloc/memusage.sh:65
+#: malloc/memusagestat.c:539 nscd/nscd.c:415 nss/getent.c:918 nss/makedb.c:231
+#: posix/getconf.c:1122 sunrpc/rpc_main.c:1492 sunrpc/rpcinfo.c:691
#: sysdeps/unix/sysv/linux/lddlibc4.c:62
-#, c-format
msgid ""
"For bug reporting instructions, please see:\n"
"<http://www.gnu.org/software/libc/bugs.html>.\n"
@@ -160,11 +164,11 @@ msgstr ""
"<http://www.gnu.org/software/libc/bugs.html>.\n"
#: catgets/gencat.c:246 debug/pcprofiledump.c:222 debug/xtrace.sh:66
-#: elf/ldconfig.c:316 elf/ldd.bash.in:39 elf/sprof.c:375
+#: elf/ldconfig.c:316 elf/ldd.bash.in:39 elf/sotruss.ksh:76 elf/sprof.c:386
#: iconv/iconv_prog.c:423 iconv/iconvconfig.c:395 locale/programs/locale.c:293
-#: locale/programs/localedef.c:387 login/programs/pt_chown.c:59
-#: malloc/memusage.sh:73 malloc/memusagestat.c:551 nscd/nscd.c:429
-#: nss/getent.c:81 nss/makedb.c:245 posix/getconf.c:1012
+#: locale/programs/localedef.c:387 login/programs/pt_chown.c:63
+#: malloc/memusage.sh:73 malloc/memusagestat.c:557 nscd/nscd.c:429
+#: nss/getent.c:87 nss/makedb.c:245 posix/getconf.c:1104
#: sysdeps/unix/sysv/linux/lddlibc4.c:69
#, c-format
msgid ""
@@ -179,11 +183,11 @@ msgstr ""
# lf
#: catgets/gencat.c:251 debug/pcprofiledump.c:227 debug/xtrace.sh:70
-#: elf/ldconfig.c:321 elf/sprof.c:381 iconv/iconv_prog.c:428
+#: elf/ldconfig.c:321 elf/sprof.c:392 iconv/iconv_prog.c:428
#: iconv/iconvconfig.c:400 locale/programs/locale.c:298
#: locale/programs/localedef.c:392 malloc/memusage.sh:77
-#: malloc/memusagestat.c:556 nscd/nscd.c:434 nss/getent.c:86 nss/makedb.c:250
-#: posix/getconf.c:1017
+#: malloc/memusagestat.c:562 nscd/nscd.c:434 nss/getent.c:92 nss/makedb.c:250
+#: posix/getconf.c:1109
#, c-format
msgid "Written by %s.\n"
msgstr "Scritto da %s.\n"
@@ -202,7 +206,7 @@ msgstr "impossibile aprire il file di input \"%s\""
# lf
#: catgets/gencat.c:417 catgets/gencat.c:494
msgid "illegal set number"
-msgstr "numero di set illecito"
+msgstr "numero di set non consentito"
# lf
#: catgets/gencat.c:444
@@ -319,13 +323,13 @@ msgstr "dimensione puntatore non valida"
msgid "Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\\n"
msgstr "Uso: xtrace [OPZIONE]... PROGRAMMA [OPZIONEPROGRAMMA]...\\n"
-#: debug/xtrace.sh:33
-msgid "Try \\`xtrace --help' for more information.\\n"
-msgstr "Usare \\\"xtrace --help\" per ulteriori informazioni.\\n"
+#: debug/xtrace.sh:33 malloc/memusage.sh:27
+msgid "Try \\`%s --help' or `%s --usage' for more information.\\n"
+msgstr "Usare \\\"%s --help\" o \"%s --usage\" per ulteriori informazioni.\\n"
#: debug/xtrace.sh:39
-msgid "xtrace: option \\`$1' requires an argument.\\n"
-msgstr "xtrace: l'opzione \\\"$1\" richiede un argomento.\\n"
+msgid "%s: option '%s' requires an argument.\\n"
+msgstr "%s: l'opzione \"%s\" richiede un argomento\\n"
#: debug/xtrace.sh:46
msgid ""
@@ -406,7 +410,7 @@ msgstr "Sistema operativo sconosciuto"
msgid ", OS ABI: %s %d.%d.%d"
msgstr ", ABI del sistema operativo: %s %d.%d.%d"
-#: elf/cache.c:134 elf/ldconfig.c:1289
+#: elf/cache.c:134 elf/ldconfig.c:1305
#, c-format
msgid "Can't open cache file %s\n"
msgstr "Impossibile aprire il file di cache %s\n"
@@ -451,12 +455,12 @@ msgstr "Rinomina di %s a %s non riuscita"
# lf
#
-#: elf/dl-close.c:378 elf/dl-open.c:460
+#: elf/dl-close.c:387 elf/dl-open.c:397
msgid "cannot create scope list"
msgstr "impossibile creare l'elenco di ambito"
# lf
-#: elf/dl-close.c:725
+#: elf/dl-close.c:767
msgid "shared object not open"
msgstr "oggetto condiviso non aperto"
@@ -465,7 +469,7 @@ msgstr "oggetto condiviso non aperto"
msgid "DST not allowed in SUID/SGID programs"
msgstr "DST non consentito in programmi SUID/SGID"
-#: elf/dl-deps.c:127 elf/dl-open.c:282
+#: elf/dl-deps.c:127
msgid "empty dynamic string token substitution"
msgstr "sostituzione del token di stringa dinamica vuoto"
@@ -480,12 +484,12 @@ msgid "cannot allocate dependency list"
msgstr "impossibile allocare l'elenco delle dipendenze"
# lf
-#: elf/dl-deps.c:510 elf/dl-deps.c:565
+#: elf/dl-deps.c:514 elf/dl-deps.c:574
msgid "cannot allocate symbol search list"
msgstr "impossibile allocare l'elenco della ricerca simboli"
# lf
-#: elf/dl-deps.c:550
+#: elf/dl-deps.c:554
msgid "Filters not supported with LD_TRACE_PRELINKING"
msgstr "Filtri non supportati con LD_TRACE_PRELINKING"
@@ -511,239 +515,248 @@ msgid "internal error: symidx out of range of fptr table"
msgstr "errore interno: symidx fuori dall'intervallo della tabella fptr"
# lf
-#: elf/dl-load.c:372
+#: elf/dl-load.c:471
msgid "cannot allocate name record"
msgstr "impossibile allocare il record dei nomi"
# lf
-#: elf/dl-load.c:474 elf/dl-load.c:582 elf/dl-load.c:667 elf/dl-load.c:780
+#: elf/dl-load.c:548 elf/dl-load.c:664 elf/dl-load.c:749 elf/dl-load.c:862
msgid "cannot create cache for search path"
msgstr "impossibile creare la cache per il percorso di ricerca"
# lf
-#: elf/dl-load.c:565
+#: elf/dl-load.c:639
msgid "cannot create RUNPATH/RPATH copy"
msgstr "impossibile creare la copia di RUNPATH/RPATH"
# lf
-#: elf/dl-load.c:653
+#: elf/dl-load.c:735
msgid "cannot create search path array"
msgstr "impossibile creare l'array dei percorsi di ricerca"
# lf
-#: elf/dl-load.c:864
+#: elf/dl-load.c:931
msgid "cannot stat shared object"
msgstr "impossibile fare stat sull'oggetto condiviso"
-#: elf/dl-load.c:934
+#: elf/dl-load.c:1009
msgid "cannot open zero fill device"
msgstr "impossibile aprire il device riempito con zeri"
# lf
-#: elf/dl-load.c:979 elf/dl-load.c:2215
+#: elf/dl-load.c:1055 elf/dl-load.c:2313
msgid "cannot create shared object descriptor"
msgstr "impossibile creare il descrittore di oggetto condiviso"
# lf
-#: elf/dl-load.c:998 elf/dl-load.c:1647 elf/dl-load.c:1739
+#: elf/dl-load.c:1074 elf/dl-load.c:1730 elf/dl-load.c:1833
msgid "cannot read file data"
msgstr "impossibile leggere il file di dati"
# lf
-#: elf/dl-load.c:1042
+#: elf/dl-load.c:1120
msgid "ELF load command alignment not page-aligned"
msgstr "comando di caricamento ELF non allineato alla pagina"
# lf
-#: elf/dl-load.c:1049
+#: elf/dl-load.c:1127
msgid "ELF load command address/offset not properly aligned"
msgstr "indirizzo/offset del comando di caricamento ELF non propriamente allineato"
# lf
-#: elf/dl-load.c:1132
+#: elf/dl-load.c:1210
msgid "cannot allocate TLS data structures for initial thread"
msgstr "impossibile allocare strutture dati TLS per il thread iniziale"
# lf
-#: elf/dl-load.c:1155
+#: elf/dl-load.c:1233
msgid "cannot handle TLS data"
msgstr "impossibile gestire i dati TLS"
# lf
-#: elf/dl-load.c:1174
+#: elf/dl-load.c:1252
msgid "object file has no loadable segments"
msgstr "il file oggetto non presenta segmenti caricabili"
# lf
-#: elf/dl-load.c:1210
+#: elf/dl-load.c:1288
msgid "failed to map segment from shared object"
msgstr "mappatura del segmento dall'oggetto condiviso non riuscita"
# lf
-#: elf/dl-load.c:1236
+#: elf/dl-load.c:1314
msgid "cannot dynamically load executable"
msgstr "impossibile caricare dinamicamente l'eseguibile"
# lf
-#: elf/dl-load.c:1298
+#: elf/dl-load.c:1376
msgid "cannot change memory protections"
msgstr "impossibile cambiare le protezioni della memoria"
# lf
#
-#: elf/dl-load.c:1317
+#: elf/dl-load.c:1395
msgid "cannot map zero-fill pages"
msgstr "impossibile mappare le pagine riempite con zeri"
# lf
#
-#: elf/dl-load.c:1331
+#: elf/dl-load.c:1409
msgid "object file has no dynamic section"
msgstr "il file oggetto non presenta una sezione dinamica"
# lf
-#: elf/dl-load.c:1354
+#: elf/dl-load.c:1432
msgid "shared object cannot be dlopen()ed"
msgstr "impossibile eseguire dlopen() sull'oggetto condiviso"
# lf
-#: elf/dl-load.c:1367
+#: elf/dl-load.c:1445
msgid "cannot allocate memory for program header"
msgstr "impossibile allocare memoria per l'intestazione di programma"
-#: elf/dl-load.c:1384 elf/dl-open.c:218
+#: elf/dl-load.c:1462 elf/dl-open.c:180
msgid "invalid caller"
msgstr "chiamante non valido"
# lf
-#: elf/dl-load.c:1423
+#: elf/dl-load.c:1501
msgid "cannot enable executable stack as shared object requires"
msgstr "impossibile abilitare lo stack eseguibile come richiesto dall'oggetto condiviso"
-#: elf/dl-load.c:1436
+#: elf/dl-load.c:1514
msgid "cannot close file descriptor"
msgstr "impossibile chiudere il descrittore di file"
# lf
-#: elf/dl-load.c:1647
+#: elf/dl-load.c:1730
msgid "file too short"
msgstr "file troppo corto"
# lf
-#: elf/dl-load.c:1676
+#: elf/dl-load.c:1766
msgid "invalid ELF header"
msgstr "intestazione ELF non valida"
# lf
-#: elf/dl-load.c:1688
+#: elf/dl-load.c:1778
msgid "ELF file data encoding not big-endian"
msgstr "la codifica dati del file ELF non è big-endian"
# lf
-#: elf/dl-load.c:1690
+#: elf/dl-load.c:1780
msgid "ELF file data encoding not little-endian"
msgstr "la codifica dati del file ELF non è little-endian"
-#: elf/dl-load.c:1694
+#: elf/dl-load.c:1784
msgid "ELF file version ident does not match current one"
msgstr "l'identificatore di versione del file ELF non corrisponde a quello attuale"
-#: elf/dl-load.c:1698
+#: elf/dl-load.c:1788
msgid "ELF file OS ABI invalid"
msgstr "ABI del file ELF del sistema operativo non valido"
-#: elf/dl-load.c:1700
+#: elf/dl-load.c:1791
msgid "ELF file ABI version invalid"
msgstr "versione ABI del file ELF non valida"
+#: elf/dl-load.c:1794
+msgid "nonzero padding in e_ident"
+msgstr "riempimento con valori diversi da zero in e_ident"
+
# lf
-#: elf/dl-load.c:1703
+#: elf/dl-load.c:1797
msgid "internal error"
msgstr "errore interno"
-#: elf/dl-load.c:1710
+#: elf/dl-load.c:1804
msgid "ELF file version does not match current one"
msgstr "La versione del file ELF non corrisponde a quella attuale"
# lf
-#: elf/dl-load.c:1718
+#: elf/dl-load.c:1812
msgid "only ET_DYN and ET_EXEC can be loaded"
msgstr "è possibile caricare solo ET_DYN ed ET_EXEC"
-#: elf/dl-load.c:1724
+#: elf/dl-load.c:1818
msgid "ELF file's phentsize not the expected size"
msgstr "La phentsize del file ELF non corrisponde a quella attesa"
-#: elf/dl-load.c:2231
+#: elf/dl-load.c:2332
msgid "wrong ELF class: ELFCLASS64"
msgstr "classe ELF errata: ELFCLASS64"
-#: elf/dl-load.c:2232
+#: elf/dl-load.c:2333
msgid "wrong ELF class: ELFCLASS32"
msgstr "classe ELF errata: ELFCLASS32"
# lf
-#: elf/dl-load.c:2235
+#: elf/dl-load.c:2336
msgid "cannot open shared object file"
msgstr "impossibile aprire il file oggetto condiviso"
# lf
-#: elf/dl-lookup.c:356
+#: elf/dl-lookup.c:757
msgid "relocation error"
msgstr "errore di rilocazione"
-#: elf/dl-lookup.c:384
+#: elf/dl-lookup.c:785
msgid "symbol lookup error"
msgstr "errore nella ricerca del simbolo"
# ls
#
-#: elf/dl-open.c:114
+#: elf/dl-open.c:115
msgid "cannot extend global scope"
msgstr "impossibile estendere l'ambito globale"
-#: elf/dl-open.c:512
+#: elf/dl-open.c:440
msgid "TLS generation counter wrapped! Please report this."
-msgstr "contatore TLS di generazione interrotto. Segnalare questo problema."
+msgstr "contatore TLS di generazione azzerato. Segnalare questo problema."
+
+# lf
+#: elf/dl-open.c:462
+msgid "cannot load any more object with static TLS"
+msgstr "impossibile caricare altri oggetti con un TLS statico"
# ls
-#: elf/dl-open.c:549
+#: elf/dl-open.c:511
msgid "invalid mode for dlopen()"
msgstr "modo non valido per dlopen()"
-#: elf/dl-open.c:566
+#: elf/dl-open.c:528
msgid "no more namespaces available for dlmopen()"
msgstr "nessuno spazio dei nomi disponibile per dlmopen()"
-#: elf/dl-open.c:579
+#: elf/dl-open.c:547
msgid "invalid target namespace in dlmopen()"
msgstr "spazio dei nomi di destinazione non valido in dlmopen()"
# lf
-#: elf/dl-reloc.c:121
+#: elf/dl-reloc.c:120
msgid "cannot allocate memory in static TLS block"
msgstr "impossibile allocare memoria nel blocco statico TLS"
# lf
-#: elf/dl-reloc.c:211
+#: elf/dl-reloc.c:212
msgid "cannot make segment writable for relocation"
msgstr "impossibile rendere il segmento scrivibile per la rilocazione"
-#: elf/dl-reloc.c:277
+#: elf/dl-reloc.c:275
#, c-format
msgid "%s: no PLTREL found in object %s\n"
msgstr "%s: nessun PLTREL trovato nell'oggetto %s\n"
-#: elf/dl-reloc.c:288
+#: elf/dl-reloc.c:286
#, c-format
msgid "%s: out of memory to store relocation results for %s\n"
msgstr "%s: memoria esaurita per memorizzare i risultati della rilocazione per %s\n"
-#: elf/dl-reloc.c:304
+#: elf/dl-reloc.c:302
msgid "cannot restore segment prot after reloc"
msgstr "impossibile ripristinare la protezione del segmento dopo la rilocazione"
-#: elf/dl-reloc.c:329
+#: elf/dl-reloc.c:331
msgid "cannot apply additional memory protection after relocation"
msgstr "impossibile applicare una protezione supplementare della memoria dopo la rilocazione"
@@ -753,15 +766,19 @@ msgid "RTLD_NEXT used in code not dynamically loaded"
msgstr "RTLD_NEXT usato in codice caricato non dinamicamente"
# lf
-#: elf/dl-sysdep.c:481 elf/dl-sysdep.c:493
+#: elf/dl-sysdep.c:488 elf/dl-sysdep.c:500
msgid "cannot create capability list"
msgstr "impossibile creare l'elenco di capacità"
# lf
-#: elf/dl-tls.c:864
+#: elf/dl-tls.c:861
msgid "cannot create TLS data structures"
msgstr "impossibile creare le strutture dati TLS"
+#: elf/dl-version.c:172
+msgid "version lookup error"
+msgstr "errore nella ricerca della versione"
+
# lf
#: elf/dl-version.c:303
msgid "cannot allocate version reference table"
@@ -784,16 +801,16 @@ msgstr "Non crea la cache"
# lf
#: elf/ldconfig.c:144
msgid "Don't generate links"
-msgstr "Non genera i collegamenti"
+msgstr "Non genera collegamenti"
# lf
#: elf/ldconfig.c:145
msgid "Change to and use ROOT as root directory"
-msgstr "Passa a ROOT come directory di root"
+msgstr "Passa a RADICE come directory di root"
#: elf/ldconfig.c:145
msgid "ROOT"
-msgstr "ROOT"
+msgstr "RADICE"
#: elf/ldconfig.c:146
msgid "CACHE"
@@ -850,158 +867,158 @@ msgstr "Percorso \"%s\" fornito più di una volta"
msgid "%s is not a known library type"
msgstr "%s non è un tipo di libreria conosciuto"
-#: elf/ldconfig.c:404
+#: elf/ldconfig.c:407
#, c-format
msgid "Can't stat %s"
msgstr "Impossibile fare stat di %s"
-#: elf/ldconfig.c:478
+#: elf/ldconfig.c:481
#, c-format
msgid "Can't stat %s\n"
msgstr "Impossibile fare stat di %s\n"
# lf
-#: elf/ldconfig.c:488
+#: elf/ldconfig.c:491
#, c-format
msgid "%s is not a symbolic link\n"
msgstr "%s non è un collegamento simbolico\n"
# lf
-#: elf/ldconfig.c:507
+#: elf/ldconfig.c:510
#, c-format
msgid "Can't unlink %s"
msgstr "Impossibile eseguire l'unlink di %s"
# lf
#
-#: elf/ldconfig.c:513
+#: elf/ldconfig.c:516
#, c-format
msgid "Can't link %s to %s"
msgstr "Impossibile collegare %s a %s"
-#: elf/ldconfig.c:519
+#: elf/ldconfig.c:522
msgid " (changed)\n"
msgstr " (cambiato)\n"
-#: elf/ldconfig.c:521
+#: elf/ldconfig.c:524
msgid " (SKIPPED)\n"
msgstr " (SALTATO)\n"
-#: elf/ldconfig.c:576
+#: elf/ldconfig.c:579
#, c-format
msgid "Can't find %s"
msgstr "Impossibile trovare %s"
-#: elf/ldconfig.c:592 elf/ldconfig.c:765 elf/ldconfig.c:813 elf/ldconfig.c:847
+#: elf/ldconfig.c:595 elf/ldconfig.c:768 elf/ldconfig.c:827 elf/ldconfig.c:861
#, c-format
msgid "Cannot lstat %s"
msgstr "Impossibile fare lstat di %s"
# lf
-#: elf/ldconfig.c:599
+#: elf/ldconfig.c:602
#, c-format
msgid "Ignored file %s since it is not a regular file."
msgstr "File %s ignorato poiché non è un file normale."
# lf
#
-#: elf/ldconfig.c:608
+#: elf/ldconfig.c:611
#, c-format
msgid "No link created since soname could not be found for %s"
msgstr "Collegamenti non creati poiché non è stato possibile trovare il soname per %s"
-#: elf/ldconfig.c:691
+#: elf/ldconfig.c:694
#, c-format
msgid "Can't open directory %s"
msgstr "Impossibile aprire la directory %s"
-#: elf/ldconfig.c:779
-#, c-format
-msgid "Cannot stat %s"
-msgstr "Impossibile fare stat di %s"
-
-#: elf/ldconfig.c:834 elf/readlib.c:91
+#: elf/ldconfig.c:786 elf/ldconfig.c:848 elf/readlib.c:91
#, c-format
msgid "Input file %s not found.\n"
msgstr "File di input %s non trovato.\n"
+#: elf/ldconfig.c:793
+#, c-format
+msgid "Cannot stat %s"
+msgstr "Impossibile fare stat di %s"
+
# lf
-#: elf/ldconfig.c:908
+#: elf/ldconfig.c:922
#, c-format
msgid "libc5 library %s in wrong directory"
msgstr "libreria libc5 %s nella directory errata"
# lf
-#: elf/ldconfig.c:911
+#: elf/ldconfig.c:925
#, c-format
msgid "libc6 library %s in wrong directory"
msgstr "libreria libc6 %s nella directory errata"
# lf
-#: elf/ldconfig.c:914
+#: elf/ldconfig.c:928
#, c-format
msgid "libc4 library %s in wrong directory"
msgstr "libreria libc4 %s nella directory errata"
# lf
-#: elf/ldconfig.c:942
+#: elf/ldconfig.c:956
#, c-format
msgid "libraries %s and %s in directory %s have same soname but different type."
msgstr "le librerie %s e %s nella directory %s hanno lo stesso soname, ma di tipo differente."
-#: elf/ldconfig.c:1051
+#: elf/ldconfig.c:1065
#, c-format
msgid "Can't open configuration file %s"
msgstr "Impossibile aprire il file di configurazione %s"
-#: elf/ldconfig.c:1115
+#: elf/ldconfig.c:1129
#, c-format
msgid "%s:%u: bad syntax in hwcap line"
msgstr "%s:%u: sintassi non valida nella riga hwcap"
-#: elf/ldconfig.c:1121
+#: elf/ldconfig.c:1135
#, c-format
msgid "%s:%u: hwcap index %lu above maximum %u"
msgstr "%s:%u: indice hwcap %lu al di sopra del massimo %u"
-#: elf/ldconfig.c:1128 elf/ldconfig.c:1136
+#: elf/ldconfig.c:1142 elf/ldconfig.c:1150
#, c-format
msgid "%s:%u: hwcap index %lu already defined as %s"
msgstr "%s:%u: indice hwcap %lu già definito come %s"
-#: elf/ldconfig.c:1139
+#: elf/ldconfig.c:1153
#, c-format
msgid "%s:%u: duplicate hwcap %lu %s"
msgstr "%s:%u: hwcap %lu duplicato %s"
-#: elf/ldconfig.c:1161
+#: elf/ldconfig.c:1175
#, c-format
msgid "need absolute file name for configuration file when using -r"
msgstr "se viene usato -r è necessario un nome file assoluto per il file di configurazione"
-#: elf/ldconfig.c:1168 locale/programs/xmalloc.c:70 malloc/obstack.c:434
-#: malloc/obstack.c:436 posix/getconf.c:985 posix/getconf.c:1177
+#: elf/ldconfig.c:1182 locale/programs/xmalloc.c:70 malloc/obstack.c:434
+#: malloc/obstack.c:436 posix/getconf.c:1077 posix/getconf.c:1297
#, c-format
msgid "memory exhausted"
msgstr "memoria esaurita"
-#: elf/ldconfig.c:1198
+#: elf/ldconfig.c:1214
#, c-format
msgid "%s:%u: cannot read directory %s"
msgstr "%s:%u: impossibile leggere la directory %s"
# lf
-#: elf/ldconfig.c:1242
+#: elf/ldconfig.c:1258
#, c-format
msgid "relative path `%s' used to build cache"
msgstr "usato il percorso relativo \"%s\" per creare la cache"
-#: elf/ldconfig.c:1268
+#: elf/ldconfig.c:1284
#, c-format
msgid "Can't chdir to /"
msgstr "Impossibile fare chdir a /"
-#: elf/ldconfig.c:1310
+#: elf/ldconfig.c:1325
#, c-format
msgid "Can't open cache file directory %s\n"
msgstr "Impossibile aprire la directory del file di cache %s\n"
@@ -1052,7 +1069,7 @@ msgstr "argomenti relativi al file mancanti"
msgid "No such file or directory"
msgstr "File o directory non esistente"
-#: elf/ldd.bash.in:153 inet/rcmd.c:483
+#: elf/ldd.bash.in:153 inet/rcmd.c:488
msgid "not regular file"
msgstr "non è un file normale"
@@ -1070,7 +1087,7 @@ msgstr "uscito con codice d'uscita sconosciuto"
#: elf/ldd.bash.in:198
msgid "error: you do not have read permission for"
-msgstr "errore: permessi di lettura non sufficienti per"
+msgstr "errore: permessi di lettura mancanti per"
# lf
#: elf/readelflib.c:35
@@ -1170,6 +1187,66 @@ msgstr "%s: destinazione non valida: %s\n"
msgid "Invalid link from \"%s\" to \"%s\": %s\n"
msgstr "collegamento non valido da \"%s\" a \"%s\": %s\n"
+#: elf/sotruss.ksh:33
+#, sh-format
+msgid ""
+"Usage: sotruss [OPTION...] [--] EXECUTABLE [EXECUTABLE-OPTION...]\n"
+" -F, --from FROMLIST trace calls from objects on FORMLIST\n"
+" -T, --to TOLIST trace calls to objects on TOLIST\n"
+"\n"
+" -e, --exit also show exits from the function calls\n"
+" -f, --follow trace child processes\n"
+" -o, --output FILENAME write output to FILENAME (or FILENAME.$PID in case\n"
+"\t\t\t -f is also used) instead of standard error\n"
+"\n"
+" --help print this help and exit\n"
+" --version print version information and exit"
+msgstr ""
+"Usage: sotruss [OPZIONi...] [--] ESEGUIBILE [OPZIONI-ESEGUIBILE...]\n"
+" -F, --from DAELENCO Traccia le chiamate dagli oggetti presenti nel DAELENCO\n"
+" -T, --to AELENCO Traccia le chiamate agli oggetti presenti nel AELENCO\n"
+"\n"
+" -e, --exit Mostra anche le uscite dalle chiamate alla funzione\n"
+" -f, --follow Traccia i processi figlio\n"
+" -o, --output NOMEFILE Scrive l'output su NOMEFILE (o NOMEFILE.$PID se viene\n"
+"\t\t\t usato anche -f) invece che sullo standard error\n"
+"\n"
+" --help Stampa questo aiuto ed esce\n"
+" --version Stampa le informazioni sulla versione ed esce"
+
+#: elf/sotruss.ksh:46
+msgid "Mandatory arguments to long options are also mandatory for any corresponding\\nshort options.\\n"
+msgstr "Gli argomenti obbligatori per le opzioni lunghe lo sono anche per tutte le relative\\nopzioni corte.\\n"
+
+#: elf/sotruss.ksh:56
+msgid "%s: option requires an argument -- '%s'\\n"
+msgstr "%s: l'opzione richiede un argomento -- \"%s\"\\n"
+
+#: elf/sotruss.ksh:57 elf/sotruss.ksh:68 elf/sotruss.ksh:134
+msgid "Try \\`%s --help' or \\`%s --usage' for more information.\\n"
+msgstr "Usare \\\"%s --help\" o \"%s --usage\" per ulteriori informazioni.\\n"
+
+#: elf/sotruss.ksh:62
+msgid "%s: option is ambiguous; possibilities:"
+msgstr "%s: l'opzione è ambigua; alternative:"
+
+# lf
+#: elf/sotruss.ksh:80
+msgid "Written by %s.\\n"
+msgstr "Scritto da %s.\\n"
+
+#: elf/sotruss.ksh:87
+msgid ""
+"Usage: %s [-ef] [-F FROMLIST] [-o FILENAME] [-T TOLIST] [--exit]\n"
+"\t [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST]\\n"
+msgstr ""
+"Uso: %s [-ef] [-F DAELENCO] [-o NOMEFILE] [-T AELENCO] [--exit]\n"
+"\t [--follow] [--from DAELENCO] [--output NOMEFILE] [--to AELENCO]\\n"
+
+#: elf/sotruss.ksh:133
+msgid "%s: unrecognized option '%c%s'\\n"
+msgstr "%s: opzione non riconosciuta \"%c%s\"\\n"
+
# lf
#: elf/sprof.c:77
msgid "Output selection:"
@@ -1198,100 +1275,100 @@ msgid "SHOBJ [PROFDATA]"
msgstr "OGGCOND [DATIPROF]"
# lf
-#: elf/sprof.c:420
+#: elf/sprof.c:431
#, c-format
msgid "failed to load shared object `%s'"
msgstr "caricamento dell'oggetto condiviso \"%s\" non riuscito"
# lf
-#: elf/sprof.c:429
+#: elf/sprof.c:440
#, c-format
msgid "cannot create internal descriptors"
msgstr "impossibile creare descrittori interni"
# lf
-#: elf/sprof.c:548
+#: elf/sprof.c:559
#, c-format
msgid "Reopening shared object `%s' failed"
msgstr "Riapertura dell'oggetto condiviso \"%s\" non riuscita"
-#: elf/sprof.c:555 elf/sprof.c:649
+#: elf/sprof.c:566 elf/sprof.c:660
#, c-format
msgid "reading of section headers failed"
-msgstr "lettura degli header di sezione non riuscita"
+msgstr "lettura delle intestazioni di sezione non riuscita"
-#: elf/sprof.c:563 elf/sprof.c:657
+#: elf/sprof.c:574 elf/sprof.c:668
#, c-format
msgid "reading of section header string table failed"
-msgstr "lettura della tabella di stringhe degli header di sezione non riuscita"
+msgstr "lettura della tabella di stringhe delle intestazioni di sezione non riuscita"
-#: elf/sprof.c:589
+#: elf/sprof.c:600
#, c-format
msgid "*** Cannot read debuginfo file name: %m\n"
msgstr "*** Impossibile leggere il nome del file debuginfo: %m\n"
-#: elf/sprof.c:609
+#: elf/sprof.c:620
#, c-format
msgid "cannot determine file name"
msgstr "impossibile determinare il nome del file"
-#: elf/sprof.c:642
+#: elf/sprof.c:653
#, c-format
msgid "reading of ELF header failed"
msgstr "lettura dell'intestazione ELF non riuscita"
-#: elf/sprof.c:678
+#: elf/sprof.c:689
#, c-format
msgid "*** The file `%s' is stripped: no detailed analysis possible\n"
msgstr "*** Il file \"%s\" è stato rimosso: impossibile fare l'analisi dettagliata\n"
# lf
-#: elf/sprof.c:708
+#: elf/sprof.c:719
#, c-format
msgid "failed to load symbol data"
msgstr "caricamento dei dati dei simboli non riuscito"
# lf
-#: elf/sprof.c:775
+#: elf/sprof.c:784
#, c-format
msgid "cannot load profiling data"
msgstr "impossibile caricare i dati di profiling"
-#: elf/sprof.c:784
+#: elf/sprof.c:793
#, c-format
msgid "while stat'ing profiling data file"
msgstr "durante lo stat del relativo file"
-#: elf/sprof.c:792
+#: elf/sprof.c:801
#, c-format
msgid "profiling data file `%s' does not match shared object `%s'"
msgstr "il file di dati di profiling \"%s\" non ha corrispondenza con l'oggetto condiviso \"%s\""
# lf
-#: elf/sprof.c:803
+#: elf/sprof.c:812
#, c-format
msgid "failed to mmap the profiling data file"
msgstr "mmap sul file di dati di profiling non riuscito"
# lf
-#: elf/sprof.c:811
+#: elf/sprof.c:820
#, c-format
msgid "error while closing the profiling data file"
msgstr "errore durante la chiusura del file di dati di profiling"
# lf
-#: elf/sprof.c:820 elf/sprof.c:890
+#: elf/sprof.c:829 elf/sprof.c:927
#, c-format
msgid "cannot create internal descriptor"
msgstr "impossibile creare il descrittore interno"
# lf
-#: elf/sprof.c:866
+#: elf/sprof.c:903
#, c-format
msgid "`%s' is no correct profile data file for `%s'"
msgstr "\"%s\" non è il corretto file di dati profilo per \"%s\""
-#: elf/sprof.c:1047 elf/sprof.c:1105
+#: elf/sprof.c:1084 elf/sprof.c:1142
#, c-format
msgid "cannot allocate symbol data"
msgstr "impossibile allocare i dati dei simboli"
@@ -1383,7 +1460,7 @@ msgstr "Stampa informazioni di avanzamento"
#: iconv/iconv_prog.c:74
msgid "Convert encoding of given files from one encoding to another."
-msgstr "Converte in un'altra codifica quella dei file indicati."
+msgstr "Converte la codifica dei file indicati in un'altra."
# lf
#: iconv/iconv_prog.c:78
@@ -1509,71 +1586,71 @@ msgid "cannot generate output file"
msgstr "impossibile generare il file di output"
# lf
-#: inet/rcmd.c:157
+#: inet/rcmd.c:163
msgid "rcmd: Cannot allocate memory\n"
msgstr "rcmd: impossibile allocare memoria\n"
# lf
-#: inet/rcmd.c:172
+#: inet/rcmd.c:178
msgid "rcmd: socket: All ports in use\n"
msgstr "rcmd: socket: tutte le porte in uso\n"
# lf
-#: inet/rcmd.c:200
+#: inet/rcmd.c:206
#, c-format
msgid "connect to address %s: "
msgstr "connessione all'indirizzo %s: "
# lf
-#: inet/rcmd.c:213
+#: inet/rcmd.c:219
#, c-format
msgid "Trying %s...\n"
msgstr "Tentativo su %s...\n"
-#: inet/rcmd.c:249
+#: inet/rcmd.c:255
#, c-format
msgid "rcmd: write (setting up stderr): %m\n"
msgstr "rcmd: write (impostazione stderr): %m\n"
-#: inet/rcmd.c:265
+#: inet/rcmd.c:271
#, c-format
msgid "rcmd: poll (setting up stderr): %m\n"
msgstr "rcmd: poll (impostazione stderr): %m\n"
-#: inet/rcmd.c:268
+#: inet/rcmd.c:274
msgid "poll: protocol failure in circuit setup\n"
msgstr "poll: errore del protocollo nell'impostazione del circuito\n"
-#: inet/rcmd.c:301
+#: inet/rcmd.c:306
msgid "socket: protocol failure in circuit setup\n"
msgstr "socket: errore del protocollo nell'impostazione del circuito\n"
-#: inet/rcmd.c:325
+#: inet/rcmd.c:330
#, c-format
msgid "rcmd: %s: short read"
msgstr "rcmd: %s: lettura breve"
-#: inet/rcmd.c:481
+#: inet/rcmd.c:486
msgid "lstat failed"
msgstr "lstat non riuscita"
-#: inet/rcmd.c:488
+#: inet/rcmd.c:493
msgid "cannot open"
msgstr "impossibile aprire"
-#: inet/rcmd.c:490
+#: inet/rcmd.c:495
msgid "fstat failed"
msgstr "fstat non riuscita"
-#: inet/rcmd.c:492
+#: inet/rcmd.c:497
msgid "bad owner"
msgstr "proprietario errato"
-#: inet/rcmd.c:494
+#: inet/rcmd.c:499
msgid "writeable by other than owner"
msgstr "scrivibile da altri oltre che dal proprietario"
-#: inet/rcmd.c:496
+#: inet/rcmd.c:501
msgid "hard linked somewhere"
msgstr "collegato fisicamente da qualche parte"
@@ -1630,7 +1707,7 @@ msgstr "%s: <mb_cur_max> deve essere maggiore di <mb_cur_min>\n"
#: locale/programs/repertoire.c:174
#, c-format
msgid "syntax error in prolog: %s"
-msgstr "errore di sintassi in prolog: %s"
+msgstr "errore di sintassi nel prologo: %s"
# lf
#: locale/programs/charmap.c:358
@@ -1707,8 +1784,8 @@ msgid "no symbolic name given for end of range"
msgstr "nessun nome simbolico fornito per la fine dell'intervallo"
#: locale/programs/charmap.c:610 locale/programs/ld-address.c:602
-#: locale/programs/ld-collate.c:2767 locale/programs/ld-collate.c:3924
-#: locale/programs/ld-ctype.c:2232 locale/programs/ld-ctype.c:2984
+#: locale/programs/ld-collate.c:2769 locale/programs/ld-collate.c:3927
+#: locale/programs/ld-ctype.c:2257 locale/programs/ld-ctype.c:3009
#: locale/programs/ld-identification.c:452
#: locale/programs/ld-measurement.c:238 locale/programs/ld-messages.c:332
#: locale/programs/ld-monetary.c:943 locale/programs/ld-name.c:307
@@ -1735,8 +1812,8 @@ msgid "%s: error in state machine"
msgstr "%s: errore nella macchina a stati"
#: locale/programs/charmap.c:850 locale/programs/ld-address.c:618
-#: locale/programs/ld-collate.c:2764 locale/programs/ld-collate.c:4117
-#: locale/programs/ld-ctype.c:2229 locale/programs/ld-ctype.c:3001
+#: locale/programs/ld-collate.c:2766 locale/programs/ld-collate.c:4120
+#: locale/programs/ld-ctype.c:2254 locale/programs/ld-ctype.c:3026
#: locale/programs/ld-identification.c:468
#: locale/programs/ld-measurement.c:254 locale/programs/ld-messages.c:348
#: locale/programs/ld-monetary.c:959 locale/programs/ld-name.c:323
@@ -1759,7 +1836,7 @@ msgid "number of bytes for byte sequence of beginning and end of range not the s
msgstr "il numero di byte per la sequenza d'inizio e di fine dell'intervallo non sono gli stessi: %d contro %d"
# lf
-#: locale/programs/charmap.c:993 locale/programs/ld-collate.c:3044
+#: locale/programs/charmap.c:993 locale/programs/ld-collate.c:3046
#: locale/programs/repertoire.c:419
msgid "invalid names for character range"
msgstr "nomi non validi per l'intervallo di caratteri"
@@ -1782,8 +1859,8 @@ msgid "resulting bytes for range not representable."
msgstr "i byte risultanti per l'intervallo non sono rappresentabili."
# lf
-#: locale/programs/ld-address.c:135 locale/programs/ld-collate.c:1556
-#: locale/programs/ld-ctype.c:420 locale/programs/ld-identification.c:133
+#: locale/programs/ld-address.c:135 locale/programs/ld-collate.c:1558
+#: locale/programs/ld-ctype.c:421 locale/programs/ld-identification.c:133
#: locale/programs/ld-measurement.c:94 locale/programs/ld-messages.c:97
#: locale/programs/ld-monetary.c:194 locale/programs/ld-name.c:94
#: locale/programs/ld-numeric.c:98 locale/programs/ld-paper.c:91
@@ -1848,7 +1925,7 @@ msgid "%s: numeric country code `%d' not valid"
msgstr "%s: codice numerico di nazione \"%d\" non valido"
#: locale/programs/ld-address.c:510 locale/programs/ld-address.c:547
-#: locale/programs/ld-address.c:585 locale/programs/ld-ctype.c:2608
+#: locale/programs/ld-address.c:585 locale/programs/ld-ctype.c:2633
#: locale/programs/ld-identification.c:364
#: locale/programs/ld-measurement.c:221 locale/programs/ld-messages.c:301
#: locale/programs/ld-monetary.c:701 locale/programs/ld-monetary.c:736
@@ -1871,8 +1948,8 @@ msgstr "%s: campo \"%s\" dichiarato più di una volta"
msgid "%s: unknown character in field `%s'"
msgstr "%s: carattere sconosciuto nel campo \"%s\""
-#: locale/programs/ld-address.c:599 locale/programs/ld-collate.c:3922
-#: locale/programs/ld-ctype.c:2981 locale/programs/ld-identification.c:449
+#: locale/programs/ld-address.c:599 locale/programs/ld-collate.c:3925
+#: locale/programs/ld-ctype.c:3006 locale/programs/ld-identification.c:449
#: locale/programs/ld-measurement.c:235 locale/programs/ld-messages.c:330
#: locale/programs/ld-monetary.c:941 locale/programs/ld-name.c:305
#: locale/programs/ld-numeric.c:366 locale/programs/ld-paper.c:239
@@ -1881,12 +1958,12 @@ msgstr "%s: carattere sconosciuto nel campo \"%s\""
msgid "%s: incomplete `END' line"
msgstr "%s: riga \"END\" incompleta"
-#: locale/programs/ld-address.c:609 locale/programs/ld-collate.c:542
-#: locale/programs/ld-collate.c:594 locale/programs/ld-collate.c:890
-#: locale/programs/ld-collate.c:903 locale/programs/ld-collate.c:2733
-#: locale/programs/ld-collate.c:2754 locale/programs/ld-collate.c:4107
-#: locale/programs/ld-ctype.c:1960 locale/programs/ld-ctype.c:2219
-#: locale/programs/ld-ctype.c:2806 locale/programs/ld-ctype.c:2992
+#: locale/programs/ld-address.c:609 locale/programs/ld-collate.c:544
+#: locale/programs/ld-collate.c:596 locale/programs/ld-collate.c:892
+#: locale/programs/ld-collate.c:905 locale/programs/ld-collate.c:2735
+#: locale/programs/ld-collate.c:2756 locale/programs/ld-collate.c:4110
+#: locale/programs/ld-ctype.c:1985 locale/programs/ld-ctype.c:2244
+#: locale/programs/ld-ctype.c:2831 locale/programs/ld-ctype.c:3017
#: locale/programs/ld-identification.c:459
#: locale/programs/ld-measurement.c:245 locale/programs/ld-messages.c:339
#: locale/programs/ld-monetary.c:950 locale/programs/ld-name.c:314
@@ -1897,489 +1974,489 @@ msgid "%s: syntax error"
msgstr "%s: errore di sintassi"
# lf
-#: locale/programs/ld-collate.c:417
+#: locale/programs/ld-collate.c:419
#, c-format
msgid "`%.*s' already defined in charmap"
msgstr "\"%.*s\" già definito nella mappa caratteri"
-#: locale/programs/ld-collate.c:426
+#: locale/programs/ld-collate.c:428
#, c-format
msgid "`%.*s' already defined in repertoire"
msgstr "\"%.*s\" già definito nel repertorio"
-#: locale/programs/ld-collate.c:433
+#: locale/programs/ld-collate.c:435
#, c-format
msgid "`%.*s' already defined as collating symbol"
msgstr "\"%.*s\" già definito come simbolo di collazione"
-#: locale/programs/ld-collate.c:440
+#: locale/programs/ld-collate.c:442
#, c-format
msgid "`%.*s' already defined as collating element"
msgstr "\"%.*s\" già definito come elemento di collazione"
-#: locale/programs/ld-collate.c:471 locale/programs/ld-collate.c:497
+#: locale/programs/ld-collate.c:473 locale/programs/ld-collate.c:499
#, c-format
msgid "%s: `forward' and `backward' are mutually excluding each other"
msgstr "%s: \"forward\" e \"backward\" sono mutuamente esclusivi"
-#: locale/programs/ld-collate.c:481 locale/programs/ld-collate.c:507
-#: locale/programs/ld-collate.c:523
+#: locale/programs/ld-collate.c:483 locale/programs/ld-collate.c:509
+#: locale/programs/ld-collate.c:525
#, c-format
msgid "%s: `%s' mentioned more than once in definition of weight %d"
msgstr "%s: \"%s\" menzionato più di una volta nella definizione del peso %d"
-#: locale/programs/ld-collate.c:579
+#: locale/programs/ld-collate.c:581
#, c-format
msgid "%s: too many rules; first entry only had %d"
msgstr "%s: troppe regole; la prima voce ne aveva solo %d"
-#: locale/programs/ld-collate.c:615
+#: locale/programs/ld-collate.c:617
#, c-format
msgid "%s: not enough sorting rules"
msgstr "%s: regole di ordinamento non sufficienti"
# lf
-#: locale/programs/ld-collate.c:780
+#: locale/programs/ld-collate.c:782
#, c-format
msgid "%s: empty weight string not allowed"
msgstr "%s: stringa vuota del peso non consentita"
-#: locale/programs/ld-collate.c:875
+#: locale/programs/ld-collate.c:877
#, c-format
msgid "%s: weights must use the same ellipsis symbol as the name"
msgstr "%s: i pesi devono usare lo stesso simbolo ellissi del nome"
-#: locale/programs/ld-collate.c:931
+#: locale/programs/ld-collate.c:933
#, c-format
msgid "%s: too many values"
msgstr "%s: troppi valori"
# lf
-#: locale/programs/ld-collate.c:1051 locale/programs/ld-collate.c:1226
+#: locale/programs/ld-collate.c:1053 locale/programs/ld-collate.c:1228
#, c-format
msgid "order for `%.*s' already defined at %s:%Zu"
msgstr "ordine per \"%.*s\" già definito su %s:%Zu"
-#: locale/programs/ld-collate.c:1101
+#: locale/programs/ld-collate.c:1103
#, c-format
msgid "%s: the start and the end symbol of a range must stand for characters"
msgstr "%s: i simboli iniziale e finale di un intervallo devono rappresentare caratteri"
-#: locale/programs/ld-collate.c:1128
+#: locale/programs/ld-collate.c:1130
#, c-format
msgid "%s: byte sequences of first and last character must have the same length"
msgstr "%s: la sequenza di byte del primo e dell'ultimo carattere devono avere la stessa lunghezza"
-#: locale/programs/ld-collate.c:1170
+#: locale/programs/ld-collate.c:1172
#, c-format
msgid "%s: byte sequence of first character of range is not lower than that of the last character"
msgstr "%s: la sequenza di byte del primo carattere dell'intervallo non è più piccola di quella dell'ultimo carattere"
-#: locale/programs/ld-collate.c:1295
+#: locale/programs/ld-collate.c:1297
#, c-format
msgid "%s: symbolic range ellipsis must not directly follow `order_start'"
msgstr "%s: l'ellissi dell'intervallo simbolico non deve seguire direttamente \"order_start\""
-#: locale/programs/ld-collate.c:1299
+#: locale/programs/ld-collate.c:1301
#, c-format
msgid "%s: symbolic range ellipsis must not be directly followed by `order_end'"
msgstr "%s: l'ellissi dell'intervallo simbolico non deve essere seguita direttamente da \"order_end\""
-#: locale/programs/ld-collate.c:1319 locale/programs/ld-ctype.c:1477
+#: locale/programs/ld-collate.c:1321 locale/programs/ld-ctype.c:1502
#, c-format
msgid "`%s' and `%.*s' are not valid names for symbolic range"
msgstr "\"%s\" e \"%.*s\" non sono nomi validi per un intervallo simbolico"
-#: locale/programs/ld-collate.c:1369 locale/programs/ld-collate.c:3858
+#: locale/programs/ld-collate.c:1371 locale/programs/ld-collate.c:3861
#, c-format
msgid "%s: order for `%.*s' already defined at %s:%Zu"
msgstr "%s: ordine per \"%.*s\" già definito su %s:%Zu"
-#: locale/programs/ld-collate.c:1378
+#: locale/programs/ld-collate.c:1380
#, c-format
msgid "%s: `%s' must be a character"
msgstr "%s: \"%s\" deve essere un carattere"
-#: locale/programs/ld-collate.c:1573
+#: locale/programs/ld-collate.c:1575
#, c-format
msgid "%s: `position' must be used for a specific level in all sections or none"
msgstr "%s: \"position\" deve essere usato per uno specifico livello o in tutte le sezioni o in nessuna"
-#: locale/programs/ld-collate.c:1598
+#: locale/programs/ld-collate.c:1600
#, c-format
msgid "symbol `%s' not defined"
msgstr "simbolo \"%s\" non definito"
# lf
-#: locale/programs/ld-collate.c:1674 locale/programs/ld-collate.c:1780
+#: locale/programs/ld-collate.c:1676 locale/programs/ld-collate.c:1782
#, c-format
msgid "symbol `%s' has the same encoding as"
msgstr "il simbolo \"%s\" ha la stessa codifica di"
-#: locale/programs/ld-collate.c:1678 locale/programs/ld-collate.c:1784
+#: locale/programs/ld-collate.c:1680 locale/programs/ld-collate.c:1786
#, c-format
msgid "symbol `%s'"
msgstr "simbolo \"%s\""
# lf
-#: locale/programs/ld-collate.c:1826
+#: locale/programs/ld-collate.c:1828
#, c-format
msgid "no definition of `UNDEFINED'"
msgstr "nessuna definizione di \"UNDEFINED\""
-#: locale/programs/ld-collate.c:1855
+#: locale/programs/ld-collate.c:1857
#, c-format
msgid "too many errors; giving up"
msgstr "troppi errori; uscita"
-#: locale/programs/ld-collate.c:2659 locale/programs/ld-collate.c:4046
+#: locale/programs/ld-collate.c:2661 locale/programs/ld-collate.c:4049
#, c-format
msgid "%s: nested conditionals not supported"
msgstr "%s: le condizioni nidificate non sono supportate"
-#: locale/programs/ld-collate.c:2677
+#: locale/programs/ld-collate.c:2679
#, c-format
msgid "%s: more then one 'else'"
msgstr "%s: più di un \"else\""
# lf
-#: locale/programs/ld-collate.c:2852
+#: locale/programs/ld-collate.c:2854
#, c-format
msgid "%s: duplicate definition of `%s'"
msgstr "%s: definizione duplicata di \"%s\""
# lf
-#: locale/programs/ld-collate.c:2888
+#: locale/programs/ld-collate.c:2890
#, c-format
msgid "%s: duplicate declaration of section `%s'"
msgstr "%s: dichiarazione duplicata della sezione \"%s\""
-#: locale/programs/ld-collate.c:3024
+#: locale/programs/ld-collate.c:3026
#, c-format
msgid "%s: unknown character in collating symbol name"
msgstr "%s: carattere sconosciuto nel nome del simbolo di collazione"
-#: locale/programs/ld-collate.c:3153
+#: locale/programs/ld-collate.c:3155
#, c-format
msgid "%s: unknown character in equivalent definition name"
msgstr "%s: carattere sconosciuto nel nome della definizione equivalente"
-#: locale/programs/ld-collate.c:3164
+#: locale/programs/ld-collate.c:3166
#, c-format
msgid "%s: unknown character in equivalent definition value"
msgstr "%s carattere sconosciuto nel valore della definizione equivalente"
-#: locale/programs/ld-collate.c:3174
+#: locale/programs/ld-collate.c:3176
#, c-format
msgid "%s: unknown symbol `%s' in equivalent definition"
msgstr "%s: simbolo sconosciuto \"%s\" nella definizione equivalente"
-#: locale/programs/ld-collate.c:3183
+#: locale/programs/ld-collate.c:3185
msgid "error while adding equivalent collating symbol"
msgstr "errore durante l'aggiunta di un simbolo di collazione equivalente"
# lf
-#: locale/programs/ld-collate.c:3221
+#: locale/programs/ld-collate.c:3223
#, c-format
msgid "duplicate definition of script `%s'"
msgstr "definizione dello script \"%s\" duplicata"
-#: locale/programs/ld-collate.c:3269
+#: locale/programs/ld-collate.c:3271
#, c-format
msgid "%s: unknown section name `%.*s'"
msgstr "%s: nome della sezione sconosciuto \"%.*s\""
-#: locale/programs/ld-collate.c:3298
+#: locale/programs/ld-collate.c:3300
#, c-format
msgid "%s: multiple order definitions for section `%s'"
msgstr "%s: definizioni di ordine multiplo per la sezione \"%s\""
-#: locale/programs/ld-collate.c:3326
+#: locale/programs/ld-collate.c:3328
#, c-format
msgid "%s: invalid number of sorting rules"
msgstr "%s: numero di regole di ordinamento non valido"
-#: locale/programs/ld-collate.c:3353
+#: locale/programs/ld-collate.c:3355
#, c-format
msgid "%s: multiple order definitions for unnamed section"
msgstr "%s: definizioni multiple di ordinamento per la sezione senza nome"
-#: locale/programs/ld-collate.c:3407 locale/programs/ld-collate.c:3537
-#: locale/programs/ld-collate.c:3900
+#: locale/programs/ld-collate.c:3410 locale/programs/ld-collate.c:3540
+#: locale/programs/ld-collate.c:3903
#, c-format
msgid "%s: missing `order_end' keyword"
msgstr "%s: parola chiave \"order_end\" mancante"
-#: locale/programs/ld-collate.c:3470
+#: locale/programs/ld-collate.c:3473
#, c-format
msgid "%s: order for collating symbol %.*s not yet defined"
msgstr "%s: ordine non ancora definito per il simbolo di collazione %.*s"
-#: locale/programs/ld-collate.c:3488
+#: locale/programs/ld-collate.c:3491
#, c-format
msgid "%s: order for collating element %.*s not yet defined"
msgstr "%s: ordine non ancora definito per l'elemento di collazione %.*s"
-#: locale/programs/ld-collate.c:3499
+#: locale/programs/ld-collate.c:3502
#, c-format
msgid "%s: cannot reorder after %.*s: symbol not known"
msgstr "%s: impossibile riordinare dopo %.*s: simbolo sconosciuto"
-#: locale/programs/ld-collate.c:3551 locale/programs/ld-collate.c:3912
+#: locale/programs/ld-collate.c:3554 locale/programs/ld-collate.c:3915
#, c-format
msgid "%s: missing `reorder-end' keyword"
msgstr "%s: parola chiave \"reorder-end\" mancante"
-#: locale/programs/ld-collate.c:3585 locale/programs/ld-collate.c:3783
+#: locale/programs/ld-collate.c:3588 locale/programs/ld-collate.c:3786
#, c-format
msgid "%s: section `%.*s' not known"
msgstr "%s: sezione \"%.*s\" sconosciuta"
-#: locale/programs/ld-collate.c:3650
+#: locale/programs/ld-collate.c:3653
#, c-format
msgid "%s: bad symbol <%.*s>"
msgstr "%s: simbolo non valido <%.*s>"
-#: locale/programs/ld-collate.c:3846
+#: locale/programs/ld-collate.c:3849
#, c-format
msgid "%s: cannot have `%s' as end of ellipsis range"
msgstr "%s: impossibile avere \"%s\" come fine dell'intervallo con ellissi"
-#: locale/programs/ld-collate.c:3896
+#: locale/programs/ld-collate.c:3899
#, c-format
msgid "%s: empty category description not allowed"
msgstr "%s: descrizione vuota della categoria non consentita"
-#: locale/programs/ld-collate.c:3915
+#: locale/programs/ld-collate.c:3918
#, c-format
msgid "%s: missing `reorder-sections-end' keyword"
msgstr "%s: parola chiave \"reorder-sections-end\" mancante"
-#: locale/programs/ld-collate.c:4079
+#: locale/programs/ld-collate.c:4082
#, c-format
msgid "%s: '%s' without matching 'ifdef' or 'ifndef'"
msgstr "%s: \"%s\" senza il corrispondente \"ifdef\" o \"ifndef\""
-#: locale/programs/ld-collate.c:4097
+#: locale/programs/ld-collate.c:4100
#, c-format
msgid "%s: 'endif' without matching 'ifdef' or 'ifndef'"
msgstr "%s: \"endif\" senza il corrispondente \"ifdef\" o \"ifndef\""
-#: locale/programs/ld-ctype.c:439
+#: locale/programs/ld-ctype.c:440
#, c-format
msgid "No character set name specified in charmap"
msgstr "Nessun nome specificato per il set nella mappa caratteri"
-#: locale/programs/ld-ctype.c:468
+#: locale/programs/ld-ctype.c:469
#, c-format
msgid "character L'\\u%0*x' in class `%s' must be in class `%s'"
msgstr "il carattere L\"\\u%0*x\" nella classe \"%s\" deve stare nella classe \"%s\""
-#: locale/programs/ld-ctype.c:483
+#: locale/programs/ld-ctype.c:484
#, c-format
msgid "character L'\\u%0*x' in class `%s' must not be in class `%s'"
msgstr "il carattere L\"\\u%0*x\" nella classe \"%s\" non deve stare nella classe \"%s\""
-#: locale/programs/ld-ctype.c:497 locale/programs/ld-ctype.c:555
+#: locale/programs/ld-ctype.c:498 locale/programs/ld-ctype.c:556
#, c-format
msgid "internal error in %s, line %u"
msgstr "errore interno in %s, riga %u"
-#: locale/programs/ld-ctype.c:526
+#: locale/programs/ld-ctype.c:527
#, c-format
msgid "character '%s' in class `%s' must be in class `%s'"
msgstr "il carattere \"%s\" nella classe \"%s\" deve stare nella classe \"%s\""
-#: locale/programs/ld-ctype.c:542
+#: locale/programs/ld-ctype.c:543
#, c-format
msgid "character '%s' in class `%s' must not be in class `%s'"
msgstr "il carattere \"%s\" nella classe \"%s\" non deve stare nella classe \"%s\""
-#: locale/programs/ld-ctype.c:572 locale/programs/ld-ctype.c:610
+#: locale/programs/ld-ctype.c:573 locale/programs/ld-ctype.c:611
#, c-format
msgid "<SP> character not in class `%s'"
msgstr "Il carattere <SP> non è nella classe \"%s\""
-#: locale/programs/ld-ctype.c:584 locale/programs/ld-ctype.c:621
+#: locale/programs/ld-ctype.c:585 locale/programs/ld-ctype.c:622
#, c-format
msgid "<SP> character must not be in class `%s'"
msgstr "Il carattere <SP> non deve stare nella classe \"%s\""
-#: locale/programs/ld-ctype.c:599
+#: locale/programs/ld-ctype.c:600
#, c-format
msgid "character <SP> not defined in character map"
msgstr "carattere <SP> non definito nella mappa caratteri"
-#: locale/programs/ld-ctype.c:714
+#: locale/programs/ld-ctype.c:736
#, c-format
msgid "`digit' category has not entries in groups of ten"
msgstr "la categoria \"digit\" non contiene voci a gruppi di dieci"
-#: locale/programs/ld-ctype.c:763
+#: locale/programs/ld-ctype.c:785
#, c-format
msgid "no input digits defined and none of the standard names in the charmap"
msgstr "nessuna cifra di input definita e nessuno dei nomi standard nella mappa caratteri"
-#: locale/programs/ld-ctype.c:828
+#: locale/programs/ld-ctype.c:850
#, c-format
msgid "not all characters used in `outdigit' are available in the charmap"
msgstr "non tutti i caratteri usati in \"outdigit\" sono disponibili nella mappa caratteri"
-#: locale/programs/ld-ctype.c:845
+#: locale/programs/ld-ctype.c:867
#, c-format
msgid "not all characters used in `outdigit' are available in the repertoire"
msgstr "non tutti i caratteri usati in \"outdigit\" sono disponibili nel repertorio"
-#: locale/programs/ld-ctype.c:1245
+#: locale/programs/ld-ctype.c:1270
#, c-format
msgid "character class `%s' already defined"
msgstr "classe di caratteri \"%s\" già definita"
-#: locale/programs/ld-ctype.c:1251
+#: locale/programs/ld-ctype.c:1276
#, c-format
msgid "implementation limit: no more than %Zd character classes allowed"
msgstr "limite di implementazione: non sono permesse più di %Zd classi di carattere"
-#: locale/programs/ld-ctype.c:1277
+#: locale/programs/ld-ctype.c:1302
#, c-format
msgid "character map `%s' already defined"
msgstr "mappa caratteri \"%s\" già definita"
-#: locale/programs/ld-ctype.c:1283
+#: locale/programs/ld-ctype.c:1308
#, c-format
msgid "implementation limit: no more than %d character maps allowed"
msgstr "limite di implementazione: non sono ammesse più di %d mappe caratteri"
-#: locale/programs/ld-ctype.c:1548 locale/programs/ld-ctype.c:1673
-#: locale/programs/ld-ctype.c:1779 locale/programs/ld-ctype.c:2471
-#: locale/programs/ld-ctype.c:3467
+#: locale/programs/ld-ctype.c:1573 locale/programs/ld-ctype.c:1698
+#: locale/programs/ld-ctype.c:1804 locale/programs/ld-ctype.c:2496
+#: locale/programs/ld-ctype.c:3492
#, c-format
msgid "%s: field `%s' does not contain exactly ten entries"
msgstr "%s: il campo \"%s\" non contiene esattamente dieci voci"
-#: locale/programs/ld-ctype.c:1576 locale/programs/ld-ctype.c:2150
+#: locale/programs/ld-ctype.c:1601 locale/programs/ld-ctype.c:2175
#, c-format
msgid "to-value <U%0*X> of range is smaller than from-value <U%0*X>"
msgstr "Il valore <U%0*X> \"fino a\" dell'intervallo è più piccolo del valore <U%0*X> \"da\""
-#: locale/programs/ld-ctype.c:1703
+#: locale/programs/ld-ctype.c:1728
msgid "start and end character sequence of range must have the same length"
msgstr "la sequenza di caratteri iniziale e finale dell'intervallo devono avere la stessa lunghezza"
-#: locale/programs/ld-ctype.c:1710
+#: locale/programs/ld-ctype.c:1735
msgid "to-value character sequence is smaller than from-value sequence"
msgstr "Il valore \"fino a\" della sequenza di caratteri è più piccolo del valore \"da\" della sequenza"
-#: locale/programs/ld-ctype.c:2070 locale/programs/ld-ctype.c:2121
+#: locale/programs/ld-ctype.c:2095 locale/programs/ld-ctype.c:2146
msgid "premature end of `translit_ignore' definition"
msgstr "fine prematura della definizione di \"translit_ignore\""
-#: locale/programs/ld-ctype.c:2076 locale/programs/ld-ctype.c:2127
-#: locale/programs/ld-ctype.c:2169
+#: locale/programs/ld-ctype.c:2101 locale/programs/ld-ctype.c:2152
+#: locale/programs/ld-ctype.c:2194
msgid "syntax error"
msgstr "errore di sintassi"
-#: locale/programs/ld-ctype.c:2303
+#: locale/programs/ld-ctype.c:2328
#, c-format
msgid "%s: syntax error in definition of new character class"
msgstr "%s: errore di sintassi nella definizione della nuova classe di caratteri"
-#: locale/programs/ld-ctype.c:2318
+#: locale/programs/ld-ctype.c:2343
#, c-format
msgid "%s: syntax error in definition of new character map"
msgstr "%s: errore di sintassi nella definizione della nuova mappa di caratteri"
-#: locale/programs/ld-ctype.c:2493
+#: locale/programs/ld-ctype.c:2518
msgid "ellipsis range must be marked by two operands of same type"
msgstr "l'intervallo con ellissi deve essere marcato da due operandi dello stesso tipo"
-#: locale/programs/ld-ctype.c:2502
+#: locale/programs/ld-ctype.c:2527
msgid "with symbolic name range values the absolute ellipsis `...' must not be used"
msgstr "con nomi simbolici come valori dell'intervallo non deve essere usata l'ellissi assoluta \"...\""
-#: locale/programs/ld-ctype.c:2517
+#: locale/programs/ld-ctype.c:2542
msgid "with UCS range values one must use the hexadecimal symbolic ellipsis `..'"
msgstr "con valori UCS per l'intervallo, deve essere usata l'ellissi simbolica esadecimale \"..\""
-#: locale/programs/ld-ctype.c:2531
+#: locale/programs/ld-ctype.c:2556
msgid "with character code range values one must use the absolute ellipsis `...'"
msgstr "con codici carattere come valori dell'intervallo deve essere usata l'ellissi assoluta \"...\""
# lf
-#: locale/programs/ld-ctype.c:2682
+#: locale/programs/ld-ctype.c:2707
#, c-format
msgid "duplicated definition for mapping `%s'"
msgstr "definizione duplicata per la mappatura \"%s\""
# lf
-#: locale/programs/ld-ctype.c:2768 locale/programs/ld-ctype.c:2912
+#: locale/programs/ld-ctype.c:2793 locale/programs/ld-ctype.c:2937
#, c-format
msgid "%s: `translit_start' section does not end with `translit_end'"
msgstr "%s: la sezione \"translit_start\" non termina con \"translit_end\""
-#: locale/programs/ld-ctype.c:2863
+#: locale/programs/ld-ctype.c:2888
#, c-format
msgid "%s: duplicate `default_missing' definition"
msgstr "%s: definizione duplicata di \"default_missing\""
# lf
-#: locale/programs/ld-ctype.c:2868
+#: locale/programs/ld-ctype.c:2893
msgid "previous definition was here"
msgstr "la definizione precedente era qui"
# lf
-#: locale/programs/ld-ctype.c:2890
+#: locale/programs/ld-ctype.c:2915
#, c-format
msgid "%s: no representable `default_missing' definition found"
msgstr "%s: nessuna definizione \"default_missing\" rappresentabile trovata"
-#: locale/programs/ld-ctype.c:3043 locale/programs/ld-ctype.c:3127
-#: locale/programs/ld-ctype.c:3147 locale/programs/ld-ctype.c:3168
-#: locale/programs/ld-ctype.c:3189 locale/programs/ld-ctype.c:3210
-#: locale/programs/ld-ctype.c:3231 locale/programs/ld-ctype.c:3271
-#: locale/programs/ld-ctype.c:3292 locale/programs/ld-ctype.c:3359
-#: locale/programs/ld-ctype.c:3401 locale/programs/ld-ctype.c:3426
+#: locale/programs/ld-ctype.c:3068 locale/programs/ld-ctype.c:3152
+#: locale/programs/ld-ctype.c:3172 locale/programs/ld-ctype.c:3193
+#: locale/programs/ld-ctype.c:3214 locale/programs/ld-ctype.c:3235
+#: locale/programs/ld-ctype.c:3256 locale/programs/ld-ctype.c:3296
+#: locale/programs/ld-ctype.c:3317 locale/programs/ld-ctype.c:3384
+#: locale/programs/ld-ctype.c:3426 locale/programs/ld-ctype.c:3451
#, c-format
msgid "%s: character `%s' not defined while needed as default value"
msgstr "%s: carattere \"%s\" non definito nonostante sia necessario come valore predefinito"
# lf
-#: locale/programs/ld-ctype.c:3048 locale/programs/ld-ctype.c:3132
-#: locale/programs/ld-ctype.c:3152 locale/programs/ld-ctype.c:3173
-#: locale/programs/ld-ctype.c:3194 locale/programs/ld-ctype.c:3215
-#: locale/programs/ld-ctype.c:3236 locale/programs/ld-ctype.c:3276
-#: locale/programs/ld-ctype.c:3297 locale/programs/ld-ctype.c:3364
+#: locale/programs/ld-ctype.c:3073 locale/programs/ld-ctype.c:3157
+#: locale/programs/ld-ctype.c:3177 locale/programs/ld-ctype.c:3198
+#: locale/programs/ld-ctype.c:3219 locale/programs/ld-ctype.c:3240
+#: locale/programs/ld-ctype.c:3261 locale/programs/ld-ctype.c:3301
+#: locale/programs/ld-ctype.c:3322 locale/programs/ld-ctype.c:3389
#, c-format
msgid "%s: character `%s' in charmap not representable with one byte"
msgstr "%s: carattere \"%s\" nella mappa caratteri non rappresentabile con un byte"
# lf
-#: locale/programs/ld-ctype.c:3408 locale/programs/ld-ctype.c:3433
+#: locale/programs/ld-ctype.c:3433 locale/programs/ld-ctype.c:3458
#, c-format
msgid "%s: character `%s' needed as default value not representable with one byte"
msgstr "%s: carattere \"%s\" necessario come valore predefinito non rappresentabile con un byte"
-#: locale/programs/ld-ctype.c:3489
+#: locale/programs/ld-ctype.c:3514
#, c-format
msgid "no output digits defined and none of the standard names in the charmap"
msgstr "nessuna cifra di output definita e nessun nome standard nella mappa caratteri"
-#: locale/programs/ld-ctype.c:3780
+#: locale/programs/ld-ctype.c:3805
#, c-format
msgid "%s: transliteration data from locale `%s' not available"
msgstr "%s: dati di traslitterazione dalla localizzazione \"%s\" non disponibili"
-#: locale/programs/ld-ctype.c:3881
+#: locale/programs/ld-ctype.c:3906
#, c-format
msgid "%s: table for class \"%s\": %lu bytes\n"
msgstr "%s: tabella per la classe \"%s\": %lu byte\n"
-#: locale/programs/ld-ctype.c:3950
+#: locale/programs/ld-ctype.c:3975
#, c-format
msgid "%s: table for map \"%s\": %lu bytes\n"
msgstr "%s: tabella per la mappa \"%s\": %lu byte\n"
-#: locale/programs/ld-ctype.c:4083
+#: locale/programs/ld-ctype.c:4108
#, c-format
msgid "%s: table for width: %lu bytes\n"
msgstr "%s: tabella per la larghezza: %lu byte\n"
@@ -2568,7 +2645,7 @@ msgstr "nome simbolico non terminato"
# lf
#: locale/programs/linereader.c:623
msgid "illegal escape sequence at end of string"
-msgstr "sequenza di escape illecita alla fine della stringa"
+msgstr "sequenza di escape non consentita alla fine della stringa"
#: locale/programs/linereader.c:627 locale/programs/linereader.c:855
msgid "unterminated string"
@@ -2576,7 +2653,7 @@ msgstr "stringa non terminata"
#: locale/programs/linereader.c:669
msgid "non-symbolic character value should not be used"
-msgstr "non dovrebbe essere usato un carattere non simbolico"
+msgstr "non dovrebbe essere usato un valore non simbolico per il carattere"
#: locale/programs/linereader.c:816
#, c-format
@@ -2588,6 +2665,12 @@ msgstr "il simbolo \"%.*s\" non è nella mappa caratteri"
msgid "symbol `%.*s' not in repertoire map"
msgstr "il simbolo \"%.*s\" non è nella mappa dei repertori"
+# lf
+#: locale/programs/locale-spec.c:131
+#, c-format
+msgid "unknown name \"%s\""
+msgstr "nome sconosciuto \"%s\""
+
#: locale/programs/locale.c:74
msgid "System information:"
msgstr "Informazioni di sistema:"
@@ -2766,13 +2849,13 @@ msgstr "impossibile scrivere i file di output in \"%s\""
#, c-format
msgid ""
"System's directory for character maps : %s\n"
-" repertoire maps: %s\n"
-" locale path : %s\n"
+"\t\t repertoire maps: %s\n"
+"\t\t locale path : %s\n"
"%s"
msgstr ""
-"Directory di sistema per le mappe caratteri : %s\n"
-" mappe di repertorio: %s\n"
-" percorso della localizzazione : %s\n"
+"Directory di sistema per le mappe caratteri : %s\n"
+"\t\t mappe di repertorio : %s\n"
+"\t\t percorso localizzazioni: %s\n"
"%s"
#: locale/programs/localedef.c:567
@@ -2785,132 +2868,137 @@ msgstr "dipendenze circolari nelle definizioni delle localizzazioni"
msgid "cannot add already read locale `%s' a second time"
msgstr "impossibile aggiungere una seconda volta la localizzazione \"%s\" già letta"
-#: locale/programs/locarchive.c:88 locale/programs/locarchive.c:261
+#: locale/programs/locarchive.c:92 locale/programs/locarchive.c:338
#, c-format
msgid "cannot create temporary file"
msgstr "impossibile creare il file temporaneo"
-#: locale/programs/locarchive.c:118 locale/programs/locarchive.c:307
+#: locale/programs/locarchive.c:122 locale/programs/locarchive.c:384
#, c-format
msgid "cannot initialize archive file"
msgstr "impossibile inizializzare il file d'archivio"
-#: locale/programs/locarchive.c:125 locale/programs/locarchive.c:314
+#: locale/programs/locarchive.c:129 locale/programs/locarchive.c:391
#, c-format
msgid "cannot resize archive file"
msgstr "impossibile ridimensionare il file d'archivio"
-#: locale/programs/locarchive.c:134 locale/programs/locarchive.c:323
-#: locale/programs/locarchive.c:527
+#: locale/programs/locarchive.c:152 locale/programs/locarchive.c:414
+#: locale/programs/locarchive.c:633
#, c-format
msgid "cannot map archive header"
msgstr "impossibile mappare l'intestazione dell'archivio"
-#: locale/programs/locarchive.c:156
+#: locale/programs/locarchive.c:174
#, c-format
msgid "failed to create new locale archive"
msgstr "creazione del nuovo archivio di localizzazione non riuscita"
-#: locale/programs/locarchive.c:168
+#: locale/programs/locarchive.c:186
#, c-format
msgid "cannot change mode of new locale archive"
msgstr "impossibile cambiare il modo del nuovo archivio di localizzazione"
-#: locale/programs/locarchive.c:255
+#: locale/programs/locarchive.c:285
+#, c-format
+msgid "cannot read data from locale archive"
+msgstr "impossibile leggere dati dall'archivio delle localizzazioni"
+
+#: locale/programs/locarchive.c:318
#, c-format
msgid "cannot map locale archive file"
msgstr "impossibile mappare il file di localizzazione dell'archivio"
-#: locale/programs/locarchive.c:331
+#: locale/programs/locarchive.c:422
#, c-format
msgid "cannot lock new archive"
-msgstr "impossibile eseguire il lock del nuovo archivio"
+msgstr "impossibile fare il lock del nuovo archivio"
-#: locale/programs/locarchive.c:396
+#: locale/programs/locarchive.c:488
#, c-format
msgid "cannot extend locale archive file"
msgstr "impossibile estendere il file di localizzazione dell'archivio"
-#: locale/programs/locarchive.c:405
+#: locale/programs/locarchive.c:497
#, c-format
msgid "cannot change mode of resized locale archive"
msgstr "impossibile cambiare il modo dell'archivio di localizzazione ridimensionato"
-#: locale/programs/locarchive.c:413
+#: locale/programs/locarchive.c:505
#, c-format
msgid "cannot rename new archive"
msgstr "impossibile rinominare il nuovo archivio"
-#: locale/programs/locarchive.c:466
+#: locale/programs/locarchive.c:558
#, c-format
msgid "cannot open locale archive \"%s\""
msgstr "impossibile aprire l'archivio delle localizzazioni \"%s\""
-#: locale/programs/locarchive.c:471
+#: locale/programs/locarchive.c:563
#, c-format
msgid "cannot stat locale archive \"%s\""
msgstr "impossibile fare stat dell'archivio di localizzazione \"%s\""
-#: locale/programs/locarchive.c:490
+#: locale/programs/locarchive.c:582
#, c-format
msgid "cannot lock locale archive \"%s\""
msgstr "impossibile fare il lock dell'archivio di localizzazione \"%s\""
-#: locale/programs/locarchive.c:513
+#: locale/programs/locarchive.c:605
#, c-format
msgid "cannot read archive header"
msgstr "impossibile leggere l'intestazione dell'archivio"
-#: locale/programs/locarchive.c:573
+#: locale/programs/locarchive.c:680
#, c-format
msgid "locale '%s' already exists"
msgstr "la localizzazione \"%s\" esiste già"
-#: locale/programs/locarchive.c:804 locale/programs/locarchive.c:819
-#: locale/programs/locarchive.c:831 locale/programs/locarchive.c:843
+#: locale/programs/locarchive.c:942 locale/programs/locarchive.c:957
+#: locale/programs/locarchive.c:969 locale/programs/locarchive.c:981
#: locale/programs/locfile.c:344
#, c-format
msgid "cannot add to locale archive"
msgstr "impossibile aggiungere all'archivio delle localizzazioni"
# lf
-#: locale/programs/locarchive.c:998
+#: locale/programs/locarchive.c:1139
#, c-format
msgid "locale alias file `%s' not found"
msgstr "file alias \"%s\" di localizzazione non trovato"
-#: locale/programs/locarchive.c:1142
+#: locale/programs/locarchive.c:1289
#, c-format
msgid "Adding %s\n"
msgstr "Aggiunta di %s\n"
-#: locale/programs/locarchive.c:1148
+#: locale/programs/locarchive.c:1295
#, c-format
msgid "stat of \"%s\" failed: %s: ignored"
msgstr "stat di \"%s\" non riuscita: %s: ignorato"
-#: locale/programs/locarchive.c:1154
+#: locale/programs/locarchive.c:1301
#, c-format
msgid "\"%s\" is no directory; ignored"
msgstr "\"%s\" non è una directory; ignorato"
# lf
-#: locale/programs/locarchive.c:1161
+#: locale/programs/locarchive.c:1308
#, c-format
msgid "cannot open directory \"%s\": %s: ignored"
msgstr "impossibile aprire la directory \"%s\": %s: ignorato"
-#: locale/programs/locarchive.c:1233
+#: locale/programs/locarchive.c:1380
#, c-format
msgid "incomplete set of locale files in \"%s\""
msgstr "set incompleto di file di localizzazione in \"%s\""
-#: locale/programs/locarchive.c:1297
+#: locale/programs/locarchive.c:1444
#, c-format
msgid "cannot read all files in \"%s\": ignored"
msgstr "impossibile leggere tutti i file in \"%s\": ignorato"
-#: locale/programs/locarchive.c:1367
+#: locale/programs/locarchive.c:1514
#, c-format
msgid "locale \"%s\" not in archive"
msgstr "la localizzazione \"%s\" non è nell'archivio"
@@ -2978,12 +3066,12 @@ msgstr "impossibile salvare la nuova mappa dei repertori"
msgid "repertoire map file `%s' not found"
msgstr "file della mappa dei repertori \"%s\" non trovato"
-#: login/programs/pt_chown.c:74
+#: login/programs/pt_chown.c:78
#, c-format
msgid "Set the owner, group and access permission of the slave pseudo terminal corresponding to the master pseudo terminal passed on file descriptor `%d'. This is the helper program for the `grantpt' function. It is not intended to be run directly from the command line.\n"
msgstr "Imposta il proprietario, il gruppo e i permessi d'accesso dello pseudo terminale \"slave\" corrispondente allo pseudo terminale \"master\" trasmesso al descrittore di file \"%d\". Questo è il programma d'aiuto per la funzione \"grantpt\". Non è predisposto per essere eseguito direttamente da riga di comando.\n"
-#: login/programs/pt_chown.c:84
+#: login/programs/pt_chown.c:88
#, c-format
msgid ""
"The owner is set to the current user, the group is set to `%s', and the access permission is set to `%o'.\n"
@@ -2994,44 +3082,40 @@ msgstr ""
"\n"
"%s"
-#: login/programs/pt_chown.c:161
+#: login/programs/pt_chown.c:192
#, c-format
msgid "too many arguments"
msgstr "troppi parametri"
-#: login/programs/pt_chown.c:169
+#: login/programs/pt_chown.c:200
#, c-format
msgid "needs to be installed setuid `root'"
msgstr "è necessario installarlo con setuid \"root\""
-#: malloc/mcheck.c:330
+#: malloc/mcheck.c:350
msgid "memory is consistent, library is buggy\n"
msgstr "la memoria è consistente, la libreria contiene bug\n"
-#: malloc/mcheck.c:333
+#: malloc/mcheck.c:353
msgid "memory clobbered before allocated block\n"
msgstr "memoria danneggiata prima dei blocchi allocati\n"
-#: malloc/mcheck.c:336
+#: malloc/mcheck.c:356
msgid "memory clobbered past end of allocated block\n"
msgstr "memoria danneggiata dopo la fine dei blocchi allocati\n"
# lf
-#: malloc/mcheck.c:339
+#: malloc/mcheck.c:359
msgid "block freed twice\n"
msgstr "blocco liberato due volte\n"
-#: malloc/mcheck.c:342
+#: malloc/mcheck.c:362
msgid "bogus mcheck_status, library is buggy\n"
msgstr "mcheck_status inesistente, la libreria contiene bug\n"
-#: malloc/memusage.sh:27
-msgid "Try \\`memusage --help' for more information."
-msgstr "Usare \\\"memusage --help\" per ulteriori informazioni."
-
#: malloc/memusage.sh:33
-msgid "memusage: option \\`$1' requires an argument"
-msgstr "memusage: l'opzione \\\"$1\" richiede un argomento"
+msgid "%s: option '%s' requires an argument\\n"
+msgstr "%s: l'opzione \"%s\" richiede un argomento\\n"
#: malloc/memusage.sh:39
msgid ""
@@ -3090,14 +3174,14 @@ msgstr ""
#: malloc/memusage.sh:101
msgid ""
"Syntax: memusage [--data=FILE] [--progname=NAME] [--png=FILE] [--unbuffered]\n"
-" [--buffer=SIZE] [--no-timer] [--time-based] [--total]\n"
-" [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]\n"
-" PROGRAM [PROGRAMOPTION]..."
+"\t [--buffer=SIZE] [--no-timer] [--time-based] [--total]\n"
+"\t [--title=STRING] [--x-size=SIZE] [--y-size=SIZE]\n"
+"\t PROGRAM [PROGRAMOPTION]..."
msgstr ""
"Sintassi: memusage [--data=FILE] [--progname=NOME] [--png=FILE] [--unbuffered]\n"
-" [--buffer=DIM] [--no-timer] [--time-based] [--total]\n"
-" [--title=STRINGA] [--x-size=DIMX] [--y-size=DIMY]\n"
-" PROGRAMMA [OPZIONEPROGRAMMA]..."
+"\t [--buffer=DIM] [--no-timer] [--time-based] [--total]\n"
+"\t [--title=STRINGA] [--x-size=DIMX] [--y-size=DIMY]\n"
+"\t PROGRAMMA [OPZIONEPROGRAMMA]..."
#: malloc/memusage.sh:193
msgid "memusage: option \\`${1##*=}' is ambiguous"
@@ -3155,7 +3239,7 @@ msgid "unable to free arguments"
msgstr "impossibile liberare argomenti"
# lf
-#: nis/nis_error.h:1 nis/ypclnt.c:833 nis/ypclnt.c:921 posix/regcomp.c:133
+#: nis/nis_error.h:1 nis/ypclnt.c:833 nis/ypclnt.c:921 posix/regcomp.c:132
#: sysdeps/gnu/errlist.c:20
msgid "Success"
msgstr "Successo"
@@ -3238,7 +3322,7 @@ msgstr "Oggetto non valido per l'operazione"
# lf
#: nis/nis_error.h:18
msgid "Malformed name, or illegal name"
-msgstr "Nome malformato o illecito"
+msgstr "Nome malformato o non consentito"
# lf
#: nis/nis_error.h:19
@@ -3272,7 +3356,7 @@ msgstr "I tipi di voce/tabella non corrispondono"
#: nis/nis_error.h:26
msgid "Link points to illegal name"
-msgstr "Il link punta a un nome illecito"
+msgstr "Il collegamento punta a un nome non consentito"
# ls
#: nis/nis_error.h:27
@@ -3309,7 +3393,7 @@ msgstr "Riscontrato un namespace non NIS+"
# lf
#: nis/nis_error.h:34
msgid "Illegal object type for operation"
-msgstr "Tipo di oggetto illecito per l'operazione"
+msgstr "Tipo di oggetto non consentito per l'operazione"
# lf
#: nis/nis_error.h:35
@@ -3322,7 +3406,7 @@ msgstr "Operazione di modifica non riuscita"
#: nis/nis_error.h:37
msgid "Query illegal for named table"
-msgstr "Interrogazione illecita per la tabella nominata"
+msgstr "Interrogazione non consentita per la tabella nominata"
# lf
#: nis/nis_error.h:38
@@ -3642,7 +3726,7 @@ msgstr "Numero di oggetti : %u\n"
#: nis/nis_print.c:377
#, c-format
msgid "Object #%d:\n"
-msgstr "Oggetto #%d:\n"
+msgstr "Oggetto n° %d:\n"
#: nis/nis_print_group_entry.c:117
#, c-format
@@ -3846,12 +3930,12 @@ msgstr "yp_update: impossibile convertire l'host in netname\n"
msgid "yp_update: cannot get server address\n"
msgstr "yp_update: impossibile ottenere l'indirizzo del server\n"
-#: nscd/aicache.c:82 nscd/hstcache.c:481
+#: nscd/aicache.c:83 nscd/hstcache.c:492
#, c-format
msgid "Haven't found \"%s\" in hosts cache!"
msgstr "\"%s\" non trovato nella cache degli host."
-#: nscd/aicache.c:84 nscd/hstcache.c:483
+#: nscd/aicache.c:85 nscd/hstcache.c:494
#, c-format
msgid "Reloading \"%s\" in hosts cache!"
msgstr "Ricaricamento di \"%s\" nella cache degli host."
@@ -3866,195 +3950,195 @@ msgid " (first)"
msgstr " (prima)"
# lf
-#: nscd/cache.c:286 nscd/connections.c:866
+#: nscd/cache.c:276 nscd/connections.c:861
#, c-format
msgid "cannot stat() file `%s': %s"
msgstr "impossibile fare stat() sul file \"%s\": %s"
-#: nscd/cache.c:328
+#: nscd/cache.c:318
#, c-format
msgid "pruning %s cache; time %ld"
msgstr "pulizia della cache di %s; tempo %ld"
-#: nscd/cache.c:357
+#: nscd/cache.c:347
#, c-format
msgid "considering %s entry \"%s\", timeout %<PRIu64>"
msgstr "considerata la voce di %s \"%s\", timeout %<PRIu64>"
-#: nscd/connections.c:570
+#: nscd/connections.c:565
#, c-format
msgid "invalid persistent database file \"%s\": %s"
msgstr "file \"%s\" del database persistente non valido: %s"
-#: nscd/connections.c:578
+#: nscd/connections.c:573
msgid "uninitialized header"
msgstr "intestazione non inizializzata"
-#: nscd/connections.c:583
+#: nscd/connections.c:578
msgid "header size does not match"
msgstr "la dimensione dell'intestazione non corrisponde"
-#: nscd/connections.c:593
+#: nscd/connections.c:588
msgid "file size does not match"
msgstr "la dimensione del file non corrisponde"
-#: nscd/connections.c:610
+#: nscd/connections.c:605
msgid "verification failed"
msgstr "verifica non riuscita"
-#: nscd/connections.c:624
+#: nscd/connections.c:619
#, c-format
msgid "suggested size of table for database %s larger than the persistent database's table"
-msgstr "dimensione suggerita della tabella per il database %s più larga della tabella del database persistente"
+msgstr "dimensione suggerita della tabella per il database %s più grande della tabella del database persistente"
-#: nscd/connections.c:635 nscd/connections.c:720
+#: nscd/connections.c:630 nscd/connections.c:715
#, c-format
msgid "cannot create read-only descriptor for \"%s\"; no mmap"
msgstr "impossibile creare descrittori in sola lettura per \"%s\"; nessun nmap"
-#: nscd/connections.c:651
+#: nscd/connections.c:646
#, c-format
msgid "cannot access '%s'"
msgstr "impossibile accedere a \"%s\""
-#: nscd/connections.c:699
+#: nscd/connections.c:694
#, c-format
msgid "database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"
msgstr "database per %s corrotto o utilizzato simultaneamente; se necessario rimuovere manualmente %s e riavviare"
-#: nscd/connections.c:706
+#: nscd/connections.c:701
#, c-format
msgid "cannot create %s; no persistent database used"
msgstr "impossibile creare %s; nessun database persistente utilizzato"
-#: nscd/connections.c:709
+#: nscd/connections.c:704
#, c-format
msgid "cannot create %s; no sharing possible"
msgstr "impossibile creare %s; nessuna condivisione possibile"
-#: nscd/connections.c:780
+#: nscd/connections.c:775
#, c-format
msgid "cannot write to database file %s: %s"
msgstr "impossibile scrivere sul file di database %s: %s"
-#: nscd/connections.c:819
+#: nscd/connections.c:814
#, c-format
msgid "cannot set socket to close on exec: %s; disabling paranoia mode"
msgstr "impossibile impostare il socket da chiudere dopo una exec: %s; modalità paranoia disabilitata"
# lf
-#: nscd/connections.c:902
+#: nscd/connections.c:897
#, c-format
msgid "cannot open socket: %s"
msgstr "impossibile aprire il socket: %s"
-#: nscd/connections.c:922
+#: nscd/connections.c:917
#, c-format
msgid "cannot change socket to nonblocking mode: %s"
msgstr "impossibile passare alla modalità non bloccante per il socket: %s"
-#: nscd/connections.c:930
+#: nscd/connections.c:925
#, c-format
msgid "cannot set socket to close on exec: %s"
msgstr "impossibile impostare il socket da chiudere dopo una exec: %s"
# lf
-#: nscd/connections.c:943
+#: nscd/connections.c:938
#, c-format
msgid "cannot enable socket to accept connections: %s"
msgstr "impossibile abilitare il socket per accettare le connessioni: %s"
-#: nscd/connections.c:1043
+#: nscd/connections.c:1039
#, c-format
msgid "provide access to FD %d, for %s"
msgstr "fornisce l'accesso a %d FD, per %s"
# lf
-#: nscd/connections.c:1055
+#: nscd/connections.c:1051
#, c-format
msgid "cannot handle old request version %d; current version is %d"
msgstr "impossibile gestire vecchie richieste in versione %d: la versione attuale è %d"
-#: nscd/connections.c:1077
+#: nscd/connections.c:1073
#, c-format
msgid "request from %ld not handled due to missing permission"
msgstr "richiesta da %ld non gestita a causa di permessi mancanti"
-#: nscd/connections.c:1082
+#: nscd/connections.c:1078
#, c-format
msgid "request from '%s' [%ld] not handled due to missing permission"
msgstr "richiesta da \"%s\" [%ld] non gestita a causa di permessi mancanti"
-#: nscd/connections.c:1087
+#: nscd/connections.c:1083
msgid "request not handled due to missing permission"
msgstr "richiesta non gestita a causa di permessi mancanti"
# lf
-#: nscd/connections.c:1125 nscd/connections.c:1178
+#: nscd/connections.c:1121 nscd/connections.c:1174
#, c-format
msgid "cannot write result: %s"
msgstr "impossibile scrivere il risultato: %s"
-#: nscd/connections.c:1261
+#: nscd/connections.c:1257
#, c-format
msgid "error getting caller's id: %s"
msgstr "errore durante l'acquisizione dell'id del chiamante: %s"
-#: nscd/connections.c:1320
+#: nscd/connections.c:1316
#, c-format
msgid "cannot open /proc/self/cmdline: %s; disabling paranoia mode"
msgstr "impossibile aprire /proc/self/cmdline: %s; modalità paranoia disabilitata"
-#: nscd/connections.c:1334
+#: nscd/connections.c:1330
#, c-format
msgid "cannot read /proc/self/cmdline: %s; disabling paranoia mode"
msgstr "impossibile leggere /proc/self/cmdline: %s; modalità paranoia disabilitata"
-#: nscd/connections.c:1374
+#: nscd/connections.c:1370
#, c-format
msgid "cannot change to old UID: %s; disabling paranoia mode"
msgstr "impossibile ripristinare l'UID precedente: %s; modalità paranoia disabilitata"
-#: nscd/connections.c:1384
+#: nscd/connections.c:1380
#, c-format
msgid "cannot change to old GID: %s; disabling paranoia mode"
msgstr "impossibile ripristinare il GID precedente: %s; modalità paranoia disabilitata"
-#: nscd/connections.c:1397
+#: nscd/connections.c:1393
#, c-format
msgid "cannot change to old working directory: %s; disabling paranoia mode"
msgstr "impossibile ritornare alla directory di lavoro precedente: %s; modalità paranoia disabilitata"
-#: nscd/connections.c:1429
+#: nscd/connections.c:1439
#, c-format
msgid "re-exec failed: %s; disabling paranoia mode"
msgstr "re-exec non riuscita: %s; modalità paranoia disabilitata"
-#: nscd/connections.c:1438
+#: nscd/connections.c:1448
#, c-format
msgid "cannot change current working directory to \"/\": %s"
msgstr "impossibile cambiare l'attuale directory di lavoro in \"/\": %s"
# ls
-#: nscd/connections.c:1644
+#: nscd/connections.c:1641
#, c-format
msgid "short read while reading request: %s"
msgstr "lettura breve nella lettura della richiesta: %s"
# lf
-#: nscd/connections.c:1677
+#: nscd/connections.c:1674
#, c-format
msgid "key length in request too long: %d"
msgstr "lunghezza troppo lunga della chiave nella richiesta: %d"
# lf
-#: nscd/connections.c:1690
+#: nscd/connections.c:1687
#, c-format
msgid "short read while reading request key: %s"
msgstr "lettura breve nella lettura della chiave richiesta: %s"
# lf
-#: nscd/connections.c:1699
+#: nscd/connections.c:1696
#, c-format
msgid "handle_request: request received (Version = %d) from PID %ld"
msgstr "handle_request: ricevuta richiesta (versione = %d) dal PID %ld"
@@ -4062,82 +4146,82 @@ msgstr "handle_request: ricevuta richiesta (versione = %d) dal PID %ld"
# lf
#
# credo che version sia una parola chiave...
-#: nscd/connections.c:1704
+#: nscd/connections.c:1701
#, c-format
msgid "handle_request: request received (Version = %d)"
msgstr "handle_request: ricevuta richiesta (Version = %d)"
-#: nscd/connections.c:1903 nscd/connections.c:2101
+#: nscd/connections.c:1901 nscd/connections.c:2099
#, c-format
msgid "disabled inotify after read error %d"
msgstr "inotify disabilitato dopo un errore di lettura %d"
-#: nscd/connections.c:2230
+#: nscd/connections.c:2228
msgid "could not initialize conditional variable"
msgstr "impossibile inizializzare la variabile condizionale"
-#: nscd/connections.c:2238
+#: nscd/connections.c:2236
msgid "could not start clean-up thread; terminating"
msgstr "impossibile avviare il thread di pulizia; arresto"
-#: nscd/connections.c:2252
+#: nscd/connections.c:2250
msgid "could not start any worker thread; terminating"
msgstr "impossibile avviare thread di tipo worker; arresto"
# lf
-#: nscd/connections.c:2303 nscd/connections.c:2304 nscd/connections.c:2321
-#: nscd/connections.c:2330 nscd/connections.c:2348 nscd/connections.c:2359
-#: nscd/connections.c:2370
+#: nscd/connections.c:2301 nscd/connections.c:2302 nscd/connections.c:2319
+#: nscd/connections.c:2328 nscd/connections.c:2346 nscd/connections.c:2357
+#: nscd/connections.c:2368
#, c-format
msgid "Failed to run nscd as user '%s'"
msgstr "Esecuzione di nscd come utente \"%s\" non riuscita"
-#: nscd/connections.c:2322
+#: nscd/connections.c:2320
#, c-format
msgid "initial getgrouplist failed"
msgstr "getgrouplist iniziale non riuscita"
# lf
-#: nscd/connections.c:2331
+#: nscd/connections.c:2329
#, c-format
msgid "getgrouplist failed"
msgstr "getgrouplist non riuscita"
# lf
-#: nscd/connections.c:2349
+#: nscd/connections.c:2347
#, c-format
msgid "setgroups failed"
msgstr "setgroups non riuscita"
# lf
-#: nscd/grpcache.c:395 nscd/hstcache.c:430 nscd/initgrcache.c:416
-#: nscd/pwdcache.c:400 nscd/servicescache.c:343
+#: nscd/grpcache.c:383 nscd/hstcache.c:439 nscd/initgrcache.c:406
+#: nscd/pwdcache.c:378 nscd/servicescache.c:332
#, c-format
msgid "short write in %s: %s"
msgstr "scrittura breve in %s: %s"
-#: nscd/grpcache.c:438 nscd/initgrcache.c:78
+#: nscd/grpcache.c:428 nscd/initgrcache.c:78
#, c-format
msgid "Haven't found \"%s\" in group cache!"
msgstr "\"%s\" non trovato nella cache dei gruppi."
-#: nscd/grpcache.c:440 nscd/initgrcache.c:80
+#: nscd/grpcache.c:430 nscd/initgrcache.c:80
#, c-format
msgid "Reloading \"%s\" in group cache!"
msgstr "Ricaricamento di \"%s\" nella cache dei gruppi."
# lf
-#: nscd/grpcache.c:517
+#: nscd/grpcache.c:509
#, c-format
msgid "Invalid numeric gid \"%s\"!"
msgstr "GID numerico \"%s\" non valido."
-#: nscd/mem.c:457
+#: nscd/mem.c:431
#, c-format
msgid "freed %zu bytes in %s cache"
msgstr "liberati %zu byte nella cache %s"
-#: nscd/mem.c:594
+#: nscd/mem.c:574
#, c-format
msgid "no more memory for database '%s'"
msgstr "memoria esaurita per il database \"%s\""
@@ -4191,7 +4275,7 @@ msgstr "Usa una cache separata per ciascun utente"
msgid "Name Service Cache Daemon."
msgstr "Demone di cache dei nomi di servizio (NSCD)."
-#: nscd/nscd.c:147 nss/getent.c:876 nss/makedb.c:123
+#: nscd/nscd.c:147 nss/getent.c:952 nss/makedb.c:123
#, c-format
msgid "wrong number of arguments"
msgstr "numero di argomenti errato"
@@ -4220,7 +4304,7 @@ msgstr "Impossibile cambiare l'attuale directory di lavoro a \"/\""
msgid "Could not create log file"
msgstr "Impossibile creare il file di registro"
-#: nscd/nscd.c:305 nscd/nscd.c:330 nscd/nscd_stat.c:172
+#: nscd/nscd.c:305 nscd/nscd.c:330 nscd/nscd_stat.c:174
#, c-format
msgid "Only root is allowed to use this option!"
msgstr "Solo l'utente root ha il permesso per usare questa opzione."
@@ -4230,7 +4314,7 @@ msgstr "Solo l'utente root ha il permesso per usare questa opzione."
msgid "'%s' is not a known database"
msgstr "\"%s\" non è un database conosciuto"
-#: nscd/nscd.c:370 nscd/nscd_stat.c:191
+#: nscd/nscd.c:370 nscd/nscd_stat.c:193
#, c-format
msgid "write incomplete"
msgstr "scrittura incompleta"
@@ -4295,35 +4379,35 @@ msgstr "impossibile acquisire l'attuale cartella di lavoro: %s; modalità parano
msgid "maximum file size for %s database too small"
msgstr "dimensione massima del file per il database %s troppo piccola"
-#: nscd/nscd_stat.c:141
+#: nscd/nscd_stat.c:143
#, c-format
msgid "cannot write statistics: %s"
msgstr "impossibile scrivere le statistiche: %s"
-#: nscd/nscd_stat.c:156
+#: nscd/nscd_stat.c:158
msgid "yes"
msgstr "sì"
-#: nscd/nscd_stat.c:157
+#: nscd/nscd_stat.c:159
msgid "no"
msgstr "no"
-#: nscd/nscd_stat.c:168
+#: nscd/nscd_stat.c:170
#, c-format
msgid "Only root or %s is allowed to use this option!"
msgstr "Solo l'utente root o %s ha il permesso per usare questa opzione."
-#: nscd/nscd_stat.c:179
+#: nscd/nscd_stat.c:181
#, c-format
msgid "nscd not running!\n"
msgstr "nscd non è in esecuzione.\n"
-#: nscd/nscd_stat.c:203
+#: nscd/nscd_stat.c:205
#, c-format
msgid "cannot read statistics data"
msgstr "impossibile leggere i dati statistici"
-#: nscd/nscd_stat.c:206
+#: nscd/nscd_stat.c:208
#, c-format
msgid ""
"nscd configuration:\n"
@@ -4334,27 +4418,27 @@ msgstr ""
"\n"
"%15d livello di debug del server\n"
-#: nscd/nscd_stat.c:230
+#: nscd/nscd_stat.c:232
#, c-format
msgid "%3ud %2uh %2um %2lus server runtime\n"
msgstr "%3ug %2uo %2um %2lus runtime del server\n"
-#: nscd/nscd_stat.c:233
+#: nscd/nscd_stat.c:235
#, c-format
msgid " %2uh %2um %2lus server runtime\n"
msgstr " %2uo %2um %2lus runtime del server\n"
-#: nscd/nscd_stat.c:235
+#: nscd/nscd_stat.c:237
#, c-format
msgid " %2um %2lus server runtime\n"
msgstr " %2um %2lus runtime del server\n"
-#: nscd/nscd_stat.c:237
+#: nscd/nscd_stat.c:239
#, c-format
msgid " %2lus server runtime\n"
msgstr " %2lus runtime del server\n"
-#: nscd/nscd_stat.c:239
+#: nscd/nscd_stat.c:241
#, c-format
msgid ""
"%15d current number of threads\n"
@@ -4362,14 +4446,16 @@ msgid ""
"%15lu number of times clients had to wait\n"
"%15s paranoia mode enabled\n"
"%15lu restart internal\n"
+"%15u reload count\n"
msgstr ""
-"%15d numero di thread correnti\n"
-"%15d numero massimo di thread\n"
-"%15lu numero di volte che il client è rimasto in attesa\n"
-"%15s modalità paranoia attiva\n"
-"%15lu riavvii interni\n"
+"%15d numero di thread correnti\n"
+"%15d numero massimo di thread\n"
+"%15lu numero di volte che il client è rimasto in attesa\n"
+"%15s modalità paranoia attiva\n"
+"%15lu riavvii interni\n"
+"%15u totale ricaricamenti\n"
-#: nscd/nscd_stat.c:273
+#: nscd/nscd_stat.c:276
#, c-format
msgid ""
"\n"
@@ -4403,8 +4489,8 @@ msgstr ""
"%15s la cache è persistente\n"
"%15s la cache è condivisa\n"
"%15zu dimensione suggerita\n"
-"%15zu dimensione totale della pila dati\n"
-"%15zu dimensione usata della pila dati\n"
+"%15zu dimensione totale del gruppo di dati\n"
+"%15zu dimensione usata del gruppo di dati\n"
"%15lu tempo di validità in secondi per voci positive\n"
"%15lu tempo di validità in secondi per voci negative\n"
"%15<PRIuMAX> richieste alla cache ricevute per gli elementi positivi\n"
@@ -4420,18 +4506,18 @@ msgstr ""
"%15<PRIuMAX> allocazioni di memoria non riuscite\n"
"%15s controllare /etc/%s per le modifiche\n"
-#: nscd/pwdcache.c:443
+#: nscd/pwdcache.c:423
#, c-format
msgid "Haven't found \"%s\" in password cache!"
msgstr "\"%s\" non trovato nella cache delle password."
-#: nscd/pwdcache.c:445
+#: nscd/pwdcache.c:425
#, c-format
msgid "Reloading \"%s\" in password cache!"
msgstr "Ricaricamento di \"%s\" nella cache delle password."
# lf
-#: nscd/pwdcache.c:523
+#: nscd/pwdcache.c:506
#, c-format
msgid "Invalid numeric uid \"%s\"!"
msgstr "UID numerico \"%s\" non valido."
@@ -4497,7 +4583,7 @@ msgstr "Access Vector Cache (AVC) avviato"
#: nscd/selinux.c:356
msgid "Error getting context of socket peer"
-msgstr "Errore nell'ottenere il contesto del peer del socket"
+msgstr "Errore nell'ottenere il contesto del corrispondente del socket"
#: nscd/selinux.c:361
msgid "Error getting context of nscd"
@@ -4538,50 +4624,54 @@ msgstr ""
"%15u richieste di CAV esaminate\n"
"%15u richieste di CAV perse\n"
-#: nscd/servicescache.c:390
+#: nscd/servicescache.c:381
#, c-format
msgid "Haven't found \"%s\" in services cache!"
msgstr "\"%s\" non trovato nella cache dei servizi."
-#: nscd/servicescache.c:392
+#: nscd/servicescache.c:383
#, c-format
msgid "Reloading \"%s\" in services cache!"
msgstr "Ricaricamento di \"%s\" nella cache dei servizi."
-#: nss/getent.c:52
+#: nss/getent.c:54
msgid "database [key ...]"
msgstr "database [chiave ...]"
-#: nss/getent.c:57
+#: nss/getent.c:59
msgid "Service configuration to be used"
msgstr "Configurazione da usare del servizio"
-#: nss/getent.c:62
+#: nss/getent.c:60
+msgid "disable IDN encoding"
+msgstr "disabilita codifica IDN"
+
+#: nss/getent.c:65
msgid "Get entries from administrative database."
msgstr "Ottiene voci da un database amministrativo."
-#: nss/getent.c:143 nss/getent.c:408
+#: nss/getent.c:149 nss/getent.c:479
#, c-format
msgid "Enumeration not supported on %s\n"
msgstr "Enumerazione non supportata su %s\n"
-#: nss/getent.c:794
+#: nss/getent.c:866
#, c-format
msgid "Unknown database name"
msgstr "Nome del database sconosciuto"
-#: nss/getent.c:820
+#: nss/getent.c:896
msgid "Supported databases:\n"
msgstr "Database supportati:\n"
-#: nss/getent.c:886
+#: nss/getent.c:962
#, c-format
msgid "Unknown database: %s\n"
msgstr "Database sconosciuto: %s\n"
#: nss/makedb.c:60
msgid "Convert key to lower case"
-msgstr "Converte i tasti a lettere minuscole"
+msgstr "Converte la chiave in lettere minuscole"
#: nss/makedb.c:63
msgid "Do not print messages while building database"
@@ -4639,17 +4729,17 @@ msgid "while reading database"
msgstr "durante la lettura del database"
# lf
-#: posix/getconf.c:945
+#: posix/getconf.c:1036
#, c-format
msgid "Usage: %s [-v specification] variable_name [pathname]\n"
msgstr "Uso: %s [-v specifica] nome_variabile [nome_percorso]\n"
-#: posix/getconf.c:948
+#: posix/getconf.c:1039
#, c-format
msgid " %s -a [pathname]\n"
msgstr " %s -a [nomepercorso]\n"
-#: posix/getconf.c:1023
+#: posix/getconf.c:1115
#, c-format
msgid ""
"Usage: getconf [-v SPEC] VAR\n"
@@ -4669,152 +4759,156 @@ msgstr ""
"\n"
# lf
-#: posix/getconf.c:1081
+#: posix/getconf.c:1173
#, c-format
msgid "unknown specification \"%s\""
msgstr "specifica sconosciuta \"%s\""
-#: posix/getconf.c:1109
+#: posix/getconf.c:1225
#, c-format
msgid "Couldn't execute %s"
msgstr "Impossibile eseguire %s"
# lf
-#: posix/getconf.c:1149 posix/getconf.c:1165
+#: posix/getconf.c:1269 posix/getconf.c:1285
msgid "undefined"
msgstr "non definito"
# lf
-#: posix/getconf.c:1187
+#: posix/getconf.c:1307
#, c-format
msgid "Unrecognized variable `%s'"
msgstr "Variabile \"%s\" non riconosciuta"
-#: posix/getopt.c:570 posix/getopt.c:586
+#: posix/getopt.c:594 posix/getopt.c:623
#, c-format
-msgid "%s: option '%s' is ambiguous\n"
-msgstr "%s: l'opzione \"%s\" è ambigua\n"
+msgid "%s: option '%s' is ambiguous; possibilities:"
+msgstr "%s: l'opzione \"%s\" è ambigua; alternative:"
-#: posix/getopt.c:619 posix/getopt.c:623
+#: posix/getopt.c:664 posix/getopt.c:668
#, c-format
msgid "%s: option '--%s' doesn't allow an argument\n"
msgstr "%s: l'opzione \"--%s\" non ammette argomenti\n"
-#: posix/getopt.c:632 posix/getopt.c:637
+#: posix/getopt.c:677 posix/getopt.c:682
#, c-format
msgid "%s: option '%c%s' doesn't allow an argument\n"
msgstr "%s: l'opzione \"%c%s\" non ammette argomenti\n"
-#: posix/getopt.c:680 posix/getopt.c:699 posix/getopt.c:1002
-#: posix/getopt.c:1021
+#: posix/getopt.c:725 posix/getopt.c:744
#, c-format
-msgid "%s: option '%s' requires an argument\n"
+msgid "%s: option '--%s' requires an argument\n"
msgstr "%s: l'opzione \"%s\" richiede un argomento\n"
-#: posix/getopt.c:737 posix/getopt.c:740
+#: posix/getopt.c:782 posix/getopt.c:785
#, c-format
msgid "%s: unrecognized option '--%s'\n"
msgstr "%s: opzione non riconosciuta \"--%s\"\n"
-#: posix/getopt.c:748 posix/getopt.c:751
+#: posix/getopt.c:793 posix/getopt.c:796
#, c-format
msgid "%s: unrecognized option '%c%s'\n"
msgstr "%s: opzione non riconosciuta \"%c%s\"\n"
-#: posix/getopt.c:800 posix/getopt.c:803
+#: posix/getopt.c:845 posix/getopt.c:848
#, c-format
msgid "%s: invalid option -- '%c'\n"
msgstr "%s: opzione non valida -- \"%c\"\n"
-#: posix/getopt.c:853 posix/getopt.c:870 posix/getopt.c:1073
-#: posix/getopt.c:1091
+#: posix/getopt.c:898 posix/getopt.c:915 posix/getopt.c:1123
+#: posix/getopt.c:1141
#, c-format
msgid "%s: option requires an argument -- '%c'\n"
msgstr "%s: l'opzione richiede un argomento -- \"%c\"\n"
-#: posix/getopt.c:923 posix/getopt.c:939
+#: posix/getopt.c:971 posix/getopt.c:987
#, c-format
msgid "%s: option '-W %s' is ambiguous\n"
msgstr "%s: l'opzione \"-W %s\" è ambigua\n"
-#: posix/getopt.c:963 posix/getopt.c:981
+#: posix/getopt.c:1011 posix/getopt.c:1029
#, c-format
msgid "%s: option '-W %s' doesn't allow an argument\n"
msgstr "%s: l'opzione \"-W %s\" non ammette argomenti\n"
+#: posix/getopt.c:1050 posix/getopt.c:1068
+#, c-format
+msgid "%s: option '-W %s' requires an argument\n"
+msgstr "%s: l'opzione \"-W %s\" richiede un argomento\n"
+
# lf
-#: posix/regcomp.c:136
+#: posix/regcomp.c:135
msgid "No match"
msgstr "Nessuna corrispondenza"
# lf
-#: posix/regcomp.c:139
+#: posix/regcomp.c:138
msgid "Invalid regular expression"
msgstr "Espressione regolare non valida"
# lf
-#: posix/regcomp.c:142
+#: posix/regcomp.c:141
msgid "Invalid collation character"
msgstr "Carattere di collazione non valido"
# lf
-#: posix/regcomp.c:145
+#: posix/regcomp.c:144
msgid "Invalid character class name"
msgstr "Nome della classe di caratteri non valido"
-#: posix/regcomp.c:148
+#: posix/regcomp.c:147
msgid "Trailing backslash"
msgstr "Carattere \"backslash\" alla fine della riga"
-#: posix/regcomp.c:151
+#: posix/regcomp.c:150
msgid "Invalid back reference"
msgstr "Riferimento all'indietro non valido"
-#: posix/regcomp.c:154
+#: posix/regcomp.c:153
msgid "Unmatched [ or [^"
msgstr "[ o [^ senza corrispondenza"
-#: posix/regcomp.c:157
+#: posix/regcomp.c:156
msgid "Unmatched ( or \\("
msgstr "( o \\( senza corrispondenza"
-#: posix/regcomp.c:160
+#: posix/regcomp.c:159
msgid "Unmatched \\{"
msgstr "\\{ senza corrispondenza"
-#: posix/regcomp.c:163
+#: posix/regcomp.c:162
msgid "Invalid content of \\{\\}"
msgstr "Contenuto di \\{\\} non valido"
-#: posix/regcomp.c:166
+#: posix/regcomp.c:165
msgid "Invalid range end"
msgstr "Fine dell'intervallo non valida"
-#: posix/regcomp.c:169
+#: posix/regcomp.c:168
msgid "Memory exhausted"
msgstr "Memoria esaurita"
-#: posix/regcomp.c:172
+#: posix/regcomp.c:171
msgid "Invalid preceding regular expression"
msgstr "Espressione regolare precedente non valida"
# lf
-#: posix/regcomp.c:175
+#: posix/regcomp.c:174
msgid "Premature end of regular expression"
msgstr "Fine prematura dell'espressione regolare"
# lf
-#: posix/regcomp.c:178
+#: posix/regcomp.c:177
msgid "Regular expression too big"
msgstr "Espressione regolare troppo grande"
# lf
-#: posix/regcomp.c:181
+#: posix/regcomp.c:180
msgid "Unmatched ) or \\)"
msgstr ") o \\) senza corrispondenza"
# lf
-#: posix/regcomp.c:681
+#: posix/regcomp.c:680
msgid "No previous regular expression"
msgstr "Nessuna espressione regolare precedente"
@@ -4860,7 +4954,7 @@ msgstr "Errore sconosciuto del risolutore"
#: resolv/res_hconf.c:124
#, c-format
msgid "%s: line %d: cannot specify more than %d trim domains"
-msgstr "%s: riga %d: impossibile specificare più di %d domini(o) eliminato/i"
+msgstr "%s: riga %d: impossibile specificare più di %d domini(o) da eliminare"
#: resolv/res_hconf.c:145
#, c-format
@@ -4882,6 +4976,199 @@ msgstr "%s: riga %d: comando \"%s\" errato\n"
msgid "%s: line %d: ignoring trailing garbage `%s'\n"
msgstr "%s: riga %d: spazzatura ignorata alla fine della riga \"%s\"\n"
+# lf
+#: stdio-common/psiginfo-data.h:2
+msgid "Illegal opcode"
+msgstr "Opcode non consentito"
+
+# lf
+#: stdio-common/psiginfo-data.h:3
+msgid "Illegal operand"
+msgstr "Operando non consentito"
+
+#: stdio-common/psiginfo-data.h:4
+msgid "Illegal addressing mode"
+msgstr "Modalità di indirizzamento non consentita"
+
+# lf
+#: stdio-common/psiginfo-data.h:5
+msgid "Illegal trap"
+msgstr "Trap non consentito"
+
+#: stdio-common/psiginfo-data.h:6
+msgid "Privileged opcode"
+msgstr "Opcode privilegiato"
+
+#: stdio-common/psiginfo-data.h:7
+msgid "Privileged register"
+msgstr "Registro privilegiato"
+
+#: stdio-common/psiginfo-data.h:8
+msgid "Coprocessor error"
+msgstr "Errore del coprocessore"
+
+# lf
+#: stdio-common/psiginfo-data.h:9
+msgid "Internal stack error"
+msgstr "Errore dello stack interno"
+
+#: stdio-common/psiginfo-data.h:12
+msgid "Integer divide by zero"
+msgstr "Intero diviso per zero"
+
+#: stdio-common/psiginfo-data.h:13
+msgid "Integer overflow"
+msgstr "Overflow dell'intero"
+
+#: stdio-common/psiginfo-data.h:14
+msgid "Floating-point divide by zero"
+msgstr "Virgola mobile diviso per zero"
+
+#: stdio-common/psiginfo-data.h:15
+msgid "Floating-point overflow"
+msgstr "Overflow del virgola mobile"
+
+#: stdio-common/psiginfo-data.h:16
+msgid "Floating-point underflow"
+msgstr "Underflow del virgola mobile"
+
+#: stdio-common/psiginfo-data.h:17
+msgid "Floating-poing inexact result"
+msgstr "Risultato inesatto del virgola mobile"
+
+# lf
+#: stdio-common/psiginfo-data.h:18
+msgid "Invalid floating-point operation"
+msgstr "Operazione in virgola mobile non valida"
+
+# lf
+#: stdio-common/psiginfo-data.h:19
+msgid "Subscript out of range"
+msgstr "Pedice fuori dall'intervallo"
+
+#: stdio-common/psiginfo-data.h:22
+msgid "Address not mapped to object"
+msgstr "Indirizzo non mappato sull'oggetto"
+
+#: stdio-common/psiginfo-data.h:23
+msgid "Invalid permissions for mapped object"
+msgstr "Permessi non validi per l'oggetto mappato"
+
+# lf
+#: stdio-common/psiginfo-data.h:26
+msgid "Invalid address alignment"
+msgstr "Allineamento non valido dell'indirizzo"
+
+#: stdio-common/psiginfo-data.h:27
+msgid "Nonexisting physical address"
+msgstr "Indirizzo fisico non esistente"
+
+#: stdio-common/psiginfo-data.h:28
+msgid "Object-specific hardware error"
+msgstr "Errore hardware specifico per l'oggetto"
+
+#: stdio-common/psiginfo-data.h:31
+msgid "Process breakpoint"
+msgstr "Punto di interruzione del processo"
+
+#: stdio-common/psiginfo-data.h:32
+msgid "Process trace trap"
+msgstr "Trace trap del processo"
+
+#: stdio-common/psiginfo-data.h:35
+msgid "Child has exited"
+msgstr "Il processo figlio è uscito"
+
+#: stdio-common/psiginfo-data.h:36
+msgid "Child has terminated abnormally and did not create a core file"
+msgstr "Il processo figlio è terminato in modo anomalo e non ha creato un file core"
+
+#: stdio-common/psiginfo-data.h:37
+msgid "Child hat terminated abnormally and created a core file"
+msgstr "Il processo figlio è terminato in modo anomalo e ha creato un file core"
+
+#: stdio-common/psiginfo-data.h:38
+msgid "Traced child has trapped"
+msgstr "Rilevato un trace trap nel processo figlio"
+
+#: stdio-common/psiginfo-data.h:39
+msgid "Child has stopped"
+msgstr "Il processo figlio si è fermato"
+
+#: stdio-common/psiginfo-data.h:40
+msgid "Stopped child has continued"
+msgstr "Il processo figlio fermato è proseguito"
+
+# lf
+#: stdio-common/psiginfo-data.h:43
+msgid "Data input available"
+msgstr "Dati di input disponibili"
+
+# lf
+#: stdio-common/psiginfo-data.h:44
+msgid "Output buffers available"
+msgstr "Buffer di output disponibile"
+
+# lf
+#: stdio-common/psiginfo-data.h:45
+msgid "Input message available"
+msgstr "Messaggio di input disponibile"
+
+# lf
+#: stdio-common/psiginfo-data.h:46
+msgid "I/O error"
+msgstr "Errore di I/O"
+
+# lf
+#: stdio-common/psiginfo-data.h:47
+msgid "High priority input available"
+msgstr "Input ad alta priorità disponibile"
+
+#: stdio-common/psiginfo-data.h:48
+msgid "Device disconnected"
+msgstr "Dispositivo disconnesso"
+
+#: stdio-common/psiginfo.c:145
+msgid "Signal sent by kill()"
+msgstr "Segnale inviato da kill()"
+
+#: stdio-common/psiginfo.c:148
+msgid "Signal sent by sigqueue()"
+msgstr "Segnale inviato da sigqueue()"
+
+#: stdio-common/psiginfo.c:151
+msgid "Signal generated by the expiration of a timer"
+msgstr "Segnale generato dalla scadenza di un timer"
+
+#: stdio-common/psiginfo.c:154
+msgid "Signal generated by the completion of an asynchronous I/O request"
+msgstr "Segnale generato dal completamento di una richiesta asincrona di I/O"
+
+#: stdio-common/psiginfo.c:158
+msgid "Signal generated by the arrival of a message on an empty message queue"
+msgstr "Segnale generato dall'arrivo di un messaggio su una coda vuota"
+
+#: stdio-common/psiginfo.c:163
+msgid "Signal sent by tkill()"
+msgstr "Segnale inviato da tkill()"
+
+#: stdio-common/psiginfo.c:168
+msgid "Signal generated by the completion of an asynchronous name lookup request"
+msgstr "Segnale generato dal completamento di una richiesta asincrona di ricerca del nome"
+
+#: stdio-common/psiginfo.c:174
+msgid "Signal generated by the completion of an I/O request"
+msgstr "Segnale generato dal completamento di una richiesta di I/O"
+
+#: stdio-common/psiginfo.c:180
+msgid "Signal sent by the kernel"
+msgstr "Segnale inviato dal kernel"
+
+#: stdio-common/psiginfo.c:204
+#, c-format
+msgid "Unknown signal %d\n"
+msgstr "Segnale %d sconosciuto\n"
+
#: stdio-common/psignal.c:51
#, c-format
msgid "%s%sUnknown signal %d\n"
@@ -4892,7 +5179,7 @@ msgid "Unknown signal"
msgstr "Segnale sconosciuto"
# lf
-#: string/_strerror.c:45 sysdeps/mach/_strerror.c:87
+#: string/_strerror.c:47 sysdeps/mach/_strerror.c:87
msgid "Unknown error "
msgstr "Errore sconosciuto "
@@ -4910,630 +5197,630 @@ msgstr "Segnale real-time %d"
msgid "Unknown signal %d"
msgstr "Segnale %d sconosciuto"
-#: sunrpc/auth_unix.c:114 sunrpc/clnt_tcp.c:131 sunrpc/clnt_udp.c:143
-#: sunrpc/clnt_unix.c:128 sunrpc/svc_tcp.c:179 sunrpc/svc_tcp.c:218
-#: sunrpc/svc_udp.c:153 sunrpc/svc_unix.c:176 sunrpc/svc_unix.c:215
-#: sunrpc/xdr.c:566 sunrpc/xdr.c:718 sunrpc/xdr_array.c:106
-#: sunrpc/xdr_rec.c:156 sunrpc/xdr_ref.c:85
+#: sunrpc/auth_unix.c:113 sunrpc/clnt_tcp.c:125 sunrpc/clnt_udp.c:136
+#: sunrpc/clnt_unix.c:126 sunrpc/svc_tcp.c:173 sunrpc/svc_tcp.c:218
+#: sunrpc/svc_udp.c:147 sunrpc/svc_unix.c:174 sunrpc/svc_unix.c:215
+#: sunrpc/xdr.c:632 sunrpc/xdr.c:792 sunrpc/xdr_array.c:100
+#: sunrpc/xdr_rec.c:154 sunrpc/xdr_ref.c:79
msgid "out of memory\n"
msgstr "memoria esaurita\n"
-#: sunrpc/auth_unix.c:350
+#: sunrpc/auth_unix.c:351
msgid "auth_unix.c: Fatal marshalling problem"
msgstr "auth_unix.c: problema fatale di marshalling"
-#: sunrpc/clnt_perr.c:105 sunrpc/clnt_perr.c:121
+#: sunrpc/clnt_perr.c:98 sunrpc/clnt_perr.c:114
#, c-format
msgid "%s: %s; low version = %lu, high version = %lu"
msgstr "%s: %s; versione inferiore = %lu, versione superiore = %lu"
-#: sunrpc/clnt_perr.c:112
+#: sunrpc/clnt_perr.c:105
#, c-format
msgid "%s: %s; why = %s\n"
msgstr "%s: %s; motivo = %s\n"
-#: sunrpc/clnt_perr.c:114
+#: sunrpc/clnt_perr.c:107
#, c-format
msgid "%s: %s; why = (unknown authentication error - %d)\n"
msgstr "%s: %s; motivo = (errore di autenticazione sconosciuto - %d)\n"
# lf
-#: sunrpc/clnt_perr.c:159
+#: sunrpc/clnt_perr.c:156
msgid "RPC: Success"
msgstr "RPC: successo"
# lf
-#: sunrpc/clnt_perr.c:162
+#: sunrpc/clnt_perr.c:159
msgid "RPC: Can't encode arguments"
msgstr "RPC: impossibile codificare gli argomenti"
# lf
-#: sunrpc/clnt_perr.c:166
+#: sunrpc/clnt_perr.c:163
msgid "RPC: Can't decode result"
msgstr "RPC: impossibile decodificare il risultato"
# lf
-#: sunrpc/clnt_perr.c:170
+#: sunrpc/clnt_perr.c:167
msgid "RPC: Unable to send"
msgstr "RPC: impossibile inviare"
# lf
-#: sunrpc/clnt_perr.c:174
+#: sunrpc/clnt_perr.c:171
msgid "RPC: Unable to receive"
msgstr "RPC: impossibile ricevere"
# lf
-#: sunrpc/clnt_perr.c:178
+#: sunrpc/clnt_perr.c:175
msgid "RPC: Timed out"
msgstr "RPC: tempo scaduto"
# lf
-#: sunrpc/clnt_perr.c:182
+#: sunrpc/clnt_perr.c:179
msgid "RPC: Incompatible versions of RPC"
msgstr "RPC: versione di RPC non compatibile"
# lf
-#: sunrpc/clnt_perr.c:186
+#: sunrpc/clnt_perr.c:183
msgid "RPC: Authentication error"
msgstr "RPC: errore di autenticazione"
# lf
-#: sunrpc/clnt_perr.c:190
+#: sunrpc/clnt_perr.c:187
msgid "RPC: Program unavailable"
msgstr "RPC: programma non disponibile"
# lf
-#: sunrpc/clnt_perr.c:194
+#: sunrpc/clnt_perr.c:191
msgid "RPC: Program/version mismatch"
msgstr "RPC: programma/versione non corrispondente"
# lf
-#: sunrpc/clnt_perr.c:198
+#: sunrpc/clnt_perr.c:195
msgid "RPC: Procedure unavailable"
msgstr "RPC: procedura non disponibile"
# lf
-#: sunrpc/clnt_perr.c:202
+#: sunrpc/clnt_perr.c:199
msgid "RPC: Server can't decode arguments"
msgstr "RCP: argomenti non decodificabili dal server"
# lf
-#: sunrpc/clnt_perr.c:206
+#: sunrpc/clnt_perr.c:203
msgid "RPC: Remote system error"
msgstr "RPC: errore di sistema remoto"
# lf
-#: sunrpc/clnt_perr.c:210
+#: sunrpc/clnt_perr.c:207
msgid "RPC: Unknown host"
msgstr "RPC: host sconosciuto"
# lf
-#: sunrpc/clnt_perr.c:214
+#: sunrpc/clnt_perr.c:211
msgid "RPC: Unknown protocol"
msgstr "RPC: protocollo sconosciuto"
# lf
-#: sunrpc/clnt_perr.c:218
+#: sunrpc/clnt_perr.c:215
msgid "RPC: Port mapper failure"
msgstr "RPC: errore del portmapper"
# lf
-#: sunrpc/clnt_perr.c:222
+#: sunrpc/clnt_perr.c:219
msgid "RPC: Program not registered"
msgstr "RPC: programma non registrato"
# lf
-#: sunrpc/clnt_perr.c:226
+#: sunrpc/clnt_perr.c:223
msgid "RPC: Failed (unspecified error)"
msgstr "RPC: non riuscito (errore non specificato)"
# lf
-#: sunrpc/clnt_perr.c:267
+#: sunrpc/clnt_perr.c:264
msgid "RPC: (unknown error code)"
msgstr "RPC: (codice di errore sconosciuto)"
-#: sunrpc/clnt_perr.c:330
+#: sunrpc/clnt_perr.c:336
msgid "Authentication OK"
msgstr "Autenticazione OK"
# lf
-#: sunrpc/clnt_perr.c:333
+#: sunrpc/clnt_perr.c:339
msgid "Invalid client credential"
msgstr "Credenziali del client non valide"
# lf
-#: sunrpc/clnt_perr.c:337
+#: sunrpc/clnt_perr.c:343
msgid "Server rejected credential"
msgstr "Credenziali rifiutate dal server"
# lf
-#: sunrpc/clnt_perr.c:341
+#: sunrpc/clnt_perr.c:347
msgid "Invalid client verifier"
msgstr "Verificatore del client non valido"
# lf
-#: sunrpc/clnt_perr.c:345
+#: sunrpc/clnt_perr.c:351
msgid "Server rejected verifier"
msgstr "Verificatore rifiutato dal server"
-#: sunrpc/clnt_perr.c:349
+#: sunrpc/clnt_perr.c:355
msgid "Client credential too weak"
-msgstr "Credenziale del client troppo debole"
+msgstr "Credenziali del client troppo debole"
# lf
-#: sunrpc/clnt_perr.c:353
+#: sunrpc/clnt_perr.c:359
msgid "Invalid server verifier"
msgstr "Verificatore del server non valido"
-#: sunrpc/clnt_perr.c:357
+#: sunrpc/clnt_perr.c:363
msgid "Failed (unspecified error)"
msgstr "Non riuscita (errore non specificato)"
-#: sunrpc/clnt_raw.c:117
+#: sunrpc/clnt_raw.c:115
msgid "clnt_raw.c: fatal header serialization error"
-msgstr "clnt_raw.c: errore fatale di serializzazione dell'header"
+msgstr "clnt_raw.c: errore fatale di serializzazione dell'intestazione"
-#: sunrpc/pm_getmaps.c:83
+#: sunrpc/pm_getmaps.c:77
msgid "pmap_getmaps.c: rpc problem"
msgstr "pmap_getmaps.c: problema di rpc"
-#: sunrpc/pmap_clnt.c:129
+#: sunrpc/pmap_clnt.c:127
msgid "Cannot register service"
msgstr "Impossibile registrare il servizio"
-#: sunrpc/pmap_rmt.c:248
+#: sunrpc/pmap_rmt.c:243
msgid "Cannot create socket for broadcast rpc"
msgstr "Impossibile creare il socket per l'rpc broadcast"
-#: sunrpc/pmap_rmt.c:255
+#: sunrpc/pmap_rmt.c:250
msgid "Cannot set socket option SO_BROADCAST"
msgstr "Impossibile impostare l'opzione SO_BROADCAST del socket"
-#: sunrpc/pmap_rmt.c:307
+#: sunrpc/pmap_rmt.c:302
msgid "Cannot send broadcast packet"
msgstr "Impossibile inviare il pacchetto broadcast"
-#: sunrpc/pmap_rmt.c:332
+#: sunrpc/pmap_rmt.c:327
msgid "Broadcast poll problem"
msgstr "Problema di poll del broadcast"
-#: sunrpc/pmap_rmt.c:345
+#: sunrpc/pmap_rmt.c:340
msgid "Cannot receive reply to broadcast"
msgstr "Impossibile ricevere una risposta al messaggio broadcast"
-#: sunrpc/rpc_main.c:290
+#: sunrpc/rpc_main.c:288
#, c-format
msgid "%s: output would overwrite %s\n"
msgstr "%s: l'output sovrascriverebbe %s\n"
-#: sunrpc/rpc_main.c:297
+#: sunrpc/rpc_main.c:295
#, c-format
msgid "%s: unable to open %s: %m\n"
msgstr "%s: impossibile aprire %s: %m\n"
-#: sunrpc/rpc_main.c:309
+#: sunrpc/rpc_main.c:307
#, c-format
msgid "%s: while writing output %s: %m"
msgstr "%s: nella scrittura dell'output %s: %m"
# lf
-#: sunrpc/rpc_main.c:344
+#: sunrpc/rpc_main.c:342
#, c-format
msgid "cannot find C preprocessor: %s \n"
msgstr "impossibile trovare il preprocessore C: %s \n"
# lf
-#: sunrpc/rpc_main.c:352
+#: sunrpc/rpc_main.c:350
msgid "cannot find any C preprocessor (cpp)\n"
msgstr "impossibile trovare un preprocessore C (cpp)\n"
-#: sunrpc/rpc_main.c:421
+#: sunrpc/rpc_main.c:419
#, c-format
msgid "%s: C preprocessor failed with signal %d\n"
msgstr "%s: errore del preprocessore C con segnale %d\n"
-#: sunrpc/rpc_main.c:424
+#: sunrpc/rpc_main.c:422
#, c-format
msgid "%s: C preprocessor failed with exit code %d\n"
msgstr "%s: errore del preprocessore C con codice di uscita %d\n"
-#: sunrpc/rpc_main.c:464
+#: sunrpc/rpc_main.c:462
#, c-format
msgid "illegal nettype: `%s'\n"
-msgstr "nettype illecito: \"%s\"\n"
+msgstr "nettype non consentito: \"%s\"\n"
-#: sunrpc/rpc_main.c:1130
+#: sunrpc/rpc_main.c:1128
#, c-format
msgid "rpcgen: too many defines\n"
msgstr "rpcgen: troppi define\n"
-#: sunrpc/rpc_main.c:1142
+#: sunrpc/rpc_main.c:1140
#, c-format
msgid "rpcgen: arglist coding error\n"
msgstr "rpcgen: errore di codifica arglist\n"
#. TRANS: the file will not be removed; this is an
#. TRANS: informative message.
-#: sunrpc/rpc_main.c:1175
+#: sunrpc/rpc_main.c:1173
#, c-format
msgid "file `%s' already exists and may be overwritten\n"
-msgstr "il file \"%s\" esiste già è può essere sovrascritto\n"
+msgstr "il file \"%s\" esiste già e può essere sovrascritto\n"
-#: sunrpc/rpc_main.c:1220
+#: sunrpc/rpc_main.c:1218
#, c-format
msgid "Cannot specify more than one input file!\n"
msgstr "Impossibile specificare più di un file di input.\n"
-#: sunrpc/rpc_main.c:1394
+#: sunrpc/rpc_main.c:1392
#, c-format
msgid "This implementation doesn't support newstyle or MT-safe code!\n"
msgstr "Questa implementazione non supporta codice newstyle o MT-safe.\n"
-#: sunrpc/rpc_main.c:1403
+#: sunrpc/rpc_main.c:1401
#, c-format
msgid "Cannot use netid flag with inetd flag!\n"
msgstr "Impossibile usare il flag netid con il flag inetd.\n"
-#: sunrpc/rpc_main.c:1415
+#: sunrpc/rpc_main.c:1413
#, c-format
msgid "Cannot use netid flag without TIRPC!\n"
msgstr "Impossibile usare il flag netid senza TIRPC.\n"
-#: sunrpc/rpc_main.c:1422
+#: sunrpc/rpc_main.c:1420
#, c-format
msgid "Cannot use table flags with newstyle!\n"
msgstr "Impossibile usare il flag della tabella con newstyle.\n"
-#: sunrpc/rpc_main.c:1441
+#: sunrpc/rpc_main.c:1439
#, c-format
msgid "\"infile\" is required for template generation flags.\n"
msgstr "\"filein\" è necessario per i flag di generazione del modello.\n"
-#: sunrpc/rpc_main.c:1446
+#: sunrpc/rpc_main.c:1444
#, c-format
msgid "Cannot have more than one file generation flag!\n"
msgstr "Impossibile avere più di un flag di generazione del file.\n"
-#: sunrpc/rpc_main.c:1455
+#: sunrpc/rpc_main.c:1453
#, c-format
msgid "usage: %s infile\n"
msgstr "uso: %s filein\n"
-#: sunrpc/rpc_main.c:1456
+#: sunrpc/rpc_main.c:1454
#, c-format
msgid "\t%s [-abkCLNTM][-Dname[=value]] [-i size] [-I [-K seconds]] [-Y path] infile\n"
msgstr "\t%s [-abkCLNTM][-Dnome[=valore]] [-i dimensione] [-I [-K secondi]] [-Y percorso] filein\n"
-#: sunrpc/rpc_main.c:1458
+#: sunrpc/rpc_main.c:1456
#, c-format
msgid "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o outfile] [infile]\n"
msgstr "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o fileout] [filein]\n"
-#: sunrpc/rpc_main.c:1460
+#: sunrpc/rpc_main.c:1458
#, c-format
msgid "\t%s [-s nettype]* [-o outfile] [infile]\n"
msgstr "\t%s [-s nettype]* [-o fileout] [filein]\n"
-#: sunrpc/rpc_main.c:1461
+#: sunrpc/rpc_main.c:1459
#, c-format
msgid "\t%s [-n netid]* [-o outfile] [infile]\n"
msgstr "\t%s [-n netid]* [-o fileout] [filein]\n"
-#: sunrpc/rpc_main.c:1469
+#: sunrpc/rpc_main.c:1467
#, c-format
msgid "options:\n"
msgstr "opzioni:\n"
-#: sunrpc/rpc_main.c:1470
+#: sunrpc/rpc_main.c:1468
#, c-format
msgid "-a\t\tgenerate all files, including samples\n"
msgstr "-a\t\tGenera tutti i file, inclusi i campioni\n"
-#: sunrpc/rpc_main.c:1471
+#: sunrpc/rpc_main.c:1469
#, c-format
msgid "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n"
msgstr "-b\t\tModo di compatibilità retroattiva (genera codice per SunOS 4.1)\n"
-#: sunrpc/rpc_main.c:1472
+#: sunrpc/rpc_main.c:1470
#, c-format
msgid "-c\t\tgenerate XDR routines\n"
msgstr "-c\t\tGenera le routine XDR\n"
-#: sunrpc/rpc_main.c:1473
+#: sunrpc/rpc_main.c:1471
#, c-format
msgid "-C\t\tANSI C mode\n"
msgstr "-C\t\tModalità ANSI C\n"
-#: sunrpc/rpc_main.c:1474
+#: sunrpc/rpc_main.c:1472
#, c-format
msgid "-Dname[=value]\tdefine a symbol (same as #define)\n"
msgstr "-Dnome[=valore]\tDefinisce un simbolo (come #define)\n"
-#: sunrpc/rpc_main.c:1475
+#: sunrpc/rpc_main.c:1473
#, c-format
msgid "-h\t\tgenerate header file\n"
msgstr "-h\t\tGenera il file di intestazione\n"
-#: sunrpc/rpc_main.c:1476
+#: sunrpc/rpc_main.c:1474
#, c-format
msgid "-i size\t\tsize at which to start generating inline code\n"
msgstr "-i size\t\tDimensione alla quale iniziare a generare codice inline\n"
-#: sunrpc/rpc_main.c:1477
+#: sunrpc/rpc_main.c:1475
#, c-format
msgid "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n"
msgstr "-I\t\tGenera il codice per il supporto inetd nel server (per SunOS 4.1)\n"
-#: sunrpc/rpc_main.c:1478
+#: sunrpc/rpc_main.c:1476
#, c-format
msgid "-K seconds\tserver exits after K seconds of inactivity\n"
msgstr "-K secondi\tIl server esce dopo K secondi di inattività\n"
-#: sunrpc/rpc_main.c:1479
+#: sunrpc/rpc_main.c:1477
#, c-format
msgid "-l\t\tgenerate client side stubs\n"
msgstr "-l\t\tGenera gli stub del client\n"
-#: sunrpc/rpc_main.c:1480
+#: sunrpc/rpc_main.c:1478
#, c-format
msgid "-L\t\tserver errors will be printed to syslog\n"
msgstr "-L\t\tStampa gli errori del server in syslog\n"
-#: sunrpc/rpc_main.c:1481
+#: sunrpc/rpc_main.c:1479
#, c-format
msgid "-m\t\tgenerate server side stubs\n"
msgstr "-m\t\tGenera gli stub del server\n"
-#: sunrpc/rpc_main.c:1482
+#: sunrpc/rpc_main.c:1480
#, c-format
msgid "-M\t\tgenerate MT-safe code\n"
msgstr "-M\t\tGenera codice MT-safe\n"
-#: sunrpc/rpc_main.c:1483
+#: sunrpc/rpc_main.c:1481
#, c-format
msgid "-n netid\tgenerate server code that supports named netid\n"
msgstr "-n netid\tGenera codice server che supporti netid con nome\n"
-#: sunrpc/rpc_main.c:1484
+#: sunrpc/rpc_main.c:1482
#, c-format
msgid "-N\t\tsupports multiple arguments and call-by-value\n"
msgstr "-N\t\tSupporta argomenti multipli e call-by-value\n"
-#: sunrpc/rpc_main.c:1485
+#: sunrpc/rpc_main.c:1483
#, c-format
msgid "-o outfile\tname of the output file\n"
msgstr "-o fileout\tNome del file di output\n"
-#: sunrpc/rpc_main.c:1486
+#: sunrpc/rpc_main.c:1484
#, c-format
msgid "-s nettype\tgenerate server code that supports named nettype\n"
msgstr "-s nettype\tGenera codice server che supporti nettype con nome\n"
-#: sunrpc/rpc_main.c:1487
+#: sunrpc/rpc_main.c:1485
#, c-format
msgid "-Sc\t\tgenerate sample client code that uses remote procedures\n"
msgstr "-Sc\t\tGenera codice client campione che usa procedure remote\n"
-#: sunrpc/rpc_main.c:1488
+#: sunrpc/rpc_main.c:1486
#, c-format
msgid "-Ss\t\tgenerate sample server code that defines remote procedures\n"
msgstr "-Ss\t\tGenera codice server campione che definisce procedure remote\n"
-#: sunrpc/rpc_main.c:1489
+#: sunrpc/rpc_main.c:1487
#, c-format
msgid "-Sm \t\tgenerate makefile template \n"
msgstr "-Sm \t\tGenera un modello di makefile \n"
-#: sunrpc/rpc_main.c:1490
+#: sunrpc/rpc_main.c:1488
#, c-format
msgid "-t\t\tgenerate RPC dispatch table\n"
msgstr "-t\t\tGenera la tabella di dispatch RPC\n"
-#: sunrpc/rpc_main.c:1491
+#: sunrpc/rpc_main.c:1489
#, c-format
msgid "-T\t\tgenerate code to support RPC dispatch tables\n"
msgstr "-T\t\tGenera codice per supportare le tabelle di dispatch RPC\n"
-#: sunrpc/rpc_main.c:1492
+#: sunrpc/rpc_main.c:1490
#, c-format
msgid "-Y path\t\tdirectory name to find C preprocessor (cpp)\n"
msgstr "-Y path\t\tNome della directory in cui si trova il preprocessore C (cpp)\n"
-#: sunrpc/rpc_scan.c:114
+#: sunrpc/rpc_scan.c:112
msgid "constant or identifier expected"
msgstr "attesa una costante o un identificatore"
-#: sunrpc/rpc_scan.c:310
+#: sunrpc/rpc_scan.c:308
msgid "illegal character in file: "
-msgstr "carattere illecito nel file: "
+msgstr "carattere non consentito nel file: "
-#: sunrpc/rpc_scan.c:349 sunrpc/rpc_scan.c:375
+#: sunrpc/rpc_scan.c:347 sunrpc/rpc_scan.c:373
msgid "unterminated string constant"
msgstr "costante di tipo stringa non terminata"
-#: sunrpc/rpc_scan.c:381
+#: sunrpc/rpc_scan.c:379
msgid "empty char string"
msgstr "stringa di caratteri vuota"
-#: sunrpc/rpc_scan.c:523 sunrpc/rpc_scan.c:533
+#: sunrpc/rpc_scan.c:521 sunrpc/rpc_scan.c:531
msgid "preprocessor error"
msgstr "errore del preprocessore"
-#: sunrpc/rpcinfo.c:254 sunrpc/rpcinfo.c:400
+#: sunrpc/rpcinfo.c:246 sunrpc/rpcinfo.c:392
#, c-format
msgid "program %lu is not available\n"
msgstr "il programma %lu non è disponibile\n"
-#: sunrpc/rpcinfo.c:281 sunrpc/rpcinfo.c:327 sunrpc/rpcinfo.c:350
-#: sunrpc/rpcinfo.c:424 sunrpc/rpcinfo.c:470 sunrpc/rpcinfo.c:493
-#: sunrpc/rpcinfo.c:527
+#: sunrpc/rpcinfo.c:273 sunrpc/rpcinfo.c:319 sunrpc/rpcinfo.c:342
+#: sunrpc/rpcinfo.c:416 sunrpc/rpcinfo.c:462 sunrpc/rpcinfo.c:485
+#: sunrpc/rpcinfo.c:519
#, c-format
msgid "program %lu version %lu is not available\n"
msgstr "il programma %lu versione %lu non è disponibile\n"
-#: sunrpc/rpcinfo.c:532
+#: sunrpc/rpcinfo.c:524
#, c-format
msgid "program %lu version %lu ready and waiting\n"
msgstr "programma %lu versione %lu pronto e in attesa\n"
# lf
-#: sunrpc/rpcinfo.c:573 sunrpc/rpcinfo.c:580
+#: sunrpc/rpcinfo.c:565 sunrpc/rpcinfo.c:572
msgid "rpcinfo: can't contact portmapper"
msgstr "rcpinfo: impossibile contattare il portmapper"
# ls
-#: sunrpc/rpcinfo.c:587
+#: sunrpc/rpcinfo.c:579
msgid "No remote programs registered.\n"
msgstr "Nessun programma remoto registrato.\n"
-#: sunrpc/rpcinfo.c:591
+#: sunrpc/rpcinfo.c:583
msgid " program vers proto port\n"
msgstr " programma vers proto porta\n"
-#: sunrpc/rpcinfo.c:630
+#: sunrpc/rpcinfo.c:622
msgid "(unknown)"
msgstr "(sconosciuto)"
-#: sunrpc/rpcinfo.c:654
+#: sunrpc/rpcinfo.c:646
#, c-format
msgid "rpcinfo: broadcast failed: %s\n"
msgstr "rpcinfo: broadcast non riuscito: %s\n"
-#: sunrpc/rpcinfo.c:675
+#: sunrpc/rpcinfo.c:667
msgid "Sorry. You are not root\n"
msgstr "Non si è root.\n"
-#: sunrpc/rpcinfo.c:682
+#: sunrpc/rpcinfo.c:674
#, c-format
msgid "rpcinfo: Could not delete registration for prog %s version %s\n"
msgstr "rpcinfo: impossibile eliminare la registrazione per il programma %s versione %s\n"
# lf
-#: sunrpc/rpcinfo.c:691
+#: sunrpc/rpcinfo.c:683
msgid "Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"
msgstr "Uso: rpcinfo [ -n numporta ] -t host numprog [ numvers ]\n"
# lf
-#: sunrpc/rpcinfo.c:693
+#: sunrpc/rpcinfo.c:685
msgid " rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"
msgstr " rpcinfo [ -n numporta ] -t host numprog [ numvers ]\n"
-#: sunrpc/rpcinfo.c:695
+#: sunrpc/rpcinfo.c:687
msgid " rpcinfo -p [ host ]\n"
msgstr " rpcinfo -p [ host ]\n"
# lf
-#: sunrpc/rpcinfo.c:696
+#: sunrpc/rpcinfo.c:688
msgid " rpcinfo -b prognum versnum\n"
msgstr " rpcinfo -b numprog numvers\n"
# lf
-#: sunrpc/rpcinfo.c:697
+#: sunrpc/rpcinfo.c:689
msgid " rpcinfo -d prognum versnum\n"
msgstr " rpcinfo -d numprog numvers\n"
# lf
-#: sunrpc/rpcinfo.c:722
+#: sunrpc/rpcinfo.c:714
#, c-format
msgid "rpcinfo: %s is unknown service\n"
msgstr "rcpinfo: %s è un servizio sconosciuto\n"
# lf
-#: sunrpc/rpcinfo.c:759
+#: sunrpc/rpcinfo.c:751
#, c-format
msgid "rpcinfo: %s is unknown host\n"
msgstr "rcpinfo: %s è un host sconosciuto\n"
-#: sunrpc/svc_run.c:70
+#: sunrpc/svc_run.c:71
msgid "svc_run: - out of memory"
msgstr "svc_run: - memoria esaurita"
-#: sunrpc/svc_run.c:90
+#: sunrpc/svc_run.c:91
msgid "svc_run: - poll failed"
msgstr "svc_run: - poll non riuscita"
-#: sunrpc/svc_simple.c:87
+#: sunrpc/svc_simple.c:81
#, c-format
msgid "can't reassign procedure number %ld\n"
msgstr "impossibile riassegnare il numero di procedura %ld\n"
# lf
-#: sunrpc/svc_simple.c:97
+#: sunrpc/svc_simple.c:91
msgid "couldn't create an rpc server\n"
msgstr "impossibile creare un server rcp\n"
-#: sunrpc/svc_simple.c:105
+#: sunrpc/svc_simple.c:99
#, c-format
msgid "couldn't register prog %ld vers %ld\n"
msgstr "impossibile registrare il prog %ld vers %ld\n"
-#: sunrpc/svc_simple.c:113
+#: sunrpc/svc_simple.c:107
msgid "registerrpc: out of memory\n"
msgstr "registerrpc: memoria esaurita\n"
-#: sunrpc/svc_simple.c:173
+#: sunrpc/svc_simple.c:168
#, c-format
msgid "trouble replying to prog %d\n"
msgstr "problemi replicando al prog %d\n"
-#: sunrpc/svc_simple.c:182
+#: sunrpc/svc_simple.c:177
#, c-format
msgid "never registered prog %d\n"
msgstr "prog %d mai registrato\n"
-#: sunrpc/svc_tcp.c:155
+#: sunrpc/svc_tcp.c:149
msgid "svc_tcp.c - tcp socket creation problem"
msgstr "svc_tcp.c - problema nella creazione del socket tcp"
-#: sunrpc/svc_tcp.c:170
+#: sunrpc/svc_tcp.c:164
msgid "svc_tcp.c - cannot getsockname or listen"
msgstr "svc_tcp.c - impossibile eseguire getsockname o listen"
-#: sunrpc/svc_udp.c:128
+#: sunrpc/svc_udp.c:122
msgid "svcudp_create: socket creation problem"
msgstr "svcudp_create: problema nella creazione del socket"
-#: sunrpc/svc_udp.c:142
+#: sunrpc/svc_udp.c:136
msgid "svcudp_create - cannot getsockname"
msgstr "svcudp_create - impossibile eseguire getsockname"
-#: sunrpc/svc_udp.c:175
+#: sunrpc/svc_udp.c:168
msgid "svcudp_create: xp_pad is too small for IP_PKTINFO\n"
msgstr "svcudp_create: xp_pad è troppo piccolo per IP_PKTINFO\n"
-#: sunrpc/svc_udp.c:475
+#: sunrpc/svc_udp.c:476
msgid "enablecache: cache already enabled"
msgstr "enablecache: cache già abilitata"
-#: sunrpc/svc_udp.c:481
+#: sunrpc/svc_udp.c:482
msgid "enablecache: could not allocate cache"
msgstr "enablecache: impossibile allocare la cache"
-#: sunrpc/svc_udp.c:490
+#: sunrpc/svc_udp.c:491
msgid "enablecache: could not allocate cache data"
msgstr "enablecache: impossibile allocare i dati della cache"
-#: sunrpc/svc_udp.c:498
+#: sunrpc/svc_udp.c:499
msgid "enablecache: could not allocate cache fifo"
msgstr "enablecache: impossibile allocare la coda fifo della cache"
-#: sunrpc/svc_udp.c:533
+#: sunrpc/svc_udp.c:535
msgid "cache_set: victim not found"
msgstr "cache_set: victim cache non trovata"
-#: sunrpc/svc_udp.c:544
+#: sunrpc/svc_udp.c:546
msgid "cache_set: victim alloc failed"
msgstr "cache_set: allocazione della victim cache non riuscita"
-#: sunrpc/svc_udp.c:551
+#: sunrpc/svc_udp.c:553
msgid "cache_set: could not allocate new rpc_buffer"
msgstr "cache_set: impossibile allocare il nuovo rpc_buffer"
-#: sunrpc/svc_unix.c:150
+#: sunrpc/svc_unix.c:148
msgid "svc_unix.c - AF_UNIX socket creation problem"
msgstr "svc_unix.c - problema nella creazione del socket AF_UNIX"
-#: sunrpc/svc_unix.c:166
+#: sunrpc/svc_unix.c:164
msgid "svc_unix.c - cannot getsockname or listen"
msgstr "svc_unix.c - impossibile eseguire getsockname o listen"
@@ -5547,7 +5834,7 @@ msgstr "Interruzione"
#: sysdeps/generic/siglist.h:31 sysdeps/unix/siglist.c:29
msgid "Quit"
-msgstr "Uscita (con core dump)"
+msgstr "Uscita"
#: sysdeps/generic/siglist.h:32 sysdeps/unix/siglist.c:30
msgid "Illegal instruction"
@@ -5607,11 +5894,11 @@ msgstr "Condizione di I/O urgente"
#: sysdeps/generic/siglist.h:43 sysdeps/unix/siglist.c:43
msgid "Stopped (signal)"
-msgstr "Fermato"
+msgstr "Fermato (segnale)"
#: sysdeps/generic/siglist.h:44 sysdeps/unix/siglist.c:44
msgid "Stopped"
-msgstr "Fermato (da terminale)"
+msgstr "Fermato"
#: sysdeps/generic/siglist.h:45 sysdeps/unix/siglist.c:45
msgid "Continued"
@@ -5623,11 +5910,11 @@ msgstr "Uscita del processo figlio"
#: sysdeps/generic/siglist.h:47 sysdeps/unix/siglist.c:47
msgid "Stopped (tty input)"
-msgstr "Fermato (input tty)"
+msgstr "Fermato (input da terminale)"
#: sysdeps/generic/siglist.h:48 sysdeps/unix/siglist.c:48
msgid "Stopped (tty output)"
-msgstr "Fermato (output tty)"
+msgstr "Fermato (output da terminale)"
# lf
#: sysdeps/generic/siglist.h:49 sysdeps/unix/siglist.c:49
@@ -5701,7 +5988,7 @@ msgstr "Operazione non permessa"
#. TRANS No process matches the specified process ID.
#: sysdeps/gnu/errlist.c:45
msgid "No such process"
-msgstr "Nessun processo corrispondente"
+msgstr "Nessun processo corrisponde"
# lf
#. TRANS Interrupted function call; an asynchronous signal occurred and prevented
@@ -5729,7 +6016,7 @@ msgstr "Errore di input/output"
#. TRANS computer.
#: sysdeps/gnu/errlist.c:82
msgid "No such device or address"
-msgstr "Nessun device o indirizzo corrispondente"
+msgstr "Device o indirizzo non esistente"
#. TRANS Argument list too long; used when the arguments passed to a new program
#. TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
@@ -5816,7 +6103,7 @@ msgstr "Collegamento tra dispositivi non valido"
#. TRANS particular sort of device.
#: sysdeps/gnu/errlist.c:220
msgid "No such device"
-msgstr "Nessun device di questo tipo"
+msgstr "Nessun device corrisponde"
# lf
#. TRANS A file that isn't a directory was specified when a directory is required.
@@ -5890,7 +6177,7 @@ msgstr "Spazio esaurito sul device"
#. TRANS Invalid seek operation (such as on a pipe).
#: sysdeps/gnu/errlist.c:326
msgid "Illegal seek"
-msgstr "Operazione di seek illecita"
+msgstr "Operazione di seek non consentita"
# lf
#. TRANS An attempt was made to modify something on a read-only file system.
@@ -5961,7 +6248,7 @@ msgstr "Risorsa temporaneamente non disponibile"
#. TRANS separate error code.
#: sysdeps/gnu/errlist.c:429
msgid "Operation would block"
-msgstr "L'operazione si bloccherà"
+msgstr "L'operazione si bloccherebbe"
# lf
#. TRANS An operation that cannot complete immediately was initiated on an object
@@ -6207,7 +6494,7 @@ msgstr "Quota disco superata"
#. TRANS the NFS file system on the local host.
#: sysdeps/gnu/errlist.c:787
msgid "Stale NFS file handle"
-msgstr "gestione del file NFS interrotta"
+msgstr "Gestione del file NFS interrotta"
# lf
#. TRANS An attempt was made to NFS-mount a remote file system with a file name that
@@ -6540,7 +6827,7 @@ msgstr "Accesso a una libreria condivisa danneggiata"
#: sysdeps/gnu/errlist.c:1325
msgid ".lib section in a.out corrupted"
-msgstr "sezione .lib in a.out danneggiata"
+msgstr "Sezione .lib in a.out danneggiata"
#: sysdeps/gnu/errlist.c:1333
msgid "Attempting to link in too many shared libraries"
@@ -6613,6 +6900,11 @@ msgstr "Proprietario terminato"
msgid "State not recoverable"
msgstr "Stato non recuperabile"
+# lf
+#: sysdeps/gnu/errlist.c:1461
+msgid "Operation not possible due to RF-kill"
+msgstr "Operazione non possibile a causa di un RF-kill"
+
#: sysdeps/mach/_strerror.c:57
msgid "Error in unknown error system: "
msgstr "Errore nel sistema di errore sconosciuto: "
@@ -6742,42 +7034,48 @@ msgstr "impossibile aprire \"%s\""
msgid "cannot read header from `%s'"
msgstr "impossibile leggere l'intestazione da \"%s\""
-#: timezone/zdump.c:210
+#: timezone/zdump.c:215
msgid "lacks alphabetic at start"
msgstr "manca un carattere alfabetico all'inizio"
-#: timezone/zdump.c:212
+#: timezone/zdump.c:217
msgid "has fewer than 3 alphabetics"
msgstr "ha meno di 3 caratteri alfabetici"
-#: timezone/zdump.c:214
+#: timezone/zdump.c:219
msgid "has more than 6 alphabetics"
msgstr "ha più di 6 caratteri alfabetici"
-#: timezone/zdump.c:222
+#: timezone/zdump.c:227
msgid "differs from POSIX standard"
msgstr "differisce dagli standard POSIX"
-#: timezone/zdump.c:228
+#: timezone/zdump.c:233
#, c-format
msgid "%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"
msgstr "%s: attenzione: fuso orario \"%s\" abbreviazione \"%s\" %s\n"
-#: timezone/zdump.c:279
+#: timezone/zdump.c:242
#, c-format
-msgid "%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"
-msgstr "%s: l'uso è %s [ --version ] [ -v ] [ -c [annoinf,]annosup ] nomefuso ...\n"
+msgid ""
+"%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"
+"\n"
+"Report bugs to tz@elsie.nci.nih.gov.\n"
+msgstr ""
+"%s: l'uso è %s [ --version ] [ --help ] [ -v ] [ -c [annoinf,]annosup ] nomefuso ...\n"
+"\n"
+"Segnalare i bug a tz@elsie.nci.nih.gov.\n"
-#: timezone/zdump.c:296
+#: timezone/zdump.c:311
#, c-format
msgid "%s: wild -c argument %s\n"
msgstr "%s: argomento di -c errato %s\n"
-#: timezone/zdump.c:387
+#: timezone/zdump.c:398
msgid "Error writing to standard output"
msgstr "Errore di scrittura sullo standard output"
-#: timezone/zdump.c:410
+#: timezone/zdump.c:421
#, c-format
msgid "%s: use of -v on system with floating time_t other than float or double\n"
msgstr "%s: uso di -v in un sistema con time_t variabile non float o double\n"
@@ -6805,368 +7103,372 @@ msgstr "avviso: "
#: timezone/zic.c:459
#, c-format
msgid ""
-"%s: usage is %s [ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n"
+"%s: usage is %s [ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n"
"\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"
+"\n"
+"Report bugs to tz@elsie.nci.nih.gov.\n"
msgstr ""
-"%s: l'uso è %s [ --version ] [ -v ] [ -l orariolocale ] [ -p regoleposix ] \\\n"
+"%s: l'uso è %s [ --version ] [ --help ] [ -v ] [ -l orariolocale ] [ -p regoleposix ] \\\n"
"\t[ -d directory ] [ -L secondiintercalari ] [ -y yearistype ] [ nomefile ... ]\n"
+"\n"
+"Segnalare i bug a tz@elsie.nci.nih.gov.\n"
-#: timezone/zic.c:494
+#: timezone/zic.c:496
msgid "wild compilation-time specification of zic_t"
msgstr "specifica del tempo di compilazione di zic_t errata"
-#: timezone/zic.c:511
+#: timezone/zic.c:515
#, c-format
msgid "%s: More than one -d option specified\n"
msgstr "%s: è stata specificata più di una opzione -d\n"
-#: timezone/zic.c:521
+#: timezone/zic.c:525
#, c-format
msgid "%s: More than one -l option specified\n"
msgstr "%s: è stata specificata più di una opzione -l\n"
-#: timezone/zic.c:531
+#: timezone/zic.c:535
#, c-format
msgid "%s: More than one -p option specified\n"
msgstr "%s: è stata specificata più di una opzione -p\n"
-#: timezone/zic.c:541
+#: timezone/zic.c:545
#, c-format
msgid "%s: More than one -y option specified\n"
msgstr "%s: è stata specificata più di una opzione -y\n"
-#: timezone/zic.c:551
+#: timezone/zic.c:555
#, c-format
msgid "%s: More than one -L option specified\n"
msgstr "%s: è stata specificata più di una opzione -L\n"
-#: timezone/zic.c:600
+#: timezone/zic.c:604
msgid "link to link"
msgstr "collegamento a un collegamento"
# lf
-#: timezone/zic.c:665
+#: timezone/zic.c:669
msgid "hard link failed, symbolic link used"
msgstr "collegamento fisico fallito, usato il collegamento simbolico"
# lf
-#: timezone/zic.c:673
+#: timezone/zic.c:677
#, c-format
msgid "%s: Can't link from %s to %s: %s\n"
msgstr "%s: impossibile creare un collegamento da %s a %s: %s\n"
# lf
-#: timezone/zic.c:745 timezone/zic.c:747
+#: timezone/zic.c:749 timezone/zic.c:751
msgid "same rule name in multiple files"
msgstr "stesso nome della regola in file multipli"
# lf
-#: timezone/zic.c:788
+#: timezone/zic.c:792
msgid "unruly zone"
msgstr "fuso orario senza regole"
-#: timezone/zic.c:795
+#: timezone/zic.c:799
#, c-format
msgid "%s in ruleless zone"
msgstr "%s in un fuso orario senza regole"
-#: timezone/zic.c:816
+#: timezone/zic.c:820
msgid "standard input"
msgstr "standard input"
-#: timezone/zic.c:821
+#: timezone/zic.c:825
#, c-format
msgid "%s: Can't open %s: %s\n"
msgstr "%s: impossibile aprire %s: %s\n"
# lf
-#: timezone/zic.c:832
+#: timezone/zic.c:836
msgid "line too long"
msgstr "riga troppo lunga"
# lf
-#: timezone/zic.c:852
+#: timezone/zic.c:856
msgid "input line of unknown type"
msgstr "riga di input di tipo sconosciuto"
-#: timezone/zic.c:868
+#: timezone/zic.c:872
#, c-format
msgid "%s: Leap line in non leap seconds file %s\n"
msgstr "%s: riga \"Leap\" in un file che non è di secondi intercalari %s\n"
-#: timezone/zic.c:875 timezone/zic.c:1312 timezone/zic.c:1334
+#: timezone/zic.c:879 timezone/zic.c:1316 timezone/zic.c:1338
#, c-format
msgid "%s: panic: Invalid l_value %d\n"
msgstr "%s: errore fatale: l_value %d non valido\n"
-#: timezone/zic.c:883
+#: timezone/zic.c:887
#, c-format
msgid "%s: Error reading %s\n"
msgstr "%s: errore nel leggere %s\n"
-#: timezone/zic.c:890
+#: timezone/zic.c:894
#, c-format
msgid "%s: Error closing %s: %s\n"
msgstr "%s: errore nel chiudere %s: %s\n"
# lf
-#: timezone/zic.c:895
+#: timezone/zic.c:899
msgid "expected continuation line not found"
msgstr "continuazione di riga attesa ma non trovata"
-#: timezone/zic.c:939 timezone/zic.c:2476 timezone/zic.c:2495
+#: timezone/zic.c:943 timezone/zic.c:2480 timezone/zic.c:2499
msgid "time overflow"
msgstr "overflow dell'orario"
-#: timezone/zic.c:943
+#: timezone/zic.c:947
msgid "24:00 not handled by pre-1998 versions of zic"
msgstr "24:00 non gestito dalle versioni di zic precedenti al 1998"
-#: timezone/zic.c:946
+#: timezone/zic.c:950
msgid "values over 24 hours not handled by pre-2007 versions of zic"
msgstr "i valori oltre le 24 ore non sono gestiti dalle versioni di zic precedenti al 2007"
# lf
-#: timezone/zic.c:959
+#: timezone/zic.c:963
msgid "wrong number of fields on Rule line"
msgstr "numero di campi errato nella riga \"Rule\""
# lf
-#: timezone/zic.c:963
+#: timezone/zic.c:967
msgid "nameless rule"
msgstr "regola senza nome"
-#: timezone/zic.c:968
+#: timezone/zic.c:972
msgid "invalid saved time"
-msgstr "Ora legale non valida"
+msgstr "orario memorizzato non valido"
# lf
-#: timezone/zic.c:989
+#: timezone/zic.c:993
msgid "wrong number of fields on Zone line"
msgstr "numero di campi errato nella riga \"Zone\""
-#: timezone/zic.c:995
+#: timezone/zic.c:999
#, c-format
msgid "\"Zone %s\" line and -l option are mutually exclusive"
msgstr "La riga \"Zone %s\" e l'opzione -l sono mutuamente esclusive"
-#: timezone/zic.c:1003
+#: timezone/zic.c:1007
#, c-format
msgid "\"Zone %s\" line and -p option are mutually exclusive"
msgstr "La riga \"Zone %s\" e l'opzione -p sono mutuamente esclusive"
# ls
-#: timezone/zic.c:1015
+#: timezone/zic.c:1019
#, c-format
msgid "duplicate zone name %s (file \"%s\", line %d)"
msgstr "nome del fuso %s duplicato (file \"%s\", riga %d)"
# lf
-#: timezone/zic.c:1031
+#: timezone/zic.c:1035
msgid "wrong number of fields on Zone continuation line"
msgstr "numero di campi errato nella continuazione di riga di \"Zone\""
# lf
-#: timezone/zic.c:1071
+#: timezone/zic.c:1075
msgid "invalid UTC offset"
msgstr "scostamento da UTC non valido"
# ls
-#: timezone/zic.c:1074
+#: timezone/zic.c:1078
msgid "invalid abbreviation format"
msgstr "formato di abbreviazione non valido"
-#: timezone/zic.c:1103
+#: timezone/zic.c:1107
msgid "Zone continuation line end time is not after end time of previous line"
msgstr "L'orario finale del fuso nella continuazione di riga non è successivo all'orario finale della riga precedente"
# lf
-#: timezone/zic.c:1131
+#: timezone/zic.c:1135
msgid "wrong number of fields on Leap line"
msgstr "numero di campi errato nella riga \"Leap\""
-#: timezone/zic.c:1140
+#: timezone/zic.c:1144
msgid "invalid leaping year"
msgstr "anno bisestile non valido"
# lf
-#: timezone/zic.c:1160 timezone/zic.c:1266
+#: timezone/zic.c:1164 timezone/zic.c:1270
msgid "invalid month name"
msgstr "nome di mese non valido"
# lf
-#: timezone/zic.c:1173 timezone/zic.c:1379 timezone/zic.c:1393
+#: timezone/zic.c:1177 timezone/zic.c:1383 timezone/zic.c:1397
msgid "invalid day of month"
msgstr "giorno del mese non valido"
-#: timezone/zic.c:1178
+#: timezone/zic.c:1182
msgid "time before zero"
msgstr "orario prima di zero"
-#: timezone/zic.c:1182
+#: timezone/zic.c:1186
msgid "time too small"
msgstr "orario troppo piccolo"
-#: timezone/zic.c:1186
+#: timezone/zic.c:1190
msgid "time too large"
msgstr "orario troppo grande"
-#: timezone/zic.c:1190 timezone/zic.c:1295
+#: timezone/zic.c:1194 timezone/zic.c:1299
msgid "invalid time of day"
msgstr "ora giornaliera non valida"
# lf
-#: timezone/zic.c:1209
+#: timezone/zic.c:1213
msgid "illegal CORRECTION field on Leap line"
-msgstr "campo CORRECTION illecito nella riga \"Leap\""
+msgstr "campo CORRECTION non consentito nella riga \"Leap\""
# lf
-#: timezone/zic.c:1214
+#: timezone/zic.c:1218
msgid "illegal Rolling/Stationary field on Leap line"
-msgstr "campo Rolling/Stationary illecito nella riga \"Leap\""
+msgstr "campo Rolling/Stationary non consentito nella riga \"Leap\""
# lf
-#: timezone/zic.c:1230
+#: timezone/zic.c:1234
msgid "wrong number of fields on Link line"
msgstr "numero di campi errato nella riga \"Link\""
# lf
-#: timezone/zic.c:1234
+#: timezone/zic.c:1238
msgid "blank FROM field on Link line"
msgstr "campo FROM vuoto nella riga \"Link\""
# lf
-#: timezone/zic.c:1238
+#: timezone/zic.c:1242
msgid "blank TO field on Link line"
msgstr "campo TO vuoto nella riga Link"
# lf
#
# o significa "inizio dell'anno" ??
-#: timezone/zic.c:1316
+#: timezone/zic.c:1320
msgid "invalid starting year"
msgstr "anno di inizio non valido"
-#: timezone/zic.c:1338
+#: timezone/zic.c:1342
msgid "invalid ending year"
msgstr "anno di fine non valido"
-#: timezone/zic.c:1342
+#: timezone/zic.c:1346
msgid "starting year greater than ending year"
msgstr "anno di inizio più grande dell'anno di fine"
-#: timezone/zic.c:1349
+#: timezone/zic.c:1353
msgid "typed single year"
msgstr "digitato un singolo anno"
# lf
-#: timezone/zic.c:1384
+#: timezone/zic.c:1388
msgid "invalid weekday name"
msgstr "nome del giorno della settimana non valido"
-#: timezone/zic.c:1562
+#: timezone/zic.c:1566
#, c-format
msgid "%s: Can't remove %s: %s\n"
msgstr "%s: impossibile rimuovere %s: %s\n"
-#: timezone/zic.c:1572
+#: timezone/zic.c:1576
#, c-format
msgid "%s: Can't create %s: %s\n"
msgstr "%s: impossibile creare %s: %s\n"
-#: timezone/zic.c:1722
+#: timezone/zic.c:1726
#, c-format
msgid "%s: Error writing %s\n"
msgstr "%s: errore nello scrivere %s\n"
-#: timezone/zic.c:2015
+#: timezone/zic.c:2019
msgid "no POSIX environment variable for zone"
msgstr "nessuna variable d'ambiente POSIX per il fuso orario"
-#: timezone/zic.c:2172
+#: timezone/zic.c:2176
msgid "can't determine time zone abbreviation to use just after until time"
msgstr "impossibile determinare l'abbreviazione del fuso orario da usare subito dopo l'orario raggiunto"
# ls
-#: timezone/zic.c:2218
+#: timezone/zic.c:2222
msgid "too many transitions?!"
msgstr "troppe transizioni."
-#: timezone/zic.c:2237
+#: timezone/zic.c:2241
msgid "internal error - addtype called with bad isdst"
msgstr "errore interno - chiamata addtype con isdst errata"
-#: timezone/zic.c:2241
+#: timezone/zic.c:2245
msgid "internal error - addtype called with bad ttisstd"
msgstr "errore interno - chiamata addtype con ttisstd errata"
-#: timezone/zic.c:2245
+#: timezone/zic.c:2249
msgid "internal error - addtype called with bad ttisgmt"
msgstr "errore interno - chiamata addtype con ttisgmt errata"
-#: timezone/zic.c:2264
+#: timezone/zic.c:2268
msgid "too many local time types"
msgstr "troppi tipi di orari locali"
-#: timezone/zic.c:2268
+#: timezone/zic.c:2272
msgid "UTC offset out of range"
msgstr "scostamento da UTC fuori dall'intervallo"
-#: timezone/zic.c:2296
+#: timezone/zic.c:2300
msgid "too many leap seconds"
msgstr "troppi secondi intercalari"
-#: timezone/zic.c:2302
+#: timezone/zic.c:2306
msgid "repeated leap second moment"
msgstr "secondo intercalare ripetuto"
-#: timezone/zic.c:2354
+#: timezone/zic.c:2358
msgid "Wild result from command execution"
msgstr "Risultato bizzarro dall'esecuzione del comando"
-#: timezone/zic.c:2355
+#: timezone/zic.c:2359
#, c-format
msgid "%s: command was '%s', result was %d\n"
msgstr "%s: il comando era \"%s\", il risultato %d\n"
-#: timezone/zic.c:2453
+#: timezone/zic.c:2457
msgid "Odd number of quotation marks"
msgstr "Numero dispari di apici"
-#: timezone/zic.c:2542
+#: timezone/zic.c:2546
msgid "use of 2/29 in non leap-year"
-msgstr "Usato 29/2 in un anno non bisestile"
+msgstr "usato 29/2 in un anno non bisestile"
-#: timezone/zic.c:2577
+#: timezone/zic.c:2581
msgid "rule goes past start/end of month--will not work with pre-2004 versions of zic"
msgstr "la regola che agisce prima dell'inizio/fine del mese non funzionerà con le versioni pre-2004 di zic"
-#: timezone/zic.c:2609
+#: timezone/zic.c:2613
msgid "time zone abbreviation lacks alphabetic at start"
msgstr "manca un carattere alfabetico iniziale all'abbreviazione del fuso orario"
-#: timezone/zic.c:2611
+#: timezone/zic.c:2615
msgid "time zone abbreviation has more than 3 alphabetics"
msgstr "l'abbreviazione del fuso orario ha più di 3 caratteri alfabetici"
-#: timezone/zic.c:2613
+#: timezone/zic.c:2617
msgid "time zone abbreviation has too many alphabetics"
msgstr "l'abbreviazione del fuso orario ha troppi caratteri alfabetici"
-#: timezone/zic.c:2623
+#: timezone/zic.c:2627
msgid "time zone abbreviation differs from POSIX standard"
msgstr "l'abbreviazione del fuso orario è diversa dagli standard POSIX"
-#: timezone/zic.c:2635
+#: timezone/zic.c:2639
msgid "too many, or too long, time zone abbreviations"
msgstr "le abbreviazioni del fuso orario sono troppe o troppo lunghe"
-#: timezone/zic.c:2676
+#: timezone/zic.c:2680
#, c-format
msgid "%s: Can't create directory %s: %s\n"
msgstr "%s: impossibile creare la directory %s: %s\n"
-#: timezone/zic.c:2698
+#: timezone/zic.c:2702
#, c-format
msgid "%s: %d did not sign extend correctly\n"
msgstr "%s: %d non ha esteso correttamente il segno\n"
diff --git a/libc/po/ja.po b/libc/po/ja.po
index 394906a62..2188ccf9e 100644
--- a/libc/po/ja.po
+++ b/libc/po/ja.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: libc 2.14\n"
"POT-Creation-Date: 2011-05-31 00:06-0400\n"
-"PO-Revision-Date: 2011-08-28 14:30+0900\n"
+"PO-Revision-Date: 2011-10-08 23:43+0900\n"
"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
"Language: ja\n"
@@ -19,12 +19,12 @@ msgstr ""
#: argp/argp-help.c:228
#, c-format
msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
-msgstr "%.*s: ARGP_HELP_FMT パラメータã«ã¯å€¤ãŒå¿…è¦ã§ã™"
+msgstr "%.*s: ARGP_HELP_FMT パラメーターã«ã¯å€¤ãŒå¿…è¦ã§ã™"
#: argp/argp-help.c:238
#, c-format
msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
-msgstr "%.*s: ä¸æ˜Žãª ARGP_HELP_FMT パラメータã§ã™"
+msgstr "%.*s: ä¸æ˜Žãª ARGP_HELP_FMT パラメーターã§ã™"
#: argp/argp-help.c:251
#, c-format
@@ -98,19 +98,21 @@ msgid "%s%s%s:%u: %s%sUnexpected error: %s.\n"
msgstr "%s%s%s:%u: %s%s予期ã—ãªã„エラーã§ã™: %s。\n"
#: assert/assert.c:105
-#, fuzzy, c-format
+#, c-format
msgid ""
"%s%s%s:%u: %s%sAssertion `%s' failed.\n"
"%n"
-msgstr "%s%s%s:%u: %s%sアサーション `%s' ãŒå¤±æ•—ã—ã¾ã—ãŸã€‚\n"
+msgstr ""
+"%s%s%s:%u: %s%sアサーション `%s' ã«å¤±æ•—ã—ã¾ã—ãŸã€‚\n"
+"%n"
#: catgets/gencat.c:110 catgets/gencat.c:114 nscd/nscd.c:100 nss/makedb.c:61
msgid "NAME"
-msgstr "åå‰"
+msgstr "NAME"
#: catgets/gencat.c:111
msgid "Create C header file NAME containing symbol definitions"
-msgstr "シンボル定義をå«ã‚“ã  C ヘッダファイル NAME を作æˆã™ã‚‹"
+msgstr "シンボル定義をå«ã‚“ã  C ヘッダーファイル NAME を作æˆã™ã‚‹"
#: catgets/gencat.c:113
msgid "Do not use existing catalog, force new output file"
@@ -264,7 +266,7 @@ msgstr "エスケープ文字を決定ã§ãã¾ã›ã‚“"
#: debug/pcprofiledump.c:53
msgid "Don't buffer output"
-msgstr "出力をãƒãƒƒãƒ•ã‚¡ã—ã¾ã›ã‚“"
+msgstr "出力をãƒãƒƒãƒ•ã‚¡ãƒ¼ã—ã¾ã›ã‚“"
#: debug/pcprofiledump.c:58
msgid "Dump information generated by PC profiling."
@@ -282,7 +284,7 @@ msgstr "入力ファイルを開ã‘ã¾ã›ã‚“"
#: debug/pcprofiledump.c:115
#, c-format
msgid "cannot read header"
-msgstr "ヘッダを読ã¿è¾¼ã‚ã¾ã›ã‚“"
+msgstr "ヘッダーを読ã¿è¾¼ã‚ã¾ã›ã‚“"
#: debug/pcprofiledump.c:179
#, c-format
@@ -294,14 +296,12 @@ msgid "Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\\n"
msgstr "使用法: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\\n"
#: debug/xtrace.sh:33 malloc/memusage.sh:27
-#, fuzzy
msgid "Try \\`%s --help' or `%s --usage' for more information.\\n"
-msgstr "詳細㯠`%s --help' ã¾ãŸã¯ `%s --usage' を実行ã—ã¦ä¸‹ã•ã„。\n"
+msgstr "詳細㯠\\`%s --help' ã¾ãŸã¯ `%s --usage' を実行ã—ã¦ãã ã•ã„。\\n"
#: debug/xtrace.sh:39
-#, fuzzy
msgid "%s: option '%s' requires an argument.\\n"
-msgstr "%s: オプション '--%s' ã¯å¼•æ•°ãŒå¿…è¦ã§ã™\n"
+msgstr "%s: オプション '%s' ã¯å¼•æ•°ãŒå¿…è¦ã§ã™ã€‚\\n"
#: debug/xtrace.sh:46
msgid ""
@@ -462,19 +462,19 @@ msgstr "共有ライブラリã®ãƒ­ãƒ¼ãƒ‰ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ"
#: elf/dl-fptr.c:88
msgid "cannot map pages for fdesc table"
-msgstr "ファイル記述å­è¡¨ç”¨ã®ãƒšãƒ¼ã‚¸ã‚’マップ出æ¥ã¾ã›ã‚“"
+msgstr "ãƒ•ã‚¡ã‚¤ãƒ«è¨˜è¿°å­ (fdesc) 表用ã®ãƒšãƒ¼ã‚¸ã‚’マップã§ãã¾ã›ã‚“"
#: elf/dl-fptr.c:192
msgid "cannot map pages for fptr table"
-msgstr "ファイルãƒã‚¤ãƒ³ã‚¿è¡¨ç”¨ã®ãƒšãƒ¼ã‚¸ã‚’マップ出æ¥ã¾ã›ã‚“"
+msgstr "ファイルãƒã‚¤ãƒ³ã‚¿ (fptr) 表用ã®ãƒšãƒ¼ã‚¸ã‚’マップã§ãã¾ã›ã‚“"
#: elf/dl-fptr.c:221
msgid "internal error: symidx out of range of fptr table"
-msgstr "内部エラー: ファイルãƒã‚¤ãƒ³ã‚¿è¡¨ã®ã‚·ãƒ³ãƒœãƒ«ç´¢å¼•ãŒç¯„囲外ã§ã™"
+msgstr "内部エラー: ファイルãƒã‚¤ãƒ³ã‚¿ (fptr) 表ã®ã‚·ãƒ³ãƒœãƒ«ç´¢å¼•ãŒç¯„囲外ã§ã™"
#: elf/dl-load.c:471
msgid "cannot allocate name record"
-msgstr "åå‰ãƒ¬ã‚³ãƒ¼ãƒ‰ã‚’é…置出æ¥ã¾ã›ã‚“"
+msgstr "åå‰ãƒ¬ã‚³ãƒ¼ãƒ‰ã‚’é…ç½®ã§ãã¾ã›ã‚“"
#: elf/dl-load.c:548 elf/dl-load.c:664 elf/dl-load.c:749 elf/dl-load.c:862
msgid "cannot create cache for search path"
@@ -490,7 +490,7 @@ msgstr "探索パスé…列を作æˆã§ãã¾ã›ã‚“"
#: elf/dl-load.c:931
msgid "cannot stat shared object"
-msgstr "共有オブジェクトã®çŠ¶æ…‹å–å¾— (stat) ãŒå‡ºæ¥ã¾ã›ã‚“"
+msgstr "共有オブジェクトã®çŠ¶æ…‹å–å¾— (stat) ãŒã§ãã¾ã›ã‚“"
#: elf/dl-load.c:1009
msgid "cannot open zero fill device"
@@ -514,7 +514,7 @@ msgstr "ELF ロードコマンドã®ã‚¢ãƒ‰ãƒ¬ã‚¹/オフセットãŒé©åˆ‡ã«æ•´å
#: elf/dl-load.c:1210
msgid "cannot allocate TLS data structures for initial thread"
-msgstr "åˆæœŸã‚¹ãƒ¬ãƒƒãƒ‰ç”¨ã® TLS データ構造体ãŒé…置出æ¥ã¾ã›ã‚“"
+msgstr "åˆæœŸã‚¹ãƒ¬ãƒƒãƒ‰ç”¨ã® TLS データ構造体ãŒé…ç½®ã§ãã¾ã›ã‚“"
#: elf/dl-load.c:1233
msgid "cannot handle TLS data"
@@ -550,7 +550,7 @@ msgstr "共有オブジェクト㯠dlopen() ã§ãã¾ã›ã‚“"
#: elf/dl-load.c:1445
msgid "cannot allocate memory for program header"
-msgstr "プログラムヘッダ用ã®ãƒ¡ãƒ¢ãƒªã‚’é…置出æ¥ã¾ã›ã‚“"
+msgstr "プログラムヘッダー用ã®ãƒ¡ãƒ¢ãƒªã‚’é…ç½®ã§ãã¾ã›ã‚“"
#: elf/dl-load.c:1462 elf/dl-open.c:180
msgid "invalid caller"
@@ -570,7 +570,7 @@ msgstr "ファイルãŒå°ã•ã™ãŽã¾ã™"
#: elf/dl-load.c:1766
msgid "invalid ELF header"
-msgstr "無効㪠ELF ヘッダã§ã™"
+msgstr "無効㪠ELF ヘッダーã§ã™"
#: elf/dl-load.c:1778
msgid "ELF file data encoding not big-endian"
@@ -641,9 +641,8 @@ msgid "TLS generation counter wrapped! Please report this."
msgstr "TLS 生æˆã‚«ã‚¦ãƒ³ã‚¿ãŒä¸€å‘¨ã—ã¾ã—ãŸ! ã“れを報告ã—ã¦ãã ã•ã„。"
#: elf/dl-open.c:462
-#, fuzzy
msgid "cannot load any more object with static TLS"
-msgstr "é™çš„ TLS ブロック内ã«ãƒ¡ãƒ¢ãƒªã‚’é…置出æ¥ã¾ã›ã‚“"
+msgstr "é™çš„ TLS ブロックã§ã¯ã“れ以上オブジェクトをロードã§ãã¾ã›ã‚“"
#: elf/dl-open.c:511
msgid "invalid mode for dlopen()"
@@ -689,7 +688,7 @@ msgstr "コード内ã§ä½¿ç”¨ã•ã‚Œã¦ã„ã‚‹ RTLD_NEXT ã‚’å‹•çš„ã«ãƒ­ãƒ¼ãƒ‰å‡ºæ
#: elf/dl-sysdep.c:488 elf/dl-sysdep.c:500
msgid "cannot create capability list"
-msgstr "能力リストを作æˆã§ãã¾ã›ã‚“"
+msgstr "権é™ãƒªã‚¹ãƒˆã‚’作æˆã§ãã¾ã›ã‚“"
#: elf/dl-tls.c:861
msgid "cannot create TLS data structures"
@@ -1095,6 +1094,17 @@ msgid ""
" --help print this help and exit\n"
" --version print version information and exit"
msgstr ""
+"Usage: sotruss [OPTION...] [--] EXECUTABLE [EXECUTABLE-OPTION...]\n"
+" -F, --from FROMLIST FORMLIST ã®ã‚ªãƒ–ジェクトã‹ã‚‰ã®å‘¼ã³å‡ºã—をトレースã™ã‚‹\n"
+" -T, --to TOLIST TOLIST ã®ã‚ªãƒ–ジェクトã¸ã®å‘¼ã³å‡ºã—をトレースã™ã‚‹\n"
+"\n"
+" -e, --exit 関数呼ã³å‡ºã—ã‹ã‚‰ã®çµ‚了も表示ã™ã‚‹\n"
+" -f, --follow å­ãƒ—ロセスもトレースã™ã‚‹\n"
+" -o, --output FILENAME 出力を標準出力ã®ä»£ã‚ã‚Šã« FILENAME (-f も使用ã•ã‚ŒãŸ\n"
+"\t\t\t å ´åˆã¯ FILENAME.$PID) ã¸æ›¸ã込む\n"
+"\n"
+" --help ã“ã®ãƒ˜ãƒ«ãƒ—メッセージを表示ã—ã¦çµ‚了ã™ã‚‹\n"
+" --version ãƒãƒ¼ã‚¸ãƒ§ãƒ³æƒ…報を表示ã—ã¦çµ‚了ã™ã‚‹"
#: elf/sotruss.ksh:46
msgid "Mandatory arguments to long options are also mandatory for any corresponding\\nshort options.\\n"
@@ -1170,12 +1180,12 @@ msgstr "共有オブジェクト `%s' ã®å†ã‚ªãƒ¼ãƒ—ンã«å¤±æ•—ã—ã¾ã—ãŸ"
#: elf/sprof.c:566 elf/sprof.c:660
#, c-format
msgid "reading of section headers failed"
-msgstr "セクションヘッダã®èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ"
+msgstr "セクションヘッダーã®èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: elf/sprof.c:574 elf/sprof.c:668
#, c-format
msgid "reading of section header string table failed"
-msgstr "セクションヘッダ文字列表ã®èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ"
+msgstr "セクションヘッダー文字列表ã®èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: elf/sprof.c:600
#, c-format
@@ -1190,7 +1200,7 @@ msgstr "ファイルåを決定ã§ãã¾ã›ã‚“"
#: elf/sprof.c:653
#, c-format
msgid "reading of ELF header failed"
-msgstr "ELF ヘッダã®èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ"
+msgstr "ELF ヘッダーã®èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: elf/sprof.c:689
#, c-format
@@ -2628,7 +2638,7 @@ msgid "cannot write output files to `%s'"
msgstr "出力ファイル `%s' ã¸æ›¸ãè¾¼ã‚ã¾ã›ã‚“"
#: locale/programs/localedef.c:366
-#, fuzzy, c-format
+#, c-format
msgid ""
"System's directory for character maps : %s\n"
"\t\t repertoire maps: %s\n"
@@ -2669,7 +2679,7 @@ msgstr "書庫ファイルã®ã‚µã‚¤ã‚ºå¤‰æ›´ã¯å‡ºæ¥ã¾ã›ã‚“"
#: locale/programs/locarchive.c:633
#, c-format
msgid "cannot map archive header"
-msgstr "書庫ヘッダをマップ出æ¥ã¾ã›ã‚“"
+msgstr "書庫ヘッダーをマップ出æ¥ã¾ã›ã‚“"
#: locale/programs/locarchive.c:174
#, c-format
@@ -2729,7 +2739,7 @@ msgstr "ロケール書庫 \"%s\" をロックã§ãã¾ã›ã‚“"
#: locale/programs/locarchive.c:605
#, c-format
msgid "cannot read archive header"
-msgstr "書庫ヘッダを読ã¿è¾¼ã‚ã¾ã›ã‚“"
+msgstr "書庫ヘッダーを読ã¿è¾¼ã‚ã¾ã›ã‚“"
#: locale/programs/locarchive.c:680
#, c-format
@@ -2847,7 +2857,7 @@ msgstr "レパートリマップファイル `%s' ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“"
#: login/programs/pt_chown.c:78
#, c-format
msgid "Set the owner, group and access permission of the slave pseudo terminal corresponding to the master pseudo terminal passed on file descriptor `%d'. This is the helper program for the `grantpt' function. It is not intended to be run directly from the command line.\n"
-msgstr ""
+msgstr "スレーブ疑似端末ã®æ‰€æœ‰è€…ã€ã‚°ãƒ«ãƒ¼ãƒ—ã€ã‚¢ã‚¯ã‚»ã‚¹æ¨©ã‚’ã€ãƒ•ã‚¡ã‚¤ãƒ«è¨˜è¿°å­ `%d' ã¨ã—ã¦æ¸¡ã•ã‚ŒãŸãƒžã‚¹ã‚¿ãƒ¼ç–‘似端末ã«åˆã‚ã›ã¦è¨­å®šã—ã¾ã™ã€‚ã“れ㯠`grantpt' 関数用ã®è£œåŠ©ãƒ—ログラムã§ã™ã€‚コマンドラインã‹ã‚‰ç›´æŽ¥å®Ÿè¡Œã™ã‚‹ã‚ˆã†ã«ã¯æ„図ã•ã‚Œã¦ã„ã¾ã›ã‚“。\n"
#: login/programs/pt_chown.c:88
#, c-format
@@ -3034,7 +3044,7 @@ msgstr "キャッシュãŒç ´æ£„ã•ã‚Œã¾ã—ãŸ"
#: nis/nis_error.h:6
msgid "NIS+ servers unreachable"
-msgstr "NIS+ サーãƒã«åˆ°é”ã—ã¾ã›ã‚“"
+msgstr "NIS+ サーãƒãƒ¼ã«åˆ°é”ã—ã¾ã›ã‚“"
#: nis/nis_error.h:7
msgid "Unknown object"
@@ -3042,7 +3052,7 @@ msgstr "ä¸æ˜Žãªã‚ªãƒ–ジェクトã§ã™"
#: nis/nis_error.h:8
msgid "Server busy, try again"
-msgstr "サーãƒãŒãƒ“ジー状態ã§ã™ã€‚å†è©¦è¡Œã—ã¦ãã ã•ã„"
+msgstr "サーãƒãƒ¼ãŒãƒ“ジー状態ã§ã™ã€‚å†è©¦è¡Œã—ã¦ãã ã•ã„"
#: nis/nis_error.h:9
msgid "Generic system error"
@@ -3067,7 +3077,7 @@ msgstr "åå‰ã¯ã“ã®ã‚µãƒ¼ãƒãƒ¼ã§ç®¡ç†ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: nis/nis_error.h:14
msgid "Server out of memory"
-msgstr "サーãƒã®ãƒ¡ãƒ¢ãƒªãŒè¶³ã‚Šã¾ã›ã‚“"
+msgstr "サーãƒãƒ¼ã®ãƒ¡ãƒ¢ãƒªãŒè¶³ã‚Šã¾ã›ã‚“"
#: nis/nis_error.h:15
msgid "Object with same name exists"
@@ -3075,7 +3085,7 @@ msgstr "åŒã˜åå‰ã‚’æŒã¤ã‚ªãƒ–ジェクトãŒå­˜åœ¨ã—ã¾ã™"
#: nis/nis_error.h:16
msgid "Not master server for this domain"
-msgstr "ã“ã®ãƒ‰ãƒ¡ã‚¤ãƒ³ã®ãƒžã‚¹ã‚¿ãƒ¼ã‚µãƒ¼ãƒã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "ã“ã®ãƒ‰ãƒ¡ã‚¤ãƒ³ã®ãƒžã‚¹ã‚¿ãƒ¼ã‚µãƒ¼ãƒãƒ¼ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: nis/nis_error.h:17
msgid "Invalid object for operation"
@@ -3151,7 +3161,7 @@ msgstr "æ“作ã«å¯¾ã™ã‚‹ä¸æ­£ãªã‚ªãƒ–ジェクト型ã§ã™"
#: nis/nis_error.h:35
msgid "Passed object is not the same object on server"
-msgstr "渡ã•ã‚ŒãŸã‚ªãƒ–ジェクトã¯ã‚µãƒ¼ãƒä¸Šã®ã‚ªãƒ–ジェクトã¨åŒã˜ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "渡ã•ã‚ŒãŸã‚ªãƒ–ジェクトã¯ã‚µãƒ¼ãƒãƒ¼ä¸Šã®ã‚ªãƒ–ジェクトã¨åŒã˜ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: nis/nis_error.h:36
msgid "Modify operation failed"
@@ -3187,7 +3197,7 @@ msgstr "ã¯ã„ã€42ã¯ç”Ÿå­˜æœŸé–“ã®å¹³å‡ã§ã™"
#: nis/nis_error.h:44
msgid "Unable to authenticate NIS+ server"
-msgstr "NIS+ サーãƒã‚’èªè¨¼ã§ãã¾ã›ã‚“"
+msgstr "NIS+ サーãƒãƒ¼ã‚’èªè¨¼ã§ãã¾ã›ã‚“"
#: nis/nis_error.h:45
msgid "Unable to authenticate NIS+ client"
@@ -3195,15 +3205,15 @@ msgstr "NIS+ クライアントをèªè¨¼ã§ãã¾ã›ã‚“"
#: nis/nis_error.h:46
msgid "No file space on server"
-msgstr "サーãƒã«ãƒ•ã‚¡ã‚¤ãƒ«ç”¨ã®é ˜åŸŸãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "サーãƒãƒ¼ã«ãƒ•ã‚¡ã‚¤ãƒ«ç”¨ã®é ˜åŸŸãŒã‚ã‚Šã¾ã›ã‚“"
#: nis/nis_error.h:47
msgid "Unable to create process on server"
-msgstr "サーãƒä¸Šã«ãƒ—ロセスを作æˆã§ãã¾ã›ã‚“"
+msgstr "サーãƒãƒ¼ä¸Šã«ãƒ—ロセスを作æˆã§ãã¾ã›ã‚“"
#: nis/nis_error.h:48
msgid "Master server busy, full dump rescheduled."
-msgstr "マスターサーãƒãŒãƒ“ジーã§ã™ã€ãƒ•ãƒ«ãƒ€ãƒ³ãƒ—ã¯å†ã‚¹ã‚±ã‚¸ãƒ¥ãƒ¼ãƒ«ã•ã‚Œã¾ã—ãŸã€‚"
+msgstr "マスターサーãƒãƒ¼ãŒãƒ“ジーã§ã™ã€ãƒ•ãƒ«ãƒ€ãƒ³ãƒ—ã¯å†ã‚¹ã‚±ã‚¸ãƒ¥ãƒ¼ãƒ«ã•ã‚Œã¾ã—ãŸã€‚"
#: nis/nis_local_names.c:122
#, c-format
@@ -3262,7 +3272,7 @@ msgstr "åž‹ : %s\n"
#: nis/nis_print.c:173
msgid "Master Server :\n"
-msgstr "マスターサーãƒ:\n"
+msgstr "マスターサーãƒãƒ¼:\n"
#: nis/nis_print.c:175
msgid "Replicate :\n"
@@ -3566,11 +3576,11 @@ msgstr "NIS æ“作ã«é–¢ã™ã‚‹ RPC ãŒå¤±æ•—ã—ã¾ã—ãŸ"
#: nis/ypclnt.c:842
msgid "Can't bind to server which serves this domain"
-msgstr "ã“ã®ãƒ‰ãƒ¡ã‚¤ãƒ³ã‚’扱ã†ã‚µãƒ¼ãƒã¸ãƒã‚¤ãƒ³ãƒ‰ã§ãã¾ã›ã‚“"
+msgstr "ã“ã®ãƒ‰ãƒ¡ã‚¤ãƒ³ã‚’扱ã†ã‚µãƒ¼ãƒãƒ¼ã¸ãƒã‚¤ãƒ³ãƒ‰ã§ãã¾ã›ã‚“"
#: nis/ypclnt.c:845
msgid "No such map in server's domain"
-msgstr "サーãƒãƒ‰ãƒ¡ã‚¤ãƒ³ã«ãã®ã‚ˆã†ãªãƒžãƒƒãƒ—ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "サーãƒãƒ¼ãƒ‰ãƒ¡ã‚¤ãƒ³ã«ãã®ã‚ˆã†ãªãƒžãƒƒãƒ—ã¯ã‚ã‚Šã¾ã›ã‚“"
#: nis/ypclnt.c:848
msgid "No such key in map"
@@ -3610,7 +3620,7 @@ msgstr "NIS マップデータベースãŒé–“é•ã£ã¦ã„ã¾ã™"
#: nis/ypclnt.c:875
msgid "NIS client/server version mismatch - can't supply service"
-msgstr "NIS クライアントã¨ã‚µãƒ¼ãƒã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒä¸€è‡´ã—ã¾ã›ã‚“。サービスをæä¾›ã§ãã¾ã›ã‚“"
+msgstr "NIS クライアントã¨ã‚µãƒ¼ãƒãƒ¼ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒä¸€è‡´ã—ã¾ã›ã‚“。サービスをæä¾›ã§ãã¾ã›ã‚“"
#: nis/ypclnt.c:881
msgid "Database is busy"
@@ -3642,7 +3652,7 @@ msgstr "yp_update: ホストをãƒãƒƒãƒˆåã¸å¤‰æ›ã§ãã¾ã›ã‚“\n"
#: nis/ypclnt.c:992
msgid "yp_update: cannot get server address\n"
-msgstr "yp_update: サーãƒã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾—ã§ãã¾ã›ã‚“\n"
+msgstr "yp_update: サーãƒãƒ¼ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’å–å¾—ã§ãã¾ã›ã‚“\n"
#: nscd/aicache.c:83 nscd/hstcache.c:492
#, c-format
@@ -3671,7 +3681,7 @@ msgstr "ファイル `%s' ã‚’ stat() ã§ãã¾ã›ã‚“: %s"
#: nscd/cache.c:318
#, c-format
msgid "pruning %s cache; time %ld"
-msgstr ""
+msgstr "%s キャッシュを切り詰ã‚ã¦ã„ã¾ã™ã€‚時間 %ld"
#: nscd/cache.c:347
#, c-format
@@ -3685,11 +3695,11 @@ msgstr "無効ãªæ°¸ç¶šçš„データベースファイル \"%s\" ã§ã™: %s"
#: nscd/connections.c:573
msgid "uninitialized header"
-msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„ヘッダã§ã™"
+msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„ヘッダーã§ã™"
#: nscd/connections.c:578
msgid "header size does not match"
-msgstr "ヘッダサイズãŒä¸€è‡´ã—ã¾ã›ã‚“"
+msgstr "ヘッダーサイズãŒä¸€è‡´ã—ã¾ã›ã‚“"
#: nscd/connections.c:588
msgid "file size does not match"
@@ -3737,7 +3747,7 @@ msgstr "データベースファイル %s ã¸æ›¸ãè¾¼ã‚ã¾ã›ã‚“: %s"
#: nscd/connections.c:814
#, c-format
msgid "cannot set socket to close on exec: %s; disabling paranoia mode"
-msgstr ""
+msgstr "ソケットを実行時ã«é–‰ã˜ã‚‹ã‚ˆã†ã«è¨­å®šã§ãã¾ã›ã‚“: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/connections.c:897
#, c-format
@@ -3752,7 +3762,7 @@ msgstr "ソケットをéžãƒ–ロッキングモードã«å¤‰æ›´ã§ãã¾ã›ã‚“: %
#: nscd/connections.c:925
#, c-format
msgid "cannot set socket to close on exec: %s"
-msgstr ""
+msgstr "ソケットを実行時ã«é–‰ã˜ã‚‹ã‚ˆã†ã«è¨­å®šã§ãã¾ã›ã‚“: %s"
#: nscd/connections.c:938
#, c-format
@@ -3762,7 +3772,7 @@ msgstr "接続をå—ã‘付ã‘るソケットを有効ã«ã§ãã¾ã›ã‚“: %s"
#: nscd/connections.c:1039
#, c-format
msgid "provide access to FD %d, for %s"
-msgstr ""
+msgstr "ãƒ•ã‚¡ã‚¤ãƒ«è¨˜è¿°å­ %d ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã‚’æä¾›ã—ã¾ã™ (%s 用)"
#: nscd/connections.c:1051
#, c-format
@@ -3796,32 +3806,32 @@ msgstr "呼ã³å‡ºã—å…ƒ ID ã®å–得時ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: %s"
#: nscd/connections.c:1316
#, c-format
msgid "cannot open /proc/self/cmdline: %s; disabling paranoia mode"
-msgstr ""
+msgstr "/proc/self/cmdline ã‚’é–‹ã‘ã¾ã›ã‚“: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/connections.c:1330
#, c-format
msgid "cannot read /proc/self/cmdline: %s; disabling paranoia mode"
-msgstr ""
+msgstr "/proc/self/cmdline を読ã¿è¾¼ã‚ã¾ã›ã‚“: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/connections.c:1370
#, c-format
msgid "cannot change to old UID: %s; disabling paranoia mode"
-msgstr ""
+msgstr "å¤ã„ UID ã¸å¤‰æ›´ã§ãã¾ã›ã‚“: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/connections.c:1380
#, c-format
msgid "cannot change to old GID: %s; disabling paranoia mode"
-msgstr ""
+msgstr "å¤ã„ GID ã«å¤‰æ›´ã§ãã¾ã›ã‚“: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/connections.c:1393
#, c-format
msgid "cannot change to old working directory: %s; disabling paranoia mode"
-msgstr ""
+msgstr "å¤ã„作業ディレクトリã«ç§»å‹•ã§ãã¾ã›ã‚“: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/connections.c:1439
#, c-format
msgid "re-exec failed: %s; disabling paranoia mode"
-msgstr ""
+msgstr "å†å®Ÿè¡Œã«å¤±æ•—ã—ã¾ã—ãŸ: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/connections.c:1448
#, c-format
@@ -3831,27 +3841,27 @@ msgstr "ç¾åœ¨ã®ä½œæ¥­ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’ \"/\" ã«å¤‰æ›´ã§ãã¾ã›ã‚“: %s"
#: nscd/connections.c:1641
#, c-format
msgid "short read while reading request: %s"
-msgstr "リクエスト: %s を読込ã¿ä¸­ã®çŸ­ã„読込ã¿ã§ã™"
+msgstr "読ã¿è¾¼ã¿è¦æ±‚より短ã„読ã¿è¾¼ã¿ã§ã™: %s"
#: nscd/connections.c:1674
#, c-format
msgid "key length in request too long: %d"
-msgstr "リクエストã«å«ã¾ã‚Œã‚‹ã‚­ãƒ¼é•·ãŒé•·ã™ãŽã¾ã™: %d"
+msgstr "è¦æ±‚ã«å«ã¾ã‚Œã‚‹ã‚­ãƒ¼é•·ãŒé•·ã™ãŽã¾ã™: %d"
#: nscd/connections.c:1687
#, c-format
msgid "short read while reading request key: %s"
-msgstr "リクエストキー: %s を読込ã¿ä¸­ã®çŸ­ã„読込ã¿ã§ã™"
+msgstr "è¦æ±‚キーã®èª­ã¿è¾¼ã¿ã‚ˆã‚ŠçŸ­ã„読ã¿è¾¼ã¿ã§ã™: %s"
#: nscd/connections.c:1696
#, c-format
msgid "handle_request: request received (Version = %d) from PID %ld"
-msgstr "handle_request: リクエストãŒåˆ°ç€ (ãƒãƒ¼ã‚¸ãƒ§ãƒ³ = %d) é€ä¿¡PID %ld"
+msgstr "handle_request: è¦æ±‚ã‚’å—ã‘å–ã‚Šã¾ã—㟠(ãƒãƒ¼ã‚¸ãƒ§ãƒ³ = %d) é€ä¿¡PID %ld"
#: nscd/connections.c:1701
#, c-format
msgid "handle_request: request received (Version = %d)"
-msgstr "handle_request: è¦æ±‚ãŒåˆ°ç€ (ãƒãƒ¼ã‚¸ãƒ§ãƒ³ = %d)"
+msgstr "handle_request: è¦æ±‚ã‚’å—ã‘å–ã‚Šã¾ã—㟠(ãƒãƒ¼ã‚¸ãƒ§ãƒ³ = %d)"
#: nscd/connections.c:1901 nscd/connections.c:2099
#, c-format
@@ -3860,11 +3870,11 @@ msgstr "読ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ %d ãŒç™ºç”Ÿã—ãŸãŸã‚ inotify を無効ã«ã—ã
#: nscd/connections.c:2228
msgid "could not initialize conditional variable"
-msgstr ""
+msgstr "æ¡ä»¶å¤‰æ•°ã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“ã§ã—ãŸ"
#: nscd/connections.c:2236
msgid "could not start clean-up thread; terminating"
-msgstr ""
+msgstr "クリーンアップスレッドを開始ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚終了ã—ã¾ã™"
#: nscd/connections.c:2250
msgid "could not start any worker thread; terminating"
@@ -3875,7 +3885,7 @@ msgstr "作業スレッドを全ã開始ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚終了ã—ã¾
#: nscd/connections.c:2368
#, c-format
msgid "Failed to run nscd as user '%s'"
-msgstr "ユーザ '%s' 㧠nscd を実行ã™ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—ãŸ"
+msgstr "ユーザー '%s' 㧠nscd を実行ã™ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: nscd/connections.c:2320
#, c-format
@@ -3941,7 +3951,7 @@ msgstr "NUMBERスレッドã§èµ·å‹•ã™ã‚‹"
#: nscd/nscd.c:105
msgid "Shut the server down"
-msgstr "サーãƒã‚’終了ã™ã‚‹"
+msgstr "サーãƒãƒ¼ã‚’終了ã™ã‚‹"
#: nscd/nscd.c:106
msgid "Print current configuration statistics"
@@ -4064,7 +4074,7 @@ msgstr "ä¸æ˜Žãªã‚ªãƒ—ションã§ã™: %s %s %s"
#: nscd/nscd_conf.c:287
#, c-format
msgid "cannot get current working directory: %s; disabling paranoia mode"
-msgstr ""
+msgstr "ç¾åœ¨ã®ä½œæ¥­ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãƒ¼ã‚’å–å¾—ã§ãã¾ã›ã‚“: %s; paranoia モードを無効ã«ã—ã¦ã„ã¾ã™"
#: nscd/nscd_conf.c:307
#, c-format
@@ -4108,30 +4118,30 @@ msgid ""
msgstr ""
"nscd 設定:\n"
"\n"
-"%15d サーãƒãƒ‡ãƒãƒƒã‚°ãƒ¬ãƒ™ãƒ«\n"
+"%15d サーãƒãƒ¼ãƒ‡ãƒãƒƒã‚°ãƒ¬ãƒ™ãƒ«\n"
#: nscd/nscd_stat.c:232
#, c-format
msgid "%3ud %2uh %2um %2lus server runtime\n"
-msgstr "%3ud %2uh %2um %2lus サーム実行時間\n"
+msgstr "%3ud %2uh %2um %2lus サーãƒãƒ¼ 実行時間\n"
#: nscd/nscd_stat.c:235
#, c-format
msgid " %2uh %2um %2lus server runtime\n"
-msgstr " %2uh %2um %2lus サーム実行時間\n"
+msgstr " %2uh %2um %2lus サーãƒãƒ¼ 実行時間\n"
#: nscd/nscd_stat.c:237
#, c-format
msgid " %2um %2lus server runtime\n"
-msgstr " %2um %2lus サーム実行時間\n"
+msgstr " %2um %2lus サーãƒãƒ¼ 実行時間\n"
#: nscd/nscd_stat.c:239
#, c-format
msgid " %2lus server runtime\n"
-msgstr " %2lus サーム実行時間\n"
+msgstr " %2lus サーãƒãƒ¼ 実行時間\n"
#: nscd/nscd_stat.c:241
-#, fuzzy, c-format
+#, c-format
msgid ""
"%15d current number of threads\n"
"%15d maximum number of threads\n"
@@ -4143,8 +4153,9 @@ msgstr ""
"%15d ç¾åœ¨ã®ã‚¹ãƒ¬ãƒƒãƒ‰æ•°\n"
"%15d 最大スレッド数\n"
"%15lu クライアントãŒå¾…æ©Ÿã—ãªã‘ã‚Œã°ãªã‚‰ãªã‹ã£ãŸå›žæ•°\n"
-"%15s paranoia mode enabled\n"
+"%15s paranoia モードãŒæœ‰åŠ¹ã‹ã©ã†ã‹\n"
"%15lu 内部å†èµ·å‹•\n"
+"%15u å†èµ·å‹•å›žæ•°\n"
#: nscd/nscd_stat.c:276
#, c-format
@@ -4176,26 +4187,26 @@ msgstr ""
"\n"
"%s キャッシュ:\n"
"\n"
-"%15s cache is enabled\n"
-"%15s cache is persistent\n"
-"%15s cache is shared\n"
-"%15zu suggested size\n"
-"%15zu total data pool size\n"
-"%15zu used data pool size\n"
-"%15lu seconds time to live for positive entries\n"
-"%15lu seconds time to live for negative entries\n"
-"%15<PRIuMAX> cache hits on positive entries\n"
-"%15<PRIuMAX> cache hits on negative entries\n"
-"%15<PRIuMAX> cache misses on positive entries\n"
-"%15<PRIuMAX> cache misses on negative entries\n"
-"%15lu%% cache hit rate\n"
-"%15zu current number of cached values\n"
-"%15zu maximum number of cached values\n"
-"%15zu maximum chain length searched\n"
-"%15<PRIuMAX> number of delays on rdlock\n"
-"%15<PRIuMAX> number of delays on wrlock\n"
-"%15<PRIuMAX> memory allocations failed\n"
-"%15s check /etc/%s for changes\n"
+"%15s キャッシュãŒæœ‰åŠ¹\n"
+"%15s キャッシュãŒæ°¸ç¶šçš„\n"
+"%15s キャッシュãŒå…±æœ‰ã•ã‚Œã¦ã„ã‚‹\n"
+"%15zu æ案ã•ã‚Œã‚‹ã‚µã‚¤ã‚º\n"
+"%15zu 全データプールサイズ\n"
+"%15zu 使用中ã®ãƒ‡ãƒ¼ã‚¿ãƒ—ールサイズ\n"
+"%15lu æ­£ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥ä¿æŒç§’æ•°\n"
+"%15lu è² ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥ä¿æŒç§’æ•°\n"
+"%15<PRIuMAX> æ­£ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥ãƒ’ット\n"
+"%15<PRIuMAX> è² ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥ãƒ’ット\n"
+"%15<PRIuMAX> æ­£ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥ãƒŸã‚¹\n"
+"%15<PRIuMAX> è² ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥ãƒŸã‚¹\n"
+"%15lu%% キャッシュヒット率\n"
+"%15zu ç¾åœ¨ã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥å€‹æ•°\n"
+"%15zu 最大ã®ã‚­ãƒ£ãƒƒã‚·ãƒ¥å€‹æ•°\n"
+"%15zu 検索ã•ã‚Œã‚‹æœ€å¤§é€£éŽ–é•·\n"
+"%15<PRIuMAX> rdlock ã®é…延数\n"
+"%15<PRIuMAX> wrlock ã®é…延数\n"
+"%15<PRIuMAX> メモリ割り当ã¦å¤±æ•—\n"
+"%15s 変更ã«é–¢ã—ã¦ã¯ /etc/%s を確èªã—ã¦ãã ã•ã„\n"
#: nscd/pwdcache.c:423
#, c-format
@@ -4228,7 +4239,7 @@ msgstr "prctl(KEEPCAPS) ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: nscd/selinux.c:192
msgid "Failed to initialize drop of capabilities"
-msgstr ""
+msgstr "権é™ã‚’å–り除ã„ã¦åˆæœŸåŒ–ã™ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: nscd/selinux.c:193
#, c-format
@@ -4237,7 +4248,7 @@ msgstr "cap_init ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: nscd/selinux.c:214 nscd/selinux.c:231
msgid "Failed to drop capabilities"
-msgstr ""
+msgstr "権é™ã‚’å–り除ãã®ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: nscd/selinux.c:215 nscd/selinux.c:232
#, c-format
@@ -4273,7 +4284,7 @@ msgstr "Access Vector Cache (AVC) ãŒé–‹å§‹ã•ã‚Œã¾ã—ãŸ"
#: nscd/selinux.c:356
msgid "Error getting context of socket peer"
-msgstr ""
+msgstr "ソケット対å‘ã®ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆå–得中ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ"
#: nscd/selinux.c:361
msgid "Error getting context of nscd"
@@ -4334,11 +4345,11 @@ msgstr "使用ã•ã‚Œã‚‹ã‚µãƒ¼ãƒ“ス設定"
#: nss/getent.c:60
msgid "disable IDN encoding"
-msgstr ""
+msgstr "IDN エンコーディングを無効ã«ã™ã‚‹"
#: nss/getent.c:65
msgid "Get entries from administrative database."
-msgstr "管ç†ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‹ã‚‰ã‚¨ãƒ³ãƒˆãƒªã‚’å–å¾—ã™ã‚‹"
+msgstr "管ç†ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‹ã‚‰ã‚¨ãƒ³ãƒˆãƒªã‚’å–å¾—ã—ã¾ã™ã€‚"
#: nss/getent.c:149 nss/getent.c:479
#, c-format
@@ -4439,6 +4450,12 @@ msgid ""
"environment SPEC.\n"
"\n"
msgstr ""
+"使用法: getconf [-v SPEC] VAR\n"
+"ã¾ãŸã¯: getconf [-v SPEC] PATH_VAR PATH\n"
+"\n"
+"変数 VAR (ã¾ãŸã¯ PATH ã®å¤‰æ•° PATH_VAR) ã®è¨­å®šå€¤ã‚’å–å¾—ã—ã¾ã™ã€‚\n"
+"SPEC ãŒæŒ‡å®šã•ã‚ŒãŸå ´åˆã€ã‚³ãƒ³ãƒ‘イル環境 SPEC ã®å€¤ã‚’å–å¾—ã—ã¾ã™ã€‚\n"
+"\n"
#: posix/getconf.c:1173
#, c-format
@@ -4460,9 +4477,9 @@ msgid "Unrecognized variable `%s'"
msgstr "èªè­˜ã§ããªã„変数 `%s' ã§ã™"
#: posix/getopt.c:594 posix/getopt.c:623
-#, fuzzy, c-format
+#, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
-msgstr "%s: オプション '%s' ã¯æ›–昧ã§ã™\n"
+msgstr "%s: オプション '%s' ã¯æ›–昧ã§ã™:次ã®ã‚‚ã®ãŒå¯èƒ½ã§ã™:"
#: posix/getopt.c:664 posix/getopt.c:668
#, c-format
@@ -4475,7 +4492,7 @@ msgid "%s: option '%c%s' doesn't allow an argument\n"
msgstr "%s: オプション '%c%s' ã¯å¼•æ•°ã‚’å–ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“\n"
#: posix/getopt.c:725 posix/getopt.c:744
-#, fuzzy, c-format
+#, c-format
msgid "%s: option '--%s' requires an argument\n"
msgstr "%s: オプション '--%s' ã¯å¼•æ•°ãŒå¿…è¦ã§ã™\n"
@@ -4511,9 +4528,9 @@ msgid "%s: option '-W %s' doesn't allow an argument\n"
msgstr "%s: オプション '-W %s' ã¯å¼•æ•°ã‚’å–ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“\n"
#: posix/getopt.c:1050 posix/getopt.c:1068
-#, fuzzy, c-format
+#, c-format
msgid "%s: option '-W %s' requires an argument\n"
-msgstr "%s: オプション '--%s' ã¯å¼•æ•°ãŒå¿…è¦ã§ã™\n"
+msgstr "%s: オプション '-W %s' ã¯å¼•æ•°ãŒå¿…è¦ã§ã™\n"
#: posix/regcomp.c:135
msgid "No match"
@@ -4601,7 +4618,7 @@ msgstr "ホストåã®è§£æ±ºã«å¤±æ•—ã—ã¾ã—ãŸ"
#: resolv/herror.c:71
msgid "Unknown server error"
-msgstr "ä¸æ˜Žãªã‚µãƒ¼ãƒã‚¨ãƒ©ãƒ¼ã§ã™"
+msgstr "ä¸æ˜Žãªã‚µãƒ¼ãƒãƒ¼ã‚¨ãƒ©ãƒ¼ã§ã™"
#: resolv/herror.c:72
msgid "No address associated with name"
@@ -4641,200 +4658,180 @@ msgid "%s: line %d: ignoring trailing garbage `%s'\n"
msgstr "%s: è¡Œ %d: 後ã«æ®‹ã£ãŸã‚´ãƒŸ `%s' を無視ã—ã¾ã™\n"
#: stdio-common/psiginfo-data.h:2
-#, fuzzy
msgid "Illegal opcode"
-msgstr "ä¸æ­£ãªã‚·ãƒ¼ã‚¯ã§ã™"
+msgstr "ä¸æ­£ãªå‘½ä»¤ã‚³ãƒ¼ãƒ‰ã§ã™"
#: stdio-common/psiginfo-data.h:3
-#, fuzzy
msgid "Illegal operand"
-msgstr "ä¸æ­£ãªã‚·ãƒ¼ã‚¯ã§ã™"
+msgstr "ä¸æ­£ãªå‘½ä»¤è¢«æ¼”ç®—å­ã§ã™"
#: stdio-common/psiginfo-data.h:4
msgid "Illegal addressing mode"
-msgstr ""
+msgstr "ä¸æ­£ãªã‚¢ãƒ‰ãƒ¬ãƒƒã‚·ãƒ³ã‚°ãƒ¢ãƒ¼ãƒ‰ã§ã™"
#: stdio-common/psiginfo-data.h:5
-#, fuzzy
msgid "Illegal trap"
-msgstr "ä¸æ­£ãªã‚·ãƒ¼ã‚¯ã§ã™"
+msgstr "ä¸æ­£ãªãƒˆãƒ©ãƒƒãƒ—ã§ã™"
#: stdio-common/psiginfo-data.h:6
msgid "Privileged opcode"
-msgstr ""
+msgstr "特権命令コードã§ã™"
#: stdio-common/psiginfo-data.h:7
msgid "Privileged register"
-msgstr ""
+msgstr "特権レジスターã§ã™"
#: stdio-common/psiginfo-data.h:8
-#, fuzzy
msgid "Coprocessor error"
-msgstr "プリプロセッサエラー"
+msgstr "コプロセッサーエラーã§ã™"
#: stdio-common/psiginfo-data.h:9
-#, fuzzy
msgid "Internal stack error"
-msgstr "NIS 内部エラー"
+msgstr "内部スタックエラーã§ã™"
#: stdio-common/psiginfo-data.h:12
msgid "Integer divide by zero"
-msgstr ""
+msgstr "æ•´æ•°ã® 0ã«ã‚ˆã‚‹é™¤ç®—ã§ã™"
#: stdio-common/psiginfo-data.h:13
-#, fuzzy
msgid "Integer overflow"
-msgstr "時間オーãƒãƒ¼ãƒ•ãƒ­ãƒ¼"
+msgstr "æ•´æ•°ã®ã‚ªãƒ¼ãƒãƒ¼ãƒ•ãƒ­ãƒ¼ã§ã™"
#: stdio-common/psiginfo-data.h:14
-#, fuzzy
msgid "Floating-point divide by zero"
-msgstr "浮動å°æ•°ç‚¹ä¾‹å¤–"
+msgstr "浮動å°æ•°ã® 0 ã«ã‚ˆã‚‹é™¤ç®—ã§ã™"
#: stdio-common/psiginfo-data.h:15
-#, fuzzy
msgid "Floating-point overflow"
-msgstr "浮動å°æ•°ç‚¹ä¾‹å¤–"
+msgstr "浮動å°æ•°ã®ã‚ªãƒ¼ãƒãƒ¼ãƒ•ãƒ­ãƒ¼ã§ã™"
#: stdio-common/psiginfo-data.h:16
-#, fuzzy
msgid "Floating-point underflow"
-msgstr "浮動å°æ•°ç‚¹ä¾‹å¤–"
+msgstr "浮動å°æ•°ã®ã‚¢ãƒ³ãƒ€ãƒ¼ãƒ•ãƒ­ãƒ¼ã§ã™"
#: stdio-common/psiginfo-data.h:17
-#, fuzzy
msgid "Floating-poing inexact result"
-msgstr "浮動å°æ•°ç‚¹ä¾‹å¤–"
+msgstr "浮動å°æ•°ã®æ­£ã—ããªã„çµæžœã§ã™"
#: stdio-common/psiginfo-data.h:18
-#, fuzzy
msgid "Invalid floating-point operation"
-msgstr "æ“作ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªã‚ªãƒ–ジェクトã§ã™"
+msgstr "無効ãªæµ®å‹•å°æ•°ã®æ“作命令ã§ã™"
#: stdio-common/psiginfo-data.h:19
-#, fuzzy
msgid "Subscript out of range"
-msgstr "範囲外ã®æ–‡å­—"
+msgstr "æ·»ãˆå­—ãŒç¯„囲外ã§ã™"
#: stdio-common/psiginfo-data.h:22
msgid "Address not mapped to object"
-msgstr ""
+msgstr "アドレスãŒã‚ªãƒ–ジェクトã«ãƒžãƒƒãƒ—ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: stdio-common/psiginfo-data.h:23
msgid "Invalid permissions for mapped object"
-msgstr ""
+msgstr "マップã•ã‚ŒãŸã‚ªãƒ–ジェクトã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªã‚¢ã‚¯ã‚»ã‚¹æ¨©é™ã§ã™"
#: stdio-common/psiginfo-data.h:26
-#, fuzzy
msgid "Invalid address alignment"
-msgstr "無効ãªå¼•æ•°ã§ã™"
+msgstr "無効ãªã‚¢ãƒ‰ãƒ¬ã‚¹æ•´åˆ—ã§ã™"
#: stdio-common/psiginfo-data.h:27
msgid "Nonexisting physical address"
-msgstr ""
+msgstr "存在ã—ãªã„物ç†ã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã™"
#: stdio-common/psiginfo-data.h:28
msgid "Object-specific hardware error"
-msgstr ""
+msgstr "オブジェクト特有ã®ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢ã‚¨ãƒ©ãƒ¼ã§ã™"
#: stdio-common/psiginfo-data.h:31
-#, fuzzy
msgid "Process breakpoint"
-msgstr "Trace/breakpoint trap"
+msgstr "プロセスã®ãƒ–レークãƒã‚¤ãƒ³ãƒˆã§ã™"
#: stdio-common/psiginfo-data.h:32
msgid "Process trace trap"
-msgstr ""
+msgstr "プロセスã®ãƒˆãƒ¬ãƒ¼ã‚¹ãƒˆãƒ©ãƒƒãƒ—ã§ã™"
#: stdio-common/psiginfo-data.h:35
-#, fuzzy
msgid "Child has exited"
-msgstr "å­ãƒ—ロセス終了"
+msgstr "å­ãƒ—ロセスãŒçµ‚了ã—ã¾ã—ãŸ"
#: stdio-common/psiginfo-data.h:36
msgid "Child has terminated abnormally and did not create a core file"
-msgstr ""
+msgstr "å­ãƒ—ロセスãŒç•°å¸¸çµ‚了ã—ã¾ã—ãŸã€‚コアファイルã¯ä½œæˆã•ã‚Œã¾ã›ã‚“ã§ã—ãŸ"
#: stdio-common/psiginfo-data.h:37
msgid "Child hat terminated abnormally and created a core file"
-msgstr ""
+msgstr "å­ãƒ—ロセスãŒç•°å¸¸çµ‚了ã—ã¾ã—ãŸã€‚コアファイルãŒä½œæˆã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo-data.h:38
msgid "Traced child has trapped"
-msgstr ""
+msgstr "追跡ã—ã¦ã„ã‚‹å­ãƒ—ロセスãŒãƒˆãƒ©ãƒƒãƒ—ã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo-data.h:39
-#, fuzzy
msgid "Child has stopped"
-msgstr "å­ãƒ—ロセス終了"
+msgstr "å­ãƒ—ロセスãŒä¸­æ–­ã—ã¾ã—ãŸ"
#: stdio-common/psiginfo-data.h:40
msgid "Stopped child has continued"
-msgstr ""
+msgstr "中断ã—ã¦ã„ãŸå­ãƒ—ロセスãŒå†é–‹ã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo-data.h:43
-#, fuzzy
msgid "Data input available"
-msgstr "利用å¯èƒ½ãªãƒ‡ãƒ¼ã‚¿ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "データ入力ãŒä½¿ç”¨å¯èƒ½ã§ã™"
#: stdio-common/psiginfo-data.h:44
-#, fuzzy
msgid "Output buffers available"
-msgstr "利用å¯èƒ½ãªç©ºããƒãƒƒãƒ•ã‚¡ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "出力ãƒãƒƒãƒ•ã‚¡ãƒ¼ãŒä½¿ç”¨å¯èƒ½ã§ã™"
#: stdio-common/psiginfo-data.h:45
-#, fuzzy
msgid "Input message available"
-msgstr "利用å¯èƒ½ãªç©ºããƒãƒƒãƒ•ã‚¡ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "入力メッセージãŒä½¿ç”¨å¯èƒ½ã§ã™"
#: stdio-common/psiginfo-data.h:46
msgid "I/O error"
-msgstr "I/Oエラー"
+msgstr "I/Oエラーã§ã™"
#: stdio-common/psiginfo-data.h:47
-#, fuzzy
msgid "High priority input available"
-msgstr "RPCプログラムã¯åˆ©ç”¨ã§ãã¾ã›ã‚“"
+msgstr "高優先度入力ãŒä½¿ç”¨å¯èƒ½ã§ã™"
#: stdio-common/psiginfo-data.h:48
msgid "Device disconnected"
-msgstr ""
+msgstr "デãƒã‚¤ã‚¹ãŒåˆ‡æ–­ã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:145
msgid "Signal sent by kill()"
-msgstr ""
+msgstr "kill() ã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒé€ã‚‰ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:148
msgid "Signal sent by sigqueue()"
-msgstr ""
+msgstr "sigqueue() ã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒé€ã‚‰ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:151
msgid "Signal generated by the expiration of a timer"
-msgstr ""
+msgstr "タイマーã®æ™‚間切れã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒç”Ÿæˆã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:154
msgid "Signal generated by the completion of an asynchronous I/O request"
-msgstr ""
+msgstr "éžåŒæœŸ I/O è¦æ±‚ã®å®Œäº†ã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒç”Ÿæˆã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:158
msgid "Signal generated by the arrival of a message on an empty message queue"
-msgstr ""
+msgstr "空ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚­ãƒ¥ãƒ¼ã«ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒåˆ°ç€ã—ãŸã“ã¨ã«ã‚ˆã‚Šã‚·ã‚°ãƒŠãƒ«ãŒç”Ÿæˆã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:163
msgid "Signal sent by tkill()"
-msgstr ""
+msgstr "tkill() ã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒé€ã‚‰ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:168
msgid "Signal generated by the completion of an asynchronous name lookup request"
-msgstr ""
+msgstr "éžåŒæœŸåå‰è§£æ±ºè¦æ±‚ã®å®Œäº†ã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒç”Ÿæˆã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:174
msgid "Signal generated by the completion of an I/O request"
-msgstr ""
+msgstr "I/O è¦æ±‚ã®å®Œäº†ã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒç”Ÿæˆã•ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:180
msgid "Signal sent by the kernel"
-msgstr ""
+msgstr "カーãƒãƒ«ã«ã‚ˆã£ã¦ã‚·ã‚°ãƒŠãƒ«ãŒé€ã‚‰ã‚Œã¾ã—ãŸ"
#: stdio-common/psiginfo.c:204
#, c-format
@@ -4941,7 +4938,7 @@ msgstr "RPC: 手続ããŒåˆ©ç”¨ã§ãã¾ã›ã‚“"
#: sunrpc/clnt_perr.c:199
msgid "RPC: Server can't decode arguments"
-msgstr "RPC: サーãƒãŒå¼•æ•°ã‚’デコードã§ãã¾ã›ã‚“"
+msgstr "RPC: サーãƒãƒ¼ãŒå¼•æ•°ã‚’デコードã§ãã¾ã›ã‚“"
#: sunrpc/clnt_perr.c:203
msgid "RPC: Remote system error"
@@ -4981,7 +4978,7 @@ msgstr "無効ãªã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã®ä¿¡ä»»ã§ã™"
#: sunrpc/clnt_perr.c:343
msgid "Server rejected credential"
-msgstr "サーãƒãŒè¨¼æ˜Žã‚’æ‹’å¦ã—ã¾ã—ãŸ"
+msgstr "サーãƒãƒ¼ãŒè¨¼æ˜Žã‚’æ‹’å¦ã—ã¾ã—ãŸ"
#: sunrpc/clnt_perr.c:347
msgid "Invalid client verifier"
@@ -4989,7 +4986,7 @@ msgstr "無効ãªã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆç¢ºèªã§ã™"
#: sunrpc/clnt_perr.c:351
msgid "Server rejected verifier"
-msgstr "サーãƒãŒç¢ºèªã‚’æ‹’å¦ã—ã¾ã—ãŸ"
+msgstr "サーãƒãƒ¼ãŒç¢ºèªã‚’æ‹’å¦ã—ã¾ã—ãŸ"
#: sunrpc/clnt_perr.c:355
msgid "Client credential too weak"
@@ -5005,7 +5002,7 @@ msgstr "失敗ã—ã¾ã—ãŸ(原因ä¸ç‰¹å®šã®ã‚¨ãƒ©ãƒ¼)"
#: sunrpc/clnt_raw.c:115
msgid "clnt_raw.c: fatal header serialization error"
-msgstr ""
+msgstr "clnt_raw.c: 致命的ãªãƒ˜ãƒƒãƒ€ãƒ¼ã‚·ãƒªã‚¢ãƒ«åŒ–エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ"
#: sunrpc/pm_getmaps.c:77
msgid "pmap_getmaps.c: rpc problem"
@@ -5119,7 +5116,7 @@ msgstr "æ–°å½¢å¼ã‚’ã‚‚ã¤ãƒ†ãƒ¼ãƒ–ルフラグã¯ä½¿ãˆã¾ã›ã‚“!\n"
#: sunrpc/rpc_main.c:1439
#, c-format
msgid "\"infile\" is required for template generation flags.\n"
-msgstr "テンプレート生æˆãƒ•ãƒ©ã‚°ã«ã¯\"入力ファイル\"ãŒå¿…è¦ã§ã™.\n"
+msgstr "テンプレート生æˆãƒ•ãƒ©ã‚°ã«ã¯\"infile\"ãŒå¿…è¦ã§ã™.\n"
#: sunrpc/rpc_main.c:1444
#, c-format
@@ -5129,107 +5126,107 @@ msgstr "ファイル生æˆãƒ•ãƒ©ã‚°ã¯è¤‡æ•°æŒ‡å®šã§ãã¾ã›ã‚“!\n"
#: sunrpc/rpc_main.c:1453
#, c-format
msgid "usage: %s infile\n"
-msgstr "使用法: %s 入力ファイル\n"
+msgstr "使用法: %s infile\n"
#: sunrpc/rpc_main.c:1454
#, c-format
msgid "\t%s [-abkCLNTM][-Dname[=value]] [-i size] [-I [-K seconds]] [-Y path] infile\n"
-msgstr "\t%s [-abkCLNTM][-Dåå‰[=値]] [-i サイズ] [-I [-K 秒数]] [-Y パス] 入力ファイル\n"
+msgstr "\t%s [-abkCLNTM][-Dname[=value]] [-i size] [-I [-K seconds]] [-Y path] infile\n"
#: sunrpc/rpc_main.c:1456
#, c-format
msgid "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o outfile] [infile]\n"
-msgstr "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o 出力ファイル] [入力ファイル]\n"
+msgstr "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o outfile] [infile]\n"
#: sunrpc/rpc_main.c:1458
#, c-format
msgid "\t%s [-s nettype]* [-o outfile] [infile]\n"
-msgstr "\t%s [-s ãƒãƒƒãƒˆã‚¿ã‚¤ãƒ—]* [-o 出力ファイル] [入力ファイル]\n"
+msgstr "\t%s [-s nettype]* [-o outfile] [infile]\n"
#: sunrpc/rpc_main.c:1459
#, c-format
msgid "\t%s [-n netid]* [-o outfile] [infile]\n"
-msgstr "\t%s [-n netid]* [-o 出力ファイル] [入力ファイル]\n"
+msgstr "\t%s [-n netid]* [-o outfile] [infile]\n"
#: sunrpc/rpc_main.c:1467
#, c-format
msgid "options:\n"
-msgstr ""
+msgstr "オプション:\n"
#: sunrpc/rpc_main.c:1468
#, c-format
msgid "-a\t\tgenerate all files, including samples\n"
-msgstr ""
+msgstr "-a\t\tã™ã¹ã¦ã®ãƒ•ã‚¡ã‚¤ãƒ« (サンプルをå«ã‚€) を生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1469
#, c-format
msgid "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n"
-msgstr ""
+msgstr "-b\t\t後方互æ›æ€§ãƒ¢ãƒ¼ãƒ‰ (SunOS 4.1 用ã®ã‚³ãƒ¼ãƒ‰ã‚’生æˆ)\n"
#: sunrpc/rpc_main.c:1470
#, c-format
msgid "-c\t\tgenerate XDR routines\n"
-msgstr ""
+msgstr "-c\t\tXDR ルーãƒãƒ³ã‚’生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1471
#, c-format
msgid "-C\t\tANSI C mode\n"
-msgstr ""
+msgstr "-C\t\tANSI C モード\n"
#: sunrpc/rpc_main.c:1472
#, c-format
msgid "-Dname[=value]\tdefine a symbol (same as #define)\n"
-msgstr ""
+msgstr "-Dname[=value]\tシンボルを定義ã™ã‚‹ (#define ã¨åŒæ§˜)\n"
#: sunrpc/rpc_main.c:1473
#, c-format
msgid "-h\t\tgenerate header file\n"
-msgstr ""
+msgstr "-h\t\tヘッダーファイルを生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1474
#, c-format
msgid "-i size\t\tsize at which to start generating inline code\n"
-msgstr ""
+msgstr "-i size\t\tインラインコードを生æˆé–‹å§‹ã™ã‚‹ã‚µã‚¤ã‚ºã‚’ size ã«ã™ã‚‹\n"
#: sunrpc/rpc_main.c:1475
#, c-format
msgid "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n"
-msgstr ""
+msgstr "-I\t\tサーãƒãƒ¼ã§ inetd サãƒãƒ¼ãƒˆç”¨ã®ã‚³ãƒ¼ãƒ‰ã‚’生æˆã™ã‚‹ (SunOS 4.1 用)\n"
#: sunrpc/rpc_main.c:1476
#, c-format
msgid "-K seconds\tserver exits after K seconds of inactivity\n"
-msgstr ""
+msgstr "-K seconds\tK 秒間活動ãŒãªã‘ã‚Œã°ã‚µãƒ¼ãƒãƒ¼ã‚’終了ã™ã‚‹\n"
#: sunrpc/rpc_main.c:1477
#, c-format
msgid "-l\t\tgenerate client side stubs\n"
-msgstr ""
+msgstr "-l\t\tクライアントå´ã‚¹ã‚¿ãƒ–を生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1478
#, c-format
msgid "-L\t\tserver errors will be printed to syslog\n"
-msgstr ""
+msgstr "-L\t\tサーãƒãƒ¼ã®ã‚¨ãƒ©ãƒ¼ã‚’ syslog ã«å‡ºåŠ›ã™ã‚‹\n"
#: sunrpc/rpc_main.c:1479
#, c-format
msgid "-m\t\tgenerate server side stubs\n"
-msgstr ""
+msgstr "-m\t\tサーãƒãƒ¼å´ã‚¹ã‚¿ãƒ–を生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1480
#, c-format
msgid "-M\t\tgenerate MT-safe code\n"
-msgstr ""
+msgstr "-M\t\tマルãƒã‚¹ãƒ¬ãƒƒãƒ‰ã‚»ãƒ¼ãƒ•ãªã‚³ãƒ¼ãƒ‰ã‚’生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1481
#, c-format
msgid "-n netid\tgenerate server code that supports named netid\n"
-msgstr ""
+msgstr "-n netid\tnetid ã¨ã„ã†åå‰ã‚’サãƒãƒ¼ãƒˆã™ã‚‹ã‚µãƒ¼ãƒãƒ¼ã‚³ãƒ¼ãƒ‰ã‚’生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1482
#, c-format
msgid "-N\t\tsupports multiple arguments and call-by-value\n"
-msgstr ""
+msgstr "-N\t\t複数ã®å¼•æ•°ã¨å€¤å‘¼ã³å‡ºã—をサãƒãƒ¼ãƒˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1483
#, c-format
@@ -5239,32 +5236,32 @@ msgstr "-o outfile\t出力ファイルã®åå‰ã‚’設定ã™ã‚‹\n"
#: sunrpc/rpc_main.c:1484
#, c-format
msgid "-s nettype\tgenerate server code that supports named nettype\n"
-msgstr ""
+msgstr "-s nettype\tnettype ã¨ã„ã†åå‰ã‚’サãƒãƒ¼ãƒˆã™ã‚‹ã‚µãƒ¼ãƒãƒ¼ã‚³ãƒ¼ãƒ‰ã‚’生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1485
#, c-format
msgid "-Sc\t\tgenerate sample client code that uses remote procedures\n"
-msgstr ""
+msgstr "-Sc\t\tリモート手続ãを使用ã™ã‚‹ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã‚³ãƒ¼ãƒ‰ã®ã‚µãƒ³ãƒ—ルを生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1486
#, c-format
msgid "-Ss\t\tgenerate sample server code that defines remote procedures\n"
-msgstr ""
+msgstr "-Ss\t\tリモート手続ãを定義ã™ã‚‹ã‚µãƒ¼ãƒãƒ¼ã‚³ãƒ¼ãƒ‰ã®ã‚µãƒ³ãƒ—ルを生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1487
#, c-format
msgid "-Sm \t\tgenerate makefile template \n"
-msgstr ""
+msgstr "-Sm \t\tmakefile ã®ãƒ†ãƒ³ãƒ—レートを生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1488
#, c-format
msgid "-t\t\tgenerate RPC dispatch table\n"
-msgstr ""
+msgstr "-t\t\tRPC ディスパッãƒè¡¨ã‚’生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1489
#, c-format
msgid "-T\t\tgenerate code to support RPC dispatch tables\n"
-msgstr ""
+msgstr "-T\t\tRPC ディスパッãƒè¡¨ã‚’サãƒãƒ¼ãƒˆã™ã‚‹ãŸã‚ã®ã‚³ãƒ¼ãƒ‰ã‚’生æˆã™ã‚‹\n"
#: sunrpc/rpc_main.c:1490
#, c-format
@@ -5385,7 +5382,7 @@ msgstr "手続ãç•ªå· %ld ã‚’å†å‰²ã‚Šå½“ã¦ã§ãã¾ã›ã‚“\n"
#: sunrpc/svc_simple.c:91
msgid "couldn't create an rpc server\n"
-msgstr "RPCサーãƒã‚’作æˆã§ãã¾ã›ã‚“ã§ã—ãŸ\n"
+msgstr "RPCサーãƒãƒ¼ã‚’作æˆã§ãã¾ã›ã‚“ã§ã—ãŸ\n"
#: sunrpc/svc_simple.c:99
#, c-format
@@ -6434,9 +6431,8 @@ msgid "State not recoverable"
msgstr "状態ã®å¾©å¸°ãŒå‡ºæ¥ã¾ã›ã‚“"
#: sysdeps/gnu/errlist.c:1461
-#, fuzzy
msgid "Operation not possible due to RF-kill"
-msgstr "æ“作ã¯é©ç”¨ã§ãã¾ã›ã‚“"
+msgstr "RF-kill ã®ãŸã‚æ“作ã¯ä¸å¯èƒ½ã§ã™"
#: sysdeps/mach/_strerror.c:57
msgid "Error in unknown error system: "
@@ -6456,7 +6452,7 @@ msgstr "ai_flags ã«å¯¾ã™ã‚‹èª¤ã£ãŸå€¤ã§ã™"
#: sysdeps/posix/gai_strerror-strs.h:4
msgid "Non-recoverable failure in name resolution"
-msgstr "åå‰è§£æ±ºã§ãƒªã‚«ãƒãƒªã§ããªã„失敗ãŒç™ºç”Ÿã—ã¾ã—ãŸ"
+msgstr "åå‰è§£æ±ºã§å›žå¾©ã§ããªã„失敗ãŒç™ºç”Ÿã—ã¾ã—ãŸ"
#: sysdeps/posix/gai_strerror-strs.h:5
msgid "ai_family not supported"
@@ -6545,28 +6541,28 @@ msgstr "`%s'ã‚’é–‹ã‘ã¾ã›ã‚“"
#: sysdeps/unix/sysv/linux/lddlibc4.c:86
#, c-format
msgid "cannot read header from `%s'"
-msgstr "`%s'ã®ãƒ˜ãƒƒãƒ€ã‚’読ã‚ã¾ã›ã‚“"
+msgstr "`%s'ã®ãƒ˜ãƒƒãƒ€ãƒ¼ã‚’読ã‚ã¾ã›ã‚“"
#: timezone/zdump.c:215
msgid "lacks alphabetic at start"
-msgstr ""
+msgstr "開始文字ãŒã‚¢ãƒ«ãƒ•ã‚¡ãƒ™ãƒƒãƒˆã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: timezone/zdump.c:217
msgid "has fewer than 3 alphabetics"
-msgstr ""
+msgstr "アルファベット㌠3 文字より少ãªã„ã§ã™"
#: timezone/zdump.c:219
msgid "has more than 6 alphabetics"
-msgstr ""
+msgstr "アルファベット㌠6 文字を超ãˆã¦ã„ã¾ã™"
#: timezone/zdump.c:227
msgid "differs from POSIX standard"
-msgstr ""
+msgstr "POSIX 標準ã¨ç•°ãªã‚Šã¾ã™"
#: timezone/zdump.c:233
#, c-format
msgid "%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"
-msgstr ""
+msgstr "%s: 警告: ゾーン \"%s\" çœç•¥å½¢ \"%s\" %s\n"
#: timezone/zdump.c:242
#, c-format
@@ -6614,15 +6610,18 @@ msgid "warning: "
msgstr "警告: "
#: timezone/zic.c:459
-#, fuzzy, c-format
+#, c-format
msgid ""
"%s: usage is %s [ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n"
"\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"
"\n"
"Report bugs to tz@elsie.nci.nih.gov.\n"
msgstr ""
-"%s: 使用法: %s [ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n"
+"%s: 使用法 %s [ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n"
"\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"
+"\n"
+"ãƒã‚°ã‚’発見ã—ãŸã‚‰ <tz@elsie.nci.nih.gov> ã«å ±å‘Šã—ã¦ãã ã•ã„。\n"
+"翻訳ã«é–¢ã™ã‚‹ãƒã‚°ã¯<translation-team-ja@lists.sourceforge.net>ã«å ±å‘Šã—ã¦ãã ã•ã„。\n"
#: timezone/zic.c:496
msgid "wild compilation-time specification of zic_t"
@@ -6672,12 +6671,12 @@ msgstr "複数ファイルã«åŒã˜ãƒ«ãƒ¼ãƒ«åãŒã‚ã‚Šã¾ã™"
#: timezone/zic.c:792
msgid "unruly zone"
-msgstr "unruly zone"
+msgstr ""
#: timezone/zic.c:799
#, c-format
msgid "%s in ruleless zone"
-msgstr "%s in ruleless zone"
+msgstr ""
#: timezone/zic.c:820
msgid "standard input"
@@ -6694,7 +6693,7 @@ msgstr "è¡ŒãŒé•·ã™ãŽã¾ã™"
#: timezone/zic.c:856
msgid "input line of unknown type"
-msgstr "ä¸æ˜Žãªå½¢å¼ã®å…¥åŠ›ãƒ©ã‚¤ãƒ³è¡Œã§ã™"
+msgstr "ä¸æ˜Žãªå½¢å¼ã®å…¥åŠ›è¡Œã§ã™"
#: timezone/zic.c:872
#, c-format
@@ -6704,17 +6703,17 @@ msgstr "%s: é–秒ファイルã§ãªã„ファイル %s ã« Leap è¡ŒãŒã‚ã‚Šã¾ã
#: timezone/zic.c:879 timezone/zic.c:1316 timezone/zic.c:1338
#, c-format
msgid "%s: panic: Invalid l_value %d\n"
-msgstr "%s: パニック: ä¸å½“㪠l_value(%d)ã§ã™\n"
+msgstr "%s: パニック: 無効㪠l_value %d ã§ã™\n"
#: timezone/zic.c:887
#, c-format
msgid "%s: Error reading %s\n"
-msgstr "%s: %sã®èª­ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼\n"
+msgstr "%s: %s を読ã¿è¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ\n"
#: timezone/zic.c:894
#, c-format
msgid "%s: Error closing %s: %s\n"
-msgstr "%s: %sをクローズ中ã«ã‚¨ãƒ©ãƒ¼: %s\n"
+msgstr "%s: %s ã‚’é–‰ã˜ã¦ã„ã‚‹é–“ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: %s\n"
#: timezone/zic.c:899
msgid "expected continuation line not found"
@@ -6726,11 +6725,11 @@ msgstr "時間オーãƒãƒ¼ãƒ•ãƒ­ãƒ¼"
#: timezone/zic.c:947
msgid "24:00 not handled by pre-1998 versions of zic"
-msgstr ""
+msgstr "1998 以å‰ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® zic ã§ã¯ 24:00 ã¯æ‰±ãˆã¾ã›ã‚“"
#: timezone/zic.c:950
msgid "values over 24 hours not handled by pre-2007 versions of zic"
-msgstr ""
+msgstr "2007 以å‰ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® zic ã§ã¯24時間を超ãˆã‚‹å€¤ã¯æ‰±ãˆã¾ã›ã‚“"
#: timezone/zic.c:963
msgid "wrong number of fields on Rule line"
@@ -6769,11 +6768,11 @@ msgstr "Zone continuationè¡Œã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰æ•°ãŒé–“é•ã£ã¦ã„ã¾ã™"
#: timezone/zic.c:1075
msgid "invalid UTC offset"
-msgstr "ä¸å½“ãªUTCオフセット"
+msgstr "無効ãªUTCオフセットã§ã™"
#: timezone/zic.c:1078
msgid "invalid abbreviation format"
-msgstr "ä¸å½“ãªçœç•¥å½¢"
+msgstr "無効ãªçœç•¥å½¢ã§ã™"
#: timezone/zic.c:1107
msgid "Zone continuation line end time is not after end time of previous line"
@@ -6785,15 +6784,15 @@ msgstr "Leapè¡Œã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰æ•°ãŒé–“é•ã£ã¦ã„ã¾ã™"
#: timezone/zic.c:1144
msgid "invalid leaping year"
-msgstr "ä¸å½“ãªã†ã‚‹ã†å¹´ã§ã™"
+msgstr "無効ãªã†ã‚‹ã†å¹´ã§ã™"
#: timezone/zic.c:1164 timezone/zic.c:1270
msgid "invalid month name"
-msgstr "ä¸å½“ãªæœˆåã§ã™"
+msgstr "無効ãªãªæœˆåã§ã™"
#: timezone/zic.c:1177 timezone/zic.c:1383 timezone/zic.c:1397
msgid "invalid day of month"
-msgstr "ä¸å½“ãª1ヶ月中ã®æ—¥ã«ã¡ã§ã™"
+msgstr "一月ã‚ãŸã‚Šã®æ—¥ã«ã¡ãŒç„¡åŠ¹ã§ã™"
#: timezone/zic.c:1182
msgid "time before zero"
@@ -6809,7 +6808,7 @@ msgstr "時刻ãŒå¤§ãã™ãŽã¾ã™"
#: timezone/zic.c:1194 timezone/zic.c:1299
msgid "invalid time of day"
-msgstr "1日辺りã®æ™‚é–“ãŒä¸æ­£"
+msgstr "1æ—¥ã‚ãŸã‚Šã®æ™‚é–“ãŒç„¡åŠ¹ã§ã™"
#: timezone/zic.c:1213
msgid "illegal CORRECTION field on Leap line"
@@ -6833,11 +6832,11 @@ msgstr "Link 行㮠TO フィールドãŒç©ºæ¬„ã§ã™"
#: timezone/zic.c:1320
msgid "invalid starting year"
-msgstr "ä¸å½“ãªé–‹å§‹å¹´"
+msgstr "無効ãªé–‹å§‹å¹´ã§ã™"
#: timezone/zic.c:1342
msgid "invalid ending year"
-msgstr "ä¸å½“ãªçµ‚了年"
+msgstr "無効ãªçµ‚了年ã§ã™"
#: timezone/zic.c:1346
msgid "starting year greater than ending year"
@@ -6845,11 +6844,11 @@ msgstr "開始年ãŒçµ‚了年より大ãããªã£ã¦ã„ã¾ã™"
#: timezone/zic.c:1353
msgid "typed single year"
-msgstr "typed single year"
+msgstr ""
#: timezone/zic.c:1388
msgid "invalid weekday name"
-msgstr "ãŠã‹ã—ãªæ›œæ—¥å"
+msgstr "無効ãªæ›œæ—¥åã§ã™"
#: timezone/zic.c:1566
#, c-format
@@ -6864,11 +6863,11 @@ msgstr "%s: %sを作æˆã§ãã¾ã›ã‚“: %s\n"
#: timezone/zic.c:1726
#, c-format
msgid "%s: Error writing %s\n"
-msgstr "%s: %sã®æ›¸ãè¾¼ã¿ã‚¨ãƒ©ãƒ¼ã§ã™\n"
+msgstr "%s: %s を書ãè¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ\n"
#: timezone/zic.c:2019
msgid "no POSIX environment variable for zone"
-msgstr ""
+msgstr "ゾーン用㮠POSIX 環境変数ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: timezone/zic.c:2176
msgid "can't determine time zone abbreviation to use just after until time"
@@ -6921,11 +6920,11 @@ msgstr "クォートã™ã‚‹ãƒžãƒ¼ã‚¯ãŒå¥‡æ•°å€‹åˆ†ã—ã‹ã‚ã‚Šã¾ã›ã‚“"
#: timezone/zic.c:2546
msgid "use of 2/29 in non leap-year"
-msgstr "é–å¹´ã§ã¯ãªã„ã®ã«2/29を使ã£ã¦ã„ã¾ã™"
+msgstr "ã†ã‚‹ã†å¹´ã§ã¯ãªã„ã®ã«2/29を使ã£ã¦ã„ã¾ã™"
#: timezone/zic.c:2581
msgid "rule goes past start/end of month--will not work with pre-2004 versions of zic"
-msgstr ""
+msgstr "月ã®é–‹å§‹ã¨çµ‚了ã§éŽåŽ»ã«ã•ã‹ã®ã¼ã£ã¦ã„るルールã§ã™ -- 2004 以å‰ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® zic ã§ã¯å‹•ä½œã—ã¾ã›ã‚“"
#: timezone/zic.c:2613
msgid "time zone abbreviation lacks alphabetic at start"
diff --git a/libc/posix/Makefile b/libc/posix/Makefile
index 85128beae..95bd04f15 100644
--- a/libc/posix/Makefile
+++ b/libc/posix/Makefile
@@ -240,6 +240,7 @@ bug-regex23-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex25-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex26-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex30-ENV = LOCPATH=$(common-objpfx)localedata
+bug-regex32-ENV = LOCPATH=$(common-objpfx)localedata
tst-rxspencer-ARGS = rxspencer/tests
ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
tst-rxspencer-ARGS += --utf8
@@ -253,16 +254,10 @@ tst-execvp3-ARGS = --test-dir=$(objpfx)
testcases.h: TESTS TESTS2C.sed
sed -f TESTS2C.sed < $< > $@T
mv -f $@T $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
-endif
ptestcases.h: PTESTS PTESTS2C.sed
sed -f PTESTS2C.sed < $< > $@T
mv -f $@T $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs $(CVSOPTS) commit -mRegenerated $@
-endif
# Run a test on the header files we use.
# XXX Please note that for now we ignore the result of this test.
diff --git a/libc/posix/getopt.c b/libc/posix/getopt.c
index 3fa5a4d6d..ef2b48d36 100644
--- a/libc/posix/getopt.c
+++ b/libc/posix/getopt.c
@@ -74,7 +74,7 @@
# define _(msgid) gettext (msgid)
#endif
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
# include <wchar.h>
#endif
@@ -583,7 +583,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
first.next = ambig_list;
ambig_list = &first;
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf = NULL;
size_t buflen = 0;
@@ -652,7 +652,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
int n;
#endif
@@ -660,7 +660,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
if (argv[d->optind - 1][1] == '-')
{
/* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
n = __asprintf (&buf, _("\
%s: option '--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
@@ -673,7 +673,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
else
{
/* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
n = __asprintf (&buf, _("\
%s: option '%c%s' doesn't allow an argument\n"),
argv[0], argv[d->optind - 1][0],
@@ -686,7 +686,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
#endif
}
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
if (n >= 0)
{
_IO_flockfile (stderr);
@@ -719,7 +719,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
if (__asprintf (&buf, _("\
@@ -770,7 +770,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
int n;
#endif
@@ -778,7 +778,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
if (argv[d->optind][1] == '-')
{
/* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
n = __asprintf (&buf, _("%s: unrecognized option '--%s'\n"),
argv[0], d->__nextchar);
#else
@@ -789,7 +789,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
else
{
/* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
n = __asprintf (&buf, _("%s: unrecognized option '%c%s'\n"),
argv[0], argv[d->optind][0], d->__nextchar);
#else
@@ -798,7 +798,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
#endif
}
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
if (n >= 0)
{
_IO_flockfile (stderr);
@@ -836,19 +836,19 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
int n;
#endif
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
n = __asprintf (&buf, _("%s: invalid option -- '%c'\n"),
argv[0], c);
#else
fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
#endif
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
if (n >= 0)
{
_IO_flockfile (stderr);
@@ -894,7 +894,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
if (__asprintf (&buf,
@@ -968,7 +968,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
@@ -1008,7 +1008,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
if (__asprintf (&buf, _("\
@@ -1047,7 +1047,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
if (__asprintf (&buf, _("\
@@ -1122,7 +1122,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
{
if (print_errors)
{
-#if defined _LIBC && defined USE_IN_LIBIO
+#if defined _LIBC
char *buf;
if (__asprintf (&buf, _("\
diff --git a/libc/posix/wordexp.c b/libc/posix/wordexp.c
index 058a7cfbe..64689d974 100644
--- a/libc/posix/wordexp.c
+++ b/libc/posix/wordexp.c
@@ -1,5 +1,5 @@
/* POSIX.2 wordexp implementation.
- Copyright (C) 1997-2003, 2005, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1997-2003,2005,2006,2008,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Tim Waugh <tim@cyberelk.demon.co.uk>.
@@ -38,9 +38,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
#include <wordexp.h>
#include <kernel-features.h>
@@ -854,7 +852,7 @@ exec_comm_child (char *comm, int *fildes, int showerr, int noexec)
__close (fd);
}
/* Be paranoid. Check that we actually opened the /dev/null
- device. */
+ device. */
if (__builtin_expect (__fxstat64 (_STAT_VER, STDERR_FILENO, &st), 0) != 0
|| __builtin_expect (S_ISCHR (st.st_mode), 1) == 0
#if defined DEV_NULL_MAJOR && defined DEV_NULL_MINOR
@@ -862,8 +860,8 @@ exec_comm_child (char *comm, int *fildes, int showerr, int noexec)
#endif
)
/* It's not the /dev/null device. Stop right here. The
- problem is: how do we stop? We use _exit() with an
- hopefully unusual exit code. */
+ problem is: how do we stop? We use _exit() with an
+ hopefully unusual exit code. */
_exit (90);
}
@@ -1062,7 +1060,7 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
if (copying == 3)
{
/* Nothing but (IFS) newlines since the last field,
- so delimit it here before starting new word */
+ so delimit it here before starting new word */
if (w_addword (pwordexp, *word) == WRDE_NOSPACE)
goto no_space;
@@ -1089,7 +1087,7 @@ exec_comm (char *comm, char **word, size_t *word_length, size_t *max_length,
/* Ensure we don't go back further than the beginning of the
substitution (i.e. remove maxnewlines bytes at most) */
while (maxnewlines-- != 0 &&
- *word_length > 0 && (*word)[*word_length - 1] == '\n')
+ *word_length > 0 && (*word)[*word_length - 1] == '\n')
{
(*word)[--*word_length] = '\0';
@@ -1577,7 +1575,7 @@ envsubst:
if (expand_pattern)
{
/* We need to perform tilde expansion, parameter expansion,
- command substitution, and arithmetic expansion. We also
+ command substitution, and arithmetic expansion. We also
have to be a bit careful with wildcard characters, as
pattern might be given to fnmatch soon. To do this, we
convert quotes to escapes. */
@@ -1982,7 +1980,7 @@ envsubst:
field_end = field_begin + strcspn (field_begin, ifs);
/* Set up pointer to the character after end of field and
- skip whitespace IFS after it. */
+ skip whitespace IFS after it. */
next_field = field_end + strspn (field_end, ifs_white);
/* Skip at most one non-whitespace IFS character after the field */
diff --git a/libc/pwd/fgetpwent_r.c b/libc/pwd/fgetpwent_r.c
index bee728ea6..f84f72a66 100644
--- a/libc/pwd/fgetpwent_r.c
+++ b/libc/pwd/fgetpwent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996-1999, 2011 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
@@ -21,10 +21,8 @@
#include <stdio.h>
#include <pwd.h>
-#ifdef USE_IN_LIBIO
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
/* Define a line parsing function using the common code
used in the nss_files module. */
diff --git a/libc/resolv/Makefile b/libc/resolv/Makefile
index 48f8b923c..95654a4be 100644
--- a/libc/resolv/Makefile
+++ b/libc/resolv/Makefile
@@ -1,4 +1,5 @@
-# Copyright (C) 1994-2001,2003,2004,2007,2008 Free Software Foundation, Inc.
+# Copyright (C) 1994-2001,2003,2004,2007,2008,2011
+# 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
@@ -91,6 +92,11 @@ CFLAGS-res_hconf.c = -fexceptions
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
$(objpfx)libresolv.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
+# Some hosts need '__stack_chk_guard', so pull in the definition from
+# ld.so if required.
+ifeq (yesyes,$(have-ssp)$(elf))
+LDLIBS-resolv.so += $(as-needed) $(elfobjdir)/ld.so $(no-as-needed)
+endif
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so $(common-objpfx)libc.so \
diff --git a/libc/resolv/Versions b/libc/resolv/Versions
index 4b2e5e9db..93faf1e2f 100644
--- a/libc/resolv/Versions
+++ b/libc/resolv/Versions
@@ -2,11 +2,6 @@
libc {
GLIBC_2.0 {
-%if !HAVE___THREAD
- # global variables
- _h_errno;
-%endif
-
_res;
# helper functions
@@ -17,9 +12,6 @@ libc {
# variables in normal name space
h_errlist; h_nerr;
-%if !HAVE___THREAD
- h_errno;
-%endif
# h*
herror; hstrerror;
@@ -34,10 +26,7 @@ libc {
GLIBC_PRIVATE {
__gai_sigqueue;
-%if HAVE___THREAD
- # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
h_errno; __resp;
-%endif
__res_maybe_init; __res_iclose;
}
diff --git a/libc/resolv/res-state.c b/libc/resolv/res-state.c
index e327e34f5..b0aa22cfc 100644
--- a/libc/resolv/res-state.c
+++ b/libc/resolv/res-state.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 97, 98, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 97, 98, 2002, 2003, 2011 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
@@ -19,27 +19,10 @@
#include <resolv.h>
#include <tls.h>
-#if ! USE___THREAD
-
-# undef _res
-extern struct __res_state _res;
-
-/* When threaded, _res may be a per-thread variable. */
-struct __res_state *
-weak_const_function
-__res_state (void)
-{
- return &_res;
-}
-
-#else
struct __res_state *
__res_state (void)
{
return __resp;
}
-
-#endif
-
libc_hidden_def (__res_state)
diff --git a/libc/resolv/res_hconf.c b/libc/resolv/res_hconf.c
index fc4b83f7c..7b167bb3b 100644
--- a/libc/resolv/res_hconf.c
+++ b/libc/resolv/res_hconf.c
@@ -46,9 +46,7 @@
#include <bits/libc-lock.h>
#include "ifreq.h"
#include "res_hconf.h"
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
#define _PATH_HOSTCONF "/etc/host.conf"
diff --git a/libc/resolv/res_libc.c b/libc/resolv/res_libc.c
index f1413163d..cba040aea 100644
--- a/libc/resolv/res_libc.c
+++ b/libc/resolv/res_libc.c
@@ -137,12 +137,10 @@ struct __res_state _res __attribute__((section (".bss")));
#include <tls.h>
-#if USE___THREAD
#undef __resp
__thread struct __res_state *__resp = &_res;
extern __thread struct __res_state *__libc_resp
__attribute__ ((alias ("__resp"))) attribute_hidden;
-#endif
/* We declare this with compat_symbol so that it's not
visible at link time. Programs must use the accessor functions. */
diff --git a/libc/shadow/fgetspent_r.c b/libc/shadow/fgetspent_r.c
index 16747e10c..2c907a5ad 100644
--- a/libc/shadow/fgetspent_r.c
+++ b/libc/shadow/fgetspent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999, 2011 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
@@ -21,10 +21,8 @@
#include <shadow.h>
#include <stdio.h>
-#ifdef USE_IN_LIBIO
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
/* Define a line parsing function using the common code
used in the nss_files module. */
diff --git a/libc/shadow/putspent.c b/libc/shadow/putspent.c
index dc0bcaafb..c6b53edb2 100644
--- a/libc/shadow/putspent.c
+++ b/libc/shadow/putspent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996-1998, 2011 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
@@ -19,10 +19,8 @@
#include <stdio.h>
#include <shadow.h>
-#ifdef USE_IN_LIBIO
-# define flockfile(s) _IO_flockfile (s)
-# define funlockfile(s) _IO_funlockfile (s)
-#endif
+#define flockfile(s) _IO_flockfile (s)
+#define funlockfile(s) _IO_funlockfile (s)
#define _S(x) x ? x : ""
diff --git a/libc/stdio-common/printf_fp.c b/libc/stdio-common/printf_fp.c
index 7e9100a2c..0687e6b94 100644
--- a/libc/stdio-common/printf_fp.c
+++ b/libc/stdio-common/printf_fp.c
@@ -356,6 +356,7 @@ ___printf_fp (FILE *fp,
fpnum.ldbl = *(const long double *) args[0];
/* Check for special values: not a number or infinity. */
+ int res;
if (__isnanl (fpnum.ldbl))
{
union ieee854_long_double u = { .d = fpnum.ldbl };
@@ -371,9 +372,9 @@ ___printf_fp (FILE *fp,
wspecial = L"nan";
}
}
- else if (__isinfl (fpnum.ldbl))
+ else if ((res = __isinfl (fpnum.ldbl)))
{
- is_neg = fpnum.ldbl < 0;
+ is_neg = res < 0;
if (isupper (info->spec))
{
special = "INF";
@@ -401,6 +402,7 @@ ___printf_fp (FILE *fp,
fpnum.dbl = *(const double *) args[0];
/* Check for special values: not a number or infinity. */
+ int res;
if (__isnan (fpnum.dbl))
{
union ieee754_double u = { .d = fpnum.dbl };
@@ -416,9 +418,9 @@ ___printf_fp (FILE *fp,
wspecial = L"nan";
}
}
- else if (__isinf (fpnum.dbl))
+ else if ((res = __isinf (fpnum.dbl)))
{
- is_neg = fpnum.dbl < 0;
+ is_neg = res < 0;
if (isupper (info->spec))
{
special = "INF";
diff --git a/libc/stdio-common/printf_fphex.c b/libc/stdio-common/printf_fphex.c
index 8dbd49f86..cfc9351ea 100644
--- a/libc/stdio-common/printf_fphex.c
+++ b/libc/stdio-common/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2002,2004,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2002,2004,2006,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -36,22 +36,16 @@
/* This defines make it possible to use the same code for GNU C library and
the GNU I/O library. */
-#ifdef USE_IN_LIBIO
-# include <libioP.h>
-# define PUT(f, s, n) _IO_sputn (f, s, n)
-# define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : INTUSE(_IO_padn) (f, c, n))
+#include <libioP.h>
+#define PUT(f, s, n) _IO_sputn (f, s, n)
+#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : INTUSE(_IO_padn) (f, c, n))
/* We use this file GNU C library and GNU I/O library. So make
names equal. */
-# undef putc
-# define putc(c, f) (wide \
+#undef putc
+#define putc(c, f) (wide \
? (int)_IO_putwc_unlocked (c, f) : _IO_putc_unlocked (c, f))
-# define size_t _IO_size_t
-# define FILE _IO_FILE
-#else /* ! USE_IN_LIBIO */
-# define PUT(f, s, n) fwrite (s, 1, n, f)
-# define PAD(f, c, n) __printf_pad (f, c, n)
-ssize_t __printf_pad (FILE *, char pad, int n) __THROW; /* In vfprintf.c. */
-#endif /* USE_IN_LIBIO */
+#define size_t _IO_size_t
+#define FILE _IO_FILE
/* Macros for doing the actual output. */
@@ -199,7 +193,8 @@ __printf_fphex (FILE *fp,
}
else
{
- if (__isinfl (fpnum.ldbl.d))
+ int res = __isinfl (fpnum.ldbl.d);
+ if (res)
{
if (isupper (info->spec))
{
@@ -211,9 +206,10 @@ __printf_fphex (FILE *fp,
special = "inf";
wspecial = L"inf";
}
+ negative = res < 0;
}
-
- negative = signbit (fpnum.ldbl.d);
+ else
+ negative = signbit (fpnum.ldbl.d);
}
}
else
@@ -238,7 +234,8 @@ __printf_fphex (FILE *fp,
}
else
{
- if (__isinf (fpnum.dbl.d))
+ int res = __isinf (fpnum.dbl.d);
+ if (res)
{
if (isupper (info->spec))
{
@@ -250,9 +247,10 @@ __printf_fphex (FILE *fp,
special = "inf";
wspecial = L"inf";
}
+ negative = res < 0;
}
-
- negative = signbit (fpnum.dbl.d);
+ else
+ negative = signbit (fpnum.dbl.d);
}
}
diff --git a/libc/stdio-common/printf_size.c b/libc/stdio-common/printf_size.c
index 4407cf673..db3b16ce0 100644
--- a/libc/stdio-common/printf_size.c
+++ b/libc/stdio-common/printf_size.c
@@ -1,5 +1,5 @@
/* Print size value using units for orders of magnitude.
- Copyright (C) 1997-2002, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2002, 2004, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Based on a proposal by Larry McVoy <lm@sgi.com>.
@@ -110,7 +110,7 @@ __printf_size (FILE *fp, const struct printf_info *info,
fpnum;
const void *ptr = &fpnum;
- int negative = 0;
+ int fpnum_sign = 0;
/* "NaN" or "Inf" for the special cases. */
const char *special = NULL;
@@ -126,7 +126,7 @@ __printf_size (FILE *fp, const struct printf_info *info,
be trusted to figure that out. */
const int wide = 0;
#endif
-
+ int res;
/* Fetch the argument value. */
#ifndef __NO_LONG_DOUBLE_MATH
@@ -139,14 +139,13 @@ __printf_size (FILE *fp, const struct printf_info *info,
{
special = "nan";
wspecial = L"nan";
- negative = 0;
+ // fpnum_sign = 0; Already zero
}
- else if (__isinfl (fpnum.ldbl.d))
+ else if ((res = __isinfl (fpnum.ldbl.d)))
{
+ fpnum_sign = res;
special = "inf";
wspecial = L"inf";
-
- negative = fpnum.ldbl.d < 0;
}
else
while (fpnum.ldbl.d >= divisor && tag[1] != '\0')
@@ -165,14 +164,13 @@ __printf_size (FILE *fp, const struct printf_info *info,
{
special = "nan";
wspecial = L"nan";
- negative = 0;
+ // fpnum_sign = 0; Already zero
}
- else if (__isinf (fpnum.dbl.d))
+ else if ((res = __isinf (fpnum.dbl.d)))
{
+ fpnum_sign = res;
special = "inf";
wspecial = L"inf";
-
- negative = fpnum.dbl.d < 0;
}
else
while (fpnum.dbl.d >= divisor && tag[1] != '\0')
@@ -186,14 +184,14 @@ __printf_size (FILE *fp, const struct printf_info *info,
{
int width = info->prec > info->width ? info->prec : info->width;
- if (negative || info->showsign || info->space)
+ if (fpnum_sign < 0 || info->showsign || info->space)
--width;
width -= 3;
if (!info->left && width > 0)
PADN (' ', width);
- if (negative)
+ if (fpnum_sign < 0)
outchar ('-');
else if (info->showsign)
outchar ('+');
diff --git a/libc/stdio-common/tmpfile.c b/libc/stdio-common/tmpfile.c
index 69963fd4a..b1507aed8 100644
--- a/libc/stdio-common/tmpfile.c
+++ b/libc/stdio-common/tmpfile.c
@@ -1,5 +1,5 @@
/* Open a stdio stream on an anonymous temporary file. Generic/POSIX version.
- Copyright (C) 1991,1993,1996-2000,2002,2003,2007,2009
+ Copyright (C) 1991,1993,1996-2000,2002,2003,2007,2009,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -22,12 +22,10 @@
#include <stdio.h>
#include <unistd.h>
-#ifdef USE_IN_LIBIO
-# include <iolibio.h>
-# define __fdopen INTUSE(_IO_fdopen)
-# ifndef tmpfile
-# define tmpfile __new_tmpfile
-# endif
+#include <iolibio.h>
+#define __fdopen INTUSE(_IO_fdopen)
+#ifndef tmpfile
+# define tmpfile __new_tmpfile
#endif
@@ -62,7 +60,7 @@ tmpfile (void)
return f;
}
-#if defined USE_IN_LIBIO && !defined FLAGS /* Not for tmpfile64. */
+#ifndef FLAGS /* Not for tmpfile64. */
# undef tmpfile
# include <shlib-compat.h>
versioned_symbol (libc, __new_tmpfile, tmpfile, GLIBC_2_1);
diff --git a/libc/stdio-common/vfscanf.c b/libc/stdio-common/vfscanf.c
index bf89ec5f9..7ed5cc5c4 100644
--- a/libc/stdio-common/vfscanf.c
+++ b/libc/stdio-common/vfscanf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2006, 2007, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2006, 2007, 2010, 2011 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
@@ -49,7 +49,7 @@
#if INT_MAX == LONG_MAX
# define need_long 0
#else
-# define need_long 1
+# define need_long 1
#endif
/* Those are flags in the conversion format. */
@@ -103,9 +103,9 @@
# define __strtof_internal __wcstof_internal
# define L_(Str) L##Str
-# define CHAR_T wchar_t
+# define CHAR_T wchar_t
# define UCHAR_T unsigned int
-# define WINT_T wint_t
+# define WINT_T wint_t
# undef EOF
# define EOF WEOF
#else
@@ -129,7 +129,7 @@
return EOF
# define L_(Str) Str
-# define CHAR_T char
+# define CHAR_T char
# define UCHAR_T unsigned char
# define WINT_T int
#endif
@@ -272,16 +272,39 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
CHAR_T *wp = NULL; /* Workspace. */
size_t wpmax = 0; /* Maximal size of workspace. */
size_t wpsize; /* Currently used bytes in workspace. */
+ bool use_malloc = false;
#define ADDW(Ch) \
do \
{ \
- if (wpsize == wpmax) \
+ if (__builtin_expect (wpsize == wpmax, 0)) \
{ \
CHAR_T *old = wp; \
- wpmax = (UCHAR_MAX + 1 > 2 * wpmax ? UCHAR_MAX + 1 : 2 * wpmax); \
- wp = (CHAR_T *) alloca (wpmax * sizeof (CHAR_T)); \
- if (old != NULL) \
- MEMCPY (wp, old, wpsize); \
+ size_t newsize = (UCHAR_MAX + 1 > 2 * wpmax \
+ ? UCHAR_MAX + 1 : 2 * wpmax); \
+ if (use_malloc || __libc_use_alloca (newsize)) \
+ { \
+ wp = realloc (use_malloc ? wp : NULL, newsize); \
+ if (wp == NULL) \
+ { \
+ if (use_malloc) \
+ free (old); \
+ done = EOF; \
+ goto errout; \
+ } \
+ if (! use_malloc) \
+ MEMCPY (wp, old, wpsize); \
+ wpmax = newsize; \
+ use_malloc = true; \
+ } \
+ else \
+ { \
+ size_t s = wpmax * sizeof (CHAR_T); \
+ wp = (CHAR_T *) extend_alloca (wp, s, \
+ newsize * sizeof (CHAR_T)); \
+ wpmax = s / sizeof (CHAR_T); \
+ if (old != NULL) \
+ MEMCPY (wp, old, wpsize); \
+ } \
} \
wp[wpsize++] = (Ch); \
} \
@@ -690,7 +713,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (Str != NULL) \
add_ptr_to_free (strptr); \
else if (flags & POSIX_MALLOC) \
- goto reteof; \
+ { \
+ done = EOF; \
+ goto errout; \
+ } \
} \
else \
Str = ARG (Type *); \
@@ -731,8 +757,11 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
newstr = (char *) realloc (*strptr,
strleng + MB_CUR_MAX);
if (newstr == NULL)
- /* c can't have `a' flag, only `m'. */
- goto reteof;
+ {
+ /* c can't have `a' flag, only `m'. */
+ done = EOF;
+ goto errout;
+ }
else
{
*strptr = newstr;
@@ -778,8 +807,11 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
effort. */
str = (char *) realloc (*strptr, strsize + 1);
if (str == NULL)
- /* c can't have `a' flag, only `m'. */
- goto reteof;
+ {
+ /* c can't have `a' flag, only `m'. */
+ done = EOF;
+ goto errout;
+ }
else
{
*strptr = (char *) str;
@@ -850,8 +882,12 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
(strsize + 1)
* sizeof (wchar_t));
if (wstr == NULL)
- /* C or lc can't have `a' flag, only `m' flag. */
- goto reteof;
+ {
+ /* C or lc can't have `a' flag, only `m'
+ flag. */
+ done = EOF;
+ goto errout;
+ }
else
{
*strptr = (char *) wstr;
@@ -901,8 +937,11 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
((strsize + 1)
* sizeof (wchar_t)));
if (wstr == NULL)
- /* C or lc can't have `a' flag, only `m' flag. */
- goto reteof;
+ {
+ /* C or lc can't have `a' flag, only `m' flag. */
+ done = EOF;
+ goto errout;
+ }
else
{
*strptr = (char *) wstr;
@@ -1014,7 +1053,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (newstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the
string and stop converting,
so at least we don't skip any input. */
@@ -1064,7 +1106,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (str == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the
string and stop converting,
so at least we don't skip any input. */
@@ -1110,7 +1155,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (newstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the string
and stop converting, so at least we don't
skip any input. */
@@ -1194,7 +1242,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (wstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the string
and stop converting, so at least we don't
skip any input. */
@@ -1266,7 +1317,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (wstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the
string and stop converting, so at
least we don't skip any input. */
@@ -2470,7 +2524,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (wstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the string
and stop converting, so at least we don't
skip any input. */
@@ -2552,7 +2609,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (wstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the
string and stop converting,
so at least we don't skip any input. */
@@ -2694,7 +2754,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (newstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the string
and stop converting, so at least we don't
skip any input. */
@@ -2759,7 +2822,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
goto allocagain;
}
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the
string and stop converting,
so at least we don't skip any input. */
@@ -2802,7 +2868,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (newstr == NULL)
{
if (flags & POSIX_MALLOC)
- goto reteof;
+ {
+ done = EOF;
+ goto errout;
+ }
/* We lose. Oh well. Terminate the string
and stop converting, so at least we don't
skip any input. */
@@ -2865,12 +2934,14 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
/* Unlock stream. */
UNLOCK_STREAM (s);
+ if (use_malloc)
+ free (wp);
+
if (errp != NULL)
*errp |= errval;
- if (done == EOF)
+ if (__builtin_expect (done == EOF, 0))
{
- reteof:
if (__builtin_expect (ptrs_to_free != NULL, 0))
{
struct ptrs_to_free *p = ptrs_to_free;
@@ -2885,7 +2956,6 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
ptrs_to_free = p;
}
}
- return EOF;
}
else if (__builtin_expect (strptr != NULL, 0))
{
diff --git a/libc/stdlib/abort.c b/libc/stdlib/abort.c
index e9d0ab18f..3e517570d 100644
--- a/libc/stdlib/abort.c
+++ b/libc/stdlib/abort.c
@@ -32,10 +32,8 @@
# define ABORT_INSTRUCTION
#endif
-#ifdef USE_IN_LIBIO
-# include <libio/libioP.h>
-# define fflush(s) _IO_flush_all_lockp (0)
-#endif
+#include <libio/libioP.h>
+#define fflush(s) _IO_flush_all_lockp (0)
/* Exported variable to locate abort message in core files etc. */
struct abort_msg_s *__abort_msg __attribute__ ((nocommon));
diff --git a/libc/stdlib/fmtmsg.c b/libc/stdlib/fmtmsg.c
index 2a4d16a46..8ee06bfd0 100644
--- a/libc/stdlib/fmtmsg.c
+++ b/libc/stdlib/fmtmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1999,2000-2003,2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999-2003,2005,2006,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,9 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/syslog.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
/* We have global data, protect the modification. */
diff --git a/libc/stdlib/longlong.h b/libc/stdlib/longlong.h
index 1bab76db3..60b35a3ac 100644
--- a/libc/stdlib/longlong.h
+++ b/libc/stdlib/longlong.h
@@ -1,6 +1,6 @@
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -343,23 +343,24 @@ UDItype __umulsidi3 (USItype, USItype);
#else
#define smul_ppmm(xh, xl, m0, m1) \
do { \
- register SItype r0 __asm__ ("0"); \
- register SItype r1 __asm__ ("1") = m0; \
- \
+ register SItype __r0 __asm__ ("0"); \
+ register SItype __r1 __asm__ ("1") = (m0); \
+ \
__asm__ ("mr\t%%r0,%3" \
- : "=r" (r0), "=r" (r1) \
- : "r" (r1), "r" (m1)); \
- (xh) = r0; (xl) = r1; \
+ : "=r" (__r0), "=r" (__r1) \
+ : "r" (__r1), "r" (m1)); \
+ (xh) = __r0; (xl) = __r1; \
} while (0)
+
#define sdiv_qrnnd(q, r, n1, n0, d) \
do { \
- register SItype r0 __asm__ ("0") = n0; \
- register SItype r1 __asm__ ("1") = n1; \
- \
- __asm__ ("dr\t%%r0,%3" \
- : "=r" (r0), "=r" (r1) \
- : "r" (r0), "r" (r1), "r" (d)); \
- (q) = r0; (r) = r1; \
+ register SItype __r0 __asm__ ("0") = (n1); \
+ register SItype __r1 __asm__ ("1") = (n0); \
+ \
+ __asm__ ("dr\t%%r0,%4" \
+ : "=r" (__r0), "=r" (__r1) \
+ : "r" (__r0), "r" (__r1), "r" (d)); \
+ (q) = __r1; (r) = __r0; \
} while (0)
#endif /* __zarch__ */
#endif
@@ -801,9 +802,9 @@ UDItype __umulsidi3 (USItype, USItype);
#define count_trailing_zeros(count,x) \
do { \
__asm__ ("ffsd %2,%0" \
- : "=r" ((USItype) (count)) \
- : "0" ((USItype) 0), \
- "r" ((USItype) (x))); \
+ : "=r" ((USItype) (count)) \
+ : "0" ((USItype) 0), \
+ "r" ((USItype) (x))); \
} while (0)
#endif /* __ns32000__ */
@@ -819,7 +820,7 @@ UDItype __umulsidi3 (USItype, USItype);
|| defined (__ppc__) /* Darwin */ \
|| (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */ \
|| (defined (PPC) && defined (CPU_FAMILY) /* VxWorks */ \
- && CPU_FAMILY == PPC) \
+ && CPU_FAMILY == PPC) \
) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
do { \
@@ -860,7 +861,7 @@ UDItype __umulsidi3 (USItype, USItype);
|| defined (__ppc__) \
|| (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */ \
|| (defined (PPC) && defined (CPU_FAMILY) /* VxWorks */ \
- && CPU_FAMILY == PPC)
+ && CPU_FAMILY == PPC)
#define umul_ppmm(ph, pl, m0, m1) \
do { \
USItype __m0 = (m0), __m1 = (m1); \
@@ -1028,7 +1029,7 @@ UDItype __umulsidi3 (USItype, USItype);
#define udiv_qrnnd(q, r, n1, n0, d) \
do { \
extern UWtype __udiv_qrnnd_16 (UWtype, UWtype) \
- __attribute__ ((visibility ("hidden"))); \
+ __attribute__ ((visibility ("hidden"))); \
/* r0: rn r1: qn */ /* r0: n1 r4: n0 r5: d r6: d1 */ /* r2: __m */ \
__asm__ ( \
"mov%M4 %4,r5\n" \
@@ -1163,8 +1164,8 @@ UDItype __umulsidi3 (USItype, USItype);
#define count_leading_zeros(count, x) \
do { \
__asm__ ("scan %1,1,%0" \
- : "=r" ((USItype) (count)) \
- : "r" ((USItype) (x))); \
+ : "=r" ((USItype) (count)) \
+ : "r" ((USItype) (x))); \
} while (0)
/* Early sparclites return 63 for an argument of 0, but they warn that future
implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0
diff --git a/libc/string/Makefile b/libc/string/Makefile
index 699ccce0a..46d32188b 100644
--- a/libc/string/Makefile
+++ b/libc/string/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2002, 2005-2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1991-2002, 2005-2010, 2011 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
@@ -50,11 +50,11 @@ routines-$(OPTION_EGLIBC_ENVZ) += envz
# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks.
o-objects.ob := memcpy.o memset.o memchr.o
-strop-tests := wcscmp memchr memcmp memcpy memmove mempcpy memset memccpy \
+strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \
stpcpy stpncpy strcat strchr strcmp strcpy strcspn \
strlen strncmp strncpy strpbrk strrchr strspn memmem \
strstr strcasestr strnlen strcasecmp strncasecmp \
- strncat
+ strncat rawmemchr
tests := tester inl-tester noinl-tester testcopy test-ffs \
tst-strlen stratcliff tst-svc tst-inlcall \
bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
diff --git a/libc/string/memrchr.c b/libc/string/memrchr.c
index 21662b1bd..498a4376e 100644
--- a/libc/string/memrchr.c
+++ b/libc/string/memrchr.c
@@ -63,7 +63,12 @@
/* Search no more than N bytes of S for C. */
__ptr_t
-__memrchr (s, c_in, n)
+#ifndef MEMRCHR
+__memrchr
+#else
+MEMRCHR
+#endif
+ (s, c_in, n)
const __ptr_t s;
int c_in;
size_t n;
@@ -205,6 +210,8 @@ __memrchr (s, c_in, n)
return 0;
}
-#ifdef weak_alias
+#ifndef MEMRCHR
+# ifdef weak_alias
weak_alias (__memrchr, memrchr)
+# endif
#endif
diff --git a/libc/string/stratcliff.c b/libc/string/stratcliff.c
index 5165be2d1..5176409c5 100644
--- a/libc/string/stratcliff.c
+++ b/libc/string/stratcliff.c
@@ -1,5 +1,5 @@
/* Test for string function add boundaries of usable memory.
- Copyright (C) 1996,1997,1999-2003,2007,2009,2010
+ Copyright (C) 1996,1997,1999-2003,2007,2009,2010,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -240,7 +240,7 @@ do_test (void)
}
}
- /* This function only exists for single-byte characters. */
+ /* These functions only exist for single-byte characters. */
#ifndef WCSTEST
/* rawmemchr test */
for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
@@ -261,6 +261,37 @@ do_test (void)
adr[middle] = L('T');
}
}
+
+ /* memrchr test */
+ for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+ {
+ for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+ {
+ adr[middle] = L('V');
+
+ CHAR *cp = memrchr (&adr[outer], L('V'), nchars - outer);
+
+ if (cp - &adr[outer] != middle - outer)
+ {
+ printf ("%s flunked for outer = %d, middle = %d\n",
+ STRINGIFY (memrchr), outer, middle);
+ result = 1;
+ }
+
+ adr[middle] = L('T');
+ }
+ }
+ for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+ {
+ CHAR *cp = memrchr (&adr[outer], L('V'), nchars - outer);
+
+ if (cp != NULL)
+ {
+ printf ("%s flunked for outer = %d\n",
+ STRINGIFY (memrchr), outer);
+ result = 1;
+ }
+ }
#endif
/* strcpy/wcscpy test */
diff --git a/libc/string/strncat.c b/libc/string/strncat.c
index 0a3d4af70..bf6f99b27 100644
--- a/libc/string/strncat.c
+++ b/libc/string/strncat.c
@@ -25,6 +25,7 @@ typedef char reg_char;
#endif
#ifndef STRNCAT
+# undef strncat
# define STRNCAT strncat
#endif
diff --git a/libc/string/strnlen.c b/libc/string/strnlen.c
index 454257b2b..d083ec29e 100644
--- a/libc/string/strnlen.c
+++ b/libc/string/strnlen.c
@@ -1,5 +1,5 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 1991,1993,1997,2000,2001,2005 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1997, 2000, 2001, 2005, 2011 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
Based on strlen written by Torbjorn Granlund (tege@sics.se),
@@ -26,12 +26,17 @@
/* Find the length of S, but scan at most MAXLEN characters. If no
'\0' terminator is found in that many characters, return MAXLEN. */
+
+#ifdef STRNLEN
+# define __strnlen STRNLEN
+#endif
+
size_t
__strnlen (const char *str, size_t maxlen)
{
const char *char_ptr, *end_ptr = str + maxlen;
const unsigned long int *longword_ptr;
- unsigned long int longword, magic_bits, himagic, lomagic;
+ unsigned long int longword, himagic, lomagic;
if (maxlen == 0)
return 0;
@@ -65,14 +70,12 @@ __strnlen (const char *str, size_t maxlen)
The 1-bits make sure that carries propagate to the next 0-bit.
The 0-bits provide holes for carries to fall into. */
- magic_bits = 0x7efefeffL;
himagic = 0x80808080L;
lomagic = 0x01010101L;
if (sizeof (longword) > 4)
{
/* 64-bit version of the magic. */
/* Do the shift in two steps to avoid a warning if long has 32 bits. */
- magic_bits = ((0x7efefefeL << 16) << 16) | 0xfefefeffL;
himagic = ((himagic << 16) << 16) | himagic;
lomagic = ((lomagic << 16) << 16) | lomagic;
}
@@ -157,5 +160,7 @@ __strnlen (const char *str, size_t maxlen)
char_ptr = end_ptr;
return char_ptr - str;
}
+#ifndef STRNLEN
weak_alias (__strnlen, strnlen)
+#endif
libc_hidden_def (strnlen)
diff --git a/libc/string/test-memcmp.c b/libc/string/test-memcmp.c
index 3040e212a..f246d3a78 100644
--- a/libc/string/test-memcmp.c
+++ b/libc/string/test-memcmp.c
@@ -1,7 +1,8 @@
/* Test and measure memcmp functions.
- Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
+ Added wmemcmp support by Liubov Dmitrieva <liubov.dmitrieva@gmail.com>, 2011.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -20,25 +21,57 @@
#define TEST_MAIN
#include "test-string.h"
-
-typedef int (*proto_t) (const char *, const char *, size_t);
-int simple_memcmp (const char *, const char *, size_t);
-
-IMPL (simple_memcmp, 0)
-IMPL (memcmp, 1)
+#ifdef WIDE
+# include <inttypes.h>
+# include <wchar.h>
+
+# define MEMCMP wmemcmp
+# define MEMCPY wmemcpy
+# define SIMPLE_MEMCMP simple_wmemcmp
+# define CHAR wchar_t
+# define UCHAR wchar_t
+# define CHARBYTES 4
+# define CHAR__MIN WCHAR_MIN
+# define CHAR__MAX WCHAR_MAX
+int
+simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+ int ret = 0;
+ /* Warning!
+ wmemcmp has to use SIGNED comparison for elements.
+ memcmp has to use UNSIGNED comparison for elemnts.
+ */
+ while (n-- && (ret = *s1 < *s2 ? -1 : *s1 == *s2 ? 0 : 1) == 0) {s1++; s2++;}
+ return ret;
+}
+#else
+# define MEMCMP memcmp
+# define MEMCPY memcpy
+# define SIMPLE_MEMCMP simple_memcmp
+# define CHAR char
+# define MAX_CHAR 255
+# define UCHAR unsigned char
+# define CHARBYTES 1
+# define CHAR__MIN CHAR_MIN
+# define CHAR__MAX CHAR_MAX
int
simple_memcmp (const char *s1, const char *s2, size_t n)
{
int ret = 0;
- while (n--
- && (ret = *(unsigned char *) s1++ - *(unsigned char *) s2++) == 0);
+ while (n-- && (ret = *(unsigned char *) s1++ - *(unsigned char *) s2++) == 0);
return ret;
}
+#endif
+
+typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
+
+IMPL (SIMPLE_MEMCMP, 0)
+IMPL (MEMCMP, 1)
static int
-check_result (impl_t *impl, const char *s1, const char *s2, size_t len,
+check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
int exp_result)
{
int result = CALL (impl, s1, s2, len);
@@ -56,7 +89,7 @@ check_result (impl_t *impl, const char *s1, const char *s2, size_t len,
}
static void
-do_one_test (impl_t *impl, const char *s1, const char *s2, size_t len,
+do_one_test (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len,
int exp_result)
{
if (check_result (impl, s1, s2, len, exp_result) < 0)
@@ -85,24 +118,24 @@ static void
do_test (size_t align1, size_t align2, size_t len, int exp_result)
{
size_t i;
- char *s1, *s2;
+ CHAR *s1, *s2;
if (len == 0)
return;
- align1 &= 7;
- if (align1 + len >= page_size)
+ align1 &= 63;
+ if (align1 + (len + 1) * CHARBYTES >= page_size)
return;
- align2 &= 7;
- if (align2 + len >= page_size)
+ align2 &= 63;
+ if (align2 + (len + 1) * CHARBYTES >= page_size)
return;
- s1 = (char *) (buf1 + align1);
- s2 = (char *) (buf2 + align2);
+ s1 = (CHAR *) (buf1 + align1);
+ s2 = (CHAR *) (buf2 + align2);
for (i = 0; i < len; i++)
- s1[i] = s2[i] = 1 + 23 * i % 255;
+ s1[i] = s2[i] = 1 + (23 << ((CHARBYTES - 1) * 8)) * i % CHAR__MAX;
s1[len] = align1;
s2[len] = align2;
@@ -124,12 +157,12 @@ do_random_tests (void)
size_t i, j, n, align1, align2, pos, len;
int result;
long r;
- unsigned char *p1 = buf1 + page_size - 512;
- unsigned char *p2 = buf2 + page_size - 512;
+ UCHAR *p1 = (UCHAR *) (buf1 + page_size - 512 * CHARBYTES);
+ UCHAR *p2 = (UCHAR *) (buf2 + page_size - 512 * CHARBYTES);
for (n = 0; n < ITERATIONS; n++)
{
- align1 = random () & 31;
+ align1 = random () & 31;
if (random () & 1)
align2 = random () & 31;
else
@@ -142,7 +175,7 @@ do_random_tests (void)
pos = 511 - j - (random () & 7);
len = random () & 511;
if (len + j >= 512)
- len = 511 - j - (random () & 7);
+ len = 511 - j - (random () & 7);
j = len + align1 + 64;
if (j > 512) j = 512;
for (i = 0; i < j; ++i)
@@ -152,10 +185,10 @@ do_random_tests (void)
result = 0;
if (pos >= len)
- memcpy (p2 + align2, p1 + align1, len);
+ MEMCPY ((CHAR *) p2 + align2, (const CHAR *) p1 + align1, len);
else
{
- memcpy (p2 + align2, p1 + align1, pos);
+ MEMCPY ((CHAR *) p2 + align2, (const CHAR *) p1 + align1, pos);
if (p2[align2 + pos] == p1[align1 + pos])
{
p2[align2 + pos] = random () & 255;
@@ -171,16 +204,14 @@ do_random_tests (void)
FOR_EACH_IMPL (impl, 1)
{
- r = CALL (impl, (char *) (p1 + align1), (char *) (p2 + align2), len);
- /* Test whether on 64-bit architectures where ABI requires
- callee to promote has the promotion been done. */
- asm ("" : "=g" (r) : "0" (r));
+ r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2,
+ len);
if ((r == 0 && result)
|| (r < 0 && result >= 0)
|| (r > 0 && result <= 0))
{
error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p",
- n, impl->name, align1, align2, len, pos, r, result, p1, p2);
+ n, impl->name, align1 * CHARBYTES & 63, align2 * CHARBYTES & 63, len, pos, r, result, p1, p2);
ret = 1;
}
}
@@ -190,7 +221,7 @@ do_random_tests (void)
static void
check1 (void)
{
- char s1[116], s2[116];
+ CHAR s1[116], s2[116];
int n, exp_result;
s1[0] = -108;
@@ -395,8 +426,8 @@ check1 (void)
s2[99] = 1;
s1[100] = 116;
s2[100] = 116;
- s1[101] = -13;
- s2[101] = -13;
+ s1[101] = CHAR__MIN;
+ s2[101] = CHAR__MAX;
s1[102] = -109;
s2[102] = -109;
s1[103] = 1;
@@ -417,8 +448,8 @@ check1 (void)
s2[110] = -109;
s1[111] = 1;
s2[111] = 1;
- s1[112] = 20;
- s2[112] = 20;
+ s1[112] = CHAR__MAX;
+ s2[112] = CHAR__MIN;
s1[113] = -13;
s2[113] = -13;
s1[114] = -109;
@@ -427,9 +458,12 @@ check1 (void)
s2[115] = 1;
n = 116;
- exp_result = simple_memcmp (s1, s2, n);
- FOR_EACH_IMPL (impl, 0)
- check_result (impl, s1, s2, n, exp_result);
+ for (size_t i = 0; i < n; i++)
+ {
+ exp_result = SIMPLE_MEMCMP (s1 + i, s2 + i, n - i);
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s1 + i, s2 + i, n - i, exp_result);
+ }
}
int
@@ -448,9 +482,9 @@ test_main (void)
for (i = 1; i < 16; ++i)
{
- do_test (i, i, i, 0);
- do_test (i, i, i, 1);
- do_test (i, i, i, -1);
+ do_test (i * CHARBYTES, i * CHARBYTES, i, 0);
+ do_test (i * CHARBYTES, i * CHARBYTES, i, 1);
+ do_test (i * CHARBYTES, i * CHARBYTES, i, -1);
}
for (i = 0; i < 16; ++i)
@@ -466,20 +500,19 @@ test_main (void)
do_test (0, 0, 2 << i, 1);
do_test (0, 0, 2 << i, -1);
do_test (0, 0, 16 << i, 0);
- do_test (8 - i, 2 * i, 16 << i, 0);
+ do_test ((8 - i) * CHARBYTES, (2 * i) * CHARBYTES, 16 << i, 0);
do_test (0, 0, 16 << i, 1);
do_test (0, 0, 16 << i, -1);
}
for (i = 1; i < 8; ++i)
{
- do_test (i, 2 * i, 8 << i, 0);
- do_test (i, 2 * i, 8 << i, 1);
- do_test (i, 2 * i, 8 << i, -1);
+ do_test (i * CHARBYTES, 2 * (i * CHARBYTES), 8 << i, 0);
+ do_test (i * CHARBYTES, 2 * (i * CHARBYTES), 8 << i, 1);
+ do_test (i * CHARBYTES, 2 * (i * CHARBYTES), 8 << i, -1);
}
do_random_tests ();
return ret;
}
-
#include "../test-skeleton.c"
diff --git a/libc/string/test-rawmemchr.c b/libc/string/test-rawmemchr.c
new file mode 100644
index 000000000..58c1b158f
--- /dev/null
+++ b/libc/string/test-rawmemchr.c
@@ -0,0 +1,189 @@
+/* Test and measure memchr functions.
+ Copyright (C) 1999,2002,2003,2005,2009,2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Jakub Jelinek <jakub@redhat.com>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <assert.h>
+
+#define TEST_MAIN
+#include "test-string.h"
+
+typedef char *(*proto_t) (const char *, int);
+char *simple_rawmemchr (const char *, int);
+
+IMPL (simple_rawmemchr, 0)
+IMPL (rawmemchr, 1)
+
+char *
+simple_rawmemchr (const char *s, int c)
+{
+ while (1)
+ if (*s++ == (char) c)
+ return (char *) s - 1;
+ return NULL;
+}
+
+static void
+do_one_test (impl_t *impl, const char *s, int c, char *exp_res)
+{
+ char *res = CALL (impl, s, c);
+ if (res != exp_res)
+ {
+ error (0, 0, "Wrong result in function %s %p %p", impl->name,
+ res, exp_res);
+ ret = 1;
+ return;
+ }
+
+ if (HP_TIMING_AVAIL)
+ {
+ hp_timing_t start __attribute ((unused));
+ hp_timing_t stop __attribute ((unused));
+ hp_timing_t best_time = ~ (hp_timing_t) 0;
+ size_t i;
+
+ for (i = 0; i < 32; ++i)
+ {
+ HP_TIMING_NOW (start);
+ CALL (impl, s, c);
+ HP_TIMING_NOW (stop);
+ HP_TIMING_BEST (best_time, start, stop);
+ }
+
+ printf ("\t%zd", (size_t) best_time);
+ }
+}
+
+static void
+do_test (size_t align, size_t pos, size_t len, int seek_char)
+{
+ size_t i;
+ char *result;
+
+ align &= 7;
+ if (align + len >= page_size)
+ return;
+
+ for (i = 0; i < len; ++i)
+ {
+ buf1[align + i] = 1 + 23 * i % 127;
+ if (buf1[align + i] == seek_char)
+ buf1[align + i] = seek_char + 1;
+ }
+ buf1[align + len] = 0;
+
+ assert (pos < len);
+
+ buf1[align + pos] = seek_char;
+ buf1[align + len] = -seek_char;
+ result = (char *) (buf1 + align + pos);
+
+ if (HP_TIMING_AVAIL)
+ printf ("Length %4zd, alignment %2zd:", pos, align);
+
+ FOR_EACH_IMPL (impl, 0)
+ do_one_test (impl, (char *) (buf1 + align), seek_char, result);
+
+ if (HP_TIMING_AVAIL)
+ putchar ('\n');
+}
+
+static void
+do_random_tests (void)
+{
+ size_t i, j, n, align, pos, len;
+ int seek_char;
+ char *result;
+ unsigned char *p = buf1 + page_size - 512;
+
+ for (n = 0; n < ITERATIONS; n++)
+ {
+ align = random () & 15;
+ pos = random () & 511;
+ if (pos + align >= 512)
+ pos = 511 - align - (random () & 7);
+ len = random () & 511;
+ if (len + align >= 512)
+ len = 512 - align - (random () & 7);
+ if (pos >= len)
+ continue;
+ seek_char = random () & 255;
+ j = len + align + 64;
+ if (j > 512)
+ j = 512;
+
+ for (i = 0; i < j; i++)
+ {
+ if (i == pos + align)
+ p[i] = seek_char;
+ else
+ {
+ p[i] = random () & 255;
+ if (i < pos + align && p[i] == seek_char)
+ p[i] = seek_char + 13;
+ }
+ }
+
+ assert (pos < len);
+ size_t r = random ();
+ if ((r & 31) == 0)
+ len = ~(uintptr_t) (p + align) - ((r >> 5) & 31);
+ result = (char *) (p + pos + align);
+
+ FOR_EACH_IMPL (impl, 1)
+ if (CALL (impl, (char *) (p + align), seek_char) != result)
+ {
+ error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p",
+ n, impl->name, align, seek_char, len, pos,
+ CALL (impl, (char *) (p + align), seek_char),
+ result, p);
+ ret = 1;
+ }
+ }
+}
+
+int
+test_main (void)
+{
+ size_t i;
+
+ test_init ();
+
+ printf ("%20s", "");
+ FOR_EACH_IMPL (impl, 0)
+ printf ("\t%s", impl->name);
+ putchar ('\n');
+
+ for (i = 1; i < 7; ++i)
+ {
+ do_test (0, 16 << i, 2048, 23);
+ do_test (i, 64, 256, 23);
+ do_test (0, 16 << i, 2048, 0);
+ do_test (i, 64, 256, 0);
+ }
+ for (i = 1; i < 32; ++i)
+ {
+ do_test (0, i, i + 1, 23);
+ do_test (0, i, i + 1, 0);
+ }
+
+ do_random_tests ();
+ return ret;
+}
+
+#include "../test-skeleton.c"
diff --git a/libc/string/test-strchr.c b/libc/string/test-strchr.c
index cf25b449d..518a4dce3 100644
--- a/libc/string/test-strchr.c
+++ b/libc/string/test-strchr.c
@@ -1,7 +1,8 @@
-/* Test and measure strchr functions.
- Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+/* Test and measure STRCHR functions.
+ Copyright (C) 1999, 2002, 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
+ Added wcschr support by Liubov Dmitrieva <liubov.dmitrieva@gmail.com>, 2011
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -21,38 +22,55 @@
#define TEST_MAIN
#include "test-string.h"
-typedef char *(*proto_t) (const char *, int);
-char *simple_strchr (const char *, int);
-char *stupid_strchr (const char *, int);
-
-IMPL (stupid_strchr, 0)
-IMPL (simple_strchr, 0)
-IMPL (strchr, 1)
-
-char *
-simple_strchr (const char *s, int c)
+#ifndef WIDE
+# define STRCHR strchr
+# define STRLEN strlen
+# define CHAR char
+# define BIG_CHAR CHAR_MAX
+# define MIDDLE_CHAR 127
+# define SMALL_CHAR 23
+# define UCHAR unsigned char
+#else
+# include <wchar.h>
+# define STRCHR wcschr
+# define STRLEN wcslen
+# define CHAR wchar_t
+# define BIG_CHAR WCHAR_MAX
+# define MIDDLE_CHAR 1121
+# define SMALL_CHAR 851
+# define UCHAR wchar_t
+#endif
+
+typedef CHAR *(*proto_t) (const CHAR *, int);
+
+CHAR *
+simple_STRCHR (const CHAR *s, int c)
{
- for (; *s != (char) c; ++s)
+ for (; *s != (CHAR) c; ++s)
if (*s == '\0')
return NULL;
- return (char *) s;
+ return (CHAR *) s;
}
-char *
-stupid_strchr (const char *s, int c)
+CHAR *
+stupid_STRCHR (const CHAR *s, int c)
{
- size_t n = strlen (s) + 1;
+ size_t n = STRLEN (s) + 1;
while (n--)
- if (*s++ == (char) c)
- return (char *) s - 1;
+ if (*s++ == (CHAR) c)
+ return (CHAR *) s - 1;
return NULL;
}
+IMPL (stupid_STRCHR, 1)
+IMPL (simple_STRCHR, 1)
+IMPL (STRCHR, 1)
+
static void
-do_one_test (impl_t *impl, const char *s, int c, char *exp_res)
+do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res)
{
- char *res = CALL (impl, s, c);
+ CHAR *res = CALL (impl, s, c);
if (res != exp_res)
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
@@ -82,37 +100,40 @@ do_one_test (impl_t *impl, const char *s, int c, char *exp_res)
static void
do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
+/* for wcschr: align here means align not in bytes,
+ * but in wchar_ts, in bytes it will equal to align * (sizeof (wchar_t))
+ * len for wcschr here isn't in bytes but it's number of wchar_t symbols */
{
size_t i;
- char *result;
-
- align &= 7;
- if (align + len >= page_size)
+ CHAR *result;
+ CHAR *buf = (CHAR *) (buf1);
+ align &= 15;
+ if ((align + len) * sizeof(CHAR) >= page_size)
return;
for (i = 0; i < len; ++i)
{
- buf1[align + i] = 32 + 23 * i % (max_char - 32);
- if (buf1[align + i] == seek_char)
- buf1[align + i] = seek_char + 1;
+ buf[align + i] = 32 + 23 * i % max_char;
+ if (buf[align + i] == seek_char)
+ buf[align + i] = seek_char + 1;
}
- buf1[align + len] = 0;
+ buf[align + len] = 0;
if (pos < len)
{
- buf1[align + pos] = seek_char;
- result = (char *) (buf1 + align + pos);
+ buf[align + pos] = seek_char;
+ result = buf + align + pos;
}
else if (seek_char == 0)
- result = (char *) (buf1 + align + len);
+ result = buf + align + len;
else
result = NULL;
if (HP_TIMING_AVAIL)
- printf ("Length %4zd, alignment %2zd:", pos, align);
+ printf ("Length %4zd, alignment in bytes %2zd:", pos, align * sizeof (CHAR));
FOR_EACH_IMPL (impl, 0)
- do_one_test (impl, (char *) (buf1 + align), seek_char, result);
+ do_one_test (impl, buf + align, seek_char, result);
if (HP_TIMING_AVAIL)
putchar ('\n');
@@ -123,27 +144,30 @@ do_random_tests (void)
{
size_t i, j, n, align, pos, len;
int seek_char;
- char *result;
- unsigned char *p = buf1 + page_size - 512;
+ CHAR *result;
+ UCHAR *p = (UCHAR *) (buf1 + page_size - 512 * sizeof (CHAR));
for (n = 0; n < ITERATIONS; n++)
{
+/* for wcschr: align here means align not in bytes, but in wchar_ts,
+ * in bytes it will equal to align * (sizeof (wchar_t)) */
align = random () & 15;
pos = random () & 511;
seek_char = random () & 255;
if (pos + align >= 511)
pos = 510 - align - (random () & 7);
+/* len for wcschr here isn't in bytes but it's number of wchar_t symbols */
len = random () & 511;
if ((pos == len && seek_char)
|| (pos > len && (random () & 1)))
len = pos + 1 + (random () & 7);
if (len + align >= 512)
- len = 511 - align - (random () & 7);
+ len = 511 - align - (random () & 7);
if (pos == len && seek_char)
len = pos + 1;
j = (pos > len ? pos : len) + align + 64;
if (j > 512)
- j = 512;
+ j = 512;
for (i = 0; i < j; i++)
{
@@ -166,18 +190,19 @@ do_random_tests (void)
}
if (pos <= len)
- result = (char *) (p + pos + align);
+ result = (CHAR *) (p + pos + align);
else if (seek_char == 0)
- result = (char *) (p + len + align);
+ result = (CHAR *) (p + len + align);
else
result = NULL;
FOR_EACH_IMPL (impl, 1)
- if (CALL (impl, (char *) (p + align), seek_char) != result)
+ if (CALL (impl, (CHAR *) (p + align), seek_char) != result)
{
- error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p",
- n, impl->name, align, seek_char, len, pos,
- CALL (impl, (char *) (p + align), seek_char), result, p);
+ error (0, 0, "Iteration %zd - wrong result in function \
+ %s (align in bytes: %zd, seek_char: %d, len: %zd, pos: %zd) %p != %p, p %p",
+ n, impl->name, align * sizeof (CHAR), seek_char, len, pos,
+ CALL (impl, (CHAR *) (p + align), seek_char), result, p);
ret = 1;
}
}
@@ -197,38 +222,38 @@ test_main (void)
for (i = 1; i < 8; ++i)
{
- do_test (0, 16 << i, 2048, 23, 127);
- do_test (i, 16 << i, 2048, 23, 127);
+ do_test (0, 16 << i, 2048, SMALL_CHAR, MIDDLE_CHAR);
+ do_test (i, 16 << i, 2048, SMALL_CHAR, MIDDLE_CHAR);
}
for (i = 1; i < 8; ++i)
{
- do_test (i, 64, 256, 23, 127);
- do_test (i, 64, 256, 23, 255);
+ do_test (i, 64, 256, SMALL_CHAR, MIDDLE_CHAR);
+ do_test (i, 64, 256, SMALL_CHAR, BIG_CHAR);
}
for (i = 0; i < 32; ++i)
{
- do_test (0, i, i + 1, 23, 127);
- do_test (0, i, i + 1, 23, 255);
+ do_test (0, i, i + 1, SMALL_CHAR, MIDDLE_CHAR);
+ do_test (0, i, i + 1, SMALL_CHAR, BIG_CHAR);
}
for (i = 1; i < 8; ++i)
{
- do_test (0, 16 << i, 2048, 0, 127);
- do_test (i, 16 << i, 2048, 0, 127);
+ do_test (0, 16 << i, 2048, 0, MIDDLE_CHAR);
+ do_test (i, 16 << i, 2048, 0, MIDDLE_CHAR);
}
for (i = 1; i < 8; ++i)
{
- do_test (i, 64, 256, 0, 127);
- do_test (i, 64, 256, 0, 255);
+ do_test (i, 64, 256, 0, MIDDLE_CHAR);
+ do_test (i, 64, 256, 0, BIG_CHAR);
}
for (i = 0; i < 32; ++i)
{
- do_test (0, i, i + 1, 0, 127);
- do_test (0, i, i + 1, 0, 255);
+ do_test (0, i, i + 1, 0, MIDDLE_CHAR);
+ do_test (0, i, i + 1, 0, BIG_CHAR);
}
do_random_tests ();
diff --git a/libc/string/test-strcmp.c b/libc/string/test-strcmp.c
index b8d85dca7..9ea4df759 100644
--- a/libc/string/test-strcmp.c
+++ b/libc/string/test-strcmp.c
@@ -1,4 +1,4 @@
-/* Test and measure STRCMP functions.
+/* Test and measure strcmp and wcscmp functions.
Copyright (C) 1999, 2002, 2003, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -23,7 +23,6 @@
#include "test-string.h"
#ifdef WIDE
-# include <inttypes.h>
# include <wchar.h>
# define L(str) L##str
@@ -34,12 +33,53 @@
# define SIMPLE_STRCMP simple_wcscmp
# define STUPID_STRCMP stupid_wcscmp
# define CHAR wchar_t
-# define UCHAR uint32_t
+# define UCHAR wchar_t
# define CHARBYTES 4
# define CHARBYTESLOG 2
# define CHARALIGN __alignof__ (CHAR)
# define MIDCHAR 0x7fffffff
# define LARGECHAR 0xfffffffe
+# define CHAR__MAX WCHAR_MAX
+# define CHAR__MIN WCHAR_MIN
+
+/* Wcscmp uses signed semantics for comparison, not unsigned */
+/* Avoid using substraction since possible overflow */
+
+int
+simple_wcscmp (const wchar_t *s1, const wchar_t *s2)
+{
+ wchar_t c1, c2;
+ do
+ {
+ c1 = *s1++;
+ c2 = *s2++;
+ if (c2 == L'\0')
+ return c1 - c2;
+ }
+ while (c1 == c2);
+
+ return c1 < c2 ? -1 : 1;
+}
+
+int
+stupid_wcscmp (const wchar_t *s1, const wchar_t *s2)
+{
+ size_t ns1 = wcslen (s1) + 1;
+ size_t ns2 = wcslen (s2) + 1;
+ size_t n = ns1 < ns2 ? ns1 : ns2;
+ int ret = 0;
+
+ wchar_t c1, c2;
+
+ while (n--) {
+ c1 = *s1++;
+ c2 = *s2++;
+ if ((ret = c1 < c2 ? -1 : c1 == c2 ? 0 : 1) != 0)
+ break;
+ }
+ return ret;
+}
+
#else
# define L(str) str
# define STRCMP strcmp
@@ -55,31 +95,35 @@
# define CHARALIGN 1
# define MIDCHAR 0x7f
# define LARGECHAR 0xfe
-#endif
-typedef int (*proto_t) (const CHAR *, const CHAR *);
+# define CHAR__MAX CHAR_MAX
+# define CHAR__MIN CHAR_MIN
+/* Strcmp uses unsigned semantics for comparison. */
int
-SIMPLE_STRCMP (const CHAR *s1, const CHAR *s2)
+simple_strcmp (const char *s1, const char *s2)
{
int ret;
- while ((ret = *(UCHAR *) s1 - *(UCHAR *) s2++) == 0 && *s1++);
+ while ((ret = *(unsigned char *) s1 - *(unsigned char*) s2++) == 0 && *s1++);
return ret;
}
int
-STUPID_STRCMP (const CHAR *s1, const CHAR *s2)
+stupid_strcmp (const char *s1, const char *s2)
{
- size_t ns1 = STRLEN (s1) + 1;
- size_t ns2 = STRLEN (s2) + 1;
+ size_t ns1 = strlen (s1) + 1;
+ size_t ns2 = strlen (s2) + 1;
size_t n = ns1 < ns2 ? ns1 : ns2;
int ret = 0;
while (n--)
- if ((ret = *(UCHAR *) s1++ - *(UCHAR *) s2++) != 0)
+ if ((ret = *(unsigned char *) s1++ - *(unsigned char *) s2++) != 0)
break;
return ret;
}
+#endif
+
+typedef int (*proto_t) (const CHAR *, const CHAR *);
IMPL (STUPID_STRCMP, 1)
IMPL (SIMPLE_STRCMP, 1)
@@ -276,14 +320,31 @@ check (void)
STRCPY(s1, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"));
STRCPY(s2, L("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkLMNOPQRSTUV"));
+ /* Check correct working for negatives values */
+
+ s1[0] = 1;
+ s2[0] = 1;
+ s1[1] = 1;
+ s2[1] = 1;
+ s1[2] = -1;
+ s2[2] = 3;
+ s1[3] = 0;
+ s2[3] = -1;
+
+ /* Check possible overflow bug, actual more for wcscmp */
+
+ s1[7] = CHAR__MIN;
+ s2[7] = CHAR__MAX;
+
size_t l1 = STRLEN (s1);
size_t l2 = STRLEN (s2);
+
for (size_t i1 = 0; i1 < l1; i1++)
for (size_t i2 = 0; i2 < l2; i2++)
{
- int exp_result = SIMPLE_STRCMP (s1 + i1, s2 + i2);
- FOR_EACH_IMPL (impl, 0)
- check_result (impl, s1 + i1, s2 + i2, exp_result);
+ int exp_result = SIMPLE_STRCMP (s1 + i1, s2 + i2);
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s1 + i1, s2 + i2, exp_result);
}
}
diff --git a/libc/string/test-strlen.c b/libc/string/test-strlen.c
index e01befbf4..f12d3ba9d 100644
--- a/libc/string/test-strlen.c
+++ b/libc/string/test-strlen.c
@@ -1,7 +1,8 @@
-/* Test and measure strlen functions.
- Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Test and measure STRLEN functions.
+ Copyright (C) 1999, 2002, 2003, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
+ Added wcslen support by Liubov Dmitrieva <liubov.dmitrieva@gmail.com>, 2011
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -21,31 +22,43 @@
#define TEST_MAIN
#include "test-string.h"
-typedef size_t (*proto_t) (const char *);
-size_t simple_strlen (const char *);
-size_t builtin_strlen (const char *);
+#ifndef WIDE
+# define STRLEN strlen
+# define CHAR char
+# define MAX_CHAR CHAR_MAX
+#else
+# include <wchar.h>
+# define STRLEN wcslen
+# define CHAR wchar_t
+# define MAX_CHAR WCHAR_MAX
+#endif
-IMPL (simple_strlen, 0)
-IMPL (builtin_strlen, 0)
-IMPL (strlen, 1)
+typedef size_t (*proto_t) (const CHAR *);
size_t
-simple_strlen (const char *s)
+simple_STRLEN (const CHAR *s)
{
- const char *p;
+ const CHAR *p;
for (p = s; *p; ++p);
return p - s;
}
+#ifndef WIDE
size_t
-builtin_strlen (const char *p)
+builtin_strlen (const CHAR *p)
{
return __builtin_strlen (p);
}
+IMPL (builtin_strlen, 0)
+#endif
+
+IMPL (simple_STRLEN, 0)
+IMPL (STRLEN, 1)
+
static void
-do_one_test (impl_t *impl, const char *s, size_t exp_len)
+do_one_test (impl_t *impl, const CHAR *s, size_t exp_len)
{
size_t len = CALL (impl, s);
if (len != exp_len)
@@ -76,23 +89,25 @@ do_one_test (impl_t *impl, const char *s, size_t exp_len)
}
static void
-do_test (size_t align, size_t len, int max_char)
+do_test (size_t align, size_t len)
{
size_t i;
- align &= 7;
- if (align + len >= page_size)
+ align &= 63;
+ if (align + sizeof(CHAR) * len >= page_size)
return;
+ CHAR *buf = (CHAR *) (buf1);
+
for (i = 0; i < len; ++i)
- buf1[align + i] = 1 + 7 * i % max_char;
- buf1[align + len] = 0;
+ buf[align + i] = 1 + 11111 * i % MAX_CHAR;
+ buf[align + len] = 0;
if (HP_TIMING_AVAIL)
printf ("Length %4zd, alignment %2zd:", len, align);
FOR_EACH_IMPL (impl, 0)
- do_one_test (impl, (char *) (buf1 + align), len);
+ do_one_test (impl, (CHAR *) (buf + align), len);
if (HP_TIMING_AVAIL)
putchar ('\n');
@@ -102,7 +117,7 @@ static void
do_random_tests (void)
{
size_t i, j, n, align, len;
- unsigned char *p = buf1 + page_size - 512;
+ CHAR *p = (CHAR *) (buf1 + page_size - 512 * sizeof(CHAR));
for (n = 0; n < ITERATIONS; n++)
{
@@ -127,10 +142,10 @@ do_random_tests (void)
}
FOR_EACH_IMPL (impl, 1)
- if (CALL (impl, (char *) (p + align)) != len)
+ if (CALL (impl, (CHAR *) (p + align)) != len)
{
error (0, 0, "Iteration %zd - wrong result in function %s (%zd) %zd != %zd, p %p",
- n, impl->name, align, CALL (impl, (char *) (p + align)),
+ n, impl->name, align, CALL (impl, (CHAR *) (p + align)),
len, p);
ret = 1;
}
@@ -149,28 +164,20 @@ test_main (void)
printf ("\t%s", impl->name);
putchar ('\n');
- for (i = 1; i < 8; ++i)
- do_test (0, i, 127);
-
- for (i = 1; i < 8; ++i)
- do_test (i, i, 127);
-
- for (i = 2; i <= 10; ++i)
- {
- do_test (0, 1 << i, 127);
- do_test (1, 1 << i, 127);
- }
-
- for (i = 1; i < 8; ++i)
- do_test (0, i, 255);
+ /* Checking with only 4 * N alignments for wcslen, other alignments are wrong for wchar_t type arrays*/
for (i = 1; i < 8; ++i)
- do_test (i, i, 255);
+ {
+ do_test (sizeof(CHAR) * i, i);
+ do_test (0, i);
+ }
- for (i = 2; i <= 10; ++i)
+ for (i = 2; i <= 12; ++i)
{
- do_test (0, 1 << i, 255);
- do_test (1, 1 << i, 255);
+ do_test (0, 1 << i);
+ do_test (sizeof(CHAR) * 7, 1 << i);
+ do_test (sizeof(CHAR) * i, 1 << i);
+ do_test (sizeof(CHAR) * i, (size_t)((1 << i) / 1.5));
}
do_random_tests ();
diff --git a/libc/string/test-wcscmp.c b/libc/string/test-wcscmp.c
deleted file mode 100644
index ac98e6d1d..000000000
--- a/libc/string/test-wcscmp.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define WIDE 1
-#include "test-strcmp.c"
diff --git a/libc/sunrpc/auth_unix.c b/libc/sunrpc/auth_unix.c
index 858523eb8..d3b5dc7de 100644
--- a/libc/sunrpc/auth_unix.c
+++ b/libc/sunrpc/auth_unix.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle America, Inc.
+ * Copyright (c) 2010, 2011, Oracle America, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -45,15 +45,13 @@
#include <unistd.h>
#include <libintl.h>
#include <sys/param.h>
+#include <wchar.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
#include <rpc/auth_unix.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
/*
* Unix authenticator operations vector
diff --git a/libc/sunrpc/clnt_perr.c b/libc/sunrpc/clnt_perr.c
index e6b2460ec..175370ebf 100644
--- a/libc/sunrpc/clnt_perr.c
+++ b/libc/sunrpc/clnt_perr.c
@@ -1,7 +1,7 @@
/*
* clnt_perror.c
*
- * Copyright (c) 2010, Oracle America, Inc.
+ * Copyright (c) 2010, 2011, Oracle America, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -34,11 +34,8 @@
#include <string.h>
#include <libintl.h>
#include <rpc/rpc.h>
-
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-#endif
+#include <wchar.h>
+#include <libio/iolibio.h>
static char *auth_errmsg (enum auth_stat stat) internal_function;
diff --git a/libc/sunrpc/clnt_tcp.c b/libc/sunrpc/clnt_tcp.c
index a07f50a1b..7cfbe9e8d 100644
--- a/libc/sunrpc/clnt_tcp.c
+++ b/libc/sunrpc/clnt_tcp.c
@@ -53,9 +53,7 @@
#include <sys/poll.h>
#include <sys/socket.h>
#include <rpc/pmap_clnt.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
extern u_long _create_xid (void);
diff --git a/libc/sunrpc/clnt_udp.c b/libc/sunrpc/clnt_udp.c
index 83fdd8ef2..babee9abf 100644
--- a/libc/sunrpc/clnt_udp.c
+++ b/libc/sunrpc/clnt_udp.c
@@ -45,9 +45,7 @@
#include <rpc/pmap_clnt.h>
#include <net/if.h>
#include <ifaddrs.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
#include <fcntl.h>
#ifdef IP_RECVERR
diff --git a/libc/sunrpc/clnt_unix.c b/libc/sunrpc/clnt_unix.c
index 5d361b303..62dc8c604 100644
--- a/libc/sunrpc/clnt_unix.c
+++ b/libc/sunrpc/clnt_unix.c
@@ -54,9 +54,7 @@
#include <sys/poll.h>
#include <sys/socket.h>
#include <rpc/pmap_clnt.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
extern u_long _create_xid (void);
diff --git a/libc/sunrpc/netname.c b/libc/sunrpc/netname.c
index e1f1cf68f..7de2b86be 100644
--- a/libc/sunrpc/netname.c
+++ b/libc/sunrpc/netname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2002, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1997-1999, 2002, 2007, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@@ -196,9 +196,8 @@ netname2host (const char netname[MAXNETNAMELEN + 1], char *hostname,
const int hostlen)
{
char *p1, *p2;
- char buffer[MAXNETNAMELEN + 1];
- p1 = strchr (buffer, '.');
+ p1 = strchr (netname, '.');
if (p1 == NULL)
return 0;
p1++;
diff --git a/libc/sunrpc/openchild.c b/libc/sunrpc/openchild.c
index 18c7d105d..541a223bc 100644
--- a/libc/sunrpc/openchild.c
+++ b/libc/sunrpc/openchild.c
@@ -41,11 +41,9 @@
#include <rpc/rpc.h>
#include <rpc/clnt.h>
-#ifdef USE_IN_LIBIO
-# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
-# define __fdopen(fd,m) INTUSE(_IO_fdopen) (fd,m)
-#endif
+#include <libio/iolibio.h>
+#define fflush(s) INTUSE(_IO_fflush) (s)
+#define __fdopen(fd,m) INTUSE(_IO_fdopen) (fd,m)
/*
* returns pid, or -1 for failure
diff --git a/libc/sunrpc/svc_simple.c b/libc/sunrpc/svc_simple.c
index 49b1211bf..b8ba4ab38 100644
--- a/libc/sunrpc/svc_simple.c
+++ b/libc/sunrpc/svc_simple.c
@@ -41,10 +41,8 @@
#include <sys/socket.h>
#include <netdb.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-#endif
+#include <wchar.h>
+#include <libio/iolibio.h>
struct proglst_
{
diff --git a/libc/sunrpc/svc_tcp.c b/libc/sunrpc/svc_tcp.c
index 74f2cd9cf..e0515322a 100644
--- a/libc/sunrpc/svc_tcp.c
+++ b/libc/sunrpc/svc_tcp.c
@@ -45,10 +45,8 @@
#include <errno.h>
#include <stdlib.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-#endif
+#include <wchar.h>
+#include <libio/iolibio.h>
/*
* Ops vector for TCP/IP based rpc service handle
diff --git a/libc/sunrpc/svc_udp.c b/libc/sunrpc/svc_udp.c
index 71be4f822..04c8407e6 100644
--- a/libc/sunrpc/svc_udp.c
+++ b/libc/sunrpc/svc_udp.c
@@ -45,10 +45,8 @@
#include <sys/uio.h>
#endif
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-#endif
+#include <wchar.h>
+#include <libio/iolibio.h>
#define rpc_buffer(xprt) ((xprt)->xp_p1)
#ifndef MAX
diff --git a/libc/sunrpc/svc_unix.c b/libc/sunrpc/svc_unix.c
index c74b2cbdc..2b02682e7 100644
--- a/libc/sunrpc/svc_unix.c
+++ b/libc/sunrpc/svc_unix.c
@@ -46,10 +46,7 @@
#include <errno.h>
#include <stdlib.h>
#include <libintl.h>
-
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
/*
* Ops vector for AF_UNIX based rpc service handle
diff --git a/libc/sunrpc/xdr.c b/libc/sunrpc/xdr.c
index f770685de..4dd82ff04 100644
--- a/libc/sunrpc/xdr.c
+++ b/libc/sunrpc/xdr.c
@@ -39,13 +39,11 @@
#include <limits.h>
#include <string.h>
#include <libintl.h>
+#include <wchar.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
/*
* constants specific to the xdr "protocol"
diff --git a/libc/sunrpc/xdr_array.c b/libc/sunrpc/xdr_array.c
index 05162ec41..b83207834 100644
--- a/libc/sunrpc/xdr_array.c
+++ b/libc/sunrpc/xdr_array.c
@@ -40,10 +40,7 @@
#include <rpc/xdr.h>
#include <libintl.h>
#include <limits.h>
-
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#include <wchar.h>
#define LASTUNSIGNED ((u_int)0-1)
diff --git a/libc/sunrpc/xdr_rec.c b/libc/sunrpc/xdr_rec.c
index 1e13d34ba..556c6c4bc 100644
--- a/libc/sunrpc/xdr_rec.c
+++ b/libc/sunrpc/xdr_rec.c
@@ -47,11 +47,8 @@
#include <unistd.h>
#include <rpc/rpc.h>
#include <libintl.h>
-
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-#endif
+#include <wchar.h>
+#include <libio/iolibio.h>
static bool_t xdrrec_getlong (XDR *, long *);
static bool_t xdrrec_putlong (XDR *, const long *);
diff --git a/libc/sunrpc/xdr_ref.c b/libc/sunrpc/xdr_ref.c
index b4bdb52ef..7510bed87 100644
--- a/libc/sunrpc/xdr_ref.c
+++ b/libc/sunrpc/xdr_ref.c
@@ -39,11 +39,8 @@
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <libintl.h>
-
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/iolibio.h>
-#endif
+#include <wchar.h>
+#include <libio/iolibio.h>
#define LASTUNSIGNED ((u_int)0-1)
diff --git a/libc/sunrpc/xdr_stdio.c b/libc/sunrpc/xdr_stdio.c
index c68f004b3..d9866063f 100644
--- a/libc/sunrpc/xdr_stdio.c
+++ b/libc/sunrpc/xdr_stdio.c
@@ -39,13 +39,11 @@
#include <stdio.h>
#include <rpc/xdr.h>
-#ifdef USE_IN_LIBIO
-# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
-# define fread(p, m, n, s) INTUSE(_IO_fread) (p, m, n, s)
-# define ftell(s) INTUSE(_IO_ftell) (s)
-# define fwrite(p, m, n, s) INTUSE(_IO_fwrite) (p, m, n, s)
-#endif
+#include <libio/iolibio.h>
+#define fflush(s) INTUSE(_IO_fflush) (s)
+#define fread(p, m, n, s) INTUSE(_IO_fread) (p, m, n, s)
+#define ftell(s) INTUSE(_IO_ftell) (s)
+#define fwrite(p, m, n, s) INTUSE(_IO_fwrite) (p, m, n, s)
static bool_t xdrstdio_getlong (XDR *, long *);
static bool_t xdrstdio_putlong (XDR *, const long *);
diff --git a/libc/sysdeps/gnu/Makefile b/libc/sysdeps/gnu/Makefile
index e748f4c06..64622d11a 100644
--- a/libc/sysdeps/gnu/Makefile
+++ b/libc/sysdeps/gnu/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1996,1997,1998,1999,2001,2002,2003,2004,2005,2006,2010
+# Copyright (C) 1996,1997,1998,1999,2001,2002,2003,2004,2005,2006,2010,2011
# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
@@ -26,9 +26,6 @@ $(..)sysdeps/gnu/errlist.c: $(..)sysdeps/gnu/errlist.awk \
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $@-tmp
mv -f $@-tmp $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs commit -m'Regenerated from $^' $@
-endif
ifeq ($(subdir),stdio-common)
@@ -64,7 +61,7 @@ endif
ifeq ($(subdir),login)
sysdep_routines-$(OPTION_EGLIBC_UTMPX) \
+= setutxent getutxent endutxent getutxid getutxline \
- pututxline utmpxname updwtmpx getutmpx getutmp
+ pututxline utmpxname updwtmpx getutmpx getutmp
sysdep_headers += utmpx.h bits/utmpx.h
endif
diff --git a/libc/sysdeps/i386/bits/select.h b/libc/sysdeps/i386/bits/select.h
index ab9aa3d10..9e4c56aa8 100644
--- a/libc/sysdeps/i386/bits/select.h
+++ b/libc/sysdeps/i386/bits/select.h
@@ -48,8 +48,8 @@
#endif /* GNU CC */
#define __FD_SET(d, set) \
- ((void) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d)))
+ ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d)))
#define __FD_CLR(d, set) \
- ((void) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d)))
+ ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d)))
#define __FD_ISSET(d, set) \
- ((__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d)) != 0)
+ ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0)
diff --git a/libc/sysdeps/i386/configure b/libc/sysdeps/i386/configure
index e8a7970e3..cd4e627ea 100755
--- a/libc/sysdeps/i386/configure
+++ b/libc/sysdeps/i386/configure
@@ -682,6 +682,31 @@ _ACEOF
fi
+{ $as_echo "$as_me:$LINENO: checking for FMA4 support" >&5
+$as_echo_n "checking for FMA4 support... " >&6; }
+if test "${libc_cv_cc_fma4+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if { ac_try='${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ libc_cv_cc_fma4=yes
+else
+ libc_cv_cc_fma4=no
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_cc_fma4" >&5
+$as_echo "$libc_cv_cc_fma4" >&6; }
+if test $libc_cv_cc_fma4 = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_FMA4_SUPPORT 1
+_ACEOF
+
+fi
+
{ $as_echo "$as_me:$LINENO: checking for -mno-vzeroupper support" >&5
$as_echo_n "checking for -mno-vzeroupper support... " >&6; }
if test "${libc_cv_cc_novzeroupper+set}" = set; then
diff --git a/libc/sysdeps/i386/configure.in b/libc/sysdeps/i386/configure.in
index 67fd1d7df..5a9840e16 100644
--- a/libc/sysdeps/i386/configure.in
+++ b/libc/sysdeps/i386/configure.in
@@ -67,6 +67,17 @@ if test $libc_cv_cc_avx = yes; then
AC_DEFINE(HAVE_AVX_SUPPORT)
fi
+dnl Check if -mfma4 works.
+AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl
+if AC_TRY_COMMAND([${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null]); then
+ libc_cv_cc_fma4=yes
+else
+ libc_cv_cc_fma4=no
+fi])
+if test $libc_cv_cc_fma4 = yes; then
+ AC_DEFINE(HAVE_FMA4_SUPPORT)
+fi
+
dnl Check if -mno-vzeroupper works.
AC_CACHE_CHECK(for -mno-vzeroupper support, libc_cv_cc_novzeroupper, [dnl
if AC_TRY_COMMAND([${CC-cc} -mno-vzeroupper -xc /dev/null -S -o /dev/null]); then
diff --git a/libc/sysdeps/i386/dl-machine.h b/libc/sysdeps/i386/dl-machine.h
index a093d2b15..9469a2b5d 100644
--- a/libc/sysdeps/i386/dl-machine.h
+++ b/libc/sysdeps/i386/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. i386 version.
- Copyright (C) 1995-2005, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1995-2005, 2006, 2009, 2011 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
@@ -243,18 +243,12 @@ _dl_start_user:\n\
define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
# define elf_machine_type_class(type) \
((((type) == R_386_JMP_SLOT || (type) == R_386_TLS_DTPMOD32 \
|| (type) == R_386_TLS_DTPOFF32 || (type) == R_386_TLS_TPOFF32 \
|| (type) == R_386_TLS_TPOFF || (type) == R_386_TLS_DESC) \
* ELF_RTYPE_CLASS_PLT) \
| (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-# define elf_machine_type_class(type) \
- ((((type) == R_386_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_386_JMP_SLOT
@@ -311,7 +305,7 @@ auto inline void
__attribute ((always_inline))
elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -347,7 +341,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (r_type)
@@ -357,44 +352,43 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
*reloc_addr = value;
break;
-# if !defined RTLD_BOOTSTRAP || USE___THREAD
case R_386_TLS_DTPMOD32:
-# ifdef RTLD_BOOTSTRAP
+# ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always the module
with index 1.
XXX If this relocation is necessary move before RESOLVE
call. */
*reloc_addr = 1;
-# else
+# else
/* Get the information from the link map returned by the
resolv function. */
if (sym_map != NULL)
*reloc_addr = sym_map->l_tls_modid;
-# endif
+# endif
break;
case R_386_TLS_DTPOFF32:
-# ifndef RTLD_BOOTSTRAP
+# ifndef RTLD_BOOTSTRAP
/* During relocation all TLS symbols are defined and used.
Therefore the offset is already correct. */
if (sym != NULL)
*reloc_addr = sym->st_value;
-# endif
+# endif
break;
case R_386_TLS_DESC:
{
struct tlsdesc volatile *td =
(struct tlsdesc volatile *)reloc_addr;
-# ifndef RTLD_BOOTSTRAP
+# ifndef RTLD_BOOTSTRAP
if (! sym)
td->entry = _dl_tlsdesc_undefweak;
else
-# endif
+# endif
{
-# ifndef RTLD_BOOTSTRAP
-# ifndef SHARED
+# ifndef RTLD_BOOTSTRAP
+# ifndef SHARED
CHECK_STATIC_TLS (map, sym_map);
-# else
+# else
if (!TRY_STATIC_TLS (map, sym_map))
{
td->arg = _dl_make_tlsdesc_dynamic
@@ -402,8 +396,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
td->entry = _dl_tlsdesc_dynamic;
}
else
-# endif
# endif
+# endif
{
td->arg = (void*)(sym->st_value - sym_map->l_tls_offset
+ (ElfW(Word))td->arg);
@@ -426,13 +420,13 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
CHECK_STATIC_TLS (map, sym_map);
*reloc_addr += sym_map->l_tls_offset - sym->st_value;
}
-# endif
+# endif
break;
case R_386_TLS_TPOFF:
/* The offset is negative, forward from the thread pointer. */
-# ifdef RTLD_BOOTSTRAP
+# ifdef RTLD_BOOTSTRAP
*reloc_addr += sym->st_value - map->l_tls_offset;
-# else
+# else
/* We know the offset of object the symbol is contained in.
It is a negative value which will be added to the
thread pointer. */
@@ -441,9 +435,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
CHECK_STATIC_TLS (map, sym_map);
*reloc_addr += sym->st_value - sym_map->l_tls_offset;
}
-# endif
+# endif
break;
-# endif /* use TLS */
# ifndef RTLD_BOOTSTRAP
case R_386_32:
@@ -490,7 +483,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -507,8 +500,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
if (sym != NULL
&& __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0))
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (ELF32_R_TYPE (reloc->r_info))
@@ -655,7 +648,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rel *reloc)
+ Elf32_Addr l_addr, const Elf32_Rel *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -706,19 +700,20 @@ elf_machine_lazy_rel (struct link_map *map,
ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff;
elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)],
&map->l_versions[ndx],
- (void *) (l_addr + r->r_offset));
+ (void *) (l_addr + r->r_offset), skip_ifunc);
}
# ifndef RTLD_BOOTSTRAP
else
elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL,
- (void *) (l_addr + r->r_offset));
+ (void *) (l_addr + r->r_offset), skip_ifunc);
# endif
}
}
else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
{
Elf32_Addr value = map->l_addr + *reloc_addr;
- value = ((Elf32_Addr (*) (void)) value) ();
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf32_Addr (*) (void)) value) ();
*reloc_addr = value;
}
else
@@ -730,7 +725,8 @@ elf_machine_lazy_rel (struct link_map *map,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rela (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -747,7 +743,8 @@ elf_machine_lazy_rela (struct link_map *map,
else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
{
Elf32_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf32_Addr (*) (void)) value) ();
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf32_Addr (*) (void)) value) ();
*reloc_addr = value;
}
else
diff --git a/libc/sysdeps/i386/elf/configure b/libc/sysdeps/i386/elf/configure
index 7a909d9a5..88edda0a1 100755
--- a/libc/sysdeps/i386/elf/configure
+++ b/libc/sysdeps/i386/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/i386/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for i386 TLS support" >&5
@@ -39,12 +38,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_386_tls" >&5
$as_echo "$libc_cv_386_tls" >&6; }
-if test $libc_cv_386_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_386_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
cat >>confdefs.h <<\_ACEOF
diff --git a/libc/sysdeps/i386/elf/configure.in b/libc/sysdeps/i386/elf/configure.in
index ca607adeb..0c436f3f4 100644
--- a/libc/sysdeps/i386/elf/configure.in
+++ b/libc/sysdeps/i386/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/i386/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for i386 TLS support, libc_cv_386_tls, [dnl
@@ -28,9 +27,8 @@ else
libc_cv_386_tls=no
fi
rm -f conftest*])
-if test $libc_cv_386_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_386_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl It is always possible to access static and hidden symbols in an
diff --git a/libc/sysdeps/i386/fpu/e_acos.S b/libc/sysdeps/i386/fpu/e_acos.S
index b9d07b109..d3505baf0 100644
--- a/libc/sysdeps/i386/fpu/e_acos.S
+++ b/libc/sysdeps/i386/fpu/e_acos.S
@@ -19,3 +19,4 @@ ENTRY(__ieee754_acos)
fpatan /* atan (sqrt(1 - x^2) / x) */
ret
END (__ieee754_acos)
+strong_alias (__ieee754_acos, __acos_finite)
diff --git a/libc/sysdeps/i386/fpu/e_acosf.S b/libc/sysdeps/i386/fpu/e_acosf.S
index 50b13fd1b..6a843a51d 100644
--- a/libc/sysdeps/i386/fpu/e_acosf.S
+++ b/libc/sysdeps/i386/fpu/e_acosf.S
@@ -20,3 +20,4 @@ ENTRY(__ieee754_acosf)
fpatan
ret
END (__ieee754_acosf)
+strong_alias (__ieee754_acosf, __acosf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_acosh.S b/libc/sysdeps/i386/fpu/e_acosh.S
index 62a232471..fc65c295c 100644
--- a/libc/sysdeps/i386/fpu/e_acosh.S
+++ b/libc/sysdeps/i386/fpu/e_acosh.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -21,12 +21,12 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -101,3 +101,4 @@ ENTRY(__ieee754_acosh)
fdiv %st, %st(0)
ret
END(__ieee754_acosh)
+strong_alias (__ieee754_acosh, __acosh_finite)
diff --git a/libc/sysdeps/i386/fpu/e_acoshf.S b/libc/sysdeps/i386/fpu/e_acoshf.S
index 1906c6057..b55004b62 100644
--- a/libc/sysdeps/i386/fpu/e_acoshf.S
+++ b/libc/sysdeps/i386/fpu/e_acoshf.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -21,12 +21,12 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -101,3 +101,4 @@ ENTRY(__ieee754_acoshf)
fdiv %st, %st(0)
ret
END(__ieee754_acoshf)
+strong_alias (__ieee754_acoshf, __acoshf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_acoshl.S b/libc/sysdeps/i386/fpu/e_acoshl.S
index c7b548d25..76bc0d752 100644
--- a/libc/sysdeps/i386/fpu/e_acoshl.S
+++ b/libc/sysdeps/i386/fpu/e_acoshl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -21,12 +21,12 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
/* 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. */
@@ -108,3 +108,4 @@ ENTRY(__ieee754_acoshl)
fdiv %st, %st(0)
ret
END(__ieee754_acoshl)
+strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_acosl.c b/libc/sysdeps/i386/fpu/e_acosl.c
index 0c3e03945..ec516ffca 100644
--- a/libc/sysdeps/i386/fpu/e_acosl.c
+++ b/libc/sysdeps/i386/fpu/e_acosl.c
@@ -23,3 +23,4 @@ __ieee754_acosl (long double x)
: "=t" (res) : "0" (x) : "st(1)");
return res;
}
+strong_alias (__ieee754_acosl, __acosl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_asin.S b/libc/sysdeps/i386/fpu/e_asin.S
index 945e30824..a17e922b6 100644
--- a/libc/sysdeps/i386/fpu/e_asin.S
+++ b/libc/sysdeps/i386/fpu/e_asin.S
@@ -18,3 +18,4 @@ ENTRY(__ieee754_asin)
fpatan
ret
END (__ieee754_asin)
+strong_alias (__ieee754_asin, __asin_finite)
diff --git a/libc/sysdeps/i386/fpu/e_asinf.S b/libc/sysdeps/i386/fpu/e_asinf.S
index d450e9a74..5c1065dd4 100644
--- a/libc/sysdeps/i386/fpu/e_asinf.S
+++ b/libc/sysdeps/i386/fpu/e_asinf.S
@@ -19,3 +19,4 @@ ENTRY(__ieee754_asinf)
fpatan
ret
END (__ieee754_asinf)
+strong_alias (__ieee754_asinf, __asinf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_atan2.S b/libc/sysdeps/i386/fpu/e_atan2.S
index 8df04e485..e76f8e2a7 100644
--- a/libc/sysdeps/i386/fpu/e_atan2.S
+++ b/libc/sysdeps/i386/fpu/e_atan2.S
@@ -13,3 +13,4 @@ ENTRY(__ieee754_atan2)
fpatan
ret
END (__ieee754_atan2)
+strong_alias (__ieee754_atan2, __atan2_finite)
diff --git a/libc/sysdeps/i386/fpu/e_atan2f.S b/libc/sysdeps/i386/fpu/e_atan2f.S
index fc6621f18..9ffa6373b 100644
--- a/libc/sysdeps/i386/fpu/e_atan2f.S
+++ b/libc/sysdeps/i386/fpu/e_atan2f.S
@@ -13,3 +13,4 @@ ENTRY(__ieee754_atan2f)
fpatan
ret
END (__ieee754_atan2f)
+strong_alias (__ieee754_atan2f, __atan2f_finite)
diff --git a/libc/sysdeps/i386/fpu/e_atan2l.c b/libc/sysdeps/i386/fpu/e_atan2l.c
index 19a2a6062..9f88bfcc0 100644
--- a/libc/sysdeps/i386/fpu/e_atan2l.c
+++ b/libc/sysdeps/i386/fpu/e_atan2l.c
@@ -16,3 +16,4 @@ __ieee754_atan2l (long double y, long double x)
return res;
}
+strong_alias (__ieee754_atan2l, __atan2l_finite)
diff --git a/libc/sysdeps/i386/fpu/e_atanh.S b/libc/sysdeps/i386/fpu/e_atanh.S
index 3566ec6ef..d7e53a288 100644
--- a/libc/sysdeps/i386/fpu/e_atanh.S
+++ b/libc/sysdeps/i386/fpu/e_atanh.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arctanh function.
- Copyright (C) 1996, 1999, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1999, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -114,3 +114,4 @@ ENTRY(__ieee754_atanh)
6: fldl 4(%esp)
ret
END(__ieee754_atanh)
+strong_alias (__ieee754_atanh, __atanh_finite)
diff --git a/libc/sysdeps/i386/fpu/e_atanhf.S b/libc/sysdeps/i386/fpu/e_atanhf.S
index 10ce6aed9..00ad9142f 100644
--- a/libc/sysdeps/i386/fpu/e_atanhf.S
+++ b/libc/sysdeps/i386/fpu/e_atanhf.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arctanh function.
- Copyright (C) 1996, 1999, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1999, 2005, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -107,3 +107,4 @@ ENTRY(__ieee754_atanhf)
5: flds 4(%esp)
ret
END(__ieee754_atanhf)
+strong_alias (__ieee754_atanhf, __atanhf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_atanhl.S b/libc/sysdeps/i386/fpu/e_atanhl.S
index 8618c3fb3..cc70e73f4 100644
--- a/libc/sysdeps/i386/fpu/e_atanhl.S
+++ b/libc/sysdeps/i386/fpu/e_atanhl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of arctanh function.
- Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1999, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -118,3 +118,4 @@ ENTRY(__ieee754_atanhl)
6: fldt 4(%esp)
ret
END(__ieee754_atanhl)
+strong_alias (__ieee754_atanhl, __atanhl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_exp.S b/libc/sysdeps/i386/fpu/e_exp.S
index 4a75fa1d1..2c331d9ed 100644
--- a/libc/sysdeps/i386/fpu/e_exp.S
+++ b/libc/sysdeps/i386/fpu/e_exp.S
@@ -5,7 +5,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_exp.S,v 1.7 1996/07/03 17:31:28 jtc Exp $")
/* e^x = 2^(x * log2(e)) */
ENTRY(__ieee754_exp)
@@ -39,3 +38,19 @@ ENTRY(__ieee754_exp)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp)
+
+
+ENTRY(__exp_finite)
+ fldl2e
+ fmull 4(%esp) /* x * log2(e) */
+ fld %st
+ frndint /* int(x * log2(e)) */
+ fsubr %st,%st(1) /* fract(x * log2(e)) */
+ fxch
+ f2xm1 /* 2^(fract(x * log2(e))) - 1 */
+ fld1
+ faddp /* 2^(fract(x * log2(e))) */
+ fscale /* e^x */
+ fstp %st(1)
+ ret
+END(__exp_finite)
diff --git a/libc/sysdeps/i386/fpu/e_exp10.S b/libc/sysdeps/i386/fpu/e_exp10.S
index 6bfcdbb72..1e32b0784 100644
--- a/libc/sysdeps/i386/fpu/e_exp10.S
+++ b/libc/sysdeps/i386/fpu/e_exp10.S
@@ -36,3 +36,4 @@ ENTRY(__ieee754_exp10)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp10)
+strong_alias (__ieee754_exp10, __exp10_finite)
diff --git a/libc/sysdeps/i386/fpu/e_exp10f.S b/libc/sysdeps/i386/fpu/e_exp10f.S
index 4791b99af..614496415 100644
--- a/libc/sysdeps/i386/fpu/e_exp10f.S
+++ b/libc/sysdeps/i386/fpu/e_exp10f.S
@@ -4,7 +4,7 @@
#include <machine/asm.h>
-/* e^x = 2^(x * log2(10)) */
+/* 10^x = 2^(x * log2(10)) */
ENTRY(__ieee754_exp10f)
flds 4(%esp)
/* I added the following ugly construct because exp(+-Inf) resulted
@@ -36,3 +36,4 @@ ENTRY(__ieee754_exp10f)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp10f)
+strong_alias (__ieee754_exp10f, __exp10f_finite)
diff --git a/libc/sysdeps/i386/fpu/e_exp10l.S b/libc/sysdeps/i386/fpu/e_exp10l.S
index 71f0da792..04ec8001d 100644
--- a/libc/sysdeps/i386/fpu/e_exp10l.S
+++ b/libc/sysdeps/i386/fpu/e_exp10l.S
@@ -4,7 +4,7 @@
#include <machine/asm.h>
-/* e^x = 2^(x * log2l(10)) */
+/* 10^x = 2^(x * log2l(10)) */
ENTRY(__ieee754_exp10l)
fldt 4(%esp)
/* I added the following ugly construct because expl(+-Inf) resulted
@@ -36,3 +36,4 @@ ENTRY(__ieee754_exp10l)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp10l)
+strong_alias (__ieee754_exp10l, __exp10l_finite)
diff --git a/libc/sysdeps/i386/fpu/e_exp2.S b/libc/sysdeps/i386/fpu/e_exp2.S
index 778c0c0eb..f802cf8b9 100644
--- a/libc/sysdeps/i386/fpu/e_exp2.S
+++ b/libc/sysdeps/i386/fpu/e_exp2.S
@@ -35,3 +35,4 @@ ENTRY(__ieee754_exp2)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp2)
+strong_alias (__ieee754_exp2, __exp2_finite)
diff --git a/libc/sysdeps/i386/fpu/e_exp2f.S b/libc/sysdeps/i386/fpu/e_exp2f.S
index c2d1af1af..f867d0d47 100644
--- a/libc/sysdeps/i386/fpu/e_exp2f.S
+++ b/libc/sysdeps/i386/fpu/e_exp2f.S
@@ -35,3 +35,4 @@ ENTRY(__ieee754_exp2f)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp2f)
+strong_alias (__ieee754_exp2f, __exp2f_finite)
diff --git a/libc/sysdeps/i386/fpu/e_exp2l.S b/libc/sysdeps/i386/fpu/e_exp2l.S
index fa1fdc923..203dd0078 100644
--- a/libc/sysdeps/i386/fpu/e_exp2l.S
+++ b/libc/sysdeps/i386/fpu/e_exp2l.S
@@ -35,3 +35,4 @@ ENTRY(__ieee754_exp2l)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp2l)
+strong_alias (__ieee754_exp2l, __exp2l_finite)
diff --git a/libc/sysdeps/i386/fpu/e_expf.S b/libc/sysdeps/i386/fpu/e_expf.S
index 5fd49b89f..4e4f6a0df 100644
--- a/libc/sysdeps/i386/fpu/e_expf.S
+++ b/libc/sysdeps/i386/fpu/e_expf.S
@@ -6,7 +6,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
/* e^x = 2^(x * log2(e)) */
ENTRY(__ieee754_expf)
@@ -40,3 +39,19 @@ ENTRY(__ieee754_expf)
fldz /* Set result to 0. */
2: ret
END (__ieee754_expf)
+
+
+ENTRY(__expf_finite)
+ fldl2e
+ fmuls 4(%esp) /* x * log2(e) */
+ fld %st
+ frndint /* int(x * log2(e)) */
+ fsubr %st,%st(1) /* fract(x * log2(e)) */
+ fxch
+ f2xm1 /* 2^(fract(x * log2(e))) - 1 */
+ fld1
+ faddp /* 2^(fract(x * log2(e))) */
+ fscale /* e^x */
+ fstp %st(1)
+ ret
+END(__expf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_expl.c b/libc/sysdeps/i386/fpu/e_expl.c
index 2240ceac4..8dc9581f7 100644
--- a/libc/sysdeps/i386/fpu/e_expl.c
+++ b/libc/sysdeps/i386/fpu/e_expl.c
@@ -63,7 +63,7 @@ __ieee754_expl (long double x)
"fld1\n\t" /* 4 1.0 */
"faddp\n\t" /* 3 2^(fract(x * log2(e))) */
"fstp %%st(1)\n\t" /* 2 */
- "fscale\n\t" /* 2 scale factor is st(1); e^x */
+ "fscale\n\t" /* 2 scale factor is st(1); e^x */
"fstp %%st(1)\n\t" /* 1 */
"fstp %%st(1)\n\t" /* 0 */
"jmp 2f\n\t"
@@ -75,3 +75,4 @@ __ieee754_expl (long double x)
: "=t" (res) : "0" (x), "m" (c0), "m" (c1) : "ax", "dx");
return res;
}
+strong_alias (__ieee754_expl, __expl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_fmod.S b/libc/sysdeps/i386/fpu/e_fmod.S
index 4cf6e9205..26b3acc39 100644
--- a/libc/sysdeps/i386/fpu/e_fmod.S
+++ b/libc/sysdeps/i386/fpu/e_fmod.S
@@ -5,8 +5,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_fmod.S,v 1.4 1995/05/08 23:47:56 jtc Exp $")
-
ENTRY(__ieee754_fmod)
fldl 12(%esp)
fldl 4(%esp)
@@ -17,3 +15,4 @@ ENTRY(__ieee754_fmod)
fstp %st(1)
ret
END (__ieee754_fmod)
+strong_alias (__ieee754_fmod, __fmod_finite)
diff --git a/libc/sysdeps/i386/fpu/e_fmodf.S b/libc/sysdeps/i386/fpu/e_fmodf.S
index bbce40976..ece4d9842 100644
--- a/libc/sysdeps/i386/fpu/e_fmodf.S
+++ b/libc/sysdeps/i386/fpu/e_fmodf.S
@@ -6,8 +6,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
ENTRY(__ieee754_fmodf)
flds 8(%esp)
flds 4(%esp)
@@ -18,3 +16,4 @@ ENTRY(__ieee754_fmodf)
fstp %st(1)
ret
END(__ieee754_fmodf)
+strong_alias (__ieee754_fmodf, __fmodf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_fmodl.c b/libc/sysdeps/i386/fpu/e_fmodl.c
index c7c9a6045..49700ae8f 100644
--- a/libc/sysdeps/i386/fpu/e_fmodl.c
+++ b/libc/sysdeps/i386/fpu/e_fmodl.c
@@ -20,3 +20,4 @@ __ieee754_fmodl (long double x, long double y)
: "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");
return res;
}
+strong_alias (__ieee754_fmodl, __fmodl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_hypot.S b/libc/sysdeps/i386/fpu/e_hypot.S
index 043585730..0baa011d1 100644
--- a/libc/sysdeps/i386/fpu/e_hypot.S
+++ b/libc/sysdeps/i386/fpu/e_hypot.S
@@ -1,5 +1,5 @@
/* Compute the hypothenuse of X and Y.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -58,5 +58,6 @@ ENTRY(__ieee754_hypot)
fxch
5: fstp %st(1)
jmp 2b
-
+
END(__ieee754_hypot)
+strong_alias (__ieee754_hypot, __hypot_finite)
diff --git a/libc/sysdeps/i386/fpu/e_hypotf.S b/libc/sysdeps/i386/fpu/e_hypotf.S
index 5967dae21..eb95d6ee9 100644
--- a/libc/sysdeps/i386/fpu/e_hypotf.S
+++ b/libc/sysdeps/i386/fpu/e_hypotf.S
@@ -1,5 +1,5 @@
/* Compute the hypothenuse of X and Y.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -58,5 +58,6 @@ ENTRY(__ieee754_hypotf)
fxch
5: fstp %st(1)
jmp 2b
-
+
END(__ieee754_hypotf)
+strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_log.S b/libc/sysdeps/i386/fpu/e_log.S
index ce55b7229..a2e4d89a4 100644
--- a/libc/sysdeps/i386/fpu/e_log.S
+++ b/libc/sysdeps/i386/fpu/e_log.S
@@ -7,14 +7,12 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_log.S,v 1.4 1995/05/08 23:48:39 jtc Exp $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -27,9 +25,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -64,3 +62,22 @@ ENTRY(__ieee754_log)
fstp %st(1)
ret
END (__ieee754_log)
+
+ENTRY(__log_finite)
+ fldln2 // log(2)
+ fldl 4(%esp) // x : log(2)
+#ifdef PIC
+ LOAD_PIC_REG (dx)
+#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)
+ andb $0x45, %ah
+ jz 2b
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+END(__log_finite)
diff --git a/libc/sysdeps/i386/fpu/e_log10.S b/libc/sysdeps/i386/fpu/e_log10.S
index 525f08c96..9d24d7402 100644
--- a/libc/sysdeps/i386/fpu/e_log10.S
+++ b/libc/sysdeps/i386/fpu/e_log10.S
@@ -7,14 +7,12 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_log10.S,v 1.4 1995/05/08 23:49:24 jtc Exp $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -27,9 +25,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -64,3 +62,4 @@ ENTRY(__ieee754_log10)
fstp %st(1)
ret
END (__ieee754_log10)
+strong_alias (__ieee754_log10, __log10_finite)
diff --git a/libc/sysdeps/i386/fpu/e_log10f.S b/libc/sysdeps/i386/fpu/e_log10f.S
index da5069d58..38a4833d1 100644
--- a/libc/sysdeps/i386/fpu/e_log10f.S
+++ b/libc/sysdeps/i386/fpu/e_log10f.S
@@ -8,14 +8,12 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -28,9 +26,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -65,3 +63,4 @@ ENTRY(__ieee754_log10f)
fstp %st(1)
ret
END (__ieee754_log10f)
+strong_alias (__ieee754_log10f, __log10f_finite)
diff --git a/libc/sysdeps/i386/fpu/e_log10l.S b/libc/sysdeps/i386/fpu/e_log10l.S
index 3811516be..88b309d53 100644
--- a/libc/sysdeps/i386/fpu/e_log10l.S
+++ b/libc/sysdeps/i386/fpu/e_log10l.S
@@ -9,14 +9,12 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -29,9 +27,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -66,3 +64,4 @@ ENTRY(__ieee754_log10l)
fstp %st(1)
ret
END(__ieee754_log10l)
+strong_alias (__ieee754_log10l, __log10l_finite)
diff --git a/libc/sysdeps/i386/fpu/e_log2.S b/libc/sysdeps/i386/fpu/e_log2.S
index d80bf8023..88aee7f3c 100644
--- a/libc/sysdeps/i386/fpu/e_log2.S
+++ b/libc/sysdeps/i386/fpu/e_log2.S
@@ -9,11 +9,11 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -26,9 +26,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -63,3 +63,4 @@ ENTRY(__ieee754_log2)
fstp %st(1)
ret
END (__ieee754_log2)
+strong_alias (__ieee754_log2, __log2_finite)
diff --git a/libc/sysdeps/i386/fpu/e_log2f.S b/libc/sysdeps/i386/fpu/e_log2f.S
index 9eb7b2a82..20144875f 100644
--- a/libc/sysdeps/i386/fpu/e_log2f.S
+++ b/libc/sysdeps/i386/fpu/e_log2f.S
@@ -9,11 +9,11 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -26,9 +26,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -63,3 +63,4 @@ ENTRY(__ieee754_log2f)
fstp %st(1)
ret
END (__ieee754_log2f)
+strong_alias (__ieee754_log2f, __log2f_finite)
diff --git a/libc/sysdeps/i386/fpu/e_log2l.S b/libc/sysdeps/i386/fpu/e_log2l.S
index 9de08f5de..bc79dea2d 100644
--- a/libc/sysdeps/i386/fpu/e_log2l.S
+++ b/libc/sysdeps/i386/fpu/e_log2l.S
@@ -9,11 +9,11 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -26,9 +26,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -63,3 +63,4 @@ ENTRY(__ieee754_log2l)
fstp %st(1)
ret
END (__ieee754_log2l)
+strong_alias (__ieee754_log2l, __log2l_finite)
diff --git a/libc/sysdeps/i386/fpu/e_logf.S b/libc/sysdeps/i386/fpu/e_logf.S
index cd4538b59..1992cc2f8 100644
--- a/libc/sysdeps/i386/fpu/e_logf.S
+++ b/libc/sysdeps/i386/fpu/e_logf.S
@@ -8,14 +8,12 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_log.S,v 1.4 1995/05/08 23:48:39 jtc Exp $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -28,9 +26,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -65,3 +63,22 @@ ENTRY(__ieee754_logf)
fstp %st(1)
ret
END (__ieee754_logf)
+
+ENTRY(__logf_finite)
+ fldln2 // log(2)
+ flds 4(%esp) // x : log(2)
+#ifdef PIC
+ LOAD_PIC_REG (dx)
+#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)
+ andb $0x45, %ah
+ jz 2b
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+END(__logf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_logl.S b/libc/sysdeps/i386/fpu/e_logl.S
index 551dcf1e4..bfb72a30e 100644
--- a/libc/sysdeps/i386/fpu/e_logl.S
+++ b/libc/sysdeps/i386/fpu/e_logl.S
@@ -7,15 +7,13 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -28,9 +26,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##@GOTOFF(%edx)
+# define MO(op) op##@GOTOFF(%edx)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -65,3 +63,22 @@ ENTRY(__ieee754_logl)
fstp %st(1)
ret
END (__ieee754_logl)
+
+ENTRY(__logl_finite)
+ fldln2 // log(2)
+ fldt 4(%esp) // x : log(2)
+#ifdef PIC
+ LOAD_PIC_REG (dx)
+#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)
+ andb $0x45, %ah
+ jz 2b
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+END(__logl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_pow.S b/libc/sysdeps/i386/fpu/e_pow.S
index 792f92690..dccc67752 100644
--- a/libc/sysdeps/i386/fpu/e_pow.S
+++ b/libc/sysdeps/i386/fpu/e_pow.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007
+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -22,12 +22,27 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
+ .p2align 3
+ 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(p63,@object)
+p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
+ ASM_SIZE_DIRECTIVE(p63)
- .align ALIGNARG(4)
+#ifdef __ELF__
+ .section .rodata.cst16,"aM",@progbits,16
+#else
+ .text
+#endif
+ .p2align 3
ASM_TYPE_DIRECTIVE(infinity,@object)
inf_zero:
infinity:
@@ -43,22 +58,13 @@ minfinity:
mzero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
ASM_SIZE_DIRECTIVE(minf_mzero)
- 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(p63,@object)
-p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
- ASM_SIZE_DIRECTIVE(p63)
#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+# define MO(op) op##@GOTOFF(%ecx)
+# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
+# define MO(op) op
+# define MOX(op,x,f) op(,x,f)
#endif
.text
@@ -360,3 +366,4 @@ ENTRY(__ieee754_pow)
ret
END(__ieee754_pow)
+strong_alias (__ieee754_pow, __pow_finite)
diff --git a/libc/sysdeps/i386/fpu/e_powf.S b/libc/sysdeps/i386/fpu/e_powf.S
index c91545418..99c95bbdf 100644
--- a/libc/sysdeps/i386/fpu/e_powf.S
+++ b/libc/sysdeps/i386/fpu/e_powf.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1999, 2001, 2004, 2005, 2007
+ Copyright (C) 1996, 1997, 1999, 2001, 2004, 2005, 2007, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -22,12 +22,27 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
+ .p2align 3
+ 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(p31,@object)
+p31: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x41
+ ASM_SIZE_DIRECTIVE(p31)
- .align ALIGNARG(4)
+#ifdef __ELF__
+ .section .rodata.cst16,"aM",@progbits,16
+#else
+ .text
+#endif
+ .p2align 3
ASM_TYPE_DIRECTIVE(infinity,@object)
inf_zero:
infinity:
@@ -43,22 +58,13 @@ minfinity:
mzero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
ASM_SIZE_DIRECTIVE(minf_mzero)
- 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(p31,@object)
-p31: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x41
- ASM_SIZE_DIRECTIVE(p31)
#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+# define MO(op) op##@GOTOFF(%ecx)
+# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
+# define MO(op) op
+# define MOX(op,x,f) op(,x,f)
#endif
.text
@@ -348,3 +354,4 @@ ENTRY(__ieee754_powf)
ret
END(__ieee754_powf)
+strong_alias (__ieee754_powf, __powf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_powl.S b/libc/sysdeps/i386/fpu/e_powl.S
index 621549620..34ace3576 100644
--- a/libc/sysdeps/i386/fpu/e_powl.S
+++ b/libc/sysdeps/i386/fpu/e_powl.S
@@ -1,5 +1,5 @@
/* ix87 specific implementation of pow function.
- Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007
+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2007, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -22,12 +22,27 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
+ .p2align 3
+ 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(p63,@object)
+p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
+ ASM_SIZE_DIRECTIVE(p63)
- .align ALIGNARG(4)
+#ifdef __ELF__
+ .section .rodata.cst16,"aM",@progbits,16
+#else
+ .text
+#endif
+ .p2align 3
ASM_TYPE_DIRECTIVE(infinity,@object)
inf_zero:
infinity:
@@ -43,22 +58,13 @@ minfinity:
mzero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
ASM_SIZE_DIRECTIVE(minf_mzero)
- 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(p63,@object)
-p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
- ASM_SIZE_DIRECTIVE(p63)
#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+# define MO(op) op##@GOTOFF(%ecx)
+# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
+# define MO(op) op
+# define MOX(op,x,f) op(,x,f)
#endif
.text
@@ -360,3 +366,4 @@ ENTRY(__ieee754_powl)
ret
END(__ieee754_powl)
+strong_alias (__ieee754_powl, __powl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_remainder.S b/libc/sysdeps/i386/fpu/e_remainder.S
index 2f43cb894..f7867aa90 100644
--- a/libc/sysdeps/i386/fpu/e_remainder.S
+++ b/libc/sysdeps/i386/fpu/e_remainder.S
@@ -5,8 +5,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_remainder.S,v 1.4 1995/05/08 23:49:37 jtc Exp $")
-
ENTRY(__ieee754_remainder)
fldl 12(%esp)
fldl 4(%esp)
@@ -17,3 +15,4 @@ ENTRY(__ieee754_remainder)
fstp %st(1)
ret
END (__ieee754_remainder)
+strong_alias (__ieee754_remainder, __remainder_finite)
diff --git a/libc/sysdeps/i386/fpu/e_remainderf.S b/libc/sysdeps/i386/fpu/e_remainderf.S
index 79f821993..cfd390bc6 100644
--- a/libc/sysdeps/i386/fpu/e_remainderf.S
+++ b/libc/sysdeps/i386/fpu/e_remainderf.S
@@ -5,8 +5,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_remainderf.S,v 1.2 1995/05/08 23:49:47 jtc Exp $")
-
ENTRY(__ieee754_remainderf)
flds 8(%esp)
flds 4(%esp)
@@ -17,3 +15,4 @@ ENTRY(__ieee754_remainderf)
fstp %st(1)
ret
END (__ieee754_remainderf)
+strong_alias (__ieee754_remainderf, __remainderf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_remainderl.S b/libc/sysdeps/i386/fpu/e_remainderl.S
index 5f50b626a..5ec23a37a 100644
--- a/libc/sysdeps/i386/fpu/e_remainderl.S
+++ b/libc/sysdeps/i386/fpu/e_remainderl.S
@@ -7,8 +7,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
ENTRY(__ieee754_remainderl)
fldt 16(%esp)
fldt 4(%esp)
@@ -19,3 +17,4 @@ ENTRY(__ieee754_remainderl)
fstp %st(1)
ret
END (__ieee754_remainderl)
+strong_alias (__ieee754_remainderl, __remainderl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_scalb.S b/libc/sysdeps/i386/fpu/e_scalb.S
index 7e334a361..0f3ec9619 100644
--- a/libc/sysdeps/i386/fpu/e_scalb.S
+++ b/libc/sysdeps/i386/fpu/e_scalb.S
@@ -7,8 +7,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_scalb.S,v 1.4 1995/05/08 23:49:52 jtc Exp $")
-
#ifdef __ELF__
.section .rodata
#else
@@ -20,18 +18,17 @@ RCSID("$NetBSD: e_scalb.S,v 1.4 1995/05/08 23:49:52 jtc Exp $")
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
-minus_zero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
ASM_SIZE_DIRECTIVE(zero_nan)
#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+# define MO(op) op##@GOTOFF(%ecx)
+# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
+# define MO(op) op
+# define MOX(op,x,f) op(,x,f)
#endif
.text
@@ -100,3 +97,4 @@ ENTRY(__ieee754_scalb)
fdiv %st
ret
END(__ieee754_scalb)
+strong_alias (__ieee754_scalb, __scalb_finite)
diff --git a/libc/sysdeps/i386/fpu/e_scalbf.S b/libc/sysdeps/i386/fpu/e_scalbf.S
index e99ee92cb..d11ca66d1 100644
--- a/libc/sysdeps/i386/fpu/e_scalbf.S
+++ b/libc/sysdeps/i386/fpu/e_scalbf.S
@@ -8,8 +8,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
.section .rodata
#else
@@ -21,18 +19,17 @@ RCSID("$NetBSD: $")
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
-minus_zero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
ASM_SIZE_DIRECTIVE(zero_nan)
#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+# define MO(op) op##@GOTOFF(%ecx)
+# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
+# define MO(op) op
+# define MOX(op,x,f) op(,x,f)
#endif
@@ -102,3 +99,4 @@ ENTRY(__ieee754_scalbf)
fdiv %st
ret
END(__ieee754_scalbf)
+strong_alias (__ieee754_scalbf, __scalbf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_scalbl.S b/libc/sysdeps/i386/fpu/e_scalbl.S
index 3f67d0bef..d8b216971 100644
--- a/libc/sysdeps/i386/fpu/e_scalbl.S
+++ b/libc/sysdeps/i386/fpu/e_scalbl.S
@@ -9,8 +9,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
.section .rodata
#else
@@ -22,18 +20,17 @@ RCSID("$NetBSD: $")
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
-minus_zero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
ASM_SIZE_DIRECTIVE(zero_nan)
#ifdef PIC
-#define MO(op) op##@GOTOFF(%ecx)
-#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
+# define MO(op) op##@GOTOFF(%ecx)
+# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
#else
-#define MO(op) op
-#define MOX(op,x,f) op(,x,f)
+# define MO(op) op
+# define MOX(op,x,f) op(,x,f)
#endif
.text
@@ -102,3 +99,4 @@ ENTRY(__ieee754_scalbl)
fdiv %st
ret
END(__ieee754_scalbl)
+strong_alias (__ieee754_scalbl, __scalbl_finite)
diff --git a/libc/sysdeps/i386/fpu/e_sqrt.S b/libc/sysdeps/i386/fpu/e_sqrt.S
index 6f253d51a..1054ba453 100644
--- a/libc/sysdeps/i386/fpu/e_sqrt.S
+++ b/libc/sysdeps/i386/fpu/e_sqrt.S
@@ -5,10 +5,9 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_sqrt.S,v 1.4 1995/05/08 23:49:57 jtc Exp $")
-
ENTRY(__ieee754_sqrt)
fldl 4(%esp)
fsqrt
ret
END (__ieee754_sqrt)
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/libc/sysdeps/i386/fpu/e_sqrtf.S b/libc/sysdeps/i386/fpu/e_sqrtf.S
index 5ce1ad054..6f7e4b015 100644
--- a/libc/sysdeps/i386/fpu/e_sqrtf.S
+++ b/libc/sysdeps/i386/fpu/e_sqrtf.S
@@ -5,10 +5,9 @@
#include <machine/asm.h>
-RCSID("$NetBSD: e_sqrtf.S,v 1.2 1995/05/08 23:50:14 jtc Exp $")
-
ENTRY(__ieee754_sqrtf)
flds 4(%esp)
fsqrt
ret
END (__ieee754_sqrtf)
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/libc/sysdeps/i386/fpu/e_sqrtl.c b/libc/sysdeps/i386/fpu/e_sqrtl.c
index 85f61bb38..41bcd7eeb 100644
--- a/libc/sysdeps/i386/fpu/e_sqrtl.c
+++ b/libc/sysdeps/i386/fpu/e_sqrtl.c
@@ -7,6 +7,7 @@
#include <math_private.h>
+#undef __ieee754_sqrtl
long double
__ieee754_sqrtl (long double x)
{
@@ -16,3 +17,4 @@ __ieee754_sqrtl (long double x)
return res;
}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/libc/sysdeps/i386/fpu/libm-test-ulps b/libc/sysdeps/i386/fpu/libm-test-ulps
index 4b1a9e734..ebd46b0df 100644
--- a/libc/sysdeps/i386/fpu/libm-test-ulps
+++ b/libc/sysdeps/i386/fpu/libm-test-ulps
@@ -640,6 +640,52 @@ double: 1
idouble: 1
ildouble: 1
ldouble: 1
+Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
+float: 1
+ifloat: 1
+double: 1
+idouble: 1
+ldouble: 82
+ildouble: 82
+Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813":
+ldouble: 186
+ildouble: 186
+Test "jn (4, 2.4048255576957729) == 0.647466661641779720084932282551219891E-1":
+ldouble: 185
+ildouble: 185
+Test: "jn (5, 2.4048255576957729) == 0.163892432048058525099230549946147698E-1":
+float: 1
+ifloat: 1
+double: 1
+idouble: 1
+ldouble: 249
+ildouble: 249
+Test "jn (6, 2.4048255576957729) == 0.34048184720278336646673682895929161E-2":
+float: 2
+ifloat: 2
+double: 1
+idouble: 1
+ldouble: 511
+ildouble: 511
+Test "jn (7, 2.4048255576957729) == 0.60068836573295394221291569249883076E-3":
+float: 2
+ifloat: 2
+double: 1
+idouble: 1
+ldouble: 428
+ildouble: 428
+Test "jn (8, 2.4048255576957729) == 0.92165786705344923232879022467054148E-4":
+float: 3
+ifloat: 3
+double: 1
+idouble: 1
+ldouble: 609
+ildouble: 609
+Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4":
+float: 4
+ifloat: 4
+ldouble: 750
+ildouble: 750
# lgamma
Test "lgamma (-0.5) == log(2*sqrt(pi))":
@@ -1168,11 +1214,11 @@ ldouble: 1
Function: "jn":
double: 5
-float: 2
+float: 4
idouble: 5
-ifloat: 2
-ildouble: 2
-ldouble: 2
+ifloat: 4
+ildouble: 750
+ldouble: 750
Function: "lgamma":
double: 1
diff --git a/libc/sysdeps/i386/i686/fpu/e_log.S b/libc/sysdeps/i386/i686/fpu/e_log.S
new file mode 100644
index 000000000..73060b088
--- /dev/null
+++ b/libc/sysdeps/i386/i686/fpu/e_log.S
@@ -0,0 +1,29 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ *
+ * Adapted for i686 instructions.
+ */
+
+#include <machine/asm.h>
+
+
+ .text
+ENTRY(__ieee754_log)
+ fldln2 // log(2)
+ fldl 4(%esp) // x : log(2)
+ fucomi %st
+ jp 3f
+ fyl2x // log(x)
+ ret
+
+3: fstp %st(1)
+ ret
+END (__ieee754_log)
+
+ENTRY(__log_finite)
+ fldln2 // log(2)
+ fldl 4(%esp) // x : log(2)
+ fyl2x // log(x)
+ ret
+END(__log_finite)
diff --git a/libc/sysdeps/i386/i686/fpu/e_logf.S b/libc/sysdeps/i386/i686/fpu/e_logf.S
new file mode 100644
index 000000000..6fd39d50d
--- /dev/null
+++ b/libc/sysdeps/i386/i686/fpu/e_logf.S
@@ -0,0 +1,30 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for float by Ulrich Drepper <drepper@cygnus.com>.
+ *
+ * Adapted for i686 instructions.
+ */
+
+#include <machine/asm.h>
+
+
+ .text
+ENTRY(__ieee754_logf)
+ fldln2 // log(2)
+ flds 4(%esp) // x : log(2)
+ fucomi %st
+ jp 3f
+ fyl2x // log(x)
+ ret
+
+3: fstp %st(1)
+ ret
+END (__ieee754_logf)
+
+ENTRY(__logf_finite)
+ fldln2 // log(2)
+ flds 4(%esp) // x : log(2)
+ fyl2x // log(x)
+ ret
+END(__logf_finite)
diff --git a/libc/sysdeps/i386/i686/fpu/e_logl.S b/libc/sysdeps/i386/i686/fpu/e_logl.S
new file mode 100644
index 000000000..4e79a5a4b
--- /dev/null
+++ b/libc/sysdeps/i386/i686/fpu/e_logl.S
@@ -0,0 +1,81 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ *
+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
+ * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
+ * Adapted for i686 instructions.
+ */
+
+#include <machine/asm.h>
+
+#ifdef __ELF__
+ .section .rodata.cst8,"aM",@progbits,8
+#else
+ .text
+#endif
+ .p2align 3
+ 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 // log(2)
+ fldt 4(%esp) // x : log(2)
+ fucomi %st
+ jp 3f
+#ifdef PIC
+ LOAD_PIC_REG (dx)
+#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)
+ fld MO(limit) // 0.29 : |x-1| : x-1 : x : log(2)
+ fcomip %st(1) // |x-1| : x-1 : x : log(2)
+ fstp %st(0) // x-1 : x : log(2)
+ jc 2f
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+
+2: fstp %st(0) // x : log(2)
+ fyl2x // log(x)
+ ret
+
+3: fstp %st(1)
+ ret
+END (__ieee754_logl)
+
+ENTRY(__logl_finite)
+ fldln2 // log(2)
+ fldt 4(%esp) // x : log(2)
+#ifdef PIC
+ LOAD_PIC_REG (dx)
+#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)
+ fld MO(limit) // 0.29 : |x-1| : x-1 : x : log(2)
+ fcomip %st(1) // |x-1| : x-1 : x : log(2)
+ fstp %st(0) // x-1 : x : log(2)
+ jc 2b
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+END(__logl_finite)
diff --git a/libc/sysdeps/i386/i686/multiarch/Makefile b/libc/sysdeps/i386/i686/multiarch/Makefile
index c89ae9247..5f1853877 100644
--- a/libc/sysdeps/i386/i686/multiarch/Makefile
+++ b/libc/sysdeps/i386/i686/multiarch/Makefile
@@ -15,7 +15,11 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
strncpy-sse2 stpcpy-sse2 stpncpy-sse2 strcat-ssse3 \
strcat-sse2 strncat-ssse3 strncat-sse2 strncat-c \
strchr-sse2 strrchr-sse2 strchr-sse2-bsf strrchr-sse2-bsf \
- wcscmp-sse2 wcscmp-c
+ wcscmp-sse2 wcscmp-c memchr-sse2 memchr-sse2-bsf \
+ memrchr-sse2 memrchr-sse2-bsf memrchr-c \
+ rawmemchr-sse2 rawmemchr-sse2-bsf \
+ strnlen-sse2 strnlen-c wcslen-sse2 wcslen-c \
+ wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c
ifeq (yes,$(config-cflags-sse4))
sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c
CFLAGS-varshift.c += -msse4
diff --git a/libc/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S b/libc/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
new file mode 100644
index 000000000..115a2192a
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S
@@ -0,0 +1,497 @@
+/* Optimized memchr with sse2
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# define PARMS 4
+# define STR1 PARMS
+# define STR2 STR1+4
+
+# ifndef USE_AS_RAWMEMCHR
+# define LEN STR2+4
+# define RETURN POP(%edi); ret; CFI_PUSH(%edi);
+# endif
+
+# ifndef MEMCHR
+# define MEMCHR __memchr_sse2_bsf
+# endif
+
+ .text
+ENTRY (MEMCHR)
+
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+
+# ifndef USE_AS_RAWMEMCHR
+ mov LEN(%esp), %edx
+ test %edx, %edx
+ jz L(return_null_1)
+# endif
+ mov %ecx, %eax
+
+ punpcklbw %xmm1, %xmm1
+ punpcklbw %xmm1, %xmm1
+
+ and $63, %ecx
+ pshufd $0, %xmm1, %xmm1
+
+ cmp $48, %ecx
+ ja L(crosscache)
+
+ movdqu (%eax), %xmm0
+ pcmpeqb %xmm1, %xmm0
+/* Check if there is a match. */
+ pmovmskb %xmm0, %ecx
+ test %ecx, %ecx
+ je L(unaligned_no_match_1)
+/* Check which byte is a match. */
+ bsf %ecx, %ecx
+
+# ifndef USE_AS_RAWMEMCHR
+ sub %ecx, %edx
+ jbe L(return_null_1)
+# endif
+ add %ecx, %eax
+ ret
+
+ .p2align 4
+L(unaligned_no_match_1):
+# ifndef USE_AS_RAWMEMCHR
+ sub $16, %edx
+ jbe L(return_null_1)
+ PUSH (%edi)
+ lea 16(%eax), %edi
+ and $15, %eax
+ and $-16, %edi
+ add %eax, %edx
+# else
+ lea 16(%eax), %edx
+ and $-16, %edx
+# endif
+ jmp L(loop_prolog)
+
+ .p2align 4
+L(return_null_1):
+ xor %eax, %eax
+ ret
+
+# ifndef USE_AS_RAWMEMCHR
+ CFI_POP (%edi)
+# endif
+
+ .p2align 4
+L(crosscache):
+/* Handle unaligned string. */
+
+# ifndef USE_AS_RAWMEMCHR
+ PUSH (%edi)
+ mov %eax, %edi
+ and $15, %ecx
+ and $-16, %edi
+ movdqa (%edi), %xmm0
+# else
+ mov %eax, %edx
+ and $15, %ecx
+ and $-16, %edx
+ movdqa (%edx), %xmm0
+# endif
+ pcmpeqb %xmm1, %xmm0
+/* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+/* Remove the leading bytes. */
+ sar %cl, %eax
+ test %eax, %eax
+ je L(unaligned_no_match)
+/* Check which byte is a match. */
+ bsf %eax, %eax
+
+# ifndef USE_AS_RAWMEMCHR
+ sub %eax, %edx
+ jbe L(return_null)
+ add %edi, %eax
+ add %ecx, %eax
+ RETURN
+# else
+ add %edx, %eax
+ add %ecx, %eax
+ ret
+# endif
+
+ .p2align 4
+L(unaligned_no_match):
+# ifndef USE_AS_RAWMEMCHR
+ sub $16, %edx
+ add %ecx, %edx
+ jle L(return_null)
+ add $16, %edi
+# else
+ add $16, %edx
+# endif
+
+ .p2align 4
+/* Loop start on aligned string. */
+L(loop_prolog):
+# ifndef USE_AS_RAWMEMCHR
+ sub $64, %edx
+ jbe L(exit_loop)
+ movdqa (%edi), %xmm0
+# else
+ movdqa (%edx), %xmm0
+# endif
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 16(%edi), %xmm2
+# else
+ movdqa 16(%edx), %xmm2
+# endif
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 32(%edi), %xmm3
+# else
+ movdqa 32(%edx), %xmm3
+# endif
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 48(%edi), %xmm4
+# else
+ movdqa 48(%edx), %xmm4
+# endif
+ pcmpeqb %xmm1, %xmm4
+
+# ifndef USE_AS_RAWMEMCHR
+ add $64, %edi
+# else
+ add $64, %edx
+# endif
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+# ifndef USE_AS_RAWMEMCHR
+ test $0x3f, %edi
+# else
+ test $0x3f, %edx
+# endif
+ jz L(align64_loop)
+
+# ifndef USE_AS_RAWMEMCHR
+ sub $64, %edx
+ jbe L(exit_loop)
+ movdqa (%edi), %xmm0
+# else
+ movdqa (%edx), %xmm0
+# endif
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 16(%edi), %xmm2
+# else
+ movdqa 16(%edx), %xmm2
+# endif
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 32(%edi), %xmm3
+# else
+ movdqa 32(%edx), %xmm3
+# endif
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 48(%edi), %xmm3
+# else
+ movdqa 48(%edx), %xmm3
+# endif
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+
+# ifndef USE_AS_RAWMEMCHR
+ add $64, %edi
+# else
+ add $64, %edx
+# endif
+ test %eax, %eax
+ jnz L(matches0)
+
+# ifndef USE_AS_RAWMEMCHR
+ mov %edi, %ecx
+ and $-64, %edi
+ and $63, %ecx
+ add %ecx, %edx
+# else
+ and $-64, %edx
+# endif
+
+ .p2align 4
+L(align64_loop):
+# ifndef USE_AS_RAWMEMCHR
+ sub $64, %edx
+ jbe L(exit_loop)
+ movdqa (%edi), %xmm0
+ movdqa 16(%edi), %xmm2
+ movdqa 32(%edi), %xmm3
+ movdqa 48(%edi), %xmm4
+# else
+ movdqa (%edx), %xmm0
+ movdqa 16(%edx), %xmm2
+ movdqa 32(%edx), %xmm3
+ movdqa 48(%edx), %xmm4
+# endif
+ pcmpeqb %xmm1, %xmm0
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm1, %xmm3
+ pcmpeqb %xmm1, %xmm4
+
+ pmaxub %xmm0, %xmm3
+ pmaxub %xmm2, %xmm4
+ pmaxub %xmm3, %xmm4
+ pmovmskb %xmm4, %eax
+
+# ifndef USE_AS_RAWMEMCHR
+ add $64, %edi
+# else
+ add $64, %edx
+# endif
+
+ test %eax, %eax
+ jz L(align64_loop)
+
+# ifndef USE_AS_RAWMEMCHR
+ sub $64, %edi
+# else
+ sub $64, %edx
+# endif
+
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 32(%edi), %xmm3
+# else
+ movdqa 32(%edx), %xmm3
+# endif
+
+ pcmpeqb %xmm1, %xmm3
+
+# ifndef USE_AS_RAWMEMCHR
+ pcmpeqb 48(%edi), %xmm1
+# else
+ pcmpeqb 48(%edx), %xmm1
+# endif
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ pmovmskb %xmm1, %eax
+ bsf %eax, %eax
+
+# ifndef USE_AS_RAWMEMCHR
+ lea 48(%edi, %eax), %eax
+ RETURN
+# else
+ lea 48(%edx, %eax), %eax
+ ret
+# endif
+
+# ifndef USE_AS_RAWMEMCHR
+ .p2align 4
+L(exit_loop):
+ add $64, %edx
+ cmp $32, %edx
+ jbe L(exit_loop_32)
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ movdqa 16(%edi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%edi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32_1)
+ cmp $48, %edx
+ jbe L(return_null)
+
+ pcmpeqb 48(%edi), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches48_1)
+ xor %eax, %eax
+ RETURN
+
+ .p2align 4
+L(exit_loop_32):
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches_1)
+ cmp $16, %edx
+ jbe L(return_null)
+
+ pcmpeqb 16(%edi), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches16_1)
+ xor %eax, %eax
+ RETURN
+# endif
+ .p2align 4
+L(matches0):
+ bsf %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ lea -16(%eax, %edi), %eax
+ RETURN
+# else
+ lea -16(%eax, %edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(matches):
+ bsf %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ add %edi, %eax
+ RETURN
+# else
+ add %edx, %eax
+ ret
+# endif
+
+ .p2align 4
+L(matches16):
+ bsf %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ lea 16(%eax, %edi), %eax
+ RETURN
+# else
+ lea 16(%eax, %edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(matches32):
+ bsf %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ lea 32(%eax, %edi), %eax
+ RETURN
+# else
+ lea 32(%eax, %edx), %eax
+ ret
+# endif
+
+# ifndef USE_AS_RAWMEMCHR
+ .p2align 4
+L(matches_1):
+ bsf %eax, %eax
+ sub %eax, %edx
+ jbe L(return_null)
+
+ add %edi, %eax
+ RETURN
+
+ .p2align 4
+L(matches16_1):
+ sub $16, %edx
+ bsf %eax, %eax
+ sub %eax, %edx
+ jbe L(return_null)
+
+ lea 16(%edi, %eax), %eax
+ RETURN
+
+ .p2align 4
+L(matches32_1):
+ sub $32, %edx
+ bsf %eax, %eax
+ sub %eax, %edx
+ jbe L(return_null)
+
+ lea 32(%edi, %eax), %eax
+ RETURN
+
+ .p2align 4
+L(matches48_1):
+ sub $48, %edx
+ bsf %eax, %eax
+ sub %eax, %edx
+ jbe L(return_null)
+
+ lea 48(%edi, %eax), %eax
+ RETURN
+# endif
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ RETURN
+# else
+ ret
+# endif
+
+END (MEMCHR)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/memchr-sse2.S b/libc/sysdeps/i386/i686/multiarch/memchr-sse2.S
new file mode 100644
index 000000000..63d1d5d7b
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/memchr-sse2.S
@@ -0,0 +1,706 @@
+/* Optimized memchr with sse2 without bsf
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# ifndef USE_AS_RAWMEMCHR
+# define ENTRANCE PUSH(%edi);
+# define PARMS 8
+# define RETURN POP(%edi); ret; CFI_PUSH(%edi);
+# else
+# define ENTRANCE
+# define PARMS 4
+# endif
+
+# define STR1 PARMS
+# define STR2 STR1+4
+
+# ifndef USE_AS_RAWMEMCHR
+# define LEN STR2+4
+# endif
+
+# ifndef MEMCHR
+# define MEMCHR __memchr_sse2
+# endif
+
+ atom_text_section
+ENTRY (MEMCHR)
+ ENTRANCE
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+# ifndef USE_AS_RAWMEMCHR
+ mov LEN(%esp), %edx
+ test %edx, %edx
+ jz L(return_null)
+# endif
+
+ punpcklbw %xmm1, %xmm1
+# ifndef USE_AS_RAWMEMCHR
+ mov %ecx, %edi
+# else
+ mov %ecx, %edx
+# endif
+ punpcklbw %xmm1, %xmm1
+
+ and $63, %ecx
+ pshufd $0, %xmm1, %xmm1
+ cmp $48, %ecx
+ ja L(crosscache)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqu (%edi), %xmm0
+# else
+ movdqu (%edx), %xmm0
+# endif
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ jnz L(match_case2_prolog)
+
+ sub $16, %edx
+ jbe L(return_null)
+ lea 16(%edi), %edi
+ and $15, %ecx
+ and $-16, %edi
+ add %ecx, %edx
+# else
+ jnz L(match_case1_prolog)
+ lea 16(%edx), %edx
+ and $-16, %edx
+# endif
+ jmp L(loop_prolog)
+
+ .p2align 4
+L(crosscache):
+ and $15, %ecx
+# ifndef USE_AS_RAWMEMCHR
+ and $-16, %edi
+ movdqa (%edi), %xmm0
+# else
+ and $-16, %edx
+ movdqa (%edx), %xmm0
+# endif
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ sar %cl, %eax
+ test %eax, %eax
+
+# ifndef USE_AS_RAWMEMCHR
+ jnz L(match_case2_prolog1)
+ lea -16(%edx), %edx
+ add %ecx, %edx
+ jle L(return_null)
+ lea 16(%edi), %edi
+# else
+ jnz L(match_case1_prolog1)
+ lea 16(%edx), %edx
+# endif
+
+ .p2align 4
+L(loop_prolog):
+# ifndef USE_AS_RAWMEMCHR
+ sub $64, %edx
+ jbe L(exit_loop)
+ movdqa (%edi), %xmm0
+# else
+ movdqa (%edx), %xmm0
+# endif
+ pcmpeqb %xmm1, %xmm0
+ xor %ecx, %ecx
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 16(%edi), %xmm2
+# else
+ movdqa 16(%edx), %xmm2
+# endif
+ pcmpeqb %xmm1, %xmm2
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 32(%edi), %xmm3
+# else
+ movdqa 32(%edx), %xmm3
+# endif
+ pcmpeqb %xmm1, %xmm3
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 48(%edi), %xmm4
+# else
+ movdqa 48(%edx), %xmm4
+# endif
+ pcmpeqb %xmm1, %xmm4
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ lea 64(%edi), %edi
+ sub $64, %edx
+ jbe L(exit_loop)
+
+ movdqa (%edi), %xmm0
+# else
+ lea 64(%edx), %edx
+ movdqa (%edx), %xmm0
+# endif
+ pcmpeqb %xmm1, %xmm0
+ xor %ecx, %ecx
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 16(%edi), %xmm2
+# else
+ movdqa 16(%edx), %xmm2
+# endif
+ pcmpeqb %xmm1, %xmm2
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 32(%edi), %xmm3
+# else
+ movdqa 32(%edx), %xmm3
+# endif
+ pcmpeqb %xmm1, %xmm3
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 48(%edi), %xmm4
+# else
+ movdqa 48(%edx), %xmm4
+# endif
+ pcmpeqb %xmm1, %xmm4
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ lea 64(%edi), %edi
+ mov %edi, %ecx
+ and $-64, %edi
+ and $63, %ecx
+ add %ecx, %edx
+# else
+ lea 64(%edx), %edx
+ and $-64, %edx
+# endif
+
+ .p2align 4
+L(align64_loop):
+
+# ifndef USE_AS_RAWMEMCHR
+ sub $64, %edx
+ jbe L(exit_loop)
+ movdqa (%edi), %xmm0
+ movdqa 16(%edi), %xmm2
+ movdqa 32(%edi), %xmm3
+ movdqa 48(%edi), %xmm4
+# else
+ movdqa (%edx), %xmm0
+ movdqa 16(%edx), %xmm2
+ movdqa 32(%edx), %xmm3
+ movdqa 48(%edx), %xmm4
+# endif
+ pcmpeqb %xmm1, %xmm0
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm1, %xmm3
+ pcmpeqb %xmm1, %xmm4
+
+ pmaxub %xmm0, %xmm3
+ pmaxub %xmm2, %xmm4
+ pmaxub %xmm3, %xmm4
+# ifndef USE_AS_RAWMEMCHR
+ add $64, %edi
+# else
+ add $64, %edx
+# endif
+ pmovmskb %xmm4, %eax
+
+ test %eax, %eax
+ jz L(align64_loop)
+
+# ifndef USE_AS_RAWMEMCHR
+ sub $64, %edi
+# else
+ sub $64, %edx
+# endif
+
+ pmovmskb %xmm0, %eax
+ xor %ecx, %ecx
+ test %eax, %eax
+ jnz L(match_case1)
+
+ pmovmskb %xmm2, %eax
+ lea 16(%ecx), %ecx
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ movdqa 32(%edi), %xmm3
+# else
+ movdqa 32(%edx), %xmm3
+# endif
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ lea 16(%ecx), %ecx
+ test %eax, %eax
+ jnz L(match_case1)
+
+# ifndef USE_AS_RAWMEMCHR
+ pcmpeqb 48(%edi), %xmm1
+# else
+ pcmpeqb 48(%edx), %xmm1
+# endif
+ pmovmskb %xmm1, %eax
+ lea 16(%ecx), %ecx
+
+ .p2align 4
+L(match_case1):
+# ifndef USE_AS_RAWMEMCHR
+ add %ecx, %edi
+# else
+L(match_case1_prolog1):
+ add %ecx, %edx
+L(match_case1_prolog):
+# endif
+ test %al, %al
+ jz L(match_case1_high)
+ mov %al, %cl
+ and $15, %cl
+ jz L(match_case1_8)
+ test $0x01, %al
+ jnz L(ExitCase1_1)
+ test $0x02, %al
+ jnz L(ExitCase1_2)
+ test $0x04, %al
+ jnz L(ExitCase1_3)
+# ifndef USE_AS_RAWMEMCHR
+ lea 3(%edi), %eax
+ RETURN
+# else
+ lea 3(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(match_case1_8):
+ test $0x10, %al
+ jnz L(ExitCase1_5)
+ test $0x20, %al
+ jnz L(ExitCase1_6)
+ test $0x40, %al
+ jnz L(ExitCase1_7)
+# ifndef USE_AS_RAWMEMCHR
+ lea 7(%edi), %eax
+ RETURN
+# else
+ lea 7(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(match_case1_high):
+ mov %ah, %ch
+ and $15, %ch
+ jz L(match_case1_high_8)
+ test $0x01, %ah
+ jnz L(ExitCase1_9)
+ test $0x02, %ah
+ jnz L(ExitCase1_10)
+ test $0x04, %ah
+ jnz L(ExitCase1_11)
+# ifndef USE_AS_RAWMEMCHR
+ lea 11(%edi), %eax
+ RETURN
+# else
+ lea 11(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(match_case1_high_8):
+ test $0x10, %ah
+ jnz L(ExitCase1_13)
+ test $0x20, %ah
+ jnz L(ExitCase1_14)
+ test $0x40, %ah
+ jnz L(ExitCase1_15)
+# ifndef USE_AS_RAWMEMCHR
+ lea 15(%edi), %eax
+ RETURN
+# else
+ lea 15(%edx), %eax
+ ret
+# endif
+
+# ifndef USE_AS_RAWMEMCHR
+ .p2align 4
+L(exit_loop):
+ add $64, %edx
+
+ movdqa (%edi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ xor %ecx, %ecx
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(match_case2)
+ cmp $16, %edx
+ jbe L(return_null)
+
+ movdqa 16(%edi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(match_case2)
+ cmp $32, %edx
+ jbe L(return_null)
+
+ movdqa 32(%edi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(match_case2)
+ cmp $48, %edx
+ jbe L(return_null)
+
+ pcmpeqb 48(%edi), %xmm1
+ lea 16(%ecx), %ecx
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(match_case2)
+
+ xor %eax, %eax
+ RETURN
+# endif
+
+ .p2align 4
+L(ExitCase1_1):
+# ifndef USE_AS_RAWMEMCHR
+ mov %edi, %eax
+ RETURN
+# else
+ mov %edx, %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_2):
+# ifndef USE_AS_RAWMEMCHR
+ lea 1(%edi), %eax
+ RETURN
+# else
+ lea 1(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_3):
+# ifndef USE_AS_RAWMEMCHR
+ lea 2(%edi), %eax
+ RETURN
+# else
+ lea 2(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_5):
+# ifndef USE_AS_RAWMEMCHR
+ lea 4(%edi), %eax
+ RETURN
+# else
+ lea 4(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_6):
+# ifndef USE_AS_RAWMEMCHR
+ lea 5(%edi), %eax
+ RETURN
+# else
+ lea 5(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_7):
+# ifndef USE_AS_RAWMEMCHR
+ lea 6(%edi), %eax
+ RETURN
+# else
+ lea 6(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_9):
+# ifndef USE_AS_RAWMEMCHR
+ lea 8(%edi), %eax
+ RETURN
+# else
+ lea 8(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_10):
+# ifndef USE_AS_RAWMEMCHR
+ lea 9(%edi), %eax
+ RETURN
+# else
+ lea 9(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_11):
+# ifndef USE_AS_RAWMEMCHR
+ lea 10(%edi), %eax
+ RETURN
+# else
+ lea 10(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_13):
+# ifndef USE_AS_RAWMEMCHR
+ lea 12(%edi), %eax
+ RETURN
+# else
+ lea 12(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_14):
+# ifndef USE_AS_RAWMEMCHR
+ lea 13(%edi), %eax
+ RETURN
+# else
+ lea 13(%edx), %eax
+ ret
+# endif
+
+ .p2align 4
+L(ExitCase1_15):
+# ifndef USE_AS_RAWMEMCHR
+ lea 14(%edi), %eax
+ RETURN
+# else
+ lea 14(%edx), %eax
+ ret
+# endif
+
+# ifndef USE_AS_RAWMEMCHR
+ .p2align 4
+L(match_case2):
+ sub %ecx, %edx
+L(match_case2_prolog1):
+ add %ecx, %edi
+L(match_case2_prolog):
+ test %al, %al
+ jz L(match_case2_high)
+ mov %al, %cl
+ and $15, %cl
+ jz L(match_case2_8)
+ test $0x01, %al
+ jnz L(ExitCase2_1)
+ test $0x02, %al
+ jnz L(ExitCase2_2)
+ test $0x04, %al
+ jnz L(ExitCase2_3)
+ sub $4, %edx
+ jb L(return_null)
+ lea 3(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_case2_8):
+ test $0x10, %al
+ jnz L(ExitCase2_5)
+ test $0x20, %al
+ jnz L(ExitCase2_6)
+ test $0x40, %al
+ jnz L(ExitCase2_7)
+ sub $8, %edx
+ jb L(return_null)
+ lea 7(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_case2_high):
+ mov %ah, %ch
+ and $15, %ch
+ jz L(match_case2_high_8)
+ test $0x01, %ah
+ jnz L(ExitCase2_9)
+ test $0x02, %ah
+ jnz L(ExitCase2_10)
+ test $0x04, %ah
+ jnz L(ExitCase2_11)
+ sub $12, %edx
+ jb L(return_null)
+ lea 11(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(match_case2_high_8):
+ test $0x10, %ah
+ jnz L(ExitCase2_13)
+ test $0x20, %ah
+ jnz L(ExitCase2_14)
+ test $0x40, %ah
+ jnz L(ExitCase2_15)
+ sub $16, %edx
+ jb L(return_null)
+ lea 15(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_1):
+ mov %edi, %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_2):
+ sub $2, %edx
+ jb L(return_null)
+ lea 1(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_3):
+ sub $3, %edx
+ jb L(return_null)
+ lea 2(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_5):
+ sub $5, %edx
+ jb L(return_null)
+ lea 4(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_6):
+ sub $6, %edx
+ jb L(return_null)
+ lea 5(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_7):
+ sub $7, %edx
+ jb L(return_null)
+ lea 6(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_9):
+ sub $9, %edx
+ jb L(return_null)
+ lea 8(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_10):
+ sub $10, %edx
+ jb L(return_null)
+ lea 9(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_11):
+ sub $11, %edx
+ jb L(return_null)
+ lea 10(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_13):
+ sub $13, %edx
+ jb L(return_null)
+ lea 12(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_14):
+ sub $14, %edx
+ jb L(return_null)
+ lea 13(%edi), %eax
+ RETURN
+
+ .p2align 4
+L(ExitCase2_15):
+ sub $15, %edx
+ jb L(return_null)
+ lea 14(%edi), %eax
+ RETURN
+# endif
+
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+# ifndef USE_AS_RAWMEMCHR
+ RETURN
+# else
+ ret
+# endif
+
+END (MEMCHR)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/memchr.S b/libc/sysdeps/i386/i686/multiarch/memchr.S
new file mode 100644
index 000000000..163a83e17
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/memchr.S
@@ -0,0 +1,99 @@
+/* Multiple versions of memchr
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+ .text
+ENTRY(__memchr)
+ .type __memchr, @gnu_indirect_function
+ pushl %ebx
+ CFI_PUSH (%ebx)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+
+1: testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+ jz 3f
+
+ leal __memchr_sse2@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+
+ CFI_PUSH (%ebx)
+
+2: leal __memchr_ia32@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+
+ CFI_PUSH (%ebx)
+
+3: leal __memchr_sse2_bsf@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+END(__memchr)
+
+weak_alias(__memchr, memchr)
+
+# undef ENTRY
+# define ENTRY(name) \
+ .type __memchr_ia32, @function; \
+ .globl __memchr_ia32; \
+ .p2align 4; \
+ __memchr_ia32: cfi_startproc; \
+ CALL_MCOUNT
+# undef END
+# define END(name) \
+ cfi_endproc; .size __memchr_ia32, .-__memchr_ia32
+
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_builtin_def(name) \
+ .globl __GI_memchr; __GI_memchr = __memchr_ia32
+
+#endif
+#include "../../memchr.S"
diff --git a/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S b/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S
index b1ed778f1..1f5dbc15c 100644
--- a/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S
+++ b/libc/sysdeps/i386/i686/multiarch/memcmp-sse4.S
@@ -1,5 +1,5 @@
-/* memcmp with SSE4.2
- Copyright (C) 2010 Free Software Foundation, Inc.
+/* memcmp with SSE4.2, wmemcmp with SSE4.2
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -20,84 +20,97 @@
#ifndef NOT_IN_libc
-#include <sysdep.h>
-#include "asm-syntax.h"
+# include <sysdep.h>
-#ifndef MEMCMP
-# define MEMCMP __memcmp_sse4_2
-#endif
+# ifndef MEMCMP
+# define MEMCMP __memcmp_sse4_2
+# endif
-#define CFI_PUSH(REG) \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (REG, 0)
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
-#define CFI_POP(REG) \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (REG)
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
-#define PUSH(REG) pushl REG; CFI_PUSH (REG)
-#define POP(REG) popl REG; CFI_POP (REG)
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
-#define PARMS 4
-#define BLK1 PARMS
-#define BLK2 BLK1+4
-#define LEN BLK2+4
-#define RETURN POP (%ebx); ret; CFI_PUSH (%ebx)
+# define PARMS 4
+# define BLK1 PARMS
+# define BLK2 BLK1 + 4
+# define LEN BLK2 + 4
+# define RETURN POP (%ebx); ret; CFI_PUSH (%ebx)
-#ifdef SHARED
-# define JMPTBL(I, B) I - B
+# ifdef SHARED
+# define JMPTBL(I, B) I - B
/* Load an entry in a jump table into EBX and branch to it. TABLE is a
- jump table with relative offsets. INDEX is a register contains the
- index into the jump table. SCALE is the scale of INDEX. */
-# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
- /* We first load PC into EBX. */ \
- call __i686.get_pc_thunk.bx; \
- /* Get the address of the jump table. */ \
- addl $(TABLE - .), %ebx; \
- /* Get the entry and convert the relative offset to the \
- absolute address. */ \
- addl (%ebx,INDEX,SCALE), %ebx; \
- /* We loaded the jump table and adjuested EDX/ESI. Go. */ \
- jmp *%ebx
-
- .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
- .globl __i686.get_pc_thunk.bx
- .hidden __i686.get_pc_thunk.bx
- ALIGN (4)
- .type __i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
- movl (%esp), %ebx
- ret
-#else
-# define JMPTBL(I, B) I
+ jump table with relative offsets. INDEX is a register contains the
+ index into the jump table. SCALE is the scale of INDEX. */
+
+# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
+/* We first load PC into EBX. */ \
+ call __i686.get_pc_thunk.bx; \
+/* Get the address of the jump table. */ \
+ addl $(TABLE - .), %ebx; \
+/* Get the entry and convert the relative offset to the \
+ absolute address. */ \
+ addl (%ebx,INDEX,SCALE), %ebx; \
+/* We loaded the jump table and adjuested EDX/ESI. Go. */ \
+ jmp *%ebx
+# else
+# define JMPTBL(I, B) I
/* Load an entry in a jump table into EBX and branch to it. TABLE is a
- jump table with relative offsets. INDEX is a register contains the
- index into the jump table. SCALE is the scale of INDEX. */
-# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
- jmp *TABLE(,INDEX,SCALE)
-#endif
+ jump table with relative offsets. INDEX is a register contains the
+ index into the jump table. SCALE is the scale of INDEX. */
+# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
+ jmp *TABLE(,INDEX,SCALE)
+# endif
+
+
+/* Warning!
+ wmemcmp has to use SIGNED comparison for elements.
+ memcmp has to use UNSIGNED comparison for elemnts.
+*/
.section .text.sse4.2,"ax",@progbits
ENTRY (MEMCMP)
movl BLK1(%esp), %eax
movl BLK2(%esp), %edx
movl LEN(%esp), %ecx
+
+# ifdef USE_AS_WMEMCMP
+ shl $2, %ecx
+ test %ecx, %ecx
+ jz L(return0)
+# else
cmp $1, %ecx
jbe L(less1bytes)
+# endif
+
pxor %xmm0, %xmm0
cmp $64, %ecx
ja L(64bytesormore)
cmp $8, %ecx
- PUSH (%ebx)
+
+# ifndef USE_AS_WMEMCMP
+ PUSH (%ebx)
+ jb L(less8bytes)
+# else
jb L(less8bytes)
+ PUSH (%ebx)
+# endif
+
add %ecx, %edx
add %ecx, %eax
BRANCH_TO_JMPTBL_ENTRY(L(table_64bytes), %ecx, 4)
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(less8bytes):
mov (%eax), %bl
cmpb (%edx), %bl
@@ -141,22 +154,49 @@ L(less8bytes):
mov 6(%eax), %bl
cmpb 6(%edx), %bl
je L(0bytes)
+
L(nonzero):
- POP (%ebx)
+ POP (%ebx)
mov $1, %eax
ja L(above)
neg %eax
L(above):
ret
CFI_PUSH (%ebx)
+# endif
- ALIGN (4)
+ .p2align 4
L(0bytes):
- POP (%ebx)
+ POP (%ebx)
xor %eax, %eax
ret
- ALIGN (4)
+# ifdef USE_AS_WMEMCMP
+
+/* for wmemcmp, case N == 1 */
+
+ .p2align 4
+L(less8bytes):
+ mov (%eax), %ecx
+ cmp (%edx), %ecx
+ je L(return0)
+ mov $1, %eax
+ jg L(find_diff_bigger)
+ neg %eax
+ ret
+
+ .p2align 4
+L(find_diff_bigger):
+ ret
+
+ .p2align 4
+L(return0):
+ xor %eax, %eax
+ ret
+# endif
+
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(less1bytes):
jb L(0bytesend)
movzbl (%eax), %eax
@@ -164,14 +204,14 @@ L(less1bytes):
sub %edx, %eax
ret
- ALIGN (4)
+ .p2align 4
L(0bytesend):
xor %eax, %eax
ret
-
- ALIGN (4)
+# endif
+ .p2align 4
L(64bytesormore):
- PUSH (%ebx)
+ PUSH (%ebx)
mov %ecx, %ebx
mov $64, %ecx
sub $64, %ebx
@@ -208,7 +248,14 @@ L(64bytesormore_loop):
add %ecx, %eax
BRANCH_TO_JMPTBL_ENTRY(L(table_64bytes), %ecx, 4)
- ALIGN (4)
+# ifdef USE_AS_WMEMCMP
+
+/* Label needs only for table_64bytes filling */
+L(unreal_case):
+/* no code here */
+
+# endif
+ .p2align 4
L(find_16diff):
sub $16, %ecx
L(find_32diff):
@@ -218,9 +265,9 @@ L(find_48diff):
L(find_64diff):
add %ecx, %edx
add %ecx, %eax
- jmp L(16bytes)
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(16bytes):
mov -16(%eax), %ecx
mov -16(%edx), %ebx
@@ -243,8 +290,30 @@ L(4bytes):
mov $0, %eax
jne L(find_diff)
RETURN
+# else
+ .p2align 4
+L(16bytes):
+ mov -16(%eax), %ecx
+ cmp -16(%edx), %ecx
+ jne L(find_diff)
+L(12bytes):
+ mov -12(%eax), %ecx
+ cmp -12(%edx), %ecx
+ jne L(find_diff)
+L(8bytes):
+ mov -8(%eax), %ecx
+ cmp -8(%edx), %ecx
+ jne L(find_diff)
+L(4bytes):
+ mov -4(%eax), %ecx
+ cmp -4(%edx), %ecx
+ mov $0, %eax
+ jne L(find_diff)
+ RETURN
+# endif
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(49bytes):
movdqu -49(%eax), %xmm1
movdqu -49(%edx), %xmm2
@@ -285,7 +354,7 @@ L(5bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(50bytes):
mov $-50, %ebx
movdqu -50(%eax), %xmm1
@@ -330,7 +399,7 @@ L(2bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(51bytes):
mov $-51, %ebx
movdqu -51(%eax), %xmm1
@@ -378,8 +447,8 @@ L(1bytes):
mov $0, %eax
jne L(end)
RETURN
-
- ALIGN (4)
+# endif
+ .p2align 4
L(52bytes):
movdqu -52(%eax), %xmm1
movdqu -52(%edx), %xmm2
@@ -402,13 +471,18 @@ L(20bytes):
ptest %xmm2, %xmm0
jnc L(less16bytes)
mov -4(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -4(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -4(%edx), %ecx
+# endif
mov $0, %eax
jne L(find_diff)
RETURN
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(53bytes):
movdqu -53(%eax), %xmm1
movdqu -53(%edx), %xmm2
@@ -440,7 +514,7 @@ L(21bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(54bytes):
movdqu -54(%eax), %xmm1
movdqu -54(%edx), %xmm2
@@ -476,7 +550,7 @@ L(22bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(55bytes):
movdqu -55(%eax), %xmm1
movdqu -55(%edx), %xmm2
@@ -513,8 +587,8 @@ L(23bytes):
mov $0, %eax
jne L(end)
RETURN
-
- ALIGN (4)
+# endif
+ .p2align 4
L(56bytes):
movdqu -56(%eax), %xmm1
movdqu -56(%edx), %xmm2
@@ -538,18 +612,27 @@ L(24bytes):
jnc L(less16bytes)
mov -8(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -8(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -8(%edx), %ecx
+# endif
jne L(find_diff)
mov -4(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -4(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -4(%edx), %ecx
+# endif
mov $0, %eax
jne L(find_diff)
RETURN
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(57bytes):
movdqu -57(%eax), %xmm1
movdqu -57(%edx), %xmm2
@@ -585,7 +668,7 @@ L(25bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(58bytes):
movdqu -58(%eax), %xmm1
movdqu -58(%edx), %xmm2
@@ -627,7 +710,7 @@ L(26bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(59bytes):
movdqu -59(%eax), %xmm1
movdqu -59(%edx), %xmm2
@@ -668,8 +751,8 @@ L(27bytes):
mov $0, %eax
jne L(end)
RETURN
-
- ALIGN (4)
+# endif
+ .p2align 4
L(60bytes):
movdqu -60(%eax), %xmm1
movdqu -60(%edx), %xmm2
@@ -691,22 +774,38 @@ L(28bytes):
pxor %xmm1, %xmm2
ptest %xmm2, %xmm0
jnc L(less16bytes)
+
mov -12(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -12(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -12(%edx), %ecx
+# endif
jne L(find_diff)
+
mov -8(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -8(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -8(%edx), %ecx
+# endif
jne L(find_diff)
+
mov -4(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -4(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -4(%edx), %ecx
+# endif
mov $0, %eax
jne L(find_diff)
RETURN
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(61bytes):
movdqu -61(%eax), %xmm1
movdqu -61(%edx), %xmm2
@@ -749,7 +848,7 @@ L(29bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(62bytes):
movdqu -62(%eax), %xmm1
movdqu -62(%edx), %xmm2
@@ -792,7 +891,7 @@ L(30bytes):
jne L(end)
RETURN
- ALIGN (4)
+ .p2align 4
L(63bytes):
movdqu -63(%eax), %xmm1
movdqu -63(%edx), %xmm2
@@ -838,8 +937,9 @@ L(31bytes):
mov $0, %eax
jne L(end)
RETURN
+# endif
- ALIGN (4)
+ .p2align 4
L(64bytes):
movdqu -64(%eax), %xmm1
movdqu -64(%edx), %xmm2
@@ -863,28 +963,45 @@ L(32bytes):
jnc L(less16bytes)
mov -16(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -16(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -16(%edx), %ecx
+# endif
jne L(find_diff)
mov -12(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -12(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -12(%edx), %ecx
+# endif
jne L(find_diff)
mov -8(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -8(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -8(%edx), %ecx
+# endif
jne L(find_diff)
mov -4(%eax), %ecx
+# ifndef USE_AS_WMEMCMP
mov -4(%edx), %ebx
cmp %ebx, %ecx
+# else
+ cmp -4(%edx), %ecx
+# endif
mov $0, %eax
jne L(find_diff)
RETURN
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(less16bytes):
add %ebx, %eax
add %ebx, %edx
@@ -910,9 +1027,35 @@ L(less16bytes):
mov $0, %eax
jne L(find_diff)
RETURN
+# else
+ .p2align 4
+L(less16bytes):
+ add %ebx, %eax
+ add %ebx, %edx
+
+ mov (%eax), %ecx
+ cmp (%edx), %ecx
+ jne L(find_diff)
+
+ mov 4(%eax), %ecx
+ cmp 4(%edx), %ecx
+ jne L(find_diff)
+
+ mov 8(%eax), %ecx
+ cmp 8(%edx), %ecx
+ jne L(find_diff)
+
+ mov 12(%eax), %ecx
+ cmp 12(%edx), %ecx
+
+ mov $0, %eax
+ jne L(find_diff)
+ RETURN
+# endif
- ALIGN (4)
+ .p2align 4
L(find_diff):
+# ifndef USE_AS_WMEMCMP
cmpb %bl, %cl
jne L(end)
cmp %bx, %cx
@@ -923,17 +1066,29 @@ L(find_diff):
jne L(end)
cmp %bx, %cx
L(end):
- POP (%ebx)
+ POP (%ebx)
mov $1, %eax
ja L(bigger)
neg %eax
L(bigger):
ret
+# else
+ POP (%ebx)
+ mov $1, %eax
+ jg L(bigger)
+ neg %eax
+ ret
+
+ .p2align 4
+L(bigger):
+ ret
+# endif
END (MEMCMP)
.section .rodata.sse4.2,"a",@progbits
- ALIGN (2)
+ .p2align 2
.type L(table_64bytes), @object
+# ifndef USE_AS_WMEMCMP
L(table_64bytes):
.int JMPTBL (L(0bytes), L(table_64bytes))
.int JMPTBL (L(1bytes), L(table_64bytes))
@@ -1000,5 +1155,72 @@ L(table_64bytes):
.int JMPTBL (L(62bytes), L(table_64bytes))
.int JMPTBL (L(63bytes), L(table_64bytes))
.int JMPTBL (L(64bytes), L(table_64bytes))
- .size L(table_64bytes), .-L(table_64bytes)
+# else
+L(table_64bytes):
+ .int JMPTBL (L(0bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(4bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(8bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(12bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(16bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(20bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(24bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(28bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(32bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(36bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(40bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(44bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(48bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(52bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(56bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(60bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(64bytes), L(table_64bytes))
+# endif
#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S b/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
index 2e0d15fe5..eab85c1de 100644
--- a/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
+++ b/libc/sysdeps/i386/i686/multiarch/memcmp-ssse3.S
@@ -1,5 +1,5 @@
-/* memcmp with SSSE3
- Copyright (C) 2010 Free Software Foundation, Inc.
+/* memcmp with SSSE3, wmemcmp with SSSE3
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -20,47 +20,64 @@
#ifndef NOT_IN_libc
-#include <sysdep.h>
-#include "asm-syntax.h"
+# include <sysdep.h>
-#ifndef MEMCMP
-# define MEMCMP __memcmp_ssse3
-#endif
+# ifndef MEMCMP
+# define MEMCMP __memcmp_ssse3
+# endif
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
-#define CFI_PUSH(REG) \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (REG, 0)
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
-#define CFI_POP(REG) \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (REG)
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
-#define PUSH(REG) pushl REG; CFI_PUSH (REG)
-#define POP(REG) popl REG; CFI_POP (REG)
+# define PARMS 4
+# define BLK1 PARMS
+# define BLK2 BLK1+4
+# define LEN BLK2+4
+# define RETURN_END POP (%edi); POP (%esi); POP (%ebx); ret
+# define RETURN RETURN_END; cfi_restore_state; cfi_remember_state
-#define PARMS 4
-#define BLK1 PARMS
-#define BLK2 BLK1+4
-#define LEN BLK2+4
-#define RETURN_END POP (%edi); POP (%esi); POP (%ebx); ret
-#define RETURN RETURN_END; cfi_restore_state; cfi_remember_state
+/* Warning!
+ wmemcmp has to use SIGNED comparison for elements.
+ memcmp has to use UNSIGNED comparison for elemnts.
+*/
- .section .text.ssse3,"ax",@progbits
+ atom_text_section
ENTRY (MEMCMP)
movl LEN(%esp), %ecx
+
+# ifdef USE_AS_WMEMCMP
+ shl $2, %ecx
+ test %ecx, %ecx
+ jz L(zero)
+# endif
+
movl BLK1(%esp), %eax
cmp $48, %ecx
movl BLK2(%esp), %edx
jae L(48bytesormore)
+
+# ifndef USE_AS_WMEMCMP
cmp $1, %ecx
jbe L(less1bytes)
- PUSH (%ebx)
+# endif
+
+ PUSH (%ebx)
add %ecx, %edx
add %ecx, %eax
jmp L(less48bytes)
- ALIGN (4)
- CFI_POP (%ebx)
+ CFI_POP (%ebx)
+
+# ifndef USE_AS_WMEMCMP
+ .p2align 4
L(less1bytes):
jb L(zero)
movb (%eax), %cl
@@ -71,29 +88,30 @@ L(less1bytes):
neg %eax
L(1bytesend):
ret
+# endif
- ALIGN (4)
+ .p2align 4
L(zero):
- mov $0, %eax
+ xor %eax, %eax
ret
- ALIGN (4)
+ .p2align 4
L(48bytesormore):
- PUSH (%ebx)
- PUSH (%esi)
- PUSH (%edi)
+ PUSH (%ebx)
+ PUSH (%esi)
+ PUSH (%edi)
cfi_remember_state
- movdqu (%eax), %xmm3
- movdqu (%edx), %xmm0
+ movdqu (%eax), %xmm3
+ movdqu (%edx), %xmm0
movl %eax, %edi
movl %edx, %esi
- pcmpeqb %xmm0, %xmm3
- pmovmskb %xmm3, %edx
+ pcmpeqb %xmm0, %xmm3
+ pmovmskb %xmm3, %edx
lea 16(%edi), %edi
- sub $0xffff, %edx
+ sub $0xffff, %edx
lea 16(%esi), %esi
- jnz L(less16bytes)
+ jnz L(less16bytes)
mov %edi, %edx
and $0xf, %edx
xor %edx, %edi
@@ -104,6 +122,7 @@ L(48bytesormore):
jz L(shr_0)
xor %edx, %esi
+# ifndef USE_AS_WMEMCMP
cmp $8, %edx
jae L(next_unaligned_table)
cmp $0, %edx
@@ -122,7 +141,7 @@ L(48bytesormore):
je L(shr_6)
jmp L(shr_7)
- ALIGN (4)
+ .p2align 2
L(next_unaligned_table):
cmp $8, %edx
je L(shr_8)
@@ -139,8 +158,17 @@ L(next_unaligned_table):
cmp $14, %edx
je L(shr_14)
jmp L(shr_15)
+# else
+ cmp $0, %edx
+ je L(shr_0)
+ cmp $4, %edx
+ je L(shr_4)
+ cmp $8, %edx
+ je L(shr_8)
+ jmp L(shr_12)
+# endif
- ALIGN (4)
+ .p2align 4
L(shr_0):
cmp $80, %ecx
jae L(shr_0_gobble)
@@ -159,13 +187,13 @@ L(shr_0):
lea (%ecx, %edi,1), %eax
lea (%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_0_gobble):
lea -48(%ecx), %ecx
movdqa (%esi), %xmm0
@@ -205,13 +233,14 @@ L(shr_0_gobble_loop_next):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea (%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# ifndef USE_AS_WMEMCMP
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_1):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -235,13 +264,13 @@ L(shr_1):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 1(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_1_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -288,14 +317,14 @@ L(shr_1_gobble_next):
lea (%ecx, %edi,1), %eax
lea 1(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_2):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -319,13 +348,13 @@ L(shr_2):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 2(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_2_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -372,13 +401,13 @@ L(shr_2_gobble_next):
lea (%ecx, %edi,1), %eax
lea 2(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_3):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -402,13 +431,13 @@ L(shr_3):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 3(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_3_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -455,13 +484,14 @@ L(shr_3_gobble_next):
lea (%ecx, %edi,1), %eax
lea 3(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# endif
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_4):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -485,13 +515,13 @@ L(shr_4):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 4(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_4_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -538,13 +568,14 @@ L(shr_4_gobble_next):
lea (%ecx, %edi,1), %eax
lea 4(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# ifndef USE_AS_WMEMCMP
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_5):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -568,13 +599,13 @@ L(shr_5):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 5(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_5_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -621,13 +652,13 @@ L(shr_5_gobble_next):
lea (%ecx, %edi,1), %eax
lea 5(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_6):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -651,13 +682,13 @@ L(shr_6):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 6(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_6_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -704,13 +735,13 @@ L(shr_6_gobble_next):
lea (%ecx, %edi,1), %eax
lea 6(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_7):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -734,13 +765,13 @@ L(shr_7):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 7(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_7_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -787,13 +818,14 @@ L(shr_7_gobble_next):
lea (%ecx, %edi,1), %eax
lea 7(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# endif
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_8):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -817,13 +849,13 @@ L(shr_8):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 8(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_8_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -870,13 +902,14 @@ L(shr_8_gobble_next):
lea (%ecx, %edi,1), %eax
lea 8(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# ifndef USE_AS_WMEMCMP
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_9):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -900,13 +933,13 @@ L(shr_9):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 9(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_9_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -953,13 +986,13 @@ L(shr_9_gobble_next):
lea (%ecx, %edi,1), %eax
lea 9(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_10):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -983,13 +1016,13 @@ L(shr_10):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 10(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_10_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -1036,13 +1069,13 @@ L(shr_10_gobble_next):
lea (%ecx, %edi,1), %eax
lea 10(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_11):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -1066,13 +1099,13 @@ L(shr_11):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 11(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_11_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -1119,13 +1152,14 @@ L(shr_11_gobble_next):
lea (%ecx, %edi,1), %eax
lea 11(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# endif
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_12):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -1149,13 +1183,13 @@ L(shr_12):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 12(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_12_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -1202,13 +1236,14 @@ L(shr_12_gobble_next):
lea (%ecx, %edi,1), %eax
lea 12(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# ifndef USE_AS_WMEMCMP
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_13):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -1232,13 +1267,13 @@ L(shr_13):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 13(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_13_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -1285,13 +1320,13 @@ L(shr_13_gobble_next):
lea (%ecx, %edi,1), %eax
lea 13(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_14):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -1315,13 +1350,13 @@ L(shr_14):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 14(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_14_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -1368,13 +1403,13 @@ L(shr_14_gobble_next):
lea (%ecx, %edi,1), %eax
lea 14(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_15):
cmp $80, %ecx
lea -48(%ecx), %ecx
@@ -1398,13 +1433,13 @@ L(shr_15):
jnz L(exit)
lea (%ecx, %edi,1), %eax
lea 15(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(shr_15_gobble):
sub $32, %ecx
movdqa 16(%esi), %xmm0
@@ -1451,13 +1486,14 @@ L(shr_15_gobble_next):
lea (%ecx, %edi,1), %eax
lea 15(%ecx, %esi,1), %edx
- POP (%edi)
- POP (%esi)
+ POP (%edi)
+ POP (%esi)
jmp L(less48bytes)
+# endif
cfi_restore_state
cfi_remember_state
- ALIGN (4)
+ .p2align 4
L(exit):
pmovmskb %xmm1, %ebx
sub $0xffff, %ebx
@@ -1465,9 +1501,12 @@ L(exit):
lea -16(%esi), %esi
lea -16(%edi), %edi
mov %ebx, %edx
+
L(first16bytes):
add %eax, %esi
L(less16bytes):
+
+# ifndef USE_AS_WMEMCMP
test %dl, %dl
jz L(next_24_bytes)
@@ -1492,61 +1531,61 @@ L(less16bytes):
test $0x40, %dl
jnz L(Byte22)
L(Byte23):
- movzbl -9(%edi), %eax
- movzbl -9(%esi), %edx
+ movzbl -9(%edi), %eax
+ movzbl -9(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(Byte16):
- movzbl -16(%edi), %eax
- movzbl -16(%esi), %edx
+ movzbl -16(%edi), %eax
+ movzbl -16(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(Byte17):
- movzbl -15(%edi), %eax
- movzbl -15(%esi), %edx
+ movzbl -15(%edi), %eax
+ movzbl -15(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(Byte18):
- movzbl -14(%edi), %eax
- movzbl -14(%esi), %edx
+ movzbl -14(%edi), %eax
+ movzbl -14(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(Byte19):
- movzbl -13(%edi), %eax
- movzbl -13(%esi), %edx
+ movzbl -13(%edi), %eax
+ movzbl -13(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(Byte20):
- movzbl -12(%edi), %eax
- movzbl -12(%esi), %edx
+ movzbl -12(%edi), %eax
+ movzbl -12(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(Byte21):
- movzbl -11(%edi), %eax
- movzbl -11(%esi), %edx
+ movzbl -11(%edi), %eax
+ movzbl -11(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(Byte22):
- movzbl -10(%edi), %eax
- movzbl -10(%esi), %edx
+ movzbl -10(%edi), %eax
+ movzbl -10(%esi), %edx
sub %edx, %eax
RETURN
- ALIGN (4)
+ .p2align 4
L(next_24_bytes):
lea 8(%edi), %edi
lea 8(%esi), %esi
@@ -1571,20 +1610,69 @@ L(next_24_bytes):
test $0x40, %dh
jnz L(Byte22)
- ALIGN (4)
+ .p2align 4
L(Byte31):
- movzbl -9(%edi), %eax
- movzbl -9(%esi), %edx
+ movzbl -9(%edi), %eax
+ movzbl -9(%esi), %edx
sub %edx, %eax
RETURN_END
+# else
+
+/* special for wmemcmp */
+ xor %eax, %eax
+ test %dl, %dl
+ jz L(next_two_double_words)
+ and $15, %dl
+ jz L(second_double_word)
+ mov -16(%edi), %eax
+ cmp -16(%esi), %eax
+ jne L(nequal)
+ RETURN
+
+ .p2align 4
+L(second_double_word):
+ mov -12(%edi), %eax
+ cmp -12(%esi), %eax
+ jne L(nequal)
+ RETURN
+
+ .p2align 4
+L(next_two_double_words):
+ and $15, %dh
+ jz L(fourth_double_word)
+ mov -8(%edi), %eax
+ cmp -8(%esi), %eax
+ jne L(nequal)
+ RETURN
+
+ .p2align 4
+L(fourth_double_word):
+ mov -4(%edi), %eax
+ cmp -4(%esi), %eax
+ jne L(nequal)
+ RETURN
+
+ .p2align 4
+L(nequal):
+ mov $1, %eax
+ jg L(nequal_bigger)
+ neg %eax
+ RETURN
+
+ .p2align 4
+L(nequal_bigger):
+ RETURN_END
+# endif
CFI_PUSH (%ebx)
- ALIGN (4)
+
+ .p2align 4
L(more8bytes):
cmp $16, %ecx
jae L(more16bytes)
cmp $8, %ecx
je L(8bytes)
+# ifndef USE_AS_WMEMCMP
cmp $9, %ecx
je L(9bytes)
cmp $10, %ecx
@@ -1598,13 +1686,17 @@ L(more8bytes):
cmp $14, %ecx
je L(14bytes)
jmp L(15bytes)
+# else
+ jmp L(12bytes)
+# endif
- ALIGN (4)
+ .p2align 4
L(more16bytes):
cmp $24, %ecx
jae L(more24bytes)
cmp $16, %ecx
je L(16bytes)
+# ifndef USE_AS_WMEMCMP
cmp $17, %ecx
je L(17bytes)
cmp $18, %ecx
@@ -1618,13 +1710,17 @@ L(more16bytes):
cmp $22, %ecx
je L(22bytes)
jmp L(23bytes)
+# else
+ jmp L(20bytes)
+# endif
- ALIGN (4)
+ .p2align 4
L(more24bytes):
cmp $32, %ecx
jae L(more32bytes)
cmp $24, %ecx
je L(24bytes)
+# ifndef USE_AS_WMEMCMP
cmp $25, %ecx
je L(25bytes)
cmp $26, %ecx
@@ -1638,13 +1734,17 @@ L(more24bytes):
cmp $30, %ecx
je L(30bytes)
jmp L(31bytes)
+# else
+ jmp L(28bytes)
+# endif
- ALIGN (4)
+ .p2align 4
L(more32bytes):
cmp $40, %ecx
jae L(more40bytes)
cmp $32, %ecx
je L(32bytes)
+# ifndef USE_AS_WMEMCMP
cmp $33, %ecx
je L(33bytes)
cmp $34, %ecx
@@ -1658,11 +1758,35 @@ L(more32bytes):
cmp $38, %ecx
je L(38bytes)
jmp L(39bytes)
+# else
+ jmp L(36bytes)
+# endif
+
+ .p2align 4
+L(less48bytes):
+ cmp $8, %ecx
+ jae L(more8bytes)
+# ifndef USE_AS_WMEMCMP
+ cmp $2, %ecx
+ je L(2bytes)
+ cmp $3, %ecx
+ je L(3bytes)
+ cmp $4, %ecx
+ je L(4bytes)
+ cmp $5, %ecx
+ je L(5bytes)
+ cmp $6, %ecx
+ je L(6bytes)
+ jmp L(7bytes)
+# else
+ jmp L(4bytes)
+# endif
- ALIGN (4)
+ .p2align 4
L(more40bytes):
cmp $40, %ecx
je L(40bytes)
+# ifndef USE_AS_WMEMCMP
cmp $41, %ecx
je L(41bytes)
cmp $42, %ecx
@@ -1677,23 +1801,7 @@ L(more40bytes):
je L(46bytes)
jmp L(47bytes)
- ALIGN (4)
-L(less48bytes):
- cmp $8, %ecx
- jae L(more8bytes)
- cmp $2, %ecx
- je L(2bytes)
- cmp $3, %ecx
- je L(3bytes)
- cmp $4, %ecx
- je L(4bytes)
- cmp $5, %ecx
- je L(5bytes)
- cmp $6, %ecx
- je L(6bytes)
- jmp L(7bytes)
-
- ALIGN (4)
+ .p2align 4
L(44bytes):
mov -44(%eax), %ecx
mov -44(%edx), %ebx
@@ -1750,11 +1858,64 @@ L(4bytes):
cmp %ebx, %ecx
mov $0, %eax
jne L(find_diff)
- POP (%ebx)
+ POP (%ebx)
+ ret
+ CFI_PUSH (%ebx)
+# else
+ .p2align 4
+L(44bytes):
+ mov -44(%eax), %ecx
+ cmp -44(%edx), %ecx
+ jne L(find_diff)
+L(40bytes):
+ mov -40(%eax), %ecx
+ cmp -40(%edx), %ecx
+ jne L(find_diff)
+L(36bytes):
+ mov -36(%eax), %ecx
+ cmp -36(%edx), %ecx
+ jne L(find_diff)
+L(32bytes):
+ mov -32(%eax), %ecx
+ cmp -32(%edx), %ecx
+ jne L(find_diff)
+L(28bytes):
+ mov -28(%eax), %ecx
+ cmp -28(%edx), %ecx
+ jne L(find_diff)
+L(24bytes):
+ mov -24(%eax), %ecx
+ cmp -24(%edx), %ecx
+ jne L(find_diff)
+L(20bytes):
+ mov -20(%eax), %ecx
+ cmp -20(%edx), %ecx
+ jne L(find_diff)
+L(16bytes):
+ mov -16(%eax), %ecx
+ cmp -16(%edx), %ecx
+ jne L(find_diff)
+L(12bytes):
+ mov -12(%eax), %ecx
+ cmp -12(%edx), %ecx
+ jne L(find_diff)
+L(8bytes):
+ mov -8(%eax), %ecx
+ cmp -8(%edx), %ecx
+ jne L(find_diff)
+L(4bytes):
+ mov -4(%eax), %ecx
+ xor %eax, %eax
+ cmp -4(%edx), %ecx
+ jne L(find_diff)
+ POP (%ebx)
ret
CFI_PUSH (%ebx)
+# endif
- ALIGN (4)
+# ifndef USE_AS_WMEMCMP
+
+ .p2align 4
L(45bytes):
mov -45(%eax), %ecx
mov -45(%edx), %ebx
@@ -1814,11 +1975,11 @@ L(5bytes):
cmp -1(%edx), %cl
mov $0, %eax
jne L(end)
- POP (%ebx)
+ POP (%ebx)
ret
CFI_PUSH (%ebx)
- ALIGN (4)
+ .p2align 4
L(46bytes):
mov -46(%eax), %ecx
mov -46(%edx), %ebx
@@ -1882,11 +2043,11 @@ L(2bytes):
cmp %bh, %ch
mov $0, %eax
jne L(end)
- POP (%ebx)
+ POP (%ebx)
ret
CFI_PUSH (%ebx)
- ALIGN (4)
+ .p2align 4
L(47bytes):
movl -47(%eax), %ecx
movl -47(%edx), %ebx
@@ -1953,11 +2114,11 @@ L(3bytes):
cmpb -1(%edx), %al
mov $0, %eax
jne L(end)
- POP (%ebx)
+ POP (%ebx)
ret
CFI_PUSH (%ebx)
- ALIGN (4)
+ .p2align 4
L(find_diff):
cmpb %bl, %cl
jne L(end)
@@ -1968,14 +2129,30 @@ L(find_diff):
cmp %bl, %cl
jne L(end)
cmp %bx, %cx
+
+ .p2align 4
L(end):
- POP (%ebx)
+ POP (%ebx)
mov $1, %eax
ja L(bigger)
neg %eax
L(bigger):
ret
+# else
-END (MEMCMP)
+/* for wmemcmp */
+ .p2align 4
+L(find_diff):
+ POP (%ebx)
+ mov $1, %eax
+ jg L(find_diff_bigger)
+ neg %eax
+ ret
+ .p2align 4
+L(find_diff_bigger):
+ ret
+
+# endif
+END (MEMCMP)
#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
index f64f8d214..26471fc0e 100644
--- a/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
+++ b/libc/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
@@ -1,5 +1,5 @@
/* memcpy with SSSE3
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -235,7 +235,7 @@ L(shl_0_end):
add %edi, %edx
add %edi, %eax
POP (%edi)
- BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd), %ecx, 4)
+ BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd_align), %ecx, 4)
CFI_PUSH (%edi)
L(shl_0_gobble):
@@ -385,7 +385,7 @@ L(shl_0_mem_less_32bytes):
L(shl_0_mem_less_16bytes):
add %ecx, %edx
add %ecx, %eax
- BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd), %ecx, 4)
+ BRANCH_TO_JMPTBL_ENTRY (L(table_48bytes_fwd_align), %ecx, 4)
cfi_restore_state
cfi_remember_state
@@ -1065,38 +1065,48 @@ L(shl_15_end):
ALIGN (4)
L(fwd_write_44bytes):
- movl -44(%eax), %ecx
- movl %ecx, -44(%edx)
-L(fwd_write_40bytes):
- movl -40(%eax), %ecx
- movl %ecx, -40(%edx)
+ movq -44(%eax), %xmm0
+ movq %xmm0, -44(%edx)
L(fwd_write_36bytes):
- movl -36(%eax), %ecx
- movl %ecx, -36(%edx)
-L(fwd_write_32bytes):
- movl -32(%eax), %ecx
- movl %ecx, -32(%edx)
+ movq -36(%eax), %xmm0
+ movq %xmm0, -36(%edx)
L(fwd_write_28bytes):
- movl -28(%eax), %ecx
- movl %ecx, -28(%edx)
-L(fwd_write_24bytes):
- movl -24(%eax), %ecx
- movl %ecx, -24(%edx)
+ movq -28(%eax), %xmm0
+ movq %xmm0, -28(%edx)
L(fwd_write_20bytes):
- movl -20(%eax), %ecx
- movl %ecx, -20(%edx)
-L(fwd_write_16bytes):
- movl -16(%eax), %ecx
- movl %ecx, -16(%edx)
+ movq -20(%eax), %xmm0
+ movq %xmm0, -20(%edx)
L(fwd_write_12bytes):
- movl -12(%eax), %ecx
- movl %ecx, -12(%edx)
-L(fwd_write_8bytes):
- movl -8(%eax), %ecx
- movl %ecx, -8(%edx)
+ movq -12(%eax), %xmm0
+ movq %xmm0, -12(%edx)
L(fwd_write_4bytes):
movl -4(%eax), %ecx
movl %ecx, -4(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_40bytes):
+ movq -40(%eax), %xmm0
+ movq %xmm0, -40(%edx)
+L(fwd_write_32bytes):
+ movq -32(%eax), %xmm0
+ movq %xmm0, -32(%edx)
+L(fwd_write_24bytes):
+ movq -24(%eax), %xmm0
+ movq %xmm0, -24(%edx)
+L(fwd_write_16bytes):
+ movq -16(%eax), %xmm0
+ movq %xmm0, -16(%edx)
+L(fwd_write_8bytes):
+ movq -8(%eax), %xmm0
+ movq %xmm0, -8(%edx)
L(fwd_write_0bytes):
#ifndef USE_AS_BCOPY
# ifdef USE_AS_MEMPCPY
@@ -1124,37 +1134,49 @@ L(fwd_write_5bytes):
ALIGN (4)
L(fwd_write_45bytes):
- movl -45(%eax), %ecx
- movl %ecx, -45(%edx)
-L(fwd_write_41bytes):
- movl -41(%eax), %ecx
- movl %ecx, -41(%edx)
+ movq -45(%eax), %xmm0
+ movq %xmm0, -45(%edx)
L(fwd_write_37bytes):
- movl -37(%eax), %ecx
- movl %ecx, -37(%edx)
-L(fwd_write_33bytes):
- movl -33(%eax), %ecx
- movl %ecx, -33(%edx)
+ movq -37(%eax), %xmm0
+ movq %xmm0, -37(%edx)
L(fwd_write_29bytes):
- movl -29(%eax), %ecx
- movl %ecx, -29(%edx)
-L(fwd_write_25bytes):
- movl -25(%eax), %ecx
- movl %ecx, -25(%edx)
+ movq -29(%eax), %xmm0
+ movq %xmm0, -29(%edx)
L(fwd_write_21bytes):
- movl -21(%eax), %ecx
- movl %ecx, -21(%edx)
-L(fwd_write_17bytes):
- movl -17(%eax), %ecx
- movl %ecx, -17(%edx)
+ movq -21(%eax), %xmm0
+ movq %xmm0, -21(%edx)
L(fwd_write_13bytes):
- movl -13(%eax), %ecx
- movl %ecx, -13(%edx)
-L(fwd_write_9bytes):
- movl -9(%eax), %ecx
- movl %ecx, -9(%edx)
+ movq -13(%eax), %xmm0
+ movq %xmm0, -13(%edx)
movl -5(%eax), %ecx
movl %ecx, -5(%edx)
+ movzbl -1(%eax), %ecx
+ movb %cl, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_41bytes):
+ movq -41(%eax), %xmm0
+ movq %xmm0, -41(%edx)
+L(fwd_write_33bytes):
+ movq -33(%eax), %xmm0
+ movq %xmm0, -33(%edx)
+L(fwd_write_25bytes):
+ movq -25(%eax), %xmm0
+ movq %xmm0, -25(%edx)
+L(fwd_write_17bytes):
+ movq -17(%eax), %xmm0
+ movq %xmm0, -17(%edx)
+L(fwd_write_9bytes):
+ movq -9(%eax), %xmm0
+ movq %xmm0, -9(%edx)
L(fwd_write_1bytes):
movzbl -1(%eax), %ecx
movb %cl, -1(%edx)
@@ -1169,38 +1191,50 @@ L(fwd_write_1bytes):
ALIGN (4)
L(fwd_write_46bytes):
- movl -46(%eax), %ecx
- movl %ecx, -46(%edx)
-L(fwd_write_42bytes):
- movl -42(%eax), %ecx
- movl %ecx, -42(%edx)
+ movq -46(%eax), %xmm0
+ movq %xmm0, -46(%edx)
L(fwd_write_38bytes):
- movl -38(%eax), %ecx
- movl %ecx, -38(%edx)
-L(fwd_write_34bytes):
- movl -34(%eax), %ecx
- movl %ecx, -34(%edx)
+ movq -38(%eax), %xmm0
+ movq %xmm0, -38(%edx)
L(fwd_write_30bytes):
- movl -30(%eax), %ecx
- movl %ecx, -30(%edx)
-L(fwd_write_26bytes):
- movl -26(%eax), %ecx
- movl %ecx, -26(%edx)
+ movq -30(%eax), %xmm0
+ movq %xmm0, -30(%edx)
L(fwd_write_22bytes):
- movl -22(%eax), %ecx
- movl %ecx, -22(%edx)
-L(fwd_write_18bytes):
- movl -18(%eax), %ecx
- movl %ecx, -18(%edx)
+ movq -22(%eax), %xmm0
+ movq %xmm0, -22(%edx)
L(fwd_write_14bytes):
- movl -14(%eax), %ecx
- movl %ecx, -14(%edx)
-L(fwd_write_10bytes):
- movl -10(%eax), %ecx
- movl %ecx, -10(%edx)
+ movq -14(%eax), %xmm0
+ movq %xmm0, -14(%edx)
L(fwd_write_6bytes):
movl -6(%eax), %ecx
movl %ecx, -6(%edx)
+ movzwl -2(%eax), %ecx
+ movw %cx, -2(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_42bytes):
+ movq -42(%eax), %xmm0
+ movq %xmm0, -42(%edx)
+L(fwd_write_34bytes):
+ movq -34(%eax), %xmm0
+ movq %xmm0, -34(%edx)
+L(fwd_write_26bytes):
+ movq -26(%eax), %xmm0
+ movq %xmm0, -26(%edx)
+L(fwd_write_18bytes):
+ movq -18(%eax), %xmm0
+ movq %xmm0, -18(%edx)
+L(fwd_write_10bytes):
+ movq -10(%eax), %xmm0
+ movq %xmm0, -10(%edx)
L(fwd_write_2bytes):
movzwl -2(%eax), %ecx
movw %cx, -2(%edx)
@@ -1215,38 +1249,52 @@ L(fwd_write_2bytes):
ALIGN (4)
L(fwd_write_47bytes):
- movl -47(%eax), %ecx
- movl %ecx, -47(%edx)
-L(fwd_write_43bytes):
- movl -43(%eax), %ecx
- movl %ecx, -43(%edx)
+ movq -47(%eax), %xmm0
+ movq %xmm0, -47(%edx)
L(fwd_write_39bytes):
- movl -39(%eax), %ecx
- movl %ecx, -39(%edx)
-L(fwd_write_35bytes):
- movl -35(%eax), %ecx
- movl %ecx, -35(%edx)
+ movq -39(%eax), %xmm0
+ movq %xmm0, -39(%edx)
L(fwd_write_31bytes):
- movl -31(%eax), %ecx
- movl %ecx, -31(%edx)
-L(fwd_write_27bytes):
- movl -27(%eax), %ecx
- movl %ecx, -27(%edx)
+ movq -31(%eax), %xmm0
+ movq %xmm0, -31(%edx)
L(fwd_write_23bytes):
- movl -23(%eax), %ecx
- movl %ecx, -23(%edx)
-L(fwd_write_19bytes):
- movl -19(%eax), %ecx
- movl %ecx, -19(%edx)
+ movq -23(%eax), %xmm0
+ movq %xmm0, -23(%edx)
L(fwd_write_15bytes):
- movl -15(%eax), %ecx
- movl %ecx, -15(%edx)
-L(fwd_write_11bytes):
- movl -11(%eax), %ecx
- movl %ecx, -11(%edx)
+ movq -15(%eax), %xmm0
+ movq %xmm0, -15(%edx)
L(fwd_write_7bytes):
movl -7(%eax), %ecx
movl %ecx, -7(%edx)
+ movzwl -3(%eax), %ecx
+ movzbl -1(%eax), %eax
+ movw %cx, -3(%edx)
+ movb %al, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_43bytes):
+ movq -43(%eax), %xmm0
+ movq %xmm0, -43(%edx)
+L(fwd_write_35bytes):
+ movq -35(%eax), %xmm0
+ movq %xmm0, -35(%edx)
+L(fwd_write_27bytes):
+ movq -27(%eax), %xmm0
+ movq %xmm0, -27(%edx)
+L(fwd_write_19bytes):
+ movq -19(%eax), %xmm0
+ movq %xmm0, -19(%edx)
+L(fwd_write_11bytes):
+ movq -11(%eax), %xmm0
+ movq %xmm0, -11(%edx)
L(fwd_write_3bytes):
movzwl -3(%eax), %ecx
movzbl -1(%eax), %eax
@@ -1259,6 +1307,356 @@ L(fwd_write_3bytes):
movl DEST(%esp), %eax
# endif
#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_40bytes_align):
+ movdqa -40(%eax), %xmm0
+ movdqa %xmm0, -40(%edx)
+L(fwd_write_24bytes_align):
+ movdqa -24(%eax), %xmm0
+ movdqa %xmm0, -24(%edx)
+L(fwd_write_8bytes_align):
+ movq -8(%eax), %xmm0
+ movq %xmm0, -8(%edx)
+L(fwd_write_0bytes_align):
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_32bytes_align):
+ movdqa -32(%eax), %xmm0
+ movdqa %xmm0, -32(%edx)
+L(fwd_write_16bytes_align):
+ movdqa -16(%eax), %xmm0
+ movdqa %xmm0, -16(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_5bytes_align):
+ movl -5(%eax), %ecx
+ movl -4(%eax), %eax
+ movl %ecx, -5(%edx)
+ movl %eax, -4(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_45bytes_align):
+ movdqa -45(%eax), %xmm0
+ movdqa %xmm0, -45(%edx)
+L(fwd_write_29bytes_align):
+ movdqa -29(%eax), %xmm0
+ movdqa %xmm0, -29(%edx)
+L(fwd_write_13bytes_align):
+ movq -13(%eax), %xmm0
+ movq %xmm0, -13(%edx)
+ movl -5(%eax), %ecx
+ movl %ecx, -5(%edx)
+ movzbl -1(%eax), %ecx
+ movb %cl, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_37bytes_align):
+ movdqa -37(%eax), %xmm0
+ movdqa %xmm0, -37(%edx)
+L(fwd_write_21bytes_align):
+ movdqa -21(%eax), %xmm0
+ movdqa %xmm0, -21(%edx)
+ movl -5(%eax), %ecx
+ movl %ecx, -5(%edx)
+ movzbl -1(%eax), %ecx
+ movb %cl, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_41bytes_align):
+ movdqa -41(%eax), %xmm0
+ movdqa %xmm0, -41(%edx)
+L(fwd_write_25bytes_align):
+ movdqa -25(%eax), %xmm0
+ movdqa %xmm0, -25(%edx)
+L(fwd_write_9bytes_align):
+ movq -9(%eax), %xmm0
+ movq %xmm0, -9(%edx)
+L(fwd_write_1bytes_align):
+ movzbl -1(%eax), %ecx
+ movb %cl, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_33bytes_align):
+ movdqa -33(%eax), %xmm0
+ movdqa %xmm0, -33(%edx)
+L(fwd_write_17bytes_align):
+ movdqa -17(%eax), %xmm0
+ movdqa %xmm0, -17(%edx)
+ movzbl -1(%eax), %ecx
+ movb %cl, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_46bytes_align):
+ movdqa -46(%eax), %xmm0
+ movdqa %xmm0, -46(%edx)
+L(fwd_write_30bytes_align):
+ movdqa -30(%eax), %xmm0
+ movdqa %xmm0, -30(%edx)
+L(fwd_write_14bytes_align):
+ movq -14(%eax), %xmm0
+ movq %xmm0, -14(%edx)
+L(fwd_write_6bytes_align):
+ movl -6(%eax), %ecx
+ movl %ecx, -6(%edx)
+ movzwl -2(%eax), %ecx
+ movw %cx, -2(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_38bytes_align):
+ movdqa -38(%eax), %xmm0
+ movdqa %xmm0, -38(%edx)
+L(fwd_write_22bytes_align):
+ movdqa -22(%eax), %xmm0
+ movdqa %xmm0, -22(%edx)
+ movl -6(%eax), %ecx
+ movl %ecx, -6(%edx)
+ movzwl -2(%eax), %ecx
+ movw %cx, -2(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_42bytes_align):
+ movdqa -42(%eax), %xmm0
+ movdqa %xmm0, -42(%edx)
+L(fwd_write_26bytes_align):
+ movdqa -26(%eax), %xmm0
+ movdqa %xmm0, -26(%edx)
+L(fwd_write_10bytes_align):
+ movq -10(%eax), %xmm0
+ movq %xmm0, -10(%edx)
+L(fwd_write_2bytes_align):
+ movzwl -2(%eax), %ecx
+ movw %cx, -2(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_34bytes_align):
+ movdqa -34(%eax), %xmm0
+ movdqa %xmm0, -34(%edx)
+L(fwd_write_18bytes_align):
+ movdqa -18(%eax), %xmm0
+ movdqa %xmm0, -18(%edx)
+ movzwl -2(%eax), %ecx
+ movw %cx, -2(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_47bytes_align):
+ movdqa -47(%eax), %xmm0
+ movdqa %xmm0, -47(%edx)
+L(fwd_write_31bytes_align):
+ movdqa -31(%eax), %xmm0
+ movdqa %xmm0, -31(%edx)
+L(fwd_write_15bytes_align):
+ movq -15(%eax), %xmm0
+ movq %xmm0, -15(%edx)
+L(fwd_write_7bytes_align):
+ movl -7(%eax), %ecx
+ movl %ecx, -7(%edx)
+ movzwl -3(%eax), %ecx
+ movzbl -1(%eax), %eax
+ movw %cx, -3(%edx)
+ movb %al, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_39bytes_align):
+ movdqa -39(%eax), %xmm0
+ movdqa %xmm0, -39(%edx)
+L(fwd_write_23bytes_align):
+ movdqa -23(%eax), %xmm0
+ movdqa %xmm0, -23(%edx)
+ movl -7(%eax), %ecx
+ movl %ecx, -7(%edx)
+ movzwl -3(%eax), %ecx
+ movzbl -1(%eax), %eax
+ movw %cx, -3(%edx)
+ movb %al, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_43bytes_align):
+ movdqa -43(%eax), %xmm0
+ movdqa %xmm0, -43(%edx)
+L(fwd_write_27bytes_align):
+ movdqa -27(%eax), %xmm0
+ movdqa %xmm0, -27(%edx)
+L(fwd_write_11bytes_align):
+ movq -11(%eax), %xmm0
+ movq %xmm0, -11(%edx)
+L(fwd_write_3bytes_align):
+ movzwl -3(%eax), %ecx
+ movzbl -1(%eax), %eax
+ movw %cx, -3(%edx)
+ movb %al, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_35bytes_align):
+ movdqa -35(%eax), %xmm0
+ movdqa %xmm0, -35(%edx)
+L(fwd_write_19bytes_align):
+ movdqa -19(%eax), %xmm0
+ movdqa %xmm0, -19(%edx)
+ movzwl -3(%eax), %ecx
+ movzbl -1(%eax), %eax
+ movw %cx, -3(%edx)
+ movb %al, -1(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_44bytes_align):
+ movdqa -44(%eax), %xmm0
+ movdqa %xmm0, -44(%edx)
+L(fwd_write_28bytes_align):
+ movdqa -28(%eax), %xmm0
+ movdqa %xmm0, -28(%edx)
+L(fwd_write_12bytes_align):
+ movq -12(%eax), %xmm0
+ movq %xmm0, -12(%edx)
+L(fwd_write_4bytes_align):
+ movl -4(%eax), %ecx
+ movl %ecx, -4(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(fwd_write_36bytes_align):
+ movdqa -36(%eax), %xmm0
+ movdqa %xmm0, -36(%edx)
+L(fwd_write_20bytes_align):
+ movdqa -20(%eax), %xmm0
+ movdqa %xmm0, -20(%edx)
+ movl -4(%eax), %ecx
+ movl %ecx, -4(%edx)
+#ifndef USE_AS_BCOPY
+# ifdef USE_AS_MEMPCPY
+ movl %edx, %eax
+# else
+ movl DEST(%esp), %eax
+# endif
+#endif
RETURN_END
cfi_restore_state
@@ -1330,35 +1728,20 @@ L(large_page_less_32bytes):
ALIGN (4)
L(bk_write_44bytes):
- movl 40(%eax), %ecx
- movl %ecx, 40(%edx)
-L(bk_write_40bytes):
- movl 36(%eax), %ecx
- movl %ecx, 36(%edx)
+ movq 36(%eax), %xmm0
+ movq %xmm0, 36(%edx)
L(bk_write_36bytes):
- movl 32(%eax), %ecx
- movl %ecx, 32(%edx)
-L(bk_write_32bytes):
- movl 28(%eax), %ecx
- movl %ecx, 28(%edx)
+ movq 28(%eax), %xmm0
+ movq %xmm0, 28(%edx)
L(bk_write_28bytes):
- movl 24(%eax), %ecx
- movl %ecx, 24(%edx)
-L(bk_write_24bytes):
- movl 20(%eax), %ecx
- movl %ecx, 20(%edx)
+ movq 20(%eax), %xmm0
+ movq %xmm0, 20(%edx)
L(bk_write_20bytes):
- movl 16(%eax), %ecx
- movl %ecx, 16(%edx)
-L(bk_write_16bytes):
- movl 12(%eax), %ecx
- movl %ecx, 12(%edx)
+ movq 12(%eax), %xmm0
+ movq %xmm0, 12(%edx)
L(bk_write_12bytes):
- movl 8(%eax), %ecx
- movl %ecx, 8(%edx)
-L(bk_write_8bytes):
- movl 4(%eax), %ecx
- movl %ecx, 4(%edx)
+ movq 4(%eax), %xmm0
+ movq %xmm0, 4(%edx)
L(bk_write_4bytes):
movl (%eax), %ecx
movl %ecx, (%edx)
@@ -1373,36 +1756,46 @@ L(bk_write_0bytes):
RETURN
ALIGN (4)
+L(bk_write_40bytes):
+ movq 32(%eax), %xmm0
+ movq %xmm0, 32(%edx)
+L(bk_write_32bytes):
+ movq 24(%eax), %xmm0
+ movq %xmm0, 24(%edx)
+L(bk_write_24bytes):
+ movq 16(%eax), %xmm0
+ movq %xmm0, 16(%edx)
+L(bk_write_16bytes):
+ movq 8(%eax), %xmm0
+ movq %xmm0, 8(%edx)
+L(bk_write_8bytes):
+ movq (%eax), %xmm0
+ movq %xmm0, (%edx)
+#ifndef USE_AS_BCOPY
+ movl DEST(%esp), %eax
+# ifdef USE_AS_MEMPCPY
+ movl LEN(%esp), %ecx
+ add %ecx, %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
L(bk_write_45bytes):
- movl 41(%eax), %ecx
- movl %ecx, 41(%edx)
-L(bk_write_41bytes):
- movl 37(%eax), %ecx
- movl %ecx, 37(%edx)
+ movq 37(%eax), %xmm0
+ movq %xmm0, 37(%edx)
L(bk_write_37bytes):
- movl 33(%eax), %ecx
- movl %ecx, 33(%edx)
-L(bk_write_33bytes):
- movl 29(%eax), %ecx
- movl %ecx, 29(%edx)
+ movq 29(%eax), %xmm0
+ movq %xmm0, 29(%edx)
L(bk_write_29bytes):
- movl 25(%eax), %ecx
- movl %ecx, 25(%edx)
-L(bk_write_25bytes):
- movl 21(%eax), %ecx
- movl %ecx, 21(%edx)
+ movq 21(%eax), %xmm0
+ movq %xmm0, 21(%edx)
L(bk_write_21bytes):
- movl 17(%eax), %ecx
- movl %ecx, 17(%edx)
-L(bk_write_17bytes):
- movl 13(%eax), %ecx
- movl %ecx, 13(%edx)
+ movq 13(%eax), %xmm0
+ movq %xmm0, 13(%edx)
L(bk_write_13bytes):
- movl 9(%eax), %ecx
- movl %ecx, 9(%edx)
-L(bk_write_9bytes):
- movl 5(%eax), %ecx
- movl %ecx, 5(%edx)
+ movq 5(%eax), %xmm0
+ movq %xmm0, 5(%edx)
L(bk_write_5bytes):
movl 1(%eax), %ecx
movl %ecx, 1(%edx)
@@ -1419,39 +1812,78 @@ L(bk_write_1bytes):
RETURN
ALIGN (4)
+L(bk_write_41bytes):
+ movq 33(%eax), %xmm0
+ movq %xmm0, 33(%edx)
+L(bk_write_33bytes):
+ movq 25(%eax), %xmm0
+ movq %xmm0, 25(%edx)
+L(bk_write_25bytes):
+ movq 17(%eax), %xmm0
+ movq %xmm0, 17(%edx)
+L(bk_write_17bytes):
+ movq 9(%eax), %xmm0
+ movq %xmm0, 9(%edx)
+L(bk_write_9bytes):
+ movq 1(%eax), %xmm0
+ movq %xmm0, 1(%edx)
+ movzbl (%eax), %ecx
+ movb %cl, (%edx)
+#ifndef USE_AS_BCOPY
+ movl DEST(%esp), %eax
+# ifdef USE_AS_MEMPCPY
+ movl LEN(%esp), %ecx
+ add %ecx, %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
L(bk_write_46bytes):
- movl 42(%eax), %ecx
- movl %ecx, 42(%edx)
-L(bk_write_42bytes):
- movl 38(%eax), %ecx
- movl %ecx, 38(%edx)
+ movq 38(%eax), %xmm0
+ movq %xmm0, 38(%edx)
L(bk_write_38bytes):
- movl 34(%eax), %ecx
- movl %ecx, 34(%edx)
-L(bk_write_34bytes):
- movl 30(%eax), %ecx
- movl %ecx, 30(%edx)
+ movq 30(%eax), %xmm0
+ movq %xmm0, 30(%edx)
L(bk_write_30bytes):
- movl 26(%eax), %ecx
- movl %ecx, 26(%edx)
-L(bk_write_26bytes):
- movl 22(%eax), %ecx
- movl %ecx, 22(%edx)
+ movq 22(%eax), %xmm0
+ movq %xmm0, 22(%edx)
L(bk_write_22bytes):
- movl 18(%eax), %ecx
- movl %ecx, 18(%edx)
-L(bk_write_18bytes):
- movl 14(%eax), %ecx
- movl %ecx, 14(%edx)
+ movq 14(%eax), %xmm0
+ movq %xmm0, 14(%edx)
L(bk_write_14bytes):
- movl 10(%eax), %ecx
- movl %ecx, 10(%edx)
-L(bk_write_10bytes):
- movl 6(%eax), %ecx
- movl %ecx, 6(%edx)
+ movq 6(%eax), %xmm0
+ movq %xmm0, 6(%edx)
L(bk_write_6bytes):
movl 2(%eax), %ecx
movl %ecx, 2(%edx)
+ movzwl (%eax), %ecx
+ movw %cx, (%edx)
+#ifndef USE_AS_BCOPY
+ movl DEST(%esp), %eax
+# ifdef USE_AS_MEMPCPY
+ movl LEN(%esp), %ecx
+ add %ecx, %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(bk_write_42bytes):
+ movq 34(%eax), %xmm0
+ movq %xmm0, 34(%edx)
+L(bk_write_34bytes):
+ movq 26(%eax), %xmm0
+ movq %xmm0, 26(%edx)
+L(bk_write_26bytes):
+ movq 18(%eax), %xmm0
+ movq %xmm0, 18(%edx)
+L(bk_write_18bytes):
+ movq 10(%eax), %xmm0
+ movq %xmm0, 10(%edx)
+L(bk_write_10bytes):
+ movq 2(%eax), %xmm0
+ movq %xmm0, 2(%edx)
L(bk_write_2bytes):
movzwl (%eax), %ecx
movw %cx, (%edx)
@@ -1466,38 +1898,52 @@ L(bk_write_2bytes):
ALIGN (4)
L(bk_write_47bytes):
- movl 43(%eax), %ecx
- movl %ecx, 43(%edx)
-L(bk_write_43bytes):
- movl 39(%eax), %ecx
- movl %ecx, 39(%edx)
+ movq 39(%eax), %xmm0
+ movq %xmm0, 39(%edx)
L(bk_write_39bytes):
- movl 35(%eax), %ecx
- movl %ecx, 35(%edx)
-L(bk_write_35bytes):
- movl 31(%eax), %ecx
- movl %ecx, 31(%edx)
+ movq 31(%eax), %xmm0
+ movq %xmm0, 31(%edx)
L(bk_write_31bytes):
- movl 27(%eax), %ecx
- movl %ecx, 27(%edx)
-L(bk_write_27bytes):
- movl 23(%eax), %ecx
- movl %ecx, 23(%edx)
+ movq 23(%eax), %xmm0
+ movq %xmm0, 23(%edx)
L(bk_write_23bytes):
- movl 19(%eax), %ecx
- movl %ecx, 19(%edx)
-L(bk_write_19bytes):
- movl 15(%eax), %ecx
- movl %ecx, 15(%edx)
+ movq 15(%eax), %xmm0
+ movq %xmm0, 15(%edx)
L(bk_write_15bytes):
- movl 11(%eax), %ecx
- movl %ecx, 11(%edx)
-L(bk_write_11bytes):
- movl 7(%eax), %ecx
- movl %ecx, 7(%edx)
+ movq 7(%eax), %xmm0
+ movq %xmm0, 7(%edx)
L(bk_write_7bytes):
movl 3(%eax), %ecx
movl %ecx, 3(%edx)
+ movzwl 1(%eax), %ecx
+ movw %cx, 1(%edx)
+ movzbl (%eax), %eax
+ movb %al, (%edx)
+#ifndef USE_AS_BCOPY
+ movl DEST(%esp), %eax
+# ifdef USE_AS_MEMPCPY
+ movl LEN(%esp), %ecx
+ add %ecx, %eax
+# endif
+#endif
+ RETURN
+
+ ALIGN (4)
+L(bk_write_43bytes):
+ movq 35(%eax), %xmm0
+ movq %xmm0, 35(%edx)
+L(bk_write_35bytes):
+ movq 27(%eax), %xmm0
+ movq %xmm0, 27(%edx)
+L(bk_write_27bytes):
+ movq 19(%eax), %xmm0
+ movq %xmm0, 19(%edx)
+L(bk_write_19bytes):
+ movq 11(%eax), %xmm0
+ movq %xmm0, 11(%edx)
+L(bk_write_11bytes):
+ movq 3(%eax), %xmm0
+ movq %xmm0, 3(%edx)
L(bk_write_3bytes):
movzwl 1(%eax), %ecx
movw %cx, 1(%edx)
@@ -1566,6 +2012,57 @@ L(table_48bytes_fwd):
.int JMPTBL (L(fwd_write_47bytes), L(table_48bytes_fwd))
ALIGN (2)
+L(table_48bytes_fwd_align):
+ .int JMPTBL (L(fwd_write_0bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_1bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_2bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_3bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_4bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_5bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_6bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_7bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_8bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_9bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_10bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_11bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_12bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_13bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_14bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_15bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_16bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_17bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_18bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_19bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_20bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_21bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_22bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_23bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_24bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_25bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_26bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_27bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_28bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_29bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_30bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_31bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_32bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_33bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_34bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_35bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_36bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_37bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_38bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_39bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_40bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_41bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_42bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_43bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_44bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_45bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_46bytes_align), L(table_48bytes_fwd_align))
+ .int JMPTBL (L(fwd_write_47bytes_align), L(table_48bytes_fwd_align))
+
+ ALIGN (2)
L(shl_table):
.int JMPTBL (L(shl_0), L(shl_table))
.int JMPTBL (L(shl_1), L(shl_table))
@@ -1658,22 +2155,14 @@ L(bk_write_64bytesless):
L(bk_write_more32bytes):
/* Copy 32 bytes at a time. */
sub $32, %ecx
- movl -4(%esi), %eax
- movl %eax, -4(%edx)
- movl -8(%esi), %eax
- movl %eax, -8(%edx)
- movl -12(%esi), %eax
- movl %eax, -12(%edx)
- movl -16(%esi), %eax
- movl %eax, -16(%edx)
- movl -20(%esi), %eax
- movl %eax, -20(%edx)
- movl -24(%esi), %eax
- movl %eax, -24(%edx)
- movl -28(%esi), %eax
- movl %eax, -28(%edx)
- movl -32(%esi), %eax
- movl %eax, -32(%edx)
+ movq -8(%esi), %xmm0
+ movq %xmm0, -8(%edx)
+ movq -16(%esi), %xmm0
+ movq %xmm0, -16(%edx)
+ movq -24(%esi), %xmm0
+ movq %xmm0, -24(%edx)
+ movq -32(%esi), %xmm0
+ movq %xmm0, -32(%edx)
sub $32, %edx
sub $32, %esi
diff --git a/libc/sysdeps/i386/i686/multiarch/memrchr-c.c b/libc/sysdeps/i386/i686/multiarch/memrchr-c.c
new file mode 100644
index 000000000..44ec1a6ed
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/memrchr-c.c
@@ -0,0 +1,7 @@
+#ifndef NOT_IN_libc
+# define MEMRCHR __memrchr_ia32
+# include <string.h>
+extern void *__memrchr_ia32 (const void *, int, size_t);
+#endif
+
+#include "string/memrchr.c"
diff --git a/libc/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S b/libc/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
new file mode 100644
index 000000000..355d498e2
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S
@@ -0,0 +1,418 @@
+/* Optimized memrchr with sse2
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# define PARMS 4
+# define STR1 PARMS
+# define STR2 STR1+4
+# define LEN STR2+4
+
+# define MEMCHR __memrchr_sse2_bsf
+
+ .text
+ENTRY (MEMCHR)
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+ mov LEN(%esp), %edx
+
+ sub $16, %edx
+ jbe L(length_less16)
+
+ punpcklbw %xmm1, %xmm1
+ add %edx, %ecx
+ punpcklbw %xmm1, %xmm1
+
+ movdqu (%ecx), %xmm0
+ pshufd $0, %xmm1, %xmm1
+ pcmpeqb %xmm1, %xmm0
+
+/* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ sub $64, %ecx
+ mov %ecx, %eax
+ and $15, %eax
+ jz L(loop_prolog)
+
+ add $16, %ecx
+ add $16, %edx
+ sub %eax, %ecx
+ sub %eax, %edx
+
+ .p2align 4
+/* Loop start on aligned string. */
+L(loop_prolog):
+ sub $64, %edx
+ jbe L(exit_loop)
+
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%ecx), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa (%ecx), %xmm4
+ pcmpeqb %xmm1, %xmm4
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ sub $64, %ecx
+ sub $64, %edx
+ jbe L(exit_loop)
+
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%ecx), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa (%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ mov %ecx, %eax
+ and $63, %eax
+ test %eax, %eax
+ jz L(align64_loop)
+
+ add $64, %ecx
+ add $64, %edx
+ sub %eax, %ecx
+ sub %eax, %edx
+
+ .p2align 4
+L(align64_loop):
+ sub $64, %ecx
+ sub $64, %edx
+ jbe L(exit_loop)
+
+ movdqa (%ecx), %xmm0
+ movdqa 16(%ecx), %xmm2
+ movdqa 32(%ecx), %xmm3
+ movdqa 48(%ecx), %xmm4
+
+ pcmpeqb %xmm1, %xmm0
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm1, %xmm3
+ pcmpeqb %xmm1, %xmm4
+
+ pmaxub %xmm3, %xmm0
+ pmaxub %xmm4, %xmm2
+ pmaxub %xmm0, %xmm2
+ pmovmskb %xmm2, %eax
+
+ test %eax, %eax
+ jz L(align64_loop)
+
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm2
+
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb (%ecx), %xmm1
+
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ pmovmskb %xmm1, %eax
+ bsr %eax, %eax
+
+ add %ecx, %eax
+ ret
+
+ .p2align 4
+L(exit_loop):
+ add $64, %edx
+ cmp $32, %edx
+ jbe L(exit_loop_32)
+
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%ecx), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16_1)
+ cmp $48, %edx
+ jbe L(return_null)
+
+ pcmpeqb (%ecx), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches0_1)
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(exit_loop_32):
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48_1)
+ cmp $16, %edx
+ jbe L(return_null)
+
+ pcmpeqb 32(%ecx), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches32_1)
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(matches0):
+ bsr %eax, %eax
+ add %ecx, %eax
+ ret
+
+ .p2align 4
+L(matches16):
+ bsr %eax, %eax
+ lea 16(%eax, %ecx), %eax
+ ret
+
+ .p2align 4
+L(matches32):
+ bsr %eax, %eax
+ lea 32(%eax, %ecx), %eax
+ ret
+
+ .p2align 4
+L(matches48):
+ bsr %eax, %eax
+ lea 48(%eax, %ecx), %eax
+ ret
+
+ .p2align 4
+L(matches0_1):
+ bsr %eax, %eax
+ sub $64, %edx
+ add %eax, %edx
+ jl L(return_null)
+ add %ecx, %eax
+ ret
+
+ .p2align 4
+L(matches16_1):
+ bsr %eax, %eax
+ sub $48, %edx
+ add %eax, %edx
+ jl L(return_null)
+ lea 16(%ecx, %eax), %eax
+ ret
+
+ .p2align 4
+L(matches32_1):
+ bsr %eax, %eax
+ sub $32, %edx
+ add %eax, %edx
+ jl L(return_null)
+ lea 32(%ecx, %eax), %eax
+ ret
+
+ .p2align 4
+L(matches48_1):
+ bsr %eax, %eax
+ sub $16, %edx
+ add %eax, %edx
+ jl L(return_null)
+ lea 48(%ecx, %eax), %eax
+ ret
+
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(length_less16_offset0):
+ mov %dl, %cl
+ pcmpeqb (%eax), %xmm1
+
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+ mov %edx, %ecx
+
+ pmovmskb %xmm1, %edx
+
+ and %ecx, %edx
+ test %edx, %edx
+ jz L(return_null)
+
+ bsr %edx, %ecx
+ add %ecx, %eax
+ ret
+
+ .p2align 4
+L(length_less16):
+ punpcklbw %xmm1, %xmm1
+ mov %ecx, %eax
+ punpcklbw %xmm1, %xmm1
+ add $16, %edx
+ jz L(return_null)
+
+ pshufd $0, %xmm1, %xmm1
+ and $15, %ecx
+ jz L(length_less16_offset0)
+
+ PUSH (%edi)
+ mov %cl, %dh
+ add %dl, %dh
+ and $-16, %eax
+
+ sub $16, %dh
+ ja L(length_less16_part2)
+
+ pcmpeqb (%eax), %xmm1
+ pmovmskb %xmm1, %edi
+
+ sar %cl, %edi
+ add %ecx, %eax
+ mov %dl, %cl
+
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ and %edx, %edi
+ test %edi, %edi
+ jz L(ret_null)
+
+ bsr %edi, %edi
+ add %edi, %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(length_less16_part2):
+ movdqa 16(%eax), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %edi
+
+ mov %cl, %ch
+
+ mov %dh, %cl
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ and %edx, %edi
+
+ test %edi, %edi
+ jnz L(length_less16_part2_return)
+
+ pcmpeqb (%eax), %xmm1
+ pmovmskb %xmm1, %edi
+
+ mov %ch, %cl
+ sar %cl, %edi
+ test %edi, %edi
+ jz L(ret_null)
+
+ bsr %edi, %edi
+ add %edi, %eax
+ xor %ch, %ch
+ add %ecx, %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(length_less16_part2_return):
+ bsr %edi, %edi
+ lea 16(%eax, %edi), %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(ret_null):
+ xor %eax, %eax
+ POP (%edi)
+ ret
+
+END (MEMCHR)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/memrchr-sse2.S b/libc/sysdeps/i386/i686/multiarch/memrchr-sse2.S
new file mode 100644
index 000000000..86a0cf961
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/memrchr-sse2.S
@@ -0,0 +1,725 @@
+/* Optimized memrchr with sse2 without bsf
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+
+# define PARMS 4
+# define STR1 PARMS
+# define STR2 STR1+4
+# define LEN STR2+4
+
+ atom_text_section
+ENTRY (__memrchr_sse2)
+ mov STR1(%esp), %ecx
+ movd STR2(%esp), %xmm1
+ mov LEN(%esp), %edx
+
+ sub $16, %edx
+ jbe L(length_less16)
+
+ punpcklbw %xmm1, %xmm1
+ add %edx, %ecx
+ punpcklbw %xmm1, %xmm1
+
+ movdqu (%ecx), %xmm0
+ pshufd $0, %xmm1, %xmm1
+ pcmpeqb %xmm1, %xmm0
+
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(exit_dispatch)
+
+ sub $64, %ecx
+ mov %ecx, %eax
+ and $15, %eax
+ jz L(loop_prolog)
+
+ lea 16(%ecx), %ecx
+ lea 16(%edx), %edx
+ sub %eax, %edx
+ and $-16, %ecx
+
+ .p2align 4
+/* Loop start on aligned string. */
+L(loop_prolog):
+ sub $64, %edx
+ jbe L(exit_loop)
+
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%ecx), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa (%ecx), %xmm4
+ pcmpeqb %xmm1, %xmm4
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(exit_dispatch)
+
+ sub $64, %ecx
+ sub $64, %edx
+ jbe L(exit_loop)
+
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%ecx), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa (%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(exit_dispatch)
+
+ mov %ecx, %eax
+ and $63, %eax
+ test %eax, %eax
+ jz L(align64_loop)
+
+ lea 64(%ecx), %ecx
+ lea 64(%edx), %edx
+ and $-64, %ecx
+ sub %eax, %edx
+
+ .p2align 4
+L(align64_loop):
+ sub $64, %ecx
+ sub $64, %edx
+ jbe L(exit_loop)
+
+ movdqa (%ecx), %xmm0
+ movdqa 16(%ecx), %xmm2
+ movdqa 32(%ecx), %xmm3
+ movdqa 48(%ecx), %xmm4
+
+ pcmpeqb %xmm1, %xmm0
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm1, %xmm3
+ pcmpeqb %xmm1, %xmm4
+
+ pmaxub %xmm3, %xmm0
+ pmaxub %xmm4, %xmm2
+ pmaxub %xmm0, %xmm2
+ pmovmskb %xmm2, %eax
+
+ test %eax, %eax
+ jz L(align64_loop)
+
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm2
+
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb (%ecx), %xmm1
+
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ pmovmskb %xmm1, %eax
+ test %ah, %ah
+ jnz L(exit_dispatch_high)
+ mov %al, %dl
+ and $15 << 4, %dl
+ jnz L(exit_dispatch_8)
+ test $0x08, %al
+ jnz L(exit_4)
+ test $0x04, %al
+ jnz L(exit_3)
+ test $0x02, %al
+ jnz L(exit_2)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(exit_loop):
+ add $64, %edx
+ cmp $32, %edx
+ jbe L(exit_loop_32)
+
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%ecx), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%ecx), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16_1)
+ cmp $48, %edx
+ jbe L(return_null)
+
+ pcmpeqb (%ecx), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches0_1)
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(exit_loop_32):
+ movdqa 48(%ecx), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48_1)
+ cmp $16, %edx
+ jbe L(return_null)
+
+ pcmpeqb 32(%ecx), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches32_1)
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(matches16):
+ lea 16(%ecx), %ecx
+ test %ah, %ah
+ jnz L(exit_dispatch_high)
+ mov %al, %dl
+ and $15 << 4, %dl
+ jnz L(exit_dispatch_8)
+ test $0x08, %al
+ jnz L(exit_4)
+ test $0x04, %al
+ jnz L(exit_3)
+ test $0x02, %al
+ jnz L(exit_2)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(matches32):
+ lea 32(%ecx), %ecx
+ test %ah, %ah
+ jnz L(exit_dispatch_high)
+ mov %al, %dl
+ and $15 << 4, %dl
+ jnz L(exit_dispatch_8)
+ test $0x08, %al
+ jnz L(exit_4)
+ test $0x04, %al
+ jnz L(exit_3)
+ test $0x02, %al
+ jnz L(exit_2)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(matches48):
+ lea 48(%ecx), %ecx
+
+ .p2align 4
+L(exit_dispatch):
+ test %ah, %ah
+ jnz L(exit_dispatch_high)
+ mov %al, %dl
+ and $15 << 4, %dl
+ jnz L(exit_dispatch_8)
+ test $0x08, %al
+ jnz L(exit_4)
+ test $0x04, %al
+ jnz L(exit_3)
+ test $0x02, %al
+ jnz L(exit_2)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(exit_dispatch_8):
+ test $0x80, %al
+ jnz L(exit_8)
+ test $0x40, %al
+ jnz L(exit_7)
+ test $0x20, %al
+ jnz L(exit_6)
+ lea 4(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_dispatch_high):
+ mov %ah, %dh
+ and $15 << 4, %dh
+ jnz L(exit_dispatch_high_8)
+ test $0x08, %ah
+ jnz L(exit_12)
+ test $0x04, %ah
+ jnz L(exit_11)
+ test $0x02, %ah
+ jnz L(exit_10)
+ lea 8(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_dispatch_high_8):
+ test $0x80, %ah
+ jnz L(exit_16)
+ test $0x40, %ah
+ jnz L(exit_15)
+ test $0x20, %ah
+ jnz L(exit_14)
+ lea 12(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_2):
+ lea 1(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_3):
+ lea 2(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_4):
+ lea 3(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_6):
+ lea 5(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_7):
+ lea 6(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_8):
+ lea 7(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_10):
+ lea 9(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_11):
+ lea 10(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_12):
+ lea 11(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_14):
+ lea 13(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_15):
+ lea 14(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_16):
+ lea 15(%ecx), %eax
+ ret
+
+ .p2align 4
+L(matches0_1):
+ lea -64(%edx), %edx
+
+ test %ah, %ah
+ jnz L(exit_dispatch_1_high)
+ mov %al, %ah
+ and $15 << 4, %ah
+ jnz L(exit_dispatch_1_8)
+ test $0x08, %al
+ jnz L(exit_1_4)
+ test $0x04, %al
+ jnz L(exit_1_3)
+ test $0x02, %al
+ jnz L(exit_1_2)
+ add $0, %edx
+ jl L(return_null)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(matches16_1):
+ lea -48(%edx), %edx
+ lea 16(%ecx), %ecx
+
+ test %ah, %ah
+ jnz L(exit_dispatch_1_high)
+ mov %al, %ah
+ and $15 << 4, %ah
+ jnz L(exit_dispatch_1_8)
+ test $0x08, %al
+ jnz L(exit_1_4)
+ test $0x04, %al
+ jnz L(exit_1_3)
+ test $0x02, %al
+ jnz L(exit_1_2)
+ add $0, %edx
+ jl L(return_null)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(matches32_1):
+ lea -32(%edx), %edx
+ lea 32(%ecx), %ecx
+
+ test %ah, %ah
+ jnz L(exit_dispatch_1_high)
+ mov %al, %ah
+ and $15 << 4, %ah
+ jnz L(exit_dispatch_1_8)
+ test $0x08, %al
+ jnz L(exit_1_4)
+ test $0x04, %al
+ jnz L(exit_1_3)
+ test $0x02, %al
+ jnz L(exit_1_2)
+ add $0, %edx
+ jl L(return_null)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(matches48_1):
+ lea -16(%edx), %edx
+ lea 48(%ecx), %ecx
+
+ .p2align 4
+L(exit_dispatch_1):
+ test %ah, %ah
+ jnz L(exit_dispatch_1_high)
+ mov %al, %ah
+ and $15 << 4, %ah
+ jnz L(exit_dispatch_1_8)
+ test $0x08, %al
+ jnz L(exit_1_4)
+ test $0x04, %al
+ jnz L(exit_1_3)
+ test $0x02, %al
+ jnz L(exit_1_2)
+ add $0, %edx
+ jl L(return_null)
+ mov %ecx, %eax
+ ret
+
+ .p2align 4
+L(exit_dispatch_1_8):
+ test $0x80, %al
+ jnz L(exit_1_8)
+ test $0x40, %al
+ jnz L(exit_1_7)
+ test $0x20, %al
+ jnz L(exit_1_6)
+ add $4, %edx
+ jl L(return_null)
+ lea 4(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_dispatch_1_high):
+ mov %ah, %al
+ and $15 << 4, %al
+ jnz L(exit_dispatch_1_high_8)
+ test $0x08, %ah
+ jnz L(exit_1_12)
+ test $0x04, %ah
+ jnz L(exit_1_11)
+ test $0x02, %ah
+ jnz L(exit_1_10)
+ add $8, %edx
+ jl L(return_null)
+ lea 8(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_dispatch_1_high_8):
+ test $0x80, %ah
+ jnz L(exit_1_16)
+ test $0x40, %ah
+ jnz L(exit_1_15)
+ test $0x20, %ah
+ jnz L(exit_1_14)
+ add $12, %edx
+ jl L(return_null)
+ lea 12(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_2):
+ add $1, %edx
+ jl L(return_null)
+ lea 1(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_3):
+ add $2, %edx
+ jl L(return_null)
+ lea 2(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_4):
+ add $3, %edx
+ jl L(return_null)
+ lea 3(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_6):
+ add $5, %edx
+ jl L(return_null)
+ lea 5(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_7):
+ add $6, %edx
+ jl L(return_null)
+ lea 6(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_8):
+ add $7, %edx
+ jl L(return_null)
+ lea 7(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_10):
+ add $9, %edx
+ jl L(return_null)
+ lea 9(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_11):
+ add $10, %edx
+ jl L(return_null)
+ lea 10(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_12):
+ add $11, %edx
+ jl L(return_null)
+ lea 11(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_14):
+ add $13, %edx
+ jl L(return_null)
+ lea 13(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_15):
+ add $14, %edx
+ jl L(return_null)
+ lea 14(%ecx), %eax
+ ret
+
+ .p2align 4
+L(exit_1_16):
+ add $15, %edx
+ jl L(return_null)
+ lea 15(%ecx), %eax
+ ret
+
+ .p2align 4
+L(return_null):
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(length_less16_offset0):
+ mov %dl, %cl
+ pcmpeqb (%eax), %xmm1
+
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ mov %eax, %ecx
+ pmovmskb %xmm1, %eax
+
+ and %edx, %eax
+ test %eax, %eax
+ jnz L(exit_dispatch)
+
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(length_less16):
+ punpcklbw %xmm1, %xmm1
+ add $16, %edx
+ je L(return_null)
+ punpcklbw %xmm1, %xmm1
+
+ mov %ecx, %eax
+ pshufd $0, %xmm1, %xmm1
+
+ and $15, %ecx
+ jz L(length_less16_offset0)
+
+ PUSH (%edi)
+
+ mov %cl, %dh
+ add %dl, %dh
+ and $-16, %eax
+
+ sub $16, %dh
+ ja L(length_less16_part2)
+
+ pcmpeqb (%eax), %xmm1
+ pmovmskb %xmm1, %edi
+
+ sar %cl, %edi
+ add %ecx, %eax
+ mov %dl, %cl
+
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ and %edx, %edi
+ test %edi, %edi
+ jz L(ret_null)
+
+ bsr %edi, %edi
+ add %edi, %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(length_less16_part2):
+ movdqa 16(%eax), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %edi
+
+ mov %cl, %ch
+
+ mov %dh, %cl
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ and %edx, %edi
+
+ test %edi, %edi
+ jnz L(length_less16_part2_return)
+
+ pcmpeqb (%eax), %xmm1
+ pmovmskb %xmm1, %edi
+
+ mov %ch, %cl
+ sar %cl, %edi
+ test %edi, %edi
+ jz L(ret_null)
+
+ bsr %edi, %edi
+ add %edi, %eax
+ xor %ch, %ch
+ add %ecx, %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(length_less16_part2_return):
+ bsr %edi, %edi
+ lea 16(%eax, %edi), %eax
+ POP (%edi)
+ ret
+
+ CFI_PUSH (%edi)
+
+ .p2align 4
+L(ret_null):
+ xor %eax, %eax
+ POP (%edi)
+ ret
+
+END (__memrchr_sse2)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/memrchr.S b/libc/sysdeps/i386/i686/multiarch/memrchr.S
new file mode 100644
index 000000000..8e5b2c50a
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/memrchr.S
@@ -0,0 +1,79 @@
+/* Multiple versions of memrchr
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+ .text
+ENTRY(__memrchr)
+ .type __memrchr, @gnu_indirect_function
+ pushl %ebx
+ CFI_PUSH (%ebx)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+
+1: testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+ jz 3f
+
+ leal __memrchr_sse2@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+
+ CFI_PUSH (%ebx)
+
+2: leal __memrchr_ia32@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+
+ CFI_PUSH (%ebx)
+
+3: leal __memrchr_sse2_bsf@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+END(__memrchr)
+
+weak_alias(__memrchr, memrchr)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2-bsf.S b/libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2-bsf.S
new file mode 100644
index 000000000..88c0e5776
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2-bsf.S
@@ -0,0 +1,3 @@
+#define USE_AS_RAWMEMCHR
+#define MEMCHR __rawmemchr_sse2_bsf
+#include "memchr-sse2-bsf.S"
diff --git a/libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2.S b/libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2.S
new file mode 100644
index 000000000..038c74896
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/rawmemchr-sse2.S
@@ -0,0 +1,3 @@
+#define USE_AS_RAWMEMCHR
+#define MEMCHR __rawmemchr_sse2
+#include "memchr-sse2.S"
diff --git a/libc/sysdeps/i386/i686/multiarch/rawmemchr.S b/libc/sysdeps/i386/i686/multiarch/rawmemchr.S
new file mode 100644
index 000000000..111f0dcf6
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/rawmemchr.S
@@ -0,0 +1,99 @@
+/* Multiple versions of rawmemchr
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+# define CFI_POP(REG) \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (REG)
+
+# define CFI_PUSH(REG) \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (REG, 0)
+
+ .text
+ENTRY(__rawmemchr)
+ .type __rawmemchr, @gnu_indirect_function
+ pushl %ebx
+ CFI_PUSH (%ebx)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+
+1: testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ testl $bit_Slow_BSF, FEATURE_OFFSET+index_Slow_BSF+__cpu_features@GOTOFF(%ebx)
+ jz 3f
+
+ leal __rawmemchr_sse2@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+
+ CFI_PUSH (%ebx)
+
+2: leal __rawmemchr_ia32@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+
+ CFI_PUSH (%ebx)
+
+3: leal __rawmemchr_sse2_bsf@GOTOFF(%ebx), %eax
+ popl %ebx
+ CFI_POP (%ebx)
+ ret
+END(__rawmemchr)
+
+weak_alias(__rawmemchr, rawmemchr)
+
+# undef ENTRY
+# define ENTRY(name) \
+ .type __rawmemchr_ia32, @function; \
+ .globl __rawmemchr_ia32; \
+ .p2align 4; \
+ __rawmemchr_ia32: cfi_startproc; \
+ CALL_MCOUNT
+# undef END
+# define END(name) \
+ cfi_endproc; .size __rawmemchr_ia32, .-__rawmemchr_ia32
+
+# undef libc_hidden_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+ they will be called without setting up EBX needed for PLT which is
+ used by IFUNC. */
+# define libc_hidden_def(name) \
+ .globl __GI___rawmemchr; __GI___rawmemchr = __rawmemchr_ia32
+
+#endif
+#include "../../rawmemchr.S"
diff --git a/libc/sysdeps/i386/i686/multiarch/rtld-strnlen.c b/libc/sysdeps/i386/i686/multiarch/rtld-strnlen.c
new file mode 100644
index 000000000..1aa544064
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/rtld-strnlen.c
@@ -0,0 +1 @@
+#include <string/strnlen.c>
diff --git a/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S b/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S
index a73b21ecc..9cc5ae8d1 100644
--- a/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S
+++ b/libc/sysdeps/i386/i686/multiarch/strchr-sse2.S
@@ -40,7 +40,7 @@
# define STR1 PARMS
# define STR2 STR1+4
- .text
+ atom_text_section
ENTRY (__strchr_sse2)
ENTRANCE
diff --git a/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S b/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
index 0dc651f01..ce50e0a33 100644
--- a/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
+++ b/libc/sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S
@@ -1,5 +1,5 @@
/* strlen with SSE2 and BSF
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -21,7 +21,6 @@
#if defined SHARED && !defined NOT_IN_libc
#include <sysdep.h>
-#include "asm-syntax.h"
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
diff --git a/libc/sysdeps/i386/i686/multiarch/strlen-sse2.S b/libc/sysdeps/i386/i686/multiarch/strlen-sse2.S
index ca549bafc..91b6d799c 100644
--- a/libc/sysdeps/i386/i686/multiarch/strlen-sse2.S
+++ b/libc/sysdeps/i386/i686/multiarch/strlen-sse2.S
@@ -18,31 +18,46 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#if (defined USE_AS_STRCAT || defined SHARED) && !defined NOT_IN_libc
+/* for strlen only SHARED version is optimized, for strcat, strncat, strnlen both STATIC and SHARED are optimized */
+
+#if (defined USE_AS_STRNLEN || defined USE_AS_STRCAT || defined SHARED) && !defined NOT_IN_libc
+
# ifndef USE_AS_STRCAT
# include <sysdep.h>
-# include "asm-syntax.h"
+# define PARMS 4
+# define STR PARMS
+# define RETURN ret
-# define CFI_PUSH(REG) \
+# ifdef USE_AS_STRNLEN
+# define LEN PARMS + 8
+# define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
-# define CFI_POP(REG) \
+# define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
-# define PUSH(REG) pushl REG; CFI_PUSH (REG)
-# define POP(REG) popl REG; CFI_POP (REG)
-# define PARMS 4
-# define STR PARMS
-# define ENTRANCE
-# define RETURN ret
+# define PUSH(REG) pushl REG; CFI_PUSH (REG)
+# define POP(REG) popl REG; CFI_POP (REG)
+# undef RETURN
+# define RETURN POP (%edi); CFI_PUSH(%edi); ret
+# endif
- .text
-ENTRY (__strlen_sse2)
- ENTRANCE
+# ifndef STRLEN
+# define STRLEN __strlen_sse2
+# endif
+
+ atom_text_section
+ENTRY (STRLEN)
mov STR(%esp), %edx
+# ifdef USE_AS_STRNLEN
+ PUSH (%edi)
+ movl LEN(%esp), %edi
+ sub $4, %edi
+ jbe L(len_less4_prolog)
+# endif
# endif
xor %eax, %eax
cmpb $0, (%edx)
@@ -53,6 +68,12 @@ ENTRY (__strlen_sse2)
jz L(exit_tail2)
cmpb $0, 3(%edx)
jz L(exit_tail3)
+
+# ifdef USE_AS_STRNLEN
+ sub $4, %edi
+ jbe L(len_less8_prolog)
+# endif
+
cmpb $0, 4(%edx)
jz L(exit_tail4)
cmpb $0, 5(%edx)
@@ -61,6 +82,12 @@ ENTRY (__strlen_sse2)
jz L(exit_tail6)
cmpb $0, 7(%edx)
jz L(exit_tail7)
+
+# ifdef USE_AS_STRNLEN
+ sub $4, %edi
+ jbe L(len_less12_prolog)
+# endif
+
cmpb $0, 8(%edx)
jz L(exit_tail8)
cmpb $0, 9(%edx)
@@ -69,6 +96,12 @@ ENTRY (__strlen_sse2)
jz L(exit_tail10)
cmpb $0, 11(%edx)
jz L(exit_tail11)
+
+# ifdef USE_AS_STRNLEN
+ sub $4, %edi
+ jbe L(len_less16_prolog)
+# endif
+
cmpb $0, 12(%edx)
jz L(exit_tail12)
cmpb $0, 13(%edx)
@@ -77,11 +110,18 @@ ENTRY (__strlen_sse2)
jz L(exit_tail14)
cmpb $0, 15(%edx)
jz L(exit_tail15)
+
pxor %xmm0, %xmm0
- mov %edx, %eax
- lea 16(%edx), %ecx
+ lea 16(%edx), %eax
+ mov %eax, %ecx
and $-16, %eax
- add $16, %eax
+
+# ifdef USE_AS_STRNLEN
+ and $15, %edx
+ add %edx, %edi
+ sub $64, %edi
+ jbe L(len_less64)
+# endif
pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx
@@ -97,7 +137,6 @@ ENTRY (__strlen_sse2)
lea 16(%eax), %eax
jnz L(exit)
-
pcmpeqb (%eax), %xmm2
pmovmskb %xmm2, %edx
pxor %xmm3, %xmm3
@@ -111,6 +150,11 @@ ENTRY (__strlen_sse2)
lea 16(%eax), %eax
jnz L(exit)
+# ifdef USE_AS_STRNLEN
+ sub $64, %edi
+ jbe L(len_less64)
+# endif
+
pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx
test %edx, %edx
@@ -135,6 +179,11 @@ ENTRY (__strlen_sse2)
lea 16(%eax), %eax
jnz L(exit)
+# ifdef USE_AS_STRNLEN
+ sub $64, %edi
+ jbe L(len_less64)
+# endif
+
pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx
test %edx, %edx
@@ -159,6 +208,11 @@ ENTRY (__strlen_sse2)
lea 16(%eax), %eax
jnz L(exit)
+# ifdef USE_AS_STRNLEN
+ sub $64, %edi
+ jbe L(len_less64)
+# endif
+
pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx
test %edx, %edx
@@ -183,8 +237,20 @@ ENTRY (__strlen_sse2)
lea 16(%eax), %eax
jnz L(exit)
+# ifdef USE_AS_STRNLEN
+ mov %eax, %edx
+ and $63, %edx
+ add %edx, %edi
+# endif
+
and $-0x40, %eax
-L(aligned_64):
+
+ .p2align 4
+L(aligned_64_loop):
+# ifdef USE_AS_STRNLEN
+ sub $64, %edi
+ jbe L(len_less64)
+# endif
movaps (%eax), %xmm0
movaps 16(%eax), %xmm1
movaps 32(%eax), %xmm2
@@ -196,7 +262,7 @@ L(aligned_64):
pmovmskb %xmm2, %edx
test %edx, %edx
lea 64(%eax), %eax
- jz L(aligned_64)
+ jz L(aligned_64_loop)
pcmpeqb -64(%eax), %xmm3
pmovmskb %xmm3, %edx
@@ -223,56 +289,348 @@ L(exit):
sub %ecx, %eax
test %dl, %dl
jz L(exit_high)
+
+ mov %dl, %cl
+ and $15, %cl
+ jz L(exit_8)
test $0x01, %dl
jnz L(exit_tail0)
-
test $0x02, %dl
jnz L(exit_tail1)
-
test $0x04, %dl
jnz L(exit_tail2)
+ add $3, %eax
+ RETURN
- test $0x08, %dl
- jnz L(exit_tail3)
-
+ .p2align 4
+L(exit_8):
test $0x10, %dl
jnz L(exit_tail4)
-
test $0x20, %dl
jnz L(exit_tail5)
-
test $0x40, %dl
jnz L(exit_tail6)
add $7, %eax
-L(exit_tail0):
RETURN
+ .p2align 4
L(exit_high):
- add $8, %eax
+ mov %dh, %ch
+ and $15, %ch
+ jz L(exit_high_8)
test $0x01, %dh
+ jnz L(exit_tail8)
+ test $0x02, %dh
+ jnz L(exit_tail9)
+ test $0x04, %dh
+ jnz L(exit_tail10)
+ add $11, %eax
+ RETURN
+
+ .p2align 4
+L(exit_high_8):
+ test $0x10, %dh
+ jnz L(exit_tail12)
+ test $0x20, %dh
+ jnz L(exit_tail13)
+ test $0x40, %dh
+ jnz L(exit_tail14)
+ add $15, %eax
+L(exit_tail0):
+ RETURN
+
+# ifdef USE_AS_STRNLEN
+
+ .p2align 4
+L(len_less64):
+ pxor %xmm0, %xmm0
+ add $64, %edi
+
+ pcmpeqb (%eax), %xmm0
+ pmovmskb %xmm0, %edx
+ pxor %xmm1, %xmm1
+ lea 16(%eax), %eax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ sub $16, %edi
+ jbe L(return_start_len)
+
+ pcmpeqb (%eax), %xmm1
+ pmovmskb %xmm1, %edx
+ lea 16(%eax), %eax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ sub $16, %edi
+ jbe L(return_start_len)
+
+ pcmpeqb (%eax), %xmm0
+ pmovmskb %xmm0, %edx
+ lea 16(%eax), %eax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ sub $16, %edi
+ jbe L(return_start_len)
+
+ pcmpeqb (%eax), %xmm1
+ pmovmskb %xmm1, %edx
+ lea 16(%eax), %eax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ movl LEN(%esp), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit):
+ sub %ecx, %eax
+
+ test %dl, %dl
+ jz L(strnlen_exit_high)
+ mov %dl, %cl
+ and $15, %cl
+ jz L(strnlen_exit_8)
+ test $0x01, %dl
jnz L(exit_tail0)
+ test $0x02, %dl
+ jnz L(strnlen_exit_tail1)
+ test $0x04, %dl
+ jnz L(strnlen_exit_tail2)
+ sub $4, %edi
+ jb L(return_start_len)
+ lea 3(%eax), %eax
+ RETURN
- test $0x02, %dh
- jnz L(exit_tail1)
+ .p2align 4
+L(strnlen_exit_8):
+ test $0x10, %dl
+ jnz L(strnlen_exit_tail4)
+ test $0x20, %dl
+ jnz L(strnlen_exit_tail5)
+ test $0x40, %dl
+ jnz L(strnlen_exit_tail6)
+ sub $8, %edi
+ jb L(return_start_len)
+ lea 7(%eax), %eax
+ RETURN
+ .p2align 4
+L(strnlen_exit_high):
+ mov %dh, %ch
+ and $15, %ch
+ jz L(strnlen_exit_high_8)
+ test $0x01, %dh
+ jnz L(strnlen_exit_tail8)
+ test $0x02, %dh
+ jnz L(strnlen_exit_tail9)
test $0x04, %dh
- jnz L(exit_tail2)
-
- test $0x08, %dh
- jnz L(exit_tail3)
+ jnz L(strnlen_exit_tail10)
+ sub $12, %edi
+ jb L(return_start_len)
+ lea 11(%eax), %eax
+ RETURN
+ .p2align 4
+L(strnlen_exit_high_8):
test $0x10, %dh
- jnz L(exit_tail4)
-
+ jnz L(strnlen_exit_tail12)
test $0x20, %dh
- jnz L(exit_tail5)
-
+ jnz L(strnlen_exit_tail13)
test $0x40, %dh
- jnz L(exit_tail6)
- add $7, %eax
+ jnz L(strnlen_exit_tail14)
+ sub $16, %edi
+ jb L(return_start_len)
+ lea 15(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail1):
+ sub $2, %edi
+ jb L(return_start_len)
+ lea 1(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail2):
+ sub $3, %edi
+ jb L(return_start_len)
+ lea 2(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail4):
+ sub $5, %edi
+ jb L(return_start_len)
+ lea 4(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail5):
+ sub $6, %edi
+ jb L(return_start_len)
+ lea 5(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail6):
+ sub $7, %edi
+ jb L(return_start_len)
+ lea 6(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail8):
+ sub $9, %edi
+ jb L(return_start_len)
+ lea 8(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail9):
+ sub $10, %edi
+ jb L(return_start_len)
+ lea 9(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail10):
+ sub $11, %edi
+ jb L(return_start_len)
+ lea 10(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail12):
+ sub $13, %edi
+ jb L(return_start_len)
+ lea 12(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail13):
+ sub $14, %edi
+ jb L(return_start_len)
+ lea 13(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(strnlen_exit_tail14):
+ sub $15, %edi
+ jb L(return_start_len)
+ lea 14(%eax), %eax
+ RETURN
+
+ .p2align 4
+L(return_start_len):
+ movl LEN(%esp), %eax
+ RETURN
+
+/* for prolog only */
+
+ .p2align 4
+L(len_less4_prolog):
+ xor %eax, %eax
+
+ add $4, %edi
+ jz L(exit_tail0)
+
+ cmpb $0, (%edx)
+ jz L(exit_tail0)
+ cmp $1, %edi
+ je L(exit_tail1)
+
+ cmpb $0, 1(%edx)
+ jz L(exit_tail1)
+ cmp $2, %edi
+ je L(exit_tail2)
+
+ cmpb $0, 2(%edx)
+ jz L(exit_tail2)
+ cmp $3, %edi
+ je L(exit_tail3)
+
+ cmpb $0, 3(%edx)
+ jz L(exit_tail3)
+ mov $4, %eax
RETURN
.p2align 4
+L(len_less8_prolog):
+ add $4, %edi
+
+ cmpb $0, 4(%edx)
+ jz L(exit_tail4)
+ cmp $1, %edi
+ je L(exit_tail5)
+
+ cmpb $0, 5(%edx)
+ jz L(exit_tail5)
+ cmp $2, %edi
+ je L(exit_tail6)
+
+ cmpb $0, 6(%edx)
+ jz L(exit_tail6)
+ cmp $3, %edi
+ je L(exit_tail7)
+
+ cmpb $0, 7(%edx)
+ jz L(exit_tail7)
+ mov $8, %eax
+ RETURN
+
+
+ .p2align 4
+L(len_less12_prolog):
+ add $4, %edi
+
+ cmpb $0, 8(%edx)
+ jz L(exit_tail8)
+ cmp $1, %edi
+ je L(exit_tail9)
+
+ cmpb $0, 9(%edx)
+ jz L(exit_tail9)
+ cmp $2, %edi
+ je L(exit_tail10)
+
+ cmpb $0, 10(%edx)
+ jz L(exit_tail10)
+ cmp $3, %edi
+ je L(exit_tail11)
+
+ cmpb $0, 11(%edx)
+ jz L(exit_tail11)
+ mov $12, %eax
+ RETURN
+
+ .p2align 4
+L(len_less16_prolog):
+ add $4, %edi
+
+ cmpb $0, 12(%edx)
+ jz L(exit_tail12)
+ cmp $1, %edi
+ je L(exit_tail13)
+
+ cmpb $0, 13(%edx)
+ jz L(exit_tail13)
+ cmp $2, %edi
+ je L(exit_tail14)
+
+ cmpb $0, 14(%edx)
+ jz L(exit_tail14)
+ cmp $3, %edi
+ je L(exit_tail15)
+
+ cmpb $0, 15(%edx)
+ jz L(exit_tail15)
+ mov $16, %eax
+ RETURN
+# endif
+
+ .p2align 4
L(exit_tail1):
add $1, %eax
RETURN
@@ -332,7 +690,7 @@ L(exit_tail14):
L(exit_tail15):
add $15, %eax
# ifndef USE_AS_STRCAT
- ret
-END (__strlen_sse2)
+ RETURN
+END (STRLEN)
# endif
#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/strnlen-c.c b/libc/sysdeps/i386/i686/multiarch/strnlen-c.c
new file mode 100644
index 000000000..567af2c81
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/strnlen-c.c
@@ -0,0 +1,8 @@
+#ifndef NOT_IN_libc
+# define STRNLEN __strnlen_ia32
+# undef libc_hidden_builtin_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__strnlen_ia32, __GI_strnlen, __strnlen_ia32);
+#endif
+
+#include "string/strnlen.c"
diff --git a/libc/sysdeps/i386/i686/multiarch/strnlen-sse2.S b/libc/sysdeps/i386/i686/multiarch/strnlen-sse2.S
new file mode 100644
index 000000000..56b6ae2a5
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/strnlen-sse2.S
@@ -0,0 +1,3 @@
+#define USE_AS_STRNLEN
+#define STRLEN __strnlen_sse2
+#include "strlen-sse2.S"
diff --git a/libc/sysdeps/i386/i686/multiarch/strnlen.S b/libc/sysdeps/i386/i686/multiarch/strnlen.S
new file mode 100644
index 000000000..7e542d9b7
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/strnlen.S
@@ -0,0 +1,56 @@
+/* Multiple versions of strnlen
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+ .text
+ENTRY(__strnlen)
+ .type __strnlen, @gnu_indirect_function
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+1: leal __strnlen_ia32@GOTOFF(%ebx), %eax
+ testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __strnlen_sse2@GOTOFF(%ebx), %eax
+2: popl %ebx
+ cfi_adjust_cfa_offset (-4);
+ cfi_restore (ebx)
+ ret
+END(__strnlen)
+
+weak_alias(__strnlen, strnlen)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S b/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S
index 71cc69dfe..f46b17fd7 100644
--- a/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S
+++ b/libc/sysdeps/i386/i686/multiarch/strrchr-sse2.S
@@ -40,7 +40,7 @@
# define STR1 PARMS
# define STR2 STR1+4
- .text
+ atom_text_section
ENTRY (__strrchr_sse2)
ENTRANCE
diff --git a/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S b/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
index 404a9a4d4..61c43c38d 100644
--- a/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
+++ b/libc/sysdeps/i386/i686/multiarch/wcscmp-sse2.S
@@ -21,7 +21,6 @@
#ifndef NOT_IN_libc
# include <sysdep.h>
-# include "asm-syntax.h"
# define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
@@ -34,18 +33,16 @@
# define PUSH(REG) pushl REG; CFI_PUSH (REG)
# define POP(REG) popl REG; CFI_POP (REG)
-# ifndef STRCMP
-# define STRCMP __wcscmp_sse2
-# endif
-
# define ENTRANCE PUSH(%esi); PUSH(%edi)
# define RETURN POP(%edi); POP(%esi); ret; CFI_PUSH(%esi); CFI_PUSH(%edi);
# define PARMS 4
# define STR1 PARMS
# define STR2 STR1+4
+/* Note: wcscmp uses signed comparison, not unsugned as in strcmp function. */
+
.text
-ENTRY (STRCMP)
+ENTRY (__wcscmp_sse2)
/*
* This implementation uses SSE to compare up to 16 bytes at a time.
*/
@@ -264,20 +261,20 @@ L(continue_00_48):
test %ecx, %ecx
jnz L(less4_double_words1)
- sub (%esi), %eax
- jnz L(return)
+ cmp (%esi), %eax
+ jne L(nequal)
mov 4(%edi), %eax
- sub 4(%esi), %eax
- jnz L(return)
+ cmp 4(%esi), %eax
+ jne L(nequal)
mov 8(%edi), %eax
- sub 8(%esi), %eax
- jnz L(return)
+ cmp 8(%esi), %eax
+ jne L(nequal)
mov 12(%edi), %eax
- sub 12(%esi), %eax
- jnz L(return)
+ cmp 12(%esi), %eax
+ jne L(nequal)
movdqu 16(%esi), %xmm2
pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
@@ -381,7 +378,7 @@ L(continue_32_48):
movdqu 48(%esi), %xmm2
pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
pcmpeqd %xmm2, %xmm1 /* compare first 4 double_words for equality */
- psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ psubb %xmm0, %xmm1 /* packed sub of comparison results */
pmovmskb %xmm1, %edx
sub $0xffff, %edx /* if first 4 double_words are same, edx == 0xffff */
jnz L(less4_double_words_48)
@@ -585,20 +582,20 @@ L(continue_48_00):
test %ecx, %ecx
jnz L(less4_double_words1)
- sub (%esi), %eax
- jnz L(return)
+ cmp (%esi), %eax
+ jne L(nequal)
mov 4(%edi), %eax
- sub 4(%esi), %eax
- jnz L(return)
+ cmp 4(%esi), %eax
+ jne L(nequal)
mov 8(%edi), %eax
- sub 8(%esi), %eax
- jnz L(return)
+ cmp 8(%esi), %eax
+ jne L(nequal)
mov 12(%edi), %eax
- sub 12(%esi), %eax
- jnz L(return)
+ cmp 12(%esi), %eax
+ jne L(nequal)
movdqu 16(%edi), %xmm1
pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
@@ -839,142 +836,161 @@ L(less4_double_words1):
test %ecx, %ecx
jz L(equal)
- mov 12(%esi), %edx
- mov 12(%edi), %eax
- sub %edx, %eax
+ mov 12(%esi), %ecx
+ cmp %ecx, 12(%edi)
+ jne L(nequal)
+ xor %eax, %eax
RETURN
.p2align 4
L(less4_double_words):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words)
and $15, %dl
jz L(second_double_word)
- mov (%edi), %eax
- sub (%esi), %eax
+ mov (%esi), %ecx
+ cmp %ecx, (%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(second_double_word):
- mov 4(%edi), %eax
- sub 4(%esi), %eax
+ mov 4(%esi), %ecx
+ cmp %ecx, 4(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(next_two_double_words):
and $15, %dh
jz L(fourth_double_word)
- mov 8(%edi), %eax
- sub 8(%esi), %eax
+ mov 8(%esi), %ecx
+ cmp %ecx, 8(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(fourth_double_word):
- mov 12(%edi), %eax
- sub 12(%esi), %eax
+ mov 12(%esi), %ecx
+ cmp %ecx, 12(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(less4_double_words_16):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words_16)
and $15, %dl
jz L(second_double_word_16)
- mov 16(%edi), %eax
- sub 16(%esi), %eax
+ mov 16(%esi), %ecx
+ cmp %ecx, 16(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(second_double_word_16):
- mov 20(%edi), %eax
- sub 20(%esi), %eax
+ mov 20(%esi), %ecx
+ cmp %ecx, 20(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(next_two_double_words_16):
and $15, %dh
jz L(fourth_double_word_16)
- mov 24(%edi), %eax
- sub 24(%esi), %eax
+ mov 24(%esi), %ecx
+ cmp %ecx, 24(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(fourth_double_word_16):
- mov 28(%edi), %eax
- sub 28(%esi), %eax
+ mov 28(%esi), %ecx
+ cmp %ecx, 28(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(less4_double_words_32):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words_32)
and $15, %dl
jz L(second_double_word_32)
- mov 32(%edi), %eax
- sub 32(%esi), %eax
+ mov 32(%esi), %ecx
+ cmp %ecx, 32(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(second_double_word_32):
- mov 36(%edi), %eax
- sub 36(%esi), %eax
+ mov 36(%esi), %ecx
+ cmp %ecx, 36(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(next_two_double_words_32):
and $15, %dh
jz L(fourth_double_word_32)
- mov 40(%edi), %eax
- sub 40(%esi), %eax
+ mov 40(%esi), %ecx
+ cmp %ecx, 40(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(fourth_double_word_32):
- mov 44(%edi), %eax
- sub 44(%esi), %eax
+ mov 44(%esi), %ecx
+ cmp %ecx, 44(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(less4_double_words_48):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words_48)
and $15, %dl
jz L(second_double_word_48)
- mov 48(%edi), %eax
- sub 48(%esi), %eax
+ mov 48(%esi), %ecx
+ cmp %ecx, 48(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(second_double_word_48):
- mov 52(%edi), %eax
- sub 52(%esi), %eax
+ mov 52(%esi), %ecx
+ cmp %ecx, 52(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(next_two_double_words_48):
and $15, %dh
jz L(fourth_double_word_48)
- mov 56(%edi), %eax
- sub 56(%esi), %eax
+ mov 56(%esi), %ecx
+ cmp %ecx, 56(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(fourth_double_word_48):
- mov 60(%edi), %eax
- sub 60(%esi), %eax
- RETURN
-
- .p2align 4
-L(return):
+ mov 60(%esi), %ecx
+ cmp %ecx, 60(%edi)
+ jne L(nequal)
RETURN
.p2align 4
L(nequal):
mov $1, %eax
- ja L(nequal_bigger)
+ jg L(return)
neg %eax
+ RETURN
-L(nequal_bigger):
+ .p2align 4
+L(return):
RETURN
.p2align 4
@@ -988,7 +1004,7 @@ L(equal):
.p2align 4
L(neq):
mov $1, %eax
- ja L(neq_bigger)
+ jg L(neq_bigger)
neg %eax
L(neq_bigger):
@@ -999,5 +1015,5 @@ L(eq):
xorl %eax, %eax
ret
-END (STRCMP)
+END (__wcscmp_sse2)
#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/wcslen-c.c b/libc/sysdeps/i386/i686/multiarch/wcslen-c.c
new file mode 100644
index 000000000..49f32a25e
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/wcslen-c.c
@@ -0,0 +1,5 @@
+#ifndef NOT_IN_libc
+# define WCSLEN __wcslen_ia32
+#endif
+
+#include "wcsmbs/wcslen.c"
diff --git a/libc/sysdeps/i386/i686/multiarch/wcslen-sse2.S b/libc/sysdeps/i386/i686/multiarch/wcslen-sse2.S
new file mode 100644
index 000000000..d41d62309
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/wcslen-sse2.S
@@ -0,0 +1,194 @@
+/* wcslen with SSE2
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+# include <sysdep.h>
+# define STR 4
+
+ .text
+ENTRY (__wcslen_sse2)
+ mov STR(%esp), %edx
+
+ cmp $0, (%edx)
+ jz L(exit_tail0)
+ cmp $0, 4(%edx)
+ jz L(exit_tail1)
+ cmp $0, 8(%edx)
+ jz L(exit_tail2)
+ cmp $0, 12(%edx)
+ jz L(exit_tail3)
+ cmp $0, 16(%edx)
+ jz L(exit_tail4)
+ cmp $0, 20(%edx)
+ jz L(exit_tail5)
+ cmp $0, 24(%edx)
+ jz L(exit_tail6)
+ cmp $0, 28(%edx)
+ jz L(exit_tail7)
+
+ pxor %xmm0, %xmm0
+
+ lea 32(%edx), %eax
+ lea 16(%edx), %ecx
+ and $-16, %eax
+
+ pcmpeqd (%eax), %xmm0
+ pmovmskb %xmm0, %edx
+ pxor %xmm1, %xmm1
+ test %edx, %edx
+ lea 16(%eax), %eax
+ jnz L(exit)
+
+ pcmpeqd (%eax), %xmm1
+ pmovmskb %xmm1, %edx
+ pxor %xmm2, %xmm2
+ test %edx, %edx
+ lea 16(%eax), %eax
+ jnz L(exit)
+
+ pcmpeqd (%eax), %xmm2
+ pmovmskb %xmm2, %edx
+ pxor %xmm3, %xmm3
+ test %edx, %edx
+ lea 16(%eax), %eax
+ jnz L(exit)
+
+ pcmpeqd (%eax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%eax), %eax
+ jnz L(exit)
+
+ and $-0x40, %eax
+
+ .p2align 4
+L(aligned_64_loop):
+ movaps (%eax), %xmm0
+ movaps 16(%eax), %xmm1
+ movaps 32(%eax), %xmm2
+ movaps 48(%eax), %xmm6
+
+ pminub %xmm1, %xmm0
+ pminub %xmm6, %xmm2
+ pminub %xmm0, %xmm2
+ pcmpeqd %xmm3, %xmm2
+ pmovmskb %xmm2, %edx
+ test %edx, %edx
+ lea 64(%eax), %eax
+ jz L(aligned_64_loop)
+
+ pcmpeqd -64(%eax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 48(%ecx), %ecx
+ jnz L(exit)
+
+ pcmpeqd %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea -16(%ecx), %ecx
+ jnz L(exit)
+
+ pcmpeqd -32(%eax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea -16(%ecx), %ecx
+ jnz L(exit)
+
+ pcmpeqd %xmm6, %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea -16(%ecx), %ecx
+ jnz L(exit)
+
+ jmp L(aligned_64_loop)
+
+ .p2align 4
+L(exit):
+ sub %ecx, %eax
+ shr $2, %eax
+ test %dl, %dl
+ jz L(exit_high)
+
+ mov %dl, %cl
+ and $15, %cl
+ jz L(exit_1)
+ ret
+
+ .p2align 4
+L(exit_high):
+ mov %dh, %ch
+ and $15, %ch
+ jz L(exit_3)
+ add $2, %eax
+ ret
+
+ .p2align 4
+L(exit_1):
+ add $1, %eax
+ ret
+
+ .p2align 4
+L(exit_3):
+ add $3, %eax
+ ret
+
+ .p2align 4
+L(exit_tail0):
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(exit_tail1):
+ mov $1, %eax
+ ret
+
+ .p2align 4
+L(exit_tail2):
+ mov $2, %eax
+ ret
+
+ .p2align 4
+L(exit_tail3):
+ mov $3, %eax
+ ret
+
+ .p2align 4
+L(exit_tail4):
+ mov $4, %eax
+ ret
+
+ .p2align 4
+L(exit_tail5):
+ mov $5, %eax
+ ret
+
+ .p2align 4
+L(exit_tail6):
+ mov $6, %eax
+ ret
+
+ .p2align 4
+L(exit_tail7):
+ mov $7, %eax
+ ret
+
+END (__wcslen_sse2)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/wcslen.S b/libc/sysdeps/i386/i686/multiarch/wcslen.S
new file mode 100644
index 000000000..58670377e
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/wcslen.S
@@ -0,0 +1,56 @@
+/* Multiple versions of wcslen
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+__i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+ .text
+ENTRY(__wcslen)
+ .type __wcslen, @gnu_indirect_function
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+1: leal __wcslen_ia32@GOTOFF(%ebx), %eax
+ testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __wcslen_sse2@GOTOFF(%ebx), %eax
+2: popl %ebx
+ cfi_adjust_cfa_offset (-4);
+ cfi_restore (ebx)
+ ret
+END(__wcslen)
+
+weak_alias(__wcslen, wcslen)
+#endif
diff --git a/libc/sysdeps/i386/i686/multiarch/wmemcmp-c.c b/libc/sysdeps/i386/i686/multiarch/wmemcmp-c.c
new file mode 100644
index 000000000..94ff6151f
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/wmemcmp-c.c
@@ -0,0 +1,5 @@
+#ifndef NOT_IN_libc
+# define WMEMCMP __wmemcmp_ia32
+#endif
+
+#include "wcsmbs/wmemcmp.c"
diff --git a/libc/sysdeps/i386/i686/multiarch/wmemcmp-sse4.S b/libc/sysdeps/i386/i686/multiarch/wmemcmp-sse4.S
new file mode 100644
index 000000000..1a857c7e2
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/wmemcmp-sse4.S
@@ -0,0 +1,4 @@
+#define USE_AS_WMEMCMP 1
+#define MEMCMP __wmemcmp_sse4_2
+
+#include "memcmp-sse4.S"
diff --git a/libc/sysdeps/i386/i686/multiarch/wmemcmp-ssse3.S b/libc/sysdeps/i386/i686/multiarch/wmemcmp-ssse3.S
new file mode 100644
index 000000000..a41ef95fc
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/wmemcmp-ssse3.S
@@ -0,0 +1,4 @@
+#define USE_AS_WMEMCMP 1
+#define MEMCMP __wmemcmp_ssse3
+
+#include "memcmp-ssse3.S"
diff --git a/libc/sysdeps/i386/i686/multiarch/wmemcmp.S b/libc/sysdeps/i386/i686/multiarch/wmemcmp.S
new file mode 100644
index 000000000..5080c14ea
--- /dev/null
+++ b/libc/sysdeps/i386/i686/multiarch/wmemcmp.S
@@ -0,0 +1,59 @@
+/* Multiple versions of wmemcmp
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+/* Define multiple versions only for the definition in libc. */
+
+#ifndef NOT_IN_libc
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
+ .globl __i686.get_pc_thunk.bx
+ .hidden __i686.get_pc_thunk.bx
+ .p2align 4
+ .type __i686.get_pc_thunk.bx,@function
+ __i686.get_pc_thunk.bx:
+ movl (%esp), %ebx
+ ret
+
+ .text
+ENTRY(wmemcmp)
+ .type wmemcmp, @gnu_indirect_function
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (ebx, 0)
+ call __i686.get_pc_thunk.bx
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+ jne 1f
+ call __init_cpu_features
+1: leal __wmemcmp_ia32@GOTOFF(%ebx), %eax
+ testl $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __wmemcmp_ssse3@GOTOFF(%ebx), %eax
+ testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
+ jz 2f
+ leal __wmemcmp_sse4_2@GOTOFF(%ebx), %eax
+2: popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+ ret
+END(wmemcmp)
+#endif
diff --git a/libc/sysdeps/i386/sysdep.h b/libc/sysdeps/i386/sysdep.h
index efdc82dde..a8a9e571b 100644
--- a/libc/sysdeps/i386/sysdep.h
+++ b/libc/sysdeps/i386/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for i386.
- Copyright (C) 1991-93,95,96,98,2002,2003,2005,2006
+ Copyright (C) 1991-93,95,96,98,2002,2003,2005,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -167,4 +167,6 @@ __i686.get_pc_thunk.reg: \
#endif
#endif
+#define atom_text_section .section ".text.atom", "ax"
+
#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/ia64/dl-machine.h b/libc/sysdeps/ia64/dl-machine.h
index 61b4ea99a..6053b3b78 100644
--- a/libc/sysdeps/ia64/dl-machine.h
+++ b/libc/sysdeps/ia64/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. IA-64 version.
- Copyright (C) 1995-1997, 2000-2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1997, 2000-2006, 2011 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
@@ -311,15 +311,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
of the main executable's symbols, as for a COPY reloc, which we don't
use. */
/* ??? Ignore *MSB for now. */
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
#define elf_machine_type_class(type) \
(((type) == R_IA64_IPLTLSB || (type) == R_IA64_DTPMOD64LSB \
|| (type) == R_IA64_DTPREL64LSB || (type) == R_IA64_TPREL64LSB) \
* ELF_RTYPE_CLASS_PLT)
-#else
-#define elf_machine_type_class(type) \
- (((type) == R_IA64_IPLTLSB) * ELF_RTYPE_CLASS_PLT)
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_IA64_IPLTLSB
@@ -377,7 +372,8 @@ elf_machine_rela (struct link_map *map,
const Elf64_Rela *reloc,
const Elf64_Sym *sym,
const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -405,7 +401,7 @@ elf_machine_rela (struct link_map *map,
/* Already done in dynamic linker. */
if (map != &GL(dl_rtld_map))
# endif
- value += map->l_addr;
+ value += map->l_addr;
}
else
#endif
@@ -417,7 +413,7 @@ elf_machine_rela (struct link_map *map,
/* RESOLVE_MAP() will return NULL if it fail to locate the symbol. */
if ((sym_map = RESOLVE_MAP (&sym, version, r_type)))
- {
+ {
value = sym_map->l_addr + sym->st_value + reloc->r_addend;
if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_DIR64LSB))
@@ -432,26 +428,24 @@ elf_machine_rela (struct link_map *map,
value = _dl_make_fptr (sym_map, sym, value);
else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_PCREL64LSB))
value -= (Elf64_Addr) reloc_addr & -16;
-#if !defined RTLD_BOOTSTRAP || defined USE___THREAD
else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_DTPMOD64LSB))
-# ifdef RTLD_BOOTSTRAP
+#ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always index 1. */
value = 1;
-# else
+#else
/* Get the information from the link map returned by the
resolv function. */
value = sym_map->l_tls_modid;
else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_DTPREL64LSB))
value -= sym_map->l_addr;
-# endif
+#endif
else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_TPREL64LSB))
{
-# ifndef RTLD_BOOTSTRAP
+#ifndef RTLD_BOOTSTRAP
CHECK_STATIC_TLS (map, sym_map);
-# endif
+#endif
value += sym_map->l_tls_offset - sym_map->l_addr;
}
-#endif
else
_dl_reloc_bad_type (map, r_type, 0);
}
@@ -493,7 +487,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
auto inline void
__attribute ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
diff --git a/libc/sysdeps/ia64/elf/configure b/libc/sysdeps/ia64/elf/configure
index 8bc2e4f71..aed8ee550 100644
--- a/libc/sysdeps/ia64/elf/configure
+++ b/libc/sysdeps/ia64/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/ia64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for ia64 TLS support" >&5
@@ -10,18 +9,18 @@ if test "${libc_cv_ia64_tls+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
+ .section ".tdata","awT",@progbits
foo: data8 25
- .text
- addl r16 = @ltoff(@dtpmod(foo#)), gp
- addl r17 = @ltoff(@dtprel(foo#)), gp
- addl r18 = @ltoff(@tprel(foo#)), gp
- addl r19 = @dtprel(foo#), gp
- adds r21 = @dtprel(foo#), r13
- movl r23 = @dtprel(foo#)
- addl r20 = @tprel(foo#), gp
- adds r22 = @tprel(foo#), r13
- movl r24 = @tprel(foo#)
+ .text
+ addl r16 = @ltoff(@dtpmod(foo#)), gp
+ addl r17 = @ltoff(@dtprel(foo#)), gp
+ addl r18 = @ltoff(@tprel(foo#)), gp
+ addl r19 = @dtprel(foo#), gp
+ adds r21 = @dtprel(foo#), r13
+ movl r23 = @dtprel(foo#)
+ addl r20 = @tprel(foo#), gp
+ adds r22 = @tprel(foo#), r13
+ movl r24 = @tprel(foo#)
EOF
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
@@ -37,12 +36,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_ia64_tls" >&5
$as_echo "$libc_cv_ia64_tls" >&6; }
-if test $libc_cv_ia64_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_ia64_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
cat >>confdefs.h <<\_ACEOF
diff --git a/libc/sysdeps/ia64/elf/configure.in b/libc/sysdeps/ia64/elf/configure.in
index b113579ee..396b9c49c 100644
--- a/libc/sysdeps/ia64/elf/configure.in
+++ b/libc/sysdeps/ia64/elf/configure.in
@@ -1,23 +1,22 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/ia64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for ia64 TLS support, libc_cv_ia64_tls, [dnl
cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
+ .section ".tdata","awT",@progbits
foo: data8 25
- .text
- addl r16 = @ltoff(@dtpmod(foo#)), gp
- addl r17 = @ltoff(@dtprel(foo#)), gp
- addl r18 = @ltoff(@tprel(foo#)), gp
- addl r19 = @dtprel(foo#), gp
- adds r21 = @dtprel(foo#), r13
- movl r23 = @dtprel(foo#)
- addl r20 = @tprel(foo#), gp
- adds r22 = @tprel(foo#), r13
- movl r24 = @tprel(foo#)
+ .text
+ addl r16 = @ltoff(@dtpmod(foo#)), gp
+ addl r17 = @ltoff(@dtprel(foo#)), gp
+ addl r18 = @ltoff(@tprel(foo#)), gp
+ addl r19 = @dtprel(foo#), gp
+ adds r21 = @dtprel(foo#), r13
+ movl r23 = @dtprel(foo#)
+ addl r20 = @tprel(foo#), gp
+ adds r22 = @tprel(foo#), r13
+ movl r24 = @tprel(foo#)
EOF
dnl
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
@@ -26,9 +25,8 @@ else
libc_cv_ia64_tls=no
fi
rm -f conftest*])
-if test $libc_cv_ia64_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_ia64_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl It is always possible to access static and hidden symbols in an
diff --git a/libc/sysdeps/ia64/fpu/bits/math-finite.h b/libc/sysdeps/ia64/fpu/bits/math-finite.h
new file mode 100644
index 000000000..8901b2dc4
--- /dev/null
+++ b/libc/sysdeps/ia64/fpu/bits/math-finite.h
@@ -0,0 +1,25 @@
+/* Entry points to finite-math-only compiler runs.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _MATH_H
+# error "Never use <bits/math-finite.h> directly; include <math.h> instead."
+#endif
+
+/* Nothing can be done for IA-64 since the math functions differ in their
+ structure. */
diff --git a/libc/sysdeps/ieee754/dbl-64/dla.h b/libc/sysdeps/ieee754/dbl-64/dla.h
index bf73fa902..cb12dbc8f 100644
--- a/libc/sysdeps/ieee754/dbl-64/dla.h
+++ b/libc/sysdeps/ieee754/dbl-64/dla.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2011 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -44,7 +44,7 @@
/* z+zz = x+y exactly. */
#define EADD(x,y,z,zz) \
- z=(x)+(y); zz=(ABS(x)>ABS(y)) ? (((x)-(z))+(y)) : (((y)-(z))+(x));
+ z=(x)+(y); zz=(ABS(x)>ABS(y)) ? (((x)-(z))+(y)) : (((y)-(z))+(x));
/* Exact subtraction of two single-length floating point numbers, Dekker. */
@@ -52,7 +52,7 @@
/* z+zz = x-y exactly. */
#define ESUB(x,y,z,zz) \
- z=(x)-(y); zz=(ABS(x)>ABS(y)) ? (((x)-(z))-(y)) : ((x)-((y)+(z)));
+ z=(x)-(y); zz=(ABS(x)>ABS(y)) ? (((x)-(z))-(y)) : ((x)-((y)+(z)));
/* Exact multiplication of two single-length floating point numbers, */
@@ -60,10 +60,15 @@
/* satisfies z+zz = x*y exactly. p,hx,tx,hy,ty are temporary */
/* storage variables of type double. */
-#define EMULV(x,y,z,zz,p,hx,tx,hy,ty) \
- p=CN*(x); hx=((x)-p)+p; tx=(x)-hx; \
- p=CN*(y); hy=((y)-p)+p; ty=(y)-hy; \
- z=(x)*(y); zz=(((hx*hy-z)+hx*ty)+tx*hy)+tx*ty;
+#ifdef DLA_FMS
+# define EMULV(x,y,z,zz,p,hx,tx,hy,ty) \
+ z=x*y; zz=DLA_FMS(x,y,z);
+#else
+# define EMULV(x,y,z,zz,p,hx,tx,hy,ty) \
+ p=CN*(x); hx=((x)-p)+p; tx=(x)-hx; \
+ p=CN*(y); hy=((y)-p)+p; ty=(y)-hy; \
+ z=(x)*(y); zz=(((hx*hy-z)+hx*ty)+tx*hy)+tx*ty;
+#endif
/* Exact multiplication of two single-length floating point numbers, Dekker. */
@@ -71,10 +76,15 @@
/* that satisfies z+zz = x*y exactly. p,hx,tx,hy,ty,q are temporary */
/* storage variables of type double. */
-#define MUL12(x,y,z,zz,p,hx,tx,hy,ty,q) \
- p=CN*(x); hx=((x)-p)+p; tx=(x)-hx; \
- p=CN*(y); hy=((y)-p)+p; ty=(y)-hy; \
- p=hx*hy; q=hx*ty+tx*hy; z=p+q; zz=((p-z)+q)+tx*ty;
+#ifdef DLA_FMS
+# define MUL12(x,y,z,zz,p,hx,tx,hy,ty,q) \
+ EMULV(x,y,z,zz,p,hx,tx,hy,ty)
+#else
+# define MUL12(x,y,z,zz,p,hx,tx,hy,ty,q) \
+ p=CN*(x); hx=((x)-p)+p; tx=(x)-hx; \
+ p=CN*(y); hy=((y)-p)+p; ty=(y)-hy; \
+ p=hx*hy; q=hx*ty+tx*hy; z=p+q; zz=((p-z)+q)+tx*ty;
+#endif
/* Double-length addition, Dekker. The macro produces a double-length */
@@ -84,10 +94,10 @@
/* storage variables of type double. */
#define ADD2(x,xx,y,yy,z,zz,r,s) \
- r=(x)+(y); s=(ABS(x)>ABS(y)) ? \
- (((((x)-r)+(y))+(yy))+(xx)) : \
- (((((y)-r)+(x))+(xx))+(yy)); \
- z=r+s; zz=(r-z)+s;
+ r=(x)+(y); s=(ABS(x)>ABS(y)) ? \
+ (((((x)-r)+(y))+(yy))+(xx)) : \
+ (((((y)-r)+(x))+(xx))+(yy)); \
+ z=r+s; zz=(r-z)+s;
/* Double-length subtraction, Dekker. The macro produces a double-length */
@@ -97,10 +107,10 @@
/* storage variables of type double. */
#define SUB2(x,xx,y,yy,z,zz,r,s) \
- r=(x)-(y); s=(ABS(x)>ABS(y)) ? \
- (((((x)-r)-(y))-(yy))+(xx)) : \
- ((((x)-((y)+r))+(xx))-(yy)); \
- z=r+s; zz=(r-z)+s;
+ r=(x)-(y); s=(ABS(x)>ABS(y)) ? \
+ (((((x)-r)-(y))-(yy))+(xx)) : \
+ ((((x)-((y)+r))+(xx))-(yy)); \
+ z=r+s; zz=(r-z)+s;
/* Double-length multiplication, Dekker. The macro produces a double-length */
@@ -110,8 +120,8 @@
/* temporary storage variables of type double. */
#define MUL2(x,xx,y,yy,z,zz,p,hx,tx,hy,ty,q,c,cc) \
- MUL12(x,y,c,cc,p,hx,tx,hy,ty,q) \
- cc=((x)*(yy)+(xx)*(y))+cc; z=c+cc; zz=(c-z)+cc;
+ MUL12(x,y,c,cc,p,hx,tx,hy,ty,q) \
+ cc=((x)*(yy)+(xx)*(y))+cc; z=c+cc; zz=(c-z)+cc;
/* Double-length division, Dekker. The macro produces a double-length */
@@ -121,8 +131,8 @@
/* are temporary storage variables of type double. */
#define DIV2(x,xx,y,yy,z,zz,p,hx,tx,hy,ty,q,c,cc,u,uu) \
- c=(x)/(y); MUL12(c,y,u,uu,p,hx,tx,hy,ty,q) \
- cc=(((((x)-u)-uu)+(xx))-c*(yy))/(y); z=c+cc; zz=(c-z)+cc;
+ c=(x)/(y); MUL12(c,y,u,uu,p,hx,tx,hy,ty,q) \
+ cc=(((((x)-u)-uu)+(xx))-c*(yy))/(y); z=c+cc; zz=(c-z)+cc;
/* Double-length addition, slower but more accurate than ADD2. */
@@ -133,17 +143,17 @@
/* are temporary storage variables of type double. */
#define ADD2A(x,xx,y,yy,z,zz,r,rr,s,ss,u,uu,w) \
- r=(x)+(y); \
- if (ABS(x)>ABS(y)) { rr=((x)-r)+(y); s=(rr+(yy))+(xx); } \
- else { rr=((y)-r)+(x); s=(rr+(xx))+(yy); } \
- if (rr!=0.0) { \
- z=r+s; zz=(r-z)+s; } \
- else { \
- ss=(ABS(xx)>ABS(yy)) ? (((xx)-s)+(yy)) : (((yy)-s)+(xx)); \
- u=r+s; \
- uu=(ABS(r)>ABS(s)) ? ((r-u)+s) : ((s-u)+r) ; \
- w=uu+ss; z=u+w; \
- zz=(ABS(u)>ABS(w)) ? ((u-z)+w) : ((w-z)+u) ; }
+ r=(x)+(y); \
+ if (ABS(x)>ABS(y)) { rr=((x)-r)+(y); s=(rr+(yy))+(xx); } \
+ else { rr=((y)-r)+(x); s=(rr+(xx))+(yy); } \
+ if (rr!=0.0) { \
+ z=r+s; zz=(r-z)+s; } \
+ else { \
+ ss=(ABS(xx)>ABS(yy)) ? (((xx)-s)+(yy)) : (((yy)-s)+(xx)); \
+ u=r+s; \
+ uu=(ABS(r)>ABS(s)) ? ((r-u)+s) : ((s-u)+r) ; \
+ w=uu+ss; z=u+w; \
+ zz=(ABS(u)>ABS(w)) ? ((u-z)+w) : ((w-z)+u) ; }
/* Double-length subtraction, slower but more accurate than SUB2. */
@@ -154,21 +164,14 @@
/* are temporary storage variables of type double. */
#define SUB2A(x,xx,y,yy,z,zz,r,rr,s,ss,u,uu,w) \
- r=(x)-(y); \
- if (ABS(x)>ABS(y)) { rr=((x)-r)-(y); s=(rr-(yy))+(xx); } \
- else { rr=(x)-((y)+r); s=(rr+(xx))-(yy); } \
- if (rr!=0.0) { \
- z=r+s; zz=(r-z)+s; } \
- else { \
- ss=(ABS(xx)>ABS(yy)) ? (((xx)-s)-(yy)) : ((xx)-((yy)+s)); \
- u=r+s; \
- uu=(ABS(r)>ABS(s)) ? ((r-u)+s) : ((s-u)+r) ; \
- w=uu+ss; z=u+w; \
- zz=(ABS(u)>ABS(w)) ? ((u-z)+w) : ((w-z)+u) ; }
-
-
-
-
-
-
-
+ r=(x)-(y); \
+ if (ABS(x)>ABS(y)) { rr=((x)-r)-(y); s=(rr-(yy))+(xx); } \
+ else { rr=(x)-((y)+r); s=(rr+(xx))-(yy); } \
+ if (rr!=0.0) { \
+ z=r+s; zz=(r-z)+s; } \
+ else { \
+ ss=(ABS(xx)>ABS(yy)) ? (((xx)-s)-(yy)) : ((xx)-((yy)+s)); \
+ u=r+s; \
+ uu=(ABS(r)>ABS(s)) ? ((r-u)+s) : ((s-u)+r) ; \
+ w=uu+ss; z=u+w; \
+ zz=(ABS(u)>ABS(w)) ? ((u-z)+w) : ((w-z)+u) ; }
diff --git a/libc/sysdeps/ieee754/dbl-64/doasin.c b/libc/sysdeps/ieee754/dbl-64/doasin.c
index 79f344af2..c21d4b7df 100644
--- a/libc/sysdeps/ieee754/dbl-64/doasin.c
+++ b/libc/sysdeps/ieee754/dbl-64/doasin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -31,7 +31,7 @@
#include "endian.h"
#include "mydefs.h"
-#include "dla.h"
+#include <dla.h>
#include "math_private.h"
/********************************************************************/
@@ -52,7 +52,10 @@ void __doasin(double x, double dx, double v[]) {
d11 = 0.79470250400727425881446981833568758E-02;
double xx,p,pp,u,uu,r,s;
- double hx,tx,hy,ty,tp,tq,tc,tcc;
+ double tc,tcc;
+#ifndef DLA_FMA
+ double hx,tx,hy,ty,tp,tq;
+#endif
/* Taylor series for arcsin for Double-Length numbers */
diff --git a/libc/sysdeps/ieee754/dbl-64/dosincos.c b/libc/sysdeps/ieee754/dbl-64/dosincos.c
index 1d347a4bc..4ae88c31c 100644
--- a/libc/sysdeps/ieee754/dbl-64/dosincos.c
+++ b/libc/sysdeps/ieee754/dbl-64/dosincos.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -36,7 +36,7 @@
#include "endian.h"
#include "mydefs.h"
#include "sincos.tbl"
-#include "dla.h"
+#include <dla.h>
#include "dosincos.h"
#include "math_private.h"
@@ -48,8 +48,11 @@
/***********************************************************************/
void __dubsin(double x, double dx, double v[]) {
- double r,s,p,hx,tx,hy,ty,q,c,cc,d,dd,d2,dd2,e,ee,
+ double r,s,c,cc,d,dd,d2,dd2,e,ee,
sn,ssn,cs,ccs,ds,dss,dc,dcc;
+#ifndef DLA_FMA
+ double p,hx,tx,hy,ty,q;
+#endif
#if 0
double xx,y,yy,z,zz;
#endif
@@ -61,7 +64,7 @@ void __dubsin(double x, double dx, double v[]) {
x=x-(u.x-big.x);
d=x+dx;
dd=(x-d)+dx;
- /* sin(x+dx)=sin(Xi+t)=sin(Xi)*cos(t) + cos(Xi)sin(t) where t ->0 */
+ /* sin(x+dx)=sin(Xi+t)=sin(Xi)*cos(t) + cos(Xi)sin(t) where t ->0 */
MUL2(d,dd,d,dd,d2,dd2,p,hx,tx,hy,ty,q,c,cc);
sn=sincos.x[k]; /* */
ssn=sincos.x[k+1]; /* sin(Xi) and cos(Xi) */
@@ -99,8 +102,11 @@ void __dubsin(double x, double dx, double v[]) {
/**********************************************************************/
void __dubcos(double x, double dx, double v[]) {
- double r,s,p,hx,tx,hy,ty,q,c,cc,d,dd,d2,dd2,e,ee,
+ double r,s,c,cc,d,dd,d2,dd2,e,ee,
sn,ssn,cs,ccs,ds,dss,dc,dcc;
+#ifndef DLA_FMA
+ double p,hx,tx,hy,ty,q;
+#endif
#if 0
double xx,y,yy,z,zz;
#endif
@@ -166,15 +172,15 @@ void __docos(double x, double dx, double v[]) {
if (x>0) {y=x; yy=dx;}
else {y=-x; yy=-dx;}
if (y<0.5*hp0.x) /* y< PI/4 */
- {__dubcos(y,yy,w); v[0]=w[0]; v[1]=w[1];}
+ {__dubcos(y,yy,w); v[0]=w[0]; v[1]=w[1];}
else if (y<1.5*hp0.x) { /* y< 3/4 * PI */
p=hp0.x-y; /* p = PI/2 - y */
yy=hp1.x-yy;
y=p+yy;
yy=(p-y)+yy;
if (y>0) {__dubsin(y,yy,w); v[0]=w[0]; v[1]=w[1];}
- /* cos(x) = sin ( 90 - x ) */
- else {__dubsin(-y,-yy,w); v[0]=-w[0]; v[1]=-w[1];
+ /* cos(x) = sin ( 90 - x ) */
+ else {__dubsin(-y,-yy,w); v[0]=-w[0]; v[1]=-w[1];
}
}
else { /* y>= 3/4 * PI */
diff --git a/libc/sysdeps/ieee754/dbl-64/e_acosh.c b/libc/sysdeps/ieee754/dbl-64/e_acosh.c
index 27c29cd8c..6ef10cb84 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_acosh.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_acosh.c
@@ -5,18 +5,14 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_acosh.c,v 1.9 1995/05/12 04:57:18 jtc Exp $";
-#endif
-
/* __ieee754_acosh(x)
* Method :
- * Based on
+ * Based on
* acosh(x) = log [ x + sqrt(x*x-1) ]
* we have
* acosh(x) := log(x)+ln2, if x is large; else
@@ -31,21 +27,13 @@ static char rcsid[] = "$NetBSD: e_acosh.c,v 1.9 1995/05/12 04:57:18 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
+static const double
one = 1.0,
ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
-#ifdef __STDC__
- double __ieee754_acosh(double x)
-#else
- double __ieee754_acosh(x)
- double x;
-#endif
-{
+double
+__ieee754_acosh(double x)
+{
double t;
int32_t hx;
u_int32_t lx;
@@ -54,8 +42,8 @@ ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
return (x-x)/(x-x);
} else if(hx >=0x41b00000) { /* x > 2**28 */
if(hx >=0x7ff00000) { /* x is inf of NaN */
- return x+x;
- } else
+ return x+x;
+ } else
return __ieee754_log(x)+ln2; /* acosh(huge)=log(2x) */
} else if(((hx-0x3ff00000)|lx)==0) {
return 0.0; /* acosh(1) = 0 */
@@ -64,6 +52,7 @@ ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
return __ieee754_log(2.0*x-one/(x+__ieee754_sqrt(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1p(t+__sqrt(2.0*t+t*t));
+ return __log1p(t+__ieee754_sqrt(2.0*t+t*t));
}
}
+strong_alias (__ieee754_acosh, __acosh_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_asin.c b/libc/sysdeps/ieee754/dbl-64/e_asin.c
index ce5d227b7..02efb7ad2 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_asin.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_asin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -209,9 +209,9 @@ double __ieee754_asin(double x){
else xx = -x - asncs.x[n];
t = asncs.x[n+1]*xx;
p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
- xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+ xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+
- xx*asncs.x[n+9])))))))+asncs.x[n+10];
+ xx*asncs.x[n+9])))))))+asncs.x[n+10];
t+=p;
res =asncs.x[n+11] +t;
cor = (asncs.x[n+11]-res)+t;
@@ -248,9 +248,9 @@ double __ieee754_asin(double x){
else xx = -x - asncs.x[n];
t = asncs.x[n+1]*xx;
p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
- xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+ xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+
- xx*(asncs.x[n+9]+xx*asncs.x[n+10]))))))))+asncs.x[n+11];
+ xx*(asncs.x[n+9]+xx*asncs.x[n+10]))))))))+asncs.x[n+11];
t+=p;
res =asncs.x[n+12] +t;
cor = (asncs.x[n+12]-res)+t;
@@ -324,6 +324,7 @@ double __ieee754_asin(double x){
return u.x/v.x; /* NaN */
}
}
+strong_alias (__ieee754_asin, __asin_finite)
/*******************************************************************/
/* */
@@ -397,7 +398,7 @@ double __ieee754_acos(double x)
else xx = -x - asncs.x[n];
t = asncs.x[n+1]*xx;
p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
- xx*(asncs.x[n+5]+xx*asncs.x[n+6]))))+asncs.x[n+7];
+ xx*(asncs.x[n+5]+xx*asncs.x[n+6]))))+asncs.x[n+7];
t+=p;
y = (m>0)?(hp0.x-asncs.x[n+8]):(hp0.x+asncs.x[n+8]);
t = (m>0)?(hp1.x-t):(hp1.x+t);
@@ -433,8 +434,8 @@ double __ieee754_acos(double x)
else {xx = -x - asncs.x[n]; eps=1.02; }
t = asncs.x[n+1]*xx;
p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
- xx*(asncs.x[n+5]+xx*(asncs.x[n+6]+
- xx*asncs.x[n+7])))))+asncs.x[n+8];
+ xx*(asncs.x[n+5]+xx*(asncs.x[n+6]+
+ xx*asncs.x[n+7])))))+asncs.x[n+8];
t+=p;
y = (m>0)?(hp0.x-asncs.x[n+9]):(hp0.x+asncs.x[n+9]);
t = (m>0)?(hp1.x-t):(hp1.x+t);
@@ -468,8 +469,8 @@ double __ieee754_acos(double x)
else {xx = -x - asncs.x[n]; eps = 1.01; }
t = asncs.x[n+1]*xx;
p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
- xx*(asncs.x[n+5]+xx*(asncs.x[n+6]+xx*(asncs.x[n+7]+
- xx*asncs.x[n+8]))))))+asncs.x[n+9];
+ xx*(asncs.x[n+5]+xx*(asncs.x[n+6]+xx*(asncs.x[n+7]+
+ xx*asncs.x[n+8]))))))+asncs.x[n+9];
t+=p;
y = (m>0)?(hp0.x-asncs.x[n+10]):(hp0.x+asncs.x[n+10]);
t = (m>0)?(hp1.x-t):(hp1.x+t);
@@ -503,9 +504,9 @@ double __ieee754_acos(double x)
else {xx = -x - asncs.x[n]; eps =1.005; }
t = asncs.x[n+1]*xx;
p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
- xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+ xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+
- xx*asncs.x[n+9])))))))+asncs.x[n+10];
+ xx*asncs.x[n+9])))))))+asncs.x[n+10];
t+=p;
y = (m>0)?(hp0.x-asncs.x[n+11]):(hp0.x+asncs.x[n+11]);
t = (m>0)?(hp1.x-t):(hp1.x+t);
@@ -539,9 +540,9 @@ double __ieee754_acos(double x)
else {xx = -x - asncs.x[n]; eps=1.005;}
t = asncs.x[n+1]*xx;
p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
- xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+ xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
+xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+xx*(asncs.x[n+9]+
- xx*asncs.x[n+10]))))))))+asncs.x[n+11];
+ xx*asncs.x[n+10]))))))))+asncs.x[n+11];
t+=p;
y = (m>0)?(hp0.x-asncs.x[n+12]):(hp0.x+asncs.x[n+12]);
t = (m>0)?(hp1.x-t):(hp1.x+t);
@@ -635,3 +636,4 @@ double __ieee754_acos(double x)
return u.x/v.x;
}
}
+strong_alias (__ieee754_acos, __acos_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_atan2.c b/libc/sysdeps/ieee754/dbl-64/e_atan2.c
index 9e1a794ec..f8f678bc5 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_atan2.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_atan2.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -37,7 +37,7 @@
/* */
/************************************************************************/
-#include "dla.h"
+#include <dla.h>
#include "mpa.h"
#include "MathLib.h"
#include "uatan.tbl"
@@ -62,8 +62,11 @@ double __ieee754_atan2(double y,double x) {
int p;
#endif
static const int pr[MM]={6,8,10,20,32};
- double ax,ay,u,du,u9,ua,v,vv,dv,t1,t2,t3,t4,t5,t6,t7,t8,
- z,zz,cor,s1,ss1,s2,ss2;
+ double ax,ay,u,du,u9,ua,v,vv,dv,t1,t2,t3,t7,t8,
+ z,zz,cor,s1,ss1,s2,ss2;
+#ifndef DLA_FMA
+ double t4,t5,t6;
+#endif
#if 0
double z1,z2;
#endif
@@ -73,7 +76,7 @@ double __ieee754_atan2(double y,double x) {
#endif
static const int ep= 59768832, /* 57*16**5 */
- em=-59768832; /* -57*16**5 */
+ em=-59768832; /* -57*16**5 */
/* x=NaN or y=NaN */
num.d = x; ux = num.i[HIGH_HALF]; dx = num.i[LOW_HALF];
@@ -102,23 +105,23 @@ double __ieee754_atan2(double y,double x) {
if (ux==0x7ff00000) {
if (dx==0x00000000) {
if (uy==0x7ff00000) {
- if (dy==0x00000000) return qpi.d; }
+ if (dy==0x00000000) return qpi.d; }
else if (uy==0xfff00000) {
- if (dy==0x00000000) return mqpi.d; }
+ if (dy==0x00000000) return mqpi.d; }
else {
- if ((uy&0x80000000)==0x00000000) return ZERO;
- else return MZERO; }
+ if ((uy&0x80000000)==0x00000000) return ZERO;
+ else return MZERO; }
}
}
else if (ux==0xfff00000) {
if (dx==0x00000000) {
if (uy==0x7ff00000) {
- if (dy==0x00000000) return tqpi.d; }
+ if (dy==0x00000000) return tqpi.d; }
else if (uy==0xfff00000) {
- if (dy==0x00000000) return mtqpi.d; }
+ if (dy==0x00000000) return mtqpi.d; }
else {
- if ((uy&0x80000000)==0x00000000) return opi.d;
- else return mopi.d; }
+ if ((uy&0x80000000)==0x00000000) return opi.d;
+ else return mopi.d; }
}
}
@@ -156,108 +159,108 @@ double __ieee754_atan2(double y,double x) {
/* (i) x>0, abs(y)< abs(x): atan(ay/ax) */
if (ay<ax) {
if (u<inv16.d) {
- v=u*u; zz=du+u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
- if ((z=u+(zz-u1.d*u)) == u+(zz+u1.d*u)) return signArctan2(y,z);
+ v=u*u; zz=du+u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
+ if ((z=u+(zz-u1.d*u)) == u+(zz+u1.d*u)) return signArctan2(y,z);
- MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
- s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
- ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
- if ((z=s1+(ss1-u5.d*s1)) == s1+(ss1+u5.d*s1)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
+ s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
+ ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
+ if ((z=s1+(ss1-u5.d*s1)) == s1+(ss1+u5.d*s1)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
else {
- i=(TWO52+TWO8*u)-TWO52; i-=16;
- t3=u-cij[i][0].d;
- EADD(t3,du,v,dv)
- t1=cij[i][1].d; t2=cij[i][2].d;
- zz=v*t2+(dv*t2+v*v*(cij[i][3].d+v*(cij[i][4].d+
- v*(cij[i][5].d+v* cij[i][6].d))));
- if (i<112) {
- if (i<48) u9=u91.d; /* u < 1/4 */
- else u9=u92.d; } /* 1/4 <= u < 1/2 */
- else {
- if (i<176) u9=u93.d; /* 1/2 <= u < 3/4 */
- else u9=u94.d; } /* 3/4 <= u <= 1 */
- if ((z=t1+(zz-u9*t1)) == t1+(zz+u9*t1)) return signArctan2(y,z);
+ i=(TWO52+TWO8*u)-TWO52; i-=16;
+ t3=u-cij[i][0].d;
+ EADD(t3,du,v,dv)
+ t1=cij[i][1].d; t2=cij[i][2].d;
+ zz=v*t2+(dv*t2+v*v*(cij[i][3].d+v*(cij[i][4].d+
+ v*(cij[i][5].d+v* cij[i][6].d))));
+ if (i<112) {
+ if (i<48) u9=u91.d; /* u < 1/4 */
+ else u9=u92.d; } /* 1/4 <= u < 1/2 */
+ else {
+ if (i<176) u9=u93.d; /* 1/2 <= u < 3/4 */
+ else u9=u94.d; } /* 3/4 <= u <= 1 */
+ if ((z=t1+(zz-u9*t1)) == t1+(zz+u9*t1)) return signArctan2(y,z);
- t1=u-hij[i][0].d;
- EADD(t1,du,v,vv)
- s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
- v*(hij[i][14].d+v* hij[i][15].d))));
- ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
- if ((z=s2+(ss2-ub.d*s2)) == s2+(ss2+ub.d*s2)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ t1=u-hij[i][0].d;
+ EADD(t1,du,v,vv)
+ s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
+ v*(hij[i][14].d+v* hij[i][15].d))));
+ ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
+ if ((z=s2+(ss2-ub.d*s2)) == s2+(ss2+ub.d*s2)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
}
/* (ii) x>0, abs(x)<=abs(y): pi/2-atan(ax/ay) */
else {
if (u<inv16.d) {
- v=u*u;
- zz=u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
- ESUB(hpi.d,u,t2,cor)
- t3=((hpi1.d+cor)-du)-zz;
- if ((z=t2+(t3-u2.d)) == t2+(t3+u2.d)) return signArctan2(y,z);
+ v=u*u;
+ zz=u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
+ ESUB(hpi.d,u,t2,cor)
+ t3=((hpi1.d+cor)-du)-zz;
+ if ((z=t2+(t3-u2.d)) == t2+(t3+u2.d)) return signArctan2(y,z);
- MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
- s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
- ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
- SUB2(hpi.d,hpi1.d,s1,ss1,s2,ss2,t1,t2)
- if ((z=s2+(ss2-u6.d)) == s2+(ss2+u6.d)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
+ s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
+ ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
+ SUB2(hpi.d,hpi1.d,s1,ss1,s2,ss2,t1,t2)
+ if ((z=s2+(ss2-u6.d)) == s2+(ss2+u6.d)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
else {
- i=(TWO52+TWO8*u)-TWO52; i-=16;
- v=(u-cij[i][0].d)+du;
- zz=hpi1.d-v*(cij[i][2].d+v*(cij[i][3].d+v*(cij[i][4].d+
- v*(cij[i][5].d+v* cij[i][6].d))));
- t1=hpi.d-cij[i][1].d;
- if (i<112) ua=ua1.d; /* w < 1/2 */
- else ua=ua2.d; /* w >= 1/2 */
- if ((z=t1+(zz-ua)) == t1+(zz+ua)) return signArctan2(y,z);
+ i=(TWO52+TWO8*u)-TWO52; i-=16;
+ v=(u-cij[i][0].d)+du;
+ zz=hpi1.d-v*(cij[i][2].d+v*(cij[i][3].d+v*(cij[i][4].d+
+ v*(cij[i][5].d+v* cij[i][6].d))));
+ t1=hpi.d-cij[i][1].d;
+ if (i<112) ua=ua1.d; /* w < 1/2 */
+ else ua=ua2.d; /* w >= 1/2 */
+ if ((z=t1+(zz-ua)) == t1+(zz+ua)) return signArctan2(y,z);
- t1=u-hij[i][0].d;
- EADD(t1,du,v,vv)
- s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
- v*(hij[i][14].d+v* hij[i][15].d))));
- ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
- SUB2(hpi.d,hpi1.d,s2,ss2,s1,ss1,t1,t2)
- if ((z=s1+(ss1-uc.d)) == s1+(ss1+uc.d)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ t1=u-hij[i][0].d;
+ EADD(t1,du,v,vv)
+ s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
+ v*(hij[i][14].d+v* hij[i][15].d))));
+ ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
+ SUB2(hpi.d,hpi1.d,s2,ss2,s1,ss1,t1,t2)
+ if ((z=s1+(ss1-uc.d)) == s1+(ss1+uc.d)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
}
}
@@ -266,112 +269,114 @@ double __ieee754_atan2(double y,double x) {
/* (iii) x<0, abs(x)< abs(y): pi/2+atan(ax/ay) */
if (ax<ay) {
if (u<inv16.d) {
- v=u*u;
- zz=u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
- EADD(hpi.d,u,t2,cor)
- t3=((hpi1.d+cor)+du)+zz;
- if ((z=t2+(t3-u3.d)) == t2+(t3+u3.d)) return signArctan2(y,z);
+ v=u*u;
+ zz=u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
+ EADD(hpi.d,u,t2,cor)
+ t3=((hpi1.d+cor)+du)+zz;
+ if ((z=t2+(t3-u3.d)) == t2+(t3+u3.d)) return signArctan2(y,z);
- MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
- s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
- ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
- ADD2(hpi.d,hpi1.d,s1,ss1,s2,ss2,t1,t2)
- if ((z=s2+(ss2-u7.d)) == s2+(ss2+u7.d)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
+ s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
+ ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
+ ADD2(hpi.d,hpi1.d,s1,ss1,s2,ss2,t1,t2)
+ if ((z=s2+(ss2-u7.d)) == s2+(ss2+u7.d)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
else {
- i=(TWO52+TWO8*u)-TWO52; i-=16;
- v=(u-cij[i][0].d)+du;
- zz=hpi1.d+v*(cij[i][2].d+v*(cij[i][3].d+v*(cij[i][4].d+
- v*(cij[i][5].d+v* cij[i][6].d))));
- t1=hpi.d+cij[i][1].d;
- if (i<112) ua=ua1.d; /* w < 1/2 */
- else ua=ua2.d; /* w >= 1/2 */
- if ((z=t1+(zz-ua)) == t1+(zz+ua)) return signArctan2(y,z);
+ i=(TWO52+TWO8*u)-TWO52; i-=16;
+ v=(u-cij[i][0].d)+du;
+ zz=hpi1.d+v*(cij[i][2].d+v*(cij[i][3].d+v*(cij[i][4].d+
+ v*(cij[i][5].d+v* cij[i][6].d))));
+ t1=hpi.d+cij[i][1].d;
+ if (i<112) ua=ua1.d; /* w < 1/2 */
+ else ua=ua2.d; /* w >= 1/2 */
+ if ((z=t1+(zz-ua)) == t1+(zz+ua)) return signArctan2(y,z);
- t1=u-hij[i][0].d;
- EADD(t1,du,v,vv)
- s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
- v*(hij[i][14].d+v* hij[i][15].d))));
- ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
- ADD2(hpi.d,hpi1.d,s2,ss2,s1,ss1,t1,t2)
- if ((z=s1+(ss1-uc.d)) == s1+(ss1+uc.d)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ t1=u-hij[i][0].d;
+ EADD(t1,du,v,vv)
+ s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
+ v*(hij[i][14].d+v* hij[i][15].d))));
+ ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
+ ADD2(hpi.d,hpi1.d,s2,ss2,s1,ss1,t1,t2)
+ if ((z=s1+(ss1-uc.d)) == s1+(ss1+uc.d)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
}
/* (iv) x<0, abs(y)<=abs(x): pi-atan(ax/ay) */
else {
if (u<inv16.d) {
- v=u*u;
- zz=u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
- ESUB(opi.d,u,t2,cor)
- t3=((opi1.d+cor)-du)-zz;
- if ((z=t2+(t3-u4.d)) == t2+(t3+u4.d)) return signArctan2(y,z);
+ v=u*u;
+ zz=u*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
+ ESUB(opi.d,u,t2,cor)
+ t3=((opi1.d+cor)-du)-zz;
+ if ((z=t2+(t3-u4.d)) == t2+(t3+u4.d)) return signArctan2(y,z);
- MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
- s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
- ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
- SUB2(opi.d,opi1.d,s1,ss1,s2,ss2,t1,t2)
- if ((z=s2+(ss2-u8.d)) == s2+(ss2+u8.d)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ MUL2(u,du,u,du,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
+ s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
+ ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ MUL2(u,du,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(u,du,s2,ss2,s1,ss1,t1,t2)
+ SUB2(opi.d,opi1.d,s1,ss1,s2,ss2,t1,t2)
+ if ((z=s2+(ss2-u8.d)) == s2+(ss2+u8.d)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
else {
- i=(TWO52+TWO8*u)-TWO52; i-=16;
- v=(u-cij[i][0].d)+du;
- zz=opi1.d-v*(cij[i][2].d+v*(cij[i][3].d+v*(cij[i][4].d+
- v*(cij[i][5].d+v* cij[i][6].d))));
- t1=opi.d-cij[i][1].d;
- if (i<112) ua=ua1.d; /* w < 1/2 */
- else ua=ua2.d; /* w >= 1/2 */
- if ((z=t1+(zz-ua)) == t1+(zz+ua)) return signArctan2(y,z);
+ i=(TWO52+TWO8*u)-TWO52; i-=16;
+ v=(u-cij[i][0].d)+du;
+ zz=opi1.d-v*(cij[i][2].d+v*(cij[i][3].d+v*(cij[i][4].d+
+ v*(cij[i][5].d+v* cij[i][6].d))));
+ t1=opi.d-cij[i][1].d;
+ if (i<112) ua=ua1.d; /* w < 1/2 */
+ else ua=ua2.d; /* w >= 1/2 */
+ if ((z=t1+(zz-ua)) == t1+(zz+ua)) return signArctan2(y,z);
- t1=u-hij[i][0].d;
- EADD(t1,du,v,vv)
- s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
- v*(hij[i][14].d+v* hij[i][15].d))));
- ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
- SUB2(opi.d,opi1.d,s2,ss2,s1,ss1,t1,t2)
- if ((z=s1+(ss1-uc.d)) == s1+(ss1+uc.d)) return signArctan2(y,z);
- return atan2Mp(x,y,pr);
+ t1=u-hij[i][0].d;
+ EADD(t1,du,v,vv)
+ s1=v*(hij[i][11].d+v*(hij[i][12].d+v*(hij[i][13].d+
+ v*(hij[i][14].d+v* hij[i][15].d))));
+ ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][5].d,hij[i][6].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][3].d,hij[i][4].d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(hij[i][1].d,hij[i][2].d,s1,ss1,s2,ss2,t1,t2)
+ SUB2(opi.d,opi1.d,s2,ss2,s1,ss1,t1,t2)
+ if ((z=s1+(ss1-uc.d)) == s1+(ss1+uc.d)) return signArctan2(y,z);
+ return atan2Mp(x,y,pr);
}
}
}
}
+strong_alias (__ieee754_atan2, __atan2_finite)
+
/* Treat the Denormalized case */
static double normalized(double ax,double ay,double y, double z)
{ int p;
diff --git a/libc/sysdeps/ieee754/dbl-64/e_atanh.c b/libc/sysdeps/ieee754/dbl-64/e_atanh.c
index fa4fe675c..de3bc8f14 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_atanh.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_atanh.c
@@ -1,74 +1,70 @@
-/* @(#)e_atanh.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $";
-#endif
/* __ieee754_atanh(x)
- * Method :
- * 1.Reduced x to positive by atanh(-x) = -atanh(x)
- * 2.For x>=0.5
- * 1 2x x
- * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
- * 2 1 - x 1 - x
- *
- * For x<0.5
- * atanh(x) = 0.5*log1p(2x+2x*x/(1-x))
- *
- * Special cases:
- * atanh(x) is NaN if |x| > 1 with signal;
- * atanh(NaN) is that NaN with no signal;
- * atanh(+-1) is +-INF with signal.
- *
+ Method :
+ 1.Reduced x to positive by atanh(-x) = -atanh(x)
+ 2.For x>=0.5
+ 1 2x x
+ atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
+ 2 1 - x 1 - x
+
+ For x<0.5
+ atanh(x) = 0.5*log1p(2x+2x*x/(1-x))
+
+ Special cases:
+ atanh(x) is NaN if |x| > 1 with signal;
+ atanh(NaN) is that NaN with no signal;
+ atanh(+-1) is +-INF with signal.
+
*/
+#include <inttypes.h>
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
-static const double one = 1.0, huge = 1e300;
-#else
-static double one = 1.0, huge = 1e300;
-#endif
-
-#ifdef __STDC__
-static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
+static const double huge = 1e300;
-#ifdef __STDC__
- double __ieee754_atanh(double x)
-#else
- double __ieee754_atanh(x)
- double x;
-#endif
+double
+__ieee754_atanh (double x)
{
- double t;
- int32_t hx,ix;
- u_int32_t lx;
- EXTRACT_WORDS(hx,lx,x);
- ix = hx&0x7fffffff;
- if ((ix|((lx|(-lx))>>31))>0x3ff00000) /* |x|>1 */
- return (x-x)/(x-x);
- if(ix==0x3ff00000)
- return x/zero;
- if(ix<0x3e300000&&(huge+x)>zero) return x; /* x<2**-28 */
- SET_HIGH_WORD(x,ix);
- if(ix<0x3fe00000) { /* x < 0.5 */
- t = x+x;
- t = 0.5*__log1p(t+t*x/(one-x));
- } else
- t = 0.5*__log1p((x+x)/(one-x));
- if(hx>=0) return t; else return -t;
+ double xa = fabs (x);
+ double t;
+ if (xa < 0.5)
+ {
+ if (__builtin_expect (xa < 0x1.0p-28, 0) && (huge + x) > 0.0)
+ return x;
+
+ t = xa + xa;
+ t = 0.5 * __log1p (t + t * xa / (1.0 - xa));
+ }
+ else if (__builtin_expect (xa < 1.0, 1))
+ t = 0.5 * __log1p ((xa + xa) / (1.0 - xa));
+ else
+ {
+ if (xa > 1.0)
+ return (x - x) / (x - x);
+
+ return x / 0.0;
+ }
+
+ return __copysign (t, x);
}
+strong_alias (__ieee754_atanh, __atanh_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_cosh.c b/libc/sysdeps/ieee754/dbl-64/e_cosh.c
index 65106b998..b9f79e47a 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_cosh.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_cosh.c
@@ -1,32 +1,28 @@
-/* @(#)e_cosh.c 5.1 93/09/24 */
+/* Optimized by Ulrich Drepper <drepper@gmail.com>, 2011 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $";
-#endif
-
/* __ieee754_cosh(x)
- * Method :
+ * Method :
* mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2
- * 1. Replace x by |x| (cosh(x) = cosh(-x)).
- * 2.
- * [ exp(x) - 1 ]^2
+ * 1. Replace x by |x| (cosh(x) = cosh(-x)).
+ * 2.
+ * [ exp(x) - 1 ]^2
* 0 <= x <= ln2/2 : cosh(x) := 1 + -------------------
- * 2*exp(x)
+ * 2*exp(x)
*
- * exp(x) + 1/exp(x)
+ * exp(x) + 1/exp(x)
* ln2/2 <= x <= 22 : cosh(x) := -------------------
- * 2
- * 22 <= x <= lnovft : cosh(x) := exp(x)/2
+ * 2
+ * 22 <= x <= lnovft : cosh(x) := exp(x)/2
* lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2)
* ln2ovft < x : cosh(x) := huge*huge (overflow)
*
@@ -38,19 +34,11 @@ static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double one = 1.0, half=0.5, huge = 1.0e300;
-#else
-static double one = 1.0, half=0.5, huge = 1.0e300;
-#endif
-#ifdef __STDC__
- double __ieee754_cosh(double x)
-#else
- double __ieee754_cosh(x)
- double x;
-#endif
-{
+double
+__ieee754_cosh (double x)
+{
double t,w;
int32_t ix;
u_int32_t lx;
@@ -59,19 +47,17 @@ static double one = 1.0, half=0.5, huge = 1.0e300;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
- /* x is INF or NaN */
- if(ix>=0x7ff00000) return x*x;
-
- /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */
- if(ix<0x3fd62e43) {
- t = __expm1(fabs(x));
- w = one+t;
- if (ix<0x3c800000) return w; /* cosh(tiny) = 1 */
- return one+(t*t)/(w+w);
- }
-
- /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
+ /* |x| in [0,22] */
if (ix < 0x40360000) {
+ /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */
+ if(ix<0x3fd62e43) {
+ t = __expm1(fabs(x));
+ w = one+t;
+ if (ix<0x3c800000) return w; /* cosh(tiny) = 1 */
+ return one+(t*t)/(w+w);
+ }
+
+ /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
t = __ieee754_exp(fabs(x));
return half*t+half/t;
}
@@ -87,6 +73,10 @@ static double one = 1.0, half=0.5, huge = 1.0e300;
return t*w;
}
+ /* x is INF or NaN */
+ if(ix>=0x7ff00000) return x*x;
+
/* |x| > overflowthresold, cosh(x) overflow */
return huge*huge;
}
+strong_alias (__ieee754_cosh, __cosh_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_exp.c b/libc/sysdeps/ieee754/dbl-64/e_exp.c
index 717469e25..f4b34a636 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_exp.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_exp.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -145,6 +145,7 @@ double __ieee754_exp(double x) {
else return __slowexp(x);
}
}
+strong_alias (__ieee754_exp, __exp_finite)
/************************************************************************/
/* Compute e^(x+xx)(Double-Length number) .The routine also receive */
diff --git a/libc/sysdeps/ieee754/dbl-64/e_exp2.c b/libc/sysdeps/ieee754/dbl-64/e_exp2.c
index ce6368be4..0b7330aac 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_exp2.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_exp2.c
@@ -1,5 +1,6 @@
/* Double-precision floating point 2^x.
- Copyright (C) 1997,1998,2000,2001,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,2000,2001,2005,2006,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -24,9 +25,6 @@
17 (1), March 1991, pp. 26-45.
It has been slightly modified to compute 2^x instead of e^x.
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include <stdlib.h>
#include <float.h>
#include <ieee754.h>
@@ -37,13 +35,8 @@
#include "t_exp2.h"
-/* XXX I know the assembler generates a warning about incorrect section
- attributes. But without the attribute here the compiler places the
- constants in the .data section. Ideally the constant is placed in
- .rodata.cst8 so that it can be merged, but gcc sucks, it ICEs when
- we try to force this section on it. --drepper */
-static const volatile double TWO1023 = 8.988465674311579539e+307;
-static const volatile double TWOM1000 = 9.3326361850321887899e-302;
+static const double TWO1023 = 8.988465674311579539e+307;
+static const double TWOM1000 = 9.3326361850321887899e-302;
double
__ieee754_exp2 (double x)
@@ -52,19 +45,26 @@ __ieee754_exp2 (double x)
static const double lomark = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
/* Check for usual case. */
- if (isless (x, himark) && isgreaterequal (x, lomark))
+ if (__builtin_expect (isless (x, himark), 1))
{
+ /* Exceptional cases: */
+ if (__builtin_expect (! isgreaterequal (x, lomark), 0))
+ {
+ if (__isinf (x))
+ /* e^-inf == 0, with no error. */
+ return 0;
+ else
+ /* Underflow */
+ return TWOM1000 * TWOM1000;
+ }
+
static const double THREEp42 = 13194139533312.0;
int tval, unsafe;
double rx, x22, result;
union ieee754_double ex2_u, scale_u;
fenv_t oldenv;
- feholdexcept (&oldenv);
-#ifdef FE_TONEAREST
- /* If we don't have this, it's too bad. */
- fesetround (FE_TONEAREST);
-#endif
+ libc_feholdexcept_setround (&oldenv, FE_TONEAREST);
/* 1. Argument reduction.
Choose integers ex, -256 <= t < 256, and some real
@@ -108,9 +108,10 @@ __ieee754_exp2 (double x)
* x + .055504110254308625)
* x + .240226506959100583)
* x + .69314718055994495) * ex2_u.d;
+ math_opt_barrier (x22);
/* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
- fesetenv (&oldenv);
+ libc_fesetenv (&oldenv);
result = x22 * x + ex2_u.d;
@@ -119,17 +120,8 @@ __ieee754_exp2 (double x)
else
return result * scale_u.d;
}
- /* Exceptional cases: */
- else if (isless (x, himark))
- {
- if (__isinf (x))
- /* e^-inf == 0, with no error. */
- return 0;
- else
- /* Underflow */
- return TWOM1000 * TWOM1000;
- }
else
/* Return x, if x is a NaN or Inf; or overflow, otherwise. */
return TWO1023*x;
}
+strong_alias (__ieee754_exp2, __exp2_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_fmod.c b/libc/sysdeps/ieee754/dbl-64/e_fmod.c
index 2ce613574..a575f616b 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_fmod.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_fmod.c
@@ -5,16 +5,12 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_fmod.c,v 1.8 1995/05/10 20:45:07 jtc Exp $";
-#endif
-
-/*
+/*
* __ieee754_fmod(x,y)
* Return x mod y in exact arithmetic
* Method: shift and subtract
@@ -23,18 +19,10 @@ static char rcsid[] = "$NetBSD: e_fmod.c,v 1.8 1995/05/10 20:45:07 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double one = 1.0, Zero[] = {0.0, -0.0,};
-#else
-static double one = 1.0, Zero[] = {0.0, -0.0,};
-#endif
-#ifdef __STDC__
- double __ieee754_fmod(double x, double y)
-#else
- double __ieee754_fmod(x,y)
- double x,y ;
-#endif
+double
+__ieee754_fmod (double x, double y)
{
int32_t n,hx,hy,hz,ix,iy,sx,i;
u_int32_t lx,ly,lz;
@@ -51,7 +39,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
return (x*y)/(x*y);
if(hx<=hy) {
if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
- if(lx==ly)
+ if(lx==ly)
return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
}
@@ -74,25 +62,25 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
} else iy = (hy>>20)-1023;
/* set up {hx,lx}, {hy,ly} and align y to x */
- if(ix >= -1022)
+ if(ix >= -1022)
hx = 0x00100000|(0x000fffff&hx);
else { /* subnormal x, shift x to normal */
n = -1022-ix;
if(n<=31) {
- hx = (hx<<n)|(lx>>(32-n));
- lx <<= n;
+ hx = (hx<<n)|(lx>>(32-n));
+ lx <<= n;
} else {
hx = lx<<(n-32);
lx = 0;
}
}
- if(iy >= -1022)
+ if(iy >= -1022)
hy = 0x00100000|(0x000fffff&hy);
else { /* subnormal y, shift y to normal */
n = -1022-iy;
if(n<=31) {
- hy = (hy<<n)|(ly>>(32-n));
- ly <<= n;
+ hy = (hy<<n)|(ly>>(32-n));
+ ly <<= n;
} else {
hy = ly<<(n-32);
ly = 0;
@@ -105,17 +93,17 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz<0){hx = hx+hx+(lx>>31); lx = lx+lx;}
else {
- if((hz|lz)==0) /* return sign(x)*0 */
+ if((hz|lz)==0) /* return sign(x)*0 */
return Zero[(u_int32_t)sx>>31];
- hx = hz+hz+(lz>>31); lx = lz+lz;
+ hx = hz+hz+(lz>>31); lx = lz+lz;
}
}
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz>=0) {hx=hz;lx=lz;}
/* convert back to floating value and restore the sign */
- if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(u_int32_t)sx>>31];
+ if((hx|lx)==0) /* return sign(x)*0 */
+ return Zero[(u_int32_t)sx>>31];
while(hx<0x00100000) { /* normalize x */
hx = hx+hx+(lx>>31); lx = lx+lx;
iy -= 1;
@@ -138,3 +126,4 @@ static double one = 1.0, Zero[] = {0.0, -0.0,};
}
return x; /* exact output */
}
+strong_alias (__ieee754_fmod, __fmod_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c b/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c
index f32309350..c4b7470e5 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997, 1999, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2001, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -33,19 +33,20 @@ __ieee754_gamma_r (double x, int *signgamp)
EXTRACT_WORDS (hx, lx, x);
- if (((hx & 0x7fffffff) | lx) == 0)
+ if (__builtin_expect (((hx & 0x7fffffff) | lx) == 0, 0))
{
/* Return value for x == 0 is Inf with divide by zero exception. */
*signgamp = 0;
return 1.0 / x;
}
- if (hx < 0 && (u_int32_t) hx < 0xfff00000 && __rint (x) == x)
+ if (__builtin_expect (hx < 0, 0)
+ && (u_int32_t) hx < 0xfff00000 && __rint (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
return (x - x) / (x - x);
}
- if ((unsigned int) hx == 0xfff00000 && lx==0)
+ if (__builtin_expect ((unsigned int) hx == 0xfff00000 && lx==0, 0))
{
/* x == -Inf. According to ISO this is NaN. */
*signgamp = 0;
@@ -55,3 +56,4 @@ __ieee754_gamma_r (double x, int *signgamp)
/* XXX FIXME. */
return __ieee754_exp (__ieee754_lgamma_r (x, signgamp));
}
+strong_alias (__ieee754_gamma_r, __gamma_r_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_hypot.c b/libc/sysdeps/ieee754/dbl-64/e_hypot.c
index 76a77ec33..a89ccaa35 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_hypot.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_hypot.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_hypot.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
-#endif
-
/* __ieee754_hypot(x,y)
*
* Method :
@@ -42,19 +38,15 @@ static char rcsid[] = "$NetBSD: e_hypot.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
* hypot(x,y) is NAN if x or y is NAN.
*
* Accuracy:
- * hypot(x,y) returns sqrt(x^2+y^2) with error less
- * than 1 ulps (units in the last place)
+ * hypot(x,y) returns sqrt(x^2+y^2) with error less
+ * than 1 ulps (units in the last place)
*/
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- double __ieee754_hypot(double x, double y)
-#else
- double __ieee754_hypot(x,y)
- double x, y;
-#endif
+double
+__ieee754_hypot(double x, double y)
{
double a,b,t1,t2,y1,y2,w;
int32_t j,k,ha,hb;
@@ -68,7 +60,7 @@ static char rcsid[] = "$NetBSD: e_hypot.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
SET_HIGH_WORD(b,hb); /* b <- |b| */
if((ha-hb)>0x3c00000) {return a+b;} /* x/y > 2**60 */
k=0;
- if(ha > 0x5f300000) { /* a>2**500 */
+ if(__builtin_expect(ha > 0x5f300000, 0)) { /* a>2**500 */
if(ha >= 0x7ff00000) { /* Inf or NaN */
u_int32_t low;
w = a+b; /* for sNaN */
@@ -83,9 +75,9 @@ static char rcsid[] = "$NetBSD: e_hypot.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
SET_HIGH_WORD(a,ha);
SET_HIGH_WORD(b,hb);
}
- if(hb < 0x20b00000) { /* b < 2**-500 */
+ if(__builtin_expect(hb < 0x20b00000, 0)) { /* b < 2**-500 */
if(hb <= 0x000fffff) { /* subnormal b or 0 */
- u_int32_t low;
+ u_int32_t low;
GET_LOW_WORD(low,b);
if((hb|low)==0) return a;
t1=0;
@@ -94,7 +86,7 @@ static char rcsid[] = "$NetBSD: e_hypot.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
a *= t1;
k -= 1022;
} else { /* scale a and b by 2^600 */
- ha += 0x25800000; /* a *= 2^600 */
+ ha += 0x25800000; /* a *= 2^600 */
hb += 0x25800000; /* b *= 2^600 */
k -= 600;
SET_HIGH_WORD(a,ha);
@@ -126,3 +118,4 @@ static char rcsid[] = "$NetBSD: e_hypot.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
return t1*w;
} else return w;
}
+strong_alias (__ieee754_hypot, __hypot_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_j0.c b/libc/sysdeps/ieee754/dbl-64/e_j0.c
index 302df49d6..5ebf2056b 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_j0.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_j0.c
@@ -13,10 +13,6 @@
for performance improvement on pipelined processors.
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_j0.c,v 1.8 1995/05/10 20:45:23 jtc Exp $";
-#endif
-
/* __ieee754_j0(x), __ieee754_y0(x)
* Bessel function of the first and second kinds of order zero.
* Method -- j0(x):
@@ -26,16 +22,16 @@ static char rcsid[] = "$NetBSD: e_j0.c,v 1.8 1995/05/10 20:45:23 jtc Exp $";
* j0(x) = 1-z/4+ z^2*R0/S0, where z = x*x;
* (precision: |j0-1+z/4-z^2R0/S0 |<2**-63.67 )
* for x in (2,inf)
- * j0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)-q0(x)*sin(x0))
- * where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
+ * j0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)-q0(x)*sin(x0))
+ * where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
* as follow:
* cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
* = 1/sqrt(2) * (cos(x) + sin(x))
* sin(x0) = sin(x)cos(pi/4)-cos(x)sin(pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
- * (To avoid cancellation, use
+ * (To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.)
+ * to compute the worse one.)
*
* 3 Special cases
* j0(nan)= nan
@@ -56,8 +52,8 @@ static char rcsid[] = "$NetBSD: e_j0.c,v 1.8 1995/05/10 20:45:23 jtc Exp $";
* Note: For tiny x, U/V = u0 and j0(x)~1, hence
* y0(tiny) = u0 + (2/pi)*ln(tiny), (choose tiny<2**-27)
* 2. For x>=2.
- * y0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)+q0(x)*sin(x0))
- * where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
+ * y0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)+q0(x)*sin(x0))
+ * where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
* by the method mentioned above.
* 3. Special cases: y0(0)=-inf, y0(x<0)=NaN, y0(inf)=0.
*/
@@ -65,22 +61,14 @@ static char rcsid[] = "$NetBSD: e_j0.c,v 1.8 1995/05/10 20:45:23 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static double pzero(double), qzero(double);
-#else
-static double pzero(), qzero();
-#endif
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
-huge = 1e300,
+huge = 1e300,
one = 1.0,
invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
tpi = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
- /* R0/S0 on [0, 2.00] */
+ /* R0/S0 on [0, 2.00] */
R[] = {0.0, 0.0, 1.56249999999999947958e-02, /* 0x3F8FFFFF, 0xFFFFFFFD */
-1.89979294238854721751e-04, /* 0xBF28E6A5, 0xB61AC6E9 */
1.82954049532700665670e-06, /* 0x3EBEB1D1, 0x0C503919 */
@@ -90,18 +78,10 @@ S[] = {0.0, 1.56191029464890010492e-02, /* 0x3F8FFCE8, 0x82C8C2A4 */
5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */
1.16614003333790000205e-09}; /* 0x3E1408BC, 0xF4745D8F */
-#ifdef __STDC__
static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-#ifdef __STDC__
- double __ieee754_j0(double x)
-#else
- double __ieee754_j0(x)
- double x;
-#endif
+double
+__ieee754_j0(double x)
{
double z, s,c,ss,cc,r,u,v,r1,r2,s1,s2,z2,z4;
int32_t hx,ix;
@@ -117,7 +97,7 @@ static double zero = 0.0;
if(ix<0x7fe00000) { /* make sure x+x not overflow */
z = -__cos(x+x);
if ((s*c)<zero) cc = z/ss;
- else ss = z/cc;
+ else ss = z/cc;
}
/*
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
@@ -132,8 +112,8 @@ static double zero = 0.0;
}
if(ix<0x3f200000) { /* |x| < 2**-13 */
if(huge+x>one) { /* raise inexact if x != 0 */
- if(ix<0x3e400000) return one; /* |x|<2**-27 */
- else return one - 0.25*x*x;
+ if(ix<0x3e400000) return one; /* |x|<2**-27 */
+ else return one - 0.25*x*x;
}
}
z = x*x;
@@ -155,12 +135,9 @@ static double zero = 0.0;
return((one+u)*(one-u)+z*(r/s));
}
}
+strong_alias (__ieee754_j0, __j0_finite)
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
U[] = {-7.38042951086872317523e-02, /* 0xBFB2E4D6, 0x99CBD01F */
1.76666452509181115538e-01, /* 0x3FC69D01, 0x9DE9E3FC */
-1.38185671945596898896e-02, /* 0xBF8C4CE8, 0xB16CFA97 */
@@ -173,52 +150,48 @@ V[] = {1.27304834834123699328e-02, /* 0x3F8A1270, 0x91C9C71A */
2.59150851840457805467e-07, /* 0x3E91642D, 0x7FF202FD */
4.41110311332675467403e-10}; /* 0x3DFE5018, 0x3BD6D9EF */
-#ifdef __STDC__
- double __ieee754_y0(double x)
-#else
- double __ieee754_y0(x)
- double x;
-#endif
+double
+__ieee754_y0(double x)
{
double z, s,c,ss,cc,u,v,z2,z4,z6,u1,u2,u3,v1,v2;
int32_t hx,ix,lx;
EXTRACT_WORDS(hx,lx,x);
- ix = 0x7fffffff&hx;
+ ix = 0x7fffffff&hx;
/* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0, y0(0) is -inf. */
if(ix>=0x7ff00000) return one/(x+x*x);
- if((ix|lx)==0) return -HUGE_VAL+x; /* -inf and overflow exception. */
- if(hx<0) return zero/(zero*x);
- if(ix >= 0x40000000) { /* |x| >= 2.0 */
- /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
- * where x0 = x-pi/4
- * Better formula:
- * cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
- * = 1/sqrt(2) * (sin(x) + cos(x))
- * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
- * = 1/sqrt(2) * (sin(x) - cos(x))
- * To avoid cancellation, use
- * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.
- */
+ if((ix|lx)==0) return -HUGE_VAL+x; /* -inf and overflow exception. */
+ if(hx<0) return zero/(zero*x);
+ if(ix >= 0x40000000) { /* |x| >= 2.0 */
+ /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
+ * where x0 = x-pi/4
+ * Better formula:
+ * cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
+ * = 1/sqrt(2) * (sin(x) + cos(x))
+ * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
+ * = 1/sqrt(2) * (sin(x) - cos(x))
+ * To avoid cancellation, use
+ * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ * to compute the worse one.
+ */
__sincos (x, &s, &c);
- ss = s-c;
- cc = s+c;
+ ss = s-c;
+ cc = s+c;
/*
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
- if(ix<0x7fe00000) { /* make sure x+x not overflow */
- z = -__cos(x+x);
- if ((s*c)<zero) cc = z/ss;
- else ss = z/cc;
- }
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrt(x);
- else {
- u = pzero(x); v = qzero(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrt(x);
- }
- return z;
+ if(ix<0x7fe00000) { /* make sure x+x not overflow */
+ z = -__cos(x+x);
+ if ((s*c)<zero) cc = z/ss;
+ else ss = z/cc;
+ }
+ if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrt(x);
+ else {
+ u = pzero(x); v = qzero(x);
+ z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrt(x);
+ }
+ return z;
}
if(ix<=0x3e400000) { /* x < 2**-27 */
return(U[0] + tpi*__ieee754_log(x));
@@ -238,21 +211,18 @@ V[] = {1.27304834834123699328e-02, /* 0x3F8A1270, 0x91C9C71A */
#endif
return(u/v + tpi*(__ieee754_j0(x)*__ieee754_log(x)));
}
+strong_alias (__ieee754_y0, __y0_finite)
/* The asymptotic expansions of pzero is
* 1 - 9/128 s^2 + 11025/98304 s^4 - ..., where s = 1/x.
* For x >= 2, We approximate pzero by
- * pzero(x) = 1 + (R/S)
+ * pzero(x) = 1 + (R/S)
* where R = pR0 + pR1*s^2 + pR2*s^4 + ... + pR5*s^10
- * S = 1 + pS0*s^2 + ... + pS4*s^10
+ * S = 1 + pS0*s^2 + ... + pS4*s^10
* and
* | pzero(x)-1-R/S | <= 2 ** ( -60.26)
*/
-#ifdef __STDC__
static const double pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static double pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
-7.03124999999900357484e-02, /* 0xBFB1FFFF, 0xFFFFFD32 */
-8.08167041275349795626e+00, /* 0xC02029D0, 0xB44FA779 */
@@ -260,11 +230,7 @@ static double pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-2.48521641009428822144e+03, /* 0xC0A36A6E, 0xCD4DCAFC */
-5.25304380490729545272e+03, /* 0xC0B4850B, 0x36CC643D */
};
-#ifdef __STDC__
static const double pS8[5] = {
-#else
-static double pS8[5] = {
-#endif
1.16534364619668181717e+02, /* 0x405D2233, 0x07A96751 */
3.83374475364121826715e+03, /* 0x40ADF37D, 0x50596938 */
4.05978572648472545552e+04, /* 0x40E3D2BB, 0x6EB6B05F */
@@ -272,11 +238,7 @@ static double pS8[5] = {
4.76277284146730962675e+04, /* 0x40E74177, 0x4F2C49DC */
};
-#ifdef __STDC__
static const double pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static double pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
-1.14125464691894502584e-11, /* 0xBDA918B1, 0x47E495CC */
-7.03124940873599280078e-02, /* 0xBFB1FFFF, 0xE69AFBC6 */
-4.15961064470587782438e+00, /* 0xC010A370, 0xF90C6BBF */
@@ -284,11 +246,7 @@ static double pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-3.31231299649172967747e+02, /* 0xC074B3B3, 0x6742CC63 */
-3.46433388365604912451e+02, /* 0xC075A6EF, 0x28A38BD7 */
};
-#ifdef __STDC__
static const double pS5[5] = {
-#else
-static double pS5[5] = {
-#endif
6.07539382692300335975e+01, /* 0x404E6081, 0x0C98C5DE */
1.05125230595704579173e+03, /* 0x40906D02, 0x5C7E2864 */
5.97897094333855784498e+03, /* 0x40B75AF8, 0x8FBE1D60 */
@@ -296,11 +254,7 @@ static double pS5[5] = {
2.40605815922939109441e+03, /* 0x40A2CC1D, 0xC70BE864 */
};
-#ifdef __STDC__
static const double pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#else
-static double pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
-2.54704601771951915620e-09, /* 0xBE25E103, 0x6FE1AA86 */
-7.03119616381481654654e-02, /* 0xBFB1FFF6, 0xF7C0E24B */
-2.40903221549529611423e+00, /* 0xC00345B2, 0xAEA48074 */
@@ -308,11 +262,7 @@ static double pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-5.80791704701737572236e+01, /* 0xC04D0A22, 0x420A1A45 */
-3.14479470594888503854e+01, /* 0xC03F72AC, 0xA892D80F */
};
-#ifdef __STDC__
static const double pS3[5] = {
-#else
-static double pS3[5] = {
-#endif
3.58560338055209726349e+01, /* 0x4041ED92, 0x84077DD3 */
3.61513983050303863820e+02, /* 0x40769839, 0x464A7C0E */
1.19360783792111533330e+03, /* 0x4092A66E, 0x6D1061D6 */
@@ -320,11 +270,7 @@ static double pS3[5] = {
1.73580930813335754692e+02, /* 0x4065B296, 0xFC379081 */
};
-#ifdef __STDC__
static const double pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static double pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
-8.87534333032526411254e-08, /* 0xBE77D316, 0xE927026D */
-7.03030995483624743247e-02, /* 0xBFB1FF62, 0x495E1E42 */
-1.45073846780952986357e+00, /* 0xBFF73639, 0x8A24A843 */
@@ -332,11 +278,7 @@ static double pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-1.11931668860356747786e+01, /* 0xC02662E6, 0xC5246303 */
-3.23364579351335335033e+00, /* 0xC009DE81, 0xAF8FE70F */
};
-#ifdef __STDC__
static const double pS2[5] = {
-#else
-static double pS2[5] = {
-#endif
2.22202997532088808441e+01, /* 0x40363865, 0x908B5959 */
1.36206794218215208048e+02, /* 0x4061069E, 0x0EE8878F */
2.70470278658083486789e+02, /* 0x4070E786, 0x42EA079B */
@@ -344,18 +286,10 @@ static double pS2[5] = {
1.46576176948256193810e+01, /* 0x402D50B3, 0x44391809 */
};
-#ifdef __STDC__
- static double pzero(double x)
-#else
- static double pzero(x)
- double x;
-#endif
+static double
+pzero(double x)
{
-#ifdef __STDC__
const double *p,*q;
-#else
- double *p,*q;
-#endif
double z,r,s,z2,z4,r1,r2,r3,s1,s2,s3;
int32_t ix;
GET_HIGH_WORD(ix,x);
@@ -385,17 +319,13 @@ static double pS2[5] = {
/* For x >= 8, the asymptotic expansions of qzero is
* -1/8 s + 75/1024 s^3 - ..., where s = 1/x.
* We approximate pzero by
- * qzero(x) = s*(-1.25 + (R/S))
+ * qzero(x) = s*(-1.25 + (R/S))
* where R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
- * S = 1 + qS0*s^2 + ... + qS5*s^12
+ * S = 1 + qS0*s^2 + ... + qS5*s^12
* and
* | qzero(x)/s +1.25-R/S | <= 2 ** ( -61.22)
*/
-#ifdef __STDC__
static const double qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static double qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
7.32421874999935051953e-02, /* 0x3FB2BFFF, 0xFFFFFE2C */
1.17682064682252693899e+01, /* 0x40278952, 0x5BB334D6 */
@@ -403,11 +333,7 @@ static double qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
8.85919720756468632317e+03, /* 0x40C14D99, 0x3E18F46D */
3.70146267776887834771e+04, /* 0x40E212D4, 0x0E901566 */
};
-#ifdef __STDC__
static const double qS8[6] = {
-#else
-static double qS8[6] = {
-#endif
1.63776026895689824414e+02, /* 0x406478D5, 0x365B39BC */
8.09834494656449805916e+03, /* 0x40BFA258, 0x4E6B0563 */
1.42538291419120476348e+05, /* 0x41016652, 0x54D38C3F */
@@ -416,11 +342,7 @@ static double qS8[6] = {
-3.43899293537866615225e+05, /* 0xC114FD6D, 0x2C9530C5 */
};
-#ifdef __STDC__
static const double qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static double qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
1.84085963594515531381e-11, /* 0x3DB43D8F, 0x29CC8CD9 */
7.32421766612684765896e-02, /* 0x3FB2BFFF, 0xD172B04C */
5.83563508962056953777e+00, /* 0x401757B0, 0xB9953DD3 */
@@ -428,11 +350,7 @@ static double qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
1.02724376596164097464e+03, /* 0x40900CF9, 0x9DC8C481 */
1.98997785864605384631e+03, /* 0x409F17E9, 0x53C6E3A6 */
};
-#ifdef __STDC__
static const double qS5[6] = {
-#else
-static double qS5[6] = {
-#endif
8.27766102236537761883e+01, /* 0x4054B1B3, 0xFB5E1543 */
2.07781416421392987104e+03, /* 0x40A03BA0, 0xDA21C0CE */
1.88472887785718085070e+04, /* 0x40D267D2, 0x7B591E6D */
@@ -441,11 +359,7 @@ static double qS5[6] = {
-5.35434275601944773371e+03, /* 0xC0B4EA57, 0xBEDBC609 */
};
-#ifdef __STDC__
static const double qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#else
-static double qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
4.37741014089738620906e-09, /* 0x3E32CD03, 0x6ADECB82 */
7.32411180042911447163e-02, /* 0x3FB2BFEE, 0x0E8D0842 */
3.34423137516170720929e+00, /* 0x400AC0FC, 0x61149CF5 */
@@ -453,11 +367,7 @@ static double qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
1.70808091340565596283e+02, /* 0x406559DB, 0xE25EFD1F */
1.66733948696651168575e+02, /* 0x4064D77C, 0x81FA21E0 */
};
-#ifdef __STDC__
static const double qS3[6] = {
-#else
-static double qS3[6] = {
-#endif
4.87588729724587182091e+01, /* 0x40486122, 0xBFE343A6 */
7.09689221056606015736e+02, /* 0x40862D83, 0x86544EB3 */
3.70414822620111362994e+03, /* 0x40ACF04B, 0xE44DFC63 */
@@ -466,11 +376,7 @@ static double qS3[6] = {
-1.49247451836156386662e+02, /* 0xC062A7EB, 0x201CF40F */
};
-#ifdef __STDC__
static const double qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static double qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
1.50444444886983272379e-07, /* 0x3E84313B, 0x54F76BDB */
7.32234265963079278272e-02, /* 0x3FB2BEC5, 0x3E883E34 */
1.99819174093815998816e+00, /* 0x3FFFF897, 0xE727779C */
@@ -478,11 +384,7 @@ static double qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
3.16662317504781540833e+01, /* 0x403FAA8E, 0x29FBDC4A */
1.62527075710929267416e+01, /* 0x403040B1, 0x71814BB4 */
};
-#ifdef __STDC__
static const double qS2[6] = {
-#else
-static double qS2[6] = {
-#endif
3.03655848355219184498e+01, /* 0x403E5D96, 0xF7C07AED */
2.69348118608049844624e+02, /* 0x4070D591, 0xE4D14B40 */
8.44783757595320139444e+02, /* 0x408A6645, 0x22B3BF22 */
@@ -491,18 +393,10 @@ static double qS2[6] = {
-5.31095493882666946917e+00, /* 0xC0153E6A, 0xF8B32931 */
};
-#ifdef __STDC__
- static double qzero(double x)
-#else
- static double qzero(x)
- double x;
-#endif
+static double
+qzero(double x)
{
-#ifdef __STDC__
const double *p,*q;
-#else
- double *p,*q;
-#endif
double s,r,z,z2,z4,z6,r1,r2,r3,s1,s2,s3;
int32_t ix;
GET_HIGH_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/e_j1.c b/libc/sysdeps/ieee754/dbl-64/e_j1.c
index 8a3b2ffd1..fdc6b5b89 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_j1.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_j1.c
@@ -13,10 +13,6 @@
for performance improvement on pipelined processors.
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_j1.c,v 1.8 1995/05/10 20:45:27 jtc Exp $";
-#endif
-
/* __ieee754_j1(x), __ieee754_y1(x)
* Bessel function of the first and second kinds of order zero.
* Method -- j1(x):
@@ -26,17 +22,17 @@ static char rcsid[] = "$NetBSD: e_j1.c,v 1.8 1995/05/10 20:45:27 jtc Exp $";
* j1(x) = x/2 + x*z*R0/S0, where z = x*x;
* (precision: |j1/x - 1/2 - R0/S0 |<2**-61.51 )
* for x in (2,inf)
- * j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
- * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
- * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
+ * j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
+ * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
+ * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
* as follow:
* cos(x1) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
* sin(x1) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
* = -1/sqrt(2) * (sin(x) + cos(x))
- * (To avoid cancellation, use
+ * (To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.)
+ * to compute the worse one.)
*
* 3 Special cases
* j1(nan)= nan
@@ -57,25 +53,17 @@ static char rcsid[] = "$NetBSD: e_j1.c,v 1.8 1995/05/10 20:45:27 jtc Exp $";
* Note: For tiny x, 1/x dominate y1 and hence
* y1(tiny) = -2/pi/tiny, (choose tiny<2**-54)
* 3. For x>=2.
- * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
- * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
+ * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
+ * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
* by method mentioned above.
*/
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static double pone(double), qone(double);
-#else
-static double pone(), qone();
-#endif
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
huge = 1e300,
one = 1.0,
invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
@@ -91,25 +79,17 @@ S[] = {0.0, 1.91537599538363460805e-02, /* 0x3F939D0B, 0x12637E53 */
5.04636257076217042715e-09, /* 0x3E35AC88, 0xC97DFF2C */
1.23542274426137913908e-11}; /* 0x3DAB2ACF, 0xCFB97ED8 */
-#ifdef __STDC__
static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-#ifdef __STDC__
- double __ieee754_j1(double x)
-#else
- double __ieee754_j1(x)
- double x;
-#endif
+double
+__ieee754_j1(double x)
{
double z, s,c,ss,cc,r,u,v,y,r1,r2,s1,s2,s3,z2,z4;
int32_t hx,ix;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
- if(ix>=0x7ff00000) return one/x;
+ if(__builtin_expect(ix>=0x7ff00000, 0)) return one/x;
y = fabs(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
__sincos (y, &s, &c);
@@ -118,7 +98,7 @@ static double zero = 0.0;
if(ix<0x7fe00000) { /* make sure y+y not overflow */
z = __cos(y+y);
if ((s*c)>zero) cc = z/ss;
- else ss = z/cc;
+ else ss = z/cc;
}
/*
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
@@ -130,9 +110,9 @@ static double zero = 0.0;
z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrt(y);
}
if(hx<0) return -z;
- else return z;
+ else return z;
}
- if(ix<0x3e400000) { /* |x|<2**-27 */
+ if(__builtin_expect(ix<0x3e400000, 0)) { /* |x|<2**-27 */
if(huge+x>one) return 0.5*x;/* inexact if x!=0 necessary */
}
z = x*x;
@@ -144,7 +124,7 @@ static double zero = 0.0;
r1 = z*R[0]; z2=z*z;
r2 = R[1]+z*R[2]; z4=z2*z2;
r = r1 + z2*r2 + z4*R[3];
- r *= x;
+ r *= x;
s1 = one+z*S[1];
s2 = S[2]+z*S[3];
s3 = S[4]+z*S[5];
@@ -152,23 +132,16 @@ static double zero = 0.0;
#endif
return(x*0.5+r/s);
}
+strong_alias (__ieee754_j1, __j1_finite)
-#ifdef __STDC__
static const double U0[5] = {
-#else
-static double U0[5] = {
-#endif
-1.96057090646238940668e-01, /* 0xBFC91866, 0x143CBC8A */
5.04438716639811282616e-02, /* 0x3FA9D3C7, 0x76292CD1 */
-1.91256895875763547298e-03, /* 0xBF5F55E5, 0x4844F50F */
2.35252600561610495928e-05, /* 0x3EF8AB03, 0x8FA6B88E */
-9.19099158039878874504e-08, /* 0xBE78AC00, 0x569105B8 */
};
-#ifdef __STDC__
static const double V0[5] = {
-#else
-static double V0[5] = {
-#endif
1.99167318236649903973e-02, /* 0x3F94650D, 0x3F4DA9F0 */
2.02552581025135171496e-04, /* 0x3F2A8C89, 0x6C257764 */
1.35608801097516229404e-06, /* 0x3EB6C05A, 0x894E8CA6 */
@@ -176,56 +149,53 @@ static double V0[5] = {
1.66559246207992079114e-11, /* 0x3DB25039, 0xDACA772A */
};
-#ifdef __STDC__
- double __ieee754_y1(double x)
-#else
- double __ieee754_y1(x)
- double x;
-#endif
+double
+__ieee754_y1(double x)
{
double z, s,c,ss,cc,u,v,u1,u2,v1,v2,v3,z2,z4;
int32_t hx,ix,lx;
EXTRACT_WORDS(hx,lx,x);
- ix = 0x7fffffff&hx;
+ ix = 0x7fffffff&hx;
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
- if(ix>=0x7ff00000) return one/(x+x*x);
- if((ix|lx)==0) return -HUGE_VAL+x; /* -inf and overflow exception. */;
- if(hx<0) return zero/(zero*x);
- if(ix >= 0x40000000) { /* |x| >= 2.0 */
+ if(__builtin_expect(ix>=0x7ff00000, 0)) return one/(x+x*x);
+ if(__builtin_expect((ix|lx)==0, 0))
+ return -HUGE_VAL+x; /* -inf and overflow exception. */;
+ if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
+ if(ix >= 0x40000000) { /* |x| >= 2.0 */
__sincos (x, &s, &c);
- ss = -s-c;
- cc = s-c;
- if(ix<0x7fe00000) { /* make sure x+x not overflow */
- z = __cos(x+x);
- if ((s*c)>zero) cc = z/ss;
- else ss = z/cc;
- }
- /* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x0)+q1(x)*cos(x0))
- * where x0 = x-3pi/4
- * Better formula:
- * cos(x0) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
- * = 1/sqrt(2) * (sin(x) - cos(x))
- * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
- * = -1/sqrt(2) * (cos(x) + sin(x))
- * To avoid cancellation, use
- * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.
- */
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrt(x);
- else {
- u = pone(x); v = qone(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrt(x);
- }
- return z;
- }
- if(ix<=0x3c900000) { /* x < 2**-54 */
- return(-tpi/x);
- }
- z = x*x;
+ ss = -s-c;
+ cc = s-c;
+ if(ix<0x7fe00000) { /* make sure x+x not overflow */
+ z = __cos(x+x);
+ if ((s*c)>zero) cc = z/ss;
+ else ss = z/cc;
+ }
+ /* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x0)+q1(x)*cos(x0))
+ * where x0 = x-3pi/4
+ * Better formula:
+ * cos(x0) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
+ * = 1/sqrt(2) * (sin(x) - cos(x))
+ * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
+ * = -1/sqrt(2) * (cos(x) + sin(x))
+ * To avoid cancellation, use
+ * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ * to compute the worse one.
+ */
+ if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrt(x);
+ else {
+ u = pone(x); v = qone(x);
+ z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrt(x);
+ }
+ return z;
+ }
+ if(__builtin_expect(ix<=0x3c900000, 0)) { /* x < 2**-54 */
+ return(-tpi/x);
+ }
+ z = x*x;
#ifdef DO_NOT_USE_THIS
- u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
- v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
+ u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
+ v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
#else
u1 = U0[0]+z*U0[1];z2=z*z;
u2 = U0[2]+z*U0[3];z4=z2*z2;
@@ -235,24 +205,21 @@ static double V0[5] = {
v3 = V0[3]+z*V0[4];
v = v1 + z2*v2 + z4*v3;
#endif
- return(x*(u/v) + tpi*(__ieee754_j1(x)*__ieee754_log(x)-one/x));
+ return(x*(u/v) + tpi*(__ieee754_j1(x)*__ieee754_log(x)-one/x));
}
+strong_alias (__ieee754_y1, __y1_finite)
/* For x >= 8, the asymptotic expansions of pone is
* 1 + 15/128 s^2 - 4725/2^15 s^4 - ..., where s = 1/x.
* We approximate pone by
- * pone(x) = 1 + (R/S)
+ * pone(x) = 1 + (R/S)
* where R = pr0 + pr1*s^2 + pr2*s^4 + ... + pr5*s^10
- * S = 1 + ps0*s^2 + ... + ps4*s^10
+ * S = 1 + ps0*s^2 + ... + ps4*s^10
* and
* | pone(x)-1-R/S | <= 2 ** ( -60.06)
*/
-#ifdef __STDC__
static const double pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static double pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
1.17187499999988647970e-01, /* 0x3FBDFFFF, 0xFFFFFCCE */
1.32394806593073575129e+01, /* 0x402A7A9D, 0x357F7FCE */
@@ -260,11 +227,7 @@ static double pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
3.87474538913960532227e+03, /* 0x40AE457D, 0xA3A532CC */
7.91447954031891731574e+03, /* 0x40BEEA7A, 0xC32782DD */
};
-#ifdef __STDC__
static const double ps8[5] = {
-#else
-static double ps8[5] = {
-#endif
1.14207370375678408436e+02, /* 0x405C8D45, 0x8E656CAC */
3.65093083420853463394e+03, /* 0x40AC85DC, 0x964D274F */
3.69562060269033463555e+04, /* 0x40E20B86, 0x97C5BB7F */
@@ -272,11 +235,7 @@ static double ps8[5] = {
3.08042720627888811578e+04, /* 0x40DE1511, 0x697A0B2D */
};
-#ifdef __STDC__
static const double pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static double pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
1.31990519556243522749e-11, /* 0x3DAD0667, 0xDAE1CA7D */
1.17187493190614097638e-01, /* 0x3FBDFFFF, 0xE2C10043 */
6.80275127868432871736e+00, /* 0x401B3604, 0x6E6315E3 */
@@ -284,11 +243,7 @@ static double pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
5.17636139533199752805e+02, /* 0x40802D16, 0xD052D649 */
5.28715201363337541807e+02, /* 0x408085B8, 0xBB7E0CB7 */
};
-#ifdef __STDC__
static const double ps5[5] = {
-#else
-static double ps5[5] = {
-#endif
5.92805987221131331921e+01, /* 0x404DA3EA, 0xA8AF633D */
9.91401418733614377743e+02, /* 0x408EFB36, 0x1B066701 */
5.35326695291487976647e+03, /* 0x40B4E944, 0x5706B6FB */
@@ -296,11 +251,7 @@ static double ps5[5] = {
1.50404688810361062679e+03, /* 0x40978030, 0x036F5E51 */
};
-#ifdef __STDC__
static const double pr3[6] = {
-#else
-static double pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
3.02503916137373618024e-09, /* 0x3E29FC21, 0xA7AD9EDD */
1.17186865567253592491e-01, /* 0x3FBDFFF5, 0x5B21D17B */
3.93297750033315640650e+00, /* 0x400F76BC, 0xE85EAD8A */
@@ -308,11 +259,7 @@ static double pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
9.10550110750781271918e+01, /* 0x4056C385, 0x4D2C1837 */
4.85590685197364919645e+01, /* 0x4048478F, 0x8EA83EE5 */
};
-#ifdef __STDC__
static const double ps3[5] = {
-#else
-static double ps3[5] = {
-#endif
3.47913095001251519989e+01, /* 0x40416549, 0xA134069C */
3.36762458747825746741e+02, /* 0x40750C33, 0x07F1A75F */
1.04687139975775130551e+03, /* 0x40905B7C, 0x5037D523 */
@@ -320,11 +267,7 @@ static double ps3[5] = {
1.03787932439639277504e+02, /* 0x4059F26D, 0x7C2EED53 */
};
-#ifdef __STDC__
static const double pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static double pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
1.07710830106873743082e-07, /* 0x3E7CE9D4, 0xF65544F4 */
1.17176219462683348094e-01, /* 0x3FBDFF42, 0xBE760D83 */
2.36851496667608785174e+00, /* 0x4002F2B7, 0xF98FAEC0 */
@@ -332,11 +275,7 @@ static double pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
1.76939711271687727390e+01, /* 0x4031B1A8, 0x177F8EE2 */
5.07352312588818499250e+00, /* 0x40144B49, 0xA574C1FE */
};
-#ifdef __STDC__
static const double ps2[5] = {
-#else
-static double ps2[5] = {
-#endif
2.14364859363821409488e+01, /* 0x40356FBD, 0x8AD5ECDC */
1.25290227168402751090e+02, /* 0x405F5293, 0x14F92CD5 */
2.32276469057162813669e+02, /* 0x406D08D8, 0xD5A2DBD9 */
@@ -344,30 +283,22 @@ static double ps2[5] = {
8.36463893371618283368e+00, /* 0x4020BAB1, 0xF44E5192 */
};
-#ifdef __STDC__
- static double pone(double x)
-#else
- static double pone(x)
- double x;
-#endif
+static double
+pone(double x)
{
-#ifdef __STDC__
const double *p,*q;
-#else
- double *p,*q;
-#endif
double z,r,s,r1,r2,r3,s1,s2,s3,z2,z4;
- int32_t ix;
+ int32_t ix;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
- if(ix>=0x40200000) {p = pr8; q= ps8;}
- else if(ix>=0x40122E8B){p = pr5; q= ps5;}
- else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
- else if(ix>=0x40000000){p = pr2; q= ps2;}
- z = one/(x*x);
+ if(ix>=0x40200000) {p = pr8; q= ps8;}
+ else if(ix>=0x40122E8B){p = pr5; q= ps5;}
+ else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
+ else if(ix>=0x40000000){p = pr2; q= ps2;}
+ z = one/(x*x);
#ifdef DO_NOT_USE_THIS
- r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
- s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
+ r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
+ s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
#else
r1 = p[0]+z*p[1]; z2=z*z;
r2 = p[2]+z*p[3]; z4=z2*z2;
@@ -378,25 +309,21 @@ static double ps2[5] = {
s3 = q[3]+z*q[4];
s = s1 + z2*s2 + z4*s3;
#endif
- return one+ r/s;
+ return one+ r/s;
}
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
* We approximate pone by
- * qone(x) = s*(0.375 + (R/S))
+ * qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
- * S = 1 + qs1*s^2 + ... + qs6*s^12
+ * S = 1 + qs1*s^2 + ... + qs6*s^12
* and
* | qone(x)/s -0.375-R/S | <= 2 ** ( -61.13)
*/
-#ifdef __STDC__
static const double qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static double qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
-1.02539062499992714161e-01, /* 0xBFBA3FFF, 0xFFFFFDF3 */
-1.62717534544589987888e+01, /* 0xC0304591, 0xA26779F7 */
@@ -404,11 +331,7 @@ static double qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-1.18498066702429587167e+04, /* 0xC0C724E7, 0x40F87415 */
-4.84385124285750353010e+04, /* 0xC0E7A6D0, 0x65D09C6A */
};
-#ifdef __STDC__
static const double qs8[6] = {
-#else
-static double qs8[6] = {
-#endif
1.61395369700722909556e+02, /* 0x40642CA6, 0xDE5BCDE5 */
7.82538599923348465381e+03, /* 0x40BE9162, 0xD0D88419 */
1.33875336287249578163e+05, /* 0x4100579A, 0xB0B75E98 */
@@ -417,11 +340,7 @@ static double qs8[6] = {
-2.94490264303834643215e+05, /* 0xC111F969, 0x0EA5AA18 */
};
-#ifdef __STDC__
static const double qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static double qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
-2.08979931141764104297e-11, /* 0xBDB6FA43, 0x1AA1A098 */
-1.02539050241375426231e-01, /* 0xBFBA3FFF, 0xCB597FEF */
-8.05644828123936029840e+00, /* 0xC0201CE6, 0xCA03AD4B */
@@ -429,11 +348,7 @@ static double qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-1.37319376065508163265e+03, /* 0xC09574C6, 0x6931734F */
-2.61244440453215656817e+03, /* 0xC0A468E3, 0x88FDA79D */
};
-#ifdef __STDC__
static const double qs5[6] = {
-#else
-static double qs5[6] = {
-#endif
8.12765501384335777857e+01, /* 0x405451B2, 0xFF5A11B2 */
1.99179873460485964642e+03, /* 0x409F1F31, 0xE77BF839 */
1.74684851924908907677e+04, /* 0x40D10F1F, 0x0D64CE29 */
@@ -442,11 +357,7 @@ static double qs5[6] = {
-4.71918354795128470869e+03, /* 0xC0B26F2E, 0xFCFFA004 */
};
-#ifdef __STDC__
static const double qr3[6] = {
-#else
-static double qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
-5.07831226461766561369e-09, /* 0xBE35CFA9, 0xD38FC84F */
-1.02537829820837089745e-01, /* 0xBFBA3FEB, 0x51AEED54 */
-4.61011581139473403113e+00, /* 0xC01270C2, 0x3302D9FF */
@@ -454,11 +365,7 @@ static double qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-2.28244540737631695038e+02, /* 0xC06C87D3, 0x4718D55F */
-2.19210128478909325622e+02, /* 0xC06B66B9, 0x5F5C1BF6 */
};
-#ifdef __STDC__
static const double qs3[6] = {
-#else
-static double qs3[6] = {
-#endif
4.76651550323729509273e+01, /* 0x4047D523, 0xCCD367E4 */
6.73865112676699709482e+02, /* 0x40850EEB, 0xC031EE3E */
3.38015286679526343505e+03, /* 0x40AA684E, 0x448E7C9A */
@@ -467,11 +374,7 @@ static double qs3[6] = {
-1.35201191444307340817e+02, /* 0xC060E670, 0x290A311F */
};
-#ifdef __STDC__
static const double qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static double qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
-1.78381727510958865572e-07, /* 0xBE87F126, 0x44C626D2 */
-1.02517042607985553460e-01, /* 0xBFBA3E8E, 0x9148B010 */
-2.75220568278187460720e+00, /* 0xC0060484, 0x69BB4EDA */
@@ -479,11 +382,7 @@ static double qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-4.23253133372830490089e+01, /* 0xC04529A3, 0xDE104AAA */
-2.13719211703704061733e+01, /* 0xC0355F36, 0x39CF6E52 */
};
-#ifdef __STDC__
static const double qs2[6] = {
-#else
-static double qs2[6] = {
-#endif
2.95333629060523854548e+01, /* 0x403D888A, 0x78AE64FF */
2.52981549982190529136e+02, /* 0x406F9F68, 0xDB821CBA */
7.57502834868645436472e+02, /* 0x4087AC05, 0xCE49A0F7 */
@@ -492,18 +391,10 @@ static double qs2[6] = {
-4.95949898822628210127e+00, /* 0xC013D686, 0xE71BE86B */
};
-#ifdef __STDC__
- static double qone(double x)
-#else
- static double qone(x)
- double x;
-#endif
+static double
+qone(double x)
{
-#ifdef __STDC__
const double *p,*q;
-#else
- double *p,*q;
-#endif
double s,r,z,r1,r2,r3,s1,s2,s3,z2,z4,z6;
int32_t ix;
GET_HIGH_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/dbl-64/e_jn.c b/libc/sysdeps/ieee754/dbl-64/e_jn.c
index bf4a13d97..f8b8e2ee6 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_jn.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_jn.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_jn.c,v 1.9 1995/05/10 20:45:34 jtc Exp $";
-#endif
-
/*
* __ieee754_jn(n, x), __ieee754_yn(n, x)
* floating point Bessel's function of the 1st and 2nd kind
@@ -43,27 +39,15 @@ static char rcsid[] = "$NetBSD: e_jn.c,v 1.9 1995/05/10 20:45:34 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */
one = 1.00000000000000000000e+00; /* 0x3FF00000, 0x00000000 */
-#ifdef __STDC__
static const double zero = 0.00000000000000000000e+00;
-#else
-static double zero = 0.00000000000000000000e+00;
-#endif
-#ifdef __STDC__
- double __ieee754_jn(int n, double x)
-#else
- double __ieee754_jn(n,x)
- int n; double x;
-#endif
+double
+__ieee754_jn(int n, double x)
{
int32_t i,hx,ix,lx, sgn;
double a, b, temp, di;
@@ -75,7 +59,8 @@ static double zero = 0.00000000000000000000e+00;
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
/* if J(n,NaN) is NaN */
- if((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000) return x+x;
+ if(__builtin_expect((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000, 0))
+ return x+x;
if(n<0){
n = -n;
x = -x;
@@ -85,8 +70,9 @@ static double zero = 0.00000000000000000000e+00;
if(n==1) return(__ieee754_j1(x));
sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */
x = fabs(x);
- if((ix|lx)==0||ix>=0x7ff00000) /* if x is 0 or inf */
- b = zero;
+ if(__builtin_expect((ix|lx)==0||ix>=0x7ff00000,0))
+ /* if x is 0 or inf */
+ b = zero;
else if((double)n<=x) {
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
if(ix>=0x52D00000) { /* x > 2**302 */
@@ -99,7 +85,7 @@ static double zero = 0.00000000000000000000e+00;
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
* 0 s-c c+s
- * 1 -s-c -c+s
+ * 1 -s-c -c+s
* 2 -s+c -c-s
* 3 s+c c-s
*/
@@ -114,13 +100,13 @@ static double zero = 0.00000000000000000000e+00;
}
b = invsqrtpi*temp/__ieee754_sqrt(x);
} else {
- a = __ieee754_j0(x);
- b = __ieee754_j1(x);
- for(i=1;i<n;i++){
+ a = __ieee754_j0(x);
+ b = __ieee754_j1(x);
+ for(i=1;i<n;i++){
temp = b;
b = b*((double)(i+i)/x) - a; /* avoid underflow */
a = temp;
- }
+ }
}
} else {
if(ix<0x3e100000) { /* x < 2**-29 */
@@ -139,11 +125,11 @@ static double zero = 0.00000000000000000000e+00;
}
} else {
/* use backward recurrence */
- /* x x^2 x^2
+ /* x x^2 x^2
* J(n,x)/J(n-1,x) = ---- ------ ------ .....
* 2n - 2(n+1) - 2(n+2)
*
- * 1 1 1
+ * 1 1 1
* (for large x) = ---- ------ ------ .....
* 2n 2(n+1) 2(n+2)
* -- - ------ - ------ -
@@ -156,7 +142,7 @@ static double zero = 0.00000000000000000000e+00;
* 1
* w - -----------------
* 1
- * w+h - ---------
+ * w+h - ---------
* w+2h - ...
*
* To determine how many terms needed, let
@@ -193,19 +179,19 @@ static double zero = 0.00000000000000000000e+00;
v = two/x;
tmp = tmp*__ieee754_log(fabs(v*tmp));
if(tmp<7.09782712893383973096e+02) {
- for(i=n-1,di=(double)(i+i);i>0;i--){
- temp = b;
+ for(i=n-1,di=(double)(i+i);i>0;i--){
+ temp = b;
b *= di;
b = b/x - a;
- a = temp;
+ a = temp;
di -= two;
- }
+ }
} else {
- for(i=n-1,di=(double)(i+i);i>0;i--){
- temp = b;
+ for(i=n-1,di=(double)(i+i);i>0;i--){
+ temp = b;
b *= di;
b = b/x - a;
- a = temp;
+ a = temp;
di -= two;
/* scale b to avoid spurious overflow */
if(b>1e100) {
@@ -213,20 +199,26 @@ static double zero = 0.00000000000000000000e+00;
t /= b;
b = one;
}
- }
+ }
}
- b = (t*__ieee754_j0(x)/b);
+ /* j0() and j1() suffer enormous loss of precision at and
+ * near zero; however, we know that their zero points never
+ * coincide, so just choose the one further away from zero.
+ */
+ z = __ieee754_j0 (x);
+ w = __ieee754_j1 (x);
+ if (fabs (z) >= fabs (w))
+ b = (t * z / b);
+ else
+ b = (t * w / a);
}
}
if(sgn==1) return -b; else return b;
}
+strong_alias (__ieee754_jn, __jn_finite)
-#ifdef __STDC__
- double __ieee754_yn(int n, double x)
-#else
- double __ieee754_yn(n,x)
- int n; double x;
-#endif
+double
+__ieee754_yn(int n, double x)
{
int32_t i,hx,ix,lx;
int32_t sign;
@@ -235,9 +227,11 @@ static double zero = 0.00000000000000000000e+00;
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
/* if Y(n,NaN) is NaN */
- if((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000) return x+x;
- if((ix|lx)==0) return -HUGE_VAL+x; /* -inf and overflow exception. */;
- if(hx<0) return zero/(zero*x);
+ if(__builtin_expect((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000,0))
+ return x+x;
+ if(__builtin_expect((ix|lx)==0, 0))
+ return -HUGE_VAL+x; /* -inf and overflow exception. */;
+ if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
sign = 1;
if(n<0){
n = -n;
@@ -245,7 +239,7 @@ static double zero = 0.00000000000000000000e+00;
}
if(n==0) return(__ieee754_y0(x));
if(n==1) return(sign*__ieee754_y1(x));
- if(ix==0x7ff00000) return zero;
+ if(__builtin_expect(ix==0x7ff00000, 0)) return zero;
if(ix>=0x52D00000) { /* x > 2**302 */
/* (x >> n**2)
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
@@ -256,7 +250,7 @@ static double zero = 0.00000000000000000000e+00;
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
* 0 s-c c+s
- * 1 -s-c -c+s
+ * 1 -s-c -c+s
* 2 -s+c -c-s
* 3 s+c c-s
*/
@@ -285,3 +279,4 @@ static double zero = 0.00000000000000000000e+00;
}
if(sign>0) return b; else return -b;
}
+strong_alias (__ieee754_yn, __yn_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c
index a298a5a2a..e26ce8a24 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_lgamma_r.c
@@ -10,19 +10,15 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_lgamma_r.c,v 1.7 1995/05/10 20:45:42 jtc Exp $";
-#endif
-
/* __ieee754_lgamma_r(x, signgamp)
* Reentrant version of the logarithm of the Gamma function
* with user provide pointer for the sign of Gamma(x).
*
* Method:
* 1. Argument Reduction for 0 < x <= 8
- * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
- * reduce x to a number in [1.5,2.5] by
- * lgamma(1+s) = log(s) + lgamma(s)
+ * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
+ * reduce x to a number in [1.5,2.5] by
+ * lgamma(1+s) = log(s) + lgamma(s)
* for example,
* lgamma(7.3) = log(6.3) + lgamma(6.3)
* = log(6.3*5.3) + lgamma(5.3)
@@ -56,15 +52,15 @@ static char rcsid[] = "$NetBSD: e_lgamma_r.c,v 1.7 1995/05/10 20:45:42 jtc Exp $
* Let z = 1/x, then we approximation
* f(z) = lgamma(x) - (x-0.5)(log(x)-1)
* by
- * 3 5 11
+ * 3 5 11
* w = w0 + w1*z + w2*z + w3*z + ... + w6*z
* where
* |w - f(z)| < 2**-58.74
*
* 4. For negative x, since (G is gamma function)
* -x*G(-x)*G(x) = pi/sin(pi*x),
- * we have
- * G(x) = pi/(sin(pi*x)*(-x)*G(-x))
+ * we have
+ * G(x) = pi/(sin(pi*x)*(-x)*G(-x))
* since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0
* Hence, for x<0, signgam = sign(sin(pi*x)) and
* lgamma(x) = log(|Gamma(x)|)
@@ -77,18 +73,14 @@ static char rcsid[] = "$NetBSD: e_lgamma_r.c,v 1.7 1995/05/10 20:45:42 jtc Exp $
* lgamma(1)=lgamma(2)=0
* lgamma(x) ~ -log(x) for tiny x
* lgamma(0) = lgamma(inf) = inf
- * lgamma(-integer) = +-inf
+ * lgamma(-integer) = +-inf
*
*/
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
@@ -156,18 +148,10 @@ w4 = -5.95187557450339963135e-04, /* 0xBF4380CB, 0x8C0FE741 */
w5 = 8.36339918996282139126e-04, /* 0x3F4B67BA, 0x4CDAD5D1 */
w6 = -1.63092934096575273989e-03; /* 0xBF5AB89D, 0x0B9E43E4 */
-#ifdef __STDC__
static const double zero= 0.00000000000000000000e+00;
-#else
-static double zero= 0.00000000000000000000e+00;
-#endif
-#ifdef __STDC__
- static double sin_pi(double x)
-#else
- static double sin_pi(x)
- double x;
-#endif
+static double
+sin_pi(double x)
{
double y,z;
int n,ix;
@@ -188,16 +172,16 @@ static double zero= 0.00000000000000000000e+00;
y = 2.0*(y - __floor(y)); /* y = |x| mod 2.0 */
n = (int) (y*4.0);
} else {
- if(ix>=0x43400000) {
- y = zero; n = 0; /* y must be even */
- } else {
- if(ix<0x43300000) z = y+two52; /* exact */
+ if(ix>=0x43400000) {
+ y = zero; n = 0; /* y must be even */
+ } else {
+ if(ix<0x43300000) z = y+two52; /* exact */
GET_LOW_WORD(n,z);
n &= 1;
- y = n;
- n<<= 2;
- }
- }
+ y = n;
+ n<<= 2;
+ }
+ }
switch (n) {
case 0: y = __sin(pi*y); break;
case 1:
@@ -212,12 +196,8 @@ static double zero= 0.00000000000000000000e+00;
}
-#ifdef __STDC__
- double __ieee754_lgamma_r(double x, int *signgamp)
-#else
- double __ieee754_lgamma_r(x,signgamp)
- double x; int *signgamp;
-#endif
+double
+__ieee754_lgamma_r(double x, int *signgamp)
{
double t,y,z,nadj,p,p1,p2,p3,q,r,w;
int i,hx,lx,ix;
@@ -227,21 +207,23 @@ static double zero= 0.00000000000000000000e+00;
/* purge off +-inf, NaN, +-0, and negative arguments */
*signgamp = 1;
ix = hx&0x7fffffff;
- if(ix>=0x7ff00000) return x*x;
- if((ix|lx)==0)
+ if(__builtin_expect(ix>=0x7ff00000, 0)) return x*x;
+ if(__builtin_expect((ix|lx)==0, 0))
{
if (hx < 0)
*signgamp = -1;
return one/fabs(x);
}
- if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */
+ if(__builtin_expect(ix<0x3b900000, 0)) {
+ /* |x|<2**-70, return -log(|x|) */
if(hx<0) {
- *signgamp = -1;
- return -__ieee754_log(-x);
+ *signgamp = -1;
+ return -__ieee754_log(-x);
} else return -__ieee754_log(x);
}
if(hx<0) {
- if(ix>=0x43300000) /* |x|>=2**52, must be -integer */
+ if(__builtin_expect(ix>=0x43300000, 0))
+ /* |x|>=2**52, must be -integer */
return x/zero;
t = sin_pi(x);
if(t==zero) return one/fabsf(t); /* -integer */
@@ -254,15 +236,15 @@ static double zero= 0.00000000000000000000e+00;
if((((ix-0x3ff00000)|lx)==0)||(((ix-0x40000000)|lx)==0)) r = 0;
/* for x < 2.0 */
else if(ix<0x40000000) {
- if(ix<=0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */
+ if(ix<=0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */
r = -__ieee754_log(x);
if(ix>=0x3FE76944) {y = one-x; i= 0;}
else if(ix>=0x3FCDA661) {y= x-(tc-one); i=1;}
- else {y = x; i=2;}
+ else {y = x; i=2;}
} else {
- r = zero;
- if(ix>=0x3FFBB4C3) {y=2.0-x;i=0;} /* [1.7316,2] */
- else if(ix>=0x3FF3B4C4) {y=x-tc;i=1;} /* [1.23,1.73] */
+ r = zero;
+ if(ix>=0x3FFBB4C3) {y=2.0-x;i=0;} /* [1.7316,2] */
+ else if(ix>=0x3FF3B4C4) {y=x-tc;i=1;} /* [1.23,1.73] */
else {y=x-one;i=2;}
}
switch(i) {
@@ -286,7 +268,7 @@ static double zero= 0.00000000000000000000e+00;
r += (-0.5*y + p1/p2);
}
}
- else if(ix<0x40200000) { /* x < 8.0 */
+ else if(ix<0x40200000) { /* x < 8.0 */
i = (int)x;
t = zero;
y = x-(double)i;
@@ -315,3 +297,4 @@ static double zero= 0.00000000000000000000e+00;
if(hx<0) r = nadj - r;
return r;
}
+strong_alias (__ieee754_lgamma_r, __lgamma_r_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_log.c b/libc/sysdeps/ieee754/dbl-64/e_log.c
index 1a9967b54..14851638a 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_log.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_log.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -36,7 +36,7 @@
#include "endian.h"
-#include "dla.h"
+#include <dla.h>
#include "mpa.h"
#include "MathLib.h"
#include "math_private.h"
@@ -55,9 +55,12 @@ double __ieee754_log(double x) {
int k;
#endif
double dbl_n,u,p0,q,r0,w,nln2a,luai,lubi,lvaj,lvbj,
- sij,ssij,ttij,A,B,B0,y,y1,y2,polI,polII,sa,sb,
- t1,t2,t3,t4,t5,t6,t7,t8,t,ra,rb,ww,
- a0,aa0,s1,s2,ss2,s3,ss3,a1,aa1,a,aa,b,bb,c;
+ sij,ssij,ttij,A,B,B0,y,y1,y2,polI,polII,sa,sb,
+ t1,t2,t7,t8,t,ra,rb,ww,
+ a0,aa0,s1,s2,ss2,s3,ss3,a1,aa1,a,aa,b,bb,c;
+#ifndef DLA_FMA
+ double t3,t4,t5,t6;
+#endif
number num;
mp_no mpx,mpy,mpy1,mpy2,mperr;
@@ -68,18 +71,21 @@ double __ieee754_log(double x) {
num.d = x; ux = num.i[HIGH_HALF]; dx = num.i[LOW_HALF];
n=0;
- if (ux < 0x00100000) {
- if (((ux & 0x7fffffff) | dx) == 0) return MHALF/ZERO; /* return -INF */
- if (ux < 0) return (x-x)/ZERO; /* return NaN */
+ if (__builtin_expect(ux < 0x00100000, 0)) {
+ if (__builtin_expect(((ux & 0x7fffffff) | dx) == 0, 0))
+ return MHALF/ZERO; /* return -INF */
+ if (__builtin_expect(ux < 0, 0))
+ return (x-x)/ZERO; /* return NaN */
n -= 54; x *= two54.d; /* scale x */
num.d = x;
}
- if (ux >= 0x7ff00000) return x+x; /* INF or NaN */
+ if (__builtin_expect(ux >= 0x7ff00000, 0))
+ return x+x; /* INF or NaN */
/* Regular values of x */
w = x-ONE;
- if (ABS(w) > U03) { goto case_03; }
+ if (__builtin_expect(ABS(w) > U03, 1)) { goto case_03; }
/*--- Stage I, the case abs(x-1) < 0.03 */
@@ -90,7 +96,7 @@ double __ieee754_log(double x) {
/* Evaluate polynomial II */
polII = (b0.d+w*(b1.d+w*(b2.d+w*(b3.d+w*(b4.d+
- w*(b5.d+w*(b6.d+w*(b7.d+w*b8.d))))))))*w*w*w;
+ w*(b5.d+w*(b6.d+w*(b7.d+w*b8.d))))))))*w*w*w;
c = (aa+bb)+polII;
/* End stage I, case abs(x-1) < 0.03 */
@@ -99,7 +105,7 @@ double __ieee754_log(double x) {
/*--- Stage II, the case abs(x-1) < 0.03 */
a = d11.d+w*(d12.d+w*(d13.d+w*(d14.d+w*(d15.d+w*(d16.d+
- w*(d17.d+w*(d18.d+w*(d19.d+w*d20.d))))))));
+ w*(d17.d+w*(d18.d+w*(d19.d+w*d20.d))))))));
EMULV(w,a,s2,ss2,t1,t2,t3,t4,t5)
ADD2(d10.d,dd10.d,s2,ss2,s3,ss3,t1,t2)
MUL2(w,ZERO,s3,ss3,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
@@ -201,3 +207,4 @@ double __ieee754_log(double x) {
}
return y1;
}
+strong_alias (__ieee754_log, __log_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_log10.c b/libc/sysdeps/ieee754/dbl-64/e_log10.c
index e8a3278ea..6a630bcef 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_log10.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_log10.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_log10.c,v 1.9 1995/05/10 20:45:51 jtc Exp $";
-#endif
-
/* __ieee754_log10(x)
* Return the base 10 logarithm of x
*
@@ -50,28 +46,16 @@ static char rcsid[] = "$NetBSD: e_log10.c,v 1.9 1995/05/10 20:45:51 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */
log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */
-#ifdef __STDC__
static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-#ifdef __STDC__
- double __ieee754_log10(double x)
-#else
- double __ieee754_log10(x)
- double x;
-#endif
+double
+__ieee754_log10(double x)
{
double y,z;
int32_t i,k,hx;
@@ -79,20 +63,22 @@ static double zero = 0.0;
EXTRACT_WORDS(hx,lx,x);
- k=0;
- if (hx < 0x00100000) { /* x < 2**-1022 */
- if (((hx&0x7fffffff)|lx)==0)
- return -two54/(x-x); /* log(+-0)=-inf */
- if (hx<0) return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 54; x *= two54; /* subnormal number, scale up x */
+ k=0;
+ if (hx < 0x00100000) { /* x < 2**-1022 */
+ if (__builtin_expect(((hx&0x7fffffff)|lx)==0, 0))
+ return -two54/(x-x); /* log(+-0)=-inf */
+ if (__builtin_expect(hx<0, 0))
+ return (x-x)/(x-x); /* log(-#) = NaN */
+ k -= 54; x *= two54; /* subnormal number, scale up x */
GET_HIGH_WORD(hx,x);
- }
- if (hx >= 0x7ff00000) return x+x;
+ }
+ if (__builtin_expect(hx >= 0x7ff00000, 0)) return x+x;
k += (hx>>20)-1023;
i = ((u_int32_t)k&0x80000000)>>31;
- hx = (hx&0x000fffff)|((0x3ff-i)<<20);
- y = (double)(k+i);
+ hx = (hx&0x000fffff)|((0x3ff-i)<<20);
+ y = (double)(k+i);
SET_HIGH_WORD(x,hx);
z = y*log10_2lo + ivln10*__ieee754_log(x);
return z+y*log10_2hi;
}
+strong_alias (__ieee754_log10, __log10_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_log2.c b/libc/sysdeps/ieee754/dbl-64/e_log2.c
index f05d0ce96..be41cb4e6 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_log2.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_log2.c
@@ -21,14 +21,14 @@
* 2. Approximation of log(1+f).
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
- * = 2s + s*R
+ * = 2s + s*R
* We use a special Reme algorithm on [0,0.1716] to generate
- * a polynomial of degree 14 to approximate R The maximum error
+ * a polynomial of degree 14 to approximate R The maximum error
* of this polynomial approximation is bounded by 2**-58.45. In
* other words,
- * 2 4 6 8 10 12 14
+ * 2 4 6 8 10 12 14
* R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
- * (the values of Lg1 to Lg7 are listed in the program)
+ * (the values of Lg1 to Lg7 are listed in the program)
* and
* | 2 14 | -58.45
* | Lg1*s +...+Lg7*s - R(z) | <= 2
@@ -57,11 +57,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
ln2 = 0.69314718055994530942,
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
@@ -72,18 +68,10 @@ Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
-#ifdef __STDC__
static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-#ifdef __STDC__
- double __ieee754_log2(double x)
-#else
- double __ieee754_log2(x)
- double x;
-#endif
+double
+__ieee754_log2(double x)
{
double hfsq,f,s,z,R,w,t1,t2,dk;
int32_t k,hx,i,j;
@@ -93,13 +81,14 @@ static double zero = 0.0;
k=0;
if (hx < 0x00100000) { /* x < 2**-1022 */
- if (((hx&0x7fffffff)|lx)==0)
+ if (__builtin_expect(((hx&0x7fffffff)|lx)==0, 0))
return -two54/(x-x); /* log(+-0)=-inf */
- if (hx<0) return (x-x)/(x-x); /* log(-#) = NaN */
+ if (__builtin_expect(hx<0, 0))
+ return (x-x)/(x-x); /* log(-#) = NaN */
k -= 54; x *= two54; /* subnormal number, scale up x */
GET_HIGH_WORD(hx,x);
}
- if (hx >= 0x7ff00000) return x+x;
+ if (__builtin_expect(hx >= 0x7ff00000, 0)) return x+x;
k += (hx>>20)-1023;
hx &= 0x000fffff;
i = (hx+0x95f64)&0x100000;
@@ -112,7 +101,7 @@ static double zero = 0.0;
R = f*f*(0.5-0.33333333333333333*f);
return dk-(R-f)/ln2;
}
- s = f/(2.0+f);
+ s = f/(2.0+f);
z = s*s;
i = hx-0x6147a;
w = z*z;
@@ -128,3 +117,4 @@ static double zero = 0.0;
return dk-((s*(f-R))-f)/ln2;
}
}
+strong_alias (__ieee754_log2, __log2_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_pow.c b/libc/sysdeps/ieee754/dbl-64/e_pow.c
index 1e159f2c0..789054015 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_pow.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2002, 2004 Free Software Foundation
+ * Copyright (C) 2001, 2002, 2004, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -22,12 +22,12 @@
/* */
/* FUNCTIONS: upow */
/* power1 */
-/* my_log2 */
+/* my_log2 */
/* log1 */
/* checkint */
/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h */
/* halfulp.c mpexp.c mplog.c slowexp.c slowpow.c mpa.c */
-/* uexp.c upow.c */
+/* uexp.c upow.c */
/* root.tbl uexp.tbl upow.tbl */
/* An ultimate power routine. Given two IEEE double machine numbers y,x */
/* it computes the correctly rounded (to nearest) value of x^y. */
@@ -37,7 +37,7 @@
/***************************************************************************/
#include "endian.h"
#include "upow.h"
-#include "dla.h"
+#include <dla.h>
#include "mydefs.h"
#include "MathLib.h"
#include "upow.tbl"
@@ -77,7 +77,7 @@ double __ieee754_pow(double x, double y) {
/* else */
if(((u.i[HIGH_HALF]>0 && u.i[HIGH_HALF]<0x7ff00000)|| /* x>0 and not x->0 */
(u.i[HIGH_HALF]==0 && u.i[LOW_HALF]!=0)) &&
- /* 2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
+ /* 2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
(v.i[HIGH_HALF]&0x7fffffff) < 0x4ff00000) { /* if y<-1 or y>1 */
z = log1(x,&aa,&error); /* x^y =e^(y log (X)) */
t = y*134217729.0;
@@ -153,6 +153,7 @@ double __ieee754_pow(double x, double y) {
if (y<0) return (x<1.0)?INF.x:0;
return 0; /* unreachable, to make the compiler happy */
}
+strong_alias (__ieee754_pow, __pow_finite)
/**************************************************************************/
/* Computing x^y using more accurate but more slow log routine */
@@ -282,7 +283,10 @@ static double my_log2(double x, double *delta, double *error) {
double cor;
#endif
double ou1,ou2,lu1,lu2,ov,lv1,lv2,a,a1,a2;
- double y,yy,z,zz,j1,j2,j3,j4,j5,j6,j7,j8;
+ double y,yy,z,zz,j1,j2,j7,j8;
+#ifndef DLA_FMA
+ double j3,j4,j5,j6;
+#endif
mynumber u,v;
#ifdef BIG_ENDI
mynumber
diff --git a/libc/sysdeps/ieee754/dbl-64/e_remainder.c b/libc/sysdeps/ieee754/dbl-64/e_remainder.c
index cc06e18ce..d1782a15c 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_remainder.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_remainder.c
@@ -1,8 +1,8 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
- *
+ * Copyright (C) 2001, 2011 Free Software Foundation
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
@@ -96,9 +96,9 @@ double __ieee754_remainder(double x, double y)
u.x=(u.x-d*w.x)-d*ww.x;
if (ABS(u.x)<0.5*t.x) return (u.x!=0)?u.x:((x>0)?ZERO.x:nZERO.x);
else
- if (ABS(u.x)>0.5*t.x) return (d>z)?u.x+t.x:u.x-t.x;
- else
- {z=u.x/t.x; d=(z+big.x)-big.x; return ((u.x-d*w.x)-d*ww.x);}
+ if (ABS(u.x)>0.5*t.x) return (d>z)?u.x+t.x:u.x-t.x;
+ else
+ {z=u.x/t.x; d=(z+big.x)-big.x; return ((u.x-d*w.x)-d*ww.x);}
}
} /* (kx<0x7fe00000&&ky<0x7ff00000&&ky>=0x03500000) */
@@ -128,3 +128,4 @@ double __ieee754_remainder(double x, double y)
}
}
}
+strong_alias (__ieee754_remainder, __remainder_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_sinh.c b/libc/sysdeps/ieee754/dbl-64/e_sinh.c
index 1701b9bb6..50463c304 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_sinh.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_sinh.c
@@ -5,7 +5,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.
* ====================================================
*/
@@ -15,15 +15,15 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
#endif
/* __ieee754_sinh(x)
- * Method :
+ * Method :
* mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
- * 1. Replace x by |x| (sinh(-x) = -sinh(x)).
- * 2.
- * E + E/(E+1)
+ * 1. Replace x by |x| (sinh(-x) = -sinh(x)).
+ * 2.
+ * E + E/(E+1)
* 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
- * 2
+ * 2
*
- * 22 <= x <= lnovft : sinh(x) := exp(x)/2
+ * 22 <= x <= lnovft : sinh(x) := exp(x)/2
* lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2)
* ln2ovft < x : sinh(x) := x*shuge (overflow)
*
@@ -35,19 +35,11 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double one = 1.0, shuge = 1.0e307;
-#else
-static double one = 1.0, shuge = 1.0e307;
-#endif
-#ifdef __STDC__
- double __ieee754_sinh(double x)
-#else
- double __ieee754_sinh(x)
- double x;
-#endif
-{
+double
+__ieee754_sinh(double x)
+{
double t,w,h;
int32_t ix,jx;
u_int32_t lx;
@@ -57,14 +49,15 @@ static double one = 1.0, shuge = 1.0e307;
ix = jx&0x7fffffff;
/* x is INF or NaN */
- if(ix>=0x7ff00000) return x+x;
+ if(__builtin_expect(ix>=0x7ff00000, 0)) return x+x;
h = 0.5;
if (jx<0) h = -h;
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x40360000) { /* |x|<22 */
- if (ix<0x3e300000) /* |x|<2**-28 */
- if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
+ if (__builtin_expect(ix<0x3e300000, 0)) /* |x|<2**-28 */
+ if(shuge+x>one)
+ return x;/* sinh(tiny) = tiny with inexact */
t = __expm1(fabs(x));
if(ix<0x3ff00000) return h*(2.0*t-t*t/(t+one));
return h*(t+t/(t+one));
@@ -84,3 +77,4 @@ static double one = 1.0, shuge = 1.0e307;
/* |x| > overflowthresold, sinh(x) overflow */
return x*shuge;
}
+strong_alias (__ieee754_sinh, __sinh_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/e_sqrt.c b/libc/sysdeps/ieee754/dbl-64/e_sqrt.c
index f7e805549..c507c598d 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_sqrt.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_sqrt.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -35,7 +35,7 @@
#include "endian.h"
#include "mydefs.h"
-#include "dla.h"
+#include <dla.h>
#include "MathLib.h"
#include "root.tbl"
#include "math_private.h"
@@ -86,3 +86,4 @@ double __ieee754_sqrt(double x) {
return tm256.x*__ieee754_sqrt(x*t512.x);
}
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/halfulp.c b/libc/sysdeps/ieee754/dbl-64/halfulp.c
index 478a4bacf..373d40522 100644
--- a/libc/sysdeps/ieee754/dbl-64/halfulp.c
+++ b/libc/sysdeps/ieee754/dbl-64/halfulp.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2005 Free Software Foundation
+ * Copyright (C) 2001, 2005, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -37,22 +37,23 @@
#include "endian.h"
#include "mydefs.h"
-#include "dla.h"
+#include <dla.h>
#include "math_private.h"
-double __ieee754_sqrt(double x);
-
static const int4 tab54[32] = {
262143, 11585, 1782, 511, 210, 107, 63, 42,
30, 22, 17, 14, 12, 10, 9, 7,
- 7, 6, 5, 5, 5, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3 };
+ 7, 6, 5, 5, 5, 4, 4, 4,
+ 3, 3, 3, 3, 3, 3, 3, 3 };
double __halfulp(double x, double y)
{
mynumber v;
- double z,u,uu,j1,j2,j3,j4,j5;
+ double z,u,uu;
+#ifndef DLA_FMA
+ double j1,j2,j3,j4,j5;
+#endif
int4 k,l,m,n;
if (y <= 0) { /*if power is negative or zero */
v.x = y;
@@ -64,12 +65,12 @@ double __halfulp(double x, double y)
z = (double) k;
return (z*y == -1075.0)?0: -10.0;
}
- /* if y > 0 */
+ /* if y > 0 */
v.x = y;
if (v.i[LOW_HALF] != 0) return -10.0;
v.x=x;
- /* case where x = 2**n for some integer n */
+ /* case where x = 2**n for some integer n */
if (((v.i[HIGH_HALF]&0x000fffff)|v.i[LOW_HALF]) == 0) {
k=(v.i[HIGH_HALF]>>20)-1023;
return (((double) k)*y == -1075.0)?0:-10.0;
@@ -90,7 +91,7 @@ double __halfulp(double x, double y)
k = -k;
if (k>5) return -10.0;
- /* now treat x */
+ /* now treat x */
while (k>0) {
z = __ieee754_sqrt(x);
EMULV(z,z,u,uu,j1,j2,j3,j4,j5);
@@ -111,11 +112,11 @@ double __halfulp(double x, double y)
m = (k&0x000fffff)|0x00100000;
m = m>>(20-l); /* m is the odd integer of x */
- /* now check whether the length of m**n is at most 54 bits */
+ /* now check whether the length of m**n is at most 54 bits */
if (m > tab54[n-3]) return -10.0;
- /* yes, it is - now compute x**n by simple multiplications */
+ /* yes, it is - now compute x**n by simple multiplications */
u = x;
for (k=1;k<n;k++) u = u*x;
diff --git a/libc/sysdeps/ieee754/dbl-64/s_asinh.c b/libc/sysdeps/ieee754/dbl-64/s_asinh.c
index 985cfe32e..93789fb41 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_asinh.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_asinh.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_asinh.c,v 1.9 1995/05/12 04:57:37 jtc Exp $";
-#endif
-
/* asinh(x)
* Method :
* Based on
@@ -28,40 +24,34 @@ static char rcsid[] = "$NetBSD: s_asinh.c,v 1.9 1995/05/12 04:57:37 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
ln2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */
huge= 1.00000000000000000000e+300;
-#ifdef __STDC__
- double __asinh(double x)
-#else
- double __asinh(x)
- double x;
-#endif
+double
+__asinh(double x)
{
- double t,w;
+ double w;
int32_t hx,ix;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
- if(ix>=0x7ff00000) return x+x; /* x is inf or NaN */
- if(ix< 0x3e300000) { /* |x|<2**-28 */
+ if(__builtin_expect(ix< 0x3e300000, 0)) { /* |x|<2**-28 */
if(huge+x>one) return x; /* return x inexact except 0 */
}
- if(ix>0x41b00000) { /* |x| > 2**28 */
+ if(__builtin_expect(ix>0x41b00000, 0)) { /* |x| > 2**28 */
+ if(ix>=0x7ff00000) return x+x; /* x is inf or NaN */
w = __ieee754_log(fabs(x))+ln2;
- } else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */
- t = fabs(x);
- w = __ieee754_log(2.0*t+one/(__ieee754_sqrt(x*x+one)+t));
- } else { /* 2.0 > |x| > 2**-28 */
- t = x*x;
- w =__log1p(fabs(x)+t/(one+__ieee754_sqrt(one+t)));
+ } else {
+ double xa = fabs(x);
+ if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */
+ w = __ieee754_log(2.0*xa+one/(__ieee754_sqrt(xa*xa+one)+xa));
+ } else { /* 2.0 > |x| > 2**-28 */
+ double t = xa*xa;
+ w =__log1p(xa+t/(one+__ieee754_sqrt(one+t)));
+ }
}
- if(hx>0) return w; else return -w;
+ return __copysign(w, x);
}
weak_alias (__asinh, asinh)
#ifdef NO_LONG_DOUBLE
diff --git a/libc/sysdeps/ieee754/dbl-64/s_atan.c b/libc/sysdeps/ieee754/dbl-64/s_atan.c
index 556f5b216..5ea83261a 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_atan.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_atan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -37,7 +37,7 @@
/* */
/************************************************************************/
-#include "dla.h"
+#include <dla.h>
#include "mpa.h"
#include "MathLib.h"
#include "uatan.tbl"
@@ -52,8 +52,11 @@ double __signArctan(double,double);
double atan(double x) {
- double cor,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,u,u2,u3,
- v,vv,w,ww,y,yy,z,zz;
+ double cor,s1,ss1,s2,ss2,t1,t2,t3,t7,t8,t9,t10,u,u2,u3,
+ v,vv,w,ww,y,yy,z,zz;
+#ifndef DLA_FMA
+ double t4,t5,t6;
+#endif
#if 0
double y1,y2;
#endif
@@ -78,44 +81,44 @@ double atan(double x) {
if (u<C) {
if (u<B) {
if (u<A) { /* u < A */
- return x; }
+ return x; }
else { /* A <= u < B */
- v=x*x; yy=x*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
- if ((y=x+(yy-U1*x)) == x+(yy+U1*x)) return y;
-
- EMULV(x,x,v,vv,t1,t2,t3,t4,t5) /* v+vv=x^2 */
- s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
- ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- MUL2(x,ZERO,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(x,ZERO,s2,ss2,s1,ss1,t1,t2)
- if ((y=s1+(ss1-U5*s1)) == s1+(ss1+U5*s1)) return y;
-
- return atanMp(x,pr);
+ v=x*x; yy=x*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
+ if ((y=x+(yy-U1*x)) == x+(yy+U1*x)) return y;
+
+ EMULV(x,x,v,vv,t1,t2,t3,t4,t5) /* v+vv=x^2 */
+ s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
+ ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ MUL2(x,ZERO,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(x,ZERO,s2,ss2,s1,ss1,t1,t2)
+ if ((y=s1+(ss1-U5*s1)) == s1+(ss1+U5*s1)) return y;
+
+ return atanMp(x,pr);
} }
else { /* B <= u < C */
i=(TWO52+TWO8*u)-TWO52; i-=16;
z=u-cij[i][0].d;
yy=z*(cij[i][2].d+z*(cij[i][3].d+z*(cij[i][4].d+
- z*(cij[i][5].d+z* cij[i][6].d))));
+ z*(cij[i][5].d+z* cij[i][6].d))));
t1=cij[i][1].d;
if (i<112) {
- if (i<48) u2=U21; /* u < 1/4 */
- else u2=U22; } /* 1/4 <= u < 1/2 */
+ if (i<48) u2=U21; /* u < 1/4 */
+ else u2=U22; } /* 1/4 <= u < 1/2 */
else {
- if (i<176) u2=U23; /* 1/2 <= u < 3/4 */
- else u2=U24; } /* 3/4 <= u <= 1 */
+ if (i<176) u2=U23; /* 1/2 <= u < 3/4 */
+ else u2=U24; } /* 3/4 <= u <= 1 */
if ((y=t1+(yy-u2*t1)) == t1+(yy+u2*t1)) return __signArctan(x,y);
z=u-hij[i][0].d;
s1=z*(hij[i][11].d+z*(hij[i][12].d+z*(hij[i][13].d+
- z*(hij[i][14].d+z* hij[i][15].d))));
+ z*(hij[i][14].d+z* hij[i][15].d))));
ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
MUL2(z,ZERO,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
@@ -138,7 +141,7 @@ double atan(double x) {
i=(TWO52+TWO8*w)-TWO52; i-=16;
z=(w-cij[i][0].d)+ww;
yy=HPI1-z*(cij[i][2].d+z*(cij[i][3].d+z*(cij[i][4].d+
- z*(cij[i][5].d+z* cij[i][6].d))));
+ z*(cij[i][5].d+z* cij[i][6].d))));
t1=HPI-cij[i][1].d;
if (i<112) u3=U31; /* w < 1/2 */
else u3=U32; /* w >= 1/2 */
@@ -148,7 +151,7 @@ double atan(double x) {
t1=w-hij[i][0].d;
EADD(t1,ww,z,zz)
s1=z*(hij[i][11].d+z*(hij[i][12].d+z*(hij[i][13].d+
- z*(hij[i][14].d+z* hij[i][15].d))));
+ z*(hij[i][14].d+z* hij[i][15].d))));
ADD2(hij[i][9].d,hij[i][10].d,s1,ZERO,s2,ss2,t1,t2)
MUL2(z,zz,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
ADD2(hij[i][7].d,hij[i][8].d,s1,ss1,s2,ss2,t1,t2)
@@ -165,36 +168,36 @@ double atan(double x) {
}
else {
if (u<E) { /* D <= u < E */
- w=ONE/u; v=w*w;
- EMULV(w,u,t1,t2,t3,t4,t5,t6,t7)
- yy=w*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
- ww=w*((ONE-t1)-t2);
- ESUB(HPI,w,t3,cor)
- yy=((HPI1+cor)-ww)-yy;
- if ((y=t3+(yy-U4)) == t3+(yy+U4)) return __signArctan(x,y);
-
- DIV2(ONE,ZERO,u,ZERO,w,ww,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
- MUL2(w,ww,w,ww,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
- s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
- ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
- MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
- MUL2(w,ww,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
- ADD2(w,ww,s2,ss2,s1,ss1,t1,t2)
- SUB2(HPI,HPI1,s1,ss1,s2,ss2,t1,t2)
- if ((y=s2+(ss2-U8)) == s2+(ss2+U8)) return __signArctan(x,y);
+ w=ONE/u; v=w*w;
+ EMULV(w,u,t1,t2,t3,t4,t5,t6,t7)
+ yy=w*v*(d3.d+v*(d5.d+v*(d7.d+v*(d9.d+v*(d11.d+v*d13.d)))));
+ ww=w*((ONE-t1)-t2);
+ ESUB(HPI,w,t3,cor)
+ yy=((HPI1+cor)-ww)-yy;
+ if ((y=t3+(yy-U4)) == t3+(yy+U4)) return __signArctan(x,y);
+
+ DIV2(ONE,ZERO,u,ZERO,w,ww,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+ MUL2(w,ww,w,ww,v,vv,t1,t2,t3,t4,t5,t6,t7,t8)
+ s1=v*(f11.d+v*(f13.d+v*(f15.d+v*(f17.d+v*f19.d))));
+ ADD2(f9.d,ff9.d,s1,ZERO,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f7.d,ff7.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f5.d,ff5.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(f3.d,ff3.d,s1,ss1,s2,ss2,t1,t2)
+ MUL2(v,vv,s2,ss2,s1,ss1,t1,t2,t3,t4,t5,t6,t7,t8)
+ MUL2(w,ww,s1,ss1,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
+ ADD2(w,ww,s2,ss2,s1,ss1,t1,t2)
+ SUB2(HPI,HPI1,s1,ss1,s2,ss2,t1,t2)
+ if ((y=s2+(ss2-U8)) == s2+(ss2+U8)) return __signArctan(x,y);
return atanMp(x,pr);
}
else {
- /* u >= E */
- if (x>0) return HPI;
- else return MHPI; }
+ /* u >= E */
+ if (x>0) return HPI;
+ else return MHPI; }
}
}
diff --git a/libc/sysdeps/ieee754/dbl-64/s_ceil.c b/libc/sysdeps/ieee754/dbl-64/s_ceil.c
index 1b352a679..695cae5d5 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_ceil.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_ceil.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_ceil.c,v 1.8 1995/05/10 20:46:53 jtc Exp $";
-#endif
-
/*
* ceil(x)
* Return x rounded toward -inf to integral value
@@ -26,18 +22,10 @@ static char rcsid[] = "$NetBSD: s_ceil.c,v 1.8 1995/05/10 20:46:53 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double huge = 1.0e300;
-#else
-static double huge = 1.0e300;
-#endif
-#ifdef __STDC__
- double __ceil(double x)
-#else
- double __ceil(x)
- double x;
-#endif
+double
+__ceil(double x)
{
int32_t i0,i1,j0;
u_int32_t i,j;
@@ -78,8 +66,10 @@ static double huge = 1.0e300;
INSERT_WORDS(x,i0,i1);
return x;
}
+#ifndef __ceil
weak_alias (__ceil, ceil)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
strong_alias (__ceil, __ceill)
weak_alias (__ceil, ceill)
+# endif
#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/s_finite.c b/libc/sysdeps/ieee754/dbl-64/s_finite.c
index 90de0f9d1..2ca3bf245 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_finite.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_finite.c
@@ -22,6 +22,7 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $";
#include "math.h"
#include "math_private.h"
+#undef __finite
#ifdef __STDC__
int __finite(double x)
#else
diff --git a/libc/sysdeps/ieee754/dbl-64/s_floor.c b/libc/sysdeps/ieee754/dbl-64/s_floor.c
index 77db9ef39..5b593ca31 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_floor.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_floor.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_floor.c,v 1.8 1995/05/10 20:47:20 jtc Exp $";
-#endif
-
/*
* floor(x)
* Return x rounded toward -inf to integral value
@@ -44,7 +40,7 @@ static double huge = 1.0e300;
EXTRACT_WORDS(i0,i1,x);
j0 = ((i0>>20)&0x7ff)-0x3ff;
if(j0<20) {
- if(j0<0) { /* raise inexact if x != 0 */
+ if(j0<0) { /* raise inexact if x != 0 */
if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
if(i0>=0) {i0=i1=0;}
else if(((i0&0x7fffffff)|i1)!=0)
@@ -64,12 +60,12 @@ static double huge = 1.0e300;
} else {
i = ((u_int32_t)(0xffffffff))>>(j0-20);
if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
+ if(huge+x>0.0) { /* raise inexact flag */
if(i0<0) {
if(j0==20) i0+=1;
else {
j = i1+(1<<(52-j0));
- if(j<i1) i0 +=1 ; /* got a carry */
+ if(j<i1) i0 +=1 ; /* got a carry */
i1=j;
}
}
@@ -79,8 +75,10 @@ static double huge = 1.0e300;
INSERT_WORDS(x,i0,i1);
return x;
}
+#ifndef __floor
weak_alias (__floor, floor)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
strong_alias (__floor, __floorl)
weak_alias (__floor, floorl)
+# endif
#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/s_fma.c b/libc/sysdeps/ieee754/dbl-64/s_fma.c
index 3b0bfd5ce..14c6503de 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_fma.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -22,6 +22,7 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math_private.h>
/* This implementation uses rounding to odd to avoid problems with
double rounding. See a paper by Boldo and Melquiond:
@@ -47,7 +48,7 @@ __fma (double x, double y, double z)
z rather than NaN. */
if (w.ieee.exponent == 0x7ff
&& u.ieee.exponent != 0x7ff
- && v.ieee.exponent != 0x7ff)
+ && v.ieee.exponent != 0x7ff)
return (z + x) + y;
/* If x or y or z is Inf/NaN, or if fma will certainly overflow,
or if x * y is less than half of DBL_DENORM_MIN,
@@ -148,34 +149,33 @@ __fma (double x, double y, double z)
double a2 = t1 + t2;
fenv_t env;
- feholdexcept (&env);
- fesetround (FE_TOWARDZERO);
+ libc_feholdexcept_setround (&env, FE_TOWARDZERO);
/* Perform m2 + a2 addition with round to odd. */
u.d = a2 + m2;
if (__builtin_expect (adjust == 0, 1))
{
if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
- u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
- feupdateenv (&env);
+ u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
+ libc_feupdateenv (&env);
/* Result is a1 + u.d. */
return a1 + u.d;
}
else if (__builtin_expect (adjust > 0, 1))
{
if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
- u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
- feupdateenv (&env);
+ u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
+ libc_feupdateenv (&env);
/* Result is a1 + u.d, scaled up. */
return (a1 + u.d) * 0x1p53;
}
else
{
if ((u.ieee.mantissa1 & 1) == 0)
- u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
+ u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
v.d = a1 + u.d;
- int j = fetestexcept (FE_INEXACT) != 0;
- feupdateenv (&env);
+ int j = libc_fetestexcept (FE_INEXACT) != 0;
+ libc_feupdateenv (&env);
/* Ensure the following computations are performed in default rounding
mode instead of just reusing the round to zero computation. */
asm volatile ("" : "=m" (u) : "m" (u));
diff --git a/libc/sysdeps/ieee754/dbl-64/s_fmaf.c b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
index cd16cd1dc..dc748e554 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,6 +21,7 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math_private.h>
/* This implementation relies on double being more than twice as
precise as float and uses rounding to odd in order to avoid problems
@@ -35,13 +36,12 @@ __fmaf (float x, float y, float z)
/* Multiplication is always exact. */
double temp = (double) x * (double) y;
union ieee754_double u;
- feholdexcept (&env);
- fesetround (FE_TOWARDZERO);
+ libc_feholdexcept_setroundf (&env, FE_TOWARDZERO);
/* Perform addition with round to odd. */
u.d = temp + (double) z;
if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0x7ff)
- u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
- feupdateenv (&env);
+ u.ieee.mantissa1 |= libc_fetestexcept (FE_INEXACT) != 0;
+ libc_feupdateenv (&env);
/* And finally truncation with round to nearest. */
return (float) u.d;
}
diff --git a/libc/sysdeps/ieee754/dbl-64/s_isinf_ns.c b/libc/sysdeps/ieee754/dbl-64/s_isinf_ns.c
new file mode 100644
index 000000000..065522ed8
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/s_isinf_ns.c
@@ -0,0 +1,20 @@
+/*
+ * Written by Ulrich Drepper <drepper@gmail.com>.
+ */
+
+/*
+ * __isinf_ns(x) returns != 0 if x is ±inf, else 0;
+ * no branching!
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#undef __isinf_ns
+int
+__isinf_ns (double x)
+{
+ int32_t hx,lx;
+ EXTRACT_WORDS(hx,lx,x);
+ return !(lx | ((hx & 0x7fffffff) ^ 0x7ff00000));
+}
diff --git a/libc/sysdeps/ieee754/dbl-64/s_isnan.c b/libc/sysdeps/ieee754/dbl-64/s_isnan.c
index 3a089e99a..74e829160 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_isnan.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_isnan.c
@@ -22,6 +22,7 @@ static char rcsid[] = "$NetBSD: s_isnan.c,v 1.8 1995/05/10 20:47:36 jtc Exp $";
#include "math.h"
#include "math_private.h"
+#undef __isnan
#ifdef __STDC__
int __isnan(double x)
#else
diff --git a/libc/sysdeps/ieee754/dbl-64/s_lround.c b/libc/sysdeps/ieee754/dbl-64/s_lround.c
index 4e1302ad4..a849997a1 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_lround.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_lround.c
@@ -51,7 +51,7 @@ __lround (double x)
else if (j0 < (int32_t) (8 * sizeof (long int)) - 1)
{
if (j0 >= 52)
- result = ((long int) i0 << (j0 - 20)) | (i1 << (j0 - 52));
+ result = ((long int) i0 << (j0 - 20)) | ((long int) i1 << (j0 - 52));
else
{
u_int32_t j = i1 + (0x80000000 >> (j0 - 20));
diff --git a/libc/sysdeps/ieee754/dbl-64/s_rint.c b/libc/sysdeps/ieee754/dbl-64/s_rint.c
index 4e6381efb..a671a6277 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_rint.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_rint.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_rint.c,v 1.8 1995/05/10 20:48:04 jtc Exp $";
-#endif
-
/*
* rint(x)
* Return x rounded to integral value according to the prevailing
@@ -27,22 +23,14 @@ static char rcsid[] = "$NetBSD: s_rint.c,v 1.8 1995/05/10 20:48:04 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
TWO52[2]={
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
};
-#ifdef __STDC__
- double __rint(double x)
-#else
- double __rint(x)
- double x;
-#endif
+double
+__rint(double x)
{
int32_t i0,j0,sx;
u_int32_t i,i1;
@@ -57,11 +45,11 @@ TWO52[2]={
i0 &= 0xfffe0000;
i0 |= ((i1|-i1)>>12)&0x80000;
SET_HIGH_WORD(x,i0);
- w = TWO52[sx]+x;
- t = w-TWO52[sx];
+ w = TWO52[sx]+x;
+ t = w-TWO52[sx];
GET_HIGH_WORD(i0,t);
SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
- return t;
+ return t;
} else {
i = (0x000fffff)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
@@ -91,8 +79,10 @@ TWO52[2]={
w = TWO52[sx]+x;
return w-TWO52[sx];
}
+#ifndef __rint
weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
strong_alias (__rint, __rintl)
weak_alias (__rint, rintl)
+# endif
#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/s_tan.c b/libc/sysdeps/ieee754/dbl-64/s_tan.c
index 4e26d90ae..df8eedd92 100644
--- a/libc/sysdeps/ieee754/dbl-64/s_tan.c
+++ b/libc/sysdeps/ieee754/dbl-64/s_tan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2009 Free Software Foundation
+ * Copyright (C) 2001, 2009, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -36,7 +36,7 @@
#include <errno.h>
#include "endian.h"
-#include "dla.h"
+#include <dla.h>
#include "mpa.h"
#include "MathLib.h"
#include "math.h"
@@ -50,7 +50,10 @@ double tan(double x) {
int ux,i,n;
double a,da,a2,b,db,c,dc,c1,cc1,c2,cc2,c3,cc3,fi,ffi,gi,pz,s,sy,
- t,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,w,x2,xn,xx2,y,ya,yya,z0,z,zz,z2,zz2;
+ t,t1,t2,t3,t4,t7,t8,t9,t10,w,x2,xn,xx2,y,ya,yya,z0,z,zz,z2,zz2;
+#ifndef DLA_FMA
+ double t5,t6;
+#endif
int p;
number num,v;
mp_no mpa,mpt1,mpt2;
@@ -84,7 +87,7 @@ double tan(double x) {
/* Second stage */
c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+
- x2*a27.d))))));
+ x2*a27.d))))));
EMULV(x,x,x2,xx2,t1,t2,t3,t4,t5)
ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2)
MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8)
@@ -159,13 +162,13 @@ double tan(double x) {
a2 = a*a;
t2 = da+a*a2*(d3.d+a2*(d5.d+a2*(d7.d+a2*(d9.d+a2*d11.d))));
if (n) {
- /* First stage -cot */
- EADD(a,t2,b,db)
- DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
- if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c)) return (-y); }
+ /* First stage -cot */
+ EADD(a,t2,b,db)
+ DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+ if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c)) return (-y); }
else {
- /* First stage tan */
- if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a)) return y; }
+ /* First stage tan */
+ if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a)) return y; }
/* Second stage */
/* Range reduction by algorithm ii */
t = (x*hpinv.d + toint.d);
@@ -184,7 +187,7 @@ double tan(double x) {
EADD(a,da,t1,t2) a=t1; da=t2;
MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8)
c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+
- x2*a27.d))))));
+ x2*a27.d))))));
ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2)
MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8)
ADD2(a11.d,aa11.d,c1,cc1,c2,cc2,t1,t2)
@@ -201,12 +204,12 @@ double tan(double x) {
ADD2(a ,da ,c2,cc2,c1,cc1,t1,t2)
if (n) {
- /* Second stage -cot */
- DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
- if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2)) return (-y); }
+ /* Second stage -cot */
+ DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+ if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2)) return (-y); }
else {
- /* Second stage tan */
- if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1)) return y; }
+ /* Second stage tan */
+ if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1)) return y; }
return tanMp(x);
}
@@ -287,18 +290,18 @@ double tan(double x) {
a2 = a*a;
t2 = da+a*a2*(d3.d+a2*(d5.d+a2*(d7.d+a2*(d9.d+a2*d11.d))));
if (n) {
- /* First stage -cot */
- EADD(a,t2,b,db)
- DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
- if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c)) return (-y); }
+ /* First stage -cot */
+ EADD(a,t2,b,db)
+ DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+ if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c)) return (-y); }
else {
- /* First stage tan */
- if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a)) return y; }
+ /* First stage tan */
+ if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a)) return y; }
/* Second stage */
MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8)
c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+
- x2*a27.d))))));
+ x2*a27.d))))));
ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2)
MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8)
ADD2(a11.d,aa11.d,c1,cc1,c2,cc2,t1,t2)
@@ -315,12 +318,12 @@ double tan(double x) {
ADD2(a ,da ,c2,cc2,c1,cc1,t1,t2)
if (n) {
- /* Second stage -cot */
- DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
- if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2)) return (-y); }
+ /* Second stage -cot */
+ DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+ if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2)) return (-y); }
else {
- /* Second stage tan */
- if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1)) return (y); }
+ /* Second stage tan */
+ if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1)) return (y); }
return tanMp(x);
}
@@ -404,7 +407,7 @@ double tan(double x) {
MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8)
c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+
- x2*a27.d))))));
+ x2*a27.d))))));
ADD2(a13.d,aa13.d,c1,zero.d,c2,cc2,t1,t2)
MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8)
ADD2(a11.d,aa11.d,c1,cc1,c2,cc2,t1,t2)
diff --git a/libc/sysdeps/ieee754/dbl-64/w_exp.c b/libc/sysdeps/ieee754/dbl-64/w_exp.c
index 121649209..f1becff94 100644
--- a/libc/sysdeps/ieee754/dbl-64/w_exp.c
+++ b/libc/sysdeps/ieee754/dbl-64/w_exp.c
@@ -1,55 +1,46 @@
-/* @(#)w_exp.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_exp.c,v 1.6 1995/05/10 20:48:51 jtc Exp $";
-#endif
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-/*
- * wrapper exp(x)
- */
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-#include "math.h"
-#include "math_private.h"
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <math.h>
+#include <math_private.h>
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */
u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */
-#ifdef __STDC__
- double __exp(double x) /* wrapper exp */
-#else
- double __exp(x) /* wrapper exp */
- double x;
-#endif
+
+/* wrapper exp */
+double
+__exp (double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_exp(x);
-#else
- double z;
- z = __ieee754_exp(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(__finite(x)) {
- if(x>o_threshold)
- return __kernel_standard(x,x,6); /* exp overflow */
- else if(x<u_threshold)
- return __kernel_standard(x,x,7); /* exp underflow */
- }
- return z;
-#endif
+ if (__builtin_expect (x > o_threshold, 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 6);
+ }
+ else if (__builtin_expect (x < u_threshold, 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 7);
+ }
+
+ return __ieee754_exp (x);
}
hidden_def (__exp)
weak_alias (__exp, exp)
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
new file mode 100644
index 000000000..41dc42c0a
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
@@ -0,0 +1,82 @@
+/* Optimized by Ulrich Drepper <drepper@gmail.com>, 2011 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/* __ieee754_cosh(x)
+ * Method :
+ * mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2
+ * 1. Replace x by |x| (cosh(x) = cosh(-x)).
+ * 2.
+ * [ exp(x) - 1 ]^2
+ * 0 <= x <= ln2/2 : cosh(x) := 1 + -------------------
+ * 2*exp(x)
+ *
+ * exp(x) + 1/exp(x)
+ * ln2/2 <= x <= 22 : cosh(x) := -------------------
+ * 2
+ * 22 <= x <= lnovft : cosh(x) := exp(x)/2
+ * lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2)
+ * ln2ovft < x : cosh(x) := huge*huge (overflow)
+ *
+ * Special cases:
+ * cosh(x) is |x| if x is +INF, -INF, or NaN.
+ * only cosh(0)=1 is exact for finite x.
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+static const double one = 1.0, half=0.5, huge = 1.0e300;
+
+double
+__ieee754_cosh (double x)
+{
+ double t,w;
+ int32_t ix;
+
+ /* High word of |x|. */
+ GET_HIGH_WORD(ix,x);
+ ix &= 0x7fffffff;
+
+ /* |x| in [0,22] */
+ if (ix < 0x40360000) {
+ /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */
+ if(ix<0x3fd62e43) {
+ t = __expm1(fabs(x));
+ w = one+t;
+ if (ix<0x3c800000) return w; /* cosh(tiny) = 1 */
+ return one+(t*t)/(w+w);
+ }
+
+ /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
+ t = __ieee754_exp(fabs(x));
+ return half*t+half/t;
+ }
+
+ /* |x| in [22, log(maxdouble)] return half*exp(|x|) */
+ if (ix < 0x40862e42) return half*__ieee754_exp(fabs(x));
+
+ /* |x| in [log(maxdouble), overflowthresold] */
+ int64_t fix;
+ EXTRACT_WORDS64(fix, x);
+ if (fix <= UINT64_C(0x408633ce8fb9f87d)) {
+ w = __ieee754_exp(half*fabs(x));
+ t = half*w;
+ return t*w;
+ }
+
+ /* x is INF or NaN */
+ if(ix>=0x7ff00000) return x*x;
+
+ /* |x| > overflowthresold, cosh(x) overflow */
+ return huge*huge;
+}
+strong_alias (__ieee754_cosh, __cosh_finite)
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
index 9123fdc7b..e0e71558f 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
@@ -22,18 +22,10 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double huge = 1.0e300;
-#else
-static double huge = 1.0e300;
-#endif
-#ifdef __STDC__
- double __ceil(double x)
-#else
- double __ceil(x)
- double x;
-#endif
+double
+__ceil(double x)
{
int64_t i0,i;
int32_t j0;
@@ -60,8 +52,10 @@ static double huge = 1.0e300;
INSERT_WORDS64(x,i0);
return x;
}
+#ifndef __ceil
weak_alias (__ceil, ceil)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
strong_alias (__ceil, __ceill)
weak_alias (__ceil, ceill)
+# endif
#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
new file mode 100644
index 000000000..93a39a683
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
@@ -0,0 +1,33 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * finite(x) returns 1 is x is finite, else 0;
+ * no branching!
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#undef __finite
+int
+__finite(double x)
+{
+ int64_t lx;
+ EXTRACT_WORDS64(lx,x);
+ return (int)((uint64_t)((lx&INT64_C(0x7fffffffffffffff))-INT64_C(0x7ff0000000000000))>>63);
+}
+hidden_def (__finite)
+weak_alias (__finite, finite)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__finite, __finitel)
+weak_alias (__finite, finitel)
+#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
new file mode 100644
index 000000000..8b7300bb9
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
@@ -0,0 +1,81 @@
+/* Round double to integer away from zero.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Based on a version which carries the following copyright: */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+/*
+ * floor(x)
+ * Return x rounded toward -inf to integral value
+ * Method:
+ * Bit twiddling.
+ * Exception:
+ * Inexact flag raised if x not equal to floor(x).
+ */
+
+static const double huge = 1.0e300;
+
+
+double
+__floor (double x)
+{
+ int64_t i0;
+ EXTRACT_WORDS64(i0,x);
+ int32_t j0 = ((i0>>52)&0x7ff)-0x3ff;
+ if(__builtin_expect(j0<52, 1)) {
+ if(j0<0) { /* raise inexact if x != 0 */
+ if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
+ if(i0>=0) {i0=0;}
+ else if((i0&0x7fffffffffffffffl)!=0)
+ { i0=0xbff0000000000000l;}
+ }
+ } else {
+ uint64_t i = (0x000fffffffffffffl)>>j0;
+ if((i0&i)==0) return x; /* x is integral */
+ if(huge+x>0.0) { /* raise inexact flag */
+ if(i0<0) i0 += (0x0010000000000000l)>>j0;
+ i0 &= (~i);
+ }
+ }
+ INSERT_WORDS64(x,i0);
+ } else if (j0==0x400)
+ return x+x; /* inf or NaN */
+ return x;
+}
+#ifndef __floor
+weak_alias (__floor, floor)
+# ifdef NO_LONG_DOUBLE
+strong_alias (__floor, __floorl)
+weak_alias (__floor, floorl)
+# endif
+#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
new file mode 100644
index 000000000..76f761080
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <inttypes.h>
+#include "math.h"
+#include "math_private.h"
+
+/*
+ * for non-zero, finite x
+ * x = frexp(arg,&exp);
+ * return a double fp quantity x such that 0.5 <= |x| <1.0
+ * and the corresponding binary exponent "exp". That is
+ * arg = x*2^exp.
+ * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg
+ * with *exp=0.
+ */
+
+
+double
+__frexp (double x, int *eptr)
+{
+ int64_t ix;
+ EXTRACT_WORDS64 (ix, x);
+ int32_t ex = 0x7ff & (ix >> 52);
+ int e = 0;
+
+ if (__builtin_expect (ex != 0x7ff && x != 0.0, 1))
+ {
+ /* Not zero and finite. */
+ e = ex - 1022;
+ if (__builtin_expect (ex == 0, 0))
+ {
+ /* Subnormal. */
+ x *= 0x1p54;
+ EXTRACT_WORDS64 (ix, x);
+ ex = 0x7ff & (ix >> 52);
+ e = ex - 1022 - 54;
+ }
+
+ ix = (ix & INT64_C (0x800fffffffffffff)) | INT64_C (0x3fe0000000000000);
+ INSERT_WORDS64 (x, ix);
+ }
+
+ *eptr = e;
+ return x;
+}
+weak_alias (__frexp, frexp)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__frexp, __frexpl)
+weak_alias (__frexp, frexpl)
+#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c
new file mode 100644
index 000000000..09dcc9453
--- /dev/null
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c
@@ -0,0 +1,20 @@
+/*
+ * Written by Ulrich Drepper <drepper@gmail.com>.
+ */
+
+/*
+ * __isinf_ns(x) returns != 0 if x is ±inf, else 0;
+ * no branching!
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#undef __isinf_ns
+int
+__isinf_ns (double x)
+{
+ int64_t ix;
+ EXTRACT_WORDS64(ix,x);
+ return (ix & UINT64_C(0x7fffffffffffffff)) == UINT64_C(0x7ff0000000000000);
+}
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
index 3b08c54dd..65dc8934f 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
@@ -18,6 +18,7 @@
#include "math.h"
#include "math_private.h"
+#undef __isnan
#ifdef __STDC__
int __isnan(double x)
#else
diff --git a/ports/sysdeps/m68k/m680x0/s_isnanl.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
index 999746f29..741350436 100644
--- a/ports/sysdeps/m68k/m680x0/s_isnanl.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
@@ -1,5 +1,7 @@
-/* Copyright (C) 1991, 1992, 1995, 1997, 2002 Free Software Foundation, Inc.
+/* Compute radix independent exponent.
+ Copyright (C) 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,22 +19,26 @@
02111-1307 USA. */
#include <math.h>
-#include "ieee754.h"
-/* Return nonzero if VALUE is not a number. */
-int
-__isnanl (long double value)
-{
- union ieee854_long_double u;
+#include "math_private.h"
- u.d = value;
- /* IEEE 854 NaN's have the maximum possible
- exponent and a nonzero mantissa. In Motorola's
- interpretation the integer bit is ignored. */
- return ((u.ieee.exponent & 0x7fff) == 0x7fff &&
- ((u.ieee.mantissa0 & 0x7fffffff) != 0 || u.ieee.mantissa1 != 0));
+double
+__logb (double x)
+{
+ int64_t ix;
+
+ EXTRACT_WORDS64 (ix, x);
+ ix &= UINT64_C(0x7fffffffffffffff);
+ if (ix == 0)
+ return -1.0 / fabs (x);
+ unsigned int ex = ix >> 52;
+ if (ex == 0x7ff)
+ return x * x;
+ return ex == 0 ? -1022.0 : (double) (ex - 1023);
}
-
-hidden_def (__isnanl)
-weak_alias (__isnanl, isnanl);
+weak_alias (__logb, logb)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__logb, __logbl)
+weak_alias (__logb, logbl)
+#endif
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
index cb49019dd..861da20b1 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -24,22 +24,14 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
TWO52[2]={
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
};
-#ifdef __STDC__
- double __nearbyint(double x)
-#else
- double __nearbyint(x)
- double x;
-#endif
+double
+__nearbyint(double x)
{
fenv_t env;
int64_t i0,sx;
@@ -47,20 +39,19 @@ TWO52[2]={
EXTRACT_WORDS64(i0,x);
sx = (i0>>63)&1;
j0 = ((i0>>52)&0x7ff)-0x3ff;
- if(j0<52) {
+ if(__builtin_expect(j0<52, 1)) {
if(j0<0) {
if((i0&UINT64_C(0x7fffffffffffffff))==0) return x;
uint64_t i = i0 & UINT64_C(0xfffffffffffff);
i0 &= UINT64_C(0xfffe000000000000);
i0 |= (((i|-i) >> 12) & UINT64_C(0x8000000000000));
INSERT_WORDS64(x,i0);
- feholdexcept (&env);
+ libc_feholdexcept (&env);
double w = TWO52[sx]+x;
double t = w-TWO52[sx];
- fesetenv (&env);
- EXTRACT_WORDS64(i0,t);
- INSERT_WORDS64(t,(i0&UINT64_C(0x7fffffffffffffff))|(sx<<63));
- return t;
+ math_opt_barrier(t);
+ libc_fesetenv (&env);
+ return copysign(t, x);
} else {
uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
@@ -73,10 +64,11 @@ TWO52[2]={
else return x; /* x is integral */
}
INSERT_WORDS64(x,i0);
- feholdexcept (&env);
+ libc_feholdexcept (&env);
double w = TWO52[sx]+x;
double t = w-TWO52[sx];
- fesetenv (&env);
+ math_opt_barrier (t);
+ libc_fesetenv (&env);
return t;
}
weak_alias (__nearbyint, nearbyint)
diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
index 4a60aa327..571b3811a 100644
--- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
+++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
@@ -1,4 +1,3 @@
-/* @(#)s_rint.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -23,22 +22,14 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
TWO52[2]={
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
};
-#ifdef __STDC__
- double __rint(double x)
-#else
- double __rint(x)
- double x;
-#endif
+double
+__rint(double x)
{
int64_t i0,sx;
int32_t j0;
@@ -72,8 +63,10 @@ TWO52[2]={
double w = TWO52[sx]+x;
return w-TWO52[sx];
}
+#ifndef __rint
weak_alias (__rint, rint)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
strong_alias (__rint, __rintl)
weak_alias (__rint, rintl)
+# endif
#endif
diff --git a/libc/sysdeps/ieee754/flt-32/e_acosf.c b/libc/sysdeps/ieee754/flt-32/e_acosf.c
index 0d85c4210..a258e2f91 100644
--- a/libc/sysdeps/ieee754/flt-32/e_acosf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_acosf.c
@@ -8,23 +8,15 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_acosf.c,v 1.5 1995/05/12 04:57:16 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
-static const float
-#else
-static float
-#endif
+static const float
one = 1.0000000000e+00, /* 0x3F800000 */
pi = 3.1415925026e+00, /* 0x40490fda */
pio2_hi = 1.5707962513e+00, /* 0x3fc90fda */
@@ -40,12 +32,8 @@ qS2 = 2.0209457874e+00, /* 0x4001572d */
qS3 = -6.8828397989e-01, /* 0xbf303361 */
qS4 = 7.7038154006e-02; /* 0x3d9dc62e */
-#ifdef __STDC__
- float __ieee754_acosf(float x)
-#else
- float __ieee754_acosf(x)
- float x;
-#endif
+float
+__ieee754_acosf(float x)
{
float z,p,q,r,w,s,c,df;
int32_t hx,ix;
@@ -87,3 +75,4 @@ qS4 = 7.7038154006e-02; /* 0x3d9dc62e */
return (float)2.0*(df+w);
}
}
+strong_alias (__ieee754_acosf, __acosf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_acoshf.c b/libc/sysdeps/ieee754/flt-32/e_acoshf.c
index c607f7211..777e0b9e3 100644
--- a/libc/sysdeps/ieee754/flt-32/e_acoshf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_acoshf.c
@@ -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,9 +21,9 @@ static char rcsid[] = "$NetBSD: e_acoshf.c,v 1.5 1995/05/12 04:57:20 jtc Exp $";
#include "math_private.h"
#ifdef __STDC__
-static const float
+static const float
#else
-static float
+static float
#endif
one = 1.0,
ln2 = 6.9314718246e-01; /* 0x3f317218 */
@@ -34,7 +34,7 @@ ln2 = 6.9314718246e-01; /* 0x3f317218 */
float __ieee754_acoshf(x)
float x;
#endif
-{
+{
float t;
int32_t hx;
GET_FLOAT_WORD(hx,x);
@@ -42,8 +42,8 @@ ln2 = 6.9314718246e-01; /* 0x3f317218 */
return (x-x)/(x-x);
} else if(hx >=0x4d800000) { /* x > 2**28 */
if(hx >=0x7f800000) { /* x is inf of NaN */
- return x+x;
- } else
+ return x+x;
+ } else
return __ieee754_logf(x)+ln2; /* acosh(huge)=log(2x) */
} else if (hx==0x3f800000) {
return 0.0; /* acosh(1) = 0 */
@@ -52,6 +52,7 @@ ln2 = 6.9314718246e-01; /* 0x3f317218 */
return __ieee754_logf((float)2.0*x-one/(x+__ieee754_sqrtf(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pf(t+__sqrtf((float)2.0*t+t*t));
+ return __log1pf(t+__ieee754_sqrtf((float)2.0*t+t*t));
}
}
+strong_alias (__ieee754_acoshf, __acoshf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_asinf.c b/libc/sysdeps/ieee754/flt-32/e_asinf.c
index b0c835c83..7296ba3e1 100644
--- a/libc/sysdeps/ieee754/flt-32/e_asinf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_asinf.c
@@ -14,11 +14,11 @@
*/
/*
- Modifications for single precision expansion are
+ Modifications for single precision expansion are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -93,7 +93,7 @@ p4 = 4.216630880e-2f;
t = w*0.5f;
p = t * (p0 + t * (p1 + t * (p2 + t * (p3 + t * p4))));
s = __ieee754_sqrtf(t);
- if(ix>=0x3F79999A) { /* if |x| > 0.975 */
+ if(ix>=0x3F79999A) { /* if |x| > 0.975 */
t = pio2_hi-(2.0f*(s+s*p)-pio2_lo);
} else {
int32_t iw;
@@ -108,3 +108,4 @@ p4 = 4.216630880e-2f;
}
if(hx>0) return t; else return -t;
}
+strong_alias (__ieee754_asinf, __asinf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_atan2f.c b/libc/sysdeps/ieee754/flt-32/e_atan2f.c
index c0cafb16b..abbde88bd 100644
--- a/libc/sysdeps/ieee754/flt-32/e_atan2f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_atan2f.c
@@ -13,18 +13,10 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_atan2f.c,v 1.4 1995/05/10 20:44:53 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
tiny = 1.0e-30,
zero = 0.0,
pi_o_4 = 7.8539818525e-01, /* 0x3f490fdb */
@@ -32,12 +24,8 @@ pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */
pi = 3.1415927410e+00, /* 0x40490fdb */
pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */
-#ifdef __STDC__
- float __ieee754_atan2f(float y, float x)
-#else
- float __ieee754_atan2f(y,x)
- float y,x;
-#endif
+float
+__ieee754_atan2f (float y, float x)
{
float z;
int32_t k,m,hx,hy,ix,iy;
@@ -56,7 +44,7 @@ pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */
if(iy==0) {
switch(m) {
case 0:
- case 1: return y; /* atan(+-0,+anything)=+-0 */
+ case 1: return y; /* atan(+-0,+anything)=+-0 */
case 2: return pi+tiny;/* atan(+0,-anything) = pi */
case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
}
@@ -87,19 +75,20 @@ pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */
/* compute y/x */
k = (iy-ix)>>23;
- if(k > 60) z=pi_o_2+(float)0.5*pi_lo; /* |y/x| > 2**60 */
- else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */
+ if(k > 60) z=pi_o_2+(float)0.5*pi_lo; /* |y/x| > 2**60 */
+ else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */
else z=__atanf(fabsf(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: {
- u_int32_t zh;
+ u_int32_t zh;
GET_FLOAT_WORD(zh,z);
SET_FLOAT_WORD(z,zh ^ 0x80000000);
}
return z ; /* atan(-,+) */
case 2: return pi-(z-pi_lo);/* atan(+,-) */
default: /* case 3 */
- return (z-pi_lo)-pi;/* atan(-,-) */
+ return (z-pi_lo)-pi;/* atan(-,-) */
}
}
+strong_alias (__ieee754_atan2f, __atan2f_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_atanhf.c b/libc/sysdeps/ieee754/flt-32/e_atanhf.c
index f26a15bbc..ddd18ab30 100644
--- a/libc/sysdeps/ieee754/flt-32/e_atanhf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_atanhf.c
@@ -1,58 +1,70 @@
-/* e_atanhf.c -- float version of e_atanh.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+
+/* __ieee754_atanh(x)
+ Method :
+ 1.Reduced x to positive by atanh(-x) = -atanh(x)
+ 2.For x>=0.5
+ 1 2x x
+ atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
+ 2 1 - x 1 - x
+
+ For x<0.5
+ atanh(x) = 0.5*log1p(2x+2x*x/(1-x))
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_atanhf.c,v 1.4 1995/05/10 20:44:56 jtc Exp $";
-#endif
+ Special cases:
+ atanh(x) is NaN if |x| > 1 with signal;
+ atanh(NaN) is that NaN with no signal;
+ atanh(+-1) is +-INF with signal.
+ */
+
+#include <inttypes.h>
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
-static const float one = 1.0, huge = 1e30;
-#else
-static float one = 1.0, huge = 1e30;
-#endif
-
-#ifdef __STDC__
-static const float zero = 0.0;
-#else
-static float zero = 0.0;
-#endif
-
-#ifdef __STDC__
- float __ieee754_atanhf(float x)
-#else
- float __ieee754_atanhf(x)
- float x;
-#endif
+static const float huge = 1e30;
+
+float
+__ieee754_atanhf (float x)
{
- float t;
- int32_t hx,ix;
- GET_FLOAT_WORD(hx,x);
- ix = hx&0x7fffffff;
- if (ix>0x3f800000) /* |x|>1 */
- return (x-x)/(x-x);
- if(ix==0x3f800000)
- return x/zero;
- if(ix<0x31800000&&(huge+x)>zero) return x; /* x<2**-28 */
- SET_FLOAT_WORD(x,ix);
- if(ix<0x3f000000) { /* x < 0.5 */
- t = x+x;
- t = (float)0.5*__log1pf(t+t*x/(one-x));
- } else
- t = (float)0.5*__log1pf((x+x)/(one-x));
- if(hx>=0) return t; else return -t;
+ float xa = fabsf (x);
+ float t;
+ if (xa < 0.5f)
+ {
+ if (__builtin_expect (xa < 0x1.0p-28f, 0) && (huge + x) > 0.0f)
+ return x;
+
+ t = xa + xa;
+ t = 0.5f * __log1pf (t + t * xa / (1.0f - xa));
+ }
+ else if (__builtin_expect (xa < 1.0f, 1))
+ t = 0.5f * __log1pf ((xa + xa) / (1.0f - xa));
+ else
+ {
+ if (xa > 1.0f)
+ return (x - x) / (x - x);
+
+ return x / 0.0f;
+ }
+
+ return __copysignf (t, x);
}
+strong_alias (__ieee754_atanhf, __atanhf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_coshf.c b/libc/sysdeps/ieee754/flt-32/e_coshf.c
index 223fbeea2..1887639a6 100644
--- a/libc/sysdeps/ieee754/flt-32/e_coshf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_coshf.c
@@ -1,5 +1,6 @@
/* e_coshf.c -- float version of e_cosh.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Optimizations by Ulrich Drepper <drepper@gmail.com>, 2011
*/
/*
@@ -13,26 +14,14 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_coshf.c,v 1.6 1996/04/08 15:43:41 phil Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float huge = 1.0e30;
static const float one = 1.0, half=0.5;
-#else
-static float one = 1.0, half=0.5, huge = 1.0e30;
-#endif
-#ifdef __STDC__
- float __ieee754_coshf(float x)
-#else
- float __ieee754_coshf(x)
- float x;
-#endif
+float
+__ieee754_coshf (float x)
{
float t,w;
int32_t ix;
@@ -40,19 +29,17 @@ static float one = 1.0, half=0.5, huge = 1.0e30;
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
- /* x is INF or NaN */
- if(ix>=0x7f800000) return x*x;
-
- /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */
- if(ix<0x3eb17218) {
- t = __expm1f(fabsf(x));
- w = one+t;
- if (ix<0x24000000) return w; /* cosh(tiny) = 1 */
- return one+(t*t)/(w+w);
- }
-
- /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
+ /* |x| in [0,22] */
if (ix < 0x41b00000) {
+ /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */
+ if(ix<0x3eb17218) {
+ t = __expm1f(fabsf(x));
+ w = one+t;
+ if (ix<0x24000000) return w; /* cosh(tiny) = 1 */
+ return one+(t*t)/(w+w);
+ }
+
+ /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
t = __ieee754_expf(fabsf(x));
return half*t+half/t;
}
@@ -67,6 +54,10 @@ static float one = 1.0, half=0.5, huge = 1.0e30;
return t*w;
}
+ /* x is INF or NaN */
+ if(ix>=0x7f800000) return x*x;
+
/* |x| > overflowthresold, cosh(x) overflow */
return huge*huge;
}
+strong_alias (__ieee754_coshf, __coshf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_exp2f.c b/libc/sysdeps/ieee754/flt-32/e_exp2f.c
index 194222a0c..f07500d20 100644
--- a/libc/sysdeps/ieee754/flt-32/e_exp2f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_exp2f.c
@@ -1,5 +1,6 @@
/* Single-precision floating point 2^x.
- Copyright (C) 1997,1998,2000,2001,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,2000,2001,2005,2006,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -56,11 +57,7 @@ __ieee754_exp2f (float x)
union ieee754_float ex2_u, scale_u;
fenv_t oldenv;
- feholdexcept (&oldenv);
-#ifdef FE_TONEAREST
- /* If we don't have this, it's too bad. */
- fesetround (FE_TONEAREST);
-#endif
+ libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
/* 1. Argument reduction.
Choose integers ex, -128 <= t < 128, and some real
@@ -103,7 +100,7 @@ __ieee754_exp2f (float x)
x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
/* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
- fesetenv (&oldenv);
+ libc_fesetenv (&oldenv);
result = x22 * x + ex2_u.f;
@@ -115,7 +112,7 @@ __ieee754_exp2f (float x)
/* Exceptional cases: */
else if (isless (x, himark))
{
- if (__isinff (x))
+ if (__isinf_nsf (x))
/* e^-inf == 0, with no error. */
return 0;
else
@@ -126,3 +123,4 @@ __ieee754_exp2f (float x)
/* Return x, if x is a NaN or Inf; or overflow, otherwise. */
return TWO127*x;
}
+strong_alias (__ieee754_exp2f, __exp2f_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_expf.c b/libc/sysdeps/ieee754/flt-32/e_expf.c
index b9cd53c03..02105c438 100644
--- a/libc/sysdeps/ieee754/flt-32/e_expf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_expf.c
@@ -1,5 +1,5 @@
/* Single-precision floating point e^x.
- Copyright (C) 1997, 1998, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -33,8 +33,8 @@
Then e^x is approximated as
e^x = 2^n ( e^(t/512 + delta[t])
- + ( e^(t/512 + delta[t])
- * ( p(x + delta[t] + n * ln(2)) - delta ) ) )
+ + ( e^(t/512 + delta[t])
+ * ( p(x + delta[t] + n * ln(2)) - delta ) ) )
where
- p(x) is a polynomial approximating e(x)-1;
@@ -47,9 +47,6 @@
to perform an 'accurate table method' expf, because of the range reduction
overhead (compare exp2f).
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include <float.h>
#include <ieee754.h>
#include <math.h>
@@ -60,8 +57,8 @@
extern const float __exp_deltatable[178];
extern const double __exp_atable[355] /* __attribute__((mode(DF))) */;
-static const volatile float TWOM100 = 7.88860905e-31;
-static const volatile float TWO127 = 1.7014118346e+38;
+static const float TWOM100 = 7.88860905e-31;
+static const float TWO127 = 1.7014118346e+38;
float
__ieee754_expf (float x)
@@ -86,10 +83,7 @@ __ieee754_expf (float x)
union ieee754_double ex2_u;
fenv_t oldenv;
- feholdexcept (&oldenv);
-#ifdef FE_TONEAREST
- fesetround (FE_TONEAREST);
-#endif
+ libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
/* Calculate n. */
n = x * M_1_LN2 + THREEp22;
@@ -119,7 +113,7 @@ __ieee754_expf (float x)
x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
/* Return result. */
- fesetenv (&oldenv);
+ libc_fesetenvf (&oldenv);
result = x22 * ex2_u.d + ex2_u.d;
return (float) result;
@@ -138,3 +132,4 @@ __ieee754_expf (float x)
/* Return x, if x is a NaN or Inf; or overflow, otherwise. */
return TWO127*x;
}
+strong_alias (__ieee754_expf, __expf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_fmodf.c b/libc/sysdeps/ieee754/flt-32/e_fmodf.c
index 47b312392..e82a9ceab 100644
--- a/libc/sysdeps/ieee754/flt-32/e_fmodf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_fmodf.c
@@ -8,16 +8,12 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_fmodf.c,v 1.4 1995/05/10 20:45:10 jtc Exp $";
-#endif
-
-/*
+/*
* __ieee754_fmodf(x,y)
* Return x mod y in exact arithmetic
* Method: shift and subtract
@@ -26,18 +22,10 @@ static char rcsid[] = "$NetBSD: e_fmodf.c,v 1.4 1995/05/10 20:45:10 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float one = 1.0, Zero[] = {0.0, -0.0,};
-#else
-static float one = 1.0, Zero[] = {0.0, -0.0,};
-#endif
-#ifdef __STDC__
- float __ieee754_fmodf(float x, float y)
-#else
- float __ieee754_fmodf(x,y)
- float x,y ;
-#endif
+float
+__ieee754_fmodf (float x, float y)
{
int32_t n,hx,hy,hz,ix,iy,sx,i;
@@ -66,13 +54,13 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
} else iy = (hy>>23)-127;
/* set up {hx,lx}, {hy,ly} and align y to x */
- if(ix >= -126)
+ if(ix >= -126)
hx = 0x00800000|(0x007fffff&hx);
else { /* subnormal x, shift x to normal */
n = -126-ix;
hx = hx<<n;
}
- if(iy >= -126)
+ if(iy >= -126)
hy = 0x00800000|(0x007fffff&hy);
else { /* subnormal y, shift y to normal */
n = -126-iy;
@@ -85,17 +73,17 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
hz=hx-hy;
if(hz<0){hx = hx+hx;}
else {
- if(hz==0) /* return sign(x)*0 */
+ if(hz==0) /* return sign(x)*0 */
return Zero[(u_int32_t)sx>>31];
- hx = hz+hz;
+ hx = hz+hz;
}
}
hz=hx-hy;
if(hz>=0) {hx=hz;}
/* convert back to floating value and restore the sign */
- if(hx==0) /* return sign(x)*0 */
- return Zero[(u_int32_t)sx>>31];
+ if(hx==0) /* return sign(x)*0 */
+ return Zero[(u_int32_t)sx>>31];
while(hx<0x00800000) { /* normalize x */
hx = hx+hx;
iy -= 1;
@@ -111,3 +99,4 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
}
return x; /* exact output */
}
+strong_alias (__ieee754_fmodf, __fmodf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_gammaf_r.c b/libc/sysdeps/ieee754/flt-32/e_gammaf_r.c
index 926c84f36..aeeddf1a9 100644
--- a/libc/sysdeps/ieee754/flt-32/e_gammaf_r.c
+++ b/libc/sysdeps/ieee754/flt-32/e_gammaf_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997, 1999, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2001, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -32,19 +32,20 @@ __ieee754_gammaf_r (float x, int *signgamp)
GET_FLOAT_WORD (hx, x);
- if ((hx & 0x7fffffff) == 0)
+ if (__builtin_expect ((hx & 0x7fffffff) == 0, 0))
{
/* Return value for x == 0 is Inf with divide by zero exception. */
*signgamp = 0;
return 1.0 / x;
}
- if (hx < 0 && (u_int32_t) hx < 0xff800000 && __rintf (x) == x)
+ if (__builtin_expect (hx < 0, 0)
+ && (u_int32_t) hx < 0xff800000 && __rintf (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
return (x - x) / (x - x);
}
- if (hx == 0xff800000)
+ if (__builtin_expect (hx == 0xff800000, 0))
{
/* x == -Inf. According to ISO this is NaN. */
*signgamp = 0;
@@ -54,3 +55,4 @@ __ieee754_gammaf_r (float x, int *signgamp)
/* XXX FIXME. */
return __ieee754_expf (__ieee754_lgammaf_r (x, signgamp));
}
+strong_alias (__ieee754_gammaf_r, __gammaf_r_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_hypotf.c b/libc/sysdeps/ieee754/flt-32/e_hypotf.c
index a8e1a52d2..7ec8ae66b 100644
--- a/libc/sysdeps/ieee754/flt-32/e_hypotf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_hypotf.c
@@ -13,19 +13,11 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_hypotf.c,v 1.5 1995/05/12 04:57:30 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- float __ieee754_hypotf(float x, float y)
-#else
- float __ieee754_hypotf(x,y)
- float x, y;
-#endif
+float
+__ieee754_hypotf(float x, float y)
{
float a,b,t1,t2,y1,y2,w;
int32_t j,k,ha,hb;
@@ -39,7 +31,7 @@ static char rcsid[] = "$NetBSD: e_hypotf.c,v 1.5 1995/05/12 04:57:30 jtc Exp $";
SET_FLOAT_WORD(b,hb); /* b <- |b| */
if((ha-hb)>0xf000000) {return a+b;} /* x/y > 2**30 */
k=0;
- if(ha > 0x58800000) { /* a>2**50 */
+ if(__builtin_expect(ha > 0x58800000, 0)) { /* a>2**50 */
if(ha >= 0x7f800000) { /* Inf or NaN */
w = a+b; /* for sNaN */
if(ha == 0x7f800000) w = a;
@@ -51,15 +43,15 @@ static char rcsid[] = "$NetBSD: e_hypotf.c,v 1.5 1995/05/12 04:57:30 jtc Exp $";
SET_FLOAT_WORD(a,ha);
SET_FLOAT_WORD(b,hb);
}
- if(hb < 0x26800000) { /* b < 2**-50 */
+ if(__builtin_expect(hb < 0x26800000, 0)) { /* b < 2**-50 */
if(hb <= 0x007fffff) { /* subnormal b or 0 */
- if(hb==0) return a;
+ if(hb==0) return a;
SET_FLOAT_WORD(t1,0x7e800000); /* t1=2^126 */
b *= t1;
a *= t1;
k -= 126;
} else { /* scale a and b by 2^60 */
- ha += 0x1e000000; /* a *= 2^60 */
+ ha += 0x1e000000; /* a *= 2^60 */
hb += 0x1e000000; /* b *= 2^60 */
k -= 60;
SET_FLOAT_WORD(a,ha);
@@ -85,3 +77,4 @@ static char rcsid[] = "$NetBSD: e_hypotf.c,v 1.5 1995/05/12 04:57:30 jtc Exp $";
return t1*w;
} else return w;
}
+strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_j0f.c b/libc/sysdeps/ieee754/flt-32/e_j0f.c
index 8c499e614..d2da43f92 100644
--- a/libc/sysdeps/ieee754/flt-32/e_j0f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_j0f.c
@@ -13,29 +13,17 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_j0f.c,v 1.4 1995/05/10 20:45:25 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static float pzerof(float), qzerof(float);
-#else
-static float pzerof(), qzerof();
-#endif
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
-huge = 1e30,
+huge = 1e30,
one = 1.0,
invsqrtpi= 5.6418961287e-01, /* 0x3f106ebb */
tpi = 6.3661974669e-01, /* 0x3f22f983 */
- /* R0/S0 on [0, 2.00] */
+ /* R0/S0 on [0, 2.00] */
R02 = 1.5625000000e-02, /* 0x3c800000 */
R03 = -1.8997929874e-04, /* 0xb947352e */
R04 = 1.8295404516e-06, /* 0x35f58e88 */
@@ -45,18 +33,10 @@ S02 = 1.1692678527e-04, /* 0x38f53697 */
S03 = 5.1354652442e-07, /* 0x3509daa6 */
S04 = 1.1661400734e-09; /* 0x30a045e8 */
-#ifdef __STDC__
static const float zero = 0.0;
-#else
-static float zero = 0.0;
-#endif
-#ifdef __STDC__
- float __ieee754_j0f(float x)
-#else
- float __ieee754_j0f(x)
- float x;
-#endif
+float
+__ieee754_j0f(float x)
{
float z, s,c,ss,cc,r,u,v;
int32_t hx,ix;
@@ -72,7 +52,7 @@ static float zero = 0.0;
if(ix<0x7f000000) { /* make sure x+x not overflow */
z = -__cosf(x+x);
if ((s*c)<zero) cc = z/ss;
- else ss = z/cc;
+ else ss = z/cc;
}
/*
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
@@ -87,8 +67,8 @@ static float zero = 0.0;
}
if(ix<0x39000000) { /* |x| < 2**-13 */
if(huge+x>one) { /* raise inexact if x != 0 */
- if(ix<0x32000000) return one; /* |x|<2**-27 */
- else return one - (float)0.25*x*x;
+ if(ix<0x32000000) return one; /* |x|<2**-27 */
+ else return one - (float)0.25*x*x;
}
}
z = x*x;
@@ -101,12 +81,9 @@ static float zero = 0.0;
return((one+u)*(one-u)+z*(r/s));
}
}
+strong_alias (__ieee754_j0f, __j0f_finite)
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
u00 = -7.3804296553e-02, /* 0xbd9726b5 */
u01 = 1.7666645348e-01, /* 0x3e34e80d */
u02 = -1.3818567619e-02, /* 0xbc626746 */
@@ -119,52 +96,48 @@ v02 = 7.6006865129e-05, /* 0x389f65e0 */
v03 = 2.5915085189e-07, /* 0x348b216c */
v04 = 4.4111031494e-10; /* 0x2ff280c2 */
-#ifdef __STDC__
- float __ieee754_y0f(float x)
-#else
- float __ieee754_y0f(x)
- float x;
-#endif
+float
+__ieee754_y0f(float x)
{
float z, s,c,ss,cc,u,v;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
- ix = 0x7fffffff&hx;
+ ix = 0x7fffffff&hx;
/* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0, y0(0) is -inf. */
if(ix>=0x7f800000) return one/(x+x*x);
- if(ix==0) return -HUGE_VALF+x; /* -inf and overflow exception. */
- if(hx<0) return zero/(zero*x);
- if(ix >= 0x40000000) { /* |x| >= 2.0 */
- /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
- * where x0 = x-pi/4
- * Better formula:
- * cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
- * = 1/sqrt(2) * (sin(x) + cos(x))
- * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
- * = 1/sqrt(2) * (sin(x) - cos(x))
- * To avoid cancellation, use
- * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.
- */
+ if(ix==0) return -HUGE_VALF+x; /* -inf and overflow exception. */
+ if(hx<0) return zero/(zero*x);
+ if(ix >= 0x40000000) { /* |x| >= 2.0 */
+ /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
+ * where x0 = x-pi/4
+ * Better formula:
+ * cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
+ * = 1/sqrt(2) * (sin(x) + cos(x))
+ * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
+ * = 1/sqrt(2) * (sin(x) - cos(x))
+ * To avoid cancellation, use
+ * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ * to compute the worse one.
+ */
__sincosf (x, &s, &c);
- ss = s-c;
- cc = s+c;
+ ss = s-c;
+ cc = s+c;
/*
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
- if(ix<0x7f000000) { /* make sure x+x not overflow */
- z = -__cosf(x+x);
- if ((s*c)<zero) cc = z/ss;
- else ss = z/cc;
- }
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
- else {
- u = pzerof(x); v = qzerof(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
- }
- return z;
+ if(ix<0x7f000000) { /* make sure x+x not overflow */
+ z = -__cosf(x+x);
+ if ((s*c)<zero) cc = z/ss;
+ else ss = z/cc;
+ }
+ if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
+ else {
+ u = pzerof(x); v = qzerof(x);
+ z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
+ }
+ return z;
}
if(ix<=0x32000000) { /* x < 2**-27 */
return(u00 + tpi*__ieee754_logf(x));
@@ -174,21 +147,18 @@ v04 = 4.4111031494e-10; /* 0x2ff280c2 */
v = one+z*(v01+z*(v02+z*(v03+z*v04)));
return(u/v + tpi*(__ieee754_j0f(x)*__ieee754_logf(x)));
}
+strong_alias (__ieee754_y0f, __y0f_finite)
/* The asymptotic expansions of pzero is
* 1 - 9/128 s^2 + 11025/98304 s^4 - ..., where s = 1/x.
* For x >= 2, We approximate pzero by
- * pzero(x) = 1 + (R/S)
+ * pzero(x) = 1 + (R/S)
* where R = pR0 + pR1*s^2 + pR2*s^4 + ... + pR5*s^10
- * S = 1 + pS0*s^2 + ... + pS4*s^10
+ * S = 1 + pS0*s^2 + ... + pS4*s^10
* and
* | pzero(x)-1-R/S | <= 2 ** ( -60.26)
*/
-#ifdef __STDC__
static const float pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static float pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.0000000000e+00, /* 0x00000000 */
-7.0312500000e-02, /* 0xbd900000 */
-8.0816707611e+00, /* 0xc1014e86 */
@@ -196,22 +166,14 @@ static float pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-2.4852163086e+03, /* 0xc51b5376 */
-5.2530439453e+03, /* 0xc5a4285a */
};
-#ifdef __STDC__
static const float pS8[5] = {
-#else
-static float pS8[5] = {
-#endif
1.1653436279e+02, /* 0x42e91198 */
3.8337448730e+03, /* 0x456f9beb */
4.0597855469e+04, /* 0x471e95db */
1.1675296875e+05, /* 0x47e4087c */
4.7627726562e+04, /* 0x473a0bba */
};
-#ifdef __STDC__
static const float pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static float pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
-1.1412546255e-11, /* 0xad48c58a */
-7.0312492549e-02, /* 0xbd8fffff */
-4.1596107483e+00, /* 0xc0851b88 */
@@ -219,11 +181,7 @@ static float pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-3.3123129272e+02, /* 0xc3a59d9b */
-3.4643338013e+02, /* 0xc3ad3779 */
};
-#ifdef __STDC__
static const float pS5[5] = {
-#else
-static float pS5[5] = {
-#endif
6.0753936768e+01, /* 0x42730408 */
1.0512523193e+03, /* 0x44836813 */
5.9789707031e+03, /* 0x45bad7c4 */
@@ -231,11 +189,7 @@ static float pS5[5] = {
2.4060581055e+03, /* 0x451660ee */
};
-#ifdef __STDC__
static const float pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#else
-static float pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
-2.5470459075e-09, /* 0xb12f081b */
-7.0311963558e-02, /* 0xbd8fffb8 */
-2.4090321064e+00, /* 0xc01a2d95 */
@@ -243,11 +197,7 @@ static float pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-5.8079170227e+01, /* 0xc2685112 */
-3.1447946548e+01, /* 0xc1fb9565 */
};
-#ifdef __STDC__
static const float pS3[5] = {
-#else
-static float pS3[5] = {
-#endif
3.5856033325e+01, /* 0x420f6c94 */
3.6151397705e+02, /* 0x43b4c1ca */
1.1936077881e+03, /* 0x44953373 */
@@ -255,11 +205,7 @@ static float pS3[5] = {
1.7358093262e+02, /* 0x432d94b8 */
};
-#ifdef __STDC__
static const float pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static float pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
-8.8753431271e-08, /* 0xb3be98b7 */
-7.0303097367e-02, /* 0xbd8ffb12 */
-1.4507384300e+00, /* 0xbfb9b1cc */
@@ -267,11 +213,7 @@ static float pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-1.1193166733e+01, /* 0xc1331736 */
-3.2336456776e+00, /* 0xc04ef40d */
};
-#ifdef __STDC__
static const float pS2[5] = {
-#else
-static float pS2[5] = {
-#endif
2.2220300674e+01, /* 0x41b1c32d */
1.3620678711e+02, /* 0x430834f0 */
2.7047027588e+02, /* 0x43873c32 */
@@ -279,18 +221,10 @@ static float pS2[5] = {
1.4657617569e+01, /* 0x416a859a */
};
-#ifdef __STDC__
- static float pzerof(float x)
-#else
- static float pzerof(x)
- float x;
-#endif
+static float
+pzerof(float x)
{
-#ifdef __STDC__
const float *p,*q;
-#else
- float *p,*q;
-#endif
float z,r,s;
int32_t ix;
GET_FLOAT_WORD(ix,x);
@@ -309,17 +243,13 @@ static float pS2[5] = {
/* For x >= 8, the asymptotic expansions of qzero is
* -1/8 s + 75/1024 s^3 - ..., where s = 1/x.
* We approximate pzero by
- * qzero(x) = s*(-1.25 + (R/S))
+ * qzero(x) = s*(-1.25 + (R/S))
* where R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
- * S = 1 + qS0*s^2 + ... + qS5*s^12
+ * S = 1 + qS0*s^2 + ... + qS5*s^12
* and
* | qzero(x)/s +1.25-R/S | <= 2 ** ( -61.22)
*/
-#ifdef __STDC__
static const float qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static float qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.0000000000e+00, /* 0x00000000 */
7.3242187500e-02, /* 0x3d960000 */
1.1768206596e+01, /* 0x413c4a93 */
@@ -327,11 +257,7 @@ static float qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
8.8591972656e+03, /* 0x460a6cca */
3.7014625000e+04, /* 0x471096a0 */
};
-#ifdef __STDC__
static const float qS8[6] = {
-#else
-static float qS8[6] = {
-#endif
1.6377603149e+02, /* 0x4323c6aa */
8.0983447266e+03, /* 0x45fd12c2 */
1.4253829688e+05, /* 0x480b3293 */
@@ -340,11 +266,7 @@ static float qS8[6] = {
-3.4389928125e+05, /* 0xc8a7eb69 */
};
-#ifdef __STDC__
static const float qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static float qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
1.8408595828e-11, /* 0x2da1ec79 */
7.3242180049e-02, /* 0x3d95ffff */
5.8356351852e+00, /* 0x40babd86 */
@@ -352,11 +274,7 @@ static float qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
1.0272437744e+03, /* 0x448067cd */
1.9899779053e+03, /* 0x44f8bf4b */
};
-#ifdef __STDC__
static const float qS5[6] = {
-#else
-static float qS5[6] = {
-#endif
8.2776611328e+01, /* 0x42a58da0 */
2.0778142090e+03, /* 0x4501dd07 */
1.8847289062e+04, /* 0x46933e94 */
@@ -365,11 +283,7 @@ static float qS5[6] = {
-5.3543427734e+03, /* 0xc5a752be */
};
-#ifdef __STDC__
static const float qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#else
-static float qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
4.3774099900e-09, /* 0x3196681b */
7.3241114616e-02, /* 0x3d95ff70 */
3.3442313671e+00, /* 0x405607e3 */
@@ -377,11 +291,7 @@ static float qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
1.7080809021e+02, /* 0x432acedf */
1.6673394775e+02, /* 0x4326bbe4 */
};
-#ifdef __STDC__
static const float qS3[6] = {
-#else
-static float qS3[6] = {
-#endif
4.8758872986e+01, /* 0x42430916 */
7.0968920898e+02, /* 0x44316c1c */
3.7041481934e+03, /* 0x4567825f */
@@ -390,11 +300,7 @@ static float qS3[6] = {
-1.4924745178e+02, /* 0xc3153f59 */
};
-#ifdef __STDC__
static const float qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static float qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
1.5044444979e-07, /* 0x342189db */
7.3223426938e-02, /* 0x3d95f62a */
1.9981917143e+00, /* 0x3fffc4bf */
@@ -402,11 +308,7 @@ static float qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
3.1666231155e+01, /* 0x41fd5471 */
1.6252708435e+01, /* 0x4182058c */
};
-#ifdef __STDC__
static const float qS2[6] = {
-#else
-static float qS2[6] = {
-#endif
3.0365585327e+01, /* 0x41f2ecb8 */
2.6934811401e+02, /* 0x4386ac8f */
8.4478375244e+02, /* 0x44533229 */
@@ -415,18 +317,10 @@ static float qS2[6] = {
-5.3109550476e+00, /* 0xc0a9f358 */
};
-#ifdef __STDC__
- static float qzerof(float x)
-#else
- static float qzerof(x)
- float x;
-#endif
+static float
+qzerof(float x)
{
-#ifdef __STDC__
const float *p,*q;
-#else
- float *p,*q;
-#endif
float s,r,z;
int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/flt-32/e_j1f.c b/libc/sysdeps/ieee754/flt-32/e_j1f.c
index 71bb2515a..bb335a740 100644
--- a/libc/sysdeps/ieee754/flt-32/e_j1f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_j1f.c
@@ -13,24 +13,12 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_j1f.c,v 1.4 1995/05/10 20:45:31 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static float ponef(float), qonef(float);
-#else
-static float ponef(), qonef();
-#endif
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
huge = 1e30,
one = 1.0,
invsqrtpi= 5.6418961287e-01, /* 0x3f106ebb */
@@ -46,25 +34,17 @@ s03 = 1.1771846857e-06, /* 0x359dffc2 */
s04 = 5.0463624390e-09, /* 0x31ad6446 */
s05 = 1.2354227016e-11; /* 0x2d59567e */
-#ifdef __STDC__
static const float zero = 0.0;
-#else
-static float zero = 0.0;
-#endif
-#ifdef __STDC__
- float __ieee754_j1f(float x)
-#else
- float __ieee754_j1f(x)
- float x;
-#endif
+float
+__ieee754_j1f(float x)
{
float z, s,c,ss,cc,r,u,v,y;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
- if(ix>=0x7f800000) return one/x;
+ if(__builtin_expect(ix>=0x7f800000, 0)) return one/x;
y = fabsf(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
__sincosf (y, &s, &c);
@@ -73,7 +53,7 @@ static float zero = 0.0;
if(ix<0x7f000000) { /* make sure y+y not overflow */
z = __cosf(y+y);
if ((s*c)>zero) cc = z/ss;
- else ss = z/cc;
+ else ss = z/cc;
}
/*
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
@@ -85,9 +65,9 @@ static float zero = 0.0;
z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(y);
}
if(hx<0) return -z;
- else return z;
+ else return z;
}
- if(ix<0x32000000) { /* |x|<2**-27 */
+ if(__builtin_expect(ix<0x32000000, 0)) { /* |x|<2**-27 */
if(huge+x>one) return (float)0.5*x;/* inexact if x!=0 necessary */
}
z = x*x;
@@ -96,23 +76,16 @@ static float zero = 0.0;
r *= x;
return(x*(float)0.5+r/s);
}
+strong_alias (__ieee754_j1f, __j1f_finite)
-#ifdef __STDC__
static const float U0[5] = {
-#else
-static float U0[5] = {
-#endif
-1.9605709612e-01, /* 0xbe48c331 */
5.0443872809e-02, /* 0x3d4e9e3c */
-1.9125689287e-03, /* 0xbafaaf2a */
2.3525259166e-05, /* 0x37c5581c */
-9.1909917899e-08, /* 0xb3c56003 */
};
-#ifdef __STDC__
static const float V0[5] = {
-#else
-static float V0[5] = {
-#endif
1.9916731864e-02, /* 0x3ca3286a */
2.0255257550e-04, /* 0x3954644b */
1.3560879779e-06, /* 0x35b602d4 */
@@ -120,73 +93,67 @@ static float V0[5] = {
1.6655924903e-11, /* 0x2d9281cf */
};
-#ifdef __STDC__
- float __ieee754_y1f(float x)
-#else
- float __ieee754_y1f(x)
- float x;
-#endif
+float
+__ieee754_y1f(float x)
{
float z, s,c,ss,cc,u,v;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
- ix = 0x7fffffff&hx;
+ ix = 0x7fffffff&hx;
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
- if(ix>=0x7f800000) return one/(x+x*x);
- if(ix==0) return -HUGE_VALF+x; /* -inf and overflow exception. */
- if(hx<0) return zero/(zero*x);
- if(ix >= 0x40000000) { /* |x| >= 2.0 */
+ if(__builtin_expect(ix>=0x7f800000, 0)) return one/(x+x*x);
+ if(__builtin_expect(ix==0, 0))
+ return -HUGE_VALF+x; /* -inf and overflow exception. */
+ if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
+ if(ix >= 0x40000000) { /* |x| >= 2.0 */
__sincosf (x, &s, &c);
- ss = -s-c;
- cc = s-c;
- if(ix<0x7f000000) { /* make sure x+x not overflow */
- z = __cosf(x+x);
- if ((s*c)>zero) cc = z/ss;
- else ss = z/cc;
- }
- /* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x0)+q1(x)*cos(x0))
- * where x0 = x-3pi/4
- * Better formula:
- * cos(x0) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
- * = 1/sqrt(2) * (sin(x) - cos(x))
- * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
- * = -1/sqrt(2) * (cos(x) + sin(x))
- * To avoid cancellation, use
- * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.
- */
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
- else {
- u = ponef(x); v = qonef(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
- }
- return z;
- }
- if(ix<=0x24800000) { /* x < 2**-54 */
- return(-tpi/x);
- }
- z = x*x;
- u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
- v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
- return(x*(u/v) + tpi*(__ieee754_j1f(x)*__ieee754_logf(x)-one/x));
+ ss = -s-c;
+ cc = s-c;
+ if(ix<0x7f000000) { /* make sure x+x not overflow */
+ z = __cosf(x+x);
+ if ((s*c)>zero) cc = z/ss;
+ else ss = z/cc;
+ }
+ /* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x0)+q1(x)*cos(x0))
+ * where x0 = x-3pi/4
+ * Better formula:
+ * cos(x0) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
+ * = 1/sqrt(2) * (sin(x) - cos(x))
+ * sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
+ * = -1/sqrt(2) * (cos(x) + sin(x))
+ * To avoid cancellation, use
+ * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ * to compute the worse one.
+ */
+ if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
+ else {
+ u = ponef(x); v = qonef(x);
+ z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
+ }
+ return z;
+ }
+ if(__builtin_expect(ix<=0x24800000, 0)) { /* x < 2**-54 */
+ return(-tpi/x);
+ }
+ z = x*x;
+ u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
+ v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
+ return(x*(u/v) + tpi*(__ieee754_j1f(x)*__ieee754_logf(x)-one/x));
}
+strong_alias (__ieee754_y1f, __y1f_finite)
/* For x >= 8, the asymptotic expansions of pone is
* 1 + 15/128 s^2 - 4725/2^15 s^4 - ..., where s = 1/x.
* We approximate pone by
- * pone(x) = 1 + (R/S)
+ * pone(x) = 1 + (R/S)
* where R = pr0 + pr1*s^2 + pr2*s^4 + ... + pr5*s^10
- * S = 1 + ps0*s^2 + ... + ps4*s^10
+ * S = 1 + ps0*s^2 + ... + ps4*s^10
* and
* | pone(x)-1-R/S | <= 2 ** ( -60.06)
*/
-#ifdef __STDC__
static const float pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static float pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.0000000000e+00, /* 0x00000000 */
1.1718750000e-01, /* 0x3df00000 */
1.3239480972e+01, /* 0x4153d4ea */
@@ -194,11 +161,7 @@ static float pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
3.8747453613e+03, /* 0x45722bed */
7.9144794922e+03, /* 0x45f753d6 */
};
-#ifdef __STDC__
static const float ps8[5] = {
-#else
-static float ps8[5] = {
-#endif
1.1420736694e+02, /* 0x42e46a2c */
3.6509309082e+03, /* 0x45642ee5 */
3.6956207031e+04, /* 0x47105c35 */
@@ -206,11 +169,7 @@ static float ps8[5] = {
3.0804271484e+04, /* 0x46f0a88b */
};
-#ifdef __STDC__
static const float pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static float pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
1.3199052094e-11, /* 0x2d68333f */
1.1718749255e-01, /* 0x3defffff */
6.8027510643e+00, /* 0x40d9b023 */
@@ -218,11 +177,7 @@ static float pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
5.1763616943e+02, /* 0x440168b7 */
5.2871520996e+02, /* 0x44042dc6 */
};
-#ifdef __STDC__
static const float ps5[5] = {
-#else
-static float ps5[5] = {
-#endif
5.9280597687e+01, /* 0x426d1f55 */
9.9140142822e+02, /* 0x4477d9b1 */
5.3532670898e+03, /* 0x45a74a23 */
@@ -230,11 +185,7 @@ static float ps5[5] = {
1.5040468750e+03, /* 0x44bc0180 */
};
-#ifdef __STDC__
static const float pr3[6] = {
-#else
-static float pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
3.0250391081e-09, /* 0x314fe10d */
1.1718686670e-01, /* 0x3defffab */
3.9329774380e+00, /* 0x407bb5e7 */
@@ -242,11 +193,7 @@ static float pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
9.1055007935e+01, /* 0x42b61c2a */
4.8559066772e+01, /* 0x42423c7c */
};
-#ifdef __STDC__
static const float ps3[5] = {
-#else
-static float ps3[5] = {
-#endif
3.4791309357e+01, /* 0x420b2a4d */
3.3676245117e+02, /* 0x43a86198 */
1.0468714600e+03, /* 0x4482dbe3 */
@@ -254,11 +201,7 @@ static float ps3[5] = {
1.0378793335e+02, /* 0x42cf936c */
};
-#ifdef __STDC__
static const float pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static float pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
1.0771083225e-07, /* 0x33e74ea8 */
1.1717621982e-01, /* 0x3deffa16 */
2.3685150146e+00, /* 0x401795c0 */
@@ -266,11 +209,7 @@ static float pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
1.7693971634e+01, /* 0x418d8d41 */
5.0735230446e+00, /* 0x40a25a4d */
};
-#ifdef __STDC__
static const float ps2[5] = {
-#else
-static float ps2[5] = {
-#endif
2.1436485291e+01, /* 0x41ab7dec */
1.2529022980e+02, /* 0x42fa9499 */
2.3227647400e+02, /* 0x436846c7 */
@@ -278,48 +217,36 @@ static float ps2[5] = {
8.3646392822e+00, /* 0x4105d590 */
};
-#ifdef __STDC__
- static float ponef(float x)
-#else
- static float ponef(x)
- float x;
-#endif
+static float
+ponef(float x)
{
-#ifdef __STDC__
const float *p,*q;
-#else
- float *p,*q;
-#endif
float z,r,s;
- int32_t ix;
+ int32_t ix;
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
- if(ix>=0x41000000) {p = pr8; q= ps8;}
- else if(ix>=0x40f71c58){p = pr5; q= ps5;}
- else if(ix>=0x4036db68){p = pr3; q= ps3;}
- else if(ix>=0x40000000){p = pr2; q= ps2;}
- z = one/(x*x);
- r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
- s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
- return one+ r/s;
+ if(ix>=0x41000000) {p = pr8; q= ps8;}
+ else if(ix>=0x40f71c58){p = pr5; q= ps5;}
+ else if(ix>=0x4036db68){p = pr3; q= ps3;}
+ else if(ix>=0x40000000){p = pr2; q= ps2;}
+ z = one/(x*x);
+ r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
+ s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
+ return one+ r/s;
}
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
* We approximate pone by
- * qone(x) = s*(0.375 + (R/S))
+ * qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
- * S = 1 + qs1*s^2 + ... + qs6*s^12
+ * S = 1 + qs1*s^2 + ... + qs6*s^12
* and
* | qone(x)/s -0.375-R/S | <= 2 ** ( -61.13)
*/
-#ifdef __STDC__
static const float qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#else
-static float qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-#endif
0.0000000000e+00, /* 0x00000000 */
-1.0253906250e-01, /* 0xbdd20000 */
-1.6271753311e+01, /* 0xc1822c8d */
@@ -327,11 +254,7 @@ static float qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
-1.1849806641e+04, /* 0xc639273a */
-4.8438511719e+04, /* 0xc73d3683 */
};
-#ifdef __STDC__
static const float qs8[6] = {
-#else
-static float qs8[6] = {
-#endif
1.6139537048e+02, /* 0x43216537 */
7.8253862305e+03, /* 0x45f48b17 */
1.3387534375e+05, /* 0x4802bcd6 */
@@ -340,11 +263,7 @@ static float qs8[6] = {
-2.9449025000e+05, /* 0xc88fcb48 */
};
-#ifdef __STDC__
static const float qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#else
-static float qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-#endif
-2.0897993405e-11, /* 0xadb7d219 */
-1.0253904760e-01, /* 0xbdd1fffe */
-8.0564479828e+00, /* 0xc100e736 */
@@ -352,11 +271,7 @@ static float qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
-1.3731937256e+03, /* 0xc4aba633 */
-2.6124443359e+03, /* 0xc523471c */
};
-#ifdef __STDC__
static const float qs5[6] = {
-#else
-static float qs5[6] = {
-#endif
8.1276550293e+01, /* 0x42a28d98 */
1.9917987061e+03, /* 0x44f8f98f */
1.7468484375e+04, /* 0x468878f8 */
@@ -365,11 +280,7 @@ static float qs5[6] = {
-4.7191835938e+03, /* 0xc5937978 */
};
-#ifdef __STDC__
static const float qr3[6] = {
-#else
-static float qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-#endif
-5.0783124372e-09, /* 0xb1ae7d4f */
-1.0253783315e-01, /* 0xbdd1ff5b */
-4.6101160049e+00, /* 0xc0938612 */
@@ -377,11 +288,7 @@ static float qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
-2.2824453735e+02, /* 0xc3643e9a */
-2.1921012878e+02, /* 0xc35b35cb */
};
-#ifdef __STDC__
static const float qs3[6] = {
-#else
-static float qs3[6] = {
-#endif
4.7665153503e+01, /* 0x423ea91e */
6.7386511230e+02, /* 0x4428775e */
3.3801528320e+03, /* 0x45534272 */
@@ -390,11 +297,7 @@ static float qs3[6] = {
-1.3520118713e+02, /* 0xc3073381 */
};
-#ifdef __STDC__
static const float qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#else
-static float qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-#endif
-1.7838172539e-07, /* 0xb43f8932 */
-1.0251704603e-01, /* 0xbdd1f475 */
-2.7522056103e+00, /* 0xc0302423 */
@@ -402,11 +305,7 @@ static float qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
-4.2325313568e+01, /* 0xc2294d1f */
-2.1371921539e+01, /* 0xc1aaf9b2 */
};
-#ifdef __STDC__
static const float qs2[6] = {
-#else
-static float qs2[6] = {
-#endif
2.9533363342e+01, /* 0x41ec4454 */
2.5298155212e+02, /* 0x437cfb47 */
7.5750280762e+02, /* 0x443d602e */
@@ -415,18 +314,10 @@ static float qs2[6] = {
-4.9594988823e+00, /* 0xc09eb437 */
};
-#ifdef __STDC__
- static float qonef(float x)
-#else
- static float qonef(x)
- float x;
-#endif
+static float
+qonef(float x)
{
-#ifdef __STDC__
const float *p,*q;
-#else
- float *p,*q;
-#endif
float s,r,z;
int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/libc/sysdeps/ieee754/flt-32/e_jnf.c b/libc/sysdeps/ieee754/flt-32/e_jnf.c
index de2e53de8..1e55485b0 100644
--- a/libc/sysdeps/ieee754/flt-32/e_jnf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_jnf.c
@@ -13,33 +13,17 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_jnf.c,v 1.5 1995/05/10 20:45:37 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
two = 2.0000000000e+00, /* 0x40000000 */
one = 1.0000000000e+00; /* 0x3F800000 */
-#ifdef __STDC__
static const float zero = 0.0000000000e+00;
-#else
-static float zero = 0.0000000000e+00;
-#endif
-#ifdef __STDC__
- float __ieee754_jnf(int n, float x)
-#else
- float __ieee754_jnf(n,x)
- int n; float x;
-#endif
+float
+__ieee754_jnf(int n, float x)
{
int32_t i,hx,ix, sgn;
float a, b, temp, di;
@@ -51,7 +35,7 @@ static float zero = 0.0000000000e+00;
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
/* if J(n,NaN) is NaN */
- if(ix>0x7f800000) return x+x;
+ if(__builtin_expect(ix>0x7f800000, 0)) return x+x;
if(n<0){
n = -n;
x = -x;
@@ -61,7 +45,7 @@ static float zero = 0.0000000000e+00;
if(n==1) return(__ieee754_j1f(x));
sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */
x = fabsf(x);
- if(ix==0||ix>=0x7f800000) /* if x is 0 or inf */
+ if(__builtin_expect(ix==0||ix>=0x7f800000, 0)) /* if x is 0 or inf */
b = zero;
else if((float)n<=x) {
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
@@ -106,7 +90,7 @@ static float zero = 0.0000000000e+00;
* 1
* w - -----------------
* 1
- * w+h - ---------
+ * w+h - ---------
* w+2h - ...
*
* To determine how many terms needed, let
@@ -144,18 +128,18 @@ static float zero = 0.0000000000e+00;
tmp = tmp*__ieee754_logf(fabsf(v*tmp));
if(tmp<(float)8.8721679688e+01) {
for(i=n-1,di=(float)(i+i);i>0;i--){
- temp = b;
+ temp = b;
b *= di;
b = b/x - a;
- a = temp;
+ a = temp;
di -= two;
}
} else {
for(i=n-1,di=(float)(i+i);i>0;i--){
- temp = b;
+ temp = b;
b *= di;
b = b/x - a;
- a = temp;
+ a = temp;
di -= two;
/* scale b to avoid spurious overflow */
if(b>(float)1e10) {
@@ -165,18 +149,24 @@ static float zero = 0.0000000000e+00;
}
}
}
- b = (t*__ieee754_j0f(x)/b);
+ /* j0() and j1() suffer enormous loss of precision at and
+ * near zero; however, we know that their zero points never
+ * coincide, so just choose the one further away from zero.
+ */
+ z = __ieee754_j0f (x);
+ w = __ieee754_j1f (x);
+ if (fabsf (z) >= fabsf (w))
+ b = (t * z / b);
+ else
+ b = (t * w / a);
}
}
if(sgn==1) return -b; else return b;
}
+strong_alias (__ieee754_jnf, __jnf_finite)
-#ifdef __STDC__
- float __ieee754_ynf(int n, float x)
-#else
- float __ieee754_ynf(n,x)
- int n; float x;
-#endif
+float
+__ieee754_ynf(int n, float x)
{
int32_t i,hx,ix;
u_int32_t ib;
@@ -186,9 +176,10 @@ static float zero = 0.0000000000e+00;
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
/* if Y(n,NaN) is NaN */
- if(ix>0x7f800000) return x+x;
- if(ix==0) return -HUGE_VALF+x; /* -inf and overflow exception. */
- if(hx<0) return zero/(zero*x);
+ if(__builtin_expect(ix>0x7f800000, 0)) return x+x;
+ if(__builtin_expect(ix==0, 0))
+ return -HUGE_VALF+x; /* -inf and overflow exception. */
+ if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
sign = 1;
if(n<0){
n = -n;
@@ -196,7 +187,7 @@ static float zero = 0.0000000000e+00;
}
if(n==0) return(__ieee754_y0f(x));
if(n==1) return(sign*__ieee754_y1f(x));
- if(ix==0x7f800000) return zero;
+ if(__builtin_expect(ix==0x7f800000, 0)) return zero;
a = __ieee754_y0f(x);
b = __ieee754_y1f(x);
@@ -210,3 +201,4 @@ static float zero = 0.0000000000e+00;
}
if(sign>0) return b; else return -b;
}
+strong_alias (__ieee754_ynf, __ynf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
index 0ed261008..cbee9db8f 100644
--- a/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
+++ b/libc/sysdeps/ieee754/flt-32/e_lgammaf_r.c
@@ -13,18 +13,10 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_lgammaf_r.c,v 1.3 1995/05/10 20:45:47 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
two23= 8.3886080000e+06, /* 0x4b000000 */
half= 5.0000000000e-01, /* 0x3f000000 */
one = 1.0000000000e+00, /* 0x3f800000 */
@@ -92,18 +84,10 @@ w4 = -5.9518753551e-04, /* 0xba1c065c */
w5 = 8.3633989561e-04, /* 0x3a5b3dd2 */
w6 = -1.6309292987e-03; /* 0xbad5c4e8 */
-#ifdef __STDC__
static const float zero= 0.0000000000e+00;
-#else
-static float zero= 0.0000000000e+00;
-#endif
-#ifdef __STDC__
- static float sin_pif(float x)
-#else
- static float sin_pif(x)
- float x;
-#endif
+static float
+sin_pif(float x)
{
float y,z;
int n,ix;
@@ -124,16 +108,16 @@ static float zero= 0.0000000000e+00;
y = (float)2.0*(y - __floorf(y)); /* y = |x| mod 2.0 */
n = (int) (y*(float)4.0);
} else {
- if(ix>=0x4b800000) {
- y = zero; n = 0; /* y must be even */
- } else {
- if(ix<0x4b000000) z = y+two23; /* exact */
+ if(ix>=0x4b800000) {
+ y = zero; n = 0; /* y must be even */
+ } else {
+ if(ix<0x4b000000) z = y+two23; /* exact */
GET_FLOAT_WORD(n,z);
n &= 1;
- y = n;
- n<<= 2;
- }
- }
+ y = n;
+ n<<= 2;
+ }
+ }
switch (n) {
case 0: y = __kernel_sinf(pi*y,zero,0); break;
case 1:
@@ -148,12 +132,8 @@ static float zero= 0.0000000000e+00;
}
-#ifdef __STDC__
- float __ieee754_lgammaf_r(float x, int *signgamp)
-#else
- float __ieee754_lgammaf_r(x,signgamp)
- float x; int *signgamp;
-#endif
+float
+__ieee754_lgammaf_r(float x, int *signgamp)
{
float t,y,z,nadj,p,p1,p2,p3,q,r,w;
int i,hx,ix;
@@ -163,21 +143,22 @@ static float zero= 0.0000000000e+00;
/* purge off +-inf, NaN, +-0, and negative arguments */
*signgamp = 1;
ix = hx&0x7fffffff;
- if(ix>=0x7f800000) return x*x;
- if(ix==0)
+ if(__builtin_expect(ix>=0x7f800000, 0)) return x*x;
+ if(__builtin_expect(ix==0, 0))
{
if (hx < 0)
*signgamp = -1;
return one/fabsf(x);
}
- if(ix<0x1c800000) { /* |x|<2**-70, return -log(|x|) */
+ if(__builtin_expect(ix<0x1c800000, 0)) {
+ /* |x|<2**-70, return -log(|x|) */
if(hx<0) {
- *signgamp = -1;
- return -__ieee754_logf(-x);
+ *signgamp = -1;
+ return -__ieee754_logf(-x);
} else return -__ieee754_logf(x);
}
if(hx<0) {
- if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */
+ if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */
return x/zero;
t = sin_pif(x);
if(t==zero) return one/fabsf(t); /* -integer */
@@ -190,15 +171,15 @@ static float zero= 0.0000000000e+00;
if (ix==0x3f800000||ix==0x40000000) r = 0;
/* for x < 2.0 */
else if(ix<0x40000000) {
- if(ix<=0x3f666666) { /* lgamma(x) = lgamma(x+1)-log(x) */
+ if(ix<=0x3f666666) { /* lgamma(x) = lgamma(x+1)-log(x) */
r = -__ieee754_logf(x);
if(ix>=0x3f3b4a20) {y = one-x; i= 0;}
else if(ix>=0x3e6d3308) {y= x-(tc-one); i=1;}
- else {y = x; i=2;}
+ else {y = x; i=2;}
} else {
- r = zero;
- if(ix>=0x3fdda618) {y=(float)2.0-x;i=0;} /* [1.7316,2] */
- else if(ix>=0x3F9da620) {y=x-tc;i=1;} /* [1.23,1.73] */
+ r = zero;
+ if(ix>=0x3fdda618) {y=(float)2.0-x;i=0;} /* [1.7316,2] */
+ else if(ix>=0x3F9da620) {y=x-tc;i=1;} /* [1.23,1.73] */
else {y=x-one;i=2;}
}
switch(i) {
@@ -222,7 +203,7 @@ static float zero= 0.0000000000e+00;
r += (-(float)0.5*y + p1/p2);
}
}
- else if(ix<0x41000000) { /* x < 8.0 */
+ else if(ix<0x41000000) { /* x < 8.0 */
i = (int)x;
t = zero;
y = x-(float)i;
@@ -251,3 +232,4 @@ static float zero= 0.0000000000e+00;
if(hx<0) r = nadj - r;
return r;
}
+strong_alias (__ieee754_lgammaf_r, __lgammaf_r_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_log10f.c b/libc/sysdeps/ieee754/flt-32/e_log10f.c
index cea3d9156..72dcea625 100644
--- a/libc/sysdeps/ieee754/flt-32/e_log10f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_log10f.c
@@ -13,55 +13,41 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_log10f.c,v 1.5 1995/05/10 20:45:53 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
two25 = 3.3554432000e+07, /* 0x4c000000 */
ivln10 = 4.3429449201e-01, /* 0x3ede5bd9 */
log10_2hi = 3.0102920532e-01, /* 0x3e9a2080 */
log10_2lo = 7.9034151668e-07; /* 0x355427db */
-#ifdef __STDC__
static const float zero = 0.0;
-#else
-static float zero = 0.0;
-#endif
-#ifdef __STDC__
- float __ieee754_log10f(float x)
-#else
- float __ieee754_log10f(x)
- float x;
-#endif
+float
+__ieee754_log10f(float x)
{
float y,z;
int32_t i,k,hx;
GET_FLOAT_WORD(hx,x);
- k=0;
- if (hx < 0x00800000) { /* x < 2**-126 */
- if ((hx&0x7fffffff)==0)
- return -two25/(x-x); /* log(+-0)=-inf */
- if (hx<0) return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 25; x *= two25; /* subnormal number, scale up x */
+ k=0;
+ if (hx < 0x00800000) { /* x < 2**-126 */
+ if (__builtin_expect((hx&0x7fffffff)==0, 0))
+ return -two25/(x-x); /* log(+-0)=-inf */
+ if (__builtin_expect(hx<0, 0))
+ return (x-x)/(x-x); /* log(-#) = NaN */
+ k -= 25; x *= two25; /* subnormal number, scale up x */
GET_FLOAT_WORD(hx,x);
- }
- if (hx >= 0x7f800000) return x+x;
+ }
+ if (__builtin_expect(hx >= 0x7f800000, 0)) return x+x;
k += (hx>>23)-127;
i = ((u_int32_t)k&0x80000000)>>31;
- hx = (hx&0x007fffff)|((0x7f-i)<<23);
- y = (float)(k+i);
+ hx = (hx&0x007fffff)|((0x7f-i)<<23);
+ y = (float)(k+i);
SET_FLOAT_WORD(x,hx);
z = y*log10_2lo + ivln10*__ieee754_logf(x);
return z+y*log10_2hi;
}
+strong_alias (__ieee754_log10f, __log10f_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_log2f.c b/libc/sysdeps/ieee754/flt-32/e_log2f.c
index af3c6eadf..745321451 100644
--- a/libc/sysdeps/ieee754/flt-32/e_log2f.c
+++ b/libc/sysdeps/ieee754/flt-32/e_log2f.c
@@ -18,11 +18,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
ln2 = 0.69314718055994530942,
two25 = 3.355443200e+07, /* 0x4c000000 */
Lg1 = 6.6666668653e-01, /* 3F2AAAAB */
@@ -33,18 +29,10 @@ Lg5 = 1.8183572590e-01, /* 3E3A3325 */
Lg6 = 1.5313838422e-01, /* 3E1CD04F */
Lg7 = 1.4798198640e-01; /* 3E178897 */
-#ifdef __STDC__
static const float zero = 0.0;
-#else
-static float zero = 0.0;
-#endif
-#ifdef __STDC__
- float __ieee754_log2f(float x)
-#else
- float __ieee754_log2f(x)
- float x;
-#endif
+float
+__ieee754_log2f(float x)
{
float hfsq,f,s,z,R,w,t1,t2,dk;
int32_t k,ix,i,j;
@@ -53,13 +41,14 @@ static float zero = 0.0;
k=0;
if (ix < 0x00800000) { /* x < 2**-126 */
- if ((ix&0x7fffffff)==0)
+ if (__builtin_expect((ix&0x7fffffff)==0, 0))
return -two25/(x-x); /* log(+-0)=-inf */
- if (ix<0) return (x-x)/(x-x); /* log(-#) = NaN */
+ if (__builtin_expect(ix<0, 0))
+ return (x-x)/(x-x); /* log(-#) = NaN */
k -= 25; x *= two25; /* subnormal number, scale up x */
GET_FLOAT_WORD(ix,x);
}
- if (ix >= 0x7f800000) return x+x;
+ if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x;
k += (ix>>23)-127;
ix &= 0x007fffff;
i = (ix+(0x95f64<<3))&0x800000;
@@ -72,7 +61,7 @@ static float zero = 0.0;
R = f*f*((float)0.5-(float)0.33333333333333333*f);
return dk-(R-f)/ln2;
}
- s = f/((float)2.0+f);
+ s = f/((float)2.0+f);
z = s*s;
i = ix-(0x6147a<<3);
w = z*z;
@@ -88,3 +77,4 @@ static float zero = 0.0;
return dk-((s*(f-R))-f)/ln2;
}
}
+strong_alias (__ieee754_log2f, __log2f_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_logf.c b/libc/sysdeps/ieee754/flt-32/e_logf.c
index de8f869df..b870b3195 100644
--- a/libc/sysdeps/ieee754/flt-32/e_logf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_logf.c
@@ -13,18 +13,10 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_logf.c,v 1.4 1995/05/10 20:45:54 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */
two25 = 3.355443200e+07, /* 0x4c000000 */
@@ -36,18 +28,10 @@ Lg5 = 1.8183572590e-01, /* 3E3A3325 */
Lg6 = 1.5313838422e-01, /* 3E1CD04F */
Lg7 = 1.4798198640e-01; /* 3E178897 */
-#ifdef __STDC__
static const float zero = 0.0;
-#else
-static float zero = 0.0;
-#endif
-#ifdef __STDC__
- float __ieee754_logf(float x)
-#else
- float __ieee754_logf(x)
- float x;
-#endif
+float
+__ieee754_logf(float x)
{
float hfsq,f,s,z,R,w,t1,t2,dk;
int32_t k,ix,i,j;
@@ -56,13 +40,14 @@ static float zero = 0.0;
k=0;
if (ix < 0x00800000) { /* x < 2**-126 */
- if ((ix&0x7fffffff)==0)
+ if (__builtin_expect((ix&0x7fffffff)==0, 0))
return -two25/(x-x); /* log(+-0)=-inf */
- if (ix<0) return (x-x)/(x-x); /* log(-#) = NaN */
+ if (__builtin_expect(ix<0, 0))
+ return (x-x)/(x-x); /* log(-#) = NaN */
k -= 25; x *= two25; /* subnormal number, scale up x */
GET_FLOAT_WORD(ix,x);
}
- if (ix >= 0x7f800000) return x+x;
+ if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x;
k += (ix>>23)-127;
ix &= 0x007fffff;
i = (ix+(0x95f64<<3))&0x800000;
@@ -76,9 +61,9 @@ static float zero = 0.0;
}
R = f*f*((float)0.5-(float)0.33333333333333333*f);
if(k==0) return f-R; else {dk=(float)k;
- return dk*ln2_hi-((R-dk*ln2_lo)-f);}
+ return dk*ln2_hi-((R-dk*ln2_lo)-f);}
}
- s = f/((float)2.0+f);
+ s = f/((float)2.0+f);
dk = (float)k;
z = s*s;
i = ix-(0x6147a<<3);
@@ -97,3 +82,4 @@ static float zero = 0.0;
return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
}
}
+strong_alias (__ieee754_logf, __logf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_powf.c b/libc/sysdeps/ieee754/flt-32/e_powf.c
index 9f520804a..460055204 100644
--- a/libc/sysdeps/ieee754/flt-32/e_powf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_powf.c
@@ -13,20 +13,12 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_powf.c,v 1.7 1996/04/08 15:43:44 phil Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
static const float huge = 1.0e+30, tiny = 1.0e-30;
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
bp[] = {1.0, 1.5,},
dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */
dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */
@@ -57,12 +49,8 @@ ivln2 = 1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */
ivln2_h = 1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/
ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
-#ifdef __STDC__
- float __ieee754_powf(float x, float y)
-#else
- float __ieee754_powf(x,y)
- float x, y;
-#endif
+float
+__ieee754_powf(float x, float y)
{
float z,ax,z_h,z_l,p_h,p_l;
float y1,t1,t2,r,s,t,u,v,w;
@@ -81,8 +69,8 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
if(x == -1.0 && isinf(y)) return one;
/* +-NaN return x+y */
- if(ix > 0x7f800000 ||
- iy > 0x7f800000)
+ if(__builtin_expect(ix > 0x7f800000 ||
+ iy > 0x7f800000, 0))
return x+y;
/* determine if y is an odd int when x < 0
@@ -101,26 +89,26 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
}
/* special value of y */
- if (iy==0x7f800000) { /* y is +-inf */
+ if (__builtin_expect(iy==0x7f800000, 0)) { /* y is +-inf */
if (ix==0x3f800000)
- return y - y; /* inf**+-1 is NaN */
+ return y - y; /* inf**+-1 is NaN */
else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */
- return (hy>=0)? y: zero;
+ return (hy>=0)? y: zero;
else /* (|x|<1)**-,+inf = inf,0 */
- return (hy<0)?-y: zero;
+ return (hy<0)?-y: zero;
}
if(iy==0x3f800000) { /* y is +-1 */
if(hy<0) return one/x; else return x;
}
if(hy==0x40000000) return x*x; /* y is 2 */
if(hy==0x3f000000) { /* y is 0.5 */
- if(hx>=0) /* x >= +0 */
+ if(__builtin_expect(hx>=0, 1)) /* x >= +0 */
return __ieee754_sqrtf(x);
}
ax = fabsf(x);
/* special value of x */
- if(ix==0x7f800000||ix==0||ix==0x3f800000){
+ if(__builtin_expect(ix==0x7f800000||ix==0||ix==0x3f800000, 0)){
z = ax; /*x is +-0,+-inf,+-1*/
if(hy<0) z = one/z; /* z = (1/|x|) */
if(hx<0) {
@@ -133,10 +121,11 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
}
/* (x<0)**(non-int) is NaN */
- if(((((u_int32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x);
+ if(__builtin_expect(((((u_int32_t)hx>>31)-1)|yisint)==0, 0))
+ return (x-x)/(x-x);
/* |y| is huge */
- if(iy>0x4d000000) { /* if |y| > 2**27 */
+ if(__builtin_expect(iy>0x4d000000, 0)) { /* if |y| > 2**27 */
/* over/underflow if x is not close to one */
if(ix<0x3f7ffff8) return (hy<0)? huge*huge:tiny*tiny;
if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny;
@@ -214,14 +203,14 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
p_h = y1*t1;
z = p_l+p_h;
GET_FLOAT_WORD(j,z);
- if (j>0x43000000) /* if z > 128 */
+ if (__builtin_expect(j>0x43000000, 0)) /* if z > 128 */
return s*huge*huge; /* overflow */
- else if (j==0x43000000) { /* if z == 128 */
+ else if (__builtin_expect(j==0x43000000, 0)) { /* if z == 128 */
if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */
}
- else if ((j&0x7fffffff)>0x43160000) /* z <= -150 */
+ else if (__builtin_expect((j&0x7fffffff)>0x43160000, 0))/* z <= -150 */
return s*tiny*tiny; /* underflow */
- else if ((u_int32_t) j==0xc3160000){ /* z == -150 */
+ else if (__builtin_expect((u_int32_t) j==0xc3160000, 0)){/* z == -150*/
if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */
}
/*
@@ -255,3 +244,4 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
else SET_FLOAT_WORD(z,j);
return s*z;
}
+strong_alias (__ieee754_powf, __powf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_remainderf.c b/libc/sysdeps/ieee754/flt-32/e_remainderf.c
index 90d0d366d..aaf15dfe5 100644
--- a/libc/sysdeps/ieee754/flt-32/e_remainderf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_remainderf.c
@@ -8,31 +8,19 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_remainderf.c,v 1.4 1995/05/10 20:46:08 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float zero = 0.0;
-#else
-static float zero = 0.0;
-#endif
-#ifdef __STDC__
- float __ieee754_remainderf(float x, float p)
-#else
- float __ieee754_remainderf(x,p)
- float x,p;
-#endif
+float
+__ieee754_remainderf(float x, float p)
{
int32_t hx,hp;
u_int32_t sx;
@@ -45,7 +33,7 @@ static float zero = 0.0;
hx &= 0x7fffffff;
/* purge off exception values */
- if(hp==0) return (x*p)/(x*p); /* p = 0 */
+ if(hp==0) return (x*p)/(x*p); /* p = 0 */
if((hx>=0x7f800000)|| /* x not finite */
((hp>0x7f800000))) /* p is NaN */
return (x*p)/(x*p);
@@ -71,3 +59,4 @@ static float zero = 0.0;
SET_FLOAT_WORD(x,hx^sx);
return x;
}
+strong_alias (__ieee754_remainderf, __remainderf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_sinhf.c b/libc/sysdeps/ieee754/flt-32/e_sinhf.c
index 045f6f121..581396348 100644
--- a/libc/sysdeps/ieee754/flt-32/e_sinhf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_sinhf.c
@@ -8,31 +8,19 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_sinhf.c,v 1.4 1995/05/10 20:46:15 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float one = 1.0, shuge = 1.0e37;
-#else
-static float one = 1.0, shuge = 1.0e37;
-#endif
-#ifdef __STDC__
- float __ieee754_sinhf(float x)
-#else
- float __ieee754_sinhf(x)
- float x;
-#endif
-{
+float
+__ieee754_sinhf(float x)
+{
float t,w,h;
int32_t ix,jx;
@@ -40,13 +28,13 @@ static float one = 1.0, shuge = 1.0e37;
ix = jx&0x7fffffff;
/* x is INF or NaN */
- if(ix>=0x7f800000) return x+x;
+ if(__builtin_expect(ix>=0x7f800000, 0)) return x+x;
h = 0.5;
if (jx<0) h = -h;
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x41b00000) { /* |x|<22 */
- if (ix<0x31800000) /* |x|<2**-28 */
+ if (__builtin_expect(ix<0x31800000, 0)) /* |x|<2**-28 */
if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
t = __expm1f(fabsf(x));
if(ix<0x3f800000) return h*((float)2.0*t-t*t/(t+one));
@@ -66,3 +54,4 @@ static float one = 1.0, shuge = 1.0e37;
/* |x| > overflowthresold, sinh(x) overflow */
return x*shuge;
}
+strong_alias (__ieee754_sinhf, __sinhf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/e_sqrtf.c b/libc/sysdeps/ieee754/flt-32/e_sqrtf.c
index 7648ef4bc..6d6688c52 100644
--- a/libc/sysdeps/ieee754/flt-32/e_sqrtf.c
+++ b/libc/sysdeps/ieee754/flt-32/e_sqrtf.c
@@ -8,43 +8,31 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_sqrtf.c,v 1.4 1995/05/10 20:46:19 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float one = 1.0, tiny=1.0e-30;
-#else
-static float one = 1.0, tiny=1.0e-30;
-#endif
-#ifdef __STDC__
- float __ieee754_sqrtf(float x)
-#else
- float __ieee754_sqrtf(x)
- float x;
-#endif
+float
+__ieee754_sqrtf(float x)
{
float z;
- int32_t sign = (int)0x80000000;
+ int32_t sign = (int)0x80000000;
int32_t ix,s,q,m,t,i;
u_int32_t r;
GET_FLOAT_WORD(ix,x);
/* take care of Inf and NaN */
- if((ix&0x7f800000)==0x7f800000) {
+ if((ix&0x7f800000)==0x7f800000) {
return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf
sqrt(-inf)=sNaN */
- }
+ }
/* take care of zero */
if(ix<=0) {
if((ix&(~sign))==0) return x;/* sqrt(+-0) = +-0 */
@@ -69,12 +57,12 @@ static float one = 1.0, tiny=1.0e-30;
r = 0x01000000; /* r = moving bit from right to left */
while(r!=0) {
- t = s+r;
- if(t<=ix) {
- s = t+r;
- ix -= t;
- q += r;
- }
+ t = s+r;
+ if(t<=ix) {
+ s = t+r;
+ ix -= t;
+ q += r;
+ }
ix += ix;
r>>=1;
}
@@ -83,7 +71,7 @@ static float one = 1.0, tiny=1.0e-30;
if(ix!=0) {
z = one-tiny; /* trigger inexact flag */
if (z>=one) {
- z = one+tiny;
+ z = one+tiny;
if (z>one)
q += 2;
else
@@ -95,3 +83,4 @@ static float one = 1.0, tiny=1.0e-30;
SET_FLOAT_WORD(z,ix);
return z;
}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/libc/sysdeps/ieee754/flt-32/s_asinhf.c b/libc/sysdeps/ieee754/flt-32/s_asinhf.c
index fac256d37..aa46f9000 100644
--- a/libc/sysdeps/ieee754/flt-32/s_asinhf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_asinhf.c
@@ -13,46 +13,36 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_asinhf.c,v 1.5 1995/05/12 04:57:39 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
one = 1.0000000000e+00, /* 0x3F800000 */
ln2 = 6.9314718246e-01, /* 0x3f317218 */
huge= 1.0000000000e+30;
-#ifdef __STDC__
- float __asinhf(float x)
-#else
- float __asinhf(x)
- float x;
-#endif
+float
+__asinhf(float x)
{
- float t,w;
+ float 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< 0x38000000) { /* |x|<2**-14 */
+ if(__builtin_expect(ix< 0x38000000, 0)) { /* |x|<2**-14 */
if(huge+x>one) return x; /* return x inexact except 0 */
}
- if(ix>0x47000000) { /* |x| > 2**14 */
+ if(__builtin_expect(ix>0x47000000, 0)) { /* |x| > 2**14 */
+ if(ix>=0x7f800000) return x+x; /* x is inf or NaN */
w = __ieee754_logf(fabsf(x))+ln2;
- } 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**-14 */
- t = x*x;
- w =__log1pf(fabsf(x)+t/(one+__ieee754_sqrtf(one+t)));
+ } else {
+ float xa = fabsf(x);
+ if (ix>0x40000000) { /* 2**14 > |x| > 2.0 */
+ w = __ieee754_logf(2.0f*xa+one/(__ieee754_sqrtf(xa*xa+one)+xa));
+ } else { /* 2.0 > |x| > 2**-14 */
+ float t = xa*xa;
+ w =__log1pf(xa+t/(one+__ieee754_sqrtf(one+t)));
+ }
}
- if(hx>0) return w; else return -w;
+ return __copysignf(w, x);
}
weak_alias (__asinhf, asinhf)
diff --git a/libc/sysdeps/ieee754/flt-32/s_ceilf.c b/libc/sysdeps/ieee754/flt-32/s_ceilf.c
index 29ccadb04..8a83201c1 100644
--- a/libc/sysdeps/ieee754/flt-32/s_ceilf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_ceilf.c
@@ -8,30 +8,19 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_ceilf.c,v 1.4 1995/05/10 20:46:55 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
+
static const float huge = 1.0e30;
-#else
-static float huge = 1.0e30;
-#endif
-#ifdef __STDC__
- float __ceilf(float x)
-#else
- float __ceilf(x)
- float x;
-#endif
+float
+__ceilf(float x)
{
int32_t i0,j0;
u_int32_t i;
@@ -39,9 +28,9 @@ static float huge = 1.0e30;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
- if(j0<0) { /* raise inexact if x != 0 */
+ if(j0<0) { /* raise inexact if x != 0 */
if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0<0) {i0=0x80000000;}
+ if(i0<0) {i0=0x80000000;}
else if(i0!=0) { i0=0x3f800000;}
}
} else {
@@ -53,10 +42,12 @@ static float huge = 1.0e30;
}
}
} else {
- if(j0==0x80) return x+x; /* inf or NaN */
+ if(__builtin_expect(j0==0x80, 0)) return x+x; /* inf or NaN */
else return x; /* x is integral */
}
SET_FLOAT_WORD(x,i0);
return x;
}
+#ifndef __ceilf
weak_alias (__ceilf, ceilf)
+#endif
diff --git a/libc/sysdeps/ieee754/flt-32/s_finitef.c b/libc/sysdeps/ieee754/flt-32/s_finitef.c
index 65767f8f9..2df513be7 100644
--- a/libc/sysdeps/ieee754/flt-32/s_finitef.c
+++ b/libc/sysdeps/ieee754/flt-32/s_finitef.c
@@ -25,6 +25,7 @@ static char rcsid[] = "$NetBSD: s_finitef.c,v 1.4 1995/05/10 20:47:18 jtc Exp $"
#include "math.h"
#include "math_private.h"
+#undef __finitef
#ifdef __STDC__
int __finitef(float x)
#else
diff --git a/libc/sysdeps/ieee754/flt-32/s_floorf.c b/libc/sysdeps/ieee754/flt-32/s_floorf.c
index e8822b088..dd19c6bc5 100644
--- a/libc/sysdeps/ieee754/flt-32/s_floorf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_floorf.c
@@ -8,15 +8,11 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_floorf.c,v 1.4 1995/05/10 20:47:22 jtc Exp $";
-#endif
-
/*
* floorf(x)
* Return x rounded toward -inf to integral value
@@ -29,27 +25,19 @@ static char rcsid[] = "$NetBSD: s_floorf.c,v 1.4 1995/05/10 20:47:22 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float huge = 1.0e30;
-#else
-static float huge = 1.0e30;
-#endif
-#ifdef __STDC__
- float __floorf(float x)
-#else
- float __floorf(x)
- float x;
-#endif
+float
+__floorf(float x)
{
int32_t i0,j0;
u_int32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
- if(j0<0) { /* raise inexact if x != 0 */
+ if(j0<0) { /* raise inexact if x != 0 */
if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0>=0) {i0=0;}
+ if(i0>=0) {i0=0;}
else if((i0&0x7fffffff)!=0)
{ i0=0xbf800000;}
}
@@ -62,10 +50,12 @@ static float huge = 1.0e30;
}
}
} else {
- if(j0==0x80) return x+x; /* inf or NaN */
+ if(__builtin_expect(j0==0x80, 0)) return x+x; /* inf or NaN */
else return x; /* x is integral */
}
SET_FLOAT_WORD(x,i0);
return x;
}
+#ifndef __floorf
weak_alias (__floorf, floorf)
+#endif
diff --git a/libc/sysdeps/ieee754/flt-32/s_isinf_nsf.c b/libc/sysdeps/ieee754/flt-32/s_isinf_nsf.c
new file mode 100644
index 000000000..1e46e2ce4
--- /dev/null
+++ b/libc/sysdeps/ieee754/flt-32/s_isinf_nsf.c
@@ -0,0 +1,20 @@
+/*
+ * Written by Ulrich Drepper <drepper@gmail.com>.
+ */
+
+/*
+ * __isinf_nsf(x) returns != 0 if x is ±inf, else 0;
+ * no branching!
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#undef __isinf_nsf
+int
+__isinf_nsf (float x)
+{
+ int32_t ix;
+ GET_FLOAT_WORD(ix,x);
+ return (ix & 0x7fffffff) == 0x7f800000;
+}
diff --git a/libc/sysdeps/ieee754/flt-32/s_isnanf.c b/libc/sysdeps/ieee754/flt-32/s_isnanf.c
index 4ac16c2b5..1b1b2475b 100644
--- a/libc/sysdeps/ieee754/flt-32/s_isnanf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_isnanf.c
@@ -4,7 +4,7 @@
/*
* ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ * Copyright (C) 1993, 2011 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
@@ -25,6 +25,7 @@ static char rcsid[] = "$NetBSD: s_isnanf.c,v 1.4 1995/05/10 20:47:38 jtc Exp $";
#include "math.h"
#include "math_private.h"
+#undef __isnanf
#ifdef __STDC__
int __isnanf(float x)
#else
diff --git a/libc/sysdeps/ieee754/flt-32/s_nearbyintf.c b/libc/sysdeps/ieee754/flt-32/s_nearbyintf.c
index 7d6f262f5..04ef9ab20 100644
--- a/libc/sysdeps/ieee754/flt-32/s_nearbyintf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_nearbyintf.c
@@ -19,22 +19,14 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
TWO23[2]={
8.3886080000e+06, /* 0x4b000000 */
-8.3886080000e+06, /* 0xcb000000 */
};
-#ifdef __STDC__
- float __nearbyintf(float x)
-#else
- float __nearbyintf(x)
- float x;
-#endif
+float
+__nearbyintf(float x)
{
fenv_t env;
int32_t i0,j0,sx;
@@ -50,13 +42,13 @@ TWO23[2]={
i0 &= 0xfff00000;
i0 |= ((i1|-i1)>>9)&0x400000;
SET_FLOAT_WORD(x,i0);
- feholdexcept (&env);
- w = TWO23[sx]+x;
- t = w-TWO23[sx];
- fesetenv (&env);
+ libc_feholdexceptf (&env);
+ w = TWO23[sx]+x;
+ t = w-TWO23[sx];
+ libc_fesetenvf (&env);
GET_FLOAT_WORD(i0,t);
SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
- return t;
+ return t;
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
@@ -64,14 +56,14 @@ TWO23[2]={
if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);
}
} else {
- if(j0==0x80) return x+x; /* inf or NaN */
+ if(__builtin_expect(j0==0x80, 0)) return x+x; /* inf or NaN */
else return x; /* x is integral */
}
SET_FLOAT_WORD(x,i0);
- feholdexcept (&env);
+ libc_feholdexceptf (&env);
w = TWO23[sx]+x;
t = w-TWO23[sx];
- fesetenv (&env);
+ libc_fesetenvf (&env);
return t;
}
weak_alias (__nearbyintf, nearbyintf)
diff --git a/libc/sysdeps/ieee754/flt-32/s_rintf.c b/libc/sysdeps/ieee754/flt-32/s_rintf.c
index 4e5b409b2..9ea9b6fc4 100644
--- a/libc/sysdeps/ieee754/flt-32/s_rintf.c
+++ b/libc/sysdeps/ieee754/flt-32/s_rintf.c
@@ -8,34 +8,22 @@
*
* 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.
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_rintf.c,v 1.4 1995/05/10 20:48:06 jtc Exp $";
-#endif
-
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const float
-#else
-static float
-#endif
TWO23[2]={
8.3886080000e+06, /* 0x4b000000 */
-8.3886080000e+06, /* 0xcb000000 */
};
-#ifdef __STDC__
- float __rintf(float x)
-#else
- float __rintf(x)
- float x;
-#endif
+float
+__rintf(float x)
{
int32_t i0,j0,sx;
u_int32_t i,i1;
@@ -44,17 +32,17 @@ TWO23[2]={
sx = (i0>>31)&1;
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
- if(j0<0) {
+ if(j0<0) {
if((i0&0x7fffffff)==0) return x;
i1 = (i0&0x07fffff);
i0 &= 0xfff00000;
i0 |= ((i1|-i1)>>9)&0x400000;
SET_FLOAT_WORD(x,i0);
- w = TWO23[sx]+x;
- t = w-TWO23[sx];
+ w = TWO23[sx]+x;
+ t = w-TWO23[sx];
GET_FLOAT_WORD(i0,t);
SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
- return t;
+ return t;
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
@@ -69,4 +57,6 @@ TWO23[2]={
w = TWO23[sx]+x;
return w-TWO23[sx];
}
+#ifndef __rintf
weak_alias (__rintf, rintf)
+#endif
diff --git a/libc/sysdeps/ieee754/flt-32/w_expf.c b/libc/sysdeps/ieee754/flt-32/w_expf.c
index 83b268f57..151c58454 100644
--- a/libc/sysdeps/ieee754/flt-32/w_expf.c
+++ b/libc/sysdeps/ieee754/flt-32/w_expf.c
@@ -1,60 +1,46 @@
-/* w_expf.c -- float version of w_exp.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: w_expf.c,v 1.3 1995/05/10 20:48:53 jtc Exp $";
-#endif
-
-/*
- * wrapper expf(x)
- */
-
-#include "math.h"
-#include "math_private.h"
-
-#ifdef __STDC__
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <math.h>
+#include <math_private.h>
+
static const float
-#else
-static float
-#endif
o_threshold= 8.8722831726e+01, /* 0x42b17217 */
u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */
-#ifdef __STDC__
- float __expf(float x) /* wrapper expf */
-#else
- float __expf(x) /* wrapper expf */
- float x;
-#endif
+
+/* wrapper expf */
+float
+__expf (float x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_expf(x);
-#else
- float z;
- z = __ieee754_expf(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(__finitef(x)) {
- if(x>o_threshold)
- /* exp overflow */
- return (float)__kernel_standard((double)x,(double)x,106);
- else if(x<u_threshold)
- /* exp underflow */
- return (float)__kernel_standard((double)x,(double)x,107);
- }
- return z;
-#endif
+ if (__builtin_expect (x > o_threshold, 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 106);
+ }
+ else if (__builtin_expect (x < u_threshold, 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ return __kernel_standard_f (x, x, 107);
+ }
+
+ return __ieee754_expf (x);
}
hidden_def (__expf)
weak_alias (__expf, expf)
diff --git a/libc/sysdeps/ieee754/k_standard.c b/libc/sysdeps/ieee754/k_standard.c
index ede515745..229c4981d 100644
--- a/libc/sysdeps/ieee754/k_standard.c
+++ b/libc/sysdeps/ieee754/k_standard.c
@@ -94,12 +94,8 @@ static double zero = 0.0; /* used as const */
*/
-#ifdef __STDC__
- double __kernel_standard(double x, double y, int type)
-#else
- double __kernel_standard(x,y,type)
- double x,y; int type;
-#endif
+double
+__kernel_standard(double x, double y, int type)
{
struct exception exc;
#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */
@@ -150,7 +146,7 @@ static double zero = 0.0; /* used as const */
__set_errno (EDOM);
else if (!matherr(&exc)) {
if(_LIB_VERSION == _SVID_) {
- (void) WRITE2("asin: DOMAIN error\n", 19);
+ (void) WRITE2("asin: DOMAIN error\n", 19);
}
__set_errno (EDOM);
}
@@ -361,14 +357,14 @@ static double zero = 0.0; /* used as const */
exc.type = OVERFLOW;
exc.name = type < 100 ? "lgamma" : (type < 200
? "lgammaf" : "lgammal");
- if (_LIB_VERSION == _SVID_)
- exc.retval = HUGE;
- else
- exc.retval = HUGE_VAL;
- if (_LIB_VERSION == _POSIX_)
+ if (_LIB_VERSION == _SVID_)
+ exc.retval = HUGE;
+ else
+ exc.retval = HUGE_VAL;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
__set_errno (ERANGE);
- else if (!matherr(&exc)) {
- __set_errno (ERANGE);
}
break;
case 15:
@@ -378,10 +374,10 @@ static double zero = 0.0; /* used as const */
exc.type = SING;
exc.name = type < 100 ? "lgamma" : (type < 200
? "lgammaf" : "lgammal");
- if (_LIB_VERSION == _SVID_)
- exc.retval = HUGE;
- else
- exc.retval = HUGE_VAL;
+ if (_LIB_VERSION == _SVID_)
+ exc.retval = HUGE;
+ else
+ exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
else if (!matherr(&exc)) {
@@ -611,95 +607,95 @@ static double zero = 0.0; /* used as const */
__set_errno (EDOM);
}
break;
- case 27:
+ case 27:
case 127:
case 227:
- /* fmod(x,0) */
- exc.type = DOMAIN;
- exc.name = type < 100 ? "fmod" : (type < 200
+ /* fmod(x,0) */
+ exc.type = DOMAIN;
+ exc.name = type < 100 ? "fmod" : (type < 200
? "fmodf" : "fmodl");
- if (_LIB_VERSION == _SVID_)
- exc.retval = x;
+ if (_LIB_VERSION == _SVID_)
+ exc.retval = x;
else
exc.retval = zero/zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2("fmod: DOMAIN error\n", 20);
- }
- __set_errno (EDOM);
- }
- break;
- case 28:
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (EDOM);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2("fmod: DOMAIN error\n", 20);
+ }
+ __set_errno (EDOM);
+ }
+ break;
+ case 28:
case 128:
case 228:
- /* remainder(x,0) */
- exc.type = DOMAIN;
- exc.name = type < 100 ? "remainder" : (type < 200
+ /* remainder(x,0) */
+ exc.type = DOMAIN;
+ exc.name = type < 100 ? "remainder" : (type < 200
? "remainderf"
: "remainderl");
- exc.retval = zero/zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2("remainder: DOMAIN error\n", 24);
- }
- __set_errno (EDOM);
- }
- break;
- case 29:
+ exc.retval = zero/zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (EDOM);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2("remainder: DOMAIN error\n", 24);
+ }
+ __set_errno (EDOM);
+ }
+ break;
+ case 29:
case 129:
case 229:
- /* acosh(x<1) */
- exc.type = DOMAIN;
- exc.name = type < 100 ? "acosh" : (type < 200
+ /* acosh(x<1) */
+ exc.type = DOMAIN;
+ exc.name = type < 100 ? "acosh" : (type < 200
? "acoshf" : "acoshl");
- exc.retval = zero/zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2("acosh: DOMAIN error\n", 20);
- }
- __set_errno (EDOM);
- }
- break;
- case 30:
+ exc.retval = zero/zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (EDOM);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2("acosh: DOMAIN error\n", 20);
+ }
+ __set_errno (EDOM);
+ }
+ break;
+ case 30:
case 130:
case 230:
- /* atanh(|x|>1) */
- exc.type = DOMAIN;
- exc.name = type < 100 ? "atanh" : (type < 200
+ /* atanh(|x|>1) */
+ exc.type = DOMAIN;
+ exc.name = type < 100 ? "atanh" : (type < 200
? "atanhf" : "atanhl");
- exc.retval = zero/zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (EDOM);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2("atanh: DOMAIN error\n", 20);
- }
- __set_errno (EDOM);
- }
- break;
- case 31:
+ exc.retval = zero/zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (EDOM);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2("atanh: DOMAIN error\n", 20);
+ }
+ __set_errno (EDOM);
+ }
+ break;
+ case 31:
case 131:
case 231:
- /* atanh(|x|=1) */
- exc.type = SING;
- exc.name = type < 100 ? "atanh" : (type < 200
+ /* atanh(|x|=1) */
+ exc.type = SING;
+ exc.name = type < 100 ? "atanh" : (type < 200
? "atanhf" : "atanhl");
exc.retval = x/zero; /* sign(x)*inf */
- if (_LIB_VERSION == _POSIX_)
- __set_errno (ERANGE);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2("atanh: SING error\n", 18);
- }
- __set_errno (EDOM);
- }
- break;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2("atanh: SING error\n", 18);
+ }
+ __set_errno (EDOM);
+ }
+ break;
case 32:
case 132:
case 232:
@@ -732,103 +728,103 @@ static double zero = 0.0; /* used as const */
case 134:
case 234:
/* j0(|x|>X_TLOSS) */
- exc.type = TLOSS;
- exc.name = type < 100 ? "j0" : (type < 200 ? "j0f" : "j0l");
- exc.retval = zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (ERANGE);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2(exc.name, 2);
- (void) WRITE2(": TLOSS error\n", 14);
- }
- __set_errno (ERANGE);
- }
+ exc.type = TLOSS;
+ exc.name = type < 100 ? "j0" : (type < 200 ? "j0f" : "j0l");
+ exc.retval = zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2(exc.name, 2);
+ (void) WRITE2(": TLOSS error\n", 14);
+ }
+ __set_errno (ERANGE);
+ }
break;
case 35:
case 135:
case 235:
/* y0(x>X_TLOSS) */
- exc.type = TLOSS;
- exc.name = type < 100 ? "y0" : (type < 200 ? "y0f" : "y0l");
- exc.retval = zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (ERANGE);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2(exc.name, 2);
- (void) WRITE2(": TLOSS error\n", 14);
- }
- __set_errno (ERANGE);
- }
+ exc.type = TLOSS;
+ exc.name = type < 100 ? "y0" : (type < 200 ? "y0f" : "y0l");
+ exc.retval = zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2(exc.name, 2);
+ (void) WRITE2(": TLOSS error\n", 14);
+ }
+ __set_errno (ERANGE);
+ }
break;
case 36:
case 136:
case 236:
/* j1(|x|>X_TLOSS) */
- exc.type = TLOSS;
- exc.name = type < 100 ? "j1" : (type < 200 ? "j1f" : "j1l");
- exc.retval = zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (ERANGE);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2(exc.name, 2);
- (void) WRITE2(": TLOSS error\n", 14);
- }
- __set_errno (ERANGE);
- }
+ exc.type = TLOSS;
+ exc.name = type < 100 ? "j1" : (type < 200 ? "j1f" : "j1l");
+ exc.retval = zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2(exc.name, 2);
+ (void) WRITE2(": TLOSS error\n", 14);
+ }
+ __set_errno (ERANGE);
+ }
break;
case 37:
case 137:
case 237:
/* y1(x>X_TLOSS) */
- exc.type = TLOSS;
- exc.name = type < 100 ? "y1" : (type < 200 ? "y1f" : "y1l");
- exc.retval = zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (ERANGE);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2(exc.name, 2);
- (void) WRITE2(": TLOSS error\n", 14);
- }
- __set_errno (ERANGE);
- }
+ exc.type = TLOSS;
+ exc.name = type < 100 ? "y1" : (type < 200 ? "y1f" : "y1l");
+ exc.retval = zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2(exc.name, 2);
+ (void) WRITE2(": TLOSS error\n", 14);
+ }
+ __set_errno (ERANGE);
+ }
break;
case 38:
case 138:
case 238:
/* jn(|x|>X_TLOSS) */
- exc.type = TLOSS;
- exc.name = type < 100 ? "jn" : (type < 200 ? "jnf" : "jnl");
- exc.retval = zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (ERANGE);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2(exc.name, 2);
- (void) WRITE2(": TLOSS error\n", 14);
- }
- __set_errno (ERANGE);
- }
+ exc.type = TLOSS;
+ exc.name = type < 100 ? "jn" : (type < 200 ? "jnf" : "jnl");
+ exc.retval = zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2(exc.name, 2);
+ (void) WRITE2(": TLOSS error\n", 14);
+ }
+ __set_errno (ERANGE);
+ }
break;
case 39:
case 139:
case 239:
/* yn(x>X_TLOSS) */
- exc.type = TLOSS;
- exc.name = type < 100 ? "yn" : (type < 200 ? "ynf" : "ynl");
- exc.retval = zero;
- if (_LIB_VERSION == _POSIX_)
- __set_errno (ERANGE);
- else if (!matherr(&exc)) {
- if (_LIB_VERSION == _SVID_) {
- (void) WRITE2(exc.name, 2);
- (void) WRITE2(": TLOSS error\n", 14);
- }
- __set_errno (ERANGE);
- }
+ exc.type = TLOSS;
+ exc.name = type < 100 ? "yn" : (type < 200 ? "ynf" : "ynl");
+ exc.retval = zero;
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_) {
+ (void) WRITE2(exc.name, 2);
+ (void) WRITE2(": TLOSS error\n", 14);
+ }
+ __set_errno (ERANGE);
+ }
break;
case 40:
case 140:
@@ -838,11 +834,11 @@ static double zero = 0.0; /* used as const */
exc.name = type < 100 ? "tgamma" : (type < 200
? "tgammaf" : "tgammal");
exc.retval = HUGE_VAL;
- if (_LIB_VERSION == _POSIX_)
+ if (_LIB_VERSION == _POSIX_)
__set_errno (ERANGE);
- else if (!matherr(&exc)) {
- __set_errno (ERANGE);
- }
+ else if (!matherr(&exc)) {
+ __set_errno (ERANGE);
+ }
break;
case 41:
case 141:
@@ -995,3 +991,10 @@ static double zero = 0.0; /* used as const */
}
return exc.retval;
}
+
+
+float
+__kernel_standard_f(float x, float y, int type)
+{
+ return __kernel_standard(x, y, type);
+}
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c b/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c
index 62170d4c2..2a74e9cd7 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c
@@ -30,20 +30,12 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0,
ln2 = 0.6931471805599453094172321214581766L;
-#ifdef __STDC__
- long double __ieee754_acoshl(long double x)
-#else
- long double __ieee754_acoshl(x)
- long double x;
-#endif
+long double
+__ieee754_acoshl(long double x)
{
long double t;
u_int64_t lx;
@@ -53,7 +45,7 @@ ln2 = 0.6931471805599453094172321214581766L;
return (x-x)/(x-x);
} else if(hx >=0x4035000000000000LL) { /* x > 2**54 */
if(hx >=0x7fff000000000000LL) { /* x is inf of NaN */
- return x+x;
+ return x+x;
} else
return __ieee754_logl(x)+ln2; /* acoshl(huge)=logl(2x) */
} else if(((hx-0x3fff000000000000LL)|lx)==0) {
@@ -66,3 +58,4 @@ ln2 = 0.6931471805599453094172321214581766L;
return __log1pl(t+__sqrtl(2.0L*t+t*t));
}
}
+strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_acosl.c b/libc/sysdeps/ieee754/ldbl-128/e_acosl.c
index 284e86a52..a7503695c 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_acosl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_acosl.c
@@ -12,9 +12,9 @@
/*
Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -57,11 +57,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
pio2_hi = 1.5707963267948966192313216916397514420986L,
pio2_lo = 4.3359050650618905123985220130216759843812E-35L,
@@ -152,14 +148,8 @@ static long double
qS8 = -4.175375777334867025769346564600396877176E1L;
/* 1.000000000000000000000000000000000000000E0 */
-#ifdef __STDC__
long double
__ieee754_acosl (long double x)
-#else
-long double
-__ieee754_acosl (x)
- long double x;
-#endif
{
long double z, r, w, p, q, s, t, f2;
int32_t ix, sign;
@@ -283,11 +273,11 @@ __ieee754_acosl (x)
s = __ieee754_sqrtl (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
- The change w from s to the improved value is
+ The change w from s to the improved value is
w = 0.5 * (s + z / s) - s = (s^2 + z)/2s - s = (z - s^2)/2s.
- Express s = f1 + f2 where f1 * f1 is exactly representable.
+ Express s = f1 + f2 where f1 * f1 is exactly representable.
w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s .
- s + w has extended precision. */
+ s + w has extended precision. */
u.value = s;
u.parts32.w2 = 0;
u.parts32.w3 = 0;
@@ -326,3 +316,4 @@ __ieee754_acosl (x)
return 2.0 * w;
}
}
+strong_alias (__ieee754_acosl, __acosl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_asinl.c b/libc/sysdeps/ieee754/ldbl-128/e_asinl.c
index 89f5d7958..e82b03f6a 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_asinl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_asinl.c
@@ -12,9 +12,9 @@
/*
Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
- reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under the
+ and are incorporated herein by permission of the author. The author
+ reserves the right to distribute this material elsewhere under different
+ copying permissions. These modifications are distributed here under the
following terms:
This library is free software; you can redistribute it and/or
@@ -263,3 +263,4 @@ __ieee754_asinl (x)
else
return -t;
}
+strong_alias (__ieee754_asinl, __asinl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_atan2l.c b/libc/sysdeps/ieee754/ldbl-128/e_atan2l.c
index 2bbb3b8f4..bba3c9bcf 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_atan2l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_atan2l.c
@@ -17,7 +17,7 @@
* Method :
* 1. Reduce y to positive by atan2l(y,x)=-atan2l(-y,x).
* 2. Reduce x to positive by (if x and y are unexceptional):
- * ARG (x+iy) = arctan(y/x) ... if x > 0,
+ * ARG (x+iy) = arctan(y/x) ... if x > 0,
* ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0,
*
* Special cases:
@@ -43,11 +43,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
tiny = 1.0e-4900L,
zero = 0.0,
pi_o_4 = 7.85398163397448309615660845819875699e-01L, /* 3ffe921fb54442d18469898cc51701b8 */
@@ -55,12 +51,8 @@ pi_o_2 = 1.57079632679489661923132169163975140e+00L, /* 3fff921fb54442d18469898
pi = 3.14159265358979323846264338327950280e+00L, /* 4000921fb54442d18469898cc51701b8 */
pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74020bbea64 */
-#ifdef __STDC__
- long double __ieee754_atan2l(long double y, long double x)
-#else
- long double __ieee754_atan2l(y,x)
- long double y,x;
-#endif
+long double
+__ieee754_atan2l(long double y, long double x)
{
long double z;
int64_t k,m,hx,hy,ix,iy;
@@ -80,7 +72,7 @@ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74
if((iy|ly)==0) {
switch(m) {
case 0:
- case 1: return y; /* atan(+-0,+anything)=+-0 */
+ case 1: return y; /* atan(+-0,+anything)=+-0 */
case 2: return pi+tiny;/* atan(+0,-anything) = pi */
case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
}
@@ -111,19 +103,20 @@ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74
/* compute y/x */
k = (iy-ix)>>48;
- if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */
- else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */
+ if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */
+ else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */
else z=__atanl(fabsl(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: {
- u_int64_t zh;
+ u_int64_t zh;
GET_LDOUBLE_MSW64(zh,z);
SET_LDOUBLE_MSW64(z,zh ^ 0x8000000000000000ULL);
}
return z ; /* atan(-,+) */
case 2: return pi-(z-pi_lo);/* atan(+,-) */
default: /* case 3 */
- return (z-pi_lo)-pi;/* atan(-,-) */
+ return (z-pi_lo)-pi;/* atan(-,-) */
}
}
+strong_alias (__ieee754_atan2l, __atan2l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c b/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c
index dd681c847..334c4bd70 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* __ieee754_atanhl(x)
* Method :
* 1.Reduced x to positive by atanh(-x) = -atanh(x)
@@ -26,7 +22,7 @@ static char rcsid[] = "$NetBSD: $";
* atanhl(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
* 2 1 - x 1 - x
*
- * For x<0.5
+ * For x<0.5
* atanhl(x) = 0.5*log1pl(2x+2x*x/(1-x))
*
* Special cases:
@@ -39,24 +35,12 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0L, huge = 1e4900L;
-#else
-static long double one = 1.0L, huge = 1e4900L;
-#endif
-#ifdef __STDC__
static const long double zero = 0.0L;
-#else
-static double long zero = 0.0L;
-#endif
-#ifdef __STDC__
- long double __ieee754_atanhl(long double x)
-#else
- long double __ieee754_atanhl(x)
- long double x;
-#endif
+long double
+__ieee754_atanhl(long double x)
{
long double t;
u_int32_t jx, ix;
@@ -82,3 +66,4 @@ static double long zero = 0.0L;
t = 0.5*__log1pl((u.value+u.value)/(one-u.value));
if(jx & 0x80000000) return -t; else return t;
}
+strong_alias (__ieee754_atanhl, __atanhl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_coshl.c b/libc/sysdeps/ieee754/ldbl-128/e_coshl.c
index 3913e3479..dfe8d47f9 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_coshl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_coshl.c
@@ -11,9 +11,9 @@
/* Changes for 128-bit long double are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -54,22 +54,11 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, half = 0.5, huge = 1.0e4900L,
ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
-#else
-static long double one = 1.0, half = 0.5, huge = 1.0e4900L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
-#endif
-#ifdef __STDC__
long double
__ieee754_coshl (long double x)
-#else
-long double
-__ieee754_coshl (x)
- long double x;
-#endif
{
long double t, w;
int32_t ex;
@@ -118,3 +107,4 @@ __ieee754_coshl (x)
/* |x| > overflowthresold, cosh(x) overflow */
return huge * huge;
}
+strong_alias (__ieee754_coshl, __coshl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_expl.c b/libc/sysdeps/ieee754/ldbl-128/e_expl.c
index 31ff16f8c..0279e777e 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_expl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_expl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point e^x.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
Partly based on double-precision code
@@ -73,7 +73,7 @@ static const long double C[] = {
/* Smallest integer x for which e^x overflows. */
#define himark C[0]
11356.523406294143949491931077970765L,
-
+
/* Largest integer x for which e^x underflows. */
#define lomark C[1]
-11433.4627433362978788372438434526231L,
@@ -247,3 +247,4 @@ __ieee754_expl (long double x)
/* Return x, if x is a NaN or Inf; or overflow, otherwise. */
return TWO16383*x;
}
+strong_alias (__ieee754_expl, __expl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c b/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c
index 1043f69cb..05665a9c8 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c
@@ -3,16 +3,16 @@
*/
/*
* ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ * Copyright (C) 1993, 2011 by Sun Microsystems, Inc. All rights reserved.
*
* 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.
* ====================================================
*/
-/*
+/*
* __ieee754_fmodl(x,y)
* Return x mod y in exact arithmetic
* Method: shift and subtract
@@ -21,18 +21,10 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, Zero[] = {0.0, -0.0,};
-#else
-static long double one = 1.0, Zero[] = {0.0, -0.0,};
-#endif
-#ifdef __STDC__
- long double __ieee754_fmodl(long double x, long double y)
-#else
- long double __ieee754_fmodl(x,y)
- long double x,y;
-#endif
+long double
+__ieee754_fmodl (long double x, long double y)
{
int64_t n,hx,hy,hz,ix,iy,sx,i;
u_int64_t lx,ly,lz;
@@ -49,7 +41,7 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
return (x*y)/(x*y);
if(hx<=hy) {
if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
- if(lx==ly)
+ if(lx==ly)
return Zero[(u_int64_t)sx>>63]; /* |x|=|y| return x*0*/
}
@@ -72,25 +64,25 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
} else iy = (hy>>48)-0x3fff;
/* set up {hx,lx}, {hy,ly} and align y to x */
- if(ix >= -16382)
+ if(ix >= -16382)
hx = 0x0001000000000000LL|(0x0000ffffffffffffLL&hx);
else { /* subnormal x, shift x to normal */
n = -16382-ix;
if(n<=63) {
- hx = (hx<<n)|(lx>>(64-n));
- lx <<= n;
+ hx = (hx<<n)|(lx>>(64-n));
+ lx <<= n;
} else {
hx = lx<<(n-64);
lx = 0;
}
}
- if(iy >= -16382)
+ if(iy >= -16382)
hy = 0x0001000000000000LL|(0x0000ffffffffffffLL&hy);
else { /* subnormal y, shift y to normal */
n = -16382-iy;
if(n<=63) {
- hy = (hy<<n)|(ly>>(64-n));
- ly <<= n;
+ hy = (hy<<n)|(ly>>(64-n));
+ ly <<= n;
} else {
hy = ly<<(n-64);
ly = 0;
@@ -103,17 +95,17 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else {
- if((hz|lz)==0) /* return sign(x)*0 */
+ if((hz|lz)==0) /* return sign(x)*0 */
return Zero[(u_int64_t)sx>>63];
- hx = hz+hz+(lz>>63); lx = lz+lz;
+ hx = hz+hz+(lz>>63); lx = lz+lz;
}
}
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz>=0) {hx=hz;lx=lz;}
/* convert back to floating value and restore the sign */
- if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ if((hx|lx)==0) /* return sign(x)*0 */
+ return Zero[(u_int64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx;
iy -= 1;
@@ -136,3 +128,4 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
}
return x; /* exact output */
}
+strong_alias (__ieee754_fmodl, __fmodl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c
index 36f5d4588..2dbe6acff 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c
@@ -1,8 +1,8 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997, 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2002, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
- Jakub Jelinek <jj@ultra.linux.cz, 1999.
+ Jakub Jelinek <jj@ultra.linux.cz, 1999.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -56,3 +56,4 @@ __ieee754_gammal_r (long double x, int *signgamp)
/* XXX FIXME. */
return __ieee754_expl (__ieee754_lgammal_r (x, signgamp));
}
+strong_alias (__ieee754_gammal_r, __gammal_r_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c b/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c
index 6834eac59..dad78fef1 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c
@@ -13,10 +13,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
-#endif
-
/* __ieee754_hypotl(x,y)
*
* Method :
@@ -45,19 +41,15 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
* hypotl(x,y) is NAN if x or y is NAN.
*
* Accuracy:
- * hypotl(x,y) returns sqrtl(x^2+y^2) with error less
- * than 1 ulps (units in the last place)
+ * hypotl(x,y) returns sqrtl(x^2+y^2) with error less
+ * than 1 ulps (units in the last place)
*/
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
- long double __ieee754_hypotl(long double x, long double y)
-#else
- long double __ieee754_hypotl(x,y)
- long double x, y;
-#endif
+long double
+__ieee754_hypotl(long double x, long double y)
{
long double a,b,t1,t2,y1,y2,w;
int64_t j,k,ha,hb;
@@ -89,7 +81,7 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
}
if(hb < 0x20bf000000000000LL) { /* b < 2**-8000 */
if(hb <= 0x0000ffffffffffffLL) { /* subnormal b or 0 */
- u_int64_t low;
+ u_int64_t low;
GET_LDOUBLE_LSW64(low,b);
if((hb|low)==0) return a;
t1=0;
@@ -98,7 +90,7 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
a *= t1;
k -= 16382;
} else { /* scale a and b by 2^9600 */
- ha += 0x2580000000000000LL; /* a *= 2^9600 */
+ ha += 0x2580000000000000LL; /* a *= 2^9600 */
hb += 0x2580000000000000LL; /* b *= 2^9600 */
k -= 9600;
SET_LDOUBLE_MSW64(a,ha);
@@ -130,3 +122,4 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
return t1*w;
} else return w;
}
+strong_alias (__ieee754_hypotl, __hypotl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c
index bcd57e2b0..ef718b9d7 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -779,6 +779,7 @@ __ieee754_j0l (long double x)
z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
return z;
}
+strong_alias (__ieee754_j0l, __j0l_finite)
/* Y0(x) = 2/pi * log(x) * J0(x) + R(x^2)
@@ -918,3 +919,4 @@ long double
z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (x);
return z;
}
+strong_alias (__ieee754_y0l, __y0l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_j1l.c b/libc/sysdeps/ieee754/ldbl-128/e_j1l.c
index 7b73e2e79..8d92b4f08 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -786,6 +786,7 @@ __ieee754_j1l (long double x)
z = -z;
return z;
}
+strong_alias (__ieee754_j1l, __j1l_finite)
/* Y1(x) = 2/pi * (log(x) * J1(x) - 1/x) + x R(x^2)
@@ -925,3 +926,4 @@ __ieee754_y1l (long double x)
z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (xx);
return z;
}
+strong_alias (__ieee754_y1l, __y1l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
index a4a4e24cf..81591634b 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c
@@ -11,9 +11,9 @@
/* Modifications for 128-bit long double are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -59,26 +59,15 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
two = 2.0e0L,
one = 1.0e0L,
zero = 0.0L;
-#ifdef __STDC__
long double
__ieee754_jnl (int n, long double x)
-#else
-long double
-__ieee754_jnl (n, x)
- int n;
- long double x;
-#endif
{
u_int32_t se;
int32_t i, ix, sgn;
@@ -285,7 +274,16 @@ __ieee754_jnl (n, x)
}
}
}
- b = (t * __ieee754_j0l (x) / b);
+ /* j0() and j1() suffer enormous loss of precision at and
+ * near zero; however, we know that their zero points never
+ * coincide, so just choose the one further away from zero.
+ */
+ z = __ieee754_j0l (x);
+ w = __ieee754_j1l (x);
+ if (fabsl (z) >= fabsl (w))
+ b = (t * z / b);
+ else
+ b = (t * w / a);
}
}
if (sgn == 1)
@@ -293,16 +291,10 @@ __ieee754_jnl (n, x)
else
return b;
}
+strong_alias (__ieee754_jnl, __jnl_finite)
-#ifdef __STDC__
long double
__ieee754_ynl (int n, long double x)
-#else
-long double
-__ieee754_ynl (n, x)
- int n;
- long double x;
-#endif
{
u_int32_t se;
int32_t i, ix;
@@ -398,3 +390,4 @@ __ieee754_ynl (n, x)
else
return -b;
}
+strong_alias (__ieee754_ynl, __ynl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index d08044847..2482296ac 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -754,15 +754,8 @@ deval (long double x, const long double *p, int n)
}
-#ifdef __STDC__
long double
__ieee754_lgammal_r (long double x, int *signgamp)
-#else
-long double
-__ieee754_lgammal_r (x, signgamp)
- long double x;
- int *signgamp;
-#endif
{
long double p, q, w, z, nx;
int i, nn;
@@ -775,7 +768,7 @@ __ieee754_lgammal_r (x, signgamp)
if (x == 0.0L)
{
if (__signbitl (x))
- *signgamp = -1;
+ *signgamp = -1;
}
if (x < 0.0L)
@@ -863,7 +856,7 @@ __ieee754_lgammal_r (x, signgamp)
{
z = x - 0.75L;
p = z * neval (z, RN1r75, NRN1r75)
- / deval (z, RD1r75, NRD1r75);
+ / deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
p += lgam1r75a;
}
@@ -1040,3 +1033,4 @@ __ieee754_lgammal_r (x, signgamp)
q += neval (p, RASY, NRASY) / x;
return (q);
}
+strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_log10l.c b/libc/sysdeps/ieee754/ldbl-128/e_log10l.c
index 1213177a8..6e69bbd7b 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_log10l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_log10l.c
@@ -58,7 +58,7 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -179,8 +179,7 @@ deval (long double x, const long double *p, int n)
long double
-__ieee754_log10l (x)
- long double x;
+__ieee754_log10l (long double x)
{
long double z;
long double y;
@@ -256,3 +255,4 @@ done:
z += e * L102A;
return (z);
}
+strong_alias (__ieee754_log10l, __log10l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_log2l.c b/libc/sysdeps/ieee754/ldbl-128/e_log2l.c
index 8663d78b3..9a02394ee 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_log2l.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_log2l.c
@@ -57,7 +57,7 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "math.h"
@@ -248,3 +248,4 @@ done:
z += e;
return (z);
}
+strong_alias (__ieee754_log2l, __log2l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_logl.c b/libc/sysdeps/ieee754/ldbl-128/e_logl.c
index b9e17f8f9..6d532874c 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_logl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_logl.c
@@ -42,7 +42,7 @@
*
*/
-/* Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
+/* Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -251,7 +251,7 @@ __ieee754_logl(long double x)
/* log(u) = log( t u/t ) = log(t) + log(u/t)
log(t) is tabulated in the lookup table.
Express log(u/t) = log(1+z), where z = u/t - 1 = (u-t)/t.
- cf. Cody & Waite. */
+ cf. Cody & Waite. */
z = (u.value - t.value) / t.value;
}
/* Series expansion of log(1+z). */
@@ -277,3 +277,4 @@ __ieee754_logl(long double x)
y += e * ln2a;
return y;
}
+strong_alias (__ieee754_logl, __logl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_powl.c b/libc/sysdeps/ieee754/ldbl-128/e_powl.c
index ba7e27b7d..d8e1af03c 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_powl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_powl.c
@@ -11,9 +11,9 @@
/* Expansions and modifications for 128-bit long double are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -144,14 +144,8 @@ static const long double
cp_h = 9.6179669392597555432899980587535537779331E-1L,
cp_l = 5.0577616648125906047157785230014751039424E-17L;
-#ifdef __STDC__
long double
__ieee754_powl (long double x, long double y)
-#else
-long double
-__ieee754_powl (x, y)
- long double x, y;
-#endif
{
long double z, ax, z_h, z_l, p_h, p_l;
long double y1, t1, t2, r, s, t, u, v, w;
@@ -445,3 +439,4 @@ __ieee754_powl (x, y)
}
return s * z;
}
+strong_alias (__ieee754_powl, __powl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c b/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c
index 81af247b3..84233808e 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c
@@ -7,36 +7,28 @@
*
* 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.
* ====================================================
*/
/* __ieee754_remainderl(x,p)
- * Return :
- * returns x REM p = x - [x/p]*p as if in infinite
- * precise arithmetic, where [x/p] is the (infinite bit)
+ * Return :
+ * returns x REM p = x - [x/p]*p as if in infinite
+ * precise arithmetic, where [x/p] is the (infinite bit)
* integer nearest x/p (in half way case choose the even one).
- * Method :
+ * Method :
* Based on fmodl() return x-[x/p]chopped*p exactlp.
*/
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double zero = 0.0L;
-#else
-static long double zero = 0.0L;
-#endif
-#ifdef __STDC__
- long double __ieee754_remainderl(long double x, long double p)
-#else
- long double __ieee754_remainderl(x,p)
- long double x,p;
-#endif
+long double
+__ieee754_remainderl(long double x, long double p)
{
int64_t hx,hp;
u_int64_t sx,lx,lp;
@@ -49,7 +41,7 @@ static long double zero = 0.0L;
hx &= 0x7fffffffffffffffLL;
/* purge off exception values */
- if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */
+ if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */
if((hx>=0x7fff000000000000LL)|| /* x not finite */
((hp>=0x7fff000000000000LL)&& /* p is NaN */
(((hp-0x7fff000000000000LL)|lp)!=0)))
@@ -76,3 +68,4 @@ static long double zero = 0.0L;
SET_LDOUBLE_MSW64(x,hx^sx);
return x;
}
+strong_alias (__ieee754_remainderl, __remainderl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c b/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c
index 93f4179c6..ac36cac5c 100644
--- a/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c
@@ -16,9 +16,9 @@
/* Changes for 128-bit long double are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -56,22 +56,11 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, shuge = 1.0e4931L,
ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
-#else
-static long double one = 1.0, shuge = 1.0e4931L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
-#endif
-#ifdef __STDC__
long double
__ieee754_sinhl (long double x)
-#else
-long double
-__ieee754_sinhl (x)
- long double x;
-#endif
{
long double t, w, h;
u_int32_t jx, ix;
@@ -121,3 +110,4 @@ __ieee754_sinhl (x)
/* |x| > overflowthreshold, sinhl(x) overflow */
return x * shuge;
}
+strong_alias (__ieee754_sinhl, __sinhl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c b/libc/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c
new file mode 100644
index 000000000..1ebc1accb
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c
@@ -0,0 +1,19 @@
+/*
+ * Written by Ulrich Drepper <drepper@gmail.com>
+ */
+
+/*
+ * __isinf_nsl(x) returns != 0 if x is ±inf, else 0;
+ * no branching!
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+int
+__isinf_nsl (long double x)
+{
+ int64_t hx,lx;
+ GET_LDOUBLE_WORDS64(hx,lx,x);
+ return !(lx | ((hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL));
+}
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
index 00576c76c..20d94eaa1 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_acosh.c,v 1.9 1995/05/12 04:57:18 jtc Exp $";
-#endif
-
/* __ieee754_acosh(x)
* Method :
* Based on
@@ -31,20 +27,12 @@ static char rcsid[] = "$NetBSD: e_acosh.c,v 1.9 1995/05/12 04:57:18 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0L,
ln2 = 6.93147180559945286227e-01L; /* 0x3FE62E42, 0xFEFA39EF */
-#ifdef __STDC__
- long double __ieee754_acoshl(long double x)
-#else
- long double __ieee754_acoshl(x)
- long double x;
-#endif
+long double
+__ieee754_acoshl(long double x)
{
long double t;
int64_t hx;
@@ -54,7 +42,7 @@ ln2 = 6.93147180559945286227e-01L; /* 0x3FE62E42, 0xFEFA39EF */
return (x-x)/(x-x);
} else if(hx >=0x41b0000000000000LL) { /* x > 2**28 */
if(hx >=0x7ff0000000000000LL) { /* x is inf of NaN */
- return x+x;
+ return x+x;
} else
return __ieee754_logl(x)+ln2; /* acosh(huge)=log(2x) */
} else if (((hx-0x3ff0000000000000LL)|(lx&0x7fffffffffffffffLL))==0) {
@@ -67,3 +55,4 @@ ln2 = 6.93147180559945286227e-01L; /* 0x3FE62E42, 0xFEFA39EF */
return __log1p(t+__sqrtl(2.0*t+t*t));
}
}
+strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
index 8823fd69b..1b37c9220 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
@@ -283,11 +283,11 @@ __ieee754_acosl (x)
s = __ieee754_sqrtl (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
- The change w from s to the improved value is
+ The change w from s to the improved value is
w = 0.5 * (s + z / s) - s = (s^2 + z)/2s - s = (z - s^2)/2s.
- Express s = f1 + f2 where f1 * f1 is exactly representable.
+ Express s = f1 + f2 where f1 * f1 is exactly representable.
w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s .
- s + w has extended precision. */
+ s + w has extended precision. */
u.value = s;
u.parts32.w2 = 0;
u.parts32.w3 = 0;
@@ -326,3 +326,4 @@ __ieee754_acosl (x)
return 2.0 * w;
}
}
+strong_alias (__ieee754_acosl, __acosl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
index 3696694f7..6c61232c0 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
@@ -12,9 +12,9 @@
/*
Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
- reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under the
+ and are incorporated herein by permission of the author. The author
+ reserves the right to distribute this material elsewhere under different
+ copying permissions. These modifications are distributed here under the
following terms:
This library is free software; you can redistribute it and/or
@@ -263,3 +263,4 @@ __ieee754_asinl (x)
else
return -t;
}
+strong_alias (__ieee754_asinl, __asinl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c
index a4bb53df0..a5b662100 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c
@@ -17,7 +17,7 @@
* Method :
* 1. Reduce y to positive by atan2l(y,x)=-atan2l(-y,x).
* 2. Reduce x to positive by (if x and y are unexceptional):
- * ARG (x+iy) = arctan(y/x) ... if x > 0,
+ * ARG (x+iy) = arctan(y/x) ... if x > 0,
* ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0,
*
* Special cases:
@@ -43,11 +43,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
tiny = 1.0e-300L,
zero = 0.0,
pi_o_4 = 7.85398163397448309615660845819875699e-01L, /* 3ffe921fb54442d18469898cc51701b8 */
@@ -55,12 +51,8 @@ pi_o_2 = 1.57079632679489661923132169163975140e+00L, /* 3fff921fb54442d18469898
pi = 3.14159265358979323846264338327950280e+00L, /* 4000921fb54442d18469898cc51701b8 */
pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74020bbea64 */
-#ifdef __STDC__
- long double __ieee754_atan2l(long double y, long double x)
-#else
- long double __ieee754_atan2l(y,x)
- long double y,x;
-#endif
+long double
+__ieee754_atan2l(long double y, long double x)
{
long double z;
int64_t k,m,hx,hy,ix,iy;
@@ -80,7 +72,7 @@ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74
if((iy|(ly&0x7fffffffffffffffLL))==0) {
switch(m) {
case 0:
- case 1: return y; /* atan(+-0,+anything)=+-0 */
+ case 1: return y; /* atan(+-0,+anything)=+-0 */
case 2: return pi+tiny;/* atan(+0,-anything) = pi */
case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
}
@@ -111,14 +103,15 @@ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74
/* compute y/x */
k = (iy-ix)>>52;
- if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */
- else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */
+ if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */
+ else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */
else z=__atanl(fabsl(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: return -z ; /* atan(-,+) */
case 2: return pi-(z-pi_lo);/* atan(+,-) */
default: /* case 3 */
- return (z-pi_lo)-pi;/* atan(-,-) */
+ return (z-pi_lo)-pi;/* atan(-,-) */
}
}
+strong_alias (__ieee754_atan2l, __atan2l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
index a801bd6f7..c879e4518 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $";
-#endif
-
/* __ieee754_atanh(x)
* Method :
* 1.Reduced x to positive by atanh(-x) = -atanh(x)
@@ -22,7 +18,7 @@ static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $";
* atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
* 2 1 - x 1 - x
*
- * For x<0.5
+ * For x<0.5
* atanh(x) = 0.5*log1p(2x+2x*x/(1-x))
*
* Special cases:
@@ -35,24 +31,12 @@ static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0L, huge = 1e300L;
-#else
-static long double one = 1.0L, huge = 1e300L;
-#endif
-#ifdef __STDC__
static const long double zero = 0.0L;
-#else
-static long double zero = 0.0L;
-#endif
-#ifdef __STDC__
- long double __ieee754_atanhl(long double x)
-#else
- long double __ieee754_atanhl(x)
- long double x;
-#endif
+long double
+__ieee754_atanhl(long double x)
{
long double t;
int64_t hx,ix;
@@ -61,7 +45,7 @@ static long double zero = 0.0L;
ix = hx&0x7fffffffffffffffLL;
if (ix >= 0x3ff0000000000000LL) { /* |x|>=1 */
if (ix > 0x3ff0000000000000LL)
- return (x-x)/(x-x);
+ return (x-x)/(x-x);
t = fabsl (x);
if (t > one)
return (x-x)/(x-x);
@@ -77,3 +61,4 @@ static long double zero = 0.0L;
t = 0.5*__log1pl((x+x)/(one-x));
if(hx>=0) return t; else return -t;
}
+strong_alias (__ieee754_atanhl, __atanhl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
index 73cb47892..ebc943639 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
@@ -10,22 +10,18 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $";
-#endif
-
/* __ieee754_cosh(x)
* Method :
* mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2
* 1. Replace x by |x| (cosh(x) = cosh(-x)).
* 2.
- * [ exp(x) - 1 ]^2
+ * [ exp(x) - 1 ]^2
* 0 <= x <= ln2/2 : cosh(x) := 1 + -------------------
- * 2*exp(x)
+ * 2*exp(x)
*
- * exp(x) + 1/exp(x)
+ * exp(x) + 1/exp(x)
* ln2/2 <= x <= 22 : cosh(x) := -------------------
- * 2
+ * 2
* 22 <= x <= lnovft : cosh(x) := exp(x)/2
* lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2)
* ln2ovft < x : cosh(x) := huge*huge (overflow)
@@ -38,18 +34,10 @@ static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0L, half=0.5L, huge = 1.0e300L;
-#else
-static long double one = 1.0L, half=0.5L, huge = 1.0e300L;
-#endif
-#ifdef __STDC__
- long double __ieee754_coshl(long double x)
-#else
- long double __ieee754_coshl(x)
- long double x;
-#endif
+long double
+__ieee754_coshl (long double x)
{
long double t,w;
int64_t ix;
@@ -79,7 +67,7 @@ static long double one = 1.0L, half=0.5L, huge = 1.0e300L;
if (ix < 0x40862e42fefa39efLL) return half*__ieee754_expl(fabsl(x));
/* |x| in [log(maxdouble), overflowthresold] */
- if (ix < 0x408633ce8fb9f87dLL) {
+ if (ix < 0x408633ce8fb9f87dLL) {
w = __ieee754_expl(half*fabsl(x));
t = half*w;
return t*w;
@@ -88,3 +76,4 @@ static long double one = 1.0L, half=0.5L, huge = 1.0e300L;
/* |x| > overflowthresold, cosh(x) overflow */
return huge*huge;
}
+strong_alias (__ieee754_coshl, __coshl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index daf2cba32..9e03eae23 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point e^x.
- Copyright (C) 1999,2004,2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1999,2004,2006, 2008, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
Partly based on double-precision code
@@ -255,3 +255,4 @@ __ieee754_expl (long double x)
/* Return x, if x is a NaN or Inf; or overflow, otherwise. */
return TWO1023*x;
}
+strong_alias (__ieee754_expl, __expl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
index e99b0bac3..4ad59a091 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
@@ -22,18 +22,10 @@
#include "math_private.h"
#include <ieee754.h>
-#ifdef __STDC__
static const long double one = 1.0, Zero[] = {0.0, -0.0,};
-#else
-static long double one = 1.0, Zero[] = {0.0, -0.0,};
-#endif
-#ifdef __STDC__
- long double __ieee754_fmodl(long double x, long double y)
-#else
- long double __ieee754_fmodl(x,y)
- long double x,y;
-#endif
+long double
+__ieee754_fmodl (long double x, long double y)
{
int64_t n,hx,hy,hz,ix,iy,sx,i;
u_int64_t lx,ly,lz;
@@ -76,8 +68,8 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
/* Make the IBM extended format 105 bit mantissa look like the ieee854 112
bit mantissa so the following operatations will give the correct
result. */
- ldbl_extract_mantissa(&hx, &lx, &temp, x);
- ldbl_extract_mantissa(&hy, &ly, &temp, y);
+ ldbl_extract_mantissa(&hx, &lx, &temp, x);
+ ldbl_extract_mantissa(&hy, &ly, &temp, y);
/* set up {hx,lx}, {hy,ly} and align y to x */
if(ix >= -1022)
@@ -85,8 +77,8 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
else { /* subnormal x, shift x to normal */
n = -1022-ix;
if(n<=63) {
- hx = (hx<<n)|(lx>>(64-n));
- lx <<= n;
+ hx = (hx<<n)|(lx>>(64-n));
+ lx <<= n;
} else {
hx = lx<<(n-64);
lx = 0;
@@ -97,8 +89,8 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
else { /* subnormal y, shift y to normal */
n = -1022-iy;
if(n<=63) {
- hy = (hy<<n)|(ly>>(64-n));
- ly <<= n;
+ hy = (hy<<n)|(ly>>(64-n));
+ ly <<= n;
} else {
hy = ly<<(n-64);
ly = 0;
@@ -111,16 +103,16 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else {
- if((hz|(lz&0x7fffffffffffffff))==0) /* return sign(x)*0 */
+ if((hz|(lz&0x7fffffffffffffff))==0) /* return sign(x)*0 */
return Zero[(u_int64_t)sx>>63];
- hx = hz+hz+(lz>>63); lx = lz+lz;
+ hx = hz+hz+(lz>>63); lx = lz+lz;
}
}
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz>=0) {hx=hz;lx=lz;}
/* convert back to floating value and restore the sign */
- if((hx|(lx&0x7fffffffffffffff))==0) /* return sign(x)*0 */
+ if((hx|(lx&0x7fffffffffffffff))==0) /* return sign(x)*0 */
return Zero[(u_int64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx;
@@ -143,3 +135,4 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,};
}
return x; /* exact output */
}
+strong_alias (__ieee754_fmodl, __fmodl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
index 03bcb2129..f20ea9e05 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
@@ -1,8 +1,8 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997,1999,2002,2004,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999,2002,2004,2006,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
- Jakub Jelinek <jj@ultra.linux.cz, 1999.
+ Jakub Jelinek <jj@ultra.linux.cz, 1999.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -56,3 +56,4 @@ __ieee754_gammal_r (long double x, int *signgamp)
/* XXX FIXME. */
return __ieee754_expl (__ieee754_lgammal_r (x, signgamp));
}
+strong_alias (__ieee754_gammal_r, __gammal_r_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
index 4330f28b9..4ef076741 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
@@ -10,10 +10,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
-#endif
-
/* __ieee754_hypotl(x,y)
*
* Method :
@@ -42,8 +38,8 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
* hypotl(x,y) is NAN if x or y is NAN.
*
* Accuracy:
- * hypotl(x,y) returns sqrtl(x^2+y^2) with error less
- * than 1 ulps (units in the last place)
+ * hypotl(x,y) returns sqrtl(x^2+y^2) with error less
+ * than 1 ulps (units in the last place)
*/
#include "math.h"
@@ -52,12 +48,8 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $";
static const long double two600 = 0x1.0p+600L;
static const long double two1022 = 0x1.0p+1022L;
-#ifdef __STDC__
- long double __ieee754_hypotl(long double x, long double y)
-#else
- long double __ieee754_hypotl(x,y)
- long double x, y;
-#endif
+long double
+__ieee754_hypotl(long double x, long double y)
{
long double a,b,t1,t2,y1,y2,w,kld;
int64_t j,k,ha,hb;
@@ -93,7 +85,7 @@ static const long double two1022 = 0x1.0p+1022L;
}
if(hb < 0x20b0000000000000LL) { /* b < 2**-500 */
if(hb <= 0x000fffffffffffffLL) { /* subnormal b or 0 */
- u_int64_t low;
+ u_int64_t low;
GET_LDOUBLE_LSW64(low,b);
if((hb|(low&0x7fffffffffffffffLL))==0) return a;
t1=two1022; /* t1=2^1022 */
@@ -102,7 +94,7 @@ static const long double two1022 = 0x1.0p+1022L;
k -= 1022;
kld = kld / two1022;
} else { /* scale a and b by 2^600 */
- ha += 0x2580000000000000LL; /* a *= 2^600 */
+ ha += 0x2580000000000000LL; /* a *= 2^600 */
hb += 0x2580000000000000LL; /* b *= 2^600 */
k -= 600;
a *= two600;
@@ -129,3 +121,4 @@ static const long double two1022 = 0x1.0p+1022L;
else
return w;
}
+strong_alias (__ieee754_hypotl, __hypotl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
index 0eea74567..2114753f8 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
@@ -286,7 +286,16 @@ __ieee754_jnl (n, x)
}
}
}
- b = (t * __ieee754_j0l (x) / b);
+ /* j0() and j1() suffer enormous loss of precision at and
+ * near zero; however, we know that their zero points never
+ * coincide, so just choose the one further away from zero.
+ */
+ z = __ieee754_j0l (x);
+ w = __ieee754_j1l (x);
+ if (fabsl (z) >= fabsl (w))
+ b = (t * z / b);
+ else
+ b = (t * w / a);
}
}
if (sgn == 1)
@@ -294,6 +303,7 @@ __ieee754_jnl (n, x)
else
return b;
}
+strong_alias (__ieee754_jnl, __jnl_finite)
#ifdef __STDC__
long double
@@ -400,3 +410,4 @@ __ieee754_ynl (n, x)
else
return -b;
}
+strong_alias (__ieee754_ynl, __ynl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_log10l.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
index 27e2c71b8..de57be39d 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
@@ -179,8 +179,7 @@ deval (long double x, const long double *p, int n)
long double
-__ieee754_log10l (x)
- long double x;
+__ieee754_log10l (long double x)
{
long double z;
long double y;
@@ -256,3 +255,4 @@ done:
z += e * L102A;
return (z);
}
+strong_alias (__ieee754_log10l, __log10l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_log2l.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
index fe8a8e1d6..9737e13f0 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
@@ -248,3 +248,4 @@ done:
z += e;
return (z);
}
+strong_alias (__ieee754_log2l, __log2l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_logl.c
index aa5fc3740..683260806 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_logl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_logl.c
@@ -253,7 +253,7 @@ __ieee754_logl(long double x)
/* log(u) = log( t u/t ) = log(t) + log(u/t)
log(t) is tabulated in the lookup table.
Express log(u/t) = log(1+z), where z = u/t - 1 = (u-t)/t.
- cf. Cody & Waite. */
+ cf. Cody & Waite. */
z = (u.value - t.value) / t.value;
}
/* Series expansion of log(1+z). */
@@ -279,3 +279,4 @@ __ieee754_logl(long double x)
y += e * ln2a;
return y;
}
+strong_alias (__ieee754_logl, __logl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c
index feeaa8ce2..9b1f2be1d 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_powl.c
@@ -144,14 +144,8 @@ static const long double
cp_h = 9.6179669392597555432899980587535537779331E-1L,
cp_l = 5.0577616648125906047157785230014751039424E-17L;
-#ifdef __STDC__
long double
__ieee754_powl (long double x, long double y)
-#else
-long double
-__ieee754_powl (x, y)
- long double x, y;
-#endif
{
long double z, ax, z_h, z_l, p_h, p_l;
long double y1, t1, t2, r, s, t, u, v, w;
@@ -390,7 +384,7 @@ __ieee754_powl (x, y)
{
/* if z > 16384 */
if (((j - 0x40d00000) | o.parts32.w1
- | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0)
+ | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0)
return s * huge * huge; /* overflow */
else
{
@@ -402,7 +396,7 @@ __ieee754_powl (x, y)
{
/* z < -16495 */
if (((j - 0xc0d01bc0) | o.parts32.w1
- | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0)
+ | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0)
return s * tiny * tiny; /* underflow */
else
{
@@ -439,3 +433,4 @@ __ieee754_powl (x, y)
z = __scalbnl (z, n);
return s * z;
}
+strong_alias (__ieee754_powl, __powl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
index b7fa68f32..d4a847dbe 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
@@ -14,8 +14,8 @@
/* __ieee754_remainderl(x,p)
* Return :
- * returns x REM p = x - [x/p]*p as if in infinite
- * precise arithmetic, where [x/p] is the (infinite bit)
+ * returns x REM p = x - [x/p]*p as if in infinite
+ * precise arithmetic, where [x/p] is the (infinite bit)
* integer nearest x/p (in half way case choose the even one).
* Method :
* Based on fmodl() return x-[x/p]chopped*p exactlp.
@@ -24,19 +24,11 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double zero = 0.0L;
-#else
-static long double zero = 0.0L;
-#endif
-#ifdef __STDC__
- long double __ieee754_remainderl(long double x, long double p)
-#else
- long double __ieee754_remainderl(x,p)
- long double x,p;
-#endif
+long double
+__ieee754_remainderl(long double x, long double p)
{
int64_t hx,hp;
u_int64_t sx,lx,lp;
@@ -49,7 +41,7 @@ static long double zero = 0.0L;
hx &= 0x7fffffffffffffffLL;
/* purge off exception values */
- if((hp|(lp&0x7fffffffffffffff))==0) return (x*p)/(x*p); /* p = 0 */
+ if((hp|(lp&0x7fffffffffffffff))==0) return (x*p)/(x*p); /* p = 0 */
if((hx>=0x7ff0000000000000LL)|| /* x not finite */
((hp>=0x7ff0000000000000LL)&& /* p is NaN */
(((hp-0x7ff0000000000000LL)|lp)!=0)))
@@ -76,3 +68,4 @@ static long double zero = 0.0L;
SET_LDOUBLE_MSW64(x,hx^sx);
return x;
}
+strong_alias (__ieee754_remainderl, __remainderl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
index 38ae71d4b..b8e86b1a6 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
@@ -10,18 +10,14 @@
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
-#endif
-
/* __ieee754_sinh(x)
* Method :
* mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
* 1. Replace x by |x| (sinh(-x) = -sinh(x)).
* 2.
- * E + E/(E+1)
+ * E + E/(E+1)
* 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
- * 2
+ * 2
*
* 22 <= x <= lnovft : sinh(x) := exp(x)/2
* lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2)
@@ -35,18 +31,10 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, shuge = 1.0e307;
-#else
-static long double one = 1.0, shuge = 1.0e307;
-#endif
-#ifdef __STDC__
- long double __ieee754_sinhl(long double x)
-#else
- long double __ieee754_sinhl(x)
- long double x;
-#endif
+long double
+__ieee754_sinhl(long double x)
{
long double t,w,h;
int64_t ix,jx;
@@ -62,7 +50,7 @@ static long double one = 1.0, shuge = 1.0e307;
if (jx<0) h = -h;
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x4036000000000000LL) { /* |x|<22 */
- if (ix<0x3e20000000000000LL) /* |x|<2**-29 */
+ if (ix<0x3e20000000000000LL) /* |x|<2**-29 */
if(shuge+x>one) return x;/* sinhl(tiny) = tiny with inexact */
t = __expm1l(fabsl(x));
if(ix<0x3ff0000000000000LL) return h*(2.0*t-t*t/(t+one));
@@ -82,3 +70,4 @@ static long double one = 1.0, shuge = 1.0e307;
/* |x| > overflowthresold, sinh(x) overflow */
return x*shuge;
}
+strong_alias (__ieee754_sinhl, __sinhl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
index fe6bb55b0..68aa18f55 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2004, 2006 Free Software Foundation
+ * Copyright (C) 2001, 2004, 2006, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -50,7 +50,7 @@ twom54 = 5.55111512312578270212e-17; /* 0x3C90000000000000 */
/* it computes the correctly rounded (to nearest) value of square */
/* root of x. */
/*********************************************************************/
-long double __ieee754_sqrtl(long double x)
+long double __ieee754_sqrtl(long double x)
{
static const long double big = 134217728.0, big1 = 134217729.0;
long double t,s,i;
@@ -107,3 +107,4 @@ long double __ieee754_sqrtl(long double x)
return tm256.x*__ieee754_sqrtl(x*t512.x);
}
}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
index b6195f10b..db31e4f90 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
@@ -59,6 +59,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <math.h>
#include "math_private.h"
#include <math_ldbl_opt.h>
diff --git a/ports/sysdeps/m68k/m680x0/s_isinfl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
index 250203908..e59d2c349 100644
--- a/ports/sysdeps/m68k/m680x0/s_isinfl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
@@ -1,5 +1,7 @@
-/* Copyright (C) 1991, 1992, 1995, 1997, 2002 Free Software Foundation, Inc.
+/* Compute x * y + z as ternary operation.
+ Copyright (C) 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
+ Contributed by David Flaherty <flaherty@linux.vnet.ibm.com>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,26 +19,21 @@
02111-1307 USA. */
#include <math.h>
-#include "ieee754.h"
+#include <math_ldbl_opt.h>
-/* Return 0 if VALUE is finite or NaN, +1 if it
- is +Infinity, -1 if it is -Infinity. */
-int
-__isinfl (long double value)
+long double
+__fmal (long double x, long double y, long double z)
{
- union ieee854_long_double u;
+ /* An IBM long double 128 is really just 2 IEEE64 doubles, and in
+ * the case of inf/nan only the first double counts. So we use the
+ * (double) cast to avoid any data movement. */
+ if ((finite ((double)x) && finite ((double)y)) && isinf ((double)z))
+ return (z);
- u.d = value;
-
- /* An IEEE 854 infinity has an exponent with the
- maximum possible value and a zero mantissa.
- In Motorola's interpretation the integer bit is ignored. */
- if ((u.ieee.exponent & 0x7fff) == 0x7fff &&
- (u.ieee.mantissa0 & 0x7fffffff) == 0 && u.ieee.mantissa1 == 0)
- return u.ieee.negative ? -1 : 1;
-
- return 0;
+ return (x * y) + z;
}
-
-hidden_def (__isinfl)
-weak_alias (__isinfl, isinfl);
+#ifdef IS_IN_libm
+long_double_symbol (libm, __fmal, fmal);
+#else
+long_double_symbol (libc, __fmal, fmal);
+#endif
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c
new file mode 100644
index 000000000..edeaba5f7
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c
@@ -0,0 +1,16 @@
+/*
+ * __isinf_nsl(x) returns != 0 if x is ±inf, else 0;
+ * no branching!
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+int
+__isinf_nsl (long double x)
+{
+ int64_t hx,lx;
+ GET_LDOUBLE_WORDS64(hx,lx,x);
+ return !((lx & 0x7fffffffffffffffLL)
+ | ((hx & 0x7fffffffffffffffLL) ^ 0x7ff0000000000000LL));
+}
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_acoshl.c b/libc/sysdeps/ieee754/ldbl-96/e_acoshl.c
index 5d4fa1ded..29004ec26 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_acoshl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_acoshl.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* __ieee754_acoshl(x)
* Method :
* Based on
@@ -35,20 +31,12 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
one = 1.0,
ln2 = 6.931471805599453094287e-01L; /* 0x3FFE, 0xB17217F7, 0xD1CF79AC */
-#ifdef __STDC__
- long double __ieee754_acoshl(long double x)
-#else
- long double __ieee754_acoshl(x)
- long double x;
-#endif
+long double
+__ieee754_acoshl(long double x)
{
long double t;
u_int32_t se,i0,i1;
@@ -57,7 +45,7 @@ ln2 = 6.931471805599453094287e-01L; /* 0x3FFE, 0xB17217F7, 0xD1CF79AC */
return (x-x)/(x-x);
} else if(se >=0x401d) { /* x > 2**30 */
if(se >=0x7fff) { /* x is inf of NaN */
- return x+x;
+ return x+x;
} else
return __ieee754_logl(x)+ln2; /* acoshl(huge)=logl(2x) */
} else if(((se-0x3fff)|i0|i1)==0) {
@@ -67,6 +55,7 @@ ln2 = 6.931471805599453094287e-01L; /* 0x3FFE, 0xB17217F7, 0xD1CF79AC */
return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__sqrtl(2.0*t+t*t));
+ return __log1pl(t+__ieee754_sqrtl(2.0*t+t*t));
}
}
+strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_asinl.c b/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
index 1cad623d4..d81303931 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_asinl.c
@@ -12,9 +12,9 @@
/*
Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -45,7 +45,7 @@
* = pio2_hi - (2*(s+s*z*R(z)) - pio2_lo)
* For x<=0.98, let pio4_hi = pio2_hi/2, then
* f = hi part of s;
- * c = sqrt(z) - f = (z-f*f)/(s+f) ...f+c=sqrt(z)
+ * c = sqrt(z) - f = (z-f*f)/(s+f) ...f+c=sqrt(z)
* and
* asin(x) = pi/2 - 2*(s+s*z*R(z))
* = pio4_hi+(pio4-2s)-(2s*z*R(z)-pio2_lo)
@@ -159,3 +159,4 @@ __ieee754_asinl (x)
else
return -t;
}
+strong_alias (__ieee754_asinl, __asinl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_atan2l.c b/libc/sysdeps/ieee754/ldbl-96/e_atan2l.c
index 0759458c2..535d0d612 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_atan2l.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_atan2l.c
@@ -14,15 +14,11 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* __ieee754_atan2l(y,x)
* Method :
* 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
* 2. Reduce x to positive by (if x and y are unexceptional):
- * ARG (x+iy) = arctan(y/x) ... if x > 0,
+ * ARG (x+iy) = arctan(y/x) ... if x > 0,
* ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0,
*
* Special cases:
@@ -48,11 +44,7 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
tiny = 1.0e-4900L,
zero = 0.0,
pi_o_4 = 7.85398163397448309628202E-01L, /* 0x3FFE, 0xC90FDAA2, 0x2168C235 */
@@ -60,12 +52,8 @@ pi_o_2 = 1.5707963267948966192564E+00L, /* 0x3FFF, 0xC90FDAA2, 0x2168C235 */
pi = 3.14159265358979323851281E+00L, /* 0x4000, 0xC90FDAA2, 0x2168C235 */
pi_lo = -5.01655761266833202345176e-20L;/* 0xBFBE, 0xECE675D1, 0xFC8F8CBB */
-#ifdef __STDC__
- long double __ieee754_atan2l(long double y, long double x)
-#else
- long double __ieee754_atan2l(y,x)
- long double y,x;
-#endif
+long double
+__ieee754_atan2l (long double y, long double x)
{
long double z;
int32_t k,m,hx,hy,ix,iy;
@@ -87,7 +75,7 @@ pi_lo = -5.01655761266833202345176e-20L;/* 0xBFBE, 0xECE675D1, 0xFC8F8CBB */
if((iy|ly)==0) {
switch(m) {
case 0:
- case 1: return y; /* atan(+-0,+anything)=+-0 */
+ case 1: return y; /* atan(+-0,+anything)=+-0 */
case 2: return pi+tiny;/* atan(+0,-anything) = pi */
case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
}
@@ -118,19 +106,20 @@ pi_lo = -5.01655761266833202345176e-20L;/* 0xBFBE, 0xECE675D1, 0xFC8F8CBB */
/* compute y/x */
k = sy-sx;
- if(k > 70) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**70 */
- else if(sx>=0x8000&&k<-70) z=0.0; /* |y|/x < -2**70 */
+ if(k > 70) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**70 */
+ else if(sx>=0x8000&&k<-70) z=0.0; /* |y|/x < -2**70 */
else z=__atanl(fabsl(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: {
- u_int32_t sz;
+ u_int32_t sz;
GET_LDOUBLE_EXP(sz,z);
SET_LDOUBLE_EXP(z,sz ^ 0x8000);
}
return z ; /* atan(-,+) */
case 2: return pi-(z-pi_lo);/* atan(+,-) */
default: /* case 3 */
- return (z-pi_lo)-pi;/* atan(-,-) */
+ return (z-pi_lo)-pi;/* atan(-,-) */
}
}
+strong_alias (__ieee754_atan2l, __atan2l_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_atanhl.c b/libc/sysdeps/ieee754/ldbl-96/e_atanhl.c
index fdcd1e9fe..5a2aebef3 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_atanhl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_atanhl.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* __ieee754_atanhl(x)
* Method :
* 1.Reduced x to positive by atanh(-x) = -atanh(x)
@@ -26,7 +22,7 @@ static char rcsid[] = "$NetBSD: $";
* atanhl(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
* 2 1 - x 1 - x
*
- * For x<0.5
+ * For x<0.5
* atanhl(x) = 0.5*log1pl(2x+2x*x/(1-x))
*
* Special cases:
@@ -39,24 +35,12 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, huge = 1e4900L;
-#else
-static long double one = 1.0, huge = 1e4900L;
-#endif
-#ifdef __STDC__
static const long double zero = 0.0;
-#else
-static double long zero = 0.0;
-#endif
-#ifdef __STDC__
- long double __ieee754_atanhl(long double x)
-#else
- long double __ieee754_atanhl(x)
- long double x;
-#endif
+long double
+__ieee754_atanhl(long double x)
{
long double t;
int32_t ix;
@@ -77,3 +61,4 @@ static double long zero = 0.0;
t = 0.5*__log1pl((x+x)/(one-x));
if(se<=0x7fff) return t; else return -t;
}
+strong_alias (__ieee754_atanhl, __atanhl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_coshl.c b/libc/sysdeps/ieee754/ldbl-96/e_coshl.c
index 8c38fa4da..6113f0719 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_coshl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_coshl.c
@@ -18,13 +18,13 @@ static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $";
* mathematically coshl(x) if defined to be (exp(x)+exp(-x))/2
* 1. Replace x by |x| (coshl(x) = coshl(-x)).
* 2.
- * [ exp(x) - 1 ]^2
+ * [ exp(x) - 1 ]^2
* 0 <= x <= ln2/2 : coshl(x) := 1 + -------------------
- * 2*exp(x)
+ * 2*exp(x)
*
- * exp(x) + 1/exp(x)
+ * exp(x) + 1/exp(x)
* ln2/2 <= x <= 22 : coshl(x) := -------------------
- * 2
+ * 2
* 22 <= x <= lnovft : coshl(x) := expl(x)/2
* lnovft <= x <= ln2ovft: coshl(x) := expl(x/2)/2 * expl(x/2)
* ln2ovft < x : coshl(x) := huge*huge (overflow)
@@ -37,18 +37,10 @@ static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, half=0.5, huge = 1.0e4900L;
-#else
-static long double one = 1.0, half=0.5, huge = 1.0e4900L;
-#endif
-#ifdef __STDC__
- long double __ieee754_coshl(long double x)
-#else
- long double __ieee754_coshl(x)
- long double x;
-#endif
+long double
+__ieee754_coshl (long double x)
{
long double t,w;
int32_t ex;
@@ -58,19 +50,17 @@ static long double one = 1.0, half=0.5, huge = 1.0e4900L;
GET_LDOUBLE_WORDS(ex,mx,lx,x);
ex &= 0x7fff;
- /* x is INF or NaN */
- if(ex==0x7fff) return x*x;
-
- /* |x| in [0,0.5*ln2], return 1+expm1l(|x|)^2/(2*expl(|x|)) */
- if(ex < 0x3ffd || (ex == 0x3ffd && mx < 0xb17217f7u)) {
- t = __expm1l(fabsl(x));
- w = one+t;
- if (ex<0x3fbc) return w; /* cosh(tiny) = 1 */
- return one+(t*t)/(w+w);
- }
-
- /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
+ /* |x| in [0,22] */
if (ex < 0x4003 || (ex == 0x4003 && mx < 0xb0000000u)) {
+ /* |x| in [0,0.5*ln2], return 1+expm1l(|x|)^2/(2*expl(|x|)) */
+ if(ex < 0x3ffd || (ex == 0x3ffd && mx < 0xb17217f7u)) {
+ t = __expm1l(fabsl(x));
+ w = one+t;
+ if (ex<0x3fbc) return w; /* cosh(tiny) = 1 */
+ return one+(t*t)/(w+w);
+ }
+
+ /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
t = __ieee754_expl(fabsl(x));
return half*t+half/t;
}
@@ -88,6 +78,10 @@ static long double one = 1.0, half=0.5, huge = 1.0e4900L;
return t*w;
}
+ /* x is INF or NaN */
+ if(ex==0x7fff) return x*x;
+
/* |x| >= log(2*maxdouble), cosh(x) overflow */
return huge*huge;
}
+strong_alias (__ieee754_coshl, __coshl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_gammal_r.c b/libc/sysdeps/ieee754/ldbl-96/e_gammal_r.c
index dd956fed9..40c18ea58 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_gammal_r.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999,2001,2003,2004,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -32,25 +32,27 @@ __ieee754_gammal_r (long double x, int *signgamp)
GET_LDOUBLE_WORDS (es, hx, lx, x);
- if (((es & 0x7fff) | hx | lx) == 0)
+ if (__builtin_expect (((es & 0x7fff) | hx | lx) == 0, 0))
{
/* Return value for x == 0 is Inf with divide by zero exception. */
*signgamp = 0;
return 1.0 / x;
}
- if (es == 0xffffffff && ((hx & 0x7fffffff) | lx) == 0)
+ if (__builtin_expect (es == 0xffffffff && ((hx & 0x7fffffff) | lx) == 0, 0))
{
/* x == -Inf. According to ISO this is NaN. */
*signgamp = 0;
return x - x;
}
- if ((es & 0x7fff) == 0x7fff && ((hx & 0x7fffffff) | lx) != 0)
+ if (__builtin_expect ((es & 0x7fff) == 0x7fff, 0)
+ && ((hx & 0x7fffffff) | lx) != 0)
{
/* NaN, return it. */
*signgamp = 0;
return x;
}
- if ((es & 0x8000) != 0 && x < 0xffffffff && __rintl (x) == x)
+ if (__builtin_expect ((es & 0x8000) != 0, 0)
+ && x < 0xffffffff && __rintl (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
@@ -60,3 +62,4 @@ __ieee754_gammal_r (long double x, int *signgamp)
/* XXX FIXME. */
return __ieee754_expl (__ieee754_lgammal_r (x, signgamp));
}
+strong_alias (__ieee754_gammal_r, __gammal_r_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c b/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c
index 1a40c556d..a59320b06 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_hypotl.c
@@ -14,10 +14,6 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* __ieee754_hypotl(x,y)
*
* Method :
@@ -46,8 +42,8 @@ static char rcsid[] = "$NetBSD: $";
* hypot(x,y) is NAN if x or y is NAN.
*
* Accuracy:
- * hypot(x,y) returns sqrt(x^2+y^2) with error less
- * than 1 ulps (units in the last place)
+ * hypot(x,y) returns sqrt(x^2+y^2) with error less
+ * than 1 ulps (units in the last place)
*/
#include "math.h"
@@ -72,7 +68,7 @@ static char rcsid[] = "$NetBSD: $";
SET_LDOUBLE_EXP(b,eb); /* b <- |b| */
if((ea-eb)>0x46) {return a+b;} /* x/y > 2**70 */
k=0;
- if(ea > 0x5f3f) { /* a>2**8000 */
+ if(__builtin_expect(ea > 0x5f3f,0)) { /* a>2**8000 */
if(ea == 0x7fff) { /* Inf or NaN */
u_int32_t exp,high,low;
w = a+b; /* for sNaN */
@@ -87,9 +83,9 @@ static char rcsid[] = "$NetBSD: $";
SET_LDOUBLE_EXP(a,ea);
SET_LDOUBLE_EXP(b,eb);
}
- if(eb < 0x20bf) { /* b < 2**-8000 */
+ if(__builtin_expect(eb < 0x20bf, 0)) { /* b < 2**-8000 */
if(eb == 0) { /* subnormal b or 0 */
- u_int32_t exp,high,low;
+ u_int32_t exp,high,low;
GET_LDOUBLE_WORDS(exp,high,low,b);
if((high|low)==0) return a;
SET_LDOUBLE_WORDS(t1, 0x7ffd, 0, 0); /* t1=2^16382 */
@@ -97,7 +93,7 @@ static char rcsid[] = "$NetBSD: $";
a *= t1;
k -= 16382;
} else { /* scale a and b by 2^9600 */
- ea += 0x2580; /* a *= 2^9600 */
+ ea += 0x2580; /* a *= 2^9600 */
eb += 0x2580; /* b *= 2^9600 */
k -= 9600;
SET_LDOUBLE_EXP(a,ea);
@@ -131,3 +127,4 @@ static char rcsid[] = "$NetBSD: $";
return t1*w;
} else return w;
}
+strong_alias (__ieee754_hypotl, __hypotl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_j0l.c b/libc/sysdeps/ieee754/ldbl-96/e_j0l.c
index 12c906bcb..ce1f0f756 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_j0l.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_j0l.c
@@ -11,9 +11,9 @@
/* Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -74,17 +74,9 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static long double pzero (long double), qzero (long double);
-#else
-static long double pzero (), qzero ();
-#endif
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
huge = 1e4930L,
one = 1.0L,
invsqrtpi = 5.6418958354775628694807945156077258584405e-1L,
@@ -109,20 +101,10 @@ static long double
/* 1.000000000000000000000000000000000000000E0L,*/
};
-#ifdef __STDC__
static const long double zero = 0.0;
-#else
-static long double zero = 0.0;
-#endif
-#ifdef __STDC__
long double
__ieee754_j0l (long double x)
-#else
-long double
-__ieee754_j0l (x)
- long double x;
-#endif
{
long double z, s, c, ss, cc, r, u, v;
int32_t ix;
@@ -130,7 +112,7 @@ __ieee754_j0l (x)
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
- if (ix >= 0x7fff)
+ if (__builtin_expect (ix >= 0x7fff, 0))
return one / (x * x);
x = fabsl (x);
if (ix >= 0x4000) /* |x| >= 2.0 */
@@ -150,7 +132,7 @@ __ieee754_j0l (x)
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
- if (ix > 0x4080) /* 2^129 */
+ if (__builtin_expect (ix > 0x4080, 0)) /* 2^129 */
z = (invsqrtpi * cc) / __ieee754_sqrtl (x);
else
{
@@ -160,7 +142,7 @@ __ieee754_j0l (x)
}
return z;
}
- if (ix < 0x3fef) /* |x| < 2**-16 */
+ if (__builtin_expect (ix < 0x3fef, 0)) /* |x| < 2**-16 */
{
if (huge + x > one)
{ /* raise inexact if x != 0 */
@@ -183,16 +165,13 @@ __ieee754_j0l (x)
return ((one + u) * (one - u) + z * (r / s));
}
}
+strong_alias (__ieee754_j0l, __j0l_finite)
/* y0(x) = 2/pi ln(x) J0(x) + U(x^2)/V(x^2)
0 < x <= 2
peak relative error 1.7e-21 */
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
U[6] = {
-1.054912306975785573710813351985351350861E10L,
2.520192609749295139432773849576523636127E10L,
@@ -201,11 +180,7 @@ U[6] = {
-3.440684087134286610316661166492641011539E5L,
1.005524356159130626192144663414848383774E3L,
};
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
V[5] = {
1.429337283720789610137291929228082613676E11L,
2.492593075325119157558811370165695013002E9L,
@@ -215,14 +190,8 @@ V[5] = {
/* 1.000000000000000000000000000000000000000E0L */
};
-#ifdef __STDC__
long double
__ieee754_y0l (long double x)
-#else
-long double
-__ieee754_y0l (x)
- long double x;
-#endif
{
long double z, s, c, ss, cc, u, v;
int32_t ix;
@@ -231,11 +200,11 @@ __ieee754_y0l (x)
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
/* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */
- if (se & 0x8000)
+ if (__builtin_expect (se & 0x8000, 0))
return zero / (zero * x);
- if (ix >= 0x7fff)
+ if (__builtin_expect (ix >= 0x7fff, 0))
return one / (x + x * x);
- if ((i0 | i1) == 0)
+ if (__builtin_expect ((i0 | i1) == 0, 0))
return -HUGE_VALL + x; /* -inf and overflow exception. */
if (ix >= 0x4000)
{ /* |x| >= 2.0 */
@@ -266,7 +235,7 @@ __ieee754_y0l (x)
else
ss = z / cc;
}
- if (ix > 0x4080) /* 1e39 */
+ if (__builtin_expect (ix > 0x4080, 0)) /* 1e39 */
z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
else
{
@@ -276,7 +245,7 @@ __ieee754_y0l (x)
}
return z;
}
- if (ix <= 0x3fde) /* x < 2^-33 */
+ if (__builtin_expect (ix <= 0x3fde, 0)) /* x < 2^-33 */
{
z = -7.380429510868722527629822444004602747322E-2L
+ tpi * __ieee754_logl (x);
@@ -287,17 +256,14 @@ __ieee754_y0l (x)
v = V[0] + z * (V[1] + z * (V[2] + z * (V[3] + z * (V[4] + z))));
return (u / v + tpi * (__ieee754_j0l (x) * __ieee754_logl (x)));
}
+strong_alias (__ieee754_y0l, __y0l_finite)
/* The asymptotic expansions of pzero is
* 1 - 9/128 s^2 + 11025/98304 s^4 - ..., where s = 1/x.
* For x >= 2, We approximate pzero by
* pzero(x) = 1 + s^2 R(s^2) / S(s^2)
*/
-#ifdef __STDC__
static const long double pR8[7] = {
-#else
-static long double pR8[7] = {
-#endif
/* 8 <= x <= inf
Peak relative error 4.62 */
-4.094398895124198016684337960227780260127E-9L,
@@ -308,11 +274,7 @@ static long double pR8[7] = {
-5.827178869301452892963280214772398135283E-2L,
-2.087563267939546435460286895807046616992E-2L,
};
-#ifdef __STDC__
static const long double pS8[6] = {
-#else
-static long double pS8[6] = {
-#endif
5.823145095287749230197031108839653988393E-8L,
1.279281986035060320477759999428992730280E-5L,
9.132668954726626677174825517150228961304E-4L,
@@ -322,11 +284,7 @@ static long double pS8[6] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static const long double pR5[7] = {
-#else
-static long double pR5[7] = {
-#endif
/* 4.54541015625 <= x <= 8
Peak relative error 6.51E-22 */
-2.041226787870240954326915847282179737987E-7L,
@@ -337,11 +295,7 @@ static long double pR5[7] = {
-8.641175552716402616180994954177818461588E-2L,
-1.354654710097134007437166939230619726157E-2L,
};
-#ifdef __STDC__
static const long double pS5[6] = {
-#else
-static long double pS5[6] = {
-#endif
2.903078099681108697057258628212823545290E-6L,
3.253948449946735405975737677123673867321E-4L,
1.181269751723085006534147920481582279979E-2L,
@@ -351,11 +305,7 @@ static long double pS5[6] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static const long double pR3[7] = {
-#else
-static long double pR3[7] = {
-#endif
/* 2.85711669921875 <= x <= 4.54541015625
peak relative error 5.25e-21 */
-5.755732156848468345557663552240816066802E-6L,
@@ -366,11 +316,7 @@ static long double pR3[7] = {
-1.193350853469302941921647487062620011042E-1L,
-8.567802507331578894302991505331963782905E-3L,
};
-#ifdef __STDC__
static const long double pS3[6] = {
-#else
-static long double pS3[6] = {
-#endif
8.185931139070086158103309281525036712419E-5L,
5.398016943778891093520574483111255476787E-3L,
1.130589193590489566669164765853409621081E-1L,
@@ -380,11 +326,7 @@ static long double pS3[6] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static const long double pR2[7] = {
-#else
-static long double pR2[7] = {
-#endif
/* 2 <= x <= 2.85711669921875
peak relative error 2.64e-21 */
-1.219525235804532014243621104365384992623E-4L,
@@ -395,11 +337,7 @@ static long double pR2[7] = {
-1.556241316844728872406672349347137975495E-1L,
-5.355423239526452209595316733635519506958E-3L,
};
-#ifdef __STDC__
static const long double pS2[6] = {
-#else
-static long double pS2[6] = {
-#endif
1.734442793664291412489066256138894953823E-3L,
7.158111826468626405416300895617986926008E-2L,
9.153839713992138340197264669867993552641E-1L,
@@ -409,20 +347,10 @@ static long double pS2[6] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static long double
pzero (long double x)
-#else
-static long double
-pzero (x)
- long double x;
-#endif
{
-#ifdef __STDC__
const long double *p, *q;
-#else
- long double *p, *q;
-#endif
long double z, r, s;
int32_t ix;
u_int32_t se, i0, i1;
@@ -468,11 +396,7 @@ pzero (x)
* We approximate qzero by
* qzero(x) = s*(-.125 + R(s^2) / S(s^2))
*/
-#ifdef __STDC__
static const long double qR8[7] = {
-#else
-static long double qR8[7] = {
-#endif
/* 8 <= x <= inf
peak relative error 2.23e-21 */
3.001267180483191397885272640777189348008E-10L,
@@ -483,11 +407,7 @@ static long double qR8[7] = {
3.881970028476167836382607922840452192636E-2L,
6.132191514516237371140841765561219149638E-2L,
};
-#ifdef __STDC__
static const long double qS8[7] = {
-#else
-static long double qS8[7] = {
-#endif
4.097730123753051126914971174076227600212E-9L,
1.199615869122646109596153392152131139306E-6L,
1.196337580514532207793107149088168946451E-4L,
@@ -498,11 +418,7 @@ static long double qS8[7] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static const long double qR5[7] = {
-#else
-static long double qR5[7] = {
-#endif
/* 4.54541015625 <= x <= 8
peak relative error 1.03e-21 */
3.406256556438974327309660241748106352137E-8L,
@@ -513,11 +429,7 @@ static long double qR5[7] = {
1.071578819056574524416060138514508609805E-1L,
7.458950172851611673015774675225656063757E-2L,
};
-#ifdef __STDC__
static const long double qS5[7] = {
-#else
-static long double qS5[7] = {
-#endif
4.650675622764245276538207123618745150785E-7L,
6.773573292521412265840260065635377164455E-5L,
3.340711249876192721980146877577806687714E-3L,
@@ -528,11 +440,7 @@ static long double qS5[7] = {
/* 1.000000000000000000000000000000000000000E0L,*/
};
-#ifdef __STDC__
static const long double qR3[7] = {
-#else
-static long double qR3[7] = {
-#endif
/* 2.85711669921875 <= x <= 4.54541015625
peak relative error 5.24e-21 */
1.749459596550816915639829017724249805242E-6L,
@@ -543,11 +451,7 @@ static long double qR3[7] = {
2.538595333972857367655146949093055405072E-1L,
8.560591367256769038905328596020118877936E-2L,
};
-#ifdef __STDC__
static const long double qS3[7] = {
-#else
-static long double qS3[7] = {
-#endif
2.388596091707517488372313710647510488042E-5L,
2.048679968058758616370095132104333998147E-3L,
5.824663198201417760864458765259945181513E-2L,
@@ -558,11 +462,7 @@ static long double qS3[7] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static const long double qR2[7] = {
-#else
-static long double qR2[7] = {
-#endif
/* 2 <= x <= 2.85711669921875
peak relative error 1.58e-21 */
6.306524405520048545426928892276696949540E-5L,
@@ -573,11 +473,7 @@ static long double qR2[7] = {
5.431871999743531634887107835372232030655E-1L,
9.447736151202905471899259026430157211949E-2L,
};
-#ifdef __STDC__
static const long double qS2[7] = {
-#else
-static long double qS2[7] = {
-#endif
8.610579901936193494609755345106129102676E-4L,
4.649054352710496997203474853066665869047E-2L,
8.104282924459837407218042945106320388339E-1L,
@@ -588,20 +484,10 @@ static long double qS2[7] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static long double
qzero (long double x)
-#else
-static long double
-qzero (x)
- long double x;
-#endif
{
-#ifdef __STDC__
const long double *p, *q;
-#else
- long double *p, *q;
-#endif
long double s, r, z;
int32_t ix;
u_int32_t se, i0, i1;
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_j1l.c b/libc/sysdeps/ieee754/ldbl-96/e_j1l.c
index 62a8ce0cb..369fd830f 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_j1l.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_j1l.c
@@ -11,9 +11,9 @@
/* Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -38,17 +38,17 @@
* for x in (0,2)
* j1(x) = x/2 + x*z*R0/S0, where z = x*x;
* for x in (2,inf)
- * j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
- * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
- * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
+ * j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
+ * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
+ * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
* as follow:
* cos(x1) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
* sin(x1) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
* = -1/sqrt(2) * (sin(x) + cos(x))
- * (To avoid cancellation, use
+ * (To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
- * to compute the worse one.)
+ * to compute the worse one.)
*
* 3 Special cases
* j1(nan)= nan
@@ -66,25 +66,17 @@
* Note: For tiny x, 1/x dominate y1 and hence
* y1(tiny) = -2/pi/tiny
* 3. For x>=2.
- * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
- * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
+ * y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
+ * where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
* by method mentioned above.
*/
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static long double pone (long double), qone (long double);
-#else
-static long double pone (), qone ();
-#endif
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
huge = 1e4930L,
one = 1.0L,
invsqrtpi = 5.6418958354775628694807945156077258584405e-1L,
@@ -110,21 +102,11 @@ R[5] = {
/* 1.000000000000000000000000000000000000000E0L, */
};
-#ifdef __STDC__
static const long double zero = 0.0;
-#else
-static long double zero = 0.0;
-#endif
-#ifdef __STDC__
long double
__ieee754_j1l (long double x)
-#else
-long double
-__ieee754_j1l (x)
- long double x;
-#endif
{
long double z, c, r, s, ss, cc, u, v, y;
int32_t ix;
@@ -132,7 +114,7 @@ __ieee754_j1l (x)
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
- if (ix >= 0x7fff)
+ if (__builtin_expect (ix >= 0x7fff, 0))
return one / x;
y = fabsl (x);
if (ix >= 0x4000)
@@ -152,7 +134,7 @@ __ieee754_j1l (x)
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
- if (ix > 0x4080)
+ if (__builtin_expect (ix > 0x4080, 0))
z = (invsqrtpi * cc) / __ieee754_sqrtl (y);
else
{
@@ -165,7 +147,7 @@ __ieee754_j1l (x)
else
return z;
}
- if (ix < 0x3fde) /* |x| < 2^-33 */
+ if (__builtin_expect (ix < 0x3fde, 0)) /* |x| < 2^-33 */
{
if (huge + x > one)
return 0.5 * x; /* inexact if x!=0 necessary */
@@ -176,16 +158,13 @@ __ieee754_j1l (x)
r *= x;
return (x * 0.5 + r / s);
}
+strong_alias (__ieee754_j1l, __j1l_finite)
/* Y1(x) = 2/pi * (log(x) * j1(x) - 1/x) + x R(x^2)
0 <= x <= 2
Peak relative error 2.3e-23 */
-#ifdef __STDC__
static const long double U0[6] = {
-#else
-static long double U0[6] = {
-#endif
-5.908077186259914699178903164682444848615E10L,
1.546219327181478013495975514375773435962E10L,
-6.438303331169223128870035584107053228235E8L,
@@ -193,11 +172,7 @@ static long double U0[6] = {
-6.138043997084355564619377183564196265471E4L,
1.418503228220927321096904291501161800215E2L,
};
-#ifdef __STDC__
static const long double V0[5] = {
-#else
-static long double V0[5] = {
-#endif
3.013447341682896694781964795373783679861E11L,
4.669546565705981649470005402243136124523E9L,
3.595056091631351184676890179233695857260E7L,
@@ -207,14 +182,8 @@ static long double V0[5] = {
};
-#ifdef __STDC__
long double
__ieee754_y1l (long double x)
-#else
-long double
-__ieee754_y1l (x)
- long double x;
-#endif
{
long double z, s, c, ss, cc, u, v;
int32_t ix;
@@ -223,11 +192,11 @@ __ieee754_y1l (x)
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
- if (se & 0x8000)
+ if (__builtin_expect (se & 0x8000, 0))
return zero / (zero * x);
- if (ix >= 0x7fff)
+ if (__builtin_expect (ix >= 0x7fff, 0))
return one / (x + x * x);
- if ((i0 | i1) == 0)
+ if (__builtin_expect ((i0 | i1) == 0, 0))
return -HUGE_VALL + x; /* -inf and overflow exception. */
if (ix >= 0x4000)
{ /* |x| >= 2.0 */
@@ -253,7 +222,7 @@ __ieee754_y1l (x)
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.
*/
- if (ix > 0x4080)
+ if (__builtin_expect (ix > 0x4080, 0))
z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
else
{
@@ -263,7 +232,7 @@ __ieee754_y1l (x)
}
return z;
}
- if (ix <= 0x3fbe)
+ if (__builtin_expect (ix <= 0x3fbe, 0))
{ /* x < 2**-65 */
return (-tpi / x);
}
@@ -273,12 +242,13 @@ __ieee754_y1l (x)
return (x * (u / v) +
tpi * (__ieee754_j1l (x) * __ieee754_logl (x) - one / x));
}
+strong_alias (__ieee754_y1l, __y1l_finite)
/* For x >= 8, the asymptotic expansions of pone is
* 1 + 15/128 s^2 - 4725/2^15 s^4 - ..., where s = 1/x.
* We approximate pone by
- * pone(x) = 1 + (R/S)
+ * pone(x) = 1 + (R/S)
*/
/* J1(x) cosX + Y1(x) sinX = sqrt( 2/(pi x)) P1(x)
@@ -286,11 +256,7 @@ __ieee754_y1l (x)
8 <= x <= inf (0 <= z <= 0.125)
Peak relative error 5.2e-22 */
-#ifdef __STDC__
static const long double pr8[7] = {
-#else
-static long double pr8[7] = {
-#endif
8.402048819032978959298664869941375143163E-9L,
1.813743245316438056192649247507255996036E-6L,
1.260704554112906152344932388588243836276E-4L,
@@ -299,11 +265,7 @@ static long double pr8[7] = {
1.131111483254318243139953003461511308672E-1L,
4.480715825681029711521286449131671880953E-2L,
};
-#ifdef __STDC__
static const long double ps8[6] = {
-#else
-static long double ps8[6] = {
-#endif
7.169748325574809484893888315707824924354E-8L,
1.556549720596672576431813934184403614817E-5L,
1.094540125521337139209062035774174565882E-3L,
@@ -317,11 +279,7 @@ static long double ps8[6] = {
P1(x) = 1 + z^2 R(z^2), z=1/x
4.54541015625 <= x <= 8
Peak relative error 7.7e-22 */
-#ifdef __STDC__
static const long double pr5[7] = {
-#else
-static long double pr5[7] = {
-#endif
4.318486887948814529950980396300969247900E-7L,
4.715341880798817230333360497524173929315E-5L,
1.642719430496086618401091544113220340094E-3L,
@@ -330,11 +288,7 @@ static long double pr5[7] = {
1.755576530055079253910829652698703791957E-1L,
3.218803858282095929559165965353784980613E-2L,
};
-#ifdef __STDC__
static const long double ps5[6] = {
-#else
-static long double ps5[6] = {
-#endif
3.685108812227721334719884358034713967557E-6L,
4.069102509511177498808856515005792027639E-4L,
1.449728676496155025507893322405597039816E-2L,
@@ -348,11 +302,7 @@ static long double ps5[6] = {
P1(x) = 1 + z^2 R(z^2), z=1/x
2.85711669921875 <= x <= 4.54541015625
Peak relative error 6.5e-21 */
-#ifdef __STDC__
static const long double pr3[7] = {
-#else
-static long double pr3[7] = {
-#endif
1.265251153957366716825382654273326407972E-5L,
8.031057269201324914127680782288352574567E-4L,
1.581648121115028333661412169396282881035E-2L,
@@ -361,11 +311,7 @@ static long double pr3[7] = {
2.559223765418386621748404398017602935764E-1L,
2.277136933287817911091370397134882441046E-2L,
};
-#ifdef __STDC__
static const long double ps3[6] = {
-#else
-static long double ps3[6] = {
-#endif
1.079681071833391818661952793568345057548E-4L,
6.986017817100477138417481463810841529026E-3L,
1.429403701146942509913198539100230540503E-1L,
@@ -379,11 +325,7 @@ static long double ps3[6] = {
P1(x) = 1 + z^2 R(z^2), z=1/x
2 <= x <= 2.85711669921875
Peak relative error 3.5e-21 */
-#ifdef __STDC__
static const long double pr2[7] = {
-#else
-static long double pr2[7] = {
-#endif
2.795623248568412225239401141338714516445E-4L,
1.092578168441856711925254839815430061135E-2L,
1.278024620468953761154963591853679640560E-1L,
@@ -392,11 +334,7 @@ static long double pr2[7] = {
3.544176317308370086415403567097130611468E-1L,
1.604142674802373041247957048801599740644E-2L,
};
-#ifdef __STDC__
static const long double ps2[6] = {
-#else
-static long double ps2[6] = {
-#endif
2.385605161555183386205027000675875235980E-3L,
9.616778294482695283928617708206967248579E-2L,
1.195215570959693572089824415393951258510E0L,
@@ -407,20 +345,10 @@ static long double ps2[6] = {
};
-#ifdef __STDC__
static long double
pone (long double x)
-#else
-static long double
-pone (x)
- long double x;
-#endif
{
-#ifdef __STDC__
const long double *p, *q;
-#else
- long double *p, *q;
-#endif
long double z, r, s;
int32_t ix;
u_int32_t se, i0, i1;
@@ -462,7 +390,7 @@ pone (x)
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
* We approximate pone by
- * qone(x) = s*(0.375 + (R/S))
+ * qone(x) = s*(0.375 + (R/S))
*/
/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
@@ -470,11 +398,7 @@ pone (x)
8 <= x <= inf
Peak relative error 8.3e-22 */
-#ifdef __STDC__
static const long double qr8[7] = {
-#else
-static long double qr8[7] = {
-#endif
-5.691925079044209246015366919809404457380E-10L,
-1.632587664706999307871963065396218379137E-7L,
-1.577424682764651970003637263552027114600E-5L,
@@ -483,11 +407,7 @@ static long double qr8[7] = {
-6.854943629378084419631926076882330494217E-2L,
-1.055448290469180032312893377152490183203E-1L,
};
-#ifdef __STDC__
static const long double qs8[7] = {
-#else
-static long double qs8[7] = {
-#endif
5.550982172325019811119223916998393907513E-9L,
1.607188366646736068460131091130644192244E-6L,
1.580792530091386496626494138334505893599E-4L,
@@ -502,11 +422,7 @@ static long double qs8[7] = {
Q1(x) = z(.375 + z^2 R(z^2)), z=1/x
4.54541015625 <= x <= 8
Peak relative error 4.1e-22 */
-#ifdef __STDC__
static const long double qr5[7] = {
-#else
-static long double qr5[7] = {
-#endif
-6.719134139179190546324213696633564965983E-8L,
-9.467871458774950479909851595678622044140E-6L,
-4.429341875348286176950914275723051452838E-4L,
@@ -515,11 +431,7 @@ static long double qr5[7] = {
-1.964432669771684034858848142418228214855E-1L,
-1.333896496989238600119596538299938520726E-1L,
};
-#ifdef __STDC__
static const long double qs5[7] = {
-#else
-static long double qs5[7] = {
-#endif
6.552755584474634766937589285426911075101E-7L,
9.410814032118155978663509073200494000589E-5L,
4.561677087286518359461609153655021253238E-3L,
@@ -534,11 +446,7 @@ static long double qs5[7] = {
Q1(x) = z(.375 + z^2 R(z^2)), z=1/x
2.85711669921875 <= x <= 4.54541015625
Peak relative error 2.2e-21 */
-#ifdef __STDC__
static const long double qr3[7] = {
-#else
-static long double qr3[7] = {
-#endif
-3.618746299358445926506719188614570588404E-6L,
-2.951146018465419674063882650970344502798E-4L,
-7.728518171262562194043409753656506795258E-3L,
@@ -547,11 +455,7 @@ static long double qr3[7] = {
-4.858192581793118040782557808823460276452E-1L,
-1.592399251246473643510898335746432479373E-1L,
};
-#ifdef __STDC__
static const long double qs3[7] = {
-#else
-static long double qs3[7] = {
-#endif
3.529139957987837084554591421329876744262E-5L,
2.973602667215766676998703687065066180115E-3L,
8.273534546240864308494062287908662592100E-2L,
@@ -566,11 +470,7 @@ static long double qs3[7] = {
Q1(x) = z(.375 + z^2 R(z^2)), z=1/x
2 <= x <= 2.85711669921875
Peak relative error 6.9e-22 */
-#ifdef __STDC__
static const long double qr2[7] = {
-#else
-static long double qr2[7] = {
-#endif
-1.372751603025230017220666013816502528318E-4L,
-6.879190253347766576229143006767218972834E-3L,
-1.061253572090925414598304855316280077828E-1L,
@@ -579,11 +479,7 @@ static long double qr2[7] = {
-1.087955310491078933531734062917489870754E0L,
-1.826821119773182847861406108689273719137E-1L,
};
-#ifdef __STDC__
static const long double qs2[7] = {
-#else
-static long double qs2[7] = {
-#endif
1.338768933634451601814048220627185324007E-3L,
7.071099998918497559736318523932241901810E-2L,
1.200511429784048632105295629933382142221E0L,
@@ -595,20 +491,10 @@ static long double qs2[7] = {
};
-#ifdef __STDC__
static long double
qone (long double x)
-#else
-static long double
-qone (x)
- long double x;
-#endif
{
-#ifdef __STDC__
const long double *p, *q;
-#else
- long double *p, *q;
-#endif
static long double s, r, z;
int32_t ix;
u_int32_t se, i0, i1;
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_jnl.c b/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
index 3d715d36a..3a70e10db 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_jnl.c
@@ -11,9 +11,9 @@
/* Modifications for long double are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -59,28 +59,13 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
invsqrtpi = 5.64189583547756286948079e-1L, two = 2.0e0L, one = 1.0e0L;
-#ifdef __STDC__
static const long double zero = 0.0L;
-#else
-static long double zero = 0.0L;
-#endif
-#ifdef __STDC__
long double
__ieee754_jnl (int n, long double x)
-#else
-long double
-__ieee754_jnl (n, x)
- int n;
- long double x;
-#endif
{
u_int32_t se, i0, i1;
int32_t i, ix, sgn;
@@ -95,7 +80,7 @@ __ieee754_jnl (n, x)
ix = se & 0x7fff;
/* if J(n,NaN) is NaN */
- if ((ix == 0x7fff) && ((i0 & 0x7fffffff) != 0))
+ if (__builtin_expect ((ix == 0x7fff) && ((i0 & 0x7fffffff) != 0), 0))
return x + x;
if (n < 0)
{
@@ -109,7 +94,8 @@ __ieee754_jnl (n, x)
return (__ieee754_j1l (x));
sgn = (n & 1) & (se >> 15); /* even n -- 0, odd n -- sign(x) */
x = fabsl (x);
- if ((ix | i0 | i1) == 0 || ix >= 0x7fff) /* if x is 0 or inf */
+ if (__builtin_expect ((ix | i0 | i1) == 0 || ix >= 0x7fff, 0))
+ /* if x is 0 or inf */
b = zero;
else if ((long double) n <= x)
{
@@ -281,7 +267,16 @@ __ieee754_jnl (n, x)
}
}
}
- b = (t * __ieee754_j0l (x) / b);
+ /* j0() and j1() suffer enormous loss of precision at and
+ * near zero; however, we know that their zero points never
+ * coincide, so just choose the one further away from zero.
+ */
+ z = __ieee754_j0l (x);
+ w = __ieee754_j1l (x);
+ if (fabsl (z) >= fabsl (w))
+ b = (t * z / b);
+ else
+ b = (t * w / a);
}
}
if (sgn == 1)
@@ -289,16 +284,10 @@ __ieee754_jnl (n, x)
else
return b;
}
+strong_alias (__ieee754_jnl, __jnl_finite)
-#ifdef __STDC__
long double
__ieee754_ynl (int n, long double x)
-#else
-long double
-__ieee754_ynl (n, x)
- int n;
- long double x;
-#endif
{
u_int32_t se, i0, i1;
int32_t i, ix;
@@ -309,11 +298,11 @@ __ieee754_ynl (n, x)
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
/* if Y(n,NaN) is NaN */
- if ((ix == 0x7fff) && ((i0 & 0x7fffffff) != 0))
+ if (__builtin_expect ((ix == 0x7fff) && ((i0 & 0x7fffffff) != 0), 0))
return x + x;
- if ((ix | i0 | i1) == 0)
+ if (__builtin_expect ((ix | i0 | i1) == 0, 0))
return -HUGE_VALL + x; /* -inf and overflow exception. */
- if (se & 0x8000)
+ if (__builtin_expect (se & 0x8000, 0))
return zero / (zero * x);
sign = 1;
if (n < 0)
@@ -325,7 +314,7 @@ __ieee754_ynl (n, x)
return (__ieee754_y0l (x));
if (n == 1)
return (sign * __ieee754_y1l (x));
- if (ix == 0x7fff)
+ if (__builtin_expect (ix == 0x7fff, 0))
return zero;
if (ix >= 0x412D)
{ /* x > 2**302 */
@@ -384,3 +373,4 @@ __ieee754_ynl (n, x)
else
return -b;
}
+strong_alias (__ieee754_ynl, __ynl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c b/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
index 36e336565..8a20e5e13 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
@@ -94,11 +94,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double
-#else
-static long double
-#endif
half = 0.5L,
one = 1.0L,
pi = 3.14159265358979323846264L,
@@ -204,20 +200,10 @@ static long double
w6 = -1.880801938119376907179E-3L,
w7 = 4.885026142432270781165E-3L;
-#ifdef __STDC__
static const long double zero = 0.0L;
-#else
-static long double zero = 0.0L;
-#endif
-#ifdef __STDC__
static long double
sin_pi (long double x)
-#else
-static long double
-sin_pi (x)
- long double x;
-#endif
{
long double y, z;
int n, ix;
@@ -283,15 +269,8 @@ sin_pi (x)
}
-#ifdef __STDC__
long double
__ieee754_lgammal_r (long double x, int *signgamp)
-#else
-long double
-__ieee754_lgammal_r (x, signgamp)
- long double x;
- int *signgamp;
-#endif
{
long double t, y, z, nadj, p, p1, p2, q, r, w;
int i, ix;
@@ -301,7 +280,7 @@ __ieee754_lgammal_r (x, signgamp)
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
- if ((ix | i0 | i1) == 0)
+ if (__builtin_expect((ix | i0 | i1) == 0, 0))
{
if (se & 0x8000)
*signgamp = -1;
@@ -311,10 +290,10 @@ __ieee754_lgammal_r (x, signgamp)
ix = (ix << 16) | (i0 >> 16);
/* purge off +-inf, NaN, +-0, and negative arguments */
- if (ix >= 0x7fff0000)
+ if (__builtin_expect(ix >= 0x7fff0000, 0))
return x * x;
- if (ix < 0x3fc08000) /* 2^-63 */
+ if (__builtin_expect(ix < 0x3fc08000, 0)) /* 2^-63 */
{ /* |x|<2**-63, return -log(|x|) */
if (se & 0x8000)
{
@@ -438,7 +417,7 @@ __ieee754_lgammal_r (x, signgamp)
z = one / x;
y = z * z;
w = w0 + z * (w1
- + y * (w2 + y * (w3 + y * (w4 + y * (w5 + y * (w6 + y * w7))))));
+ + y * (w2 + y * (w3 + y * (w4 + y * (w5 + y * (w6 + y * w7))))));
r = (x - half) * (t - one) + w;
}
else
@@ -448,3 +427,4 @@ __ieee754_lgammal_r (x, signgamp)
r = nadj - r;
return r;
}
+strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_remainderl.c b/libc/sysdeps/ieee754/ldbl-96/e_remainderl.c
index e721a6e8c..41c4c7b34 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_remainderl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_remainderl.c
@@ -14,14 +14,10 @@
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
/* __ieee754_remainderl(x,p)
* Return :
- * returns x REM p = x - [x/p]*p as if in infinite
- * precise arithmetic, where [x/p] is the (infinite bit)
+ * returns x REM p = x - [x/p]*p as if in infinite
+ * precise arithmetic, where [x/p] is the (infinite bit)
* integer nearest x/p (in half way case choose the even one).
* Method :
* Based on fmod() return x-[x/p]chopped*p exactlp.
@@ -30,19 +26,11 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double zero = 0.0;
-#else
-static long double zero = 0.0;
-#endif
-#ifdef __STDC__
- long double __ieee754_remainderl(long double x, long double p)
-#else
- long double __ieee754_remainderl(x,p)
- long double x,p;
-#endif
+long double
+__ieee754_remainderl(long double x, long double p)
{
u_int32_t sx,sex,sep,x0,x1,p0,p1;
long double p_half;
@@ -54,7 +42,7 @@ static long double zero = 0.0;
sex &= 0x7fff;
/* purge off exception values */
- if((sep|p0|p1)==0) return (x*p)/(x*p); /* p = 0 */
+ if((sep|p0|p1)==0) return (x*p)/(x*p); /* p = 0 */
if((sex==0x7fff)|| /* x not finite */
((sep==0x7fff)&& /* p is NaN */
((p0|p1)!=0)))
@@ -81,3 +69,4 @@ static long double zero = 0.0;
SET_LDOUBLE_EXP(x,sex^sx);
return x;
}
+strong_alias (__ieee754_remainderl, __remainderl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/e_sinhl.c b/libc/sysdeps/ieee754/ldbl-96/e_sinhl.c
index 646d4fde8..859327240 100644
--- a/libc/sysdeps/ieee754/ldbl-96/e_sinhl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/e_sinhl.c
@@ -23,9 +23,9 @@ static char rcsid[] = "$NetBSD: $";
* mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
* 1. Replace x by |x| (sinhl(-x) = -sinhl(x)).
* 2.
- * E + E/(E+1)
+ * E + E/(E+1)
* 0 <= x <= 25 : sinhl(x) := --------------, E=expm1l(x)
- * 2
+ * 2
*
* 25 <= x <= lnovft : sinhl(x) := expl(x)/2
* lnovft <= x <= ln2ovft: sinhl(x) := expl(x/2)/2 * expl(x/2)
@@ -39,18 +39,10 @@ static char rcsid[] = "$NetBSD: $";
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const long double one = 1.0, shuge = 1.0e4931L;
-#else
-static long double one = 1.0, shuge = 1.0e4931L;
-#endif
-#ifdef __STDC__
- long double __ieee754_sinhl(long double x)
-#else
- long double __ieee754_sinhl(x)
- long double x;
-#endif
+long double
+__ieee754_sinhl(long double x)
{
long double t,w,h;
u_int32_t jx,ix,i0,i1;
@@ -60,13 +52,13 @@ static long double one = 1.0, shuge = 1.0e4931L;
ix = jx&0x7fff;
/* x is INF or NaN */
- if(ix==0x7fff) return x+x;
+ if(__builtin_expect(ix==0x7fff, 0)) return x+x;
h = 0.5;
if (jx & 0x8000) h = -h;
/* |x| in [0,25], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x4003 || (ix == 0x4003 && i0 <= 0xc8000000)) { /* |x|<25 */
- if (ix<0x3fdf) /* |x|<2**-32 */
+ if (ix<0x3fdf) /* |x|<2**-32 */
if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
t = __expm1l(fabsl(x));
if(ix<0x3fff) return h*(2.0*t-t*t/(t+one));
@@ -89,3 +81,4 @@ static long double one = 1.0, shuge = 1.0e4931L;
/* |x| > overflowthreshold, sinhl(x) overflow */
return x*shuge;
}
+strong_alias (__ieee754_sinhl, __sinhl_finite)
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c b/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c
index 6eb434c44..9f37d4884 100644
--- a/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/s_asinhl.c
@@ -52,19 +52,21 @@ huge= 1.000000000000000000e+4900L;
int32_t hx,ix;
GET_LDOUBLE_EXP(hx,x);
ix = hx&0x7fff;
- if(ix==0x7fff) return x+x; /* x is inf or NaN */
- if(ix< 0x3fde) { /* |x|<2**-34 */
+ if(__builtin_expect(ix< 0x3fde, 0)) { /* |x|<2**-34 */
if(huge+x>one) return x; /* return x inexact except 0 */
}
- if(ix>0x4020) { /* |x| > 2**34 */
+ if(__builtin_expect(ix>0x4020,0)) { /* |x| > 2**34 */
+ if(ix==0x7fff) return x+x; /* x is inf or NaN */
w = __ieee754_logl(fabsl(x))+ln2;
- } else if (ix>0x4000) { /* 2**34 > |x| > 2.0 */
- t = fabsl(x);
- w = __ieee754_logl(2.0*t+one/(__ieee754_sqrtl(x*x+one)+t));
- } else { /* 2.0 > |x| > 2**-28 */
- t = x*x;
- w =__log1pl(fabsl(x)+t/(one+__ieee754_sqrtl(one+t)));
+ } else {
+ long double xa = fabsl(x);
+ if (ix>0x4000) { /* 2**34 > |x| > 2.0 */
+ w = __ieee754_logl(2.0*xa+one/(__ieee754_sqrtl(xa*xa+one)+xa));
+ } else { /* 2.0 > |x| > 2**-28 */
+ t = xa*xa;
+ w =__log1pl(xa+t/(one+__ieee754_sqrtl(one+t)));
+ }
}
- if(hx&0x8000) return -w; else return w;
+ return __copysignl(w, x);
}
weak_alias (__asinhl, asinhl)
diff --git a/libc/sysdeps/ieee754/ldbl-96/s_isinf_nsl.c b/libc/sysdeps/ieee754/ldbl-96/s_isinf_nsl.c
new file mode 100644
index 000000000..aa590307e
--- /dev/null
+++ b/libc/sysdeps/ieee754/ldbl-96/s_isinf_nsl.c
@@ -0,0 +1,18 @@
+/*
+ * Written by Ulrich Drepper <drepper@gmail.com>.
+ */
+
+/*
+ * __isinf_nsl(x) returns != 0 if x is ±inf, else 0;
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+int
+__isinf_nsl (long double x)
+{
+ int32_t se,hx,lx;
+ GET_LDOUBLE_WORDS(se,hx,lx,x);
+ return !(((se & 0x7fff) ^ 0x7fff) | lx | (hx & 0x7fffffff));
+}
diff --git a/libc/sysdeps/ieee754/ldbl-96/w_expl.c b/libc/sysdeps/ieee754/ldbl-96/w_expl.c
index 53bb14373..703a0a204 100644
--- a/libc/sysdeps/ieee754/ldbl-96/w_expl.c
+++ b/libc/sysdeps/ieee754/ldbl-96/w_expl.c
@@ -1,61 +1,48 @@
-/* w_expl.c -- long double version of w_exp.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
-/*
- * wrapper expl(x)
- */
-
-#include "math.h"
-#include "math_private.h"
-
-#ifdef __STDC__
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <math.h>
+#include <math_private.h>
+
static const long double
-#else
-static long double
-#endif
o_threshold= 1.135652340629414394949193107797076489134e4,
/* 0x400C, 0xB17217F7, 0xD1CF79AC */
u_threshold= -1.140019167866942050398521670162263001513e4;
/* 0x400C, 0xB220C447, 0x69C201E8 */
-#ifdef __STDC__
- long double __expl(long double x) /* wrapper exp */
-#else
- long double __expl(x) /* wrapper exp */
- long double x;
-#endif
+
+/* wrapper expl */
+long double
+__expl (long double x)
{
-#ifdef _IEEE_LIBM
- return __ieee754_expl(x);
-#else
- long double z;
- z = __ieee754_expl(x);
- if(_LIB_VERSION == _IEEE_) return z;
- if(__finitel(x)) {
- if(x>o_threshold)
- return __kernel_standard(x,x,206); /* exp overflow */
- else if(x<u_threshold)
- return __kernel_standard(x,x,207); /* exp underflow */
- }
- return z;
-#endif
+ if (__builtin_expect (x > o_threshold, 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 206);
+ }
+ else if (__builtin_expect (x < u_threshold, 0))
+ {
+ if (_LIB_VERSION != _IEEE_)
+ return __kernel_standard (x, x, 207);
+ }
+
+ return __ieee754_expl (x);
}
hidden_def (__expl)
weak_alias (__expl, expl)
diff --git a/libc/sysdeps/mach/hurd/Makefile b/libc/sysdeps/mach/hurd/Makefile
index 95d7ba380..93058ffaa 100644
--- a/libc/sysdeps/mach/hurd/Makefile
+++ b/libc/sysdeps/mach/hurd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993,94,95,96,97,98,99,2000,2001,2002,2003,2004,2009
+# Copyright (C) 1993,94,95,96,97,98,99,2000,2001,2002,2003,2004,2009,2011
# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
@@ -94,10 +94,6 @@ $(common-objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $(hurd)/bits/errno.h-tmp
$(move-if-change) $(hurd)/bits/errno.h-tmp $(hurd)/bits/errno.h
-ifeq ($(with-cvs),yes)
- test ! -d $(hurd)/CVS || \
- (cd $(hurd) && cvs commit -m'Regenerated from $^' bits/errno.h)
-endif
touch $@
common-generated += errnos.d stamp-errnos
diff --git a/libc/sysdeps/mach/hurd/fork.c b/libc/sysdeps/mach/hurd/fork.c
index 3288f186e..66fa7e27b 100644
--- a/libc/sysdeps/mach/hurd/fork.c
+++ b/libc/sysdeps/mach/hurd/fork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,1995,1996,1997,1999,2001,2002,2004,2005,2006
+/* Copyright (C) 1994,1995,1996,1997,1999,2001,2002,2004,2005,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -313,7 +313,7 @@ __fork (void)
{
/* This is a send right or a dead name.
Give the child as many references for it as we have. */
- mach_port_urefs_t refs, *record_refs = NULL;
+ mach_port_urefs_t refs = 0, *record_refs = NULL;
mach_port_t insert;
mach_msg_type_name_t insert_type = MACH_MSG_TYPE_COPY_SEND;
if (portnames[i] == newtask || portnames[i] == newproc)
diff --git a/libc/sysdeps/mach/hurd/i386/tls.h b/libc/sysdeps/mach/hurd/i386/tls.h
index d98b485b9..46e098241 100644
--- a/libc/sysdeps/mach/hurd/i386/tls.h
+++ b/libc/sysdeps/mach/hurd/i386/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. Hurd/i386 version.
- Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2006, 2007, 2011 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
@@ -20,16 +20,15 @@
#ifndef _I386_TLS_H
#define _I386_TLS_H
-#if defined HAVE_TLS_SUPPORT
/* Some things really need not be machine-dependent. */
-# include <sysdeps/mach/hurd/tls.h>
+#include <sysdeps/mach/hurd/tls.h>
/* The TCB can have any size and the memory following the address the
thread pointer points to is unspecified. Allocate the TCB there. */
-# define TLS_TCB_AT_TP 1
+#define TLS_TCB_AT_TP 1
-# ifndef __ASSEMBLER__
+#ifndef __ASSEMBLER__
/* Use i386-specific RPCs to arrange that %gs segment register prefix
addresses the TCB in each thread. */
@@ -42,7 +41,7 @@
# include <errno.h>
# include <assert.h>
-#define HURD_TLS_DESC_DECL(desc, tcb) \
+# define HURD_TLS_DESC_DECL(desc, tcb) \
struct descriptor desc = \
{ /* low word: */ \
0xffff /* limit 0..15 */ \
@@ -123,7 +122,7 @@ _hurd_tls_init (tcbhead_t *tcb, int secondcall)
# define TLS_INIT_TP_EXPENSIVE 1
/* Return the TCB address of the current thread. */
-# define THREAD_SELF \
+# define THREAD_SELF \
({ tcbhead_t *__tcb; \
__asm__ ("movl %%gs:%c1,%0" : "=r" (__tcb) \
: "i" (offsetof (tcbhead_t, tcb))); \
@@ -135,12 +134,12 @@ _hurd_tls_init (tcbhead_t *tcb, int secondcall)
: : "ir" (dtvp), "i" (offsetof (tcbhead_t, dtv))); })
/* Return the address of the dtv for the current thread. */
-# define THREAD_DTV() \
+# define THREAD_DTV() \
({ dtv_t *_dtv; \
asm ("movl %%gs:%P1,%0" : "=q" (_dtv) : "i" (offsetof (tcbhead_t, dtv)));\
_dtv; })
-#include <mach/machine/thread_status.h>
+# include <mach/machine/thread_status.h>
/* Set up TLS in the new thread of a fork child, copying from our own. */
static inline error_t __attribute__ ((unused))
@@ -165,7 +164,6 @@ _hurd_tls_fork (thread_t child, struct i386_thread_state *state)
return err;
}
-# endif /* !__ASSEMBLER__ */
-#endif /* HAVE_TLS_SUPPORT */
+#endif /* !__ASSEMBLER__ */
#endif /* i386/tls.h */
diff --git a/libc/sysdeps/mach/hurd/sys/param.h b/libc/sysdeps/mach/hurd/sys/param.h
index 699ba3510..21dc41266 100644
--- a/libc/sysdeps/mach/hurd/sys/param.h
+++ b/libc/sysdeps/mach/hurd/sys/param.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1994,1995,1997,1999,2011 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
@@ -119,6 +119,10 @@
#define MAX(a,b) (((a)>(b))?(a):(b))
+/* Unit of `st_blocks'. */
+#define DEV_BSIZE 512
+
+
/* Scale factor for scaled integers used to count %cpu time and load avgs.
The number of CPU `tick's that map to a unique `%age' can be expressed
diff --git a/libc/sysdeps/mach/hurd/tls.h b/libc/sysdeps/mach/hurd/tls.h
index 8ad3f1a28..d63045fef 100644
--- a/libc/sysdeps/mach/hurd/tls.h
+++ b/libc/sysdeps/mach/hurd/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. Hurd version.
- Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2007, 2011 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
@@ -20,7 +20,7 @@
#ifndef _TLS_H
#define _TLS_H
-#if defined HAVE_TLS_SUPPORT && !defined __ASSEMBLER__
+#ifndef __ASSEMBLER__
# include <stddef.h>
# include <stdbool.h>
@@ -71,7 +71,7 @@ typedef struct
# define GET_DTV(descr) \
(((tcbhead_t *) (descr))->dtv)
-#endif /* HAVE_TLS_SUPPORT */
+#endif /* !ASSEMBLER */
#endif /* tls.h */
diff --git a/libc/sysdeps/posix/spawni.c b/libc/sysdeps/posix/spawni.c
index 129edcd6d..f849437a4 100644
--- a/libc/sysdeps/posix/spawni.c
+++ b/libc/sysdeps/posix/spawni.c
@@ -39,7 +39,6 @@
#define SPAWN_ERROR 127
-#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_15)
/* The file is accessible but it is not an executable file. Invoke
the shell to interpret it as a script. */
static void
@@ -66,11 +65,16 @@ script_execute (const char *file, char *const argv[], char *const envp[])
__execve (new_argv[0], new_argv, envp);
}
}
-# define tryshell (xflags & SPAWN_XFLAGS_TRY_SHELL)
-#else
-# define tryshell 0
-#endif
+static inline void
+maybe_script_execute (const char *file, char *const argv[], char *const envp[],
+ int xflags)
+{
+ if (SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_15)
+ && (xflags & SPAWN_XFLAGS_TRY_SHELL)
+ && errno == ENOEXEC)
+ script_execute (file, argv, envp);
+}
/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
Before running the process perform the actions described in FILE-ACTIONS. */
@@ -237,8 +241,7 @@ __spawni (pid_t *pid, const char *file,
/* The FILE parameter is actually a path. */
__execve (file, argv, envp);
- if (tryshell && errno == ENOEXEC)
- script_execute (file, argv, envp);
+ maybe_script_execute (file, argv, envp, xflags);
/* Oh, oh. `execve' returns. This is bad. */
_exit (SPAWN_ERROR);
@@ -283,8 +286,7 @@ __spawni (pid_t *pid, const char *file,
/* Try to execute this name. If it works, execv will not return. */
__execve (startp, argv, envp);
- if (tryshell && errno == ENOEXEC)
- script_execute (startp, argv, envp);
+ maybe_script_execute (startp, argv, envp, xflags);
switch (errno)
{
diff --git a/libc/sysdeps/powerpc/Makefile b/libc/sysdeps/powerpc/Makefile
index 616458f13..e43ca704f 100644
--- a/libc/sysdeps/powerpc/Makefile
+++ b/libc/sysdeps/powerpc/Makefile
@@ -2,10 +2,6 @@
# machine.
+cflags += -mnew-mnemonics
-ifeq ($(subdir),gmon)
-sysdep_routines += ppc-mcount
-endif
-
ifeq ($(subdir),string)
CFLAGS-memcmp.c += -Wno-uninitialized
endif
diff --git a/libc/sysdeps/powerpc/fpu/e_hypot.c b/libc/sysdeps/powerpc/fpu/e_hypot.c
new file mode 100644
index 000000000..a8d67d875
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/e_hypot.c
@@ -0,0 +1,118 @@
+/* Pythagorean addition using doubles
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 "math.h"
+#include "math_private.h"
+
+static const double two60 = 1.152921504606847e+18;
+static const double two500 = 3.2733906078961419e+150;
+static const double two600 = 4.149515568880993e+180;
+static const double two1022 = 4.49423283715579e+307;
+static const double twoM500 = 3.054936363499605e-151;
+static const double twoM600 = 4.616489308892868e-128;
+static const double pdnum = 2.225073858507201e-308;
+
+/* __ieee754_hypot(x,y)
+ *
+ * This a FP only version without any FP->INT conversion.
+ * It is similar to default C version, making appropriates
+ * overflow and underflows checks as well scaling when it
+ * is needed.
+ */
+
+#ifdef _ARCH_PWR7
+/* POWER7 isinf and isnan optimization are fast. */
+# define TEST_INF_NAN(x, y) \
+ if (isinf(x) || isinf(y)) \
+ return INFINITY; \
+ if (isnan(x) || isnan(y)) \
+ return NAN;
+# else
+/* For POWER6 and below isinf/isnan triggers LHS and PLT calls are
+ * costly (especially for POWER6). */
+# define GET_TW0_HIGH_WORD(d1,d2,i1,i2) \
+ do { \
+ ieee_double_shape_type gh_u1; \
+ ieee_double_shape_type gh_u2; \
+ gh_u1.value = (d1); \
+ gh_u2.value = (d2); \
+ (i1) = gh_u1.parts.msw; \
+ (i2) = gh_u2.parts.msw; \
+ } while (0)
+
+# define TEST_INF_NAN(x, y) \
+ do { \
+ int32_t hx, hy; \
+ GET_TW0_HIGH_WORD(x, y, hx, hy); \
+ if (hy > hx) { \
+ uint32_t ht = hx; hx = hy; hy = ht; \
+ } \
+ if (hx >= 0x7ff00000) { \
+ if (hx == 0x7ff00000 || hy == 0x7ff00000) \
+ return INFINITY; \
+ return NAN; \
+ } \
+ } while (0)
+
+#endif
+
+
+double
+__ieee754_hypot (double x, double y)
+{
+ x = fabs (x);
+ y = fabs (y);
+
+ TEST_INF_NAN (x, y);
+
+ if (y > x)
+ {
+ double t = x;
+ x = y;
+ y = t;
+ }
+ if (y == 0.0 || (x / y) > two60)
+ {
+ return x + y;
+ }
+ if (x > two500)
+ {
+ x *= twoM600;
+ y *= twoM600;
+ return __ieee754_sqrt (x * x + y * y) / twoM600;
+ }
+ if (y < twoM500)
+ {
+ if (y <= pdnum)
+ {
+ x *= two1022;
+ y *= two1022;
+ return __ieee754_sqrt (x * x + y * y) / two1022;
+ }
+ else
+ {
+ x *= two600;
+ y *= two600;
+ return __ieee754_sqrt (x * x + y * y) / two600;
+ }
+ }
+ return __ieee754_sqrt (x * x + y * y);
+}
+strong_alias (__ieee754_hypot, __hypot_finite)
diff --git a/libc/sysdeps/powerpc/fpu/e_hypotf.c b/libc/sysdeps/powerpc/fpu/e_hypotf.c
new file mode 100644
index 000000000..915738c4d
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/e_hypotf.c
@@ -0,0 +1,119 @@
+/* Pythagorean addition using floats
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 "math.h"
+#include "math_private.h"
+
+
+static const float two30 = 1.0737418e09;
+static const float two50 = 1.1259000e15;
+static const float two60 = 1.1529221e18;
+static const float two126 = 8.5070592e+37;
+static const float twoM50 = 8.8817842e-16;
+static const float twoM60 = 6.7762644e-21;
+static const float pdnum = 1.1754939e-38;
+
+
+/* __ieee754_hypotf(x,y)
+ *
+ * This a FP only version without any FP->INT conversion.
+ * It is similar to default C version, making appropriates
+ * overflow and underflows checks as well scaling when it
+ * is needed.
+ */
+
+#ifdef _ARCH_PWR7
+/* POWER7 isinf and isnan optimizations are fast. */
+# define TEST_INF_NAN(x, y) \
+ if (isinff(x) || isinff(y)) \
+ return INFINITY; \
+ if (isnanf(x) || isnanf(y)) \
+ return NAN;
+# else
+/* For POWER6 and below isinf/isnan triggers LHS and PLT calls are
+ * costly (especially for POWER6). */
+# define GET_TWO_FLOAT_WORD(f1,f2,i1,i2) \
+ do { \
+ ieee_float_shape_type gf_u1; \
+ ieee_float_shape_type gf_u2; \
+ gf_u1.value = (f1); \
+ gf_u2.value = (f2); \
+ (i1) = gf_u1.word; \
+ (i2) = gf_u2.word; \
+ } while (0)
+
+# define TEST_INF_NAN(x, y) \
+ do { \
+ int32_t hx, hy; \
+ GET_TWO_FLOAT_WORD(x, y, hx, hy); \
+ if (hy > hx) { \
+ uint32_t ht = hx; hx = hy; hy = ht; \
+ } \
+ if (hx >= 0x7f800000) { \
+ if (hx == 0x7f800000 || hy == 0x7f800000) \
+ return INFINITY; \
+ return NAN; \
+ } \
+ } while (0)
+#endif
+
+
+float
+__ieee754_hypotf (float x, float y)
+{
+ x = fabsf (x);
+ y = fabsf (y);
+
+ TEST_INF_NAN (x, y);
+
+ if (y > x)
+ {
+ float t = y;
+ y = x;
+ x = t;
+ }
+ if (y == 0.0 || (x / y) > two30)
+ {
+ return x + y;
+ }
+ if (x > two50)
+ {
+ x *= twoM60;
+ y *= twoM60;
+ return __ieee754_sqrtf (x * x + y * y) / twoM60;
+ }
+ if (y < twoM50)
+ {
+ if (y <= pdnum)
+ {
+ x *= two126;
+ y *= two126;
+ return __ieee754_sqrtf (x * x + y * y) / two126;
+ }
+ else
+ {
+ x *= two60;
+ y *= two60;
+ return __ieee754_sqrtf (x * x + y * y) / two60;
+ }
+ }
+ return __ieee754_sqrtf (x * x + y * y);
+}
+strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/libc/sysdeps/powerpc/fpu/e_rem_pio2f.c b/libc/sysdeps/powerpc/fpu/e_rem_pio2f.c
new file mode 100644
index 000000000..e4427e489
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/e_rem_pio2f.c
@@ -0,0 +1,189 @@
+/* e_rem_pio2f.c -- float version of e_rem_pio2.c
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 <math.h>
+
+#include "math_private.h"
+#include "s_float_bitwise.h"
+
+/* defined in sysdeps/powerpc/fpu/k_rem_pio2f.c */
+int __fp_kernel_rem_pio2f (float *x, float *y, float e0, int32_t nx);
+
+/* __ieee754_rem_pio2f(x,y)
+ *
+ * return the remainder of x rem pi/2 in y[0]+y[1]
+ */
+
+static const float npio2_hw[] = {
+ 1.57077026e+00, 3.14154053e+00, 4.71228027e+00, 6.28308105e+00,
+ 7.85388184e+00, 9.42456055e+00, 1.09953613e+01, 1.25661621e+01,
+ 1.41369629e+01, 1.57077637e+01, 1.72783203e+01, 1.88491211e+01,
+ 2.04199219e+01, 2.19907227e+01, 2.35615234e+01, 2.51323242e+01,
+ 2.67031250e+01, 2.82739258e+01, 2.98447266e+01, 3.14155273e+01,
+ 3.29863281e+01, 3.45566406e+01, 3.61279297e+01, 3.76982422e+01,
+ 3.92695312e+01, 4.08398438e+01, 4.24111328e+01, 4.39814453e+01,
+ 4.55527344e+01, 4.71230469e+01, 4.86943359e+01, 5.02646484e+01
+};
+
+
+static const float zero = 0.0000000000e+00;
+static const float two8 = 2.5600000000e+02;
+
+static const float half = 5.0000000000e-01;
+static const float invpio2 = 6.3661980629e-01;
+static const float pio2_1 = 1.5707855225e+00;
+static const float pio2_1t = 1.0804334124e-05;
+static const float pio2_2 = 1.0804273188e-05;
+static const float pio2_2t = 6.0770999344e-11;
+static const float pio2_3 = 6.0770943833e-11;
+static const float pio2_3t = 6.1232342629e-17;
+
+static const float pio4 = 7.8539801e-01;
+static const float pio3_4 = 2.3561945e+00;
+static const float pio2_24b = 1.5707951e+00;
+static const float pio2_2e7 = 2.0106054e+02;
+
+
+int32_t
+__ieee754_rem_pio2f (float x, float *y)
+{
+ float ax, z, n, r, w, t, e0;
+ float tx[3];
+ int32_t i, nx;
+
+ ax = __builtin_fabsf (x);
+ if (ax <= pio4)
+ {
+ y[0] = x;
+ y[1] = 0;
+ return 0;
+ }
+ if (ax < pio3_4)
+ {
+ if (x > 0)
+ {
+ z = x - pio2_1;
+ if (!__float_and_test28 (ax, pio2_24b))
+ {
+ y[0] = z - pio2_1t;
+ y[1] = (z - y[0]) - pio2_1t;
+ }
+ else
+ {
+ z -= pio2_2;
+ y[0] = z - pio2_2t;
+ y[1] = (z - y[0]) - pio2_2t;
+ }
+ return 1;
+ }
+ else
+ {
+ z = x + pio2_1;
+ if (!__float_and_test28 (ax, pio2_24b))
+ {
+ y[0] = z + pio2_1t;
+ y[1] = (z - y[0]) + pio2_1t;
+ }
+ else
+ {
+ z += pio2_2;
+ y[0] = z + pio2_2t;
+ y[1] = (z - y[0]) + pio2_2t;
+ }
+ return -1;
+ }
+ }
+ if (ax <= pio2_2e7)
+ {
+ n = __floorf (ax * invpio2 + half);
+ i = (int32_t) n;
+ r = ax - n * pio2_1;
+ w = n * pio2_1t; /* 1st round good to 40 bit */
+ if (i < 32 && !__float_and_test24 (ax, npio2_hw[i - 1]))
+ {
+ y[0] = r - w;
+ }
+ else
+ {
+ float i, j;
+ j = __float_and8 (ax);
+ y[0] = r - w;
+ i = __float_and8 (y[0]);
+ if (j / i > 256.0 || j / i < 3.9062500e-3)
+ { /* 2nd iterations needed, good to 57 */
+ t = r;
+ w = n * pio2_2;
+ r = t - w;
+ w = n * pio2_2t - ((t - r) - w);
+ y[0] = r - w;
+ i = __float_and8 (y[0]);
+ if (j / i > 33554432 || j / i < 2.9802322e-8)
+ { /* 3rd iteration needed, 74 bits acc */
+ t = r;
+ w = n * pio2_3;
+ r = t - w;
+ w = n * pio2_3t - ((t - r) - w);
+ y[0] = r - w;
+ }
+ }
+ }
+ y[1] = (r - y[0]) - w;
+ if (x < 0)
+ {
+ y[0] = -y[0];
+ y[1] = -y[1];
+ return -i;
+ }
+ else
+ {
+ return i;
+ }
+ }
+
+ /* all other (large) arguments */
+ if (isnanf (x) || isinff (x))
+ {
+ y[0] = y[1] = x - x;
+ return 0;
+ }
+
+ /* set z = scalbn(|x|,ilogb(x)-7) */
+ e0 = __float_and8 (ax / 128.0);
+ z = ax / e0;
+
+ tx[0] = __floorf (z);
+ z = (z - tx[0]) * two8;
+ tx[1] = __floorf (z);
+ z = (z - tx[1]) * two8;
+ tx[2] = __floorf (z);
+
+ nx = 3;
+ while (tx[nx - 1] == zero)
+ nx--;
+
+ i = __fp_kernel_rem_pio2f (tx, y, e0, nx);
+ if (x < 0)
+ {
+ y[0] = -y[0];
+ y[1] = -y[1];
+ return -i;
+ }
+ return i;
+}
diff --git a/libc/sysdeps/powerpc/fpu/e_sqrt.c b/libc/sysdeps/powerpc/fpu/e_sqrt.c
index e95b786a0..f9ded2571 100644
--- a/libc/sysdeps/powerpc/fpu/e_sqrt.c
+++ b/libc/sysdeps/powerpc/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
/* Double-precision floating point square root.
- Copyright (C) 1997, 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2002-2004, 2008, 2011 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
@@ -46,21 +46,15 @@ extern const float __t_sqrt[1024];
generated guesses (which mostly runs on the integer unit, while the
Newton-Raphson is running on the FPU). */
-#ifdef __STDC__
double
__slow_ieee754_sqrt (double x)
-#else
-double
-__slow_ieee754_sqrt (x)
- double x;
-#endif
{
const float inf = a_inf.value;
if (x > 0)
{
/* schedule the EXTRACT_WORDS to get separation between the store
- and the load. */
+ and the load. */
ieee_double_shape_type ew_u;
ieee_double_shape_type iw_u;
ew_u.value = (x);
@@ -147,7 +141,7 @@ __slow_ieee754_sqrt (x)
else if (x < 0)
{
/* For some reason, some PowerPC32 processors don't implement
- FE_INVALID_SQRT. */
+ FE_INVALID_SQRT. */
#ifdef FE_INVALID_SQRT
feraiseexcept (FE_INVALID_SQRT);
@@ -160,14 +154,8 @@ __slow_ieee754_sqrt (x)
return f_wash (x);
}
-#ifdef __STDC__
double
__ieee754_sqrt (double x)
-#else
-double
-__ieee754_sqrt (x)
- double x;
-#endif
{
double z;
@@ -175,7 +163,7 @@ __ieee754_sqrt (x)
if (__CPU_HAS_FSQRT)
{
/* Volatile is required to prevent the compiler from moving the
- fsqrt instruction above the branch. */
+ fsqrt instruction above the branch. */
__asm __volatile (" fsqrt %0,%1\n"
:"=f" (z):"f" (x));
}
@@ -184,3 +172,4 @@ __ieee754_sqrt (x)
return z;
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/libc/sysdeps/powerpc/fpu/e_sqrtf.c b/libc/sysdeps/powerpc/fpu/e_sqrtf.c
index ca44fac55..965faee84 100644
--- a/libc/sysdeps/powerpc/fpu/e_sqrtf.c
+++ b/libc/sysdeps/powerpc/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
/* Single-precision floating point square root.
- Copyright (C) 1997, 2003, 2004, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2003, 2004, 2008, 2011 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
@@ -46,14 +46,8 @@ extern const float __t_sqrt[1024];
generated guesses (which mostly runs on the integer unit, while the
Newton-Raphson is running on the FPU). */
-#ifdef __STDC__
float
__slow_ieee754_sqrtf (float x)
-#else
-float
-__slow_ieee754_sqrtf (x)
- float x;
-#endif
{
const float inf = a_inf.value;
@@ -123,7 +117,7 @@ __slow_ieee754_sqrtf (x)
else if (x < 0)
{
/* For some reason, some PowerPC32 processors don't implement
- FE_INVALID_SQRT. */
+ FE_INVALID_SQRT. */
#ifdef FE_INVALID_SQRT
feraiseexcept (FE_INVALID_SQRT);
@@ -137,14 +131,8 @@ __slow_ieee754_sqrtf (x)
}
-#ifdef __STDC__
float
__ieee754_sqrtf (float x)
-#else
-float
-__ieee754_sqrtf (x)
- float x;
-#endif
{
double z;
@@ -152,7 +140,7 @@ __ieee754_sqrtf (x)
if (__CPU_HAS_FSQRT)
{
/* Volatile is required to prevent the compiler from moving the
- fsqrt instruction above the branch. */
+ fsqrt instruction above the branch. */
__asm __volatile (" fsqrts %0,%1\n"
:"=f" (z):"f" (x));
}
@@ -161,3 +149,4 @@ __ieee754_sqrtf (x)
return z;
}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/libc/sysdeps/powerpc/fpu/k_cosf.c b/libc/sysdeps/powerpc/fpu/k_cosf.c
new file mode 100644
index 000000000..cb0e34e39
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/k_cosf.c
@@ -0,0 +1,65 @@
+/* k_cosf.c -- float version of k_cos.c
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 "math.h"
+#include "math_private.h"
+
+static const float twom27 = 7.4505806e-09;
+static const float dot3 = 3.0000001e-01;
+static const float dot78125 = 7.8125000e-01;
+
+static const float one = 1.0000000000e+00;
+static const float C1 = 4.1666667908e-02;
+static const float C2 = -1.3888889225e-03;
+static const float C3 = 2.4801587642e-05;
+static const float C4 = -2.7557314297e-07;
+static const float C5 = 2.0875723372e-09;
+static const float C6 = -1.1359647598e-11;
+
+float
+__kernel_cosf (float x, float y)
+{
+ float a, hz, z, r, qx;
+ float ix;
+ ix = __builtin_fabsf (x);
+ if (ix < twom27)
+ { /* |x| < 2**-27 */
+ if (x == 0.0)
+ return one;
+ }
+ z = x * x;
+ r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * C6)))));
+ if (ix < dot3) /* if |x| < 0.3 */
+ return one - ((float) 0.5 * z - (z * r - x * y));
+ else
+ {
+ if (ix > dot78125)
+ { /* x > 0.78125 */
+ qx = (float) 0.28125;
+ }
+ else
+ {
+ qx = ix / 4.0;
+ }
+ hz = (float) 0.5 *z - qx;
+ a = one - qx;
+ return a - (hz - (z * r - x * y));
+ }
+}
diff --git a/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c b/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c
new file mode 100644
index 000000000..709060553
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/k_rem_pio2f.c
@@ -0,0 +1,274 @@
+/* k_rem_pio2f.c -- float version of e_rem_pio2.c
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 <math.h>
+
+#include "math_private.h"
+#include "s_float_bitwise.h"
+
+
+static const float two_over_pi[] = {
+ 1.62000000e+02, 2.49000000e+02, 1.31000000e+02, 1.10000000e+02,
+ 7.80000000e+01, 6.80000000e+01, 2.10000000e+01, 4.10000000e+01,
+ 2.52000000e+02, 3.90000000e+01, 8.70000000e+01, 2.09000000e+02,
+ 2.45000000e+02, 5.20000000e+01, 2.21000000e+02, 1.92000000e+02,
+ 2.19000000e+02, 9.80000000e+01, 1.49000000e+02, 1.53000000e+02,
+ 6.00000000e+01, 6.70000000e+01, 1.44000000e+02, 6.50000000e+01,
+ 2.54000000e+02, 8.10000000e+01, 9.90000000e+01, 1.71000000e+02,
+ 2.22000000e+02, 1.87000000e+02, 1.97000000e+02, 9.70000000e+01,
+ 1.83000000e+02, 3.60000000e+01, 1.10000000e+02, 5.80000000e+01,
+ 6.60000000e+01, 7.70000000e+01, 2.10000000e+02, 2.24000000e+02,
+ 6.00000000e+00, 7.30000000e+01, 4.60000000e+01, 2.34000000e+02,
+ 9.00000000e+00, 2.09000000e+02, 1.46000000e+02, 2.80000000e+01,
+ 2.54000000e+02, 2.90000000e+01, 2.35000000e+02, 2.80000000e+01,
+ 1.77000000e+02, 4.10000000e+01, 1.67000000e+02, 6.20000000e+01,
+ 2.32000000e+02, 1.30000000e+02, 5.30000000e+01, 2.45000000e+02,
+ 4.60000000e+01, 1.87000000e+02, 6.80000000e+01, 1.32000000e+02,
+ 2.33000000e+02, 1.56000000e+02, 1.12000000e+02, 3.80000000e+01,
+ 1.80000000e+02, 9.50000000e+01, 1.26000000e+02, 6.50000000e+01,
+ 5.70000000e+01, 1.45000000e+02, 2.14000000e+02, 5.70000000e+01,
+ 1.31000000e+02, 8.30000000e+01, 5.70000000e+01, 2.44000000e+02,
+ 1.56000000e+02, 1.32000000e+02, 9.50000000e+01, 1.39000000e+02,
+ 1.89000000e+02, 2.49000000e+02, 4.00000000e+01, 5.90000000e+01,
+ 3.10000000e+01, 2.48000000e+02, 1.51000000e+02, 2.55000000e+02,
+ 2.22000000e+02, 5.00000000e+00, 1.52000000e+02, 1.50000000e+01,
+ 2.39000000e+02, 4.70000000e+01, 1.70000000e+01, 1.39000000e+02,
+ 9.00000000e+01, 1.00000000e+01, 1.09000000e+02, 3.10000000e+01,
+ 1.09000000e+02, 5.40000000e+01, 1.26000000e+02, 2.07000000e+02,
+ 3.90000000e+01, 2.03000000e+02, 9.00000000e+00, 1.83000000e+02,
+ 7.90000000e+01, 7.00000000e+01, 6.30000000e+01, 1.02000000e+02,
+ 1.58000000e+02, 9.50000000e+01, 2.34000000e+02, 4.50000000e+01,
+ 1.17000000e+02, 3.90000000e+01, 1.86000000e+02, 1.99000000e+02,
+ 2.35000000e+02, 2.29000000e+02, 2.41000000e+02, 1.23000000e+02,
+ 6.10000000e+01, 7.00000000e+00, 5.70000000e+01, 2.47000000e+02,
+ 1.38000000e+02, 8.20000000e+01, 1.46000000e+02, 2.34000000e+02,
+ 1.07000000e+02, 2.51000000e+02, 9.50000000e+01, 1.77000000e+02,
+ 3.10000000e+01, 1.41000000e+02, 9.30000000e+01, 8.00000000e+00,
+ 8.60000000e+01, 3.00000000e+00, 4.80000000e+01, 7.00000000e+01,
+ 2.52000000e+02, 1.23000000e+02, 1.07000000e+02, 1.71000000e+02,
+ 2.40000000e+02, 2.07000000e+02, 1.88000000e+02, 3.20000000e+01,
+ 1.54000000e+02, 2.44000000e+02, 5.40000000e+01, 2.90000000e+01,
+ 1.69000000e+02, 2.27000000e+02, 1.45000000e+02, 9.70000000e+01,
+ 9.40000000e+01, 2.30000000e+02, 2.70000000e+01, 8.00000000e+00,
+ 1.01000000e+02, 1.53000000e+02, 1.33000000e+02, 9.50000000e+01,
+ 2.00000000e+01, 1.60000000e+02, 1.04000000e+02, 6.40000000e+01,
+ 1.41000000e+02, 2.55000000e+02, 2.16000000e+02, 1.28000000e+02,
+ 7.70000000e+01, 1.15000000e+02, 3.90000000e+01, 4.90000000e+01,
+ 6.00000000e+00, 6.00000000e+00, 2.10000000e+01, 8.60000000e+01,
+ 2.02000000e+02, 1.15000000e+02, 1.68000000e+02, 2.01000000e+02,
+ 9.60000000e+01, 2.26000000e+02, 1.23000000e+02, 1.92000000e+02,
+ 1.40000000e+02, 1.07000000e+02
+};
+
+
+static const float PIo2[] = {
+ 1.5703125000e+00, /* 0x3fc90000 */
+ 4.5776367188e-04, /* 0x39f00000 */
+ 2.5987625122e-05, /* 0x37da0000 */
+ 7.5437128544e-08, /* 0x33a20000 */
+ 6.0026650317e-11, /* 0x2e840000 */
+ 7.3896444519e-13, /* 0x2b500000 */
+ 5.3845816694e-15, /* 0x27c20000 */
+ 5.6378512969e-18, /* 0x22d00000 */
+ 8.3009228831e-20, /* 0x1fc40000 */
+ 3.2756352257e-22, /* 0x1bc60000 */
+ 6.3331015649e-25, /* 0x17440000 */
+};
+
+
+static const float zero = 0.0000000000e+00;
+static const float one = 1.0000000000;
+static const float twon8 = 3.9062500000e-03;
+static const float two8 = 2.5600000000e+02;
+
+
+int32_t
+__fp_kernel_rem_pio2f (float *x, float *y, float e0, int32_t nx)
+{
+ int32_t jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih, exp;
+ float z, fw, f[20], fq[20], q[20];
+
+ /* initialize jk */
+ jp = jk = 9;
+
+ /* determine jx,jv,q0, note that 3>q0 */
+ jx = nx - 1;
+ exp = __float_get_exp (e0) - 127;
+ jv = (exp - 3) / 8;
+ if (jv < 0)
+ jv = 0;
+ q0 = exp - 8 * (jv + 1);
+
+ /* set up f[0] to f[jx+jk] where f[jx+jk] = two_over_pi[jv+jk] */
+ j = jv - jx;
+ m = jx + jk;
+ for (i = 0; i <= m; i++, j++)
+ f[i] = (j < 0) ? zero : two_over_pi[j];
+
+ /* compute q[0],q[1],...q[jk] */
+ for (i = 0; i <= jk; i++)
+ {
+ for (j = 0, fw = 0.0; j <= jx; j++)
+ fw += x[j] * f[jx + i - j];
+ q[i] = fw;
+ }
+
+ jz = jk;
+recompute:
+ /* distill q[] into iq[] reversingly */
+ for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--)
+ {
+ fw = __truncf (twon8 * z);
+ iq[i] = (int32_t) (z - two8 * fw);
+ z = q[j - 1] + fw;
+ }
+
+ /* compute n */
+ z = __scalbnf (z, q0); /* actual value of z */
+ z -= 8.0 * __floorf (z * 0.125); /* trim off integer >= 8 */
+ n = (int32_t) z;
+ z -= __truncf (z);
+ ih = 0;
+ if (q0 > 0)
+ { /* need iq[jz-1] to determine n */
+ i = (iq[jz - 1] >> (8 - q0));
+ n += i;
+ iq[jz - 1] -= i << (8 - q0);
+ ih = iq[jz - 1] >> (7 - q0);
+ }
+ else if (q0 == 0)
+ ih = iq[jz - 1] >> 8;
+ else if (z >= 0.5)
+ ih = 2;
+
+ if (ih > 0)
+ { /* q > 0.5 */
+ n += 1;
+ carry = 0;
+ for (i = 0; i < jz; i++)
+ { /* compute 1-q */
+ j = iq[i];
+ if (carry == 0)
+ {
+ if (j != 0)
+ {
+ carry = 1;
+ iq[i] = 0x100 - j;
+ }
+ }
+ else
+ iq[i] = 0xff - j;
+ }
+ if (q0 > 0)
+ { /* rare case: chance is 1 in 12 */
+ switch (q0)
+ {
+ case 1:
+ iq[jz - 1] &= 0x7f;
+ break;
+ case 2:
+ iq[jz - 1] &= 0x3f;
+ break;
+ }
+ }
+ if (ih == 2)
+ {
+ z = one - z;
+ if (carry != 0)
+ z -= __scalbnf (one, q0);
+ }
+ }
+
+ /* check if recomputation is needed */
+ if (z == zero)
+ {
+ j = 0;
+ for (i = jz - 1; i >= jk; i--)
+ j |= iq[i];
+ if (j == 0)
+ { /* need recomputation */
+ for (k = 1; iq[jk - k] == 0; k++); /* k = no. of terms needed */
+
+ for (i = jz + 1; i <= jz + k; i++)
+ { /* add q[jz+1] to q[jz+k] */
+ f[jx + i] = two_over_pi[jv + i];
+ for (j = 0, fw = 0.0; j <= jx; j++)
+ fw += x[j] * f[jx + i - j];
+ q[i] = fw;
+ }
+ jz += k;
+ goto recompute;
+ }
+ }
+
+ /* chop off zero terms */
+ if (z == 0.0)
+ {
+ jz -= 1;
+ q0 -= 8;
+ while (iq[jz] == 0)
+ {
+ jz--;
+ q0 -= 8;
+ }
+ }
+ else
+ { /* break z into 8-bit if necessary */
+ z = __scalbnf (z, -q0);
+ if (z >= two8)
+ {
+ fw = __truncf (twon8 * z);
+ iq[jz] = (int32_t) (z - two8 * fw);
+ jz += 1;
+ q0 += 8;
+ iq[jz] = (int32_t) fw;
+ }
+ else
+ iq[jz] = (int32_t) z;
+ }
+
+ /* convert integer "bit" chunk to floating-point value */
+ fw = __scalbnf (one, q0);
+ for (i = jz; i >= 0; i--)
+ {
+ q[i] = fw * (float) iq[i];
+ fw *= twon8;
+ }
+
+ /* compute PIo2[0,...,jp]*q[jz,...,0] */
+ for (i = jz; i >= 0; i--)
+ {
+ for (fw = 0.0, k = 0; k <= jp && k <= jz - i; k++)
+ fw += PIo2[k] * q[i + k];
+ fq[jz - i] = fw;
+ }
+
+ /* compress fq[] into y[] */
+ fw = 0.0;
+ for (i = jz; i >= 0; i--)
+ fw += fq[i];
+ y[0] = (ih == 0) ? fw : -fw;
+ fw = fq[0] - fw;
+ for (i = 1; i <= jz; i++)
+ fw += fq[i];
+ y[1] = (ih == 0) ? fw : -fw;
+
+ return n & 7;
+}
diff --git a/libc/sysdeps/powerpc/fpu/k_sinf.c b/libc/sysdeps/powerpc/fpu/k_sinf.c
new file mode 100644
index 000000000..f93a47871
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/k_sinf.c
@@ -0,0 +1,53 @@
+/* k_sinf.c -- float version of k_sin.c
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 "math.h"
+#include "math_private.h"
+
+
+static const float twom27 = 7.4505806000e-09;
+static const float half = 5.0000000000e-01;
+static const float S1 = -1.6666667163e-01;
+static const float S2 = 8.3333337680e-03;
+static const float S3 = -1.9841270114e-04;
+static const float S4 = 2.7557314297e-06;
+static const float S5 = -2.5050759689e-08;
+static const float S6 = 1.5896910177e-10;
+
+
+float
+__kernel_sinf (float x, float y, int iy)
+{
+ float z, r, v;
+ float ix;
+ ix = __builtin_fabsf (x);
+ if (ix < twom27)
+ { /* |x| < 2**-27 */
+ if (x == 0.0)
+ return x;
+ }
+ z = x * x;
+ v = z * x;
+ r = S2 + z * (S3 + z * (S4 + z * (S5 + z * S6)));
+ if (iy == 0)
+ return x + v * (S1 + z * r);
+ else
+ return x - ((z * (half * y - v * r) - y) - v * S1);
+}
diff --git a/libc/sysdeps/powerpc/fpu/libm-test-ulps b/libc/sysdeps/powerpc/fpu/libm-test-ulps
index 7f187ac72..86c2e85c5 100644
--- a/libc/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/libc/sysdeps/powerpc/fpu/libm-test-ulps
@@ -617,8 +617,15 @@ ifloat: 1
ildouble: 4
ldouble: 4
Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+double: 1
float: 4
+idouble: 1
ifloat: 4
+Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
ildouble: 1
ldouble: 1
@@ -647,6 +654,37 @@ idouble: 1
ifloat: 2
ildouble: 2
ldouble: 2
+Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813":
+double: 3
+idouble: 3
+Test "jn (4, 2.4048255576957729) == 0.647466661641779720084932282551219891E-1":
+double: 1
+idouble: 1
+Test "jn (5, 2.4048255576957729) == 0.163892432048058525099230549946147698E-1":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+Test "jn (6, 2.4048255576957729) == 0.34048184720278336646673682895929161E-2":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+Test "jn (7, 2.4048255576957729) == 0.60068836573295394221291569249883076E-3":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+Test "jn (8, 2.4048255576957729) == 0.92165786705344923232879022467054148E-4":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
# lgamma
Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
@@ -1236,10 +1274,10 @@ ildouble: 1
ldouble: 1
Function: "jn":
-double: 3
-float: 4
-idouble: 3
-ifloat: 4
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
ildouble: 4
ldouble: 4
diff --git a/libc/sysdeps/powerpc/fpu/s_cosf.c b/libc/sysdeps/powerpc/fpu/s_cosf.c
new file mode 100644
index 000000000..8b8778a4a
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/s_cosf.c
@@ -0,0 +1,71 @@
+/* s_cosf.c -- float version of s_cos.c.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 "math.h"
+#include "math_private.h"
+
+static const float one = 1.0;
+static const float pio4 = 7.8539801e-1;
+
+float
+__cosf (float x)
+{
+ float y[2], z = 0.0;
+ float ix;
+ int32_t n;
+
+ ix = __builtin_fabsf (x);
+
+ /* |x| ~< pi/4 */
+ if (ix <= pio4)
+ {
+ return __kernel_cosf (x, z);
+ /* cos(Inf or NaN) is NaN */
+ }
+ else if (isnanf (ix))
+ {
+ return x - x;
+ }
+ else if (isinff (ix))
+ {
+ __set_errno (EDOM);
+ return x - x;
+ }
+
+ /* argument reduction needed */
+ else
+ {
+ n = __ieee754_rem_pio2f (x, y);
+ switch (n & 3)
+ {
+ case 0:
+ return __kernel_cosf (y[0], y[1]);
+ case 1:
+ return -__kernel_sinf (y[0], y[1], 1);
+ case 2:
+ return -__kernel_cosf (y[0], y[1]);
+ default:
+ return __kernel_sinf (y[0], y[1], 1);
+ }
+ }
+}
+
+weak_alias (__cosf, cosf)
diff --git a/libc/sysdeps/powerpc/fpu/s_float_bitwise.h b/libc/sysdeps/powerpc/fpu/s_float_bitwise.h
new file mode 100644
index 000000000..06b4f2a76
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/s_float_bitwise.h
@@ -0,0 +1,112 @@
+/* Bitwise manipulation over float. Function prototypes.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FLOAT_BITWISE_
+#define _FLOAT_BITWISE_ 1
+
+#include "math_private.h"
+
+/* Returns (int)(num & 0x7FFFFFF0 == value) */
+static inline
+int __float_and_test28 (float num, float value)
+{
+ float ret;
+#ifdef _ARCH_PWR7
+ vector int mask = (vector int) {
+ 0x7ffffffe, 0x00000000, 0x00000000, 0x0000000
+ };
+ __asm__ (
+ /* the 'f' constrain is use on mask because we just need
+ * to compare floats, not full vector */
+ "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
+ );
+#else
+ int32_t inum;
+ GET_FLOAT_WORD(inum, num);
+ inum = (inum & 0x7ffffff0);
+ SET_FLOAT_WORD(ret, inum);
+#endif
+ return (ret == value);
+}
+
+/* Returns (int)(num & 0x7FFFFF00 == value) */
+static inline
+int __float_and_test24 (float num, float value)
+{
+ float ret;
+#ifdef _ARCH_PWR7
+ vector int mask = (vector int) {
+ 0x7fffffe0, 0x00000000, 0x00000000, 0x0000000
+ };
+ __asm__ (
+ "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
+ );
+#else
+ int32_t inum;
+ GET_FLOAT_WORD(inum, num);
+ inum = (inum & 0x7fffff00);
+ SET_FLOAT_WORD(ret, inum);
+#endif
+ return (ret == value);
+}
+
+/* Returns (float)(num & 0x7F800000) */
+static inline
+float __float_and8 (float num)
+{
+ float ret;
+#ifdef _ARCH_PWR7
+ vector int mask = (vector int) {
+ 0x7ff00000, 0x00000000, 0x00000000, 0x00000000
+ };
+ __asm__ (
+ "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
+ );
+#else
+ int32_t inum;
+ GET_FLOAT_WORD(inum, num);
+ inum = (inum & 0x7f800000);
+ SET_FLOAT_WORD(ret, inum);
+#endif
+ return ret;
+}
+
+/* Returns ((int32_t)(num & 0x7F800000) >> 23) */
+static inline
+int32_t __float_get_exp (float num)
+{
+ int32_t inum;
+#ifdef _ARCH_PWR7
+ float ret;
+ vector int mask = (vector int) {
+ 0x7ff00000, 0x00000000, 0x00000000, 0x00000000
+ };
+ __asm__ (
+ "xxland %x0,%x1,%x2" : "=f" (ret) : "f" (num), "f" (mask)
+ );
+ GET_FLOAT_WORD(inum, ret);
+#else
+ GET_FLOAT_WORD(inum, num);
+ inum = inum & 0x7f800000;
+#endif
+ return inum >> 23;
+}
+
+#endif /* s_float_bitwise.h */
diff --git a/libc/sysdeps/powerpc/fpu/s_sinf.c b/libc/sysdeps/powerpc/fpu/s_sinf.c
new file mode 100644
index 000000000..dd724aaa8
--- /dev/null
+++ b/libc/sysdeps/powerpc/fpu/s_sinf.c
@@ -0,0 +1,70 @@
+/* s_sinf.c -- float version of s_sin.c.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011
+
+ 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 "math.h"
+#include "math_private.h"
+
+static const float pio4 = 7.8539801e-1;
+
+float
+__sinf (float x)
+{
+ float y[2], z = 0.0;
+ float ix;
+ int32_t n;
+
+ ix = __builtin_fabsf (x);
+
+ /* |x| ~< pi/4 */
+ if (ix <= pio4)
+ {
+ return __kernel_sinf (x, z, 0);
+ /* sin(Inf or NaN) is NaN */
+ }
+ else if (isnanf (ix))
+ {
+ return x - x;
+ }
+ else if (isinff (ix))
+ {
+ __set_errno (EDOM);
+ return x - x;
+ }
+
+ /* argument reduction needed */
+ else
+ {
+ n = __ieee754_rem_pio2f (x, y);
+ switch (n & 3)
+ {
+ case 0:
+ return __kernel_sinf (y[0], y[1], 1);
+ case 1:
+ return __kernel_cosf (y[0], y[1]);
+ case 2:
+ return -__kernel_sinf (y[0], y[1], 1);
+ default:
+ return -__kernel_cosf (y[0], y[1]);
+ }
+ }
+}
+
+weak_alias (__sinf, sinf)
diff --git a/libc/sysdeps/powerpc/powerpc32/Makefile b/libc/sysdeps/powerpc/powerpc32/Makefile
index 1d58a063d..ed24484c2 100644
--- a/libc/sysdeps/powerpc/powerpc32/Makefile
+++ b/libc/sysdeps/powerpc/powerpc32/Makefile
@@ -5,6 +5,11 @@ ifeq ($(with-fp),no)
sysdep-LDFLAGS += -msoft-float
endif
+ifeq ($(subdir),gmon)
+sysdep_routines += ppc-mcount
+static-only-routines += ppc-mcount
+endif
+
ifeq ($(subdir),misc)
sysdep_routines += gprsave0 gprrest0 gprsave1 gprrest1
endif
diff --git a/libc/sysdeps/powerpc/powerpc32/Versions b/libc/sysdeps/powerpc/powerpc32/Versions
index 3635c4a4a..ad4972e4d 100644
--- a/libc/sysdeps/powerpc/powerpc32/Versions
+++ b/libc/sysdeps/powerpc/powerpc32/Versions
@@ -8,6 +8,9 @@ libc {
__fixsfdi; __fixunssfdi;
__floatdidf; __floatdisf;
}
+ GLIBC_PRIVATE {
+ __mcount_internal;
+ }
}
libm {
diff --git a/libc/sysdeps/powerpc/powerpc32/dl-machine.h b/libc/sysdeps/powerpc/powerpc32/dl-machine.h
index 5351d9691..b24fee096 100644
--- a/libc/sysdeps/powerpc/powerpc32/dl-machine.h
+++ b/libc/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. PowerPC version.
- Copyright (C) 1995-2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003, 2005, 2006, 2011 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
@@ -135,7 +135,6 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,
/* We never want to use a PLT entry as the destination of a
reloc, when what is being relocated is a branch. This is
partly for efficiency, but mostly so we avoid loops. */
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
#define elf_machine_type_class(type) \
((((type) == R_PPC_JMP_SLOT \
|| (type) == R_PPC_REL24 \
@@ -143,13 +142,6 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,
&& (type) <= R_PPC_DTPREL32) \
|| (type) == R_PPC_ADDR24) * ELF_RTYPE_CLASS_PLT) \
| (((type) == R_PPC_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-#define elf_machine_type_class(type) \
- ((((type) == R_PPC_JMP_SLOT \
- || (type) == R_PPC_REL24 \
- || (type) == R_PPC_ADDR24) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_PPC_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_PPC_JMP_SLOT
@@ -280,7 +272,7 @@ extern void _dl_reloc_overflow (struct link_map *map,
auto inline void __attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const Elf32_Sym *const refsym = sym;
@@ -315,7 +307,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
/* A small amount of code is duplicated here for speed. In libc,
@@ -331,8 +324,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
*reloc_addr = value;
break;
-#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
- && !defined RESOLVE_CONFLICT_FIND_MAP
+#ifndef RESOLVE_CONFLICT_FIND_MAP
# ifdef RTLD_BOOTSTRAP
# define NOT_BOOTSTRAP 0
# else
@@ -391,7 +383,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void __attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
/* elf_machine_runtime_setup handles this. */
}
diff --git a/libc/sysdeps/powerpc/powerpc32/elf/configure b/libc/sysdeps/powerpc/powerpc32/elf/configure
index dfa577075..4bc50e0b0 100755
--- a/libc/sysdeps/powerpc/powerpc32/elf/configure
+++ b/libc/sysdeps/powerpc/powerpc32/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/powerpc32/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for powerpc32 TLS support" >&5
@@ -43,10 +42,8 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_powerpc32_tls" >&5
$as_echo "$libc_cv_powerpc32_tls" >&6; }
-if test $libc_cv_powerpc32_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_powerpc32_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
diff --git a/libc/sysdeps/powerpc/powerpc32/elf/configure.in b/libc/sysdeps/powerpc/powerpc32/elf/configure.in
index fbf41a498..e527b454c 100644
--- a/libc/sysdeps/powerpc/powerpc32/elf/configure.in
+++ b/libc/sysdeps/powerpc/powerpc32/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/powerpc32/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for powerpc32 TLS support, libc_cv_powerpc32_tls, [dnl
@@ -32,7 +31,6 @@ else
libc_cv_powerpc32_tls=no
fi
rm -f conftest*])
-if test $libc_cv_powerpc32_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_powerpc32_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S b/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S
index f0c332f1b..ec7055745 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC32/POWER7.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -116,24 +116,82 @@ L(copy_GE_32_aligned_cont):
stfd 6,0(3)
addi 10,3,8
+L(aligned_copy):
+ /* Main aligned copy loop. Copies up to 128-bytes at a time. */
.align 4
-4: /* Main aligned copy loop. Copies 32-bytes at a time. */
- lfd 6,0(11)
- lfd 7,8(11)
- lfd 8,16(11)
- lfd 0,24(11)
- addi 11,11,32
+4:
+ /* check for any 32-byte or 64-byte lumps that are outside of a
+ nice 128-byte range. R8 contains the number of 32-byte
+ lumps, so drop this into the CR, and use the SO/EQ bits to help
+ handle the 32- or 64- byte lumps. Then handle the rest with an
+ unrolled 128-bytes-at-a-time copy loop. */
+ mtocrf 1,8
+ li 6,16 # 16() index
+ li 7,32 # 32() index
+ li 8,48 # 48() index
+
+L(aligned_32byte):
+ /* if the SO bit (indicating a 32-byte lump) is not set, move along. */
+ bns cr7,L(aligned_64byte)
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ addi 11,11,32
+ stxvd2x 6,0,10
+ stxvd2x 7,10,6
+ addi 10,10,32
+
+L(aligned_64byte):
+ /* if the EQ bit (indicating a 64-byte lump) is not set, move along. */
+ bne cr7,L(aligned_128setup)
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ lxvd2x 8,11,7
+ lxvd2x 9,11,8
+ addi 11,11,64
+ stxvd2x 6,0,10
+ stxvd2x 7,10,6
+ stxvd2x 8,10,7
+ stxvd2x 9,10,8
+ addi 10,10,64
+
+L(aligned_128setup):
+ /* Set up for the 128-byte at a time copy loop. */
+ srwi 8,31,7
+ cmpwi 8,0 # Any 4x lumps left?
+ beq 3f # if not, move along.
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ mtctr 8 # otherwise, load the ctr and begin.
+ li 8,48 # 48() index
+ b L(aligned_128loop)
+
+L(aligned_128head):
+ /* for the 2nd + iteration of this loop. */
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+L(aligned_128loop):
+ lxvd2x 8,11,7
+ lxvd2x 9,11,8
+ stxvd2x 6,0,10
+ addi 11,11,64
+ stxvd2x 7,10,6
+ stxvd2x 8,10,7
+ stxvd2x 9,10,8
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ addi 10,10,64
+ lxvd2x 8,11,7
+ lxvd2x 9,11,8
+ addi 11,11,64
+ stxvd2x 6,0,10
+ stxvd2x 7,10,6
+ stxvd2x 8,10,7
+ stxvd2x 9,10,8
+ addi 10,10,64
+ bdnz L(aligned_128head)
- stfd 6,0(10)
- stfd 7,8(10)
- stfd 8,16(10)
- stfd 0,24(10)
- addi 10,10,32
- bdnz 4b
3:
-
/* Check for tail bytes. */
-
clrrwi 0,31,3
mtcrf 0x01,31
beq cr6,0f
diff --git a/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S b/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
index 6a1422a7c..bcd13b6fa 100644
--- a/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc32/power7/strncmp.S
@@ -27,7 +27,7 @@
const char *s2 [r4],
size_t size [r5]) */
-EALIGN (BP_SYM(strncmp),4,0)
+EALIGN (BP_SYM(strncmp),5,0)
#define rTMP r0
#define rRTN r3
@@ -47,9 +47,11 @@ EALIGN (BP_SYM(strncmp),4,0)
#define rBITDIF r11 /* bits that differ in s1 & s2 words */
dcbt 0,rSTR1
+ nop
or rTMP,rSTR2,rSTR1
lis r7F7F,0x7f7f
dcbt 0,rSTR2
+ nop
clrlwi. rTMP,rTMP,30
cmplwi cr1,rN,0
lis rFEFE,-0x101
diff --git a/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S b/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
index 7e39acb55..c7720a15b 100644
--- a/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
+++ b/libc/sysdeps/powerpc/powerpc32/ppc-mcount.S
@@ -58,8 +58,7 @@ ENTRY(_mcount)
stw r4, 44(r1)
cfi_offset (lr, -4)
stw r5, 8(r1)
- bl __mcount_internal@local
- nop
+ bl JUMPTARGET(__mcount_internal)
/* Restore the registers... */
lwz r6, 8(r1)
lwz r0, 44(r1)
diff --git a/libc/sysdeps/powerpc/powerpc64/Makefile b/libc/sysdeps/powerpc/powerpc64/Makefile
index 136de3008..9056e60c4 100644
--- a/libc/sysdeps/powerpc/powerpc64/Makefile
+++ b/libc/sysdeps/powerpc/powerpc64/Makefile
@@ -45,4 +45,5 @@ ifeq ($(subdir),gmon)
# Compiling with -msoft-float ensures that fp regs are not used
# for moving memory around.
CFLAGS-mcount.c += $(no-special-regs)
+sysdep_routines += ppc-mcount
endif
diff --git a/libc/sysdeps/powerpc/powerpc64/dl-machine.h b/libc/sysdeps/powerpc/powerpc64/dl-machine.h
index 901a44e4b..f4265bb15 100644
--- a/libc/sysdeps/powerpc/powerpc64/dl-machine.h
+++ b/libc/sysdeps/powerpc/powerpc64/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions.
PowerPC64 version.
- Copyright 1995-2005, 2006, 2008, 2010 Free Software Foundation, Inc.
+ Copyright 1995-2005, 2006, 2008, 2010, 2011 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
@@ -376,9 +376,9 @@ elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
branch using two instructions; Past that point,
glink uses three instructions. */
if (i < 0x8000)
- glink_offset += 2;
+ glink_offset += 2;
else
- glink_offset += 3;
+ glink_offset += 3;
}
/* Now, we've modified data. We need to write the changes from
@@ -492,10 +492,10 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
#define dont_expect(X) __builtin_expect ((X), 0)
extern void _dl_reloc_overflow (struct link_map *map,
- const char *name,
- Elf64_Addr *const reloc_addr,
- const Elf64_Sym *refsym)
- attribute_hidden;
+ const char *name,
+ Elf64_Addr *const reloc_addr,
+ const Elf64_Sym *refsym)
+ attribute_hidden;
auto inline void __attribute__ ((always_inline))
elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
@@ -505,7 +505,6 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
*reloc_addr = l_addr + reloc->r_addend;
}
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
/* This computes the value used by TPREL* relocs. */
auto inline Elf64_Addr __attribute__ ((always_inline, const))
elf_machine_tprel (struct link_map *map,
@@ -513,18 +512,17 @@ elf_machine_tprel (struct link_map *map,
const Elf64_Sym *sym,
const Elf64_Rela *reloc)
{
-# ifndef RTLD_BOOTSTRAP
+#ifndef RTLD_BOOTSTRAP
if (sym_map)
{
CHECK_STATIC_TLS (map, sym_map);
-# endif
+#endif
return TLS_TPREL_VALUE (sym_map, sym, reloc);
-# ifndef RTLD_BOOTSTRAP
+#ifndef RTLD_BOOTSTRAP
}
-# endif
+#endif
return 0;
}
-#endif
/* Call function at address VALUE (an OPD entry) to resolve ifunc relocs. */
auto inline Elf64_Addr __attribute__ ((always_inline))
@@ -558,13 +556,12 @@ elf_machine_rela (struct link_map *map,
const Elf64_Rela *reloc,
const Elf64_Sym *sym,
const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const int r_type = ELF64_R_TYPE (reloc->r_info);
-#ifndef RTLD_BOOTSTRAP
const Elf64_Sym *const refsym = sym;
-#endif
if (r_type == R_PPC64_RELATIVE)
{
@@ -583,7 +580,8 @@ elf_machine_rela (struct link_map *map,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = resolve_ifunc (value, map, sym_map);
/* For relocs that don't edit code, return.
@@ -596,12 +594,14 @@ elf_machine_rela (struct link_map *map,
return;
case R_PPC64_IRELATIVE:
- value = resolve_ifunc (value, map, sym_map);
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = resolve_ifunc (value, map, sym_map);
*reloc_addr = value;
return;
case R_PPC64_JMP_IREL:
- value = resolve_ifunc (value, map, sym_map);
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = resolve_ifunc (value, map, sym_map);
/* Fall thru */
case R_PPC64_JMP_SLOT:
#ifdef RESOLVE_CONFLICT_FIND_MAP
@@ -611,26 +611,25 @@ elf_machine_rela (struct link_map *map,
#endif
return;
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
case R_PPC64_DTPMOD64:
-# ifdef RTLD_BOOTSTRAP
+#ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always index 1. */
*reloc_addr = 1;
-# else
+#else
/* Get the information from the link map returned by the
resolve function. */
if (sym_map != NULL)
- *reloc_addr = sym_map->l_tls_modid;
-# endif
+ *reloc_addr = sym_map->l_tls_modid;
+#endif
return;
case R_PPC64_DTPREL64:
/* During relocation all TLS symbols are defined and used.
- Therefore the offset is already correct. */
-# ifndef RTLD_BOOTSTRAP
+ Therefore the offset is already correct. */
+#ifndef RTLD_BOOTSTRAP
if (sym_map != NULL)
*reloc_addr = TLS_DTPREL_VALUE (sym, reloc);
-# endif
+#endif
return;
case R_PPC64_TPREL64:
@@ -640,21 +639,21 @@ elf_machine_rela (struct link_map *map,
case R_PPC64_TPREL16_LO_DS:
value = elf_machine_tprel (map, sym_map, sym, reloc);
if (dont_expect ((value & 3) != 0))
- _dl_reloc_overflow (map, "R_PPC64_TPREL16_LO_DS", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_TPREL16_LO_DS", reloc_addr, refsym);
BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc);
break;
case R_PPC64_TPREL16_DS:
value = elf_machine_tprel (map, sym_map, sym, reloc);
if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0))
- _dl_reloc_overflow (map, "R_PPC64_TPREL16_DS", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_TPREL16_DS", reloc_addr, refsym);
BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc);
break;
case R_PPC64_TPREL16:
value = elf_machine_tprel (map, sym_map, sym, reloc);
if (dont_expect ((value + 0x8000) >= 0x10000))
- _dl_reloc_overflow (map, "R_PPC64_TPREL16", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_TPREL16", reloc_addr, refsym);
*(Elf64_Half *) reloc_addr = PPC_LO (value);
break;
@@ -692,12 +691,11 @@ elf_machine_rela (struct link_map *map,
value = elf_machine_tprel (map, sym_map, sym, reloc);
*(Elf64_Half *) reloc_addr = PPC_HIGHESTA (value);
break;
-#endif
#ifndef RTLD_BOOTSTRAP /* None of the following appear in ld.so */
case R_PPC64_ADDR16_LO_DS:
if (dont_expect ((value & 3) != 0))
- _dl_reloc_overflow (map, "R_PPC64_ADDR16_LO_DS", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_ADDR16_LO_DS", reloc_addr, refsym);
BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc);
break;
@@ -715,29 +713,29 @@ elf_machine_rela (struct link_map *map,
case R_PPC64_ADDR30:
{
- Elf64_Addr delta = value - (Elf64_Xword) reloc_addr;
- if (dont_expect ((delta + 0x80000000) >= 0x10000000
+ Elf64_Addr delta = value - (Elf64_Xword) reloc_addr;
+ if (dont_expect ((delta + 0x80000000) >= 0x10000000
|| (delta & 3) != 0))
- _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym);
- BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc);
+ _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym);
+ BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc);
}
break;
case R_PPC64_COPY:
if (dont_expect (sym == NULL))
/* This can happen in trace mode when an object could not be found. */
- return;
+ return;
if (dont_expect (sym->st_size > refsym->st_size
|| (GLRO(dl_verbose)
&& sym->st_size < refsym->st_size)))
{
- const char *strtab;
+ const char *strtab;
- strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
- _dl_error_printf ("%s: Symbol `%s' has different size" \
- " in shared object," \
- " consider re-linking\n",
- _dl_argv[0] ?: "<program name unknown>",
+ strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+ _dl_error_printf ("%s: Symbol `%s' has different size" \
+ " in shared object," \
+ " consider re-linking\n",
+ _dl_argv[0] ?: "<program name unknown>",
strtab + refsym->st_name);
}
memcpy (reloc_addr_arg, (char *) value,
@@ -766,25 +764,25 @@ elf_machine_rela (struct link_map *map,
case R_PPC64_ADDR32:
if (dont_expect ((value + 0x80000000) >= 0x10000000))
- _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym);
*(Elf64_Word *) reloc_addr = value;
return;
case R_PPC64_ADDR24:
if (dont_expect ((value + 0x2000000) >= 0x4000000 || (value & 3) != 0))
- _dl_reloc_overflow (map, "R_PPC64_ADDR24", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_ADDR24", reloc_addr, refsym);
BIT_INSERT (*(Elf64_Word *) reloc_addr, value, 0x3fffffc);
break;
case R_PPC64_ADDR16:
if (dont_expect ((value + 0x8000) >= 0x10000))
- _dl_reloc_overflow (map, "R_PPC64_ADDR16", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_ADDR16", reloc_addr, refsym);
*(Elf64_Half *) reloc_addr = value;
break;
case R_PPC64_UADDR16:
if (dont_expect ((value + 0x8000) >= 0x10000))
- _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym);
/* We are big-endian. */
((char *) reloc_addr_arg)[0] = (value >> 8) & 0xff;
((char *) reloc_addr_arg)[1] = (value >> 0) & 0xff;
@@ -792,7 +790,7 @@ elf_machine_rela (struct link_map *map,
case R_PPC64_ADDR16_DS:
if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0))
- _dl_reloc_overflow (map, "R_PPC64_ADDR16_DS", reloc_addr, refsym);
+ _dl_reloc_overflow (map, "R_PPC64_ADDR16_DS", reloc_addr, refsym);
BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc);
break;
@@ -816,11 +814,11 @@ elf_machine_rela (struct link_map *map,
case R_PPC64_ADDR14_BRTAKEN:
case R_PPC64_ADDR14_BRNTAKEN:
{
- if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0))
+ if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0))
_dl_reloc_overflow (map, "R_PPC64_ADDR14", reloc_addr, refsym);
- Elf64_Word insn = *(Elf64_Word *) reloc_addr;
- BIT_INSERT (insn, value, 0xfffc);
- if (r_type != R_PPC64_ADDR14)
+ Elf64_Word insn = *(Elf64_Word *) reloc_addr;
+ BIT_INSERT (insn, value, 0xfffc);
+ if (r_type != R_PPC64_ADDR14)
{
insn &= ~(1 << 21);
if (r_type == R_PPC64_ADDR14_BRTAKEN)
@@ -830,7 +828,7 @@ elf_machine_rela (struct link_map *map,
else if ((insn & (0x14 << 21)) == (0x10 << 21))
insn |= 0x08 << 21;
}
- *(Elf64_Word *) reloc_addr = insn;
+ *(Elf64_Word *) reloc_addr = insn;
}
break;
@@ -852,7 +850,8 @@ elf_machine_rela (struct link_map *map,
auto inline void __attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
/* elf_machine_runtime_setup handles this. */
}
diff --git a/libc/sysdeps/powerpc/powerpc64/elf/configure b/libc/sysdeps/powerpc/powerpc64/elf/configure
index 6ca1510a2..0e5893fe0 100644
--- a/libc/sysdeps/powerpc/powerpc64/elf/configure
+++ b/libc/sysdeps/powerpc/powerpc64/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/powerpc64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for powerpc64 TLS support" >&5
@@ -10,43 +9,43 @@ if test "${libc_cv_powerpc64_tls+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
+ .section ".tdata","awT",@progbits
x: .quad 1
x1: .quad 1
x2: .quad 1
x3: .quad 1
x4: .long 1
- .section ".toc","aw"
+ .section ".toc","aw"
.LC0:
- .quad x@dtpmod
- .quad x@dtprel
+ .quad x@dtpmod
+ .quad x@dtprel
.LC1:
- .quad x1@dtpmod
- .quad 0
+ .quad x1@dtpmod
+ .quad 0
.LC2:
.quad x@tprel
- .text
- addi 3,2,x@got@tlsgd
- addi 3,2,.LC0@toc
- addi 3,2,x1@got@tlsld
- addi 9,3,x1@dtprel
- addis 9,3,x2@dtprel@ha
- addi 9,9,x2@dtprel@l
- ld 9,x3@got@dtprel(2)
- addi 3,2,.LC0@toc
- lwz 0,x1@dtprel(3)
- ld 0,x1@dtprel(3)
- addis 9,3,x2@dtprel@ha
- lwz 0,x2@dtprel@l(9)
- ld 0,x2@dtprel@l(9)
- ld 9,x3@got@dtprel(2)
- ld 9,x@got@tprel(2)
- add 9,9,x@tls
- ld 9,.LC2@toc(2)
- add 9,9,.LC2@tls
- addi 9,13,x1@tprel
- addis 9,13,x2@tprel@ha
- addi 9,9,x2@tprel@l
+ .text
+ addi 3,2,x@got@tlsgd
+ addi 3,2,.LC0@toc
+ addi 3,2,x1@got@tlsld
+ addi 9,3,x1@dtprel
+ addis 9,3,x2@dtprel@ha
+ addi 9,9,x2@dtprel@l
+ ld 9,x3@got@dtprel(2)
+ addi 3,2,.LC0@toc
+ lwz 0,x1@dtprel(3)
+ ld 0,x1@dtprel(3)
+ addis 9,3,x2@dtprel@ha
+ lwz 0,x2@dtprel@l(9)
+ ld 0,x2@dtprel@l(9)
+ ld 9,x3@got@dtprel(2)
+ ld 9,x@got@tprel(2)
+ add 9,9,x@tls
+ ld 9,.LC2@toc(2)
+ add 9,9,.LC2@tls
+ addi 9,13,x1@tprel
+ addis 9,13,x2@tprel@ha
+ addi 9,9,x2@tprel@l
EOF
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
@@ -62,11 +61,8 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_powerpc64_tls" >&5
$as_echo "$libc_cv_powerpc64_tls" >&6; }
-if test $libc_cv_powerpc64_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_powerpc64_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
-
diff --git a/libc/sysdeps/powerpc/powerpc64/elf/configure.in b/libc/sysdeps/powerpc/powerpc64/elf/configure.in
index 5466367cf..9a375c66a 100644
--- a/libc/sysdeps/powerpc/powerpc64/elf/configure.in
+++ b/libc/sysdeps/powerpc/powerpc64/elf/configure.in
@@ -1,48 +1,47 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/powerpc64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for powerpc64 TLS support, libc_cv_powerpc64_tls, [dnl
cat > conftest.s <<\EOF
- .section ".tdata","awT",@progbits
+ .section ".tdata","awT",@progbits
x: .quad 1
x1: .quad 1
x2: .quad 1
x3: .quad 1
x4: .long 1
- .section ".toc","aw"
+ .section ".toc","aw"
.LC0:
- .quad x@dtpmod
- .quad x@dtprel
+ .quad x@dtpmod
+ .quad x@dtprel
.LC1:
- .quad x1@dtpmod
- .quad 0
+ .quad x1@dtpmod
+ .quad 0
.LC2:
.quad x@tprel
- .text
- addi 3,2,x@got@tlsgd
- addi 3,2,.LC0@toc
- addi 3,2,x1@got@tlsld
- addi 9,3,x1@dtprel
- addis 9,3,x2@dtprel@ha
- addi 9,9,x2@dtprel@l
- ld 9,x3@got@dtprel(2)
- addi 3,2,.LC0@toc
- lwz 0,x1@dtprel(3)
- ld 0,x1@dtprel(3)
- addis 9,3,x2@dtprel@ha
- lwz 0,x2@dtprel@l(9)
- ld 0,x2@dtprel@l(9)
- ld 9,x3@got@dtprel(2)
- ld 9,x@got@tprel(2)
- add 9,9,x@tls
- ld 9,.LC2@toc(2)
- add 9,9,.LC2@tls
- addi 9,13,x1@tprel
- addis 9,13,x2@tprel@ha
- addi 9,9,x2@tprel@l
+ .text
+ addi 3,2,x@got@tlsgd
+ addi 3,2,.LC0@toc
+ addi 3,2,x1@got@tlsld
+ addi 9,3,x1@dtprel
+ addis 9,3,x2@dtprel@ha
+ addi 9,9,x2@dtprel@l
+ ld 9,x3@got@dtprel(2)
+ addi 3,2,.LC0@toc
+ lwz 0,x1@dtprel(3)
+ ld 0,x1@dtprel(3)
+ addis 9,3,x2@dtprel@ha
+ lwz 0,x2@dtprel@l(9)
+ ld 0,x2@dtprel@l(9)
+ ld 9,x3@got@dtprel(2)
+ ld 9,x@got@tprel(2)
+ add 9,9,x@tls
+ ld 9,.LC2@toc(2)
+ add 9,9,.LC2@tls
+ addi 9,13,x1@tprel
+ addis 9,13,x2@tprel@ha
+ addi 9,9,x2@tprel@l
EOF
dnl
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
@@ -51,8 +50,6 @@ else
libc_cv_powerpc64_tls=no
fi
rm -f conftest*])
-if test $libc_cv_powerpc64_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
+if test $libc_cv_powerpc64_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
-fi
-
diff --git a/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c b/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
index 0a229cbe2..314abba3b 100644
--- a/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
+++ b/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
/* Double-precision floating point square root.
- Copyright (C) 1997, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2002-2004, 2006, 2011 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
@@ -27,3 +27,4 @@ __ieee754_sqrt (double x)
__asm __volatile ("fsqrt %0,%1" : "=f" (z) : "f" (x));
return z;
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c b/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
index 0f17a64a8..715721439 100644
--- a/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
+++ b/libc/sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
/* Single-precision floating point square root.
- Copyright (C) 1997, 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2003, 2004, 2006, 2011 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
@@ -27,3 +27,4 @@ __ieee754_sqrtf (float x)
__asm ("fsqrts %0,%1" : "=f" (z) : "f" (x));
return z;
}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/memcpy.S b/libc/sysdeps/powerpc/powerpc64/power7/memcpy.S
index 2e5beed15..8aaef9744 100644
--- a/libc/sysdeps/powerpc/powerpc64/power7/memcpy.S
+++ b/libc/sysdeps/powerpc/powerpc64/power7/memcpy.S
@@ -1,5 +1,5 @@
/* Optimized memcpy implementation for PowerPC64/POWER7.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Luis Machado <luisgpm@br.ibm.com>.
This file is part of the GNU C Library.
@@ -115,23 +115,81 @@ L(copy_GE_32_aligned_cont):
std 6,0(3)
addi 10,3,8
- /* Main aligned copy loop. Copies 32-bytes at a time. */
+L(aligned_copy):
+ /* Main aligned copy loop. Copies up to 128-bytes at a time. */
.align 4
4:
- ld 6,0(11)
- ld 7,8(11)
- ld 8,16(11)
- ld 0,24(11)
- addi 11,11,32
+ /* check for any 32-byte or 64-byte lumps that are outside of a
+ nice 128-byte range. R8 contains the number of 32-byte
+ lumps, so drop this into the CR, and use the SO/EQ bits to help
+ handle the 32- or 64- byte lumps. Then handle the rest with an
+ unrolled 128-bytes-at-a-time copy loop. */
+ mtocrf 1,8
+ li 6,16 # 16() index
+ li 7,32 # 32() index
+ li 8,48 # 48() index
+
+L(aligned_32byte):
+ /* if the SO bit (indicating a 32-byte lump) is not set, move along. */
+ bns cr7,L(aligned_64byte)
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ addi 11,11,32
+ stxvd2x 6,0,10
+ stxvd2x 7,10,6
+ addi 10,10,32
+
+L(aligned_64byte):
+ /* if the EQ bit (indicating a 64-byte lump) is not set, move along. */
+ bne cr7,L(aligned_128setup)
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ lxvd2x 8,11,7
+ lxvd2x 9,11,8
+ addi 11,11,64
+ stxvd2x 6,0,10
+ stxvd2x 7,10,6
+ stxvd2x 8,10,7
+ stxvd2x 9,10,8
+ addi 10,10,64
+
+L(aligned_128setup):
+ /* Set up for the 128-byte at a time copy loop. */
+ srdi 8,31,7
+ cmpdi 8,0 # Any 4x lumps left?
+ beq 3f # if not, move along.
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ mtctr 8 # otherwise, load the ctr and begin.
+ li 8,48 # 48() index
+ b L(aligned_128loop)
+
+L(aligned_128head):
+ /* for the 2nd + iteration of this loop. */
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+L(aligned_128loop):
+ lxvd2x 8,11,7
+ lxvd2x 9,11,8
+ stxvd2x 6,0,10
+ addi 11,11,64
+ stxvd2x 7,10,6
+ stxvd2x 8,10,7
+ stxvd2x 9,10,8
+ lxvd2x 6,0,11
+ lxvd2x 7,11,6
+ addi 10,10,64
+ lxvd2x 8,11,7
+ lxvd2x 9,11,8
+ addi 11,11,64
+ stxvd2x 6,0,10
+ stxvd2x 7,10,6
+ stxvd2x 8,10,7
+ stxvd2x 9,10,8
+ addi 10,10,64
+ bdnz L(aligned_128head)
- std 6,0(10)
- std 7,8(10)
- std 8,16(10)
- std 0,24(10)
- addi 10,10,32
- bdnz 4b
3:
-
/* Check for tail bytes. */
rldicr 0,31,0,60
mtcrf 0x01,31
diff --git a/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S b/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S
index 498b19c71..4c02b115a 100644
--- a/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S
+++ b/libc/sysdeps/powerpc/powerpc64/power7/strncmp.S
@@ -27,7 +27,7 @@
const char *s2 [r4],
size_t size [r5]) */
-EALIGN (BP_SYM(strncmp),4,0)
+EALIGN (BP_SYM(strncmp),5,0)
CALL_MCOUNT 3
#define rTMP r0
@@ -48,9 +48,11 @@ EALIGN (BP_SYM(strncmp),4,0)
#define rBITDIF r11 /* bits that differ in s1 & s2 words */
dcbt 0,rSTR1
+ nop
or rTMP,rSTR2,rSTR1
lis r7F7F,0x7f7f
dcbt 0,rSTR2
+ nop
clrldi. rTMP,rTMP,61
cmpldi cr1,rN,0
lis rFEFE,-0x101
diff --git a/libc/sysdeps/s390/fpu/e_sqrt.c b/libc/sysdeps/s390/fpu/e_sqrt.c
index e4b183e4c..affd3a1a5 100644
--- a/libc/sysdeps/s390/fpu/e_sqrt.c
+++ b/libc/sysdeps/s390/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
+/* Copyright (C) 2004, 2011 Free Software Foundation, Inc.
+ Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,3 +27,4 @@ __ieee754_sqrt (double x)
asm ( "sqdbr %0,%1" : "=f" (res) : "f" (x) );
return res;
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/libc/sysdeps/s390/fpu/e_sqrtf.c b/libc/sysdeps/s390/fpu/e_sqrtf.c
index 5b5e06e8a..4272f059d 100644
--- a/libc/sysdeps/s390/fpu/e_sqrtf.c
+++ b/libc/sysdeps/s390/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
+/* Copyright (C) 2004, 2011 Free Software Foundation, Inc.
+ Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,3 +27,4 @@ __ieee754_sqrtf (float x)
asm ( "sqebr %0,%1" : "=f" (res) : "f" (x) );
return res;
}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/libc/sysdeps/s390/fpu/e_sqrtl.c b/libc/sysdeps/s390/fpu/e_sqrtl.c
index e1daac197..45d0a0e67 100644
--- a/libc/sysdeps/s390/fpu/e_sqrtl.c
+++ b/libc/sysdeps/s390/fpu/e_sqrtl.c
@@ -1,6 +1,6 @@
/* Square root. S/390 FPU version.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
+ Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
+ Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,3 +28,4 @@ __ieee754_sqrtl (long double x)
asm ( "sqxbr %0,%1" : "=f" (res) : "f" (x) );
return res;
}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/libc/sysdeps/s390/fpu/libm-test-ulps b/libc/sysdeps/s390/fpu/libm-test-ulps
index 989722e65..a014bafd4 100644
--- a/libc/sysdeps/s390/fpu/libm-test-ulps
+++ b/libc/sysdeps/s390/fpu/libm-test-ulps
@@ -647,8 +647,15 @@ ifloat: 3
ildouble: 2
ldouble: 2
Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+double: 1
float: 4
+idouble: 1
ifloat: 4
+Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
double: 1
float: 1
@@ -671,6 +678,37 @@ double: 1
float: 2
idouble: 1
ifloat: 2
+Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813":
+double: 3
+idouble: 3
+Test "jn (4, 2.4048255576957729) == 0.647466661641779720084932282551219891E-1":
+double: 1
+idouble: 1
+Test "jn (5, 2.4048255576957729) == 0.163892432048058525099230549946147698E-1":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+Test "jn (6, 2.4048255576957729) == 0.34048184720278336646673682895929161E-2":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+Test "jn (7, 2.4048255576957729) == 0.60068836573295394221291569249883076E-3":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+Test "jn (8, 2.4048255576957729) == 0.92165786705344923232879022467054148E-4":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
# lgamma
Test "lgamma (-0.5) == log(2*sqrt(pi))":
@@ -1245,9 +1283,9 @@ ldouble: 4
Function: "jn":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 4
ldouble: 4
diff --git a/libc/sysdeps/s390/s390-32/dl-machine.h b/libc/sysdeps/s390/s390-32/dl-machine.h
index 415b38801..ea7c6a68b 100644
--- a/libc/sysdeps/s390/s390-32/dl-machine.h
+++ b/libc/sysdeps/s390/s390-32/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. S390 Version.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2011
Free Software Foundation, Inc.
Contributed by Carl Pederson & Martin Schwidefsky.
This file is part of the GNU C Library.
@@ -43,7 +43,7 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
return 0;
return (ehdr->e_machine == EM_S390 || ehdr->e_machine == EM_S390_OLD)
- && ehdr->e_ident[EI_CLASS] == ELFCLASS32;
+ && ehdr->e_ident[EI_CLASS] == ELFCLASS32;
}
@@ -275,7 +275,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -316,8 +316,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
*reloc_addr = value + reloc->r_addend;
break;
-#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
- && !defined RESOLVE_CONFLICT_FIND_MAP
+#ifndef RESOLVE_CONFLICT_FIND_MAP
case R_390_TLS_DTPMOD:
# ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always the module
@@ -434,7 +433,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
diff --git a/libc/sysdeps/s390/s390-32/elf/configure b/libc/sysdeps/s390/s390-32/elf/configure
index 72abdbdd7..fa25a0080 100644
--- a/libc/sysdeps/s390/s390-32/elf/configure
+++ b/libc/sysdeps/s390/s390-32/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/s390/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for s390 TLS support" >&5
@@ -38,12 +37,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_390_tls" >&5
$as_echo "$libc_cv_390_tls" >&6; }
-if test $libc_cv_390_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_390_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
cat >>confdefs.h <<\_ACEOF
diff --git a/libc/sysdeps/s390/s390-32/elf/configure.in b/libc/sysdeps/s390/s390-32/elf/configure.in
index fcf932999..d1f40a375 100644
--- a/libc/sysdeps/s390/s390-32/elf/configure.in
+++ b/libc/sysdeps/s390/s390-32/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/s390/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for s390 TLS support, libc_cv_390_tls, [dnl
@@ -27,9 +26,8 @@ else
libc_cv_390_tls=no
fi
rm -f conftest*])
-if test $libc_cv_390_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_390_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl It is always possible to access static and hidden symbols in an
diff --git a/libc/sysdeps/s390/s390-64/dl-machine.h b/libc/sysdeps/s390/s390-64/dl-machine.h
index c4df274cd..68015a7a0 100644
--- a/libc/sysdeps/s390/s390-64/dl-machine.h
+++ b/libc/sysdeps/s390/s390-64/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions.
64 bit S/390 Version.
- Copyright (C) 2001-2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2005, 2006, 2011 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -247,7 +247,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const Elf64_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -288,8 +288,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
*reloc_addr = value + reloc->r_addend;
break;
-#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
- && !defined RESOLVE_CONFLICT_FIND_MAP
+#ifndef RESOLVE_CONFLICT_FIND_MAP
case R_390_TLS_DTPMOD:
# ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always the module
@@ -413,7 +412,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
diff --git a/libc/sysdeps/s390/s390-64/elf/configure b/libc/sysdeps/s390/s390-64/elf/configure
index 3851674c7..db3caea59 100644
--- a/libc/sysdeps/s390/s390-64/elf/configure
+++ b/libc/sysdeps/s390/s390-64/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/s390/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for s390 TLS support" >&5
@@ -38,12 +37,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_390_tls" >&5
$as_echo "$libc_cv_390_tls" >&6; }
-if test $libc_cv_390_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_390_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
cat >>confdefs.h <<\_ACEOF
diff --git a/libc/sysdeps/s390/s390-64/elf/configure.in b/libc/sysdeps/s390/s390-64/elf/configure.in
index ac953fcff..007e3838a 100644
--- a/libc/sysdeps/s390/s390-64/elf/configure.in
+++ b/libc/sysdeps/s390/s390-64/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/s390/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for s390 TLS support, libc_cv_390_tls, [dnl
@@ -27,9 +26,8 @@ else
libc_cv_390_tls=no
fi
rm -f conftest*])
-if test $libc_cv_390_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_390_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl It is always possible to access static and hidden symbols in an
diff --git a/libc/sysdeps/sh/dl-machine.h b/libc/sysdeps/sh/dl-machine.h
index 78f70e388..e02f47cb0 100644
--- a/libc/sysdeps/sh/dl-machine.h
+++ b/libc/sysdeps/sh/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. SH version.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -208,17 +208,11 @@ __fpscr_values:\n\
define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
-# define elf_machine_type_class(type) \
+#define elf_machine_type_class(type) \
((((type) == R_SH_JMP_SLOT || (type) == R_SH_TLS_DTPMOD32 \
|| (type) == R_SH_TLS_DTPOFF32 || (type) == R_SH_TLS_TPOFF32) \
* ELF_RTYPE_CLASS_PLT) \
| (((type) == R_SH_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-#define elf_machine_type_class(type) \
- ((((type) == R_SH_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_SH_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_SH_JMP_SLOT
@@ -268,7 +262,7 @@ auto inline void
__attribute ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -354,35 +348,34 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
/* These addresses are always aligned. */
*reloc_addr = value;
break;
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
/* XXX Remove TLS relocations which are not needed. */
case R_SH_TLS_DTPMOD32:
-# ifdef RTLD_BOOTSTRAP
+#ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always the module
with index 1.
XXX If this relocation is necessary move before RESOLVE
call. */
*reloc_addr = 1;
-# else
+#else
/* Get the information from the link map returned by the
resolv function. */
if (sym_map != NULL)
*reloc_addr = sym_map->l_tls_modid;
-# endif
+#endif
break;
case R_SH_TLS_DTPOFF32:
-# ifndef RTLD_BOOTSTRAP
+#ifndef RTLD_BOOTSTRAP
/* During relocation all TLS symbols are defined and used.
Therefore the offset is already correct. */
if (sym != NULL)
*reloc_addr = sym->st_value;
-# endif
+#endif
break;
case R_SH_TLS_TPOFF32:
/* The offset is positive, afterward from the thread pointer. */
-# ifdef RTLD_BOOTSTRAP
+#ifdef RTLD_BOOTSTRAP
*reloc_addr = map->l_tls_offset + sym->st_value + reloc->r_addend;
-# else
+#else
/* We know the offset of object the symbol is contained in.
It is a positive value which will be added to the thread
pointer. To get the variable position in the TLS block
@@ -393,9 +386,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
*reloc_addr = sym_map->l_tls_offset + sym->st_value
+ reloc->r_addend;
}
-# endif
+#endif
break;
-#endif /* use TLS */
case R_SH_DIR32:
{
#ifndef RTLD_BOOTSTRAP
@@ -454,7 +446,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
/* Check for unexpected PLT reloc type. */
diff --git a/libc/sysdeps/sh/elf/configure b/libc/sysdeps/sh/elf/configure
index 95efaca49..112635bba 100644
--- a/libc/sysdeps/sh/elf/configure
+++ b/libc/sysdeps/sh/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/sh/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for SH TLS support" >&5
@@ -33,12 +32,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_sh_tls" >&5
$as_echo "$libc_cv_sh_tls" >&6; }
-if test $libc_cv_sh_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_sh_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
cat >>confdefs.h <<\_ACEOF
diff --git a/libc/sysdeps/sh/elf/configure.in b/libc/sysdeps/sh/elf/configure.in
index 42aca3f8e..9c41a24f4 100644
--- a/libc/sysdeps/sh/elf/configure.in
+++ b/libc/sysdeps/sh/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/sh/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for SH TLS support, libc_cv_sh_tls, [dnl
@@ -22,9 +21,8 @@ else
libc_cv_sh_tls=no
fi
rm -f conftest*])
-if test $libc_cv_sh_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_sh_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl It is always possible to access static and hidden symbols in an
diff --git a/libc/sysdeps/sparc/sparc32/Makefile b/libc/sysdeps/sparc/sparc32/Makefile
index 6529ad897..c5245f2a9 100644
--- a/libc/sysdeps/sparc/sparc32/Makefile
+++ b/libc/sysdeps/sparc/sparc32/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991,92,93,94,95,96,97,98,2000 Free Software Foundation, Inc.
+# Copyright (C) 1991-1998, 2000, 2011 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
@@ -50,8 +50,5 @@ $(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S): $(sysdep_dir)/sparc/sparc32/divrem.
# Make it unwritable so noone will edit it by mistake.
-chmod a-w $@-tmp
mv -f $@-tmp $@
-ifeq ($(with-cvs),yes)
- test ! -d CVS || cvs commit -m'Regenerated from $<' $@
-endif
sysdep-realclean := $(sysdep-realclean) $(divrem:%=sysdeps/sparc/sparc32/%.S)
diff --git a/libc/sysdeps/sparc/sparc32/dl-machine.h b/libc/sysdeps/sparc/sparc32/dl-machine.h
index f2bc94a07..0ef5d2850 100644
--- a/libc/sysdeps/sparc/sparc32/dl-machine.h
+++ b/libc/sysdeps/sparc/sparc32/dl-machine.h
@@ -139,7 +139,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
nop
.word MAP
- The PC value (pltpc) saved in %g2 by the jmpl points near the
+ The PC value (pltpc) saved in %g2 by the jmpl points near the
location where we store the link_map pointer for this object. */
plt[0] = 0x05000000 | ((rfunc >> 10) & 0x003fffff);
@@ -193,17 +193,11 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
PLT entries should not be allowed to define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
-# define elf_machine_type_class(type) \
+#define elf_machine_type_class(type) \
((((type) == R_SPARC_JMP_SLOT \
|| ((type) >= R_SPARC_TLS_GD_HI22 && (type) <= R_SPARC_TLS_TPOFF64)) \
* ELF_RTYPE_CLASS_PLT) \
| (((type) == R_SPARC_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-# define elf_machine_type_class(type) \
- ((((type) == R_SPARC_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_SPARC_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_SPARC_JMP_SLOT
@@ -348,7 +342,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const Elf32_Sym *const refsym = sym;
@@ -398,7 +392,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
{
value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
}
@@ -454,8 +449,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
sparc_fixup_plt (reloc, reloc_addr, value, 0, do_flush);
}
break;
-#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
- && !defined RESOLVE_CONFLICT_FIND_MAP
+#ifndef RESOLVE_CONFLICT_FIND_MAP
case R_SPARC_TLS_DTPMOD32:
/* Get the information from the link map returned by the
resolv function. */
@@ -553,7 +547,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -563,7 +558,8 @@ elf_machine_lazy_rel (struct link_map *map,
else if (r_type == R_SPARC_JMP_IREL)
{
Elf32_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
sparc_fixup_plt (reloc, reloc_addr, value, 1, 1);
}
else if (r_type == R_SPARC_NONE)
diff --git a/libc/sysdeps/sparc/sparc32/e_sqrt.c b/libc/sysdeps/sparc/sparc32/e_sqrt.c
index 0be4b6c0c..5969105a2 100644
--- a/libc/sysdeps/sparc/sparc32/e_sqrt.c
+++ b/libc/sysdeps/sparc/sparc32/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1997, 2011 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
@@ -32,3 +32,4 @@ __ieee754_sqrt (x)
asm ("fsqrtd %1, %0" : "=f" (result) : "f" (x));
return result;
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/libc/sysdeps/sparc/sparc32/elf/configure b/libc/sysdeps/sparc/sparc32/elf/configure
index 37522c345..04a229d94 100644
--- a/libc/sysdeps/sparc/sparc32/elf/configure
+++ b/libc/sysdeps/sparc/sparc32/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/sparc/sparc32/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and linker.
{ $as_echo "$as_me:$LINENO: checking for sparc32 TLS support" >&5
$as_echo_n "checking for sparc32 TLS support... " >&6; }
@@ -48,12 +47,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_sparc32_tls" >&5
$as_echo "$libc_cv_sparc32_tls" >&6; }
-if test $libc_cv_sparc32_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_sparc32_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
# Check for broken WDISP22 in the linker.
diff --git a/libc/sysdeps/sparc/sparc32/elf/configure.in b/libc/sysdeps/sparc/sparc32/elf/configure.in
index aa75e0bfa..d1593a639 100644
--- a/libc/sysdeps/sparc/sparc32/elf/configure.in
+++ b/libc/sysdeps/sparc/sparc32/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/sparc/sparc32/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and linker.
AC_CACHE_CHECK(for sparc32 TLS support, libc_cv_sparc32_tls, [dnl
changequote(,)dnl
@@ -39,9 +38,8 @@ else
libc_cv_sparc32_tls=no
fi
rm -f conftest*])
-if test $libc_cv_sparc32_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_sparc32_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
# Check for broken WDISP22 in the linker.
diff --git a/libc/sysdeps/sparc/sparc64/dl-machine.h b/libc/sysdeps/sparc/sparc64/dl-machine.h
index 3f71a6677..501092e0c 100644
--- a/libc/sysdeps/sparc/sparc64/dl-machine.h
+++ b/libc/sysdeps/sparc/sparc64/dl-machine.h
@@ -1,6 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. Sparc64 version.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1997-2006, 2009, 2010, 2011 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
@@ -77,11 +76,11 @@ elf_machine_load_address (void)
register Elf64_Addr *got __asm ("%l7");
__asm ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t"
- "call 1f\n\t"
- " add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t"
- "call _DYNAMIC\n\t"
- "call _GLOBAL_OFFSET_TABLE_\n"
- "1:\tadd %1, %0, %1\n\t" : "=r" (pc), "=r" (got));
+ "call 1f\n\t"
+ " add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t"
+ "call _DYNAMIC\n\t"
+ "call _GLOBAL_OFFSET_TABLE_\n"
+ "1:\tadd %1, %0, %1\n\t" : "=r" (pc), "=r" (got));
/* got is now l_addr + _GLOBAL_OFFSET_TABLE_
*got is _DYNAMIC
@@ -115,17 +114,11 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
PLT entries should not be allowed to define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
-# define elf_machine_type_class(type) \
+#define elf_machine_type_class(type) \
((((type) == R_SPARC_JMP_SLOT \
|| ((type) >= R_SPARC_TLS_GD_HI22 && (type) <= R_SPARC_TLS_TPOFF64)) \
* ELF_RTYPE_CLASS_PLT) \
| (((type) == R_SPARC_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-# define elf_machine_type_class(type) \
- ((((type) == R_SPARC_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_SPARC_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_SPARC_JMP_SLOT
@@ -168,7 +161,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
/* PLT0 looks like:
- sethi %uhi(_dl_runtime_{resolve,profile}_0), %g4
+ sethi %uhi(_dl_runtime_{resolve,profile}_0), %g4
sethi %hi(_dl_runtime_{resolve,profile}_0), %g5
or %g4, %ulo(_dl_runtime_{resolve,profile}_0), %g4
or %g5, %lo(_dl_runtime_{resolve,profile}_0), %g5
@@ -189,7 +182,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
/* PLT1 looks like:
- sethi %uhi(_dl_runtime_{resolve,profile}_1), %g4
+ sethi %uhi(_dl_runtime_{resolve,profile}_1), %g4
sethi %hi(_dl_runtime_{resolve,profile}_1), %g5
or %g4, %ulo(_dl_runtime_{resolve,profile}_1), %g4
or %g5, %lo(_dl_runtime_{resolve,profile}_1), %g5
@@ -375,7 +368,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const Elf64_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
@@ -429,7 +422,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
switch (r_type)
@@ -479,8 +473,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
sparc64_fixup_plt (map, reloc, reloc_addr, value, reloc->r_addend, 0);
#endif
break;
-#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \
- && !defined RESOLVE_CONFLICT_FIND_MAP
+#ifndef RESOLVE_CONFLICT_FIND_MAP
case R_SPARC_TLS_DTPMOD64:
/* Get the information from the link map returned by the
resolv function. */
@@ -647,7 +640,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -658,7 +652,8 @@ elf_machine_lazy_rel (struct link_map *map,
|| r_type == R_SPARC_IRELATIVE)
{
Elf64_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
if (r_type == R_SPARC_JMP_IREL)
{
/* 'high' is always zero, for large PLT entries the linker
diff --git a/libc/sysdeps/sparc/sparc64/elf/configure b/libc/sysdeps/sparc/sparc64/elf/configure
index f213438aa..dd1d9c6de 100644
--- a/libc/sysdeps/sparc/sparc64/elf/configure
+++ b/libc/sysdeps/sparc/sparc64/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/sparc/sparc64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and linker.
{ $as_echo "$as_me:$LINENO: checking for sparc64 TLS support" >&5
$as_echo_n "checking for sparc64 TLS support... " >&6; }
@@ -49,12 +48,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_sparc64_tls" >&5
$as_echo "$libc_cv_sparc64_tls" >&6; }
-if test $libc_cv_sparc64_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_sparc64_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
# Check for broken WDISP22 in the linker.
diff --git a/libc/sysdeps/sparc/sparc64/elf/configure.in b/libc/sysdeps/sparc/sparc64/elf/configure.in
index 4f7597835..b56b275a1 100644
--- a/libc/sysdeps/sparc/sparc64/elf/configure.in
+++ b/libc/sysdeps/sparc/sparc64/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/sparc/sparc64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and linker.
AC_CACHE_CHECK(for sparc64 TLS support, libc_cv_sparc64_tls, [dnl
changequote(,)dnl
@@ -40,9 +39,8 @@ else
libc_cv_sparc64_tls=no
fi
rm -f conftest*])
-if test $libc_cv_sparc64_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_sparc64_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
# Check for broken WDISP22 in the linker.
diff --git a/libc/sysdeps/sparc/sparc64/fpu/e_sqrtl.c b/libc/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
index 4c3d19a50..e1479c2e3 100644
--- a/libc/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
+++ b/libc/sysdeps/sparc/sparc64/fpu/e_sqrtl.c
@@ -1,5 +1,5 @@
/* Long double square root, sparc64 version.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
@@ -29,3 +29,4 @@ __ieee754_sqrtl (long double x)
_Qp_sqrt (&ret, &x);
return ret;
}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
index 2ccd01d01..79251ab39 100644
--- a/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
+++ b/libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h
@@ -236,7 +236,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
{
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
- return 0;
+ return NULL;
__cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ CMSG_ALIGN (__cmsg->cmsg_len));
@@ -245,7 +245,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
|| ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
> ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
- return 0;
+ return NULL;
return __cmsg;
}
#endif /* Use `extern inline'. */
diff --git a/libc/sysdeps/unix/clock_gettime.c b/libc/sysdeps/unix/clock_gettime.c
index fbaaf301e..d467f2b78 100644
--- a/libc/sysdeps/unix/clock_gettime.c
+++ b/libc/sysdeps/unix/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get the current time from a POSIX clockid_t. Unix version.
- Copyright (C) 1999-2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2004, 2005, 2007, 2011 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
@@ -113,7 +113,7 @@ clock_gettime (clockid_t clock_id, struct timespec *tp)
default:
#ifdef SYSDEP_GETTIME_CPU
- SYSDEP_GETTIME_CPU;
+ retval = SYSDEP_GETTIME_CPU (clock_id, tp);
#endif
#if HP_TIMING_AVAIL
if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1))
diff --git a/libc/sysdeps/unix/i386/sysdep.S b/libc/sysdeps/unix/i386/sysdep.S
index 3bc872add..9f279e15b 100644
--- a/libc/sysdeps/unix/i386/sysdep.S
+++ b/libc/sysdeps/unix/i386/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1994,1995,1996,1997,2000,2002,2004,2005
+/* Copyright (C) 1991-1997,2000,2002,2004,2005,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -46,57 +46,24 @@ syscall_error:
notb:
#endif
#ifndef PIC
-# if USE___THREAD
-# ifndef NO_TLS_DIRECT_SEG_REFS
+# ifndef NO_TLS_DIRECT_SEG_REFS
movl %eax, %gs:C_SYMBOL_NAME(errno@NTPOFF)
-# else
+# else
movl %gs:0, %ecx
movl %eax, C_SYMBOL_NAME(errno@NTPOFF)(%ecx)
-# endif
-# elif !defined _LIBC_REENTRANT
- movl %eax, C_SYMBOL_NAME(errno)
-# else
- pushl %eax
- PUSH_ERRNO_LOCATION_RETURN
- call BP_SYM (__errno_location)
- POP_ERRNO_LOCATION_RETURN
- popl %ecx
- movl %ecx, (%eax)
# endif
#else
/* The caller has pushed %ebx and then set it up to
point to the GOT before calling us through the PLT. */
-# if USE___THREAD
movl C_SYMBOL_NAME(errno@GOTNTPOFF)(%ebx), %ecx
/* Pop %ebx value saved before jumping here. */
popl %ebx
-# ifndef NO_TLS_DIRECT_SEG_REFS
+# ifndef NO_TLS_DIRECT_SEG_REFS
addl %gs:0, %ecx
movl %eax, (%ecx)
-# else
- movl %eax, %gs:0(%ecx)
-# endif
-# elif RTLD_PRIVATE_ERRNO
- movl %eax, C_SYMBOL_NAME(rtld_errno@GOTOFF)(%ebx)
-
- /* Pop %ebx value saved before jumping here. */
- popl %ebx
-# elif !defined _LIBC_REENTRANT
- movl C_SYMBOL_NAME(errno@GOT)(%ebx), %ecx
-
- /* Pop %ebx value saved before jumping here. */
- popl %ebx
- movl %eax, (%ecx)
# else
- pushl %eax
- PUSH_ERRNO_LOCATION_RETURN
- call C_SYMBOL_NAME (BP_SYM (__errno_location)@PLT)
- POP_ERRNO_LOCATION_RETURN
- popl %ecx
- /* Pop %ebx value saved before jumping here. */
- popl %ebx
- movl %ecx, (%eax)
+ movl %eax, %gs:0(%ecx)
# endif
#endif
movl $-1, %eax
diff --git a/libc/sysdeps/unix/sysv/linux/bits/in.h b/libc/sysdeps/unix/sysv/linux/bits/in.h
index 0aa0d6638..165e1441c 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/in.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000, 2004, 2008, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2000,2004,2008,2010,2011 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
@@ -70,6 +70,7 @@
#define IP_XFRM_POLICY 17
#define IP_PASSSEC 18
#define IP_TRANSPARENT 19
+#define IP_MULTICAST_ALL 49 /* bool */
/* TProxy original addresses */
#define IP_ORIGDSTADDR 20
diff --git a/libc/sysdeps/unix/sysv/linux/bits/socket.h b/libc/sysdeps/unix/sysv/linux/bits/socket.h
index 36757d64d..69e090bd4 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/socket.h
@@ -318,7 +318,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
{
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
- return 0;
+ return (struct cmsghdr *) 0;
__cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ CMSG_ALIGN (__cmsg->cmsg_len));
@@ -327,7 +327,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
|| ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
> ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
- return 0;
+ return (struct cmsghdr *) 0;
return __cmsg;
}
#endif /* Use `extern inline'. */
diff --git a/libc/sysdeps/unix/sysv/linux/clock_gettime.c b/libc/sysdeps/unix/sysv/linux/clock_gettime.c
index dd3755cce..0ae45de37 100644
--- a/libc/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/libc/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get current time from a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006,2007,2010 Free Software Foundation, Inc.
+ Copyright (C) 2003,2004,2005,2006,2007,2010,2011 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
@@ -32,9 +32,14 @@
# include <bits/libc-vdso.h>
#endif
-#define SYSCALL_GETTIME \
- retval = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); \
- break
+#ifndef SYSCALL_GETTIME
+# define SYSCALL_GETTIME(id, tp) \
+ INLINE_VSYSCALL (clock_gettime, 2, id, tp)
+#endif
+#ifndef INTERNAL_GETTIME
+# define INTERNAL_GETTIME(id, tp) \
+ INTERNAL_VSYSCALL (clock_gettime, err, 2, id, tp)
+#endif
#ifdef __ASSUME_POSIX_TIMERS
@@ -44,7 +49,8 @@
SYSDEP_GETTIME_CPUTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
- SYSCALL_GETTIME
+ retval = SYSCALL_GETTIME (clock_id, tp); \
+ break
# define __libc_missing_posix_timers 0
#elif defined __NR_clock_gettime
@@ -59,7 +65,7 @@ maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
if (!__libc_missing_posix_timers)
{
INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
+ int r = INTERNAL_GETTIME (clock_id, tp);
if (!INTERNAL_SYSCALL_ERROR_P (r, err))
return 0;
@@ -89,7 +95,7 @@ maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
/* Fallback code. */ \
if (retval == EINVAL && clock_id == CLOCK_REALTIME) \
retval = realtime_gettime (tp); \
- else \
+ else \
{ \
__set_errno (retval); \
retval = -1; \
@@ -119,7 +125,7 @@ maybe_syscall_gettime_cpu (clockid_t clock_id, struct timespec *tp)
if (!__libc_missing_posix_cpu_timers)
{
INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
+ int r = INTERNAL_GETTIME (clock_id, tp);
if (!INTERNAL_SYSCALL_ERROR_P (r, err))
return 0;
diff --git a/libc/sysdeps/unix/sysv/linux/configure b/libc/sysdeps/unix/sysv/linux/configure
index 06105c7e6..fad0ed168 100644
--- a/libc/sysdeps/unix/sysv/linux/configure
+++ b/libc/sysdeps/unix/sysv/linux/configure
@@ -410,22 +410,22 @@ use_ldconfig=yes
case "$machine" in
i[3456]86* | m68*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
;;
ia64*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
s390*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
sparc*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
;;
x86_64*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
;;
powerpc*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
;;
*)
;;
diff --git a/libc/sysdeps/unix/sysv/linux/configure.in b/libc/sysdeps/unix/sysv/linux/configure.in
index 8f00407a8..3f1daab4e 100644
--- a/libc/sysdeps/unix/sysv/linux/configure.in
+++ b/libc/sysdeps/unix/sysv/linux/configure.in
@@ -224,22 +224,22 @@ use_ldconfig=yes
changequote(,)
case "$machine" in
i[3456]86* | m68*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
;;
ia64*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
s390*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
sparc*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
;;
x86_64*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
;;
powerpc*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
+ ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
;;
*)
;;
diff --git a/libc/sysdeps/unix/sysv/linux/getpagesize.c b/libc/sysdeps/unix/sysv/linux/getpagesize.c
index 086607951..0de52ea4f 100644
--- a/libc/sysdeps/unix/sysv/linux/getpagesize.c
+++ b/libc/sysdeps/unix/sysv/linux/getpagesize.c
@@ -28,26 +28,8 @@
int
__getpagesize ()
{
-#ifdef __ASSUME_AT_PAGESIZE
assert (GLRO(dl_pagesize) != 0);
return GLRO(dl_pagesize);
-#else
- if (GLRO(dl_pagesize) != 0)
- return GLRO(dl_pagesize);
-
-# ifdef EXEC_PAGESIZE
- return EXEC_PAGESIZE;
-# else /* No EXEC_PAGESIZE. */
-# ifdef NBPG
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* No CLSIZE. */
- return NBPG * CLSIZE;
-# else /* No NBPG. */
- return NBPC;
-# endif /* NBPG. */
-# endif /* EXEC_PAGESIZE. */
-#endif
}
libc_hidden_def (__getpagesize)
weak_alias (__getpagesize, getpagesize)
diff --git a/libc/sysdeps/unix/sysv/linux/getsysstats.c b/libc/sysdeps/unix/sysv/linux/getsysstats.c
index b9bae3df9..7feb7a180 100644
--- a/libc/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/libc/sysdeps/unix/sysv/linux/getsysstats.c
@@ -37,15 +37,6 @@
#include <not-cancel.h>
#include <kernel-features.h>
-#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
-# undef INTERNAL_VSYSCALL
-# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
-# undef INLINE_VSYSCALL
-# define INLINE_VSYSCALL INLINE_SYSCALL
-#else
-# include <bits/libc-vdso.h>
-#endif
-
/* How we can determine the number of available processors depends on
the configuration. There is currently (as of version 2.0.21) no
@@ -141,17 +132,10 @@ __get_nprocs ()
static int cached_result;
static time_t timestamp;
-#ifdef __ASSUME_POSIX_TIMERS
- struct timespec ts;
- INTERNAL_SYSCALL_DECL (err);
- INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts);
-#else
- struct timeval ts;
- __gettimeofday (&ts, NULL);
-#endif
+ time_t now = time (NULL);
time_t prev = timestamp;
atomic_read_barrier ();
- if (ts.tv_sec == prev)
+ if (now == prev)
return cached_result;
/* XXX Here will come a test for the new system call. */
@@ -243,7 +227,7 @@ __get_nprocs ()
out:
cached_result = result;
atomic_write_barrier ();
- timestamp = ts.tv_sec;
+ timestamp = now;
return result;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
index a07e6c8ed..cd3c66a42 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
@@ -33,10 +33,10 @@ longjmp_msg:
cfi_register(%ebx,%ecx); \
LOAD_PIC_REG (bx); \
leal longjmp_msg@GOTOFF(%ebx), %eax; \
- call __GI___fortify_fail@PLT
+ call HIDDEN_JUMPTARGET(__fortify_fail)
#else
# define CALL_FAIL movl $longjmp_msg, %eax; \
- call __fortify_fail
+ call HIDDEN_JUMPTARGET(__fortify_fail)
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
index 9ed0b7198..726b1df4b 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007
- Free Software Foundation, Inc.
+/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
@@ -125,13 +125,12 @@
# elif defined _LIBC_REENTRANT
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_HANDLER \
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_HANDLER \
0:SETUP_PIC_REG (cx); \
addl $_GLOBAL_OFFSET_TABLE_, %ecx; \
movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx; \
@@ -140,38 +139,13 @@
SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx); \
orl $-1, %eax; \
jmp L(pseudo_end);
-# ifndef NO_TLS_DIRECT_SEG_REFS
-# define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
+# ifndef NO_TLS_DIRECT_SEG_REFS
+# define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
movl src, %gs:(destoff)
-# else
-# define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
+# else
+# define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
addl %gs:0, destoff; \
movl src, (destoff)
-# endif
-# else
-# define SYSCALL_ERROR_HANDLER \
-0:pushl %ebx; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebx, 0); \
- SETUP_PIC_REG (bx); \
- addl $_GLOBAL_OFFSET_TABLE_, %ebx; \
- xorl %edx, %edx; \
- subl %eax, %edx; \
- pushl %edx; \
- cfi_adjust_cfa_offset (4); \
- PUSH_ERRNO_LOCATION_RETURN; \
- call BP_SYM (__errno_location)@PLT; \
- POP_ERRNO_LOCATION_RETURN; \
- popl %ecx; \
- cfi_adjust_cfa_offset (-4); \
- popl %ebx; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (ebx); \
- movl %ecx, (%eax); \
- orl $-1, %eax; \
- jmp L(pseudo_end);
-/* A quick note: it is assumed that the call to `__errno_location' does
- not modify the stack! */
# endif
# else
/* Store (- %eax) into errno through the GOT. */
diff --git a/libc/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
index e097c2288..fa87f67eb 100644
--- a/libc/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/ia64/____longjmp_chk.S
@@ -30,19 +30,13 @@ longjmp_msg:
#define __longjmp ____longjmp_chk
-#ifdef PIC
-# define CALL_FAIL __GI___fortify_fail
-#else
-# define CALL_FAIL __fortify_fail
-#endif
-
#define CHECK_RSP(reg) \
cmp.ltu p0, p8 = reg, r12; \
(p8) br.cond.dpnt .Lok;; \
addl r28 = @ltoffx(longjmp_msg#), r1;; \
ld8.mov r28 = [r28], longjmp_msg#;; \
ld8 out0 = [r28]; \
- br.call.sptk.many b0 = CALL_FAIL#;; \
+ br.call.sptk.many b0 = HIDDEN_JUMPTARGET(__fortify_fail)#;; \
.Lok:
#include "__longjmp.S"
diff --git a/libc/sysdeps/unix/sysv/linux/ia64/sysdep.S b/libc/sysdeps/unix/sysv/linux/ia64/sysdep.S
index 3633dd4b7..3271857d6 100644
--- a/libc/sysdeps/unix/sysv/linux/ia64/sysdep.S
+++ b/libc/sysdeps/unix/sysv/linux/ia64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2001, 2003, 2004, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
@@ -34,7 +34,7 @@ ENTRY(__syscall_error)
;;
st4 [r2]=r8
mov r8=-1
-#elif USE___THREAD
+#else
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
@@ -46,37 +46,7 @@ ENTRY(__syscall_error)
mov r8=-1
add r2=r2,r13;;
st4 [r2]=r3
-#elif defined _LIBC_REENTRANT
- .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0)
- alloc r33=ar.pfs, 0, 4, 0, 0
- mov r32=rp
- .body
- mov r35=r8
- mov r34=r1
- ;;
- br.call.sptk.many b0 = __errno_location
-.Lret0: /* force new bundle */
- st4 [r8]=r35
- mov r1=r34
- mov rp=r32
- mov r8=-1
- mov ar.pfs=r33
-#else /* _LIBC_REENTRANT */
- /*
- * Note that the gp has to be set properly for this to work.
- * As long as all syscalls are in the same load unit
- * (executable or shared library) as this routine, we should
- * be fine. Otherwise, we would have to first load the global
- * pointer register from __gp.
- */
- addl r2=@ltoff(errno),gp
- ;;
- ld8 r2=[r2]
- mov r3=r8
- mov r8=-1
- ;;
- st4 [r2]=r3
-#endif /* _LIBC_REENTRANT */
+#endif
ret // ret is #define'd in syscall.h!
END(__syscall_error)
diff --git a/libc/sysdeps/unix/sysv/linux/init-first.c b/libc/sysdeps/unix/sysv/linux/init-first.c
index a60212f4e..63cf1ed33 100644
--- a/libc/sysdeps/unix/sysv/linux/init-first.c
+++ b/libc/sysdeps/unix/sysv/linux/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux version.
- Copyright (C) 1995-2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-2004, 2005, 2007, 2011 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
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
@@ -93,12 +94,14 @@ _init (int argc, char **argv, char **envp)
__getopt_clean_environment (envp);
#endif
+ /* Initialize ctype data. */
+ __ctype_init ();
+
#if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS
__libc_global_ctors ();
#endif
}
-
/* This function is defined here so that if this file ever gets into
ld.so we will get a link error. Having this file silently included
in ld.so causes disaster, because the _init definition above will
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S b/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
index 2a1dad069..5a24fdc2e 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -32,12 +32,11 @@
.text
ENTRY(__syscall_error)
#ifndef PIC
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
basr %r1,0
0: l %r1,1f-0b(%r1)
ear %r3,%a0
@@ -46,34 +45,6 @@ ENTRY(__syscall_error)
lhi %r2,-1
br %r14
1: .long SYSCALL_ERROR_ERRNO@ntpoff
-# elif !defined _LIBC_REENTRANT
- basr %r1,0
-0: l %r1,1f-0b(%r1)
- lcr %r2,%r2
- st %r2,0(%r1)
- lhi %r2,-1
- br %r14
-1: .long errno
-# else
- stm %r13,%r15,52(%r15)
- cfi_offset (%r15, -36)
- cfi_offset (%r14, -40)
- cfi_offset (%r13, -44)
- lr %r0,%r15
- ahi %r15,-96
- cfi_adjust_cfa_offset (96)
- lcr %r13,%r2
- st %r0,0(%r15)
- basr %r1,0
-0: l %r1,1f-0b(%r1)
- basr %r14,%r1
- st %r13,0(%r2)
- lm %r13,%r15,148(%r15)
- cfi_adjust_cfa_offset (-96)
- lhi %r2,-1
- br %r14
-1: .long __errno_location
-#endif
#else
# if RTLD_PRIVATE_ERRNO
basr %r1,0
@@ -83,7 +54,7 @@ ENTRY(__syscall_error)
lhi %r2,-1
br %r14
1: .long rtld_errno - 0b
-# elif USE___THREAD
+# else
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
@@ -98,39 +69,6 @@ ENTRY(__syscall_error)
lhi %r2,-1
br %r14
1: .long _GLOBAL_OFFSET_TABLE_-0b
-# elif !defined _LIBC_REENTRANT
- basr %r1,0
-0: al %r1,1f-0b(%r1)
- l %r1,errno@GOT(%r1)
- lcr %r2,%r2
- st %r2,0(0,%r1)
- lhi %r2,-1
- br %r14
-1: .long _GLOBAL_OFFSET_TABLE_-0b
-# else
- stm %r11,%r15,44(%r15)
- cfi_offset (%r15, -36)
- cfi_offset (%r14, -40)
- cfi_offset (%r13, -44)
- cfi_offset (%r12, -48)
- cfi_offset (%r11, -52)
- lr %r0,%r15
- ahi %r15,-96
- cfi_adjust_cfa_offset (96)
- lcr %r11,%r2
- st %r0,0(%r15)
- basr %r13,0
-0: l %r12,1f-0b(%r13)
- l %r1,2f-0b(%r13)
- la %r12,0(%r12,%r13)
- bas %r14,0(%r1,%r13)
- st %r11,0(%r2)
- lm %r11,%r15,140(%r15)
- cfi_adjust_cfa_offset (-96)
- lhi %r2,-1
- br %r14
-1: .long _GLOBAL_OFFSET_TABLE_-0b
-2: .long __errno_location@PLT-0b
# endif
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 13ce9ab74..435eaabb1 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011
Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -56,10 +56,10 @@
#undef PSEUDO
#define PSEUDO(name, syscall_name, args) \
.text; \
- ENTRY (name) \
+ ENTRY (name) \
DO_CALL (syscall_name, args); \
lhi %r4,-4095 ; \
- clr %r2,%r4 ; \
+ clr %r2,%r4 ; \
jnl SYSCALL_ERROR_LABEL
#undef PSEUDO_END
@@ -70,7 +70,7 @@
#undef PSEUDO_NOERRNO
#define PSEUDO_NOERRNO(name, syscall_name, args) \
.text; \
- ENTRY (name) \
+ ENTRY (name) \
DO_CALL (syscall_name, args)
#undef PSEUDO_END_NOERRNO
@@ -80,7 +80,7 @@
#undef PSEUDO_ERRVAL
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.text; \
- ENTRY (name) \
+ ENTRY (name) \
DO_CALL (syscall_name, args); \
lcr %r2,%r2
@@ -107,14 +107,13 @@
br %r14; \
2: .long rtld_errno-1b
# elif defined _LIBC_REENTRANT
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_LABEL 0f
-# define SYSCALL_ERROR_HANDLER \
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_LABEL 0f
+# define SYSCALL_ERROR_HANDLER \
0: lcr %r0,%r2; \
basr %r1,0; \
1: al %r1,2f-1b(%r1); \
@@ -124,14 +123,6 @@
lhi %r2,-1; \
br %r14; \
2: .long _GLOBAL_OFFSET_TABLE_-1b
-# else
-# define SYSCALL_ERROR_LABEL 0f
-# define SYSCALL_ERROR_HANDLER \
-0: basr %r1,0; \
-1: al %r1,2f-1b(%r1); \
- br %r1; \
-2: .long syscall_error@plt-1b
-# endif
# else
# define SYSCALL_ERROR_LABEL 0f
# define SYSCALL_ERROR_HANDLER \
@@ -317,8 +308,8 @@
if (INTERNAL_SYSCALL_ERROR_P (_ret, )) \
{ \
iserr: \
- __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, )); \
- _ret = -1L; \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, )); \
+ _ret = -1L; \
} \
out: \
(int) _ret; \
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
index bb61e894f..41d814389 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -33,12 +33,11 @@
.text
ENTRY(__syscall_error)
#ifndef PIC
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
basr %r1,0
0: lg %r1,1f-0b(%r1)
ear %r3,%a0
@@ -49,29 +48,6 @@ ENTRY(__syscall_error)
lghi %r2,-1
br %r14
1: .quad SYSCALL_ERROR_ERRNO@ntpoff
-# elif !defined _LIBC_REENTRANT
- larl %r1,errno
- lcr %r2,%r2
- st %r2,0(%r1)
- lghi %r2,-1
- br %r14
-# else
- stmg %r13,%r15,104(%r15)
- cfi_offset (%r15,-40)
- cfi_offset (%r14,-48)
- cfi_offset (%r13,-56)
- lgr %r0,%r15
- aghi %r15,-160
- cfi_adjust_cfa_offset (160)
- lcr %r13,%r2
- stg %r0,0(%r15)
- brasl %r14,__errno_location
- st %r13,0(%r2)
- lmg %r13,%r15,264(%r15)
- cfi_adjust_cfa_offset (-160)
- lghi %r2,-1
- br %r14
-#endif
#else
# if RTLD_PRIVATE_ERRNO
larl %r1,rtld_errno
@@ -79,7 +55,7 @@ ENTRY(__syscall_error)
st %r2,0(%r1)
lghi %r2,-1
br %r14
-# elif USE___THREAD
+# else
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
@@ -94,29 +70,6 @@ ENTRY(__syscall_error)
st %r2,0(%r1,%r3)
lghi %r2,-1
br %r14
-# elif !defined _LIBC_REENTRANT
- larl %r1,_GLOBAL_OFFSET_TABLE_
- lg %r1,errno@GOT(%r1)
- lcr %r2,%r2
- st %r2,0(%r1)
- lghi %r2,-1
- br %r14
-# else
- stmg %r13,%r15,104(%r15)
- cfi_offset (%r15,-40)
- cfi_offset (%r14,-48)
- cfi_offset (%r13,-56)
- lgr %r0,%r15
- aghi %r15,-160
- cfi_adjust_cfa_offset (160)
- lcr %r13,%r2
- stg %r0,0(%r15)
- brasl %r14,__errno_location@PLT
- st %r13,0(%r2)
- lmg %r13,%r15,264(%r15)
- cfi_adjust_cfa_offset (-160)
- lghi %r2,-1
- br %r14
# endif
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
index 4d4541763..598fb8652 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for 64 bit S/390.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011
Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -115,14 +115,13 @@
lghi %r2,-1; \
br %r14
# elif defined _LIBC_REENTRANT
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_LABEL 0f
-# define SYSCALL_ERROR_HANDLER \
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_LABEL 0f
+# define SYSCALL_ERROR_HANDLER \
0: lcr %r0,%r2; \
larl %r1,SYSCALL_ERROR_ERRNO@indntpoff; \
lg %r1,0(%r1); \
@@ -132,10 +131,6 @@
st %r0,0(%r1,%r2); \
lghi %r2,-1; \
br %r14
-# else
-# define SYSCALL_ERROR_LABEL syscall_error@plt
-# define SYSCALL_ERROR_HANDLER
-# endif
# else
# define SYSCALL_ERROR_LABEL 0f
# define SYSCALL_ERROR_HANDLER \
@@ -319,8 +314,8 @@
if (INTERNAL_SYSCALL_ERROR_P (_ret, )) \
{ \
iserr: \
- __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, )); \
- _ret = -1L; \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, )); \
+ _ret = -1L; \
} \
out: \
(int) _ret; \
diff --git a/libc/sysdeps/unix/sysv/linux/sh/sysdep.h b/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
index 0fc2c4f1e..4ba0def0e 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992,1993,1995,1996,1997,1998,1999,2000,2002,2003,2004,
- 2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1993,1995-2000,2002-2006,2009,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
@@ -114,13 +114,12 @@
# elif defined _LIBC_REENTRANT
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_HANDLER \
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_HANDLER \
neg r0,r1; \
mov r12,r2; \
mov.l 0f,r12; \
@@ -137,43 +136,6 @@
.align 2; \
0: .long _GLOBAL_OFFSET_TABLE_; \
1: .long SYSCALL_ERROR_ERRNO@GOTTPOFF
-# else
-# define SYSCALL_ERROR_HANDLER \
- neg r0,r1; \
- mov.l r14,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (r14, 0); \
- mov.l r12,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (r12, 0); \
- mov.l r1,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (r1, 0); \
- mov.l 0f,r12; \
- mova 0f,r0; \
- add r0,r12; \
- sts.l pr,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (pr, 0); \
- mov r15,r14; \
- cfi_def_cfa_register (r14); \
- mov.l 1f,r1; \
- bsrf r1; \
- nop; \
- 2: mov r14,r15; \
- lds.l @r15+,pr; \
- mov.l @r15+,r1; \
- mov.l r1,@r0; \
- mov.l @r15+,r12; \
- mov.l @r15+,r14; \
- bra .Lpseudo_end; \
- mov _IMM1,r0; \
- .align 2; \
- 0: .long _GLOBAL_OFFSET_TABLE_; \
- 1: .long PLTJMP(C_SYMBOL_NAME(__errno_location))-(2b-.)
-/* A quick note: it is assumed that the call to `__errno_location' does
- not modify the stack! */
-# endif
# else
/* Store (-r0) into errno through the GOT. */
# define SYSCALL_ERROR_HANDLER \
@@ -324,8 +286,8 @@
unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args); \
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0)) \
{ \
- __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \
- resultvar = 0xffffffff; \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \
+ resultvar = 0xffffffff; \
} \
(int) resultvar; })
@@ -347,7 +309,7 @@
#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
({ \
unsigned long int resultvar; \
- register long int r3 asm ("%r3") = (name); \
+ register long int r3 asm ("%r3") = (name); \
SUBSTITUTE_ARGS_##nr(args); \
\
asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD \
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h
index 5f85d2170..6cfbbd7d9 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h
@@ -318,7 +318,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
{
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
- return 0;
+ return (struct cmsghdr *) 0;
__cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ CMSG_ALIGN (__cmsg->cmsg_len));
@@ -327,7 +327,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
|| ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
> ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
- return 0;
+ return (struct cmsghdr *) 0;
return __cmsg;
}
#endif /* Use `extern inline'. */
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index 8af045dc2..161f43107 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008
+/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
@@ -99,32 +99,19 @@ ENTRY(name); \
mov -1, %o0;
# elif defined _LIBC_REENTRANT
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_HANDLER \
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_HANDLER \
0: SETUP_PIC_REG(o2,g1) \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
ld [%o2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO); \
- st %o0, [%g7 + %g1]; \
- jmp %o7 + 8; \
+ st %o0, [%g7 + %g1]; \
+ jmp %o7 + 8; \
mov -1, %o0;
-# else
-# define SYSCALL_ERROR_HANDLER \
-0: save %sp, -96, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register (%o7, %i7); \
- call __errno_location; \
- nop; \
- st %i0, [%o0]; \
- jmp %i7 + 8; \
- restore %g0, -1, %o0;
-# endif
# else
# define SYSCALL_ERROR_HANDLER \
0: SETUP_PIC_REG(o2,g1) \
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index bdd1d45bd..bc8a0b0e3 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2000, 2002, 2003, 2004, 2006, 2008
+/* Copyright (C) 1997, 2000, 2002, 2003, 2004, 2006, 2008, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
@@ -106,32 +106,19 @@ ENTRY(name); \
mov -1, %o0;
# elif defined _LIBC_REENTRANT
-# if USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# define SYSCALL_ERROR_HANDLER \
+# ifndef NOT_IN_libc
+# define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+# define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_HANDLER \
0: SETUP_PIC_REG(o2,g1) \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
ldx [%o2 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO);\
- st %o0, [%g7 + %g1]; \
- jmp %o7 + 8; \
+ st %o0, [%g7 + %g1]; \
+ jmp %o7 + 8; \
mov -1, %o0;
-# else
-# define SYSCALL_ERROR_HANDLER \
-0: save %sp, -176, %sp; \
- cfi_def_cfa_register(%fp); \
- cfi_window_save; \
- cfi_register (%o7, %i7); \
- call __errno_location; \
- nop; \
- st %i0, [%o0]; \
- jmp %i7 + 8; \
- restore %g0, -1, %o0;
-# endif
# else
# define SYSCALL_ERROR_HANDLER \
0: SETUP_PIC_REG(o2,g1) \
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index 3881082cf..d8cbe0684 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -34,7 +34,7 @@ longjmp_msg:
cfi_remember_state; \
cfi_def_cfa_offset(16); \
leaq longjmp_msg(%rip), %rdi; \
- call __GI___fortify_fail; \
+ call HIDDEN_JUMPTARGET(__fortify_fail); \
nop; \
cfi_restore_state
#else
@@ -42,7 +42,7 @@ longjmp_msg:
cfi_remember_state; \
cfi_def_cfa_offset(16); \
movq $longjmp_msg, %rdi; \
- call __fortify_fail; \
+ call HIDDEN_JUMPTARGET(__fortify_fail); \
nop; \
cfi_restore_state
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
index 7153e2143..e86c3578b 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
@@ -40,13 +40,9 @@ struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
__time_t sem_otime; /* last semop() time */
-#if __WORDSIZE == 32
unsigned long int __unused1;
-#endif
__time_t sem_ctime; /* last time changed by semctl() */
-#if __WORDSIZE == 32
unsigned long int __unused2;
-#endif
unsigned long int sem_nsems; /* number of semaphores in set */
unsigned long int __unused3;
unsigned long int __unused4;
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c b/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
new file mode 100644
index 000000000..7802701e2
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
@@ -0,0 +1,14 @@
+#include "bits/libc-vdso.h"
+
+#ifdef SHARED
+# define SYSCALL_GETTIME(id, tp) \
+ ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+ PTR_DEMANGLE (f); \
+ f (id, tp); })
+# define INTERNAL_GETTIME(id, tp) \
+ ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+ PTR_DEMANGLE (f); \
+ f (id, tp); })
+#endif
+
+#include "../clock_gettime.c"
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 25cf08bd7..cb39acae1 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -17,6 +17,8 @@
02111-1307 USA. */
#ifdef SHARED
+# include <time.h>
+# include <sysdep.h>
# include <dl-vdso.h>
# include <bits/libc-vdso.h>
@@ -27,12 +29,17 @@ strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
long int (*__vdso_getcpu) (unsigned *, unsigned *, void *) attribute_hidden;
+extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+
+
static inline void
_libc_vdso_platform_setup (void)
{
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
void *p = _dl_vdso_vsym ("clock_gettime", &linux26);
+ if (p == NULL)
+ p = __syscall_clock_gettime;
PTR_MANGLE (p);
__GI___vdso_clock_gettime = p;
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index 3e231a0b6..ccddb8422 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -14,6 +14,7 @@ semop - semop i:ipi __semop semop
semtimedop - semtimedop i:ipip semtimedop
semget - semget i:iii __semget semget
semctl - semctl i:iiii __semctl semctl
+syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime
# proper socket implementations:
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 2b9ea85d8..64362300a 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2005, 2007, 2011 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
@@ -124,7 +124,7 @@
movl %edx, (%rcx); \
orq $-1, %rax; \
jmp L(pseudo_end);
-# elif USE___THREAD
+# else
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
@@ -138,34 +138,6 @@
movl %edx, %fs:(%rcx); \
orq $-1, %rax; \
jmp L(pseudo_end);
-# elif defined _LIBC_REENTRANT
-/* Store (- %rax) into errno through the GOT.
- Note that errno occupies only 4 bytes. */
-# define SYSCALL_ERROR_HANDLER \
-0: \
- xorl %edx, %edx; \
- subq %rax, %rdx; \
- pushq %rdx; \
- cfi_adjust_cfa_offset(8); \
- PUSH_ERRNO_LOCATION_RETURN; \
- call BP_SYM (__errno_location)@PLT; \
- POP_ERRNO_LOCATION_RETURN; \
- popq %rdx; \
- cfi_adjust_cfa_offset(-8); \
- movl %edx, (%rax); \
- orq $-1, %rax; \
- jmp L(pseudo_end);
-
-/* A quick note: it is assumed that the call to `__errno_location' does
- not modify the stack! */
-# else /* Not _LIBC_REENTRANT. */
-# define SYSCALL_ERROR_HANDLER \
-0:movq errno@GOTPCREL(%RIP), %rcx; \
- xorl %edx, %edx; \
- subq %rax, %rdx; \
- movl %edx, (%rcx); \
- orq $-1, %rax; \
- jmp L(pseudo_end);
# endif /* PIC */
/* The Linux/x86-64 kernel expects the system call parameters in
@@ -279,8 +251,8 @@
if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \
{ \
iserr: \
- __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \
- sc_ret = -1L; \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \
+ sc_ret = -1L; \
} \
out: \
sc_ret; \
@@ -304,9 +276,6 @@
v_ret; \
})
-/* List of system calls which are supported as vsyscalls. */
-# define HAVE_CLOCK_GETTIME_VSYSCALL 1
-
# else
# define INLINE_VSYSCALL(name, nr, args...) \
INLINE_SYSCALL (name, nr, ##args)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/time.c b/libc/sysdeps/unix/sysv/linux/x86_64/time.c
index c1c1a7526..a613eb0f5 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/time.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/time.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,02, 2003, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001,02,2003,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,13 +16,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#ifdef SHARED
#include <dl-vdso.h>
-
#define VSYSCALL_ADDR_vtime 0xffffffffff600400
-
-#ifdef SHARED
void *time_ifunc (void) __asm__ ("time");
void *
@@ -34,7 +32,9 @@ time_ifunc (void)
return _dl_vdso_vsym ("time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime;
}
__asm (".type time, %gnu_indirect_function");
+
#else
+
# include <time.h>
# include <sysdep.h>
@@ -44,6 +44,7 @@ time (time_t *t)
INTERNAL_SYSCALL_DECL (err);
return INTERNAL_SYSCALL (time, err, 1, t);
}
+
#endif
strong_alias (time, __GI_time)
diff --git a/libc/sysdeps/unix/x86_64/sysdep.S b/libc/sysdeps/unix/x86_64/sysdep.S
index aca81fef2..908da3c3d 100644
--- a/libc/sysdeps/unix/x86_64/sysdep.S
+++ b/libc/sysdeps/unix/x86_64/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2004, 2005, 2011 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
@@ -45,43 +45,11 @@ syscall_error:
movl $EAGAIN, %eax /* Yes; translate it to EAGAIN. */
notb:
#endif
-#if USE___THREAD
-# ifdef PIC
+#ifdef PIC
movq C_SYMBOL_NAME(errno@GOTTPOFF)(%rip), %rcx
movl %eax, %fs:0(%rcx)
-# else
- movl %eax, %fs:C_SYMBOL_NAME(errno@TPOFF)
-# endif
-#elif !defined PIC
-# ifndef _LIBC_REENTRANT
- movl %eax, C_SYMBOL_NAME(errno)
-# else
- pushq %rax
- cfi_adjust_cfa_offset(8)
- PUSH_ERRNO_LOCATION_RETURN
- call BP_SYM (__errno_location)
- POP_ERRNO_LOCATION_RETURN
- popq %rcx
- cfi_adjust_cfa_offset(-8)
- movl %ecx, (%rax)
-# endif
#else
-# if RTLD_PRIVATE_ERRNO
- leaq rtld_errno(%rip), %rcx
- movl %eax, (%rcx)
-# elif !defined _LIBC_REENTRANT
- movq C_SYMBOL_NAME(errno)@GOTPCREL(%rip), %rcx
- movl %eax, (%rcx)
-# else
- pushq %rax
- cfi_adjust_cfa_offset(8)
- PUSH_ERRNO_LOCATION_RETURN
- call C_SYMBOL_NAME (BP_SYM (__errno_location)@PLT)
- POP_ERRNO_LOCATION_RETURN
- popq %rcx
- cfi_adjust_cfa_offset(-8)
- movl %ecx, (%rax)
-# endif
+ movl %eax, %fs:C_SYMBOL_NAME(errno@TPOFF)
#endif
movq $-1, %rax
ret
diff --git a/libc/sysdeps/x86_64/bits/select.h b/libc/sysdeps/x86_64/bits/select.h
index a300d58d3..2ebdd7ccb 100644
--- a/libc/sysdeps/x86_64/bits/select.h
+++ b/libc/sysdeps/x86_64/bits/select.h
@@ -57,8 +57,8 @@
#endif /* GNU CC */
#define __FD_SET(d, set) \
- ((void) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d)))
+ ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d)))
#define __FD_CLR(d, set) \
- ((void) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d)))
+ ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d)))
#define __FD_ISSET(d, set) \
- ((__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d)) != 0)
+ ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0)
diff --git a/libc/sysdeps/x86_64/dl-machine.h b/libc/sysdeps/x86_64/dl-machine.h
index f615e9591..1068af6bb 100644
--- a/libc/sysdeps/x86_64/dl-machine.h
+++ b/libc/sysdeps/x86_64/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. x86-64 version.
- Copyright (C) 2001-2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2001-2006, 2008-2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
@@ -195,8 +195,7 @@ _dl_start_user:\n\
define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
-# define elf_machine_type_class(type) \
+#define elf_machine_type_class(type) \
((((type) == R_X86_64_JUMP_SLOT \
|| (type) == R_X86_64_DTPMOD64 \
|| (type) == R_X86_64_DTPOFF64 \
@@ -204,15 +203,14 @@ _dl_start_user:\n\
|| (type) == R_X86_64_TLSDESC) \
* ELF_RTYPE_CLASS_PLT) \
| (((type) == R_X86_64_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-# define elf_machine_type_class(type) \
- ((((type) == R_X86_64_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_X86_64_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_X86_64_JUMP_SLOT
+/* The relative ifunc relocation. */
+// XXX This is a work-around for a broken linker. Remove!
+#define ELF_MACHINE_IRELATIVE R_X86_64_IRELATIVE
+
/* The x86-64 never uses Elf64_Rel relocations. */
#define ELF_MACHINE_NO_REL 1
@@ -261,7 +259,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const Elf64_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -299,13 +297,10 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf64_Addr (*) (void)) value) ();
-# if defined RTLD_BOOTSTRAP && !USE___THREAD
- assert (r_type == R_X86_64_GLOB_DAT || r_type == R_X86_64_JUMP_SLOT);
- *reloc_addr = value + reloc->r_addend;
-# else
switch (r_type)
{
case R_X86_64_GLOB_DAT:
@@ -453,7 +448,6 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
break;
# endif
}
-#endif
}
}
@@ -470,7 +464,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
auto inline void
__attribute ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -497,7 +492,8 @@ elf_machine_lazy_rel (struct link_map *map,
else if (__builtin_expect (r_type == R_X86_64_IRELATIVE, 0))
{
Elf64_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf64_Addr (*) (void)) value) ();
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf64_Addr (*) (void)) value) ();
*reloc_addr = value;
}
else
diff --git a/libc/sysdeps/x86_64/dl-trampoline.S b/libc/sysdeps/x86_64/dl-trampoline.S
index 258c60945..6523c9294 100644
--- a/libc/sysdeps/x86_64/dl-trampoline.S
+++ b/libc/sysdeps/x86_64/dl-trampoline.S
@@ -149,10 +149,7 @@ L(have_avx):
// Get XFEATURE_ENABLED_MASK
xgetbv
andl $0x6, %eax
- cmpl $0x6, %eax
- // Nonzero if SSE and AVX state saving is enabled.
- sete %al
-2: leal -1(%eax,%eax), %eax
+2: subl $0x5, %eax
movl %eax, L(have_avx)(%rip)
cmpl $0, %eax
diff --git a/libc/sysdeps/x86_64/dla.h b/libc/sysdeps/x86_64/dla.h
new file mode 100644
index 000000000..7aa06e5f6
--- /dev/null
+++ b/libc/sysdeps/x86_64/dla.h
@@ -0,0 +1,6 @@
+#if defined __FMA4__ || defined __FMA__
+# define DLA_FMS(x,y,z) \
+ __builtin_fma (x, y, -z)
+#endif
+
+#include "sysdeps/ieee754/dbl-64/dla.h"
diff --git a/libc/sysdeps/x86_64/elf/configure b/libc/sysdeps/x86_64/elf/configure
index 7d02f81bc..ad972bb5d 100755
--- a/libc/sysdeps/x86_64/elf/configure
+++ b/libc/sysdeps/x86_64/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/x86_64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and linker.
{ $as_echo "$as_me:$LINENO: checking for x86-64 TLS support" >&5
$as_echo_n "checking for x86-64 TLS support... " >&6; }
@@ -35,12 +34,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_x86_64_tls" >&5
$as_echo "$libc_cv_x86_64_tls" >&6; }
-if test $libc_cv_x86_64_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_x86_64_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
cat >>confdefs.h <<\_ACEOF
diff --git a/libc/sysdeps/x86_64/elf/configure.in b/libc/sysdeps/x86_64/elf/configure.in
index 4a41290f1..c53328b4c 100644
--- a/libc/sysdeps/x86_64/elf/configure.in
+++ b/libc/sysdeps/x86_64/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/x86_64/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and linker.
AC_CACHE_CHECK(for x86-64 TLS support, libc_cv_x86_64_tls, [dnl
cat > conftest.s <<\EOF
@@ -24,9 +23,8 @@ else
libc_cv_x86_64_tls=no
fi
rm -f conftest*])
-if test $libc_cv_x86_64_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_x86_64_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl It is always possible to access static and hidden symbols in an
diff --git a/libc/sysdeps/x86_64/fpu/bits/fenv.h b/libc/sysdeps/x86_64/fpu/bits/fenv.h
index 11859f00c..4af164374 100644
--- a/libc/sysdeps/x86_64/fpu/bits/fenv.h
+++ b/libc/sysdeps/x86_64/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2001,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2001,2004,2011 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
@@ -95,3 +95,41 @@ fenv_t;
/* Floating-point environment where none of the exception is masked. */
# define FE_NOMASK_ENV ((__const fenv_t *) -2)
#endif
+
+
+#ifdef __OPTIMIZE__
+__BEGIN_DECLS
+
+/* Optimized versions. */
+extern int __NTH (__feraiseexcept_renamed (int)) __asm__ ("feraiseexcept");
+__extern_inline int
+__NTH (feraiseexcept (int __excepts))
+{
+ if (__builtin_constant_p (__excepts)
+ && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0)
+ {
+ if ((FE_INVALID & __excepts) != 0)
+ {
+ /* One example of a invalid operation is 0.0 / 0.0. */
+ float __f = 0.0;
+
+ __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
+ (void) &__f;
+ }
+ if ((FE_DIVBYZERO & __excepts) != 0)
+ {
+ float __f = 1.0;
+ float __g = 0.0;
+
+ __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
+ (void) &__f;
+ }
+
+ return 0;
+ }
+
+ return __feraiseexcept_renamed (__excepts);
+}
+
+__END_DECLS
+#endif
diff --git a/libc/sysdeps/x86_64/fpu/bits/mathinline.h b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
index dc58f67d6..1a2c1ee99 100644
--- a/libc/sysdeps/x86_64/fpu/bits/mathinline.h
+++ b/libc/sysdeps/x86_64/fpu/bits/mathinline.h
@@ -1,7 +1,6 @@
/* Inline math functions for x86-64.
- Copyright (C) 2002, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004, 2007, 2009, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Andreas Jaeger <aj@suse.de>, 2002.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -24,39 +23,42 @@
#include <bits/wordsize.h>
-#ifndef __extern_inline
+#ifndef __extern_always_inline
# define __MATH_INLINE __inline
#else
-# define __MATH_INLINE __extern_inline
+# define __MATH_INLINE __extern_always_inline
#endif
-#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
+/* The gcc, version 2.7 or below, has problems with all this inlining
+ code. So disable it for this version of the compiler. */
+#if __GNUC_PREREQ (2, 8) && defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
/* Test for negative number. Used in the signbit() macro. */
__MATH_INLINE int
__NTH (__signbitf (float __x))
{
-#if __WORDSIZE == 32
+# if __WORDSIZE == 32
__extension__ union { float __f; int __i; } __u = { __f: __x };
return __u.__i < 0;
-#else
+# else
int __m;
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x8;
-#endif
+# endif
}
__MATH_INLINE int
__NTH (__signbit (double __x))
{
-#if __WORDSIZE == 32
+# if __WORDSIZE == 32
__extension__ union { double __d; int __i[2]; } __u = { __d: __x };
return __u.__i[1] < 0;
-#else
+# else
int __m;
__asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
return __m & 0x80;
-#endif
+# endif
}
__MATH_INLINE int
__NTH (__signbitl (long double __x))
@@ -64,4 +66,169 @@ __NTH (__signbitl (long double __x))
__extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
return (__u.__i[2] & 0x8000) != 0;
}
+
+__END_NAMESPACE_C99
+#endif
+
+
+#if (__GNUC_PREREQ (2, 8) && !defined __NO_MATH_INLINES \
+ && defined __OPTIMIZE__)
+
+# ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+
+/* Round to nearest integer. */
+# if __WORDSIZE == 64 || defined __SSE_MATH__
+__MATH_INLINE long int
+__NTH (lrintf (float __x))
+{
+ long int __res;
+ __asm ("cvtss2si %1, %0" : "=r" (__res) : "xm" (__x));
+ return __res;
+}
+# endif
+# if __WORDSIZE == 64 || defined __SSE2_MATH__
+__MATH_INLINE long int
+__NTH (lrint (double __x))
+{
+ long int __res;
+ __asm ("cvtsd2si %1, %0" : "=r" (__res) : "xm" (__x));
+ return __res;
+}
+# endif
+# if __WORDSIZE == 64
+__MATH_INLINE long long int
+__NTH (llrintf (float __x))
+{
+ long long int __res;
+ __asm ("cvtss2si %1, %0" : "=r" (__res) : "xm" (__x));
+ return __res;
+}
+__MATH_INLINE long long int
+__NTH (llrint (double __x))
+{
+ long long int __res;
+ __asm ("cvtsd2si %1, %0" : "=r" (__res) : "xm" (__x));
+ return __res;
+}
+# endif
+
+# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 \
+ && (__WORDSIZE == 64 || defined __SSE2_MATH__)
+/* Determine maximum of two values. */
+__MATH_INLINE float
+__NTH (fmaxf (float __x, float __y))
+{
+ __asm ("maxss %1, %0" : "+x" (__x) : "xm" (__y));
+ return __x;
+}
+__MATH_INLINE double
+__NTH (fmax (double __x, double __y))
+{
+ __asm ("maxsd %1, %0" : "+x" (__x) : "xm" (__y));
+ return __x;
+}
+
+/* Determine minimum of two values. */
+__MATH_INLINE float
+__NTH (fminf (float __x, float __y))
+{
+ __asm ("minss %1, %0" : "+x" (__x) : "xm" (__y));
+ return __x;
+}
+__MATH_INLINE double
+__NTH (fmin (double __x, double __y))
+{
+ __asm ("minsd %1, %0" : "+x" (__x) : "xm" (__y));
+ return __x;
+}
+# endif
+
+__END_NAMESPACE_C99
+# endif
+
+# if defined __SSE4_1__ && (__WORDSIZE == 64 || defined __SSE2_MATH__)
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+
+/* Round to nearest integer. */
+__MATH_INLINE double
+__NTH (rint (double __x))
+{
+ double __res;
+ __asm ("roundsd $4, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+__MATH_INLINE float
+__NTH (rintf (float __x))
+{
+ float __res;
+ __asm ("roundss $4, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+
+# ifdef __USE_ISOC99
+/* Round to nearest integer without raising inexact exception. */
+__MATH_INLINE double
+__NTH (nearbyint (double __x))
+{
+ double __res;
+ __asm ("roundsd $0xc, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+__MATH_INLINE float
+__NTH (nearbyintf (float __x))
+{
+ float __res;
+ __asm ("roundss $0xc, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+# endif
+
+__END_NAMESPACE_C99
+# endif
+
+__BEGIN_NAMESPACE_STD
+/* Smallest integral value not less than X. */
+__MATH_INLINE double
+__NTH (ceil (double __x))
+{
+ double __res;
+ __asm ("roundsd $2, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+__END_NAMESPACE_STD
+
+__BEGIN_NAMESPACE_C99
+__MATH_INLINE float
+__NTH (ceilf (float __x))
+{
+ float __res;
+ __asm ("roundss $2, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+__END_NAMESPACE_C99
+
+__BEGIN_NAMESPACE_STD
+/* Largest integer not greater than X. */
+__MATH_INLINE double
+__NTH (floor (double __x))
+{
+ double __res;
+ __asm ("roundsd $1, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+__END_NAMESPACE_STD
+
+__BEGIN_NAMESPACE_C99
+__MATH_INLINE float
+__NTH (floorf (float __x))
+{
+ float __res;
+ __asm ("roundss $1, %1, %0" : "=x" (__res) : "xm" (__x));
+ return __res;
+}
+__END_NAMESPACE_C99
+# endif
+
#endif
diff --git a/libc/sysdeps/x86_64/fpu/e_exp2l.S b/libc/sysdeps/x86_64/fpu/e_exp2l.S
index 336b98909..7abf425c7 100644
--- a/libc/sysdeps/x86_64/fpu/e_exp2l.S
+++ b/libc/sysdeps/x86_64/fpu/e_exp2l.S
@@ -36,3 +36,4 @@ ENTRY(__ieee754_exp2l)
fldz /* Set result to 0. */
2: ret
END (__ieee754_exp2l)
+strong_alias (__ieee754_exp2l, __exp2l_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_fmodl.S b/libc/sysdeps/x86_64/fpu/e_fmodl.S
index 2967bf224..07c50df8d 100644
--- a/libc/sysdeps/x86_64/fpu/e_fmodl.S
+++ b/libc/sysdeps/x86_64/fpu/e_fmodl.S
@@ -20,3 +20,4 @@ ENTRY(__ieee754_fmodl)
fstp %st(1)
ret
END (__ieee754_fmodl)
+strong_alias (__ieee754_fmodl, __fmodl_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_log10l.S b/libc/sysdeps/x86_64/fpu/e_log10l.S
index 633234b74..50c58757a 100644
--- a/libc/sysdeps/x86_64/fpu/e_log10l.S
+++ b/libc/sysdeps/x86_64/fpu/e_log10l.S
@@ -10,14 +10,12 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -30,9 +28,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##(%rip)
+# define MO(op) op##(%rip)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -65,3 +63,20 @@ ENTRY(__ieee754_log10l)
fstp %st(1)
ret
END(__ieee754_log10l)
+
+
+ENTRY(__log10l_finite)
+ fldlg2 // log10(2)
+ fldt 8(%rsp) // x : log10(2)
+ fld %st // x : x : log10(2)
+4: 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)
+ andb $0x45, %ah
+ jz 2b
+ fstp %st(1) // x-1 : log10(2)
+ fyl2xp1 // log10(x)
+ ret
+END(__log10l_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_log2l.S b/libc/sysdeps/x86_64/fpu/e_log2l.S
index f04d30a05..78dc2d5c0 100644
--- a/libc/sysdeps/x86_64/fpu/e_log2l.S
+++ b/libc/sysdeps/x86_64/fpu/e_log2l.S
@@ -10,11 +10,11 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -27,9 +27,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##(%rip)
+# define MO(op) op##(%rip)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -62,3 +62,20 @@ ENTRY(__ieee754_log2l)
fstp %st(1)
ret
END (__ieee754_log2l)
+
+
+ENTRY(__log2l_finite)
+ fldl MO(one)
+ fldt 8(%rsp) // x : 1
+ fld %st // x : x : 1
+ fsub %st(2), %st // x-1 : x : 1
+ fld %st // x-1 : x-1 : x : 1
+ fabs // |x-1| : x-1 : x : 1
+ fcompl MO(limit) // x-1 : x : 1
+ fnstsw // x-1 : x : 1
+ andb $0x45, %ah
+ jz 2b
+ fstp %st(1) // x-1 : 1
+ fyl2xp1 // log(x)
+ ret
+END (__log2l_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_logl.S b/libc/sysdeps/x86_64/fpu/e_logl.S
index 2ba91eedf..2503b9a01 100644
--- a/libc/sysdeps/x86_64/fpu/e_logl.S
+++ b/libc/sysdeps/x86_64/fpu/e_logl.S
@@ -8,15 +8,13 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
- .align ALIGNARG(4)
+ .p2align 3
ASM_TYPE_DIRECTIVE(one,@object)
one: .double 1.0
ASM_SIZE_DIRECTIVE(one)
@@ -29,9 +27,9 @@ limit: .double 0.29
#ifdef PIC
-#define MO(op) op##(%rip)
+# define MO(op) op##(%rip)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -64,3 +62,20 @@ ENTRY(__ieee754_logl)
fstp %st(1)
ret
END (__ieee754_logl)
+
+
+ENTRY(__logl_finite)
+ fldln2 // log(2)
+ fldt 8(%rsp) // x : log(2)
+ 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)
+ andb $0x45, %ah
+ jz 2b
+ fstp %st(1) // x-1 : log(2)
+ fyl2xp1 // log(x)
+ ret
+END (__logl_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_powl.S b/libc/sysdeps/x86_64/fpu/e_powl.S
index a0b1b1df1..a65c465ec 100644
--- a/libc/sysdeps/x86_64/fpu/e_powl.S
+++ b/libc/sysdeps/x86_64/fpu/e_powl.S
@@ -22,12 +22,27 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst8,"aM",@progbits,8
#else
.text
#endif
+ .p2align 3
+ 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(p63,@object)
+p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
+ ASM_SIZE_DIRECTIVE(p63)
- .align ALIGNARG(4)
+#ifdef __ELF__
+ .section .rodata.cst16,"aM",@progbits,16
+#else
+ .text
+#endif
+ .p2align 3
ASM_TYPE_DIRECTIVE(infinity,@object)
inf_zero:
infinity:
@@ -43,21 +58,11 @@ minfinity:
mzero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
ASM_SIZE_DIRECTIVE(minf_mzero)
- 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(p63,@object)
-p63:
- .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43
- ASM_SIZE_DIRECTIVE(p63)
#ifdef PIC
-#define MO(op) op##(%rip)
+# define MO(op) op##(%rip)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -339,3 +344,4 @@ ENTRY(__ieee754_powl)
ret
END(__ieee754_powl)
+strong_alias (__ieee754_powl, __powl_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_remainderl.S b/libc/sysdeps/x86_64/fpu/e_remainderl.S
index 480b1cad8..4ee091091 100644
--- a/libc/sysdeps/x86_64/fpu/e_remainderl.S
+++ b/libc/sysdeps/x86_64/fpu/e_remainderl.S
@@ -18,3 +18,4 @@ ENTRY(__ieee754_remainderl)
fstp %st(1)
ret
END (__ieee754_remainderl)
+strong_alias (__ieee754_remainderl, __remainderl_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_scalbl.S b/libc/sysdeps/x86_64/fpu/e_scalbl.S
index 6b229705b..5833321a1 100644
--- a/libc/sysdeps/x86_64/fpu/e_scalbl.S
+++ b/libc/sysdeps/x86_64/fpu/e_scalbl.S
@@ -10,8 +10,6 @@
#include <machine/asm.h>
-RCSID("$NetBSD: $")
-
#ifdef __ELF__
.section .rodata
#else
@@ -23,16 +21,15 @@ RCSID("$NetBSD: $")
zero_nan:
.double 0.0
nan: .byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
-minus_zero:
.byte 0, 0, 0, 0, 0, 0, 0, 0x80
.byte 0, 0, 0, 0, 0, 0, 0xff, 0x7f
ASM_SIZE_DIRECTIVE(zero_nan)
#ifdef PIC
-#define MO(op) op##(%rip)
+# define MO(op) op##(%rip)
#else
-#define MO(op) op
+# define MO(op) op
#endif
.text
@@ -98,3 +95,4 @@ ENTRY(__ieee754_scalbl)
fdiv %st
ret
END(__ieee754_scalbl)
+strong_alias (__ieee754_scalbl, __scalbl_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_sqrt.c b/libc/sysdeps/x86_64/fpu/e_sqrt.c
index d588a8b10..99120993f 100644
--- a/libc/sysdeps/x86_64/fpu/e_sqrt.c
+++ b/libc/sysdeps/x86_64/fpu/e_sqrt.c
@@ -1,5 +1,5 @@
/* Square root of floating point number.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2011 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
@@ -19,12 +19,14 @@
#include <math_private.h>
+#undef __ieee754_sqrt
double
__ieee754_sqrt (double x)
{
double res;
- asm ("sqrtsd %0, %1" : "=x" (res) : "x" (x));
+ asm ("sqrtsd %1, %0" : "=x" (res) : "xm" (x));
return res;
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/libc/sysdeps/x86_64/fpu/e_sqrtf.c b/libc/sysdeps/x86_64/fpu/e_sqrtf.c
index f7801f05d..dade4f59f 100644
--- a/libc/sysdeps/x86_64/fpu/e_sqrtf.c
+++ b/libc/sysdeps/x86_64/fpu/e_sqrtf.c
@@ -1,5 +1,5 @@
/* Square root of floating point number.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2011 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
@@ -19,12 +19,14 @@
#include <math_private.h>
+#undef __ieee754_sqrtf
float
__ieee754_sqrtf (float x)
{
float res;
- asm ("sqrtss %0, %1" : "=x" (res) : "x" (x));
+ asm ("sqrtss %1, %0" : "=x" (res) : "xm" (x));
return res;
}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/libc/sysdeps/x86_64/fpu/feupdateenv.c b/libc/sysdeps/x86_64/fpu/feupdateenv.c
index 291c56bd1..b2c62916c 100644
--- a/libc/sysdeps/x86_64/fpu/feupdateenv.c
+++ b/libc/sysdeps/x86_64/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01,07,2010 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,01,07,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -36,7 +36,7 @@ __feupdateenv (const fenv_t *envp)
/* Raise the saved exception. Incidently for us the implementation
defined format of the values in objects of type fexcept_t is the
same as the ones specified using the FE_* constants. */
- feraiseexcept ((int) temp);
+ __feraiseexcept ((int) temp);
/* Success. */
return 0;
diff --git a/libc/sysdeps/x86_64/fpu/fraiseexcpt.c b/libc/sysdeps/x86_64/fpu/fraiseexcpt.c
index d1d3c0330..88d1a59bb 100644
--- a/libc/sysdeps/x86_64/fpu/fraiseexcpt.c
+++ b/libc/sysdeps/x86_64/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2011 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
@@ -21,7 +21,7 @@
#include <math.h>
int
-feraiseexcept (int excepts)
+__feraiseexcept (int excepts)
{
/* Raise exceptions represented by EXPECTS. But we must raise only
one signal at a time. It is important that if the overflow/underflow
@@ -117,4 +117,5 @@ feraiseexcept (int excepts)
/* Success. */
return 0;
}
+strong_alias (__feraiseexcept, feraiseexcept)
libm_hidden_def (feraiseexcept)
diff --git a/libc/sysdeps/x86_64/fpu/libm-test-ulps b/libc/sysdeps/x86_64/fpu/libm-test-ulps
index 0ced4be7b..aafdac720 100644
--- a/libc/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/libc/sysdeps/x86_64/fpu/libm-test-ulps
@@ -103,8 +103,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ldouble: 1
ildouble: 1
+ldouble: 1
# catan
Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
@@ -168,10 +168,10 @@ ifloat: 1
ildouble: 1
ldouble: 1
Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
-ildouble: 1
-ldouble: 1
float: 1
ifloat: 1
+ildouble: 1
+ldouble: 1
# ccosh
Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
@@ -304,6 +304,9 @@ idouble: 1
ifloat: 1
# cos
+Test "cos (0.80190127184058835) == 0.69534156199418473":
+double: 1
+idouble: 1
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
float: 1
@@ -323,16 +326,13 @@ idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
-Test "cos (0.80190127184058835) == 0.69534156199418473":
-double: 1
-idouble: 1
# cpow
Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
float: 1
ifloat: 1
-ldouble: 1
ildouble: 1
+ldouble: 1
Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
float: 1
ifloat: 1
@@ -369,8 +369,8 @@ ifloat: 5
Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
float: 2
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 4
+ldouble: 4
Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i":
double: 2
float: 2
@@ -380,15 +380,15 @@ ildouble: 1
ldouble: 1
# csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+double: 1
+idouble: 1
Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
ildouble: 1
ldouble: 1
Test "Imaginary part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
float: 1
ifloat: 1
-Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
-double: 1
-idouble: 1
# csinh
Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
@@ -440,12 +440,12 @@ ldouble: 3
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+double: 1
float: 2
+idouble: 1
ifloat: 2
ildouble: 5
ldouble: 5
-double: 1
-idouble: 1
Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
ildouble: 25
ldouble: 25
@@ -456,10 +456,10 @@ Test "Real part of: ctanh (0.75 + 1.25 i) == 1.372607570533783202580486065712268
double: 1
idouble: 1
Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
-ildouble: 1
-ldouble: 1
double: 1
idouble: 1
+ildouble: 1
+ldouble: 1
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
@@ -481,26 +481,26 @@ ldouble: 1
# exp10
Test "exp10 (-1) == 0.1":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
ildouble: 1
ldouble: 1
+Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-double: 2
-idouble: 2
-Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
ildouble: 2
ldouble: 2
-float: 1
-ifloat: 1
-double: 1
-idouble: 1
Test "exp10 (3) == 1000":
-ildouble: 8
-ldouble: 8
-float: 2
-ifloat: 2
double: 6
+float: 2
idouble: 6
+ifloat: 2
+ildouble: 8
+ldouble: 8
# expm1
Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
@@ -660,10 +660,19 @@ ifloat: 3
ildouble: 2
ldouble: 2
Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+double: 1
float: 4
+idouble: 1
ifloat: 4
ildouble: 1
ldouble: 1
+Test "jn (2, 2.4048255576957729) == 0.43175480701968038399746111312430703":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+ildouble: 82
+ldouble: 82
Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
ildouble: 1
ldouble: 1
@@ -694,6 +703,51 @@ idouble: 1
ifloat: 2
ildouble: 1
ldouble: 1
+Test "jn (3, 2.4048255576957729) == 0.19899990535769083404042146764530813":
+double: 3
+idouble: 3
+ildouble: 186
+ldouble: 186
+Test "jn (4, 2.4048255576957729) == 0.647466661641779720084932282551219891E-1":
+double: 1
+idouble: 1
+ildouble: 185
+ldouble: 185
+Test "jn (5, 2.4048255576957729) == 0.163892432048058525099230549946147698E-1":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+ildouble: 249
+ldouble: 249
+Test "jn (6, 2.4048255576957729) == 0.34048184720278336646673682895929161E-2":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+ildouble: 511
+ldouble: 511
+Test "jn (7, 2.4048255576957729) == 0.60068836573295394221291569249883076E-3":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+ildouble: 428
+ldouble: 428
+Test "jn (8, 2.4048255576957729) == 0.92165786705344923232879022467054148E-4":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+ildouble: 609
+ldouble: 609
+Test "jn (9, 2.4048255576957729) == 0.12517270977961513005428966643852564E-4":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+ildouble: 750
+ldouble: 750
# lgamma
Test "lgamma (-0.5) == log(2*sqrt(pi))":
@@ -714,12 +768,12 @@ ldouble: 1
# log10
Test "log10 (0.75) == -0.124938736608299953132449886193870744":
-ildouble: 1
-ldouble: 1
-float: 2
-ifloat: 2
double: 1
+float: 2
idouble: 1
+ifloat: 2
+ildouble: 1
+ldouble: 1
Test "log10 (e) == log10(e)":
float: 1
ifloat: 1
@@ -732,6 +786,9 @@ float: 1
ifloat: 1
# sincos
+Test "sincos (0.80190127184058835, &sin_res, &cos_res) puts 0.69534156199418473 in cos_res":
+double: 1
+idouble: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
float: 1
@@ -754,9 +811,10 @@ ldouble: 1
Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
float: 1
ifloat: 1
-Test "sincos (0.80190127184058835, &sin_res, &cos_res) puts 0.69534156199418473 in cos_res":
-double: 1
-idouble: 1
+
+Test "sinh (0x8p-32) == 1.86264514923095703232705808926175479e-9":
+ldouble: 1
+ildouble: 1
# tan
Test "tan (pi/4) == 1":
@@ -1122,8 +1180,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 4
+ldouble: 4
Function: Real part of "csin":
ildouble: 1
@@ -1178,12 +1236,12 @@ ildouble: 5
ldouble: 5
Function: Imaginary part of "ctanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 25
ldouble: 25
-double: 1
-idouble: 1
Function: "erf":
double: 1
@@ -1196,12 +1254,12 @@ ildouble: 1
ldouble: 1
Function: "exp10":
-ildouble: 8
-ldouble: 8
-float: 2
-ifloat: 2
double: 6
+float: 2
idouble: 6
+ifloat: 2
+ildouble: 8
+ldouble: 8
Function: "expm1":
double: 1
@@ -1235,11 +1293,11 @@ ldouble: 1
Function: "jn":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
-ildouble: 2
-ldouble: 2
+ifloat: 5
+ildouble: 750
+ldouble: 750
Function: "lgamma":
double: 1
@@ -1250,12 +1308,12 @@ ildouble: 1
ldouble: 1
Function: "log10":
+double: 1
float: 2
+idouble: 1
ifloat: 2
ildouble: 1
ldouble: 1
-double: 1
-idouble: 1
Function: "log1p":
float: 1
@@ -1269,6 +1327,10 @@ ifloat: 1
ildouble: 1
ldouble: 1
+Function: "sinh":
+ldouble: 1
+ildouble: 1
+
Function: "tan":
double: 1
idouble: 1
diff --git a/libc/sysdeps/x86_64/fpu/math_private.h b/libc/sysdeps/x86_64/fpu/math_private.h
index 4be753654..d3d84cfda 100644
--- a/libc/sysdeps/x86_64/fpu/math_private.h
+++ b/libc/sysdeps/x86_64/fpu/math_private.h
@@ -56,3 +56,144 @@ do { \
} while (0)
#endif
+
+#define __isnan(d) \
+ ({ long int __di; EXTRACT_WORDS64 (__di, (double) (d)); \
+ (__di & 0x7fffffffffffffffl) > 0x7ff0000000000000l; })
+#define __isnanf(d) \
+ ({ int __di; GET_FLOAT_WORD (__di, (float) d); \
+ (__di & 0x7fffffff) > 0x7f800000; })
+
+#define __isinf_ns(d) \
+ ({ long int __di; EXTRACT_WORDS64 (__di, (double) (d)); \
+ (__di & 0x7fffffffffffffffl) == 0x7ff0000000000000l; })
+#define __isinf_nsf(d) \
+ ({ int __di; GET_FLOAT_WORD (__di, (float) d); \
+ (__di & 0x7fffffff) == 0x7f800000; })
+
+#define __finite(d) \
+ ({ long int __di; EXTRACT_WORDS64 (__di, (double) (d)); \
+ (__di & 0x7fffffffffffffffl) < 0x7ff0000000000000l; })
+#define __finitef(d) \
+ ({ int __di; GET_FLOAT_WORD (__di, (float) d); \
+ (__di & 0x7fffffff) < 0x7f800000; })
+
+#define __ieee754_sqrt(d) \
+ ({ double __res; \
+ asm ("sqrtsd %1, %0" : "=x" (__res) : "xm" ((double) (d))); \
+ __res; })
+#define __ieee754_sqrtf(d) \
+ ({ float __res; \
+ asm ("sqrtss %1, %0" : "=x" (__res) : "xm" ((float) (d))); \
+ __res; })
+#define __ieee754_sqrtl(d) \
+ ({ long double __res; \
+ asm ("fsqrt" : "=t" (__res) : "0" ((long double) (d))); \
+ __res; })
+
+#ifdef __SSE4_1__
+# ifndef __rint
+# define __rint(d) \
+ ({ double __res; \
+ asm ("roundsd $4, %1, %0" : "=x" (__res) : "xm" ((double) (d))); \
+ __res; })
+# endif
+# ifndef __rintf
+# define __rintf(d) \
+ ({ float __res; \
+ asm ("roundss $4, %1, %0" : "=x" (__res) : "xm" ((float) (d))); \
+ __res; })
+# endif
+
+# ifndef __floor
+# define __floor(d) \
+ ({ double __res; \
+ asm ("roundsd $1, %1, %0" : "=x" (__res) : "xm" ((double) (d))); \
+ __res; })
+# endif
+# ifndef __floorf
+# define __floorf(d) \
+ ({ float __res; \
+ asm ("roundss $1, %1, %0" : "=x" (__res) : "xm" ((float) (d))); \
+ __res; })
+# endif
+#endif
+
+
+/* Specialized variants of the <fenv.h> interfaces which only handle
+ either the FPU or the SSE unit. */
+#undef libc_fegetround
+#define libc_fegetround() \
+ ({ \
+ unsigned int mxcsr; \
+ asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
+ (mxcsr & 0x6000) >> 3; \
+ })
+#undef libc_fegetroundf
+#define libc_fegetroundf() libc_fegetround ()
+// #define libc_fegetroundl() fegetround ()
+
+#undef libc_fesetround
+#define libc_fesetround(r) \
+ do { \
+ unsigned int mxcsr; \
+ asm ("stmxcsr %0" : "=m" (*&mxcsr)); \
+ mxcsr = (mxcsr & ~0x6000) | ((r) << 3); \
+ asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \
+ } while (0)
+#undef libc_fesetroundf
+#define libc_fesetroundf(r) libc_fesetround (r)
+// #define libc_fesetroundl(r) (void) fesetround (r)
+
+#undef libc_feholdexcept
+#define libc_feholdexcept(e) \
+ do { \
+ unsigned int mxcsr; \
+ asm ("stmxcsr %0" : "=m" (*&mxcsr)); \
+ (e)->__mxcsr = mxcsr; \
+ mxcsr = (mxcsr | 0x1f80) & ~0x3f; \
+ asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \
+ } while (0)
+#undef libc_feholdexceptf
+#define libc_feholdexceptf(e) libc_feholdexcept (e)
+// #define libc_feholdexceptl(e) (void) feholdexcept (e)
+
+#undef libc_feholdexcept_setround
+#define libc_feholdexcept_setround(e, r) \
+ do { \
+ unsigned int mxcsr; \
+ asm ("stmxcsr %0" : "=m" (*&mxcsr)); \
+ (e)->__mxcsr = mxcsr; \
+ mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | ((r) << 3); \
+ asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \
+ } while (0)
+#undef libc_feholdexcept_setroundf
+#define libc_feholdexcept_setroundf(e, r) libc_feholdexcept_setround (e, r)
+// #define libc_feholdexcept_setroundl(e, r) ...
+
+#undef libc_fetestexcept
+#define libc_fetestexcept(e) \
+ ({ unsigned int mxcsr; asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
+ mxcsr & (e) & FE_ALL_EXCEPT; })
+#undef libc_fetestexceptf
+#define libc_fetestexceptf(e) libc_fetestexcept (e)
+// #define libc_fetestexceptl(e) fetestexcept (e)
+
+#undef libc_fesetenv
+#define libc_fesetenv(e) \
+ asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr))
+#undef libc_fesetenvf
+#define libc_fesetenvf(e) libc_fesetenv (e)
+// #define libc_fesetenvl(e) (void) fesetenv (e)
+
+#undef libc_feupdateenv
+#define libc_feupdateenv(e) \
+ do { \
+ unsigned int mxcsr; \
+ asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
+ asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr)); \
+ __feraiseexcept (mxcsr & FE_ALL_EXCEPT); \
+ } while (0)
+#undef libc_feupdateenvf
+#define libc_feupdateenvf(e) libc_feupdateenv (e)
+// #define libc_feupdateenvl(e) (void) feupdateenv (e)
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/Makefile b/libc/sysdeps/x86_64/fpu/multiarch/Makefile
new file mode 100644
index 000000000..bd07e98e2
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),math)
+libm-sysdep_routines += s_floor-c s_ceil-c s_floorf-c s_ceilf-c \
+ s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c
+endif
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_ceil-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_ceil-c.c
new file mode 100644
index 000000000..6a5ea3ff2
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_ceil-c.c
@@ -0,0 +1,2 @@
+#define __ceil __ceil_c
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_ceil.S b/libc/sysdeps/x86_64/fpu/multiarch/s_ceil.S
new file mode 100644
index 000000000..d0f8da344
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_ceil.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__ceil)
+ .type __ceil, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __ceil_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __ceil_c(%rip), %rax
+2: ret
+END(__ceil)
+weak_alias (__ceil, ceil)
+
+
+ENTRY(__ceil_sse41)
+ roundsd $2, %xmm0, %xmm0
+ ret
+END(__ceil_sse41)
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_ceilf-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_ceilf-c.c
new file mode 100644
index 000000000..229a6273b
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_ceilf-c.c
@@ -0,0 +1,2 @@
+#define __ceilf __ceilf_c
+#include <sysdeps/ieee754/flt-32/s_ceilf.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_ceilf.S b/libc/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
new file mode 100644
index 000000000..65ce252f6
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_ceilf.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__ceilf)
+ .type __ceilf, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __ceilf_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __ceilf_c(%rip), %rax
+2: ret
+END(__ceilf)
+weak_alias (__ceilf, ceilf)
+
+
+ENTRY(__ceilf_sse41)
+ roundss $2, %xmm0, %xmm0
+ ret
+END(__ceilf_sse41)
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_floor-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_floor-c.c
new file mode 100644
index 000000000..68733b69e
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_floor-c.c
@@ -0,0 +1,3 @@
+#undef __floor
+#define __floor __floor_c
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_floor.S b/libc/sysdeps/x86_64/fpu/multiarch/s_floor.S
new file mode 100644
index 000000000..514ea9541
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_floor.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__floor)
+ .type __floor, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __floor_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __floor_c(%rip), %rax
+2: ret
+END(__floor)
+weak_alias (__floor, floor)
+
+
+ENTRY(__floor_sse41)
+ roundsd $1, %xmm0, %xmm0
+ ret
+END(__floor_sse41)
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_floorf-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_floorf-c.c
new file mode 100644
index 000000000..238636232
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_floorf-c.c
@@ -0,0 +1,3 @@
+#undef __floorf
+#define __floorf __floorf_c
+#include <sysdeps/ieee754/flt-32/s_floorf.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_floorf.S b/libc/sysdeps/x86_64/fpu/multiarch/s_floorf.S
new file mode 100644
index 000000000..d8cd56e49
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_floorf.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__floorf)
+ .type __floorf, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __floorf_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __floorf_c(%rip), %rax
+2: ret
+END(__floorf)
+weak_alias (__floorf, floorf)
+
+
+ENTRY(__floorf_sse41)
+ roundss $1, %xmm0, %xmm0
+ ret
+END(__floorf_sse41)
diff --git a/libc/sysdeps/x86_64/multiarch/s_fma.c b/libc/sysdeps/x86_64/fpu/multiarch/s_fma.c
index 9a680c68f..dca256a51 100644
--- a/libc/sysdeps/x86_64/multiarch/s_fma.c
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_fma.c
@@ -1,5 +1,5 @@
/* FMA version of fma.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -28,13 +28,29 @@ extern double __fma_sse2 (double x, double y, double z) attribute_hidden;
static double
-__fma_fma (double x, double y, double z)
+__fma_fma3 (double x, double y, double z)
{
asm ("vfmadd213sd %3, %2, %0" : "=x" (x) : "0" (x), "x" (y), "xm" (z));
return x;
}
-libm_ifunc (__fma, HAS_FMA ? __fma_fma : __fma_sse2);
+
+# ifdef HAVE_FMA4_SUPPORT
+static double
+__fma_fma4 (double x, double y, double z)
+{
+ asm ("vfmaddsd %3, %2, %1, %0" : "=x" (x) : "x" (x), "xm" (y), "xm" (z));
+ return x;
+}
+# else
+# undef HAS_FMA4
+# define HAS_FMA4 0
+# define __fma_fma4 ((void *) 0)
+# endif
+
+
+libm_ifunc (__fma, HAS_FMA
+ ? __fma_fma3 : (HAS_FMA4 ? __fma_fma4 : __fma_sse2));
weak_alias (__fma, fma)
# define __fma __fma_sse2
diff --git a/libc/sysdeps/x86_64/multiarch/s_fmaf.c b/libc/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
index 85ef65a50..0dcf273ea 100644
--- a/libc/sysdeps/x86_64/multiarch/s_fmaf.c
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_fmaf.c
@@ -1,5 +1,5 @@
/* FMA version of fmaf.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 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
@@ -27,13 +27,29 @@ extern float __fmaf_sse2 (float x, float y, float z) attribute_hidden;
static float
-__fmaf_fma (float x, float y, float z)
+__fmaf_fma3 (float x, float y, float z)
{
asm ("vfmadd213ss %3, %2, %0" : "=x" (x) : "0" (x), "x" (y), "xm" (z));
return x;
}
-libm_ifunc (__fmaf, HAS_FMA ? __fmaf_fma : __fmaf_sse2);
+
+# ifdef HAVE_FMA4_SUPPORT
+static float
+__fmaf_fma4 (float x, float y, float z)
+{
+ asm ("vfmaddss %3, %2, %1, %0" : "=x" (x) : "x" (x), "xm" (y), "xm" (z));
+ return x;
+}
+# else
+# undef HAS_FMA4
+# define HAS_FMA4 0
+# define __fmaf_fma4 ((void *) 0)
+# endif
+
+
+libm_ifunc (__fmaf, HAS_FMA
+ ? __fmaf_fma3 : (HAS_FMA4 ? __fmaf_fma4 : __fmaf_sse2));
weak_alias (__fmaf, fmaf)
# define __fmaf __fmaf_sse2
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c
new file mode 100644
index 000000000..f897a2a6a
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint-c.c
@@ -0,0 +1,3 @@
+#undef __nearbyint
+#define __nearbyint __nearbyint_c
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
new file mode 100644
index 000000000..8ed90e7fd
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyint.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__nearbyint)
+ .type __nearbyint, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __nearbyint_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __nearbyint_c(%rip), %rax
+2: ret
+END(__nearbyint)
+weak_alias (__nearbyint, nearbyint)
+
+
+ENTRY(__nearbyint_sse41)
+ roundsd $0xc, %xmm0, %xmm0
+ ret
+END(__nearbyint_sse41)
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf-c.c
new file mode 100644
index 000000000..aa7768233
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf-c.c
@@ -0,0 +1,3 @@
+#undef __nearbyintf
+#define __nearbyintf __nearbyintf_c
+#include <sysdeps/ieee754/flt-32/s_nearbyintf.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
new file mode 100644
index 000000000..943f35d6a
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__nearbyintf)
+ .type __nearbyintf, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __nearbyintf_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __nearbyintf_c(%rip), %rax
+2: ret
+END(__nearbyintf)
+weak_alias (__nearbyintf, nearbyintf)
+
+
+ENTRY(__nearbyintf_sse41)
+ roundss $0xc, %xmm0, %xmm0
+ ret
+END(__nearbyintf_sse41)
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_rint-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_rint-c.c
new file mode 100644
index 000000000..162a630ff
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_rint-c.c
@@ -0,0 +1,3 @@
+#undef __rint
+#define __rint __rint_c
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_rint.S b/libc/sysdeps/x86_64/fpu/multiarch/s_rint.S
new file mode 100644
index 000000000..75beffad9
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_rint.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__rint)
+ .type __rint, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __rint_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __rint_c(%rip), %rax
+2: ret
+END(__rint)
+weak_alias (__rint, rint)
+
+
+ENTRY(__rint_sse41)
+ roundsd $4, %xmm0, %xmm0
+ ret
+END(__rint_sse41)
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_rintf-c.c b/libc/sysdeps/x86_64/fpu/multiarch/s_rintf-c.c
new file mode 100644
index 000000000..8505249f3
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_rintf-c.c
@@ -0,0 +1,3 @@
+#undef __rintf
+#define __rintf __rintf_c
+#include <sysdeps/ieee754/flt-32/s_rintf.c>
diff --git a/libc/sysdeps/x86_64/fpu/multiarch/s_rintf.S b/libc/sysdeps/x86_64/fpu/multiarch/s_rintf.S
new file mode 100644
index 000000000..512d28cac
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/multiarch/s_rintf.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gmail.come>, 2011.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <machine/asm.h>
+#include <init-arch.h>
+
+
+ENTRY(__rintf)
+ .type __rintf, @gnu_indirect_function
+ call __get_cpu_features@plt
+ movq %rax, %rdx
+ leaq __rintf_sse41(%rip), %rax
+ testl $bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+ jnz 2f
+ leaq __rintf_c(%rip), %rax
+2: ret
+END(__rintf)
+weak_alias (__rintf, rintf)
+
+
+ENTRY(__rintf_sse41)
+ roundss $4, %xmm0, %xmm0
+ ret
+END(__rintf_sse41)
diff --git a/libc/sysdeps/x86_64/fpu/s_copysign.S b/libc/sysdeps/x86_64/fpu/s_copysign.S
index f3d9b0cbb..66c36c88e 100644
--- a/libc/sysdeps/x86_64/fpu/s_copysign.S
+++ b/libc/sysdeps/x86_64/fpu/s_copysign.S
@@ -1,5 +1,5 @@
/* copy sign, double version.
- Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -21,7 +21,7 @@
#include <machine/asm.h>
#ifdef __ELF__
- .section .rodata
+ .section .rodata.cst16,"aM",@progbits,16
#else
.text
#endif
diff --git a/libc/sysdeps/x86_64/memchr.S b/libc/sysdeps/x86_64/memchr.S
index 6082aa7f7..895a014f5 100644
--- a/libc/sysdeps/x86_64/memchr.S
+++ b/libc/sysdeps/x86_64/memchr.S
@@ -1,5 +1,5 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- Contributed by Ulrich Drepper <drepper@redhat.com>.
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,50 +19,294 @@
#include <sysdep.h>
+/* fast SSE2 version with using pmaxub and 64 byte loop */
.text
-ENTRY (memchr)
- movd %esi, %xmm1
- movq %rdi, %rcx
+ENTRY(memchr)
+ movd %rsi, %xmm1
+ mov %rdi, %rcx
+
punpcklbw %xmm1, %xmm1
- andq $~15, %rdi
- testq %rdx, %rdx
+ test %rdx, %rdx
+ jz L(return_null)
punpcklbw %xmm1, %xmm1
- jz 3f
- orl $0xffffffff, %esi
- movdqa (%rdi), %xmm0
+
+ and $63, %rcx
pshufd $0, %xmm1, %xmm1
- subq %rdi, %rcx
+
+ cmp $48, %rcx
+ ja L(crosscache)
+
+ movdqu (%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+
+ jnz L(matches_1)
+ sub $16, %rdx
+ jbe L(return_null)
+ add $16, %rdi
+ and $15, %rcx
+ and $-16, %rdi
+ add %rcx, %rdx
+ sub $64, %rdx
+ jbe L(exit_loop)
+ jmp L(loop_prolog)
+
+ .p2align 4
+L(crosscache):
+ and $15, %rcx
+ and $-16, %rdi
+ movdqa (%rdi), %xmm0
+
+ pcmpeqb %xmm1, %xmm0
+/* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+/* Remove the leading bytes. */
+ sar %cl, %eax
+ test %eax, %eax
+ je L(unaligned_no_match)
+/* Check which byte is a match. */
+ bsf %eax, %eax
+
+ sub %rax, %rdx
+ jbe L(return_null)
+ add %rdi, %rax
+ add %rcx, %rax
+ ret
+
+ .p2align 4
+L(unaligned_no_match):
+ add %rcx, %rdx
+ sub $16, %rdx
+ jbe L(return_null)
+ add $16, %rdi
+ sub $64, %rdx
+ jbe L(exit_loop)
+
+ .p2align 4
+L(loop_prolog):
+ movdqa (%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ movdqa 16(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 48(%rdi), %xmm4
+ pcmpeqb %xmm1, %xmm4
+ add $64, %rdi
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ test $0x3f, %rdi
+ jz L(align64_loop)
+
+ sub $64, %rdx
+ jbe L(exit_loop)
+
+ movdqa (%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ movdqa 16(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 48(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+
+ add $64, %rdi
+ test %eax, %eax
+ jnz L(matches0)
+
+ mov %rdi, %rcx
+ and $-64, %rdi
+ and $63, %rcx
+ add %rcx, %rdx
+
+ .p2align 4
+L(align64_loop):
+ sub $64, %rdx
+ jbe L(exit_loop)
+ movdqa (%rdi), %xmm0
+ movdqa 16(%rdi), %xmm2
+ movdqa 32(%rdi), %xmm3
+ movdqa 48(%rdi), %xmm4
+
+ pcmpeqb %xmm1, %xmm0
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm1, %xmm3
+ pcmpeqb %xmm1, %xmm4
+
+ pmaxub %xmm0, %xmm3
+ pmaxub %xmm2, %xmm4
+ pmaxub %xmm3, %xmm4
+ pmovmskb %xmm4, %eax
+
+ add $64, %rdi
+
+ test %eax, %eax
+ jz L(align64_loop)
+
+ sub $64, %rdi
+
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+
+ pcmpeqb 48(%rdi), %xmm1
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ pmovmskb %xmm1, %eax
+ bsf %eax, %eax
+ lea 48(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(exit_loop):
+ add $32, %rdx
+ jle L(exit_loop_32)
+
+ movdqa (%rdi), %xmm0
pcmpeqb %xmm1, %xmm0
- addq %rcx, %rdx
- shl %cl, %esi
- pmovmskb %xmm0, %ecx
- andl %esi, %ecx
- movl $16, %esi
- jnz 1f
- cmpq %rsi, %rdx
- jbe 3f
-
-2: movdqa (%rdi,%rsi), %xmm0
- leaq 16(%rsi), %rsi
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ movdqa 16(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32_1)
+ sub $16, %rdx
+ jle L(return_null)
+
+ pcmpeqb 48(%rdi), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches48_1)
+ xor %rax, %rax
+ ret
+
+ .p2align 4
+L(exit_loop_32):
+ add $32, %rdx
+ movdqa (%rdi), %xmm0
pcmpeqb %xmm1, %xmm0
- pmovmskb %xmm0, %ecx
- testl %ecx, %ecx
- jnz 1f
- cmpq %rsi, %rdx
- ja 2b
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches_1)
+ sub $16, %rdx
+ jbe L(return_null)
-3: xorl %eax, %eax
+ pcmpeqb 16(%rdi), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches16_1)
+ xor %rax, %rax
ret
-1: leaq -16(%rdi,%rsi), %rax
- bsfl %ecx, %ecx
- addq %rcx, %rax
- leaq -16(%rsi,%rcx), %rsi
- cmpq %rsi, %rdx
- jbe 3b
+ .p2align 4
+L(matches0):
+ bsf %eax, %eax
+ lea -16(%rax, %rdi), %rax
ret
-END (memchr)
+
+ .p2align 4
+L(matches):
+ bsf %eax, %eax
+ add %rdi, %rax
+ ret
+
+ .p2align 4
+L(matches16):
+ bsf %eax, %eax
+ lea 16(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(matches32):
+ bsf %eax, %eax
+ lea 32(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(matches_1):
+ bsf %eax, %eax
+ sub %rax, %rdx
+ jbe L(return_null)
+ add %rdi, %rax
+ ret
+
+ .p2align 4
+L(matches16_1):
+ bsf %eax, %eax
+ sub %rax, %rdx
+ jbe L(return_null)
+ lea 16(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(matches32_1):
+ bsf %eax, %eax
+ sub %rax, %rdx
+ jbe L(return_null)
+ lea 32(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(matches48_1):
+ bsf %eax, %eax
+ sub %rax, %rdx
+ jbe L(return_null)
+ lea 48(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(return_null):
+ xor %rax, %rax
+ ret
+END(memchr)
strong_alias (memchr, __memchr)
-libc_hidden_builtin_def (memchr)
+
+libc_hidden_builtin_def(memchr)
diff --git a/libc/sysdeps/x86_64/memrchr.S b/libc/sysdeps/x86_64/memrchr.S
new file mode 100644
index 000000000..70adca379
--- /dev/null
+++ b/libc/sysdeps/x86_64/memrchr.S
@@ -0,0 +1,383 @@
+/* fast SSE2 memrchr with 64 byte loop and pmaxub instruction using
+
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY (memrchr)
+ movd %rsi, %xmm1
+
+ sub $16, %rdx
+ jbe L(length_less16)
+
+ punpcklbw %xmm1, %xmm1
+ punpcklbw %xmm1, %xmm1
+
+ add %rdx, %rdi
+ pshufd $0, %xmm1, %xmm1
+
+ movdqu (%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+
+/* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ sub $64, %rdi
+ mov %rdi, %rcx
+ and $15, %rcx
+ jz L(loop_prolog)
+
+ add $16, %rdi
+ add $16, %rdx
+ and $-16, %rdi
+ sub %rcx, %rdx
+
+ .p2align 4
+L(loop_prolog):
+ sub $64, %rdx
+ jbe L(exit_loop)
+
+ movdqa 48(%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa (%rdi), %xmm4
+ pcmpeqb %xmm1, %xmm4
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ sub $64, %rdi
+ sub $64, %rdx
+ jbe L(exit_loop)
+
+ movdqa 48(%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa (%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ mov %rdi, %rcx
+ and $63, %rcx
+ jz L(align64_loop)
+
+ add $64, %rdi
+ add $64, %rdx
+ and $-64, %rdi
+ sub %rcx, %rdx
+
+ .p2align 4
+L(align64_loop):
+ sub $64, %rdi
+ sub $64, %rdx
+ jbe L(exit_loop)
+
+ movdqa (%rdi), %xmm0
+ movdqa 16(%rdi), %xmm2
+ movdqa 32(%rdi), %xmm3
+ movdqa 48(%rdi), %xmm4
+
+ pcmpeqb %xmm1, %xmm0
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm1, %xmm3
+ pcmpeqb %xmm1, %xmm4
+
+ pmaxub %xmm3, %xmm0
+ pmaxub %xmm4, %xmm2
+ pmaxub %xmm0, %xmm2
+ pmovmskb %xmm2, %eax
+
+ test %eax, %eax
+ jz L(align64_loop)
+
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%rdi), %xmm2
+
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb (%rdi), %xmm1
+
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ pmovmskb %xmm1, %eax
+ bsr %eax, %eax
+
+ add %rdi, %rax
+ ret
+
+ .p2align 4
+L(exit_loop):
+ add $64, %rdx
+ cmp $32, %rdx
+ jbe L(exit_loop_32)
+
+ movdqa 48(%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48)
+
+ movdqa 32(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 16(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches16_1)
+ cmp $48, %rdx
+ jbe L(return_null)
+
+ pcmpeqb (%rdi), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches0_1)
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(exit_loop_32):
+ movdqa 48(%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches48_1)
+ cmp $16, %rdx
+ jbe L(return_null)
+
+ pcmpeqb 32(%rdi), %xmm1
+ pmovmskb %xmm1, %eax
+ test %eax, %eax
+ jnz L(matches32_1)
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+L(matches0):
+ bsr %eax, %eax
+ add %rdi, %rax
+ ret
+
+ .p2align 4
+L(matches16):
+ bsr %eax, %eax
+ lea 16(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(matches32):
+ bsr %eax, %eax
+ lea 32(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(matches48):
+ bsr %eax, %eax
+ lea 48(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(matches0_1):
+ bsr %eax, %eax
+ sub $64, %rdx
+ add %rax, %rdx
+ jl L(return_null)
+ add %rdi, %rax
+ ret
+
+ .p2align 4
+L(matches16_1):
+ bsr %eax, %eax
+ sub $48, %rdx
+ add %rax, %rdx
+ jl L(return_null)
+ lea 16(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(matches32_1):
+ bsr %eax, %eax
+ sub $32, %rdx
+ add %rax, %rdx
+ jl L(return_null)
+ lea 32(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(matches48_1):
+ bsr %eax, %eax
+ sub $16, %rdx
+ add %rax, %rdx
+ jl L(return_null)
+ lea 48(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(return_null):
+ xor %rax, %rax
+ ret
+
+ .p2align 4
+L(length_less16_offset0):
+ test %edx, %edx
+ jz L(return_null)
+
+ mov %dl, %cl
+ pcmpeqb (%rdi), %xmm1
+
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ pmovmskb %xmm1, %eax
+
+ and %edx, %eax
+ test %eax, %eax
+ jz L(return_null)
+
+ bsr %eax, %eax
+ add %rdi, %rax
+ ret
+
+ .p2align 4
+L(length_less16):
+ punpcklbw %xmm1, %xmm1
+ punpcklbw %xmm1, %xmm1
+
+ add $16, %rdx
+
+ pshufd $0, %xmm1, %xmm1
+
+ mov %rdi, %rcx
+ and $15, %rcx
+ jz L(length_less16_offset0)
+
+ mov %rdi, %rcx
+ and $15, %rcx
+ mov %cl, %dh
+ mov %rcx, %r8
+ add %dl, %dh
+ and $-16, %rdi
+
+ sub $16, %dh
+ ja L(length_less16_part2)
+
+ pcmpeqb (%rdi), %xmm1
+ pmovmskb %xmm1, %eax
+
+ sar %cl, %eax
+ mov %dl, %cl
+
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ and %edx, %eax
+ test %eax, %eax
+ jz L(return_null)
+
+ bsr %eax, %eax
+ add %rdi, %rax
+ add %r8, %rax
+ ret
+
+ .p2align 4
+L(length_less16_part2):
+ movdqa 16(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+
+ mov %dh, %cl
+ mov $1, %edx
+ sal %cl, %edx
+ sub $1, %edx
+
+ and %edx, %eax
+
+ test %eax, %eax
+ jnz L(length_less16_part2_return)
+
+ pcmpeqb (%rdi), %xmm1
+ pmovmskb %xmm1, %eax
+
+ mov %r8, %rcx
+ sar %cl, %eax
+ test %eax, %eax
+ jz L(return_null)
+
+ bsr %eax, %eax
+ add %rdi, %rax
+ add %r8, %rax
+ ret
+
+ .p2align 4
+L(length_less16_part2_return):
+ bsr %eax, %eax
+ lea 16(%rax, %rdi), %rax
+ ret
+
+END (memrchr)
+strong_alias (memrchr, __memrchr)
diff --git a/libc/sysdeps/x86_64/multiarch/Makefile b/libc/sysdeps/x86_64/multiarch/Makefile
index a5254dc93..4cf4cf4b2 100644
--- a/libc/sysdeps/x86_64/multiarch/Makefile
+++ b/libc/sysdeps/x86_64/multiarch/Makefile
@@ -9,13 +9,14 @@ sysdep_routines += strncat-c stpncpy-c strncpy-c strcmp-ssse3 strncmp-ssse3 \
strend-sse4 memcmp-sse4 memcpy-ssse3 mempcpy-ssse3 \
memmove-ssse3 memcpy-ssse3-back mempcpy-ssse3-back \
memmove-ssse3-back strcasestr-nonascii strcasecmp_l-ssse3 \
- strncase_l-ssse3 strlen-sse4 strlen-no-bsf memset-x86-64 \
+ strncase_l-ssse3 strlen-sse4 strlen-sse2-no-bsf memset-x86-64 \
strcpy-ssse3 strncpy-ssse3 stpcpy-ssse3 stpncpy-ssse3 \
strcpy-sse2-unaligned strncpy-sse2-unaligned \
stpcpy-sse2-unaligned stpncpy-sse2-unaligned \
strcat-sse2-unaligned strncat-sse2-unaligned \
strcat-ssse3 strncat-ssse3 strlen-sse2-pminub \
- strrchr-sse2-no-bsf strchr-sse2-no-bsf
+ strnlen-sse2-no-bsf strrchr-sse2-no-bsf strchr-sse2-no-bsf \
+ memcmp-ssse3 wmemcmp-sse4 wmemcmp-ssse3 wmemcmp-c
ifeq (yes,$(config-cflags-sse4))
sysdep_routines += strcspn-c strpbrk-c strspn-c strstr-c strcasestr-c varshift
CFLAGS-varshift.c += -msse4
diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.c b/libc/sysdeps/x86_64/multiarch/init-arch.c
index 0a145ca25..65b0ee93e 100644
--- a/libc/sysdeps/x86_64/multiarch/init-arch.c
+++ b/libc/sysdeps/x86_64/multiarch/init-arch.c
@@ -86,7 +86,7 @@ __init_cpu_features (void)
default:
/* Unknown family 0x06 processors. Assuming this is one
- of Core i3/i5/i7 processors if AVX is available. */
+ of Core i3/i5/i7 processors if AVX is available. */
if ((ecx & bit_AVX) == 0)
break;
@@ -124,13 +124,22 @@ __init_cpu_features (void)
get_common_indeces (&family, &model);
- unsigned int ecx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx;
+ ecx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx;
/* AMD processors prefer SSE instructions for memory/string routines
if they are available, otherwise they prefer integer instructions. */
if ((ecx & 0x200))
__cpu_features.feature[index_Prefer_SSE_for_memop]
|= bit_Prefer_SSE_for_memop;
+
+ unsigned int eax;
+ __cpuid (0x80000000, eax, ebx, ecx, edx);
+ if (eax >= 0x80000001)
+ __cpuid (0x80000001,
+ __cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].eax,
+ __cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ebx,
+ __cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ecx,
+ __cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].edx);
}
else
kind = arch_kind_other;
diff --git a/libc/sysdeps/x86_64/multiarch/init-arch.h b/libc/sysdeps/x86_64/multiarch/init-arch.h
index 6cfdbddc4..2fb6f75b6 100644
--- a/libc/sysdeps/x86_64/multiarch/init-arch.h
+++ b/libc/sysdeps/x86_64/multiarch/init-arch.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -31,11 +31,13 @@
# define bit_SSSE3 (1 << 9)
# define bit_SSE4_1 (1 << 19)
# define bit_SSE4_2 (1 << 20)
+# define bit_AVX (1 << 28)
# define index_SSE2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET
# define index_SSSE3 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
# define index_SSE4_1 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
# define index_SSE4_2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
+# define index_AVX COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
# define index_Fast_Rep_String FEATURE_INDEX_1*FEATURE_SIZE
# define index_Fast_Copy_Backward FEATURE_INDEX_1*FEATURE_SIZE
@@ -51,6 +53,7 @@
enum
{
COMMON_CPUID_INDEX_1 = 0,
+ COMMON_CPUID_INDEX_80000001, /* for AMD */
/* Keep the following line at the end. */
COMMON_CPUID_INDEX_MAX
};
@@ -111,6 +114,7 @@ extern const struct cpu_features *__get_cpu_features (void)
# define HAS_SSE4_1 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 19)
# define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 20)
# define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 12)
+# define HAS_FMA4 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_80000001, ecx, 16)
# define index_Fast_Rep_String FEATURE_INDEX_1
# define index_Fast_Copy_Backward FEATURE_INDEX_1
diff --git a/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S b/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S
index fc439bb01..28dd505d9 100644
--- a/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S
+++ b/libc/sysdeps/x86_64/multiarch/memcmp-sse4.S
@@ -1,5 +1,5 @@
-/* memcmp with SSE4.1
- Copyright (C) 2010 Free Software Foundation, Inc.
+/* memcmp with SSE4.1, wmemcmp with SSE4.1
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -20,43 +20,54 @@
#ifndef NOT_IN_libc
-#include <sysdep.h>
-#include "asm-syntax.h"
+# include <sysdep.h>
-#ifndef MEMCMP
-# define MEMCMP __memcmp_sse4_1
-#endif
+# ifndef MEMCMP
+# define MEMCMP __memcmp_sse4_1
+# endif
-#ifndef ALIGN
-# define ALIGN(n) .p2align n
-#endif
+# ifndef ALIGN
+# define ALIGN(n) .p2align n
+# endif
-#define JMPTBL(I, B) (I - B)
+# define JMPTBL(I, B) (I - B)
-#define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
+# define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE) \
lea TABLE(%rip), %r11; \
movslq (%r11, INDEX, SCALE), %rcx; \
add %r11, %rcx; \
jmp *%rcx; \
ud2
+/* Warning!
+ wmemcmp has to use SIGNED comparison for elements.
+ memcmp has to use UNSIGNED comparison for elemnts.
+*/
+
.section .text.sse4.1,"ax",@progbits
ENTRY (MEMCMP)
+# ifdef USE_AS_WMEMCMP
+ shl $2, %rdx
+# endif
pxor %xmm0, %xmm0
cmp $79, %rdx
ja L(79bytesormore)
+# ifndef USE_AS_WMEMCMP
cmp $1, %rdx
je L(firstbyte)
+# endif
add %rdx, %rsi
add %rdx, %rdi
BRANCH_TO_JMPTBL_ENTRY(L(table_64bytes), %rdx, 4)
+# ifndef USE_AS_WMEMCMP
ALIGN (4)
L(firstbyte):
movzbl (%rdi), %eax
movzbl (%rsi), %ecx
sub %ecx, %eax
ret
+# endif
ALIGN (4)
L(79bytesormore):
@@ -308,11 +319,11 @@ L(less32bytesin256):
ALIGN (4)
L(512bytesormore):
-#ifdef DATA_CACHE_SIZE_HALF
+# ifdef DATA_CACHE_SIZE_HALF
mov $DATA_CACHE_SIZE_HALF, %r8
-#else
+# else
mov __x86_64_data_cache_size_half(%rip), %r8
-#endif
+# endif
mov %r8, %r9
shr $1, %r8
add %r9, %r8
@@ -624,11 +635,11 @@ L(less32bytesin256in2alinged):
ALIGN (4)
L(512bytesormorein2aligned):
-#ifdef DATA_CACHE_SIZE_HALF
+# ifdef DATA_CACHE_SIZE_HALF
mov $DATA_CACHE_SIZE_HALF, %r8
-#else
+# else
mov __x86_64_data_cache_size_half(%rip), %r8
-#endif
+# endif
mov %r8, %r9
shr $1, %r8
add %r9, %r8
@@ -667,6 +678,7 @@ L(64bytesormore_loopin2aligned):
BRANCH_TO_JMPTBL_ENTRY(L(table_64bytes), %rdx, 4)
L(L2_L3_cache_aglined):
sub $64, %rdx
+
ALIGN (4)
L(L2_L3_aligned_128bytes_loop):
prefetchnta 0x1c0(%rdi)
@@ -803,13 +815,19 @@ L(12bytes):
jne L(diffin8bytes)
L(4bytes):
mov -4(%rsi), %ecx
+# ifndef USE_AS_WMEMCMP
mov -4(%rdi), %eax
cmp %eax, %ecx
+# else
+ cmp -4(%rdi), %ecx
+# endif
jne L(diffin4bytes)
L(0bytes):
xor %eax, %eax
ret
+# ifndef USE_AS_WMEMCMP
+/* unreal case for wmemcmp */
ALIGN (4)
L(65bytes):
movdqu -65(%rdi), %xmm1
@@ -1017,6 +1035,7 @@ L(1bytes):
movzbl -1(%rsi), %ecx
sub %ecx, %eax
ret
+# endif
ALIGN (4)
L(68bytes):
@@ -1047,13 +1066,20 @@ L(20bytes):
pxor %xmm1, %xmm2
ptest %xmm2, %xmm0
jnc L(less16bytes)
- mov -4(%rdi), %eax
mov -4(%rsi), %ecx
+
+# ifndef USE_AS_WMEMCMP
+ mov -4(%rdi), %eax
cmp %eax, %ecx
+# else
+ cmp -4(%rdi), %ecx
+# endif
jne L(diffin4bytes)
xor %eax, %eax
ret
+# ifndef USE_AS_WMEMCMP
+/* unreal cases for wmemcmp */
ALIGN (4)
L(69bytes):
movdqu -69(%rsi), %xmm1
@@ -1161,6 +1187,7 @@ L(23bytes):
jne L(diffin8bytes)
xor %eax, %eax
ret
+# endif
ALIGN (4)
L(72bytes):
@@ -1191,13 +1218,16 @@ L(24bytes):
pxor %xmm1, %xmm2
ptest %xmm2, %xmm0
jnc L(less16bytes)
- mov -8(%rdi), %rax
+
mov -8(%rsi), %rcx
+ mov -8(%rdi), %rax
cmp %rax, %rcx
jne L(diffin8bytes)
xor %eax, %eax
ret
+# ifndef USE_AS_WMEMCMP
+/* unreal cases for wmemcmp */
ALIGN (4)
L(73bytes):
movdqu -73(%rsi), %xmm1
@@ -1312,7 +1342,7 @@ L(27bytes):
jne L(diffin4bytes)
xor %eax, %eax
ret
-
+# endif
ALIGN (4)
L(76bytes):
movdqu -76(%rsi), %xmm1
@@ -1346,13 +1376,19 @@ L(28bytes):
mov -12(%rsi), %rcx
cmp %rax, %rcx
jne L(diffin8bytes)
- mov -4(%rdi), %eax
mov -4(%rsi), %ecx
+# ifndef USE_AS_WMEMCMP
+ mov -4(%rdi), %eax
cmp %eax, %ecx
+# else
+ cmp -4(%rdi), %ecx
+# endif
jne L(diffin4bytes)
xor %eax, %eax
ret
+# ifndef USE_AS_WMEMCMP
+/* unreal cases for wmemcmp */
ALIGN (4)
L(77bytes):
movdqu -77(%rsi), %xmm1
@@ -1474,7 +1510,7 @@ L(31bytes):
jne L(diffin8bytes)
xor %eax, %eax
ret
-
+# endif
ALIGN (4)
L(64bytes):
movdqu -64(%rdi), %xmm2
@@ -1527,7 +1563,17 @@ L(diffin8bytes):
jne L(diffin4bytes)
shr $32, %rcx
shr $32, %rax
+
+# ifdef USE_AS_WMEMCMP
+/* for wmemcmp */
+ cmp %eax, %ecx
+ jne L(diffin4bytes)
+ xor %eax, %eax
+ ret
+# endif
+
L(diffin4bytes):
+# ifndef USE_AS_WMEMCMP
cmp %cx, %ax
jne L(diffin2bytes)
shr $16, %ecx
@@ -1546,11 +1592,28 @@ L(end):
and $0xff, %ecx
sub %ecx, %eax
ret
+# else
+
+/* for wmemcmp */
+ mov $1, %eax
+ jl L(nequal_bigger)
+ neg %eax
+ ret
+
+ ALIGN (4)
+L(nequal_bigger):
+ ret
+
+L(unreal_case):
+ xor %eax, %eax
+ ret
+# endif
END (MEMCMP)
.section .rodata.sse4.1,"a",@progbits
ALIGN (3)
+# ifndef USE_AS_WMEMCMP
L(table_64bytes):
.int JMPTBL (L(0bytes), L(table_64bytes))
.int JMPTBL (L(1bytes), L(table_64bytes))
@@ -1632,4 +1695,87 @@ L(table_64bytes):
.int JMPTBL (L(77bytes), L(table_64bytes))
.int JMPTBL (L(78bytes), L(table_64bytes))
.int JMPTBL (L(79bytes), L(table_64bytes))
+# else
+L(table_64bytes):
+ .int JMPTBL (L(0bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(4bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(8bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(12bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(16bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(20bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(24bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(28bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(32bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(36bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(40bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(44bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(48bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(52bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(56bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(60bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(64bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(68bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(72bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(76bytes), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+ .int JMPTBL (L(unreal_case), L(table_64bytes))
+# endif
#endif
diff --git a/libc/sysdeps/x86_64/multiarch/memcmp-ssse3.S b/libc/sysdeps/x86_64/multiarch/memcmp-ssse3.S
new file mode 100644
index 000000000..e35a23ee7
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/memcmp-ssse3.S
@@ -0,0 +1,1997 @@
+/* memcmp with SSSE3, wmemcmp with SSSE3
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef NOT_IN_libc
+
+# include <sysdep.h>
+
+# ifndef MEMCMP
+# define MEMCMP __memcmp_ssse3
+# endif
+
+# ifndef ALIGN
+# define ALIGN(n) .p2align n
+# endif
+
+/* Warning!
+ wmemcmp has to use SIGNED comparison for elements.
+ memcmp has to use UNSIGNED comparison for elemnts.
+*/
+
+ atom_text_section
+ENTRY (MEMCMP)
+# ifdef USE_AS_WMEMCMP
+ shl $2, %rdx
+ test %rdx, %rdx
+ jz L(equal)
+# endif
+ mov %rdx, %rcx
+ mov %rdi, %rdx
+ cmp $48, %rcx;
+ jae L(48bytesormore) /* LEN => 48 */
+
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+/* ECX >= 32. */
+L(48bytesormore):
+ movdqu (%rdi), %xmm3
+ movdqu (%rsi), %xmm0
+ pcmpeqb %xmm0, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 16(%rdi), %rdi
+ lea 16(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(less16bytes)
+ mov %edi, %edx
+ and $0xf, %edx
+ xor %rdx, %rdi
+ sub %rdx, %rsi
+ add %rdx, %rcx
+ mov %esi, %edx
+ and $0xf, %edx
+ jz L(shr_0)
+ xor %rdx, %rsi
+
+# ifndef USE_AS_WMEMCMP
+ cmp $8, %edx
+ jae L(next_unaligned_table)
+ cmp $0, %edx
+ je L(shr_0)
+ cmp $1, %edx
+ je L(shr_1)
+ cmp $2, %edx
+ je L(shr_2)
+ cmp $3, %edx
+ je L(shr_3)
+ cmp $4, %edx
+ je L(shr_4)
+ cmp $5, %edx
+ je L(shr_5)
+ cmp $6, %edx
+ je L(shr_6)
+ jmp L(shr_7)
+
+ ALIGN (2)
+L(next_unaligned_table):
+ cmp $8, %edx
+ je L(shr_8)
+ cmp $9, %edx
+ je L(shr_9)
+ cmp $10, %edx
+ je L(shr_10)
+ cmp $11, %edx
+ je L(shr_11)
+ cmp $12, %edx
+ je L(shr_12)
+ cmp $13, %edx
+ je L(shr_13)
+ cmp $14, %edx
+ je L(shr_14)
+ jmp L(shr_15)
+# else
+ cmp $0, %edx
+ je L(shr_0)
+ cmp $4, %edx
+ je L(shr_4)
+ cmp $8, %edx
+ je L(shr_8)
+ jmp L(shr_12)
+# endif
+
+ ALIGN (4)
+L(shr_0):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ jae L(shr_0_gobble)
+ xor %eax, %eax
+ movdqa (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+ movdqa 16(%rsi), %xmm2
+ pcmpeqb 16(%rdi), %xmm2
+ pand %xmm1, %xmm2
+ pmovmskb %xmm2, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_0_gobble):
+ movdqa (%rsi), %xmm0
+ xor %eax, %eax
+ pcmpeqb (%rdi), %xmm0
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm2
+ pcmpeqb 16(%rdi), %xmm2
+L(shr_0_gobble_loop):
+ pand %xmm0, %xmm2
+ sub $32, %rcx
+ pmovmskb %xmm2, %edx
+ movdqa %xmm0, %xmm1
+ movdqa 32(%rsi), %xmm0
+ movdqa 48(%rsi), %xmm2
+ sbb $0xffff, %edx
+ pcmpeqb 32(%rdi), %xmm0
+ pcmpeqb 48(%rdi), %xmm2
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ jz L(shr_0_gobble_loop)
+
+ pand %xmm0, %xmm2
+ cmp $0, %rcx
+ jge L(next)
+ inc %edx
+ add $32, %rcx
+L(next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm2, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+# ifndef USE_AS_WMEMCMP
+
+ ALIGN (4)
+L(shr_1):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_1_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $1, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $1, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $1, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_1_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $1, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $1, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_1_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $1, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $1, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_1_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_1_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_1_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 1(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+
+ ALIGN (4)
+L(shr_2):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_2_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $2, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $2, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $2, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_2_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $2, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $2, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_2_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $2, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $2, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_2_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_2_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_2_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 2(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_3):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_3_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $3, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $3, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $3, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_3_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $3, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $3, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_3_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $3, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $3, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_3_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_3_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_3_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 3(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+# endif
+
+ ALIGN (4)
+L(shr_4):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_4_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $4, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $4, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $4, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_4_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $4, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $4, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_4_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $4, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $4, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_4_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_4_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_4_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 4(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+# ifndef USE_AS_WMEMCMP
+
+ ALIGN (4)
+L(shr_5):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_5_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $5, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $5, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $5, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_5_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $5, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $5, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_5_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $5, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $5, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_5_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_5_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_5_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 5(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_6):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_6_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $6, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $6, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $6, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_6_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $6, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $6, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_6_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $6, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $6, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_6_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_6_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_6_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 6(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_7):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_7_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $7, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $7, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $7, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_7_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $7, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $7, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_7_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $7, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $7, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_7_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_7_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_7_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 7(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+# endif
+
+ ALIGN (4)
+L(shr_8):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_8_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $8, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $8, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $8, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_8_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $8, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $8, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_8_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $8, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $8, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_8_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_8_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_8_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 8(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+# ifndef USE_AS_WMEMCMP
+
+ ALIGN (4)
+L(shr_9):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_9_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $9, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $9, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $9, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_9_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $9, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $9, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_9_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $9, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $9, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_9_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_9_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_9_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 9(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_10):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_10_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $10, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $10, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $10, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_10_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $10, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $10, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_10_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $10, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $10, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_10_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_10_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_10_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 10(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_11):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_11_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $11, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $11, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $11, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_11_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $11, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $11, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_11_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $11, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $11, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_11_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_11_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_11_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 11(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+# endif
+
+ ALIGN (4)
+L(shr_12):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_12_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $12, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $12, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $12, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_12_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $12, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $12, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_12_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $12, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $12, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_12_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_12_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_12_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 12(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+# ifndef USE_AS_WMEMCMP
+
+ ALIGN (4)
+L(shr_13):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_13_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $13, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $13, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $13, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_13_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $13, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $13, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_13_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $13, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $13, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_13_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_13_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_13_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 13(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_14):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_14_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $14, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $14, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $14, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_14_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $14, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $14, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_14_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $14, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $14, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_14_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_14_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_14_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 14(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_15):
+ cmp $80, %rcx
+ lea -48(%rcx), %rcx
+ mov %edx, %eax
+ jae L(shr_15_gobble)
+
+ movdqa 16(%rsi), %xmm1
+ movdqa %xmm1, %xmm2
+ palignr $15, (%rsi), %xmm1
+ pcmpeqb (%rdi), %xmm1
+
+ movdqa 32(%rsi), %xmm3
+ palignr $15, %xmm2, %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+ pand %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+ add $15, %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+
+ ALIGN (4)
+L(shr_15_gobble):
+ sub $32, %rcx
+ movdqa 16(%rsi), %xmm0
+ palignr $15, (%rsi), %xmm0
+ pcmpeqb (%rdi), %xmm0
+
+ movdqa 32(%rsi), %xmm3
+ palignr $15, 16(%rsi), %xmm3
+ pcmpeqb 16(%rdi), %xmm3
+
+L(shr_15_gobble_loop):
+ pand %xmm0, %xmm3
+ sub $32, %rcx
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+
+ movdqa 64(%rsi), %xmm3
+ palignr $15, 48(%rsi), %xmm3
+ sbb $0xffff, %edx
+ movdqa 48(%rsi), %xmm0
+ palignr $15, 32(%rsi), %xmm0
+ pcmpeqb 32(%rdi), %xmm0
+ lea 32(%rsi), %rsi
+ pcmpeqb 48(%rdi), %xmm3
+
+ lea 32(%rdi), %rdi
+ jz L(shr_15_gobble_loop)
+ pand %xmm0, %xmm3
+
+ cmp $0, %rcx
+ jge L(shr_15_gobble_next)
+ inc %edx
+ add $32, %rcx
+L(shr_15_gobble_next):
+ test %edx, %edx
+ jnz L(exit)
+
+ pmovmskb %xmm3, %edx
+ movdqa %xmm0, %xmm1
+ lea 32(%rdi), %rdi
+ lea 32(%rsi), %rsi
+ sub $0xffff, %edx
+ jnz L(exit)
+
+ lea 15(%rsi), %rsi
+ add %rcx, %rsi
+ add %rcx, %rdi
+ jmp L(less48bytes)
+# endif
+ ALIGN (4)
+L(exit):
+ pmovmskb %xmm1, %r8d
+ sub $0xffff, %r8d
+ jz L(first16bytes)
+ lea -16(%rsi), %rsi
+ lea -16(%rdi), %rdi
+ mov %r8d, %edx
+L(first16bytes):
+ add %rax, %rsi
+L(less16bytes):
+# ifndef USE_AS_WMEMCMP
+ test %dl, %dl
+ jz L(next_24_bytes)
+
+ test $0x01, %dl
+ jnz L(Byte16)
+
+ test $0x02, %dl
+ jnz L(Byte17)
+
+ test $0x04, %dl
+ jnz L(Byte18)
+
+ test $0x08, %dl
+ jnz L(Byte19)
+
+ test $0x10, %dl
+ jnz L(Byte20)
+
+ test $0x20, %dl
+ jnz L(Byte21)
+
+ test $0x40, %dl
+ jnz L(Byte22)
+
+ movzbl -9(%rdi), %eax
+ movzbl -9(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(Byte16):
+ movzbl -16(%rdi), %eax
+ movzbl -16(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(Byte17):
+ movzbl -15(%rdi), %eax
+ movzbl -15(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(Byte18):
+ movzbl -14(%rdi), %eax
+ movzbl -14(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(Byte19):
+ movzbl -13(%rdi), %eax
+ movzbl -13(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(Byte20):
+ movzbl -12(%rdi), %eax
+ movzbl -12(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(Byte21):
+ movzbl -11(%rdi), %eax
+ movzbl -11(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(Byte22):
+ movzbl -10(%rdi), %eax
+ movzbl -10(%rsi), %edx
+ sub %edx, %eax
+ ret
+
+ ALIGN (4)
+L(next_24_bytes):
+ lea 8(%rdi), %rdi
+ lea 8(%rsi), %rsi
+ test $0x01, %dh
+ jnz L(Byte16)
+
+ test $0x02, %dh
+ jnz L(Byte17)
+
+ test $0x04, %dh
+ jnz L(Byte18)
+
+ test $0x08, %dh
+ jnz L(Byte19)
+
+ test $0x10, %dh
+ jnz L(Byte20)
+
+ test $0x20, %dh
+ jnz L(Byte21)
+
+ test $0x40, %dh
+ jnz L(Byte22)
+
+ mov -9(%rdi), %eax
+ and $0xff, %eax
+ mov -9(%rsi), %edx
+ and $0xff, %edx
+ sub %edx, %eax
+ ret
+# else
+/* special for wmemcmp */
+ xor %eax, %eax
+ test %dl, %dl
+ jz L(next_two_double_words)
+ and $15, %dl
+ jz L(second_double_word)
+ mov -16(%rdi), %eax
+ cmp -16(%rsi), %eax
+ jne L(find_diff)
+ ret
+
+ ALIGN (4)
+L(second_double_word):
+ mov -12(%rdi), %eax
+ cmp -12(%rsi), %eax
+ jne L(find_diff)
+ ret
+
+ ALIGN (4)
+L(next_two_double_words):
+ and $15, %dh
+ jz L(fourth_double_word)
+ mov -8(%rdi), %eax
+ cmp -8(%rsi), %eax
+ jne L(find_diff)
+ ret
+
+ ALIGN (4)
+L(fourth_double_word):
+ mov -4(%rdi), %eax
+ cmp -4(%rsi), %eax
+ jne L(find_diff)
+ ret
+# endif
+
+ ALIGN (4)
+L(less48bytes):
+ cmp $8, %ecx
+ jae L(more8bytes)
+ cmp $0, %ecx
+ je L(0bytes)
+# ifndef USE_AS_WMEMCMP
+ cmp $1, %ecx
+ je L(1bytes)
+ cmp $2, %ecx
+ je L(2bytes)
+ cmp $3, %ecx
+ je L(3bytes)
+ cmp $4, %ecx
+ je L(4bytes)
+ cmp $5, %ecx
+ je L(5bytes)
+ cmp $6, %ecx
+ je L(6bytes)
+ jmp L(7bytes)
+# else
+ jmp L(4bytes)
+# endif
+
+ ALIGN (4)
+L(more8bytes):
+ cmp $16, %ecx
+ jae L(more16bytes)
+ cmp $8, %ecx
+ je L(8bytes)
+# ifndef USE_AS_WMEMCMP
+ cmp $9, %ecx
+ je L(9bytes)
+ cmp $10, %ecx
+ je L(10bytes)
+ cmp $11, %ecx
+ je L(11bytes)
+ cmp $12, %ecx
+ je L(12bytes)
+ cmp $13, %ecx
+ je L(13bytes)
+ cmp $14, %ecx
+ je L(14bytes)
+ jmp L(15bytes)
+# else
+ jmp L(12bytes)
+# endif
+
+ ALIGN (4)
+L(more16bytes):
+ cmp $24, %ecx
+ jae L(more24bytes)
+ cmp $16, %ecx
+ je L(16bytes)
+# ifndef USE_AS_WMEMCMP
+ cmp $17, %ecx
+ je L(17bytes)
+ cmp $18, %ecx
+ je L(18bytes)
+ cmp $19, %ecx
+ je L(19bytes)
+ cmp $20, %ecx
+ je L(20bytes)
+ cmp $21, %ecx
+ je L(21bytes)
+ cmp $22, %ecx
+ je L(22bytes)
+ jmp L(23bytes)
+# else
+ jmp L(20bytes)
+# endif
+
+ ALIGN (4)
+L(more24bytes):
+ cmp $32, %ecx
+ jae L(more32bytes)
+ cmp $24, %ecx
+ je L(24bytes)
+# ifndef USE_AS_WMEMCMP
+ cmp $25, %ecx
+ je L(25bytes)
+ cmp $26, %ecx
+ je L(26bytes)
+ cmp $27, %ecx
+ je L(27bytes)
+ cmp $28, %ecx
+ je L(28bytes)
+ cmp $29, %ecx
+ je L(29bytes)
+ cmp $30, %ecx
+ je L(30bytes)
+ jmp L(31bytes)
+# else
+ jmp L(28bytes)
+# endif
+
+ ALIGN (4)
+L(more32bytes):
+ cmp $40, %ecx
+ jae L(more40bytes)
+ cmp $32, %ecx
+ je L(32bytes)
+# ifndef USE_AS_WMEMCMP
+ cmp $33, %ecx
+ je L(33bytes)
+ cmp $34, %ecx
+ je L(34bytes)
+ cmp $35, %ecx
+ je L(35bytes)
+ cmp $36, %ecx
+ je L(36bytes)
+ cmp $37, %ecx
+ je L(37bytes)
+ cmp $38, %ecx
+ je L(38bytes)
+ jmp L(39bytes)
+# else
+ jmp L(36bytes)
+# endif
+
+ ALIGN (4)
+L(more40bytes):
+ cmp $40, %ecx
+ je L(40bytes)
+# ifndef USE_AS_WMEMCMP
+ cmp $41, %ecx
+ je L(41bytes)
+ cmp $42, %ecx
+ je L(42bytes)
+ cmp $43, %ecx
+ je L(43bytes)
+ cmp $44, %ecx
+ je L(44bytes)
+ cmp $45, %ecx
+ je L(45bytes)
+ cmp $46, %ecx
+ je L(46bytes)
+ jmp L(47bytes)
+
+ ALIGN (4)
+L(44bytes):
+ movl -44(%rdi), %eax
+ movl -44(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(40bytes):
+ movl -40(%rdi), %eax
+ movl -40(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(36bytes):
+ movl -36(%rdi), %eax
+ movl -36(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(32bytes):
+ movl -32(%rdi), %eax
+ movl -32(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(28bytes):
+ movl -28(%rdi), %eax
+ movl -28(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(24bytes):
+ movl -24(%rdi), %eax
+ movl -24(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(20bytes):
+ movl -20(%rdi), %eax
+ movl -20(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(16bytes):
+ movl -16(%rdi), %eax
+ movl -16(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(12bytes):
+ movl -12(%rdi), %eax
+ movl -12(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(8bytes):
+ movl -8(%rdi), %eax
+ movl -8(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(4bytes):
+ movl -4(%rdi), %eax
+ movl -4(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(0bytes):
+ xor %eax, %eax
+ ret
+# else
+ ALIGN (4)
+L(44bytes):
+ movl -44(%rdi), %eax
+ cmp -44(%rsi), %eax
+ jne L(find_diff)
+L(40bytes):
+ movl -40(%rdi), %eax
+ cmp -40(%rsi), %eax
+ jne L(find_diff)
+L(36bytes):
+ movl -36(%rdi), %eax
+ cmp -36(%rsi), %eax
+ jne L(find_diff)
+L(32bytes):
+ movl -32(%rdi), %eax
+ cmp -32(%rsi), %eax
+ jne L(find_diff)
+L(28bytes):
+ movl -28(%rdi), %eax
+ cmp -28(%rsi), %eax
+ jne L(find_diff)
+L(24bytes):
+ movl -24(%rdi), %eax
+ cmp -24(%rsi), %eax
+ jne L(find_diff)
+L(20bytes):
+ movl -20(%rdi), %eax
+ cmp -20(%rsi), %eax
+ jne L(find_diff)
+L(16bytes):
+ movl -16(%rdi), %eax
+ cmp -16(%rsi), %eax
+ jne L(find_diff)
+L(12bytes):
+ movl -12(%rdi), %eax
+ cmp -12(%rsi), %eax
+ jne L(find_diff)
+L(8bytes):
+ movl -8(%rdi), %eax
+ cmp -8(%rsi), %eax
+ jne L(find_diff)
+L(4bytes):
+ movl -4(%rdi), %eax
+ cmp -4(%rsi), %eax
+ jne L(find_diff)
+L(0bytes):
+ xor %eax, %eax
+ ret
+# endif
+
+# ifndef USE_AS_WMEMCMP
+ ALIGN (4)
+L(45bytes):
+ movl -45(%rdi), %eax
+ movl -45(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(41bytes):
+ movl -41(%rdi), %eax
+ movl -41(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(37bytes):
+ movl -37(%rdi), %eax
+ movl -37(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(33bytes):
+ movl -33(%rdi), %eax
+ movl -33(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(29bytes):
+ movl -29(%rdi), %eax
+ movl -29(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(25bytes):
+ movl -25(%rdi), %eax
+ movl -25(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(21bytes):
+ movl -21(%rdi), %eax
+ movl -21(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(17bytes):
+ movl -17(%rdi), %eax
+ movl -17(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(13bytes):
+ movl -13(%rdi), %eax
+ movl -13(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(9bytes):
+ movl -9(%rdi), %eax
+ movl -9(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(5bytes):
+ movl -5(%rdi), %eax
+ movl -5(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(1bytes):
+ movzbl -1(%rdi), %eax
+ cmpb -1(%rsi), %al
+ jne L(set)
+ xor %eax, %eax
+ ret
+
+ ALIGN (4)
+L(46bytes):
+ movl -46(%rdi), %eax
+ movl -46(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(42bytes):
+ movl -42(%rdi), %eax
+ movl -42(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(38bytes):
+ movl -38(%rdi), %eax
+ movl -38(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(34bytes):
+ movl -34(%rdi), %eax
+ movl -34(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(30bytes):
+ movl -30(%rdi), %eax
+ movl -30(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(26bytes):
+ movl -26(%rdi), %eax
+ movl -26(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(22bytes):
+ movl -22(%rdi), %eax
+ movl -22(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(18bytes):
+ movl -18(%rdi), %eax
+ movl -18(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(14bytes):
+ movl -14(%rdi), %eax
+ movl -14(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(10bytes):
+ movl -10(%rdi), %eax
+ movl -10(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(6bytes):
+ movl -6(%rdi), %eax
+ movl -6(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(2bytes):
+ movzwl -2(%rdi), %eax
+ movzwl -2(%rsi), %ecx
+ cmpb %cl, %al
+ jne L(set)
+ cmp %ecx, %eax
+ jne L(set)
+ xor %eax, %eax
+ ret
+
+ ALIGN (4)
+L(47bytes):
+ movl -47(%rdi), %eax
+ movl -47(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(43bytes):
+ movl -43(%rdi), %eax
+ movl -43(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(39bytes):
+ movl -39(%rdi), %eax
+ movl -39(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(35bytes):
+ movl -35(%rdi), %eax
+ movl -35(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(31bytes):
+ movl -31(%rdi), %eax
+ movl -31(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(27bytes):
+ movl -27(%rdi), %eax
+ movl -27(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(23bytes):
+ movl -23(%rdi), %eax
+ movl -23(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(19bytes):
+ movl -19(%rdi), %eax
+ movl -19(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(15bytes):
+ movl -15(%rdi), %eax
+ movl -15(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(11bytes):
+ movl -11(%rdi), %eax
+ movl -11(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(7bytes):
+ movl -7(%rdi), %eax
+ movl -7(%rsi), %ecx
+ cmp %ecx, %eax
+ jne L(find_diff)
+L(3bytes):
+ movzwl -3(%rdi), %eax
+ movzwl -3(%rsi), %ecx
+ cmpb %cl, %al
+ jne L(set)
+ cmp %ecx, %eax
+ jne L(set)
+ movzbl -1(%rdi), %eax
+ cmpb -1(%rsi), %al
+ jne L(set)
+ xor %eax, %eax
+ ret
+
+ ALIGN (4)
+L(find_diff):
+ cmpb %cl, %al
+ jne L(set)
+ cmpw %cx, %ax
+ jne L(set)
+ shr $16, %eax
+ shr $16, %ecx
+ cmpb %cl, %al
+ jne L(set)
+
+/* We get there only if we already know there is a
+difference. */
+
+ cmp %ecx, %eax
+L(set):
+ sbb %eax, %eax
+ sbb $-1, %eax
+ ret
+# else
+
+/* for wmemcmp */
+ ALIGN (4)
+L(find_diff):
+ mov $1, %eax
+ jg L(find_diff_bigger)
+ neg %eax
+ ret
+
+ ALIGN (4)
+L(find_diff_bigger):
+ ret
+# endif
+
+ ALIGN (4)
+L(equal):
+ xor %eax, %eax
+ ret
+
+END (MEMCMP)
+#endif
diff --git a/libc/sysdeps/x86_64/multiarch/memcmp.S b/libc/sysdeps/x86_64/multiarch/memcmp.S
index 301ab287f..8bf8f3a41 100644
--- a/libc/sysdeps/x86_64/multiarch/memcmp.S
+++ b/libc/sysdeps/x86_64/multiarch/memcmp.S
@@ -1,5 +1,5 @@
/* Multiple versions of memcmp
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -29,11 +29,20 @@ ENTRY(memcmp)
cmpl $0, KIND_OFFSET+__cpu_features(%rip)
jne 1f
call __init_cpu_features
-1: leaq __memcmp_sse2(%rip), %rax
- testl $bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip)
- jz 2f
+
+1: testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
+ jnz 2f
+ leaq __memcmp_sse2(%rip), %rax
+ ret
+
+2: testl $bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip)
+ jz 3f
leaq __memcmp_sse4_1(%rip), %rax
-2: ret
+ ret
+
+3: leaq __memcmp_ssse3(%rip), %rax
+ ret
+
END(memcmp)
# undef ENTRY
diff --git a/libc/sysdeps/x86_64/multiarch/rawmemchr.S b/libc/sysdeps/x86_64/multiarch/rawmemchr.S
index 2a8a6909e..1f5bbe6d3 100644
--- a/libc/sysdeps/x86_64/multiarch/rawmemchr.S
+++ b/libc/sysdeps/x86_64/multiarch/rawmemchr.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2009, 2011 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@redhat.com>.
This file is part of the GNU C Library.
@@ -29,29 +29,32 @@ ENTRY(rawmemchr)
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
-1: leaq __rawmemchr_sse2(%rip), %rax
+1: testl $bit_Prefer_PMINUB_for_stringop, __cpu_features+FEATURE_OFFSET+index_Prefer_PMINUB_for_stringop(%rip)
+ jnz 2f
testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
jz 2f
leaq __rawmemchr_sse42(%rip), %rax
-2: ret
+ ret
+2: leaq __rawmemchr_sse2(%rip), %rax
+ ret
+
END(rawmemchr)
strong_alias (rawmemchr, __rawmemchr)
.section .text.sse4.2,"ax",@progbits
- .align 16
+ .align 16
.type __rawmemchr_sse42, @function
__rawmemchr_sse42:
cfi_startproc
CALL_MCOUNT
movd %esi, %xmm1
movq %rdi, %rcx
- punpcklbw %xmm1, %xmm1
+ pxor %xmm2, %xmm2
andq $~15, %rdi
- punpcklbw %xmm1, %xmm1
orl $0xffffffff, %esi
+ pshufb %xmm2, %xmm1
movdqa (%rdi), %xmm0
- pshufd $0, %xmm1, %xmm1
subq %rdi, %rcx
pcmpeqb %xmm1, %xmm0
shl %cl, %esi
diff --git a/libc/sysdeps/x86_64/multiarch/strcat-ssse3.S b/libc/sysdeps/x86_64/multiarch/strcat-ssse3.S
index 34b61b846..2ec3ba7c3 100644
--- a/libc/sysdeps/x86_64/multiarch/strcat-ssse3.S
+++ b/libc/sysdeps/x86_64/multiarch/strcat-ssse3.S
@@ -35,7 +35,7 @@ ENTRY (STRCAT)
# endif
# define RETURN jmp L(StartStrcpyPart)
-# include "strlen-no-bsf.S"
+# include "strlen-sse2-no-bsf.S"
# undef RETURN
diff --git a/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S b/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
index 9e9c91680..4c5a48cda 100644
--- a/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
+++ b/libc/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S
@@ -23,7 +23,7 @@
# include <sysdep.h>
# include "asm-syntax.h"
- .text
+ atom_text_section
ENTRY (__strchr_sse2_no_bsf)
movd %esi, %xmm1
movq %rdi, %rcx
diff --git a/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S b/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
new file mode 100644
index 000000000..c9e03b9ca
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/strcmp-sse42.S
@@ -0,0 +1,1836 @@
+/* strcmp with SSE4.2
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+
+/* We use 0x1a:
+ _SIDD_SBYTE_OPS
+ | _SIDD_CMP_EQUAL_EACH
+ | _SIDD_NEGATIVE_POLARITY
+ | _SIDD_LEAST_SIGNIFICANT
+ on pcmpistri to find out if two 16byte data elements are the same
+ and the offset of the first different byte. There are 4 cases:
+
+ 1. Both 16byte data elements are valid and identical.
+ 2. Both 16byte data elements have EOS and identical.
+ 3. Both 16byte data elements are valid and they differ at offset X.
+ 4. At least one 16byte data element has EOS at offset X. Two 16byte
+ data elements must differ at or before offset X.
+
+ Here is the table of ECX, CFlag, ZFlag and SFlag for 4 cases:
+
+ case ECX CFlag ZFlag SFlag
+ 1 16 0 0 0
+ 2 16 0 1 1
+ 3 X 1 0 0
+ 4 0 <= X 1 0/1 0/1
+
+ We exit from the loop for cases 2, 3 and 4 with jbe which branches
+ when either CFlag or ZFlag is 1. If CFlag == 0, we return 0 for
+ case 2. */
+
+ /* Put all SSE 4.2 functions together. */
+ .section .text.SECTION,"ax",@progbits
+ .align 16
+ .type STRCMP_SSE42, @function
+#ifdef USE_AS_STRCASECMP_L
+ENTRY (GLABEL(__strcasecmp))
+ movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
+ movq %fs:(%rax),%rdx
+
+ // XXX 5 byte should be before the function
+ /* 5-byte NOP. */
+ .byte 0x0f,0x1f,0x44,0x00,0x00
+END (GLABEL(__strcasecmp))
+ /* FALLTHROUGH to strcasecmp_l. */
+#endif
+#ifdef USE_AS_STRNCASECMP_L
+ENTRY (GLABEL(__strncasecmp))
+ movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
+ movq %fs:(%rax),%rcx
+
+ // XXX 5 byte should be before the function
+ /* 5-byte NOP. */
+ .byte 0x0f,0x1f,0x44,0x00,0x00
+END (GLABEL(__strncasecmp))
+ /* FALLTHROUGH to strncasecmp_l. */
+#endif
+
+STRCMP_SSE42:
+ cfi_startproc
+ CALL_MCOUNT
+
+/*
+ * This implementation uses SSE to compare up to 16 bytes at a time.
+ */
+#ifdef USE_AS_STRCASECMP_L
+ /* We have to fall back on the C implementation for locales
+ with encodings not matching ASCII for single bytes. */
+# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
+ movq LOCALE_T___LOCALES+LC_CTYPE*8(%rdx), %rax
+# else
+ movq (%rdx), %rax
+# endif
+ testl $0, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
+ jne __strcasecmp_l_nonascii
+#endif
+#ifdef USE_AS_STRNCASECMP_L
+ /* We have to fall back on the C implementation for locales
+ with encodings not matching ASCII for single bytes. */
+# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
+ movq LOCALE_T___LOCALES+LC_CTYPE*8(%rcx), %rax
+# else
+ movq (%rcx), %rax
+# endif
+ testl $0, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
+ jne __strncasecmp_l_nonascii
+#endif
+
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ test %rdx, %rdx
+ je LABEL(strcmp_exitz)
+ cmp $1, %rdx
+ je LABEL(Byte0)
+ mov %rdx, %r11
+#endif
+ mov %esi, %ecx
+ mov %edi, %eax
+/* Use 64bit AND here to avoid long NOP padding. */
+ and $0x3f, %rcx /* rsi alignment in cache line */
+ and $0x3f, %rax /* rdi alignment in cache line */
+#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+ .section .rodata.cst16,"aM",@progbits,16
+ .align 16
+LABEL(belowupper):
+ .quad 0x4040404040404040
+ .quad 0x4040404040404040
+LABEL(topupper):
+# ifdef USE_AVX
+ .quad 0x5a5a5a5a5a5a5a5a
+ .quad 0x5a5a5a5a5a5a5a5a
+# else
+ .quad 0x5b5b5b5b5b5b5b5b
+ .quad 0x5b5b5b5b5b5b5b5b
+# endif
+LABEL(touppermask):
+ .quad 0x2020202020202020
+ .quad 0x2020202020202020
+ .previous
+ movdqa LABEL(belowupper)(%rip), %xmm4
+# define UCLOW_reg %xmm4
+ movdqa LABEL(topupper)(%rip), %xmm5
+# define UCHIGH_reg %xmm5
+ movdqa LABEL(touppermask)(%rip), %xmm6
+# define LCQWORD_reg %xmm6
+#endif
+ cmp $0x30, %ecx
+ ja LABEL(crosscache)/* rsi: 16-byte load will cross cache line */
+ cmp $0x30, %eax
+ ja LABEL(crosscache)/* rdi: 16-byte load will cross cache line */
+ movdqu (%rdi), %xmm1
+ movdqu (%rsi), %xmm2
+#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+# ifdef USE_AVX
+# define TOLOWER(reg1, reg2) \
+ vpcmpgtb UCLOW_reg, reg1, %xmm7; \
+ vpcmpgtb UCHIGH_reg, reg1, %xmm8; \
+ vpcmpgtb UCLOW_reg, reg2, %xmm9; \
+ vpcmpgtb UCHIGH_reg, reg2, %xmm10; \
+ vpandn %xmm7, %xmm8, %xmm8; \
+ vpandn %xmm9, %xmm10, %xmm10; \
+ vpand LCQWORD_reg, %xmm8, %xmm8; \
+ vpand LCQWORD_reg, %xmm10, %xmm10; \
+ vpor reg1, %xmm8, reg1; \
+ vpor reg2, %xmm10, reg2
+# else
+# define TOLOWER(reg1, reg2) \
+ movdqa reg1, %xmm7; \
+ movdqa UCHIGH_reg, %xmm8; \
+ movdqa reg2, %xmm9; \
+ movdqa UCHIGH_reg, %xmm10; \
+ pcmpgtb UCLOW_reg, %xmm7; \
+ pcmpgtb reg1, %xmm8; \
+ pcmpgtb UCLOW_reg, %xmm9; \
+ pcmpgtb reg2, %xmm10; \
+ pand %xmm8, %xmm7; \
+ pand %xmm10, %xmm9; \
+ pand LCQWORD_reg, %xmm7; \
+ pand LCQWORD_reg, %xmm9; \
+ por %xmm7, reg1; \
+ por %xmm9, reg2
+# endif
+ TOLOWER (%xmm1, %xmm2)
+#else
+# define TOLOWER(reg1, reg2)
+#endif
+ pxor %xmm0, %xmm0 /* clear %xmm0 for null char checks */
+ pcmpeqb %xmm1, %xmm0 /* Any null chars? */
+ pcmpeqb %xmm2, %xmm1 /* compare first 16 bytes for equality */
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %edx
+ sub $0xffff, %edx /* if first 16 bytes are same, edx == 0xffff */
+ jnz LABEL(less16bytes)/* If not, find different value or null char */
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)/* finish comparision */
+#endif
+ add $16, %rsi /* prepare to search next 16 bytes */
+ add $16, %rdi /* prepare to search next 16 bytes */
+
+ /*
+ * Determine source and destination string offsets from 16-byte
+ * alignment. Use relative offset difference between the two to
+ * determine which case below to use.
+ */
+ .p2align 4
+LABEL(crosscache):
+ and $0xfffffffffffffff0, %rsi /* force %rsi is 16 byte aligned */
+ and $0xfffffffffffffff0, %rdi /* force %rdi is 16 byte aligned */
+ mov $0xffff, %edx /* for equivalent offset */
+ xor %r8d, %r8d
+ and $0xf, %ecx /* offset of rsi */
+ and $0xf, %eax /* offset of rdi */
+ cmp %eax, %ecx
+ je LABEL(ashr_0) /* rsi and rdi relative offset same */
+ ja LABEL(bigger)
+ mov %edx, %r8d /* r8d is offset flag for exit tail */
+ xchg %ecx, %eax
+ xchg %rsi, %rdi
+LABEL(bigger):
+ lea 15(%rax), %r9
+ sub %rcx, %r9
+ lea LABEL(unaligned_table)(%rip), %r10
+ movslq (%r10, %r9,4), %r9
+ lea (%r10, %r9), %r10
+ jmp *%r10 /* jump to corresponding case */
+
+/*
+ * The following cases will be handled by ashr_0
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(0~15) n(0~15) 15(15+ n-n) ashr_0
+ */
+ .p2align 4
+LABEL(ashr_0):
+
+ movdqa (%rsi), %xmm1
+ pxor %xmm0, %xmm0 /* clear %xmm0 for null char check */
+ pcmpeqb %xmm1, %xmm0 /* Any null chars? */
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpeqb (%rdi), %xmm1 /* compare 16 bytes for equality */
+#else
+ movdqa (%rdi), %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm2, %xmm1 /* compare 16 bytes for equality */
+#endif
+ psubb %xmm0, %xmm1 /* packed sub of comparison results*/
+ pmovmskb %xmm1, %r9d
+ shr %cl, %edx /* adjust 0xffff for offset */
+ shr %cl, %r9d /* adjust for 16-byte offset */
+ sub %r9d, %edx
+ /*
+ * edx must be the same with r9d if in left byte (16-rcx) is equal to
+ * the start from (16-rax) and no null char was seen.
+ */
+ jne LABEL(less32bytes) /* mismatch or null char */
+ UPDATE_STRNCMP_COUNTER
+ mov $16, %rcx
+ mov $16, %r9
+ pxor %xmm0, %xmm0 /* clear xmm0, may have changed above */
+
+ /*
+ * Now both strings are aligned at 16-byte boundary. Loop over strings
+ * checking 32-bytes per iteration.
+ */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+ .p2align 4
+LABEL(ashr_0_use):
+ movdqa (%rdi,%rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ lea 16(%rdx), %rdx
+ jbe LABEL(ashr_0_exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ movdqa (%rdi,%rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ lea 16(%rdx), %rdx
+ jbe LABEL(ashr_0_exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ jmp LABEL(ashr_0_use)
+
+
+ .p2align 4
+LABEL(ashr_0_exit_use):
+ jnc LABEL(strcmp_exitz)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub %rcx, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ lea -16(%rdx, %rcx), %rcx
+ movzbl (%rdi, %rcx), %eax
+ movzbl (%rsi, %rcx), %edx
+#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+ leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rcx
+ movl (%rcx,%rax,4), %eax
+ movl (%rcx,%rdx,4), %edx
+#endif
+ sub %edx, %eax
+ ret
+
+
+
+/*
+ * The following cases will be handled by ashr_1
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(15) n -15 0(15 +(n-15) - n) ashr_1
+ */
+ .p2align 4
+LABEL(ashr_1):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0 /* Any null chars? */
+ pslldq $15, %xmm2 /* shift first string to align with second */
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2 /* compare 16 bytes for equality */
+ psubb %xmm0, %xmm2 /* packed sub of comparison results*/
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx /* adjust 0xffff for offset */
+ shr %cl, %r9d /* adjust for 16-byte offset */
+ sub %r9d, %edx
+ jnz LABEL(less32bytes) /* mismatch or null char seen */
+ movdqa (%rdi), %xmm3
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads*/
+ mov $1, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 1(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_1_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_1_use)
+
+LABEL(nibble_ashr_1_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $1, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_1_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $1, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_1_use)
+
+ .p2align 4
+LABEL(nibble_ashr_1_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $1, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $14, %ecx
+ ja LABEL(nibble_ashr_1_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_2
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(14~15) n -14 1(15 +(n-14) - n) ashr_2
+ */
+ .p2align 4
+LABEL(ashr_2):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $14, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $2, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 2(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_2_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_2_use)
+
+LABEL(nibble_ashr_2_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $2, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_2_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $2, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_2_use)
+
+ .p2align 4
+LABEL(nibble_ashr_2_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $2, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $13, %ecx
+ ja LABEL(nibble_ashr_2_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_3
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(13~15) n -13 2(15 +(n-13) - n) ashr_3
+ */
+ .p2align 4
+LABEL(ashr_3):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $13, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $3, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 3(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+LABEL(loop_ashr_3_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_3_use)
+
+LABEL(nibble_ashr_3_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $3, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_3_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $3, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_3_use)
+
+ .p2align 4
+LABEL(nibble_ashr_3_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $3, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $12, %ecx
+ ja LABEL(nibble_ashr_3_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_4
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(12~15) n -12 3(15 +(n-12) - n) ashr_4
+ */
+ .p2align 4
+LABEL(ashr_4):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $12, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $4, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 4(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_4_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_4_use)
+
+LABEL(nibble_ashr_4_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $4, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_4_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $4, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_4_use)
+
+ .p2align 4
+LABEL(nibble_ashr_4_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $4, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $11, %ecx
+ ja LABEL(nibble_ashr_4_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_5
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(11~15) n - 11 4(15 +(n-11) - n) ashr_5
+ */
+ .p2align 4
+LABEL(ashr_5):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $11, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $5, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 5(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_5_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_5_use)
+
+LABEL(nibble_ashr_5_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $5, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_5_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+
+ palignr $5, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_5_use)
+
+ .p2align 4
+LABEL(nibble_ashr_5_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $5, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $10, %ecx
+ ja LABEL(nibble_ashr_5_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_6
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(10~15) n - 10 5(15 +(n-10) - n) ashr_6
+ */
+ .p2align 4
+LABEL(ashr_6):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $10, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $6, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 6(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_6_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_6_use)
+
+LABEL(nibble_ashr_6_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $6, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_6_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $6, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_6_use)
+
+ .p2align 4
+LABEL(nibble_ashr_6_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $6, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $9, %ecx
+ ja LABEL(nibble_ashr_6_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_7
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(9~15) n - 9 6(15 +(n - 9) - n) ashr_7
+ */
+ .p2align 4
+LABEL(ashr_7):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $9, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $7, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 7(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_7_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_7_use)
+
+LABEL(nibble_ashr_7_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $7, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_7_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $7, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_7_use)
+
+ .p2align 4
+LABEL(nibble_ashr_7_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $7, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $8, %ecx
+ ja LABEL(nibble_ashr_7_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_8
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(8~15) n - 8 7(15 +(n - 8) - n) ashr_8
+ */
+ .p2align 4
+LABEL(ashr_8):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $8, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $8, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 8(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_8_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_8_use)
+
+LABEL(nibble_ashr_8_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $8, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_8_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $8, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_8_use)
+
+ .p2align 4
+LABEL(nibble_ashr_8_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $8, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $7, %ecx
+ ja LABEL(nibble_ashr_8_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_9
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(7~15) n - 7 8(15 +(n - 7) - n) ashr_9
+ */
+ .p2align 4
+LABEL(ashr_9):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $7, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $9, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 9(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_9_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_9_use)
+
+LABEL(nibble_ashr_9_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+
+ palignr $9, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_9_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $9, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_9_use)
+
+ .p2align 4
+LABEL(nibble_ashr_9_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $9, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $6, %ecx
+ ja LABEL(nibble_ashr_9_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_10
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(6~15) n - 6 9(15 +(n - 6) - n) ashr_10
+ */
+ .p2align 4
+LABEL(ashr_10):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $6, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $10, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 10(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_10_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_10_use)
+
+LABEL(nibble_ashr_10_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $10, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_10_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $10, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_10_use)
+
+ .p2align 4
+LABEL(nibble_ashr_10_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $10, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $5, %ecx
+ ja LABEL(nibble_ashr_10_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_11
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(5~15) n - 5 10(15 +(n - 5) - n) ashr_11
+ */
+ .p2align 4
+LABEL(ashr_11):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $5, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $11, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 11(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_11_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_11_use)
+
+LABEL(nibble_ashr_11_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $11, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_11_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $11, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_11_use)
+
+ .p2align 4
+LABEL(nibble_ashr_11_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $11, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $4, %ecx
+ ja LABEL(nibble_ashr_11_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_12
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(4~15) n - 4 11(15 +(n - 4) - n) ashr_12
+ */
+ .p2align 4
+LABEL(ashr_12):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $4, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $12, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 12(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_12_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_12_use)
+
+LABEL(nibble_ashr_12_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $12, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_12_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $12, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_12_use)
+
+ .p2align 4
+LABEL(nibble_ashr_12_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $12, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $3, %ecx
+ ja LABEL(nibble_ashr_12_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_13
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(3~15) n - 3 12(15 +(n - 3) - n) ashr_13
+ */
+ .p2align 4
+LABEL(ashr_13):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $3, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $13, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 13(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_13_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_13_use)
+
+LABEL(nibble_ashr_13_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $13, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_13_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $13, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_13_use)
+
+ .p2align 4
+LABEL(nibble_ashr_13_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $13, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $2, %ecx
+ ja LABEL(nibble_ashr_13_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_14
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(2~15) n - 2 13(15 +(n - 2) - n) ashr_14
+ */
+ .p2align 4
+LABEL(ashr_14):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $2, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $14, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 14(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_14_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_14_use)
+
+LABEL(nibble_ashr_14_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $14, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_14_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $14, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_14_use)
+
+ .p2align 4
+LABEL(nibble_ashr_14_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $14, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $1, %ecx
+ ja LABEL(nibble_ashr_14_restart_use)
+
+ jmp LABEL(nibble_ashr_exit_use)
+
+/*
+ * The following cases will be handled by ashr_15
+ * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
+ * n(1~15) n - 1 14(15 +(n - 1) - n) ashr_15
+ */
+ .p2align 4
+LABEL(ashr_15):
+ pxor %xmm0, %xmm0
+ movdqa (%rdi), %xmm2
+ movdqa (%rsi), %xmm1
+ pcmpeqb %xmm1, %xmm0
+ pslldq $1, %xmm2
+ TOLOWER (%xmm1, %xmm2)
+ pcmpeqb %xmm1, %xmm2
+ psubb %xmm0, %xmm2
+ pmovmskb %xmm2, %r9d
+ shr %cl, %edx
+ shr %cl, %r9d
+ sub %r9d, %edx
+ jnz LABEL(less32bytes)
+
+ movdqa (%rdi), %xmm3
+
+ UPDATE_STRNCMP_COUNTER
+
+ pxor %xmm0, %xmm0
+ mov $16, %rcx /* index for loads */
+ mov $15, %r9d /* byte position left over from less32bytes case */
+ /*
+ * Setup %r10 value allows us to detect crossing a page boundary.
+ * When %r10 goes positive we have crossed a page boundary and
+ * need to do a nibble.
+ */
+ lea 15(%rdi), %r10
+ and $0xfff, %r10 /* offset into 4K page */
+
+ sub $0x1000, %r10 /* subtract 4K pagesize */
+
+ mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
+
+ .p2align 4
+LABEL(loop_ashr_15_use):
+ add $16, %r10
+ jg LABEL(nibble_ashr_15_use)
+
+LABEL(nibble_ashr_15_restart_use):
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $15, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+
+ add $16, %rdx
+ add $16, %r10
+ jg LABEL(nibble_ashr_15_use)
+
+ movdqa (%rdi, %rdx), %xmm0
+ palignr $15, -16(%rdi, %rdx), %xmm0
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a, (%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ jbe LABEL(exit_use)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub $16, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add $16, %rdx
+ jmp LABEL(loop_ashr_15_use)
+
+ .p2align 4
+LABEL(nibble_ashr_15_use):
+ sub $0x1000, %r10
+ movdqa -16(%rdi, %rdx), %xmm0
+ psrldq $15, %xmm0
+ pcmpistri $0x3a,%xmm0, %xmm0
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ cmp %r11, %rcx
+ jae LABEL(nibble_ashr_exit_use)
+#endif
+ cmp $0, %ecx
+ ja LABEL(nibble_ashr_15_restart_use)
+
+LABEL(nibble_ashr_exit_use):
+#if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
+ pcmpistri $0x1a,(%rsi,%rdx), %xmm0
+#else
+ movdqa (%rsi,%rdx), %xmm1
+ TOLOWER (%xmm0, %xmm1)
+ pcmpistri $0x1a, %xmm1, %xmm0
+#endif
+ .p2align 4
+LABEL(exit_use):
+ jnc LABEL(strcmp_exitz)
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub %rcx, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ add %rcx, %rdx
+ lea -16(%rdi, %r9), %rdi
+ movzbl (%rdi, %rdx), %eax
+ movzbl (%rsi, %rdx), %edx
+ test %r8d, %r8d
+ jz LABEL(ret_use)
+ xchg %eax, %edx
+LABEL(ret_use):
+#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+ leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rcx
+ movl (%rcx,%rdx,4), %edx
+ movl (%rcx,%rax,4), %eax
+#endif
+
+ sub %edx, %eax
+ ret
+
+LABEL(less32bytes):
+ lea (%rdi, %rax), %rdi /* locate the exact address for first operand(rdi) */
+ lea (%rsi, %rcx), %rsi /* locate the exact address for second operand(rsi) */
+ test %r8d, %r8d
+ jz LABEL(ret)
+ xchg %rsi, %rdi /* recover original order according to flag(%r8d) */
+
+ .p2align 4
+LABEL(ret):
+LABEL(less16bytes):
+ bsf %rdx, %rdx /* find and store bit index in %rdx */
+
+#if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
+ sub %rdx, %r11
+ jbe LABEL(strcmp_exitz)
+#endif
+ movzbl (%rsi, %rdx), %ecx
+ movzbl (%rdi, %rdx), %eax
+
+#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+ leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rdx
+ movl (%rdx,%rcx,4), %ecx
+ movl (%rdx,%rax,4), %eax
+#endif
+
+ sub %ecx, %eax
+ ret
+
+LABEL(strcmp_exitz):
+ xor %eax, %eax
+ ret
+
+ .p2align 4
+ // XXX Same as code above
+LABEL(Byte0):
+ movzx (%rsi), %ecx
+ movzx (%rdi), %eax
+
+#if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+ leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rdx
+ movl (%rdx,%rcx,4), %ecx
+ movl (%rdx,%rax,4), %eax
+#endif
+
+ sub %ecx, %eax
+ ret
+ cfi_endproc
+ .size STRCMP_SSE42, .-STRCMP_SSE42
+
+#undef UCLOW_reg
+#undef UCHIGH_reg
+#undef LCQWORD_reg
+#undef TOLOWER
+
+ /* Put all SSE 4.2 functions together. */
+ .section .rodata.SECTION,"a",@progbits
+ .p2align 3
+LABEL(unaligned_table):
+ .int LABEL(ashr_1) - LABEL(unaligned_table)
+ .int LABEL(ashr_2) - LABEL(unaligned_table)
+ .int LABEL(ashr_3) - LABEL(unaligned_table)
+ .int LABEL(ashr_4) - LABEL(unaligned_table)
+ .int LABEL(ashr_5) - LABEL(unaligned_table)
+ .int LABEL(ashr_6) - LABEL(unaligned_table)
+ .int LABEL(ashr_7) - LABEL(unaligned_table)
+ .int LABEL(ashr_8) - LABEL(unaligned_table)
+ .int LABEL(ashr_9) - LABEL(unaligned_table)
+ .int LABEL(ashr_10) - LABEL(unaligned_table)
+ .int LABEL(ashr_11) - LABEL(unaligned_table)
+ .int LABEL(ashr_12) - LABEL(unaligned_table)
+ .int LABEL(ashr_13) - LABEL(unaligned_table)
+ .int LABEL(ashr_14) - LABEL(unaligned_table)
+ .int LABEL(ashr_15) - LABEL(unaligned_table)
+ .int LABEL(ashr_0) - LABEL(unaligned_table)
+
+#undef LABEL
+#undef GLABEL
+#undef SECTION
diff --git a/libc/sysdeps/x86_64/multiarch/strcmp.S b/libc/sysdeps/x86_64/multiarch/strcmp.S
index 8879855d9..f93c83d7d 100644
--- a/libc/sysdeps/x86_64/multiarch/strcmp.S
+++ b/libc/sysdeps/x86_64/multiarch/strcmp.S
@@ -1,5 +1,5 @@
/* strcmp with SSE4.2
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -28,9 +28,9 @@
/* calculate left number to compare */ \
lea -16(%rcx, %r11), %r9; \
cmp %r9, %r11; \
- jb LABEL(strcmp_exitz_sse4_2); \
+ jb LABEL(strcmp_exitz); \
test %r9, %r9; \
- je LABEL(strcmp_exitz_sse4_2); \
+ je LABEL(strcmp_exitz); \
mov %r9, %r11
# define STRCMP_SSE42 __strncmp_sse42
@@ -42,6 +42,7 @@
# define UPDATE_STRNCMP_COUNTER
+# define STRCMP_AVX __strcasecmp_l_avx
# define STRCMP_SSE42 __strcasecmp_l_sse42
# define STRCMP_SSSE3 __strcasecmp_l_ssse3
# define STRCMP_SSE2 __strcasecmp_l_sse2
@@ -55,11 +56,12 @@
/* calculate left number to compare */ \
lea -16(%rcx, %r11), %r9; \
cmp %r9, %r11; \
- jb LABEL(strcmp_exitz_sse4_2); \
+ jb LABEL(strcmp_exitz); \
test %r9, %r9; \
- je LABEL(strcmp_exitz_sse4_2); \
+ je LABEL(strcmp_exitz); \
mov %r9, %r11
+# define STRCMP_AVX __strncasecmp_l_avx
# define STRCMP_SSE42 __strncasecmp_l_sse42
# define STRCMP_SSSE3 __strncasecmp_l_ssse3
# define STRCMP_SSE2 __strncasecmp_l_sse2
@@ -75,10 +77,6 @@
# endif
#endif
-#ifndef LABEL
-# define LABEL(l) L(l)
-#endif
-
/* Define multiple versions only for the definition in libc. Don't
define multiple versions for strncmp in static library since we
need strncmp before the initialization happened. */
@@ -107,6 +105,11 @@ ENTRY(__strcasecmp)
jne 1f
call __init_cpu_features
1:
+# ifdef HAVE_AVX_SUPPORT
+ leaq __strcasecmp_avx(%rip), %rax
+ testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+ jnz 2f
+# endif
leaq __strcasecmp_sse42(%rip), %rax
testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
jnz 2f
@@ -125,6 +128,11 @@ ENTRY(__strncasecmp)
jne 1f
call __init_cpu_features
1:
+# ifdef HAVE_AVX_SUPPORT
+ leaq __strncasecmp_avx(%rip), %rax
+ testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+ jnz 2f
+# endif
leaq __strncasecmp_sse42(%rip), %rax
testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
jnz 2f
@@ -137,1798 +145,24 @@ END(__strncasecmp)
weak_alias (__strncasecmp, strncasecmp)
# endif
-/* We use 0x1a:
- _SIDD_SBYTE_OPS
- | _SIDD_CMP_EQUAL_EACH
- | _SIDD_NEGATIVE_POLARITY
- | _SIDD_LEAST_SIGNIFICANT
- on pcmpistri to find out if two 16byte data elements are the same
- and the offset of the first different byte. There are 4 cases:
-
- 1. Both 16byte data elements are valid and identical.
- 2. Both 16byte data elements have EOS and identical.
- 3. Both 16byte data elements are valid and they differ at offset X.
- 4. At least one 16byte data element has EOS at offset X. Two 16byte
- data elements must differ at or before offset X.
-
- Here is the table of ECX, CFlag, ZFlag and SFlag for 4 cases:
-
- case ECX CFlag ZFlag SFlag
- 1 16 0 0 0
- 2 16 0 1 1
- 3 X 1 0 0
- 4 0 <= X 1 0/1 0/1
-
- We exit from the loop for cases 2, 3 and 4 with jbe which branches
- when either CFlag or ZFlag is 1. If CFlag == 0, we return 0 for
- case 2. */
-
- /* Put all SSE 4.2 functions together. */
- .section .text.sse4.2,"ax",@progbits
- .align 16
- .type STRCMP_SSE42, @function
-# ifdef USE_AS_STRCASECMP_L
-ENTRY (__strcasecmp_sse42)
- movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rdx
-
- // XXX 5 byte should be before the function
- /* 5-byte NOP. */
- .byte 0x0f,0x1f,0x44,0x00,0x00
-END (__strcasecmp_sse42)
- /* FALLTHROUGH to strcasecmp_l. */
-# endif
-# ifdef USE_AS_STRNCASECMP_L
-ENTRY (__strncasecmp_sse42)
- movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
- movq %fs:(%rax),%rcx
-
- // XXX 5 byte should be before the function
- /* 5-byte NOP. */
- .byte 0x0f,0x1f,0x44,0x00,0x00
-END (__strncasecmp_sse42)
- /* FALLTHROUGH to strncasecmp_l. */
-# endif
+# undef LABEL
+# define LABEL(l) .L##l##_sse42
+# define GLABEL(l) l##_sse42
+# define SECTION sse4.2
+# include "strcmp-sse42.S"
-STRCMP_SSE42:
- cfi_startproc
- CALL_MCOUNT
-/*
- * This implementation uses SSE to compare up to 16 bytes at a time.
- */
-# ifdef USE_AS_STRCASECMP_L
- /* We have to fall back on the C implementation for locales
- with encodings not matching ASCII for single bytes. */
-# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rdx), %rax
-# else
- movq (%rdx), %rax
+# ifdef HAVE_AVX_SUPPORT
+# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
+# define LABEL(l) .L##l##_avx
+# define GLABEL(l) l##_avx
+# define USE_AVX 1
+# undef STRCMP_SSE42
+# define STRCMP_SSE42 STRCMP_AVX
+# define SECTION avx
+# include "strcmp-sse42.S"
# endif
- testl $0, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
- jne __strcasecmp_l_nonascii
-# endif
-# ifdef USE_AS_STRNCASECMP_L
- /* We have to fall back on the C implementation for locales
- with encodings not matching ASCII for single bytes. */
-# if LOCALE_T___LOCALES != 0 || LC_CTYPE != 0
- movq LOCALE_T___LOCALES+LC_CTYPE*8(%rcx), %rax
-# else
- movq (%rcx), %rax
-# endif
- testl $0, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%rax)
- jne __strncasecmp_l_nonascii
-# endif
-
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- test %rdx, %rdx
- je LABEL(strcmp_exitz_sse4_2)
- cmp $1, %rdx
- je LABEL(Byte0_sse4_2)
- mov %rdx, %r11
-# endif
- mov %esi, %ecx
- mov %edi, %eax
-/* Use 64bit AND here to avoid long NOP padding. */
- and $0x3f, %rcx /* rsi alignment in cache line */
- and $0x3f, %rax /* rdi alignment in cache line */
-# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
- .section .rodata.cst16,"aM",@progbits,16
- .align 16
-.Lbelowupper_sse4:
- .quad 0x4040404040404040
- .quad 0x4040404040404040
-.Ltopupper_sse4:
- .quad 0x5b5b5b5b5b5b5b5b
- .quad 0x5b5b5b5b5b5b5b5b
-.Ltouppermask_sse4:
- .quad 0x2020202020202020
- .quad 0x2020202020202020
- .previous
- movdqa .Lbelowupper_sse4(%rip), %xmm4
-# define UCLOW_reg %xmm4
- movdqa .Ltopupper_sse4(%rip), %xmm5
-# define UCHIGH_reg %xmm5
- movdqa .Ltouppermask_sse4(%rip), %xmm6
-# define LCQWORD_reg %xmm6
-# endif
- cmp $0x30, %ecx
- ja LABEL(crosscache_sse4_2)/* rsi: 16-byte load will cross cache line */
- cmp $0x30, %eax
- ja LABEL(crosscache_sse4_2)/* rdi: 16-byte load will cross cache line */
- movdqu (%rdi), %xmm1
- movdqu (%rsi), %xmm2
-# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
-# define TOLOWER(reg1, reg2) \
- movdqa reg1, %xmm7; \
- movdqa UCHIGH_reg, %xmm8; \
- movdqa reg2, %xmm9; \
- movdqa UCHIGH_reg, %xmm10; \
- pcmpgtb UCLOW_reg, %xmm7; \
- pcmpgtb reg1, %xmm8; \
- pcmpgtb UCLOW_reg, %xmm9; \
- pcmpgtb reg2, %xmm10; \
- pand %xmm8, %xmm7; \
- pand %xmm10, %xmm9; \
- pand LCQWORD_reg, %xmm7; \
- pand LCQWORD_reg, %xmm9; \
- por %xmm7, reg1; \
- por %xmm9, reg2
- TOLOWER (%xmm1, %xmm2)
-# else
-# define TOLOWER(reg1, reg2)
-# endif
- pxor %xmm0, %xmm0 /* clear %xmm0 for null char checks */
- pcmpeqb %xmm1, %xmm0 /* Any null chars? */
- pcmpeqb %xmm2, %xmm1 /* compare first 16 bytes for equality */
- psubb %xmm0, %xmm1 /* packed sub of comparison results*/
- pmovmskb %xmm1, %edx
- sub $0xffff, %edx /* if first 16 bytes are same, edx == 0xffff */
- jnz LABEL(less16bytes_sse4_2)/* If not, find different value or null char */
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)/* finish comparision */
-# endif
- add $16, %rsi /* prepare to search next 16 bytes */
- add $16, %rdi /* prepare to search next 16 bytes */
-
- /*
- * Determine source and destination string offsets from 16-byte alignment.
- * Use relative offset difference between the two to determine which case
- * below to use.
- */
- .p2align 4
-LABEL(crosscache_sse4_2):
- and $0xfffffffffffffff0, %rsi /* force %rsi is 16 byte aligned */
- and $0xfffffffffffffff0, %rdi /* force %rdi is 16 byte aligned */
- mov $0xffff, %edx /* for equivalent offset */
- xor %r8d, %r8d
- and $0xf, %ecx /* offset of rsi */
- and $0xf, %eax /* offset of rdi */
- cmp %eax, %ecx
- je LABEL(ashr_0_sse4_2) /* rsi and rdi relative offset same */
- ja LABEL(bigger_sse4_2)
- mov %edx, %r8d /* r8d is offset flag for exit tail */
- xchg %ecx, %eax
- xchg %rsi, %rdi
-LABEL(bigger_sse4_2):
- lea 15(%rax), %r9
- sub %rcx, %r9
- lea LABEL(unaligned_table_sse4_2)(%rip), %r10
- movslq (%r10, %r9,4), %r9
- lea (%r10, %r9), %r10
- jmp *%r10 /* jump to corresponding case */
-
-/*
- * The following cases will be handled by ashr_0
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(0~15) n(0~15) 15(15+ n-n) ashr_0
- */
- .p2align 4
-LABEL(ashr_0_sse4_2):
-
- movdqa (%rsi), %xmm1
- pxor %xmm0, %xmm0 /* clear %xmm0 for null char check */
- pcmpeqb %xmm1, %xmm0 /* Any null chars? */
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpeqb (%rdi), %xmm1 /* compare 16 bytes for equality */
-# else
- movdqa (%rdi), %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm2, %xmm1 /* compare 16 bytes for equality */
-# endif
- psubb %xmm0, %xmm1 /* packed sub of comparison results*/
- pmovmskb %xmm1, %r9d
- shr %cl, %edx /* adjust 0xffff for offset */
- shr %cl, %r9d /* adjust for 16-byte offset */
- sub %r9d, %edx
- /*
- * edx must be the same with r9d if in left byte (16-rcx) is equal to
- * the start from (16-rax) and no null char was seen.
- */
- jne LABEL(less32bytes_sse4_2) /* mismatch or null char */
- UPDATE_STRNCMP_COUNTER
- mov $16, %rcx
- mov $16, %r9
- pxor %xmm0, %xmm0 /* clear xmm0, may have changed above */
-
- /*
- * Now both strings are aligned at 16-byte boundary. Loop over strings
- * checking 32-bytes per iteration.
- */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
- .p2align 4
-LABEL(ashr_0_use_sse4_2):
- movdqa (%rdi,%rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- lea 16(%rdx), %rdx
- jbe LABEL(ashr_0_use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- movdqa (%rdi,%rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- lea 16(%rdx), %rdx
- jbe LABEL(ashr_0_use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- jmp LABEL(ashr_0_use_sse4_2)
-
-
- .p2align 4
-LABEL(ashr_0_use_sse4_2_exit):
- jnc LABEL(strcmp_exitz_sse4_2)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub %rcx, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- lea -16(%rdx, %rcx), %rcx
- movzbl (%rdi, %rcx), %eax
- movzbl (%rsi, %rcx), %edx
-# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
- leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rcx
- movl (%rcx,%rax,4), %eax
- movl (%rcx,%rdx,4), %edx
-# endif
- sub %edx, %eax
- ret
-
-
-
-/*
- * The following cases will be handled by ashr_1
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(15) n -15 0(15 +(n-15) - n) ashr_1
- */
- .p2align 4
-LABEL(ashr_1_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0 /* Any null chars? */
- pslldq $15, %xmm2 /* shift first string to align with second */
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2 /* compare 16 bytes for equality */
- psubb %xmm0, %xmm2 /* packed sub of comparison results*/
- pmovmskb %xmm2, %r9d
- shr %cl, %edx /* adjust 0xffff for offset */
- shr %cl, %r9d /* adjust for 16-byte offset */
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)/* mismatch or null char seen */
- movdqa (%rdi), %xmm3
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads*/
- mov $1, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 1(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_1_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_1_use_sse4_2)
-
-LABEL(nibble_ashr_1_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $1, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_1_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $1, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_1_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_1_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $1, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $14, %ecx
- ja LABEL(nibble_ashr_1_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_2
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(14~15) n -14 1(15 +(n-14) - n) ashr_2
- */
- .p2align 4
-LABEL(ashr_2_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $14, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $2, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 2(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_2_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_2_use_sse4_2)
-
-LABEL(nibble_ashr_2_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $2, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_2_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $2, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_2_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_2_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $2, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $13, %ecx
- ja LABEL(nibble_ashr_2_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_3
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(13~15) n -13 2(15 +(n-13) - n) ashr_3
- */
- .p2align 4
-LABEL(ashr_3_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $13, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $3, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 3(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
-LABEL(loop_ashr_3_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_3_use_sse4_2)
-
-LABEL(nibble_ashr_3_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $3, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_3_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $3, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_3_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_3_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $3, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $12, %ecx
- ja LABEL(nibble_ashr_3_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_4
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(12~15) n -12 3(15 +(n-12) - n) ashr_4
- */
- .p2align 4
-LABEL(ashr_4_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $12, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $4, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 4(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_4_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_4_use_sse4_2)
-
-LABEL(nibble_ashr_4_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $4, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_4_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $4, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_4_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_4_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $4, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $11, %ecx
- ja LABEL(nibble_ashr_4_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_5
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(11~15) n - 11 4(15 +(n-11) - n) ashr_5
- */
- .p2align 4
-LABEL(ashr_5_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $11, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $5, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 5(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_5_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_5_use_sse4_2)
-
-LABEL(nibble_ashr_5_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $5, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_5_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
-
- palignr $5, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_5_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_5_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $5, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $10, %ecx
- ja LABEL(nibble_ashr_5_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_6
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(10~15) n - 10 5(15 +(n-10) - n) ashr_6
- */
- .p2align 4
-LABEL(ashr_6_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $10, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $6, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 6(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_6_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_6_use_sse4_2)
-
-LABEL(nibble_ashr_6_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $6, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_6_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $6, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_6_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_6_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $6, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $9, %ecx
- ja LABEL(nibble_ashr_6_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_7
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(9~15) n - 9 6(15 +(n - 9) - n) ashr_7
- */
- .p2align 4
-LABEL(ashr_7_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $9, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $7, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 7(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_7_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_7_use_sse4_2)
-
-LABEL(nibble_ashr_7_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $7, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_7_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $7, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_7_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_7_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $7, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $8, %ecx
- ja LABEL(nibble_ashr_7_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_8
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(8~15) n - 8 7(15 +(n - 8) - n) ashr_8
- */
- .p2align 4
-LABEL(ashr_8_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $8, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $8, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 8(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_8_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_8_use_sse4_2)
-
-LABEL(nibble_ashr_8_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $8, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_8_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $8, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_8_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_8_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $8, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $7, %ecx
- ja LABEL(nibble_ashr_8_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_9
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(7~15) n - 7 8(15 +(n - 7) - n) ashr_9
- */
- .p2align 4
-LABEL(ashr_9_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $7, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $9, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 9(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_9_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_9_use_sse4_2)
-
-LABEL(nibble_ashr_9_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
-
- palignr $9, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_9_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $9, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_9_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_9_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $9, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $6, %ecx
- ja LABEL(nibble_ashr_9_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_10
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(6~15) n - 6 9(15 +(n - 6) - n) ashr_10
- */
- .p2align 4
-LABEL(ashr_10_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $6, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $10, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 10(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_10_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_10_use_sse4_2)
-
-LABEL(nibble_ashr_10_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $10, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_10_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $10, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_10_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_10_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $10, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $5, %ecx
- ja LABEL(nibble_ashr_10_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_11
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(5~15) n - 5 10(15 +(n - 5) - n) ashr_11
- */
- .p2align 4
-LABEL(ashr_11_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $5, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $11, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 11(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_11_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_11_use_sse4_2)
-
-LABEL(nibble_ashr_11_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $11, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_11_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $11, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_11_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_11_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $11, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $4, %ecx
- ja LABEL(nibble_ashr_11_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_12
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(4~15) n - 4 11(15 +(n - 4) - n) ashr_12
- */
- .p2align 4
-LABEL(ashr_12_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $4, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $12, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 12(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_12_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_12_use_sse4_2)
-
-LABEL(nibble_ashr_12_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $12, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_12_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $12, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_12_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_12_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $12, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $3, %ecx
- ja LABEL(nibble_ashr_12_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_13
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(3~15) n - 3 12(15 +(n - 3) - n) ashr_13
- */
- .p2align 4
-LABEL(ashr_13_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $3, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $13, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 13(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
-
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_13_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_13_use_sse4_2)
-
-LABEL(nibble_ashr_13_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $13, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_13_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $13, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_13_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_13_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $13, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $2, %ecx
- ja LABEL(nibble_ashr_13_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_14
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(2~15) n - 2 13(15 +(n - 2) - n) ashr_14
- */
- .p2align 4
-LABEL(ashr_14_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $2, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $14, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 14(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
- sub $0x1000, %r10 /* subtract 4K pagesize */
-
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_14_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_14_use_sse4_2)
-
-LABEL(nibble_ashr_14_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $14, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_14_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $14, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_14_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_14_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $14, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $1, %ecx
- ja LABEL(nibble_ashr_14_use_sse4_2_restart)
-
- jmp LABEL(nibble_ashr_use_sse4_2_exit)
-
-/*
- * The following cases will be handled by ashr_15
- * rcx(offset of rsi) rax(offset of rdi) relative offset corresponding case
- * n(1~15) n - 1 14(15 +(n - 1) - n) ashr_15
- */
- .p2align 4
-LABEL(ashr_15_sse4_2):
- pxor %xmm0, %xmm0
- movdqa (%rdi), %xmm2
- movdqa (%rsi), %xmm1
- pcmpeqb %xmm1, %xmm0
- pslldq $1, %xmm2
- TOLOWER (%xmm1, %xmm2)
- pcmpeqb %xmm1, %xmm2
- psubb %xmm0, %xmm2
- pmovmskb %xmm2, %r9d
- shr %cl, %edx
- shr %cl, %r9d
- sub %r9d, %edx
- jnz LABEL(less32bytes_sse4_2)
-
- movdqa (%rdi), %xmm3
-
- UPDATE_STRNCMP_COUNTER
-
- pxor %xmm0, %xmm0
- mov $16, %rcx /* index for loads */
- mov $15, %r9d /* byte position left over from less32bytes case */
- /*
- * Setup %r10 value allows us to detect crossing a page boundary.
- * When %r10 goes positive we have crossed a page boundary and
- * need to do a nibble.
- */
- lea 15(%rdi), %r10
- and $0xfff, %r10 /* offset into 4K page */
-
- sub $0x1000, %r10 /* subtract 4K pagesize */
-
- mov %rcx, %rdx /* only for offset of sse4 instruction loop*/
-
- .p2align 4
-LABEL(loop_ashr_15_use_sse4_2):
- add $16, %r10
- jg LABEL(nibble_ashr_15_use_sse4_2)
-
-LABEL(nibble_ashr_15_use_sse4_2_restart):
- movdqa (%rdi, %rdx), %xmm0
- palignr $15, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
-
- add $16, %rdx
- add $16, %r10
- jg LABEL(nibble_ashr_15_use_sse4_2)
-
- movdqa (%rdi, %rdx), %xmm0
- palignr $15, -16(%rdi, %rdx), %xmm0
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a, (%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- jbe LABEL(use_sse4_2_exit)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub $16, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add $16, %rdx
- jmp LABEL(loop_ashr_15_use_sse4_2)
-
- .p2align 4
-LABEL(nibble_ashr_15_use_sse4_2):
- sub $0x1000, %r10
- movdqa -16(%rdi, %rdx), %xmm0
- psrldq $15, %xmm0
- pcmpistri $0x3a,%xmm0, %xmm0
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- cmp %r11, %rcx
- jae LABEL(nibble_ashr_use_sse4_2_exit)
-# endif
- cmp $0, %ecx
- ja LABEL(nibble_ashr_15_use_sse4_2_restart)
-
-LABEL(nibble_ashr_use_sse4_2_exit):
-# if !defined USE_AS_STRCASECMP_L && !defined USE_AS_STRNCASECMP_L
- pcmpistri $0x1a,(%rsi,%rdx), %xmm0
-# else
- movdqa (%rsi,%rdx), %xmm1
- TOLOWER (%xmm0, %xmm1)
- pcmpistri $0x1a, %xmm1, %xmm0
-# endif
- .p2align 4
-LABEL(use_sse4_2_exit):
- jnc LABEL(strcmp_exitz_sse4_2)
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub %rcx, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- add %rcx, %rdx
- lea -16(%rdi, %r9), %rdi
- movzbl (%rdi, %rdx), %eax
- movzbl (%rsi, %rdx), %edx
- test %r8d, %r8d
- jz LABEL(use_sse4_2_ret_sse4_2)
- xchg %eax, %edx
-LABEL(use_sse4_2_ret_sse4_2):
-# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
- leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rcx
- movl (%rcx,%rdx,4), %edx
- movl (%rcx,%rax,4), %eax
-# endif
-
- sub %edx, %eax
- ret
-
-LABEL(less32bytes_sse4_2):
- lea (%rdi, %rax), %rdi /* locate the exact address for first operand(rdi) */
- lea (%rsi, %rcx), %rsi /* locate the exact address for second operand(rsi) */
- test %r8d, %r8d
- jz LABEL(ret_sse4_2)
- xchg %rsi, %rdi /* recover original order according to flag(%r8d) */
-
- .p2align 4
-LABEL(ret_sse4_2):
-LABEL(less16bytes_sse4_2):
- bsf %rdx, %rdx /* find and store bit index in %rdx */
-
-# if defined USE_AS_STRNCMP || defined USE_AS_STRNCASECMP_L
- sub %rdx, %r11
- jbe LABEL(strcmp_exitz_sse4_2)
-# endif
- movzbl (%rsi, %rdx), %ecx
- movzbl (%rdi, %rdx), %eax
-
-# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
- leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rdx
- movl (%rdx,%rcx,4), %ecx
- movl (%rdx,%rax,4), %eax
-# endif
-
- sub %ecx, %eax
- ret
-
-LABEL(strcmp_exitz_sse4_2):
- xor %eax, %eax
- ret
-
- .p2align 4
- // XXX Same as code above
-LABEL(Byte0_sse4_2):
- movzx (%rsi), %ecx
- movzx (%rdi), %eax
-
-# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L
- leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rdx
- movl (%rdx,%rcx,4), %ecx
- movl (%rdx,%rax,4), %eax
-# endif
-
- sub %ecx, %eax
- ret
- cfi_endproc
- .size STRCMP_SSE42, .-STRCMP_SSE42
-
-# undef UCLOW_reg
-# undef UCHIGH_reg
-# undef LCQWORD_reg
-# undef TOLOWER
-
- /* Put all SSE 4.2 functions together. */
- .section .rodata.sse4.2,"a",@progbits
- .p2align 3
-LABEL(unaligned_table_sse4_2):
- .int LABEL(ashr_1_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_2_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_3_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_4_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_5_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_6_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_7_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_8_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_9_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_10_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_11_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_12_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_13_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_14_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_15_sse4_2) - LABEL(unaligned_table_sse4_2)
- .int LABEL(ashr_0_sse4_2) - LABEL(unaligned_table_sse4_2)
# undef ENTRY
diff --git a/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S b/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S
deleted file mode 100644
index c730e0a5b..000000000
--- a/libc/sysdeps/x86_64/multiarch/strlen-no-bsf.S
+++ /dev/null
@@ -1,313 +0,0 @@
-/* strlen SSE2 without bsf
- Copyright (C) 2010, 2011 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#if (defined SHARED || defined USE_AS_STRCAT) && !defined NOT_IN_libc
-
-# ifndef USE_AS_STRCAT
-
-# include <sysdep.h>
-
-# define RETURN ret
-
- .section .text.sse2,"ax",@progbits
-ENTRY (__strlen_no_bsf)
-# endif
- xor %eax, %eax
- cmpb $0, (%rdi)
- jz L(exit_tail0)
- cmpb $0, 1(%rdi)
- jz L(exit_tail1)
- cmpb $0, 2(%rdi)
- jz L(exit_tail2)
- cmpb $0, 3(%rdi)
- jz L(exit_tail3)
- cmpb $0, 4(%rdi)
- jz L(exit_tail4)
- cmpb $0, 5(%rdi)
- jz L(exit_tail5)
- cmpb $0, 6(%rdi)
- jz L(exit_tail6)
- cmpb $0, 7(%rdi)
- jz L(exit_tail7)
- cmpb $0, 8(%rdi)
- jz L(exit_tail8)
- cmpb $0, 9(%rdi)
- jz L(exit_tail9)
- cmpb $0, 10(%rdi)
- jz L(exit_tail10)
- cmpb $0, 11(%rdi)
- jz L(exit_tail11)
- cmpb $0, 12(%rdi)
- jz L(exit_tail12)
- cmpb $0, 13(%rdi)
- jz L(exit_tail13)
- cmpb $0, 14(%rdi)
- jz L(exit_tail14)
- cmpb $0, 15(%rdi)
- jz L(exit_tail15)
- pxor %xmm0, %xmm0
- mov %rdi, %rcx
- mov %rdi, %rax
- and $-16, %rax
- add $16, %rax
- add $16, %rcx
-
- pcmpeqb (%rax), %xmm0
- pmovmskb %xmm0, %edx
- pxor %xmm1, %xmm1
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm1
- pmovmskb %xmm1, %edx
- pxor %xmm2, %xmm2
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
-
- pcmpeqb (%rax), %xmm2
- pmovmskb %xmm2, %edx
- pxor %xmm3, %xmm3
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm3
- pmovmskb %xmm3, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm0
- pmovmskb %xmm0, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm1
- pmovmskb %xmm1, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm2
- pmovmskb %xmm2, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm3
- pmovmskb %xmm3, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm0
- pmovmskb %xmm0, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm1
- pmovmskb %xmm1, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm2
- pmovmskb %xmm2, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm3
- pmovmskb %xmm3, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm0
- pmovmskb %xmm0, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm1
- pmovmskb %xmm1, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm2
- pmovmskb %xmm2, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- pcmpeqb (%rax), %xmm3
- pmovmskb %xmm3, %edx
- test %edx, %edx
- lea 16(%rax), %rax
- jnz L(exit)
-
- and $-0x40, %rax
-L(aligned_64):
- pcmpeqb (%rax), %xmm0
- pcmpeqb 16(%rax), %xmm1
- pcmpeqb 32(%rax), %xmm2
- pcmpeqb 48(%rax), %xmm3
- pmovmskb %xmm0, %edx
- pmovmskb %xmm1, %r11d
- pmovmskb %xmm2, %r10d
- pmovmskb %xmm3, %r9d
- or %edx, %r9d
- or %r11d, %r9d
- or %r10d, %r9d
- lea 64(%rax), %rax
- jz L(aligned_64)
-
- test %edx, %edx
- jnz L(aligned_64_exit_16)
- test %r11d, %r11d
- jnz L(aligned_64_exit_32)
- test %r10d, %r10d
- jnz L(aligned_64_exit_48)
-L(aligned_64_exit_64):
- pmovmskb %xmm3, %edx
- jmp L(aligned_64_exit)
-L(aligned_64_exit_48):
- lea -16(%rax), %rax
- mov %r10d, %edx
- jmp L(aligned_64_exit)
-L(aligned_64_exit_32):
- lea -32(%rax), %rax
- mov %r11d, %edx
- jmp L(aligned_64_exit)
-L(aligned_64_exit_16):
- lea -48(%rax), %rax
-L(aligned_64_exit):
-L(exit):
- sub %rcx, %rax
- test %dl, %dl
- jz L(exit_high)
- test $0x01, %dl
- jnz L(exit_tail0)
-
- test $0x02, %dl
- jnz L(exit_tail1)
-
- test $0x04, %dl
- jnz L(exit_tail2)
-
- test $0x08, %dl
- jnz L(exit_tail3)
-
- test $0x10, %dl
- jnz L(exit_tail4)
-
- test $0x20, %dl
- jnz L(exit_tail5)
-
- test $0x40, %dl
- jnz L(exit_tail6)
- add $7, %eax
-L(exit_tail0):
- RETURN
-
-L(exit_high):
- add $8, %eax
- test $0x01, %dh
- jnz L(exit_tail0)
-
- test $0x02, %dh
- jnz L(exit_tail1)
-
- test $0x04, %dh
- jnz L(exit_tail2)
-
- test $0x08, %dh
- jnz L(exit_tail3)
-
- test $0x10, %dh
- jnz L(exit_tail4)
-
- test $0x20, %dh
- jnz L(exit_tail5)
-
- test $0x40, %dh
- jnz L(exit_tail6)
- add $7, %eax
- RETURN
- .p2align 4
-L(exit_tail1):
- add $1, %eax
- RETURN
-
-L(exit_tail2):
- add $2, %eax
- RETURN
-
-L(exit_tail3):
- add $3, %eax
- RETURN
-
-L(exit_tail4):
- add $4, %eax
- RETURN
-
-L(exit_tail5):
- add $5, %eax
- RETURN
-L(exit_tail6):
- add $6, %eax
- RETURN
-L(exit_tail7):
- add $7, %eax
- RETURN
-L(exit_tail8):
- add $8, %eax
- RETURN
-L(exit_tail9):
- add $9, %eax
- RETURN
-L(exit_tail10):
- add $10, %eax
- RETURN
-L(exit_tail11):
- add $11, %eax
- RETURN
-L(exit_tail12):
- add $12, %eax
- RETURN
-L(exit_tail13):
- add $13, %eax
- RETURN
-L(exit_tail14):
- add $14, %eax
- RETURN
-L(exit_tail15):
- add $15, %eax
-# ifndef USE_AS_STRCAT
- RETURN
-END (__strlen_no_bsf)
-# endif
-#endif
diff --git a/libc/sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S b/libc/sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S
new file mode 100644
index 000000000..b2d1a9e4b
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/strlen-sse2-no-bsf.S
@@ -0,0 +1,686 @@
+/* strlen SSE2 without bsf
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* only for strlen case we don't use optimized version for STATIC build just for SHARED */
+
+#if (defined SHARED || defined USE_AS_STRCAT || defined USE_AS_STRNLEN) && !defined NOT_IN_libc
+
+# ifndef USE_AS_STRCAT
+
+# include <sysdep.h>
+
+# define RETURN ret
+
+# ifndef STRLEN
+# define STRLEN __strlen_sse2_no_bsf
+# endif
+
+ atom_text_section
+ENTRY (STRLEN)
+# endif
+ xor %eax, %eax
+# ifdef USE_AS_STRNLEN
+ mov %rsi, %r8
+ sub $4, %rsi
+ jbe L(len_less4_prolog)
+# endif
+ cmpb $0, (%rdi)
+ jz L(exit_tail0)
+ cmpb $0, 1(%rdi)
+ jz L(exit_tail1)
+ cmpb $0, 2(%rdi)
+ jz L(exit_tail2)
+ cmpb $0, 3(%rdi)
+ jz L(exit_tail3)
+
+# ifdef USE_AS_STRNLEN
+ sub $4, %rsi
+ jbe L(len_less8_prolog)
+# endif
+
+ cmpb $0, 4(%rdi)
+ jz L(exit_tail4)
+ cmpb $0, 5(%rdi)
+ jz L(exit_tail5)
+ cmpb $0, 6(%rdi)
+ jz L(exit_tail6)
+ cmpb $0, 7(%rdi)
+ jz L(exit_tail7)
+
+# ifdef USE_AS_STRNLEN
+ sub $4, %rsi
+ jbe L(len_less12_prolog)
+# endif
+
+ cmpb $0, 8(%rdi)
+ jz L(exit_tail8)
+ cmpb $0, 9(%rdi)
+ jz L(exit_tail9)
+ cmpb $0, 10(%rdi)
+ jz L(exit_tail10)
+ cmpb $0, 11(%rdi)
+ jz L(exit_tail11)
+
+# ifdef USE_AS_STRNLEN
+ sub $4, %rsi
+ jbe L(len_less16_prolog)
+# endif
+
+ cmpb $0, 12(%rdi)
+ jz L(exit_tail12)
+ cmpb $0, 13(%rdi)
+ jz L(exit_tail13)
+ cmpb $0, 14(%rdi)
+ jz L(exit_tail14)
+ cmpb $0, 15(%rdi)
+ jz L(exit_tail15)
+ pxor %xmm0, %xmm0
+ lea 16(%rdi), %rcx
+ lea 16(%rdi), %rax
+ and $-16, %rax
+
+# ifdef USE_AS_STRNLEN
+ and $15, %rdi
+ add %rdi, %rsi
+ sub $64, %rsi
+ jbe L(len_less64)
+# endif
+
+ pcmpeqb (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ pxor %xmm1, %xmm1
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ pxor %xmm2, %xmm2
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm2
+ pmovmskb %xmm2, %edx
+ pxor %xmm3, %xmm3
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+# ifdef USE_AS_STRNLEN
+ sub $64, %rsi
+ jbe L(len_less64)
+# endif
+
+ pcmpeqb (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm2
+ pmovmskb %xmm2, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+# ifdef USE_AS_STRNLEN
+ sub $64, %rsi
+ jbe L(len_less64)
+# endif
+
+ pcmpeqb (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm2
+ pmovmskb %xmm2, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+# ifdef USE_AS_STRNLEN
+ sub $64, %rsi
+ jbe L(len_less64)
+# endif
+
+ pcmpeqb (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm2
+ pmovmskb %xmm2, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqb (%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+# ifdef USE_AS_STRNLEN
+ mov %rax, %rdx
+ and $63, %rdx
+ add %rdx, %rsi
+# endif
+
+ and $-0x40, %rax
+
+ .p2align 4
+L(aligned_64):
+# ifdef USE_AS_STRNLEN
+ sub $64, %rsi
+ jbe L(len_less64)
+# endif
+ pcmpeqb (%rax), %xmm0
+ pcmpeqb 16(%rax), %xmm1
+ pcmpeqb 32(%rax), %xmm2
+ pcmpeqb 48(%rax), %xmm3
+ pmovmskb %xmm0, %edx
+ pmovmskb %xmm1, %r11d
+ pmovmskb %xmm2, %r10d
+ pmovmskb %xmm3, %r9d
+ or %edx, %r9d
+ or %r11d, %r9d
+ or %r10d, %r9d
+ lea 64(%rax), %rax
+ jz L(aligned_64)
+
+ test %edx, %edx
+ jnz L(aligned_64_exit_16)
+ test %r11d, %r11d
+ jnz L(aligned_64_exit_32)
+ test %r10d, %r10d
+ jnz L(aligned_64_exit_48)
+L(aligned_64_exit_64):
+ pmovmskb %xmm3, %edx
+ jmp L(aligned_64_exit)
+L(aligned_64_exit_48):
+ lea -16(%rax), %rax
+ mov %r10d, %edx
+ jmp L(aligned_64_exit)
+L(aligned_64_exit_32):
+ lea -32(%rax), %rax
+ mov %r11d, %edx
+ jmp L(aligned_64_exit)
+L(aligned_64_exit_16):
+ lea -48(%rax), %rax
+L(aligned_64_exit):
+L(exit):
+ sub %rcx, %rax
+ test %dl, %dl
+ jz L(exit_high)
+ test $0x01, %dl
+ jnz L(exit_tail0)
+
+ test $0x02, %dl
+ jnz L(exit_tail1)
+
+ test $0x04, %dl
+ jnz L(exit_tail2)
+
+ test $0x08, %dl
+ jnz L(exit_tail3)
+
+ test $0x10, %dl
+ jnz L(exit_tail4)
+
+ test $0x20, %dl
+ jnz L(exit_tail5)
+
+ test $0x40, %dl
+ jnz L(exit_tail6)
+ add $7, %eax
+L(exit_tail0):
+ RETURN
+
+L(exit_high):
+ add $8, %eax
+ test $0x01, %dh
+ jnz L(exit_tail0)
+
+ test $0x02, %dh
+ jnz L(exit_tail1)
+
+ test $0x04, %dh
+ jnz L(exit_tail2)
+
+ test $0x08, %dh
+ jnz L(exit_tail3)
+
+ test $0x10, %dh
+ jnz L(exit_tail4)
+
+ test $0x20, %dh
+ jnz L(exit_tail5)
+
+ test $0x40, %dh
+ jnz L(exit_tail6)
+ add $7, %eax
+ RETURN
+
+# ifdef USE_AS_STRNLEN
+
+ .p2align 4
+L(len_less64):
+ pxor %xmm0, %xmm0
+ add $64, %rsi
+
+ pcmpeqb (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ pxor %xmm1, %xmm1
+ lea 16(%rax), %rax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ sub $16, %rsi
+ jbe L(return_start_len)
+
+ pcmpeqb (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ lea 16(%rax), %rax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ sub $16, %rsi
+ jbe L(return_start_len)
+
+ pcmpeqb (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ lea 16(%rax), %rax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ sub $16, %rsi
+ jbe L(return_start_len)
+
+ pcmpeqb (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ lea 16(%rax), %rax
+ test %edx, %edx
+ jnz L(strnlen_exit)
+
+ mov %r8, %rax
+ ret
+
+ .p2align 4
+L(strnlen_exit):
+ sub %rcx, %rax
+
+ test %dl, %dl
+ jz L(strnlen_exit_high)
+ mov %dl, %cl
+ and $15, %cl
+ jz L(strnlen_exit_8)
+ test $0x01, %dl
+ jnz L(exit_tail0)
+ test $0x02, %dl
+ jnz L(strnlen_exit_tail1)
+ test $0x04, %dl
+ jnz L(strnlen_exit_tail2)
+ sub $4, %rsi
+ jb L(return_start_len)
+ lea 3(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_8):
+ test $0x10, %dl
+ jnz L(strnlen_exit_tail4)
+ test $0x20, %dl
+ jnz L(strnlen_exit_tail5)
+ test $0x40, %dl
+ jnz L(strnlen_exit_tail6)
+ sub $8, %rsi
+ jb L(return_start_len)
+ lea 7(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_high):
+ mov %dh, %ch
+ and $15, %ch
+ jz L(strnlen_exit_high_8)
+ test $0x01, %dh
+ jnz L(strnlen_exit_tail8)
+ test $0x02, %dh
+ jnz L(strnlen_exit_tail9)
+ test $0x04, %dh
+ jnz L(strnlen_exit_tail10)
+ sub $12, %rsi
+ jb L(return_start_len)
+ lea 11(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_high_8):
+ test $0x10, %dh
+ jnz L(strnlen_exit_tail12)
+ test $0x20, %dh
+ jnz L(strnlen_exit_tail13)
+ test $0x40, %dh
+ jnz L(strnlen_exit_tail14)
+ sub $16, %rsi
+ jb L(return_start_len)
+ lea 15(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail1):
+ sub $2, %rsi
+ jb L(return_start_len)
+ lea 1(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail2):
+ sub $3, %rsi
+ jb L(return_start_len)
+ lea 2(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail4):
+ sub $5, %rsi
+ jb L(return_start_len)
+ lea 4(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail5):
+ sub $6, %rsi
+ jb L(return_start_len)
+ lea 5(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail6):
+ sub $7, %rsi
+ jb L(return_start_len)
+ lea 6(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail8):
+ sub $9, %rsi
+ jb L(return_start_len)
+ lea 8(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail9):
+ sub $10, %rsi
+ jb L(return_start_len)
+ lea 9(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail10):
+ sub $11, %rsi
+ jb L(return_start_len)
+ lea 10(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail12):
+ sub $13, %rsi
+ jb L(return_start_len)
+ lea 12(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail13):
+ sub $14, %rsi
+ jb L(return_start_len)
+ lea 13(%eax), %eax
+ ret
+
+ .p2align 4
+L(strnlen_exit_tail14):
+ sub $15, %rsi
+ jb L(return_start_len)
+ lea 14(%eax), %eax
+ ret
+
+ .p2align 4
+L(return_start_len):
+ mov %r8, %rax
+ ret
+
+/* for prolog only */
+
+ .p2align 4
+L(len_less4_prolog):
+ add $4, %rsi
+ jz L(exit_tail0)
+
+ cmpb $0, (%rdi)
+ jz L(exit_tail0)
+ cmp $1, %esi
+ je L(exit_tail1)
+
+ cmpb $0, 1(%rdi)
+ jz L(exit_tail1)
+ cmp $2, %esi
+ je L(exit_tail2)
+
+ cmpb $0, 2(%rdi)
+ jz L(exit_tail2)
+ cmp $3, %esi
+ je L(exit_tail3)
+
+ cmpb $0, 3(%rdi)
+ jz L(exit_tail3)
+ mov $4, %eax
+ ret
+
+ .p2align 4
+L(len_less8_prolog):
+ add $4, %rsi
+
+ cmpb $0, 4(%rdi)
+ jz L(exit_tail4)
+ cmp $1, %esi
+ je L(exit_tail5)
+
+ cmpb $0, 5(%rdi)
+ jz L(exit_tail5)
+ cmp $2, %esi
+ je L(exit_tail6)
+
+ cmpb $0, 6(%rdi)
+ jz L(exit_tail6)
+ cmp $3, %esi
+ je L(exit_tail7)
+
+ cmpb $0, 7(%rdi)
+ jz L(exit_tail7)
+ mov $8, %eax
+ ret
+
+ .p2align 4
+L(len_less12_prolog):
+ add $4, %rsi
+
+ cmpb $0, 8(%rdi)
+ jz L(exit_tail8)
+ cmp $1, %esi
+ je L(exit_tail9)
+
+ cmpb $0, 9(%rdi)
+ jz L(exit_tail9)
+ cmp $2, %esi
+ je L(exit_tail10)
+
+ cmpb $0, 10(%rdi)
+ jz L(exit_tail10)
+ cmp $3, %esi
+ je L(exit_tail11)
+
+ cmpb $0, 11(%rdi)
+ jz L(exit_tail11)
+ mov $12, %eax
+ ret
+
+ .p2align 4
+L(len_less16_prolog):
+ add $4, %rsi
+
+ cmpb $0, 12(%rdi)
+ jz L(exit_tail12)
+ cmp $1, %esi
+ je L(exit_tail13)
+
+ cmpb $0, 13(%rdi)
+ jz L(exit_tail13)
+ cmp $2, %esi
+ je L(exit_tail14)
+
+ cmpb $0, 14(%rdi)
+ jz L(exit_tail14)
+ cmp $3, %esi
+ je L(exit_tail15)
+
+ cmpb $0, 15(%rdi)
+ jz L(exit_tail15)
+ mov $16, %eax
+ ret
+# endif
+
+ .p2align 4
+L(exit_tail1):
+ add $1, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail2):
+ add $2, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail3):
+ add $3, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail4):
+ add $4, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail5):
+ add $5, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail6):
+ add $6, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail7):
+ add $7, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail8):
+ add $8, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail9):
+ add $9, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail10):
+ add $10, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail11):
+ add $11, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail12):
+ add $12, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail13):
+ add $13, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail14):
+ add $14, %eax
+ RETURN
+
+ .p2align 4
+L(exit_tail15):
+ add $15, %eax
+# ifndef USE_AS_STRCAT
+ RETURN
+END (STRLEN)
+# endif
+#endif
diff --git a/libc/sysdeps/x86_64/multiarch/strlen.S b/libc/sysdeps/x86_64/multiarch/strlen.S
index 43e2100f4..7716d3674 100644
--- a/libc/sysdeps/x86_64/multiarch/strlen.S
+++ b/libc/sysdeps/x86_64/multiarch/strlen.S
@@ -42,7 +42,7 @@ ENTRY(strlen)
ret
2: testl $bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip)
jz 3f
- leaq __strlen_no_bsf(%rip), %rax
+ leaq __strlen_sse2_no_bsf(%rip), %rax
3: ret
END(strlen)
diff --git a/libc/sysdeps/x86_64/multiarch/strnlen-sse2-no-bsf.S b/libc/sysdeps/x86_64/multiarch/strnlen-sse2-no-bsf.S
new file mode 100644
index 000000000..248328d99
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/strnlen-sse2-no-bsf.S
@@ -0,0 +1,3 @@
+#define USE_AS_STRNLEN
+#define STRLEN __strnlen_sse2_no_bsf
+#include "strlen-sse2-no-bsf.S"
diff --git a/libc/sysdeps/x86_64/multiarch/strnlen.S b/libc/sysdeps/x86_64/multiarch/strnlen.S
new file mode 100644
index 000000000..75c9adfbc
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/strnlen.S
@@ -0,0 +1,55 @@
+/* multiple version of strnlen
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+
+/* Define multiple versions only for the definition in libc. */
+#ifndef NOT_IN_libc
+
+ .text
+ENTRY(__strnlen)
+ .type __strnlen, @gnu_indirect_function
+ cmpl $0, __cpu_features+KIND_OFFSET(%rip)
+ jne 1f
+ call __init_cpu_features
+1: leaq __strnlen_sse2(%rip), %rax
+ testl $bit_Slow_BSF, __cpu_features+FEATURE_OFFSET+index_Slow_BSF(%rip)
+ jz 2f
+ leaq __strnlen_sse2_no_bsf(%rip), %rax
+2: ret
+END(__strnlen)
+
+# undef ENTRY
+# define ENTRY(name) \
+ .type __strnlen_sse2, @function; \
+ .align 16; \
+ __strnlen_sse2: cfi_startproc; \
+ CALL_MCOUNT
+# undef END
+# define END(name) \
+ cfi_endproc; .size __strnlen_sse2, .-__strnlen_sse2
+
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ .globl __GI_strnlen; __GI_strnlen = __strnlen_sse2
+#endif
+
+#include "../strnlen.S"
diff --git a/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S b/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S
index bbc94c3e8..f839ecfbd 100644
--- a/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S
+++ b/libc/sysdeps/x86_64/multiarch/strrchr-sse2-no-bsf.S
@@ -23,7 +23,7 @@
# include <sysdep.h>
# include "asm-syntax.h"
- .text
+ atom_text_section
ENTRY (__strrchr_sse2_no_bsf)
movd %rsi, %xmm1
diff --git a/libc/sysdeps/x86_64/multiarch/wmemcmp-c.c b/libc/sysdeps/x86_64/multiarch/wmemcmp-c.c
new file mode 100644
index 000000000..793f059af
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/wmemcmp-c.c
@@ -0,0 +1,5 @@
+#ifndef NOT_IN_libc
+# define WMEMCMP __wmemcmp_sse2
+#endif
+
+#include "wcsmbs/wmemcmp.c"
diff --git a/libc/sysdeps/x86_64/multiarch/wmemcmp-sse4.S b/libc/sysdeps/x86_64/multiarch/wmemcmp-sse4.S
new file mode 100644
index 000000000..b07973a4f
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/wmemcmp-sse4.S
@@ -0,0 +1,4 @@
+#define USE_AS_WMEMCMP 1
+#define MEMCMP __wmemcmp_sse4_1
+
+#include "memcmp-sse4.S"
diff --git a/libc/sysdeps/x86_64/multiarch/wmemcmp-ssse3.S b/libc/sysdeps/x86_64/multiarch/wmemcmp-ssse3.S
new file mode 100644
index 000000000..a41ef95fc
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/wmemcmp-ssse3.S
@@ -0,0 +1,4 @@
+#define USE_AS_WMEMCMP 1
+#define MEMCMP __wmemcmp_ssse3
+
+#include "memcmp-ssse3.S"
diff --git a/libc/sysdeps/x86_64/multiarch/wmemcmp.S b/libc/sysdeps/x86_64/multiarch/wmemcmp.S
new file mode 100644
index 000000000..7c3b7ed17
--- /dev/null
+++ b/libc/sysdeps/x86_64/multiarch/wmemcmp.S
@@ -0,0 +1,47 @@
+/* Multiple versions of wmemcmp
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <init-arch.h>
+
+/* Define multiple versions only for the definition in libc. */
+#ifndef NOT_IN_libc
+ .text
+ENTRY(wmemcmp)
+ .type wmemcmp, @gnu_indirect_function
+ cmpl $0, KIND_OFFSET+__cpu_features(%rip)
+ jne 1f
+ call __init_cpu_features
+
+1: testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
+ jnz 2f
+ leaq __wmemcmp_sse2(%rip), %rax
+ ret
+
+2: testl $bit_SSE4_1, __cpu_features+CPUID_OFFSET+index_SSE4_1(%rip)
+ jz 3f
+ leaq __wmemcmp_sse4_1(%rip), %rax
+ ret
+
+3: leaq __wmemcmp_ssse3(%rip), %rax
+ ret
+
+END(wmemcmp)
+#endif
diff --git a/libc/sysdeps/x86_64/rawmemchr.S b/libc/sysdeps/x86_64/rawmemchr.S
index cfb4cebf6..a68b52c45 100644
--- a/libc/sysdeps/x86_64/rawmemchr.S
+++ b/libc/sysdeps/x86_64/rawmemchr.S
@@ -1,5 +1,7 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- Contributed by Ulrich Drepper <drepper@redhat.com>.
+/* fast SSE2 memchr with 64 byte loop and pmaxub instruction using
+
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,34 +21,187 @@
#include <sysdep.h>
-
.text
ENTRY (rawmemchr)
- movd %esi, %xmm1
- movq %rdi, %rcx
+ movd %rsi, %xmm1
+ mov %rdi, %rcx
+
punpcklbw %xmm1, %xmm1
- andq $~15, %rdi
punpcklbw %xmm1, %xmm1
- orl $0xffffffff, %esi
- movdqa (%rdi), %xmm0
+
+ and $63, %rcx
pshufd $0, %xmm1, %xmm1
- subq %rdi, %rcx
+
+ cmp $48, %rcx
+ ja L(crosscache)
+
+ movdqu (%rdi), %xmm0
pcmpeqb %xmm1, %xmm0
- shl %cl, %esi
- pmovmskb %xmm0, %ecx
- andl %esi, %ecx
- jnz 1f
+/* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+
+ jnz L(matches)
+ add $16, %rdi
+ and $-16, %rdi
+ jmp L(loop_prolog)
+
+ .p2align 4
+L(crosscache):
+ and $15, %rcx
+ and $-16, %rdi
+ movdqa (%rdi), %xmm0
-2: movdqa 16(%rdi), %xmm0
- leaq 16(%rdi), %rdi
pcmpeqb %xmm1, %xmm0
- pmovmskb %xmm0, %ecx
- testl %ecx, %ecx
- jz 2b
+/* Check if there is a match. */
+ pmovmskb %xmm0, %eax
+/* Remove the leading bytes. */
+ sar %cl, %eax
+ test %eax, %eax
+ je L(unaligned_no_match)
+/* Check which byte is a match. */
+ bsf %eax, %eax
-1: bsfl %ecx, %eax
- addq %rdi, %rax
+ add %rdi, %rax
+ add %rcx, %rax
ret
+
+ .p2align 4
+L(unaligned_no_match):
+ add $16, %rdi
+
+ .p2align 4
+L(loop_prolog):
+ movdqa (%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ movdqa 16(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 48(%rdi), %xmm4
+ pcmpeqb %xmm1, %xmm4
+ add $64, %rdi
+ pmovmskb %xmm4, %eax
+ test %eax, %eax
+ jnz L(matches0)
+
+ test $0x3f, %rdi
+ jz L(align64_loop)
+
+ movdqa (%rdi), %xmm0
+ pcmpeqb %xmm1, %xmm0
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ movdqa 16(%rdi), %xmm2
+ pcmpeqb %xmm1, %xmm2
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ movdqa 48(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+ pmovmskb %xmm3, %eax
+
+ add $64, %rdi
+ test %eax, %eax
+ jnz L(matches0)
+
+ and $-64, %rdi
+
+ .p2align 4
+L(align64_loop):
+ movdqa (%rdi), %xmm0
+ movdqa 16(%rdi), %xmm2
+ movdqa 32(%rdi), %xmm3
+ movdqa 48(%rdi), %xmm4
+
+ pcmpeqb %xmm1, %xmm0
+ pcmpeqb %xmm1, %xmm2
+ pcmpeqb %xmm1, %xmm3
+ pcmpeqb %xmm1, %xmm4
+
+ pmaxub %xmm0, %xmm3
+ pmaxub %xmm2, %xmm4
+ pmaxub %xmm3, %xmm4
+ pmovmskb %xmm4, %eax
+
+ add $64, %rdi
+
+ test %eax, %eax
+ jz L(align64_loop)
+
+ sub $64, %rdi
+
+ pmovmskb %xmm0, %eax
+ test %eax, %eax
+ jnz L(matches)
+
+ pmovmskb %xmm2, %eax
+ test %eax, %eax
+ jnz L(matches16)
+
+ movdqa 32(%rdi), %xmm3
+ pcmpeqb %xmm1, %xmm3
+
+ pcmpeqb 48(%rdi), %xmm1
+ pmovmskb %xmm3, %eax
+ test %eax, %eax
+ jnz L(matches32)
+
+ pmovmskb %xmm1, %eax
+ bsf %eax, %eax
+ lea 48(%rdi, %rax), %rax
+ ret
+
+ .p2align 4
+L(matches0):
+ bsf %eax, %eax
+ lea -16(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(matches):
+ bsf %eax, %eax
+ add %rdi, %rax
+ ret
+
+ .p2align 4
+L(matches16):
+ bsf %eax, %eax
+ lea 16(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(matches32):
+ bsf %eax, %eax
+ lea 32(%rax, %rdi), %rax
+ ret
+
+ .p2align 4
+L(return_null):
+ xor %rax, %rax
+ ret
+
END (rawmemchr)
strong_alias (rawmemchr, __rawmemchr)
diff --git a/libc/sysdeps/x86_64/sysdep.h b/libc/sysdeps/x86_64/sysdep.h
index 1d35f8fd1..d61e12673 100644
--- a/libc/sysdeps/x86_64/sysdep.h
+++ b/libc/sysdeps/x86_64/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for x86-64.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2011 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
@@ -114,4 +114,6 @@ lose: \
# endif
#endif
+#define atom_text_section .section ".text.atom", "ax"
+
#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/x86_64/wcscmp.S b/libc/sysdeps/x86_64/wcscmp.S
index 14dcab8c8..146fa3a2c 100644
--- a/libc/sysdeps/x86_64/wcscmp.S
+++ b/libc/sysdeps/x86_64/wcscmp.S
@@ -19,11 +19,8 @@
02111-1307 USA. */
#include <sysdep.h>
-#include <init-arch.h>
-/* Define multiple versions only for the definition in libc and for
- the DSO. In static binaries we need wcscmp before the initialization
- happened. */
+/* Note: wcscmp uses signed comparison, not unsighed as in strcmp function. */
.text
ENTRY (wcscmp)
@@ -214,20 +211,20 @@ L(continue_00_48):
test %ecx, %ecx
jnz L(less4_double_words1)
- sub (%rsi), %eax
- jnz L(return)
+ cmp (%rsi), %eax
+ jne L(nequal)
mov 4(%rdi), %eax
- sub 4(%rsi), %eax
- jnz L(return)
+ cmp 4(%rsi), %eax
+ jne L(nequal)
mov 8(%rdi), %eax
- sub 8(%rsi), %eax
- jnz L(return)
+ cmp 8(%rsi), %eax
+ jne L(nequal)
mov 12(%rdi), %eax
- sub 12(%rsi), %eax
- jnz L(return)
+ cmp 12(%rsi), %eax
+ jne L(nequal)
movdqu 16(%rsi), %xmm2
pcmpeqd %xmm2, %xmm0 /* Any null double_word? */
@@ -535,20 +532,20 @@ L(continue_48_00):
test %ecx, %ecx
jnz L(less4_double_words1)
- sub (%rsi), %eax
- jnz L(return)
+ cmp (%rsi), %eax
+ jne L(nequal)
mov 4(%rdi), %eax
- sub 4(%rsi), %eax
- jnz L(return)
+ cmp 4(%rsi), %eax
+ jne L(nequal)
mov 8(%rdi), %eax
- sub 8(%rsi), %eax
- jnz L(return)
+ cmp 8(%rsi), %eax
+ jne L(nequal)
mov 12(%rdi), %eax
- sub 12(%rsi), %eax
- jnz L(return)
+ cmp 12(%rsi), %eax
+ jne L(nequal)
movdqu 16(%rdi), %xmm1
pcmpeqd %xmm1, %xmm0 /* Any null double_word? */
@@ -789,25 +786,29 @@ L(less4_double_words1):
test %ecx, %ecx
jz L(equal)
- mov 12(%rsi), %edx
- mov 12(%rdi), %eax
- sub %edx, %eax
+ mov 12(%rsi), %ecx
+ cmp %ecx, 12(%rdi)
+ jne L(nequal)
+ xor %eax, %eax
ret
.p2align 4
L(less4_double_words):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words)
and $15, %dl
jz L(second_double_word)
mov (%rdi), %eax
- sub (%rsi), %eax
+ cmp (%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(second_double_word):
mov 4(%rdi), %eax
- sub 4(%rsi), %eax
+ cmp 4(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
@@ -815,29 +816,34 @@ L(next_two_double_words):
and $15, %dh
jz L(fourth_double_word)
mov 8(%rdi), %eax
- sub 8(%rsi), %eax
+ cmp 8(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(fourth_double_word):
mov 12(%rdi), %eax
- sub 12(%rsi), %eax
+ cmp 12(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(less4_double_words_16):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words_16)
and $15, %dl
jz L(second_double_word_16)
mov 16(%rdi), %eax
- sub 16(%rsi), %eax
+ cmp 16(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(second_double_word_16):
mov 20(%rdi), %eax
- sub 20(%rsi), %eax
+ cmp 20(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
@@ -845,29 +851,34 @@ L(next_two_double_words_16):
and $15, %dh
jz L(fourth_double_word_16)
mov 24(%rdi), %eax
- sub 24(%rsi), %eax
+ cmp 24(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(fourth_double_word_16):
mov 28(%rdi), %eax
- sub 28(%rsi), %eax
+ cmp 28(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(less4_double_words_32):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words_32)
and $15, %dl
jz L(second_double_word_32)
mov 32(%rdi), %eax
- sub 32(%rsi), %eax
+ cmp 32(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(second_double_word_32):
mov 36(%rdi), %eax
- sub 36(%rsi), %eax
+ cmp 36(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
@@ -875,29 +886,34 @@ L(next_two_double_words_32):
and $15, %dh
jz L(fourth_double_word_32)
mov 40(%rdi), %eax
- sub 40(%rsi), %eax
+ cmp 40(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(fourth_double_word_32):
mov 44(%rdi), %eax
- sub 44(%rsi), %eax
+ cmp 44(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(less4_double_words_48):
+ xor %eax, %eax
test %dl, %dl
jz L(next_two_double_words_48)
and $15, %dl
jz L(second_double_word_48)
mov 48(%rdi), %eax
- sub 48(%rsi), %eax
+ cmp 48(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(second_double_word_48):
mov 52(%rdi), %eax
- sub 52(%rsi), %eax
+ cmp 52(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
@@ -905,23 +921,21 @@ L(next_two_double_words_48):
and $15, %dh
jz L(fourth_double_word_48)
mov 56(%rdi), %eax
- sub 56(%rsi), %eax
+ cmp 56(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(fourth_double_word_48):
mov 60(%rdi), %eax
- sub 60(%rsi), %eax
- ret
-
- .p2align 4
-L(return):
+ cmp 60(%rsi), %eax
+ jne L(nequal)
ret
.p2align 4
L(nequal):
mov $1, %eax
- ja L(nequal_bigger)
+ jg L(nequal_bigger)
neg %eax
L(nequal_bigger):
diff --git a/libc/sysdeps/x86_64/wcslen.S b/libc/sysdeps/x86_64/wcslen.S
new file mode 100644
index 000000000..0343ac78d
--- /dev/null
+++ b/libc/sysdeps/x86_64/wcslen.S
@@ -0,0 +1,239 @@
+/* Optimized wcslen for x86-64 with SSE2.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Intel Corporation.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY (__wcslen)
+ cmpl $0, (%rdi)
+ jz L(exit_tail0)
+ cmpl $0, 4(%rdi)
+ jz L(exit_tail1)
+ cmpl $0, 8(%rdi)
+ jz L(exit_tail2)
+ cmpl $0, 12(%rdi)
+ jz L(exit_tail3)
+ cmpl $0, 16(%rdi)
+ jz L(exit_tail4)
+ cmpl $0, 20(%rdi)
+ jz L(exit_tail5)
+ cmpl $0, 24(%rdi)
+ jz L(exit_tail6)
+ cmpl $0, 28(%rdi)
+ jz L(exit_tail7)
+
+ pxor %xmm0, %xmm0
+
+ lea 32(%rdi), %rax
+ lea 16(%rdi), %rcx
+ and $-16, %rax
+
+ pcmpeqd (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ pxor %xmm1, %xmm1
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ pxor %xmm2, %xmm2
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm2
+ pmovmskb %xmm2, %edx
+ pxor %xmm3, %xmm3
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm2
+ pmovmskb %xmm2, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm0
+ pmovmskb %xmm0, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm1
+ pmovmskb %xmm1, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm2
+ pmovmskb %xmm2, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ pcmpeqd (%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 16(%rax), %rax
+ jnz L(exit)
+
+ and $-0x40, %rax
+
+ .p2align 4
+L(aligned_64_loop):
+ movaps (%rax), %xmm0
+ movaps 16(%rax), %xmm1
+ movaps 32(%rax), %xmm2
+ movaps 48(%rax), %xmm6
+
+ pminub %xmm1, %xmm0
+ pminub %xmm6, %xmm2
+ pminub %xmm0, %xmm2
+ pcmpeqd %xmm3, %xmm2
+ pmovmskb %xmm2, %edx
+ test %edx, %edx
+ lea 64(%rax), %rax
+ jz L(aligned_64_loop)
+
+ pcmpeqd -64(%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea 48(%rcx), %rcx
+ jnz L(exit)
+
+ pcmpeqd %xmm1, %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea -16(%rcx), %rcx
+ jnz L(exit)
+
+ pcmpeqd -32(%rax), %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea -16(%rcx), %rcx
+ jnz L(exit)
+
+ pcmpeqd %xmm6, %xmm3
+ pmovmskb %xmm3, %edx
+ test %edx, %edx
+ lea -16(%rcx), %rcx
+ jnz L(exit)
+
+ jmp L(aligned_64_loop)
+
+ .p2align 4
+L(exit):
+ sub %rcx, %rax
+ shr $2, %rax
+ test %dl, %dl
+ jz L(exit_high)
+
+ mov %dl, %cl
+ and $15, %cl
+ jz L(exit_1)
+ ret
+
+ .p2align 4
+L(exit_high):
+ mov %dh, %ch
+ and $15, %ch
+ jz L(exit_3)
+ add $2, %rax
+ ret
+
+ .p2align 4
+L(exit_1):
+ add $1, %rax
+ ret
+
+ .p2align 4
+L(exit_3):
+ add $3, %rax
+ ret
+
+ .p2align 4
+L(exit_tail0):
+ xor %rax, %rax
+ ret
+
+ .p2align 4
+L(exit_tail1):
+ mov $1, %rax
+ ret
+
+ .p2align 4
+L(exit_tail2):
+ mov $2, %rax
+ ret
+
+ .p2align 4
+L(exit_tail3):
+ mov $3, %rax
+ ret
+
+ .p2align 4
+L(exit_tail4):
+ mov $4, %rax
+ ret
+
+ .p2align 4
+L(exit_tail5):
+ mov $5, %rax
+ ret
+
+ .p2align 4
+L(exit_tail6):
+ mov $6, %rax
+ ret
+
+ .p2align 4
+L(exit_tail7):
+ mov $7, %rax
+ ret
+
+END (__wcslen)
+
+weak_alias(__wcslen, wcslen)
diff --git a/libc/tls.make.c b/libc/tls.make.c
deleted file mode 100644
index 6bcd2479c..000000000
--- a/libc/tls.make.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* This produces a makefile fragment saying `use-thread = yes' or no. */
-
-#include <tls.h>
-
-#if USE___THREAD
-@@@ use-thread = yes @@@
-#else
-@@@ use-thread = no @@@
-#endif
diff --git a/libc/wcsmbs/Makefile b/libc/wcsmbs/Makefile
index 3af34464b..bffdaf4c8 100644
--- a/libc/wcsmbs/Makefile
+++ b/libc/wcsmbs/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2000,2002,2003,2004,2005,2006,2007
+# Copyright (C) 1995-2000,2002,2003,2004,2005,2006,2007,2011
# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
@@ -49,12 +49,13 @@ routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
+= isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf
+strop-tests := wcscmp wmemcmp wcslen wcschr
tests := tst-wchar-h
tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+= tst-btowc tst-mbrtowc tst-mbrtowc2 tst-wcrtomb
tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
+= tst-wcstof wcsmbs-tst1 tst-wcsnlen \
- tst-wcpncpy tst-mbsrtowcs wcsatcliff
+ tst-wcpncpy tst-mbsrtowcs wcsatcliff $(addprefix test-,$(strop-tests))
include ../Rules
diff --git a/libc/wcsmbs/test-wcschr.c b/libc/wcsmbs/test-wcschr.c
new file mode 100644
index 000000000..be0abf7ae
--- /dev/null
+++ b/libc/wcsmbs/test-wcschr.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strchr.c"
diff --git a/libc/wcsmbs/test-wcscmp.c b/libc/wcsmbs/test-wcscmp.c
new file mode 100644
index 000000000..aa18c30a6
--- /dev/null
+++ b/libc/wcsmbs/test-wcscmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strcmp.c"
diff --git a/libc/wcsmbs/test-wcslen.c b/libc/wcsmbs/test-wcslen.c
new file mode 100644
index 000000000..496fa185e
--- /dev/null
+++ b/libc/wcsmbs/test-wcslen.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strlen.c"
diff --git a/libc/wcsmbs/test-wmemcmp.c b/libc/wcsmbs/test-wmemcmp.c
new file mode 100644
index 000000000..73bc4b72c
--- /dev/null
+++ b/libc/wcsmbs/test-wmemcmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-memcmp.c"
diff --git a/libc/wcsmbs/wcscmp.c b/libc/wcsmbs/wcscmp.c
index 6c93f702f..ddbd4aa93 100644
--- a/libc/wcsmbs/wcscmp.c
+++ b/libc/wcsmbs/wcscmp.c
@@ -37,11 +37,11 @@ WCSCMP (s1, s2)
{
c1 = (wint_t) *s1++;
c2 = (wint_t) *s2++;
- if (c1 == L'\0')
+ if (c2 == L'\0')
return c1 - c2;
}
while (c1 == c2);
- return c1 - c2;
+ return c1 < c2 ? -1 : 1;
}
libc_hidden_def (WCSCMP)
diff --git a/libc/wcsmbs/wcslen.c b/libc/wcsmbs/wcslen.c
index 1bced4bc9..4d7972b7c 100644
--- a/libc/wcsmbs/wcslen.c
+++ b/libc/wcsmbs/wcslen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@@ -19,10 +19,13 @@
#include <wchar.h>
-
/* Return length of string S. */
+#ifndef WCSLEN
+# define WCSLEN __wcslen
+#endif
+
size_t
-__wcslen (s)
+WCSLEN (s)
const wchar_t *s;
{
size_t len = 0;
@@ -40,4 +43,6 @@ __wcslen (s)
return len;
}
+#ifndef WCSLEN
weak_alias (__wcslen, wcslen)
+#endif
diff --git a/libc/wcsmbs/wmemcmp.c b/libc/wcsmbs/wmemcmp.c
index c6a321b89..73c6394f8 100644
--- a/libc/wcsmbs/wmemcmp.c
+++ b/libc/wcsmbs/wmemcmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
@@ -19,9 +19,12 @@
#include <wchar.h>
+#ifndef WMEMCMP
+# define WMEMCMP wmemcmp
+#endif
int
-wmemcmp (s1, s2, n)
+WMEMCMP (s1, s2, n)
const wchar_t *s1;
const wchar_t *s2;
size_t n;
@@ -34,19 +37,19 @@ wmemcmp (s1, s2, n)
c1 = (wint_t) s1[0];
c2 = (wint_t) s2[0];
if (c1 - c2 != 0)
- return c1 - c2;
+ return c1 > c2 ? 1 : -1;
c1 = (wint_t) s1[1];
c2 = (wint_t) s2[1];
if (c1 - c2 != 0)
- return c1 - c2;
+ return c1 > c2 ? 1 : -1;
c1 = (wint_t) s1[2];
c2 = (wint_t) s2[2];
if (c1 - c2 != 0)
- return c1 - c2;
+ return c1 > c2 ? 1 : -1;
c1 = (wint_t) s1[3];
c2 = (wint_t) s2[3];
if (c1 - c2 != 0)
- return c1 - c2;
+ return c1 > c2 ? 1 : -1;
s1 += 4;
s2 += 4;
n -= 4;
@@ -57,7 +60,7 @@ wmemcmp (s1, s2, n)
c1 = (wint_t) s1[0];
c2 = (wint_t) s2[0];
if (c1 - c2 != 0)
- return c1 - c2;
+ return c1 > c2 ? 1 : -1;
++s1;
++s2;
--n;
@@ -67,7 +70,7 @@ wmemcmp (s1, s2, n)
c1 = (wint_t) s1[0];
c2 = (wint_t) s2[0];
if (c1 - c2 != 0)
- return c1 - c2;
+ return c1 > c2 ? 1 : -1;
++s1;
++s2;
--n;
@@ -77,7 +80,7 @@ wmemcmp (s1, s2, n)
c1 = (wint_t) s1[0];
c2 = (wint_t) s2[0];
if (c1 - c2 != 0)
- return c1 - c2;
+ return c1 > c2 ? 1 : -1;
}
return 0;
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index 55f876898..b7d6bb1af 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,3 +1,8 @@
+2011-10-05 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/alpha/dl-machine.h (elf_machine_rela)
+ (elf_machine_lazy_rel): Add parameter skip_ifunc.
+
2011-03-28 Aurelien Jarno <aurelien@aurel32.net>
* sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S(____longjmp_chk):
@@ -48,7 +53,7 @@
Define without 64-bit aliases.
2010-05-03 Aurelien Jarno <aurelien@aurel32.net>
-
+
* sysdeps/alpha/memchr.S: Use prefetch load.
* sysdeps/alpha/alphaev6/memchr.S: Likewise.
diff --git a/ports/ChangeLog.am33 b/ports/ChangeLog.am33
index e9b19bd3c..ccffef38f 100644
--- a/ports/ChangeLog.am33
+++ b/ports/ChangeLog.am33
@@ -1,3 +1,8 @@
+2011-10-05 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/am33/dl-machine.h (elf_machine_rela)
+ (elf_machine_lazy_rel): Add parameter skip_ifunc.
+
2007-10-22 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/unix/sysv/linux/am33/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 569b98f8a..ba319b832 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,26 @@
+2011-10-05 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/arm/dl-machine.h (elf_machine_rel, elf_machine_rela)
+ (elf_machine_lazy_rel): Add parameter skip_ifunc, don't call ifunc
+ function if non-zero.
+
+2011-09-13 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/elf/configure.in: Always test for TLS support and
+ error out in case it is missing.
+ * sysdeps/arm/elf/configure: Regenerate.
+ * sysdeps/arm/nptl/tls.h,
+ sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S: Remove tests for
+ HAVE_TLS_SUPPORT.
+
+2011-09-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/dl-machine.h, sysdeps/arm/dl-tlsdesc.S,
+ sysdeps/arm/libc-tls.c, sysdeps/arm/nptl/tls.h,
+ sysdeps/arm/tlsdesc.c, sysdeps/arm/tlsdesc.sym,
+ sysdeps/unix/arm/sysdep.S: Remove !USE_THREAD and !USE_TLS cases.
+ Don't define USE_TLS.
+
2011-08-18 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
* sysdeps/unix/sysv/linux/arm/eabi/Makefile: Add libc-do-syscall
@@ -353,7 +376,7 @@
file.
2009-10-22 Andrew Stubbs <ams@codesourcery.com>
- Julian Brown <julian@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
* sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Replace deprecated
instruction fstmiax with vstmia.
@@ -398,9 +421,9 @@
(setup_aeabi_stdio): New function. Add it to .preinit_array.
2009-06-24 Maxim Kuvyrkov <maxim@codesourcery.com>
- Mark Mitchell <mark@codesourcery.com>
- Joseph Myers <joseph@codesourcery.com>
- Kazu Hirata <kazu@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+ Kazu Hirata <kazu@codesourcery.com>
* sysdeps/arm/eabi/backtrace.c: New.
* sysdeps/arm/eabi/Makefile (CFLAGS-backtrace.c): Add
@@ -461,17 +484,17 @@
2009-02-13 Khem Raj <raj.khem@gmail.com>
- * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+ * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
(libgcc_s_handle): New variable.
(pthread_cancel_init): Depend in libgcc_s_handle for decision to
load DSO. Assign last.
(__unwind_freeres): New function.
- * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c:
+ * sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c:
Likewise.
2009-02-05 Paul Brook <paul@codesourcery.com>
- Joseph Myers <joseph@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
* sysdeps/arm/dl-machine.h (elf_machine_dynamic): Ditto.
(elf_machine_load_address): Clear T bit of PLT entry contents.
@@ -877,7 +900,7 @@
2006-06-08 Mark Shinwell <shinwell@codesourcery.com>
- * sysdeps/arm/nptl/pthreaddef.h (CURRENT_STACK_FRAME): Add -12.
+ * sysdeps/arm/nptl/pthreaddef.h (CURRENT_STACK_FRAME): Add -12.
2006-06-08 Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/ports/ChangeLog.cris b/ports/ChangeLog.cris
index 810b53b32..da1ad973f 100644
--- a/ports/ChangeLog.cris
+++ b/ports/ChangeLog.cris
@@ -1,3 +1,8 @@
+2011-10-05 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/cris/dl-machine.h (elf_machine_rela)
+ (elf_machine_lazy_rel): Add parameter skip_ifunc.
+
2007-10-22 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/unix/sysv/linux/cris/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.
diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa
index 2ccc91143..be3a951a8 100644
--- a/ports/ChangeLog.hppa
+++ b/ports/ChangeLog.hppa
@@ -1,7 +1,94 @@
+2011-10-21 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/unix/sysv/linux/hppa/sys/procfs.h: Update copyright year.
+ Do not include signal.h and sys/ucontext.h.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Update copyright
+ year.
+ (PSEUDO): Define __*_nocancel version. Add CFI directives to __*_nocancel
+ and normal version.
+ (PUSHARGS_1): Add CFI directive.
+ (PUSHARGS_2): Likewise.
+ (PUSHARGS_3): Likewise.
+ (PUSHARGS_4): Likewise.
+ (PUSHARGS_5): Likewise.
+ (PUSHARGS_6): Likewise.
+ (POPARGS_1): Likewise.
+ (POPARGS_2): Likewise.
+ (POPARGS_3): Likewise.
+ (POPARGS_4): Likewise.
+ (POPARGS_5): Likewise.
+ (POPARGS_6): Likewise.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c: Remove.
+ * sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h: Remove.
+ * sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h: Remove.
+ * sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h: Remove.
+ * sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c: Remove.
+ * sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h: Remove.
+ * sysdeps/hppa/linuxthreads/pspinlock.c: Remove.
+ * sysdeps/hppa/linuxthreads/pt-machine.h: Remove.
+ * sysdeps/hppa/linuxthreads/tls.h: Remove.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/hppa/stackinfo.h: Update copyright year.
+ Include elf.h and define DEFAULT_STACK_PERMS.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h: Synchronize
+ with canonical fcntl.h.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/hppa/fpu/fegetenv.c: Add hidden alias.
+ * sysdeps/hppa/fpu/feupdateenv.c: Likewise.
+ * sysdeps/hppa/fpu/ftestexcept.c: Likewise.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/hppa/dl-tls.h: Update copyright year.
+ Define TLS_DTV_UNALLOCATED.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/hppa/elf/configure.in: Always test for TLS support
+ and error out if missing.
+ * sysdeps/hppa/elf/configure: Regenerate.
+ * sysdeps/hppa/configure: Regenerate.
+
+2011-10-20 Carlos O'Donell <carlos@systemhalted.org>
+
+ * sysdeps/hppa/nptl/tls.h: Update copyright year.
+ Remove HAVE_TLS_SUPPORT check.
+
+2011-10-17 Guy Martin <gmsoft@tuxicoman.be>
+
+ * sysdeps/unix/sysv/linux/hppa/sys/epoll.h
+ Fix EPOLL_CLOEXEC and EPOLL_NONBLOCK to match kernel definition.
+ * sysdeps/unix/sysv/linux/hppa/sys/eventfd.h
+ Fix EFD_CLOEXEC and EFD_NONBLOCK to match kernel definition.
+ * sysdeps/unix/sysv/linux/hppa/sys/inotify.h
+ Fix IN_CLOEXEC and IN_NONBLOCK to match kernel definition.
+ * sysdeps/unix/sysv/linux/hppa/sys/signalfd.h
+ Fix SFD_CLOEXEC and SFD_NONBLOCK to match kernel definition.
+ * sysdeps/unix/sysv/linux/hppa/sys/timerfd.h
+ Fix TFD_CLOEXEC and TFD_NONBLOCK to match kernel definition.
+
+2011-10-05 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/hppa/dl-machine.h (elf_machine_rela)
+ (elf_machine_lazy_rel): Add parameter skip_ifunc.
+
2010-06-24 Carlos O'Donell <carlos@codesourcery.com>
- * sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S: Only create stack
- frame around call to SYSCALL_ERROR_HANDLER. Do not restore %rp
+ * sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S: Only create stack
+ frame around call to SYSCALL_ERROR_HANDLER. Do not restore %rp
from the stack frame on successfull return.
2010-06-23 Carlos O'Donell <carlos@codesourcery.com>
@@ -10,12 +97,12 @@
Document that this function is a non-standard calling ABI.
Document register usage.
(__getcontext): Use normal %sp without adjustment. Use named
- resgister %sp.
+ resgister %sp.
* sysdeps/unix/sysv/linux/hppa/makecontext.c: Remove FRAME_SIZE.
Define FRAME_SIZE_UL, FRAME_SIZE_BYTES, ARGS.
- (__makecontext): Create and setup a stack frame.
+ (__makecontext): Create and setup a stack frame.
* sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext):
- Use named register %sp. Do not use oSS_SP.
+ Use named register %sp. Do not use oSS_SP.
2010-06-07 Andreas Schwab <schwab@redhat.com>
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
index 8c85d5c81..d7e03efd2 100644
--- a/ports/ChangeLog.m68k
+++ b/ports/ChangeLog.m68k
@@ -1,3 +1,82 @@
+2011-10-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/coldfire/fpu/e_sqrt.c: Add __sqrt_finite alias.
+ * sysdeps/m68k/coldfire/fpu/e_sqrtf.c: Add __sqrtf_finite alias.
+
+ * sysdeps/m68k/m680x0/fpu/e_exp.c (FUNC_FINITE): Define.
+ * sysdeps/m68k/m680x0/fpu/e_expf.c (FUNC_FINITE): Define.
+ * sysdeps/m68k/m680x0/fpu/e_expl.c (FUNC_FINITE): Define.
+
+2011-10-22 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/s_ccos.c: Remove.
+ * sysdeps/m68k/m680x0/fpu/s_ccosf.c: Remove.
+ * sysdeps/m68k/m680x0/fpu/s_ccosl.c: Remove.
+
+2011-10-13 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/fpu/e_acos.c: Add __*_finite alias.
+ * sysdeps/m68k/m680x0/fpu/e_acosf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_acosl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_asin.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_asinl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_asinf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_atan2.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_atanh.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_atanhf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_atanhl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_cosh.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_coshf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_coshl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_exp10.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_exp10f.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_exp10l.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_exp2.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_exp2l.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_exp2f.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_fmod.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_fmodf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_fmodl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_log.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_logl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_logf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_log10.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_log10f.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_log10l.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_log2.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_log2f.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_log2l.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_pow.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_remainder.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_remainderl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_remainderf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_scalb.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_sinh.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_sinhf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_sinhl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_sqrt.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_sqrtf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/e_sqrtl.c: Likewise.
+
+2011-10-09 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/m680x0/s_isinfl.c: Remove.
+ * sysdeps/m68k/m680x0/s_isnanl.c: Remove.
+
+2011-10-05 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/m68k/dl-machine.h (elf_machine_rela)
+ (elf_machine_lazy_rel): Add parameter skip_ifunc.
+
+2011-09-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * sysdeps/m68k/nptl/tls.h: Don't define USE_TLS.
+ * sysdeps/m68k/dl-machine.h: Remove use of USE_TLS.
+ * sysdeps/m68k/libc-tls.c: Likewise.
+
+ * sysdeps/unix/sysv/linux/m68k/sysdep.h: Remove use of
+ USE___THREAD.
+
2011-06-23 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/m68k/dl-trampoline.S (_dl_runtime_profile)
diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips
index 75f87fe41..78932d7a0 100644
--- a/ports/ChangeLog.mips
+++ b/ports/ChangeLog.mips
@@ -1,3 +1,31 @@
+2011-10-12 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/fpu/e_sqrt.c: Add __sqrt_finite alias.
+ * sysdeps/mips/fpu/e_sqrtf.c: Add __sqrtf_finite alias.
+ * sysdeps/mips/mips64/soft-fp/e_sqrtl.c: Add __sqrtl_finite alias.
+
+2011-10-05 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/mips/dl-machine.h (elf_machine_rel, elf_machine_rela)
+ (elf_machine_lazy_rel): Add parameter skip_ifunc.
+
+2011-09-13 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/socket.h (__cmsg_nxthdr): Cast
+ return value to (struct cmsghdr *).
+
+2011-09-13 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/elf/configure.in: Always test for TLS support and
+ error out in case it is missing.
+ * sysdeps/mips/elf/configure: Regenerate.
+ * sysdeps/mips/nptl/tls.h: Remove test for HAVE_TLS_SUPPORT.
+
+2011-09-11 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/mips/dl-machine.h, sysdeps/mips/libc-tls.c,
+ sysdeps/mips/nptl/tls.h: Don't define or use USE_TLS.
+
2011-09-06 Joseph Myers <joseph@codesourcery.com>
[BZ #13109]
@@ -372,7 +400,7 @@
Update comment.
* sysdeps/unix/sysv/linux/mips/kernel_rt_sigframe.h: New file.
* sysdeps/unix/sysv/linux/mips/ucontext_i.sym: New file.
- * sysdeps/unix/sysv/linux/mips/Makefile (gen-as-const-headers):
+ * sysdeps/unix/sysv/linux/mips/Makefile (gen-as-const-headers):
Add ucontext_i.sym.
2009-04-18 Joseph Myers <joseph@codesourcery.com>
@@ -577,7 +605,7 @@
2008-04-02 Aurelien Jarno <aurelien@aurel32.net>
- * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Add
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Add
truncate and ftruncate systems calls.
* sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c: Make an
empty file.
@@ -963,7 +991,7 @@
(lll_robust_mutex_dead, lll_robust_mutex_trylock, lll_robust_mutex_lock,
lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
lll_robust_mutex_unlock): New macros.
- (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
+ (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
* sysdeps/unix/sysv/linux/mips/nptl/pt-vfork.S: Use correct path to
vfork.S.
* sysdeps/unix/sysv/linux/mips/nptl/vfork.S: Likewise.
diff --git a/ports/sysdeps/alpha/dl-machine.h b/ports/sysdeps/alpha/dl-machine.h
index e4a502208..2790ae570 100644
--- a/ports/sysdeps/alpha/dl-machine.h
+++ b/ports/sysdeps/alpha/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. Alpha version.
- Copyright (C) 1996-2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1996-2005, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@tamu.edu>.
@@ -371,7 +371,8 @@ elf_machine_rela (struct link_map *map,
const Elf64_Rela *reloc,
const Elf64_Sym *sym,
const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info);
@@ -514,7 +515,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr * const reloc_addr = (void *)(l_addr + reloc->r_offset);
unsigned long int const r_type = ELF64_R_TYPE (reloc->r_info);
diff --git a/ports/sysdeps/am33/dl-machine.h b/ports/sysdeps/am33/dl-machine.h
index 808fd9cc8..ffd866ac1 100644
--- a/ports/sysdeps/am33/dl-machine.h
+++ b/ports/sysdeps/am33/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. AM33 version.
- Copyright (C) 1995,96,97,98,99,2000,2001, 2004
+ Copyright (C) 1995,96,97,98,99,2000,2001, 2004, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -296,7 +296,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
static inline void
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
Elf32_Addr value, *reloc_addr;
@@ -457,7 +457,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
static inline void
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
unsigned long int const r_type = ELF32_R_TYPE (reloc->r_info);
diff --git a/ports/sysdeps/arm/dl-machine.h b/ports/sysdeps/arm/dl-machine.h
index b5d477be6..5a5896560 100644
--- a/ports/sysdeps/arm/dl-machine.h
+++ b/ports/sysdeps/arm/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions. ARM version.
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,
- 2006, 2009, 2010 Free Software Foundation, Inc.
+ 2006, 2009, 2010, 2011 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
@@ -242,18 +242,12 @@ _dl_start_user:\n\
define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
-#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
-# define elf_machine_type_class(type) \
+#define elf_machine_type_class(type) \
((((type) == R_ARM_JUMP_SLOT || (type) == R_ARM_TLS_DTPMOD32 \
|| (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32 \
|| (type) == R_ARM_TLS_DESC) \
* ELF_RTYPE_CLASS_PLT) \
| (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY))
-#else
-#define elf_machine_type_class(type) \
- ((((type) == R_ARM_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY))
-#endif
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_ARM_JUMP_SLOT
@@ -341,7 +335,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -375,9 +369,9 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
if (sym != NULL
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (r_type)
@@ -436,7 +430,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
}
case R_ARM_TLS_DESC:
{
- struct tlsdesc volatile *td =
+ struct tlsdesc volatile *td =
(struct tlsdesc volatile *)reloc_addr;
# ifndef RTLD_BOOTSTRAP
@@ -460,10 +454,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
else
# endif
# endif
- {
+ {
td->argument.value = value + sym_map->l_tls_offset;
td->entry = _dl_tlsdesc_return;
- }
+ }
}
}
break;
@@ -494,7 +488,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
}
break;
#if !defined RTLD_BOOTSTRAP
-#if defined USE_TLS
case R_ARM_TLS_DTPMOD32:
/* Get the information from the link map returned by the
resolv function. */
@@ -514,7 +507,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
*reloc_addr += sym->st_value + sym_map->l_tls_offset;
}
break;
-#endif
case R_ARM_IRELATIVE:
value = map->l_addr + *reloc_addr;
value = ((Elf32_Addr (*) (void)) value) ();
@@ -533,7 +525,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -551,9 +543,9 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
if (sym != NULL
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (r_type)
@@ -608,7 +600,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
}
break;
#if !defined RTLD_BOOTSTRAP
-#if defined USE_TLS
case R_ARM_TLS_DTPMOD32:
/* Get the information from the link map returned by the
resolv function. */
@@ -628,7 +619,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
+ reloc->r_addend);
}
break;
-#endif
case R_ARM_IRELATIVE:
value = map->l_addr + *reloc_addr;
value = ((Elf32_Addr (*) (void)) value) ();
@@ -666,7 +656,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rel *reloc)
+ Elf32_Addr l_addr, const Elf32_Rel *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -678,20 +669,18 @@ elf_machine_lazy_rel (struct link_map *map,
else
*reloc_addr = map->l_mach.plt;
}
-#ifdef USE_TLS
else if (__builtin_expect (r_type == R_ARM_TLS_DESC, 1))
{
struct tlsdesc volatile *td =
(struct tlsdesc volatile *)reloc_addr;
/* The linker must have given us the parameter we need in the
- first GOT entry, and left the second one empty. We fill the
- last with the resolver address */
+ first GOT entry, and left the second one empty. We fill the
+ last with the resolver address */
assert (td->entry == 0);
td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
+ map->l_addr);
}
-#endif
else
_dl_reloc_bad_type (map, r_type, 1);
}
diff --git a/ports/sysdeps/arm/dl-tlsdesc.S b/ports/sysdeps/arm/dl-tlsdesc.S
index 19e4ed3d0..c192fc978 100644
--- a/ports/sysdeps/arm/dl-tlsdesc.S
+++ b/ports/sysdeps/arm/dl-tlsdesc.S
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. ARM version.
- Copyright (C) 2006, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010, 2011 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
@@ -31,7 +31,6 @@
@ emit debug information with cfi
@ use arm-specific pseudos for unwinding itself
.cfi_sections .debug_frame
-#ifdef USE_TLS
.hidden _dl_tlsdesc_return
.global _dl_tlsdesc_return
.type _dl_tlsdesc_return,#function
@@ -218,5 +217,3 @@ _dl_tlsdesc_resolve_hold:
.fnend
cfi_endproc
.size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold
-
-#endif /* USE_TLS */
diff --git a/ports/sysdeps/arm/elf/configure b/ports/sysdeps/arm/elf/configure
index 150de0c61..32018cb1a 100644
--- a/ports/sysdeps/arm/elf/configure
+++ b/ports/sysdeps/arm/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/arm/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for ARM TLS support" >&5
@@ -34,12 +33,10 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_arm_tls" >&5
$as_echo "$libc_cv_arm_tls" >&6; }
-if test $libc_cv_arm_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_arm_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
#AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/ports/sysdeps/arm/elf/configure.in b/ports/sysdeps/arm/elf/configure.in
index 104529677..123a32186 100644
--- a/ports/sysdeps/arm/elf/configure.in
+++ b/ports/sysdeps/arm/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/arm/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for ARM TLS support, libc_cv_arm_tls, [dnl
@@ -23,9 +22,8 @@ else
libc_cv_arm_tls=no
fi
rm -f conftest*])
-if test $libc_cv_arm_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_arm_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl It is always possible to access static and hidden symbols in an
diff --git a/ports/sysdeps/arm/libc-tls.c b/ports/sysdeps/arm/libc-tls.c
index affb1899e..a6271bb3b 100644
--- a/ports/sysdeps/arm/libc-tls.c
+++ b/ports/sysdeps/arm/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. ARM version.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2011 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
@@ -20,8 +20,6 @@
#include <csu/libc-tls.c>
#include <dl-tls.h>
-#if USE_TLS
-
/* On ARM, linker optimizations are not required, so __tls_get_addr
can be called even in statically linked binaries. In this case module
must be always 1 and PT_TLS segment exist in the binary, otherwise it
@@ -33,5 +31,3 @@ __tls_get_addr (tls_index *ti)
dtv_t *dtv = THREAD_DTV ();
return (char *) dtv[1].pointer.val + ti->ti_offset;
}
-
-#endif
diff --git a/ports/sysdeps/arm/nptl/tls.h b/ports/sysdeps/arm/nptl/tls.h
index f257b93fe..16c970643 100644
--- a/ports/sysdeps/arm/nptl/tls.h
+++ b/ports/sysdeps/arm/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/ARM version.
- Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2011 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
@@ -43,14 +43,6 @@ typedef union dtv
#endif /* __ASSEMBLER__ */
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
-/* Signal that TLS support is available. */
-# define USE_TLS 1
-
#ifndef __ASSEMBLER__
/* Get system call information. */
diff --git a/ports/sysdeps/arm/tlsdesc.c b/ports/sysdeps/arm/tlsdesc.c
index e0b970f00..811d66b83 100644
--- a/ports/sysdeps/arm/tlsdesc.c
+++ b/ports/sysdeps/arm/tlsdesc.c
@@ -1,5 +1,5 @@
/* Manage TLS descriptors. ARM version.
- Copyright (C) 2005, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2010, 2011 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
@@ -24,8 +24,6 @@
#include <dl-tlsdesc.h>
#include <tlsdeschtab.h>
-#ifdef USE_TLS
-
/* This function is used to lazily resolve TLS_DESC REL relocations
Besides the TLS descriptor itself, we get the module's got address
as the second parameter. */
@@ -161,4 +159,3 @@ _dl_unmap (struct link_map *map)
htab_delete (map->l_mach.tlsdesc_table);
#endif
}
-#endif
diff --git a/ports/sysdeps/arm/tlsdesc.sym b/ports/sysdeps/arm/tlsdesc.sym
index a1deb2117..3f3a13e2c 100644
--- a/ports/sysdeps/arm/tlsdesc.sym
+++ b/ports/sysdeps/arm/tlsdesc.sym
@@ -7,13 +7,9 @@
--
-- Abuse tls.h macros to derive offsets relative to the thread register.
-#if defined USE_TLS
-
TLSDESC_ARG offsetof(struct tlsdesc, argument.pointer)
TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count)
TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
-
-#endif
diff --git a/ports/sysdeps/cris/dl-machine.h b/ports/sysdeps/cris/dl-machine.h
index 368733e73..cc3701e59 100644
--- a/ports/sysdeps/cris/dl-machine.h
+++ b/ports/sysdeps/cris/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. CRIS version.
- Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1996-2001, 2002, 2003, 2011 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
@@ -285,7 +285,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
static inline void
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -378,7 +378,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
static inline void
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
diff --git a/ports/sysdeps/hppa/dl-machine.h b/ports/sysdeps/hppa/dl-machine.h
index e462fd335..72dba8f20 100644
--- a/ports/sysdeps/hppa/dl-machine.h
+++ b/ports/sysdeps/hppa/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version.
- Copyright (C) 1995-1997,1999-2003
+ Copyright (C) 1995-1997,1999-2003,2011
Free Software Foundation, Inc.
Contributed by David Huggins-Daines <dhd@debian.org>
This file is part of the GNU C Library.
@@ -33,19 +33,19 @@
#include <abort-instr.h>
#include <tls.h>
-/* These two definitions must match the definition of the stub in
+/* These two definitions must match the definition of the stub in
bfd/elf32-hppa.c (see plt_stub[]).
-
+
a. Define the size of the *entire* stub we place at the end of the PLT
table (right up against the GOT).
-
+
b. Define the number of bytes back from the GOT to the entry point of
the PLT stub. You see the PLT stub must be entered in the middle
- so it can depwi to find it's own address (long jump stub)
-
+ so it can depwi to find it's own address (long jump stub)
+
c. Define the size of a single PLT entry so we can jump over the
last entry to get the stub address */
-
+
#define SIZEOF_PLT_STUB (7*4)
#define GOT_FROM_PLT_STUB (4*4)
#define PLT_ENTRY_SIZE (2*4)
@@ -110,8 +110,8 @@ elf_machine_load_address (void)
return dynamic - elf_machine_dynamic ();
}
-/* Fixup a PLT entry to bounce directly to the function at VALUE. */
-static inline struct fdesc __attribute__ ((always_inline))
+/* Fixup a PLT entry to bounce directly to the function at VALUE. */
+static inline struct fdesc __attribute__ ((always_inline))
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, struct fdesc value)
@@ -127,7 +127,7 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t t,
}
/* Return the final value of a plt relocation. */
-static inline struct fdesc
+static inline struct fdesc
elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
struct fdesc value)
{
@@ -149,106 +149,106 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
unsigned char c[8];
Elf32_Addr i[2];
} sig = {{0x00,0xc0,0xff,0xee, 0xde,0xad,0xbe,0xef}};
-
+
/* If we don't have a PLT we can just skip all this... */
if (__builtin_expect (l->l_info[DT_JMPREL] == NULL,0))
return lazy;
-
- /* All paths use these values */
+
+ /* All paths use these values */
l_addr = l->l_addr;
jmprel = D_PTR(l, l_info[DT_JMPREL]);
end_jmprel = jmprel + l->l_info[DT_PLTRELSZ]->d_un.d_val;
-
+
extern void _dl_runtime_resolve (void);
extern void _dl_runtime_profile (void);
-
+
/* Linking lazily */
if (lazy)
{
/* FIXME: Search for the got, but backwards through the relocs, technically we should
- find it on the first try. However, assuming the relocs got out of order the
- routine is made a bit more robust by searching them all in case of failure. */
+ find it on the first try. However, assuming the relocs got out of order the
+ routine is made a bit more robust by searching them all in case of failure. */
for (iplt = (end_jmprel - sizeof(Elf32_Rela)); iplt >= jmprel; iplt -= sizeof (Elf32_Rela))
- {
-
+ {
+
reloc = (const Elf32_Rela *) iplt;
- r_type = ELF32_R_TYPE (reloc->r_info);
- r_sym = ELF32_R_SYM (reloc->r_info);
+ r_type = ELF32_R_TYPE (reloc->r_info);
+ r_sym = ELF32_R_SYM (reloc->r_info);
- got = (Elf32_Addr *) (reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB);
+ got = (Elf32_Addr *) (reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB);
- /* If we aren't an IPLT, and we aren't NONE then it's a bad reloc */
- if (__builtin_expect (r_type != R_PARISC_IPLT, 0))
+ /* If we aren't an IPLT, and we aren't NONE then it's a bad reloc */
+ if (__builtin_expect (r_type != R_PARISC_IPLT, 0))
{
if (__builtin_expect (r_type != R_PARISC_NONE, 0))
- _dl_reloc_bad_type (l, r_type, 1);
+ _dl_reloc_bad_type (l, r_type, 1);
continue;
}
-
- /* Check for the plt_stub that binutils placed here for us
- to use with _dl_runtime_resolve */
- if (got[-2] != sig.i[0] || got[-1] != sig.i[1])
- {
- got = NULL; /* Not the stub... keep looking */
- }
- else
+
+ /* Check for the plt_stub that binutils placed here for us
+ to use with _dl_runtime_resolve */
+ if (got[-2] != sig.i[0] || got[-1] != sig.i[1])
+ {
+ got = NULL; /* Not the stub... keep looking */
+ }
+ else
{
- /* Found the GOT! */
- register Elf32_Addr ltp __asm__ ("%r19");
-
- /* Identify this shared object. Second entry in the got. */
- got[1] = (Elf32_Addr) l;
-
- /* This function will be called to perform the relocation. */
- if (__builtin_expect (!profile, 1))
- {
- /* If a static application called us, then _dl_runtime_resolve is not
+ /* Found the GOT! */
+ register Elf32_Addr ltp __asm__ ("%r19");
+
+ /* Identify this shared object. Second entry in the got. */
+ got[1] = (Elf32_Addr) l;
+
+ /* This function will be called to perform the relocation. */
+ if (__builtin_expect (!profile, 1))
+ {
+ /* If a static application called us, then _dl_runtime_resolve is not
a function descriptor, but the *real* address of the function... */
if((unsigned long) &_dl_runtime_resolve & 3)
{
- got[-2] = (Elf32_Addr) ((struct fdesc *)
- ((unsigned long) &_dl_runtime_resolve & ~3))->ip;
+ got[-2] = (Elf32_Addr) ((struct fdesc *)
+ ((unsigned long) &_dl_runtime_resolve & ~3))->ip;
}
else
{
/* Static executable! */
- got[-2] = (Elf32_Addr) &_dl_runtime_resolve;
+ got[-2] = (Elf32_Addr) &_dl_runtime_resolve;
}
- }
- else
- {
- if (GLRO(dl_profile) != NULL
+ }
+ else
+ {
+ if (GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), l))
- {
+ {
/* This is the object we are looking for. Say that
- we really want profiling and the timers are
- started. */
- GL(dl_profile_map) = l;
- }
+ we really want profiling and the timers are
+ started. */
+ GL(dl_profile_map) = l;
+ }
if((unsigned long) &_dl_runtime_profile & 3)
{
- got[-2] = (Elf32_Addr) ((struct fdesc *)
- ((unsigned long) &_dl_runtime_profile & ~3))->ip;
+ got[-2] = (Elf32_Addr) ((struct fdesc *)
+ ((unsigned long) &_dl_runtime_profile & ~3))->ip;
}
else
{
/* Static executable */
- got[-2] = (Elf32_Addr) &_dl_runtime_profile;
+ got[-2] = (Elf32_Addr) &_dl_runtime_profile;
}
- }
- /* Plunk in the gp of this function descriptor so we
- can make the call to _dl_runtime_xxxxxx */
- got[-1] = ltp;
- break;
- /* Done looking for the GOT, and stub is setup */
- } /* else we found the GOT */
- } /* for, walk the relocs backwards */
-
- if(!got)
- return 0; /* No lazy linking for you! */
-
- /* Process all the relocs, now that we know the GOT... */
+ }
+ /* Plunk in the gp of this function descriptor so we
+ can make the call to _dl_runtime_xxxxxx */
+ got[-1] = ltp;
+ break;
+ /* Done looking for the GOT, and stub is setup */
+ } /* else we found the GOT */
+ } /* for, walk the relocs backwards */
+
+ if(!got)
+ return 0; /* No lazy linking for you! */
+
+ /* Process all the relocs, now that we know the GOT... */
for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela))
{
reloc = (const Elf32_Rela *) iplt;
@@ -276,25 +276,25 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
fptr->gp = D_PTR (l, l_info[DT_PLTGOT]);
}
} /* r_type == R_PARISC_IPLT */
- } /* for all the relocations */
+ } /* for all the relocations */
} /* if lazy */
else
{
for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela))
- {
- reloc = (const Elf32_Rela *) iplt;
- r_type = ELF32_R_TYPE (reloc->r_info);
- r_sym = ELF32_R_SYM (reloc->r_info);
-
- if (__builtin_expect ((r_type == R_PARISC_IPLT) && (r_sym == 0), 1))
- {
- fptr = (struct fdesc *) (reloc->r_offset + l_addr);
- /* Relocate this *ABS* entry, set only the gp, the rest is set later
- when elf_machine_rela_relative is called (WITHOUT the linkmap) */
- fptr->gp = D_PTR (l, l_info[DT_PLTGOT]);
- } /* r_type == R_PARISC_IPLT */
- } /* for all the relocations */
- }
+ {
+ reloc = (const Elf32_Rela *) iplt;
+ r_type = ELF32_R_TYPE (reloc->r_info);
+ r_sym = ELF32_R_SYM (reloc->r_info);
+
+ if (__builtin_expect ((r_type == R_PARISC_IPLT) && (r_sym == 0), 1))
+ {
+ fptr = (struct fdesc *) (reloc->r_offset + l_addr);
+ /* Relocate this *ABS* entry, set only the gp, the rest is set later
+ when elf_machine_rela_relative is called (WITHOUT the linkmap) */
+ fptr->gp = D_PTR (l, l_info[DT_PLTGOT]);
+ } /* r_type == R_PARISC_IPLT */
+ } /* for all the relocations */
+ }
return lazy;
}
@@ -441,7 +441,7 @@ asm ( \
" ldw -44(%sp),%r24\n" \
\
/* _dl_fini is a local function in the loader, so we construct \
- a false OPD here and pass this to the application. */ \
+ a false OPD here and pass this to the application. */ \
/* FIXME: Should be able to use P%, and LR RR to have the \
the linker construct a proper OPD. */ \
" .section .data\n" \
@@ -462,7 +462,7 @@ asm ( \
" depi 2,31,2,%r23\n" /* delay slot */ \
);
-/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
+/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
a TLS variable, so references should not be allowed to define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
@@ -505,7 +505,7 @@ dl_platform_init (void)
/* Avoid an empty string which would disturb us. */
GLRO(dl_platform) = NULL;
}
-
+
#endif /* !dl_machine_h */
/* These are only actually used where RESOLVE_MAP is defined, anyway. */
@@ -523,11 +523,12 @@ dl_platform_init (void)
| (((as14) & 0x2000) >> 13))
auto void __attribute__((always_inline))
-elf_machine_rela (struct link_map *map,
+elf_machine_rela (struct link_map *map,
const Elf32_Rela *reloc,
- const Elf32_Sym *sym,
+ const Elf32_Sym *sym,
const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const Elf32_Sym *const refsym = sym;
@@ -557,7 +558,7 @@ elf_machine_rela (struct link_map *map,
# else
sym_map = RESOLVE_MAP (&sym, version, r_type);
# endif
-
+
if (sym_map)
{
value = sym ? sym_map->l_addr + sym->st_value : 0;
@@ -584,7 +585,7 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_DIR21L:
{
unsigned int insn = *(unsigned int *)reloc_addr;
- value = sym_map->l_addr + sym->st_value
+ value = sym_map->l_addr + sym->st_value
+ ((reloc->r_addend + 0x1000) & -0x2000);
value = value >> 11;
insn = (insn &~ 0x1fffff) | reassemble_21 (value);
@@ -595,7 +596,7 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_DIR14R:
{
unsigned int insn = *(unsigned int *)reloc_addr;
- value = ((sym_map->l_addr + sym->st_value) & 0x7ff)
+ value = ((sym_map->l_addr + sym->st_value) & 0x7ff)
+ (((reloc->r_addend & 0x1fff) ^ 0x1000) - 0x1000);
insn = (insn &~ 0x3fff) | reassemble_14 (value);
*(unsigned int *)reloc_addr = insn;
@@ -604,17 +605,17 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_PLABEL32:
/* Easy rule: If there is a symbol and it is global, then we
- need to make a dynamic function descriptor. Otherwise we
- have the address of a PLT slot for a local symbol which we
- know to be unique. */
+ need to make a dynamic function descriptor. Otherwise we
+ have the address of a PLT slot for a local symbol which we
+ know to be unique. */
if (sym == NULL
|| sym_map == NULL
|| ELF32_ST_BIND (sym->st_info) == STB_LOCAL)
- {
+ {
break;
- }
+ }
/* Set bit 30 to indicate to $$dyncall that this is a PLABEL.
- We have to do this outside of the generic function descriptor
+ We have to do this outside of the generic function descriptor
code, since it doesn't know about our requirement for setting
protection bits */
value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2);
@@ -625,17 +626,17 @@ elf_machine_rela (struct link_map *map,
{
unsigned int insn = *(unsigned int *)reloc_addr;
- if (__builtin_expect (sym == NULL, 0))
- break;
+ if (__builtin_expect (sym == NULL, 0))
+ break;
- value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2);
+ value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2);
- if (r_type == R_PARISC_PLABEL21L)
+ if (r_type == R_PARISC_PLABEL21L)
{
value >>= 11;
insn = (insn &~ 0x1fffff) | reassemble_21 (value);
}
- else
+ else
{
value &= 0x7ff;
insn = (insn &~ 0x3fff) | reassemble_14 (value);
@@ -647,16 +648,16 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_IPLT:
if (__builtin_expect (sym_map != NULL, 1))
- {
- elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr,
+ {
+ elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr,
DL_FIXUP_MAKE_VALUE(sym_map, value));
- }
- else
- {
+ }
+ else
+ {
/* If we get here, it's a (weak) undefined sym. */
- elf_machine_fixup_plt (NULL, map, reloc, reloc_addr,
+ elf_machine_fixup_plt (NULL, map, reloc, reloc_addr,
DL_FIXUP_MAKE_VALUE(map, value));
- }
+ }
return;
case R_PARISC_COPY:
@@ -687,21 +688,21 @@ elf_machine_rela (struct link_map *map,
case R_PARISC_TLS_DTPOFF32:
/* During relocation all TLS symbols are defined and used.
- Therefore the offset is already correct. */
+ Therefore the offset is already correct. */
if (sym != NULL)
- *reloc_addr = sym->st_value;
+ *reloc_addr = sym->st_value;
return;
case R_PARISC_TLS_TPREL32:
/* The offset is negative, forward from the thread pointer */
if (sym != NULL)
- {
- CHECK_STATIC_TLS (map, sym_map);
+ {
+ CHECK_STATIC_TLS (map, sym_map);
value = sym_map->l_tls_offset + sym->st_value + reloc->r_addend;
}
break;
#endif /* use TLS */
-
+
case R_PARISC_NONE: /* Alright, Wilbur. */
return;
@@ -721,13 +722,13 @@ elf_machine_rela_relative (Elf32_Addr l_addr,
{
unsigned long const r_type = ELF32_R_TYPE (reloc->r_info);
Elf32_Addr *const reloc_addr = reloc_addr_arg;
- static char msgbuf[] = { "Unknown" };
+ static char msgbuf[] = { "Unknown" };
struct link_map map;
Elf32_Addr value;
value = l_addr + reloc->r_addend;
- if (ELF32_R_SYM (reloc->r_info) != 0){
+ if (ELF32_R_SYM (reloc->r_info) != 0){
_dl_error_printf ("%s: In elf_machine_rela_relative "
"ELF32_R_SYM (reloc->r_info) != 0. Aborting.",
rtld_progname ?: "<program name unknown>");
@@ -769,7 +770,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr,
auto void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
/* We don't have anything to do here. elf_machine_runtime_setup has
done all the relocs already. */
diff --git a/ports/sysdeps/hppa/dl-tls.h b/ports/sysdeps/hppa/dl-tls.h
index 1bc9aae66..91c3d4473 100644
--- a/ports/sysdeps/hppa/dl-tls.h
+++ b/ports/sysdeps/hppa/dl-tls.h
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. hppa version.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2011 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
@@ -27,3 +27,6 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed. */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/ports/sysdeps/hppa/elf/configure b/ports/sysdeps/hppa/elf/configure
index 0e89b7d39..e0aa9701a 100644
--- a/ports/sysdeps/hppa/elf/configure
+++ b/ports/sysdeps/hppa/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/hppa/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for hppa TLS support" >&5
@@ -54,10 +53,8 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_hppa_tls" >&5
$as_echo "$libc_cv_hppa_tls" >&6; }
-if test $libc_cv_hppa_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_hppa_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
diff --git a/ports/sysdeps/hppa/elf/configure.in b/ports/sysdeps/hppa/elf/configure.in
index 1b70a5b74..e31c880c1 100644
--- a/ports/sysdeps/hppa/elf/configure.in
+++ b/ports/sysdeps/hppa/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/hppa/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for hppa TLS support, libc_cv_hppa_tls, [dnl
@@ -43,7 +42,6 @@ else
libc_cv_hppa_tls=no
fi
rm -f conftest*])
-if test $libc_cv_hppa_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_hppa_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
diff --git a/ports/sysdeps/hppa/fpu/fegetenv.c b/ports/sysdeps/hppa/fpu/fegetenv.c
index fcf5d2dcf..aab3431b2 100644
--- a/ports/sysdeps/hppa/fpu/fegetenv.c
+++ b/ports/sysdeps/hppa/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
@@ -33,3 +33,4 @@ fegetenv (fenv_t *envp)
memcpy(envp, buf, sizeof (*envp));
return 0;
}
+libm_hidden_def (fegetenv)
diff --git a/ports/sysdeps/hppa/fpu/feupdateenv.c b/ports/sysdeps/hppa/fpu/feupdateenv.c
index 17140060a..6e1d5d4b6 100644
--- a/ports/sysdeps/hppa/fpu/feupdateenv.c
+++ b/ports/sysdeps/hppa/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
@@ -38,3 +38,4 @@ feupdateenv (const fenv_t *envp)
/* Success. */
return 0;
}
+libm_hidden_def (feupdateenv)
diff --git a/ports/sysdeps/hppa/fpu/ftestexcept.c b/ports/sysdeps/hppa/fpu/ftestexcept.c
index ac6d4b2e3..c031ffe6e 100644
--- a/ports/sysdeps/hppa/fpu/ftestexcept.c
+++ b/ports/sysdeps/hppa/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
@@ -32,3 +32,4 @@ fetestexcept (int excepts)
return (s.sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
diff --git a/ports/sysdeps/hppa/linuxthreads/pspinlock.c b/ports/sysdeps/hppa/linuxthreads/pspinlock.c
deleted file mode 100644
index e5a554522..000000000
--- a/ports/sysdeps/hppa/linuxthreads/pspinlock.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* POSIX spinlock implementation. hppa version.
- Copyright (C) 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; 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 <pthread.h>
-#include "internals.h"
-
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- volatile unsigned int *addr = __ldcw_align (lock);
-
- while (__ldcw (addr) == 0)
- while (*addr == 0) ;
-
- return 0;
-}
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
-
-
-int
-__pthread_spin_trylock (pthread_spinlock_t *lock)
-{
- volatile unsigned int *a = __ldcw_align (lock);
-
- return __ldcw (a) ? 0 : EBUSY;
-}
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
-
-
-int
-__pthread_spin_unlock (pthread_spinlock_t *lock)
-{
- volatile unsigned int *a = __ldcw_align (lock);
- int tmp = 1;
- /* This should be a memory barrier to newer compilers */
- __asm__ __volatile__ ("stw,ma %1,0(%0)"
- : : "r" (a), "r" (tmp) : "memory");
- return 0;
-}
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
-
-
-int
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
-{
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
- all processes which can access the memory location `lock' points
- to can use the spinlock. */
- volatile unsigned int *a = __ldcw_align (lock);
- int tmp = 1;
- /* This should be a memory barrier to newer compilers */
- __asm__ __volatile__ ("stw,ma %1,0(%0)"
- : : "r" (a), "r" (tmp) : "memory");
- return 0;
-}
-weak_alias (__pthread_spin_init, pthread_spin_init)
-
-
-int
-__pthread_spin_destroy (pthread_spinlock_t *lock)
-{
- /* Nothing to do. */
- return 0;
-}
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
diff --git a/ports/sysdeps/hppa/linuxthreads/pt-machine.h b/ports/sysdeps/hppa/linuxthreads/pt-machine.h
deleted file mode 100644
index f35523f0f..000000000
--- a/ports/sysdeps/hppa/linuxthreads/pt-machine.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Machine-dependent pthreads configuration and inline functions.
- hppa version.
- Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Richard Henderson <rth@tamu.edu>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _PT_MACHINE_H
-#define _PT_MACHINE_H 1
-
-#include <sys/types.h>
-#include <bits/initspin.h>
-
-#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
-#endif
-
-extern inline long int testandset (__atomic_lock_t *spinlock);
-extern inline int __compare_and_swap (long int *p, long int oldval, long int newval);
-extern inline int lock_held (__atomic_lock_t *spinlock);
-extern inline int __load_and_clear (__atomic_lock_t *spinlock);
-
-/* Get some notion of the current stack. Need not be exactly the top
- of the stack, just something somewhere in the current frame. */
-#define CURRENT_STACK_FRAME stack_pointer
-register char * stack_pointer __asm__ ("%r30");
-
-/* Get/Set thread-specific pointer. We have to call into the kernel to
- * modify it, but we can read it in user mode. */
-#ifndef THREAD_SELF
-#define THREAD_SELF __get_cr27()
-#endif
-
-#ifndef SET_THREAD_SELF
-#define SET_THREAD_SELF(descr) __set_cr27(descr)
-#endif
-/* Use this to determine type */
-struct _pthread_descr_struct *__thread_self;
-
-static inline struct _pthread_descr_struct * __get_cr27(void)
-{
- long cr27;
- asm ("mfctl %%cr27, %0" : "=r" (cr27) : );
- return (struct _pthread_descr_struct *) cr27;
-}
-
-#ifndef INIT_THREAD_SELF
-#define INIT_THREAD_SELF(descr, nr) __set_cr27(descr)
-#endif
-
-static inline void __set_cr27(struct _pthread_descr_struct * cr27)
-{
- asm ( "ble 0xe0(%%sr2, %%r0)\n\t"
- "copy %0, %%r26"
- : : "r" (cr27) : "r26" );
-}
-
-/* We want the OS to assign stack addresses. */
-#define FLOATING_STACKS 1
-#define ARCH_STACK_MAX_SIZE 8*1024*1024
-
-/* The hppa only has one atomic read and modify memory operation,
- load and clear, so hppa spinlocks must use zero to signify that
- someone is holding the lock. The address used for the ldcw
- semaphore must be 16-byte aligned. */
-#define __ldcw(a) \
-({ \
- unsigned int __ret; \
- __asm__ __volatile__("ldcw 0(%1),%0" \
- : "=r" (__ret) : "r" (a) : "memory"); \
- __ret; \
-})
-
-/* Strongly ordered lock reset */
-#define __lock_reset(lock_addr, tmp) \
-({ \
- __asm__ __volatile__ ("stw,ma %1,0(%0)" \
- : : "r" (lock_addr), "r" (tmp) : "memory"); \
-})
-
-/* Because malloc only guarantees 8-byte alignment for malloc'd data,
- and GCC only guarantees 8-byte alignment for stack locals, we can't
- be assured of 16-byte alignment for atomic lock data even if we
- specify "__attribute ((aligned(16)))" in the type declaration. So,
- we use a struct containing an array of four ints for the atomic lock
- type and dynamically select the 16-byte aligned int from the array
- for the semaphore. */
-#define __PA_LDCW_ALIGNMENT 16
-#define __ldcw_align(a) ({ \
- volatile unsigned int __ret = (unsigned int) a; \
- if ((__ret & ~(__PA_LDCW_ALIGNMENT - 1)) < (unsigned int) a) \
- __ret = (__ret & ~(__PA_LDCW_ALIGNMENT - 1)) + __PA_LDCW_ALIGNMENT; \
- (unsigned int *) __ret; \
-})
-
-/* Spinlock implementation; required. */
-PT_EI int
-__load_and_clear (__atomic_lock_t *spinlock)
-{
- volatile unsigned int *a = __ldcw_align (spinlock);
-
- return __ldcw (a);
-}
-
-/* Emulate testandset */
-PT_EI long int
-testandset (__atomic_lock_t *spinlock)
-{
- return (__load_and_clear(spinlock) == 0);
-}
-
-PT_EI int
-lock_held (__atomic_lock_t *spinlock)
-{
- volatile unsigned int *a = __ldcw_align (spinlock);
-
- return *a == 0;
-}
-
-#endif /* pt-machine.h */
diff --git a/ports/sysdeps/hppa/linuxthreads/tls.h b/ports/sysdeps/hppa/linuxthreads/tls.h
deleted file mode 100644
index 3d33a1892..000000000
--- a/ports/sysdeps/hppa/linuxthreads/tls.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Definition for thread-local data handling. linuxthreads/hppa version.
- Copyright (C) 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _TLS_H
-#define _TLS_H
-
-#ifndef __ASSEMBLER__
-# include <pt-machine.h>
-# include <stdbool.h>
-# include <stddef.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
-#else /* __ASSEMBLER__ */
-# include <tcb-offsets.h>
-#endif /* __ASSEMBLER__ */
-
-
-#if defined HAVE_TLS_SUPPORT
-
-/* Signal that TLS support is available. */
-# define USE_TLS 1
-
-# ifndef __ASSEMBLER__
-
-typedef struct
-{
- dtv_t *dtv;
- void *private;
-} tcbhead_t;
-
-/* Include some syscall information for other headers */
-# include <sysdep.h>
-
-/* This is the size of the initial TCB. */
-# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
-
-/* Alignment requirements for the initial TCB. */
-# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t)
-
-/* This is the size of the TCB. */
-# define TLS_TCB_SIZE sizeof (tcbhead_t)
-
-/* This is the size we need before TCB. */
-# define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct)
-
-/* Alignment requirements for the TCB. */
-# define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct)
-
-/* The TLS blocks start right after the TCB. */
-# define TLS_DTV_AT_TP 1
-
-/* Return the thread descriptor for the current thread. */
-# undef THREAD_SELF
-# define THREAD_SELF \
- ({ struct _pthread_descr_struct *__self; \
- __self = __get_cr27(); \
- __self - 1; \
- })
-
-# undef INIT_THREAD_SELF
-# define INIT_THREAD_SELF(descr, nr) \
- ({ struct _pthread_descr_struct *__self = (void *)descr; \
- __set_cr27(__self + 1); \
- 0; \
- })
-
-/* Access to data in the thread descriptor is easy. */
-#define THREAD_GETMEM(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_GETMEM_NC(descr, member) \
- ((void) sizeof (descr), THREAD_SELF->member)
-#define THREAD_SETMEM(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-#define THREAD_SETMEM_NC(descr, member, value) \
- ((void) sizeof (descr), THREAD_SELF->member = (value))
-
-/* Install the dtv pointer. The pointer passed is to the element with
- index -1 which contain the length. */
-# define INSTALL_DTV(tcbp, dtvp) \
- ((tcbhead_t *) (tcbp))->dtv = dtvp + 1
-
-/* Install new dtv for current thread. */
-# define INSTALL_NEW_DTV(dtv) \
- ({ tcbhead_t *__tcbp = (tcbhead_t *)__get_cr27(); \
- __tcbp->dtv = dtv; \
- })
-
-/* Return dtv of given thread descriptor. */
-# define GET_DTV(tcbp) \
- (((tcbhead_t *) (tcbp))->dtv)
-
-/* Code to initially initialize the thread pointer. This might need
- special attention since 'errno' is not yet available and if the
- operation can cause a failure 'errno' must not be touched. */
-# define TLS_INIT_TP(tcbp, secondcall) \
- ({ __set_cr27(tcbp); 0; })
-
-/* Return the address of the dtv for the current thread. */
-# define THREAD_DTV() \
- ({ tcbhead_t *__tcbp = (tcbhead_t *)__get_cr27(); \
- __tcbp->dtv; \
- })
-
-# define TLS_MULTIPLE_THREADS_IN_TCB 1
-
-/* Get the thread descriptor definition. This must be after the
- the definition of THREAD_SELF for TLS. */
-# include <linuxthreads/descr.h>
-
-# endif /* __ASSEMBLER__ */
-
-#else
-
-# ifndef __ASSEMBLER__
-
-typedef struct
-{
- void *tcb;
- dtv_t *dtv;
- void *self;
- int multiple_threads;
-} tcbhead_t;
-
-/* Get the thread descriptor definition. */
-# include <linuxthreads/descr.h>
-
-# define NONTLS_INIT_TP \
- do { \
- static const tcbhead_t nontls_init_tp = { .multiple_threads = 0 }; \
- INIT_THREAD_SELF(&nontls_init_tp, 0); \
- } while (0)
-
-# endif /* __ASSEMBLER__ */
-
-#endif /* HAVE_TLS_SUPPORT */
-
-#endif /* tls.h */
diff --git a/ports/sysdeps/hppa/nptl/tls.h b/ports/sysdeps/hppa/nptl/tls.h
index 389cbb949..8af75044c 100644
--- a/ports/sysdeps/hppa/nptl/tls.h
+++ b/ports/sysdeps/hppa/nptl/tls.h
@@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/hppa version.
- Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2010, 2011 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
@@ -42,12 +42,6 @@ typedef union dtv
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
-
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
/* Signal that TLS support is available. */
#define USE_TLS 1
diff --git a/ports/sysdeps/hppa/stackinfo.h b/ports/sysdeps/hppa/stackinfo.h
index 318de7143..44929c46a 100644
--- a/ports/sysdeps/hppa/stackinfo.h
+++ b/ports/sysdeps/hppa/stackinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,12 @@
#ifndef _STACKINFO_H
#define _STACKINFO_H 1
+#include <elf.h>
+
+/* Default to an executable stack. PF_X can be overridden if PT_GNU_STACK is
+ * present, but it is presumed absent. */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
+
/* On PA the stack grows up. */
#define _STACK_GROWS_UP 1
diff --git a/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c b/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c
index a160308bf..b6c67e89a 100644
--- a/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c
+++ b/ports/sysdeps/m68k/coldfire/fpu/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,3 +22,4 @@ __ieee754_sqrt (double x)
asm ("fdsqrt.d %1,%0" : "=f" (x) : "fm" (x));
return x;
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c b/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
index 7cfc0dd65..e0481b805 100644
--- a/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
+++ b/ports/sysdeps/m68k/coldfire/fpu/e_sqrtf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2011 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
@@ -23,3 +23,4 @@ __ieee754_sqrtf (float x)
asm ("fssqrt.s %1,%0" : "=f" (result) : "dm" (x));
return result;
}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/ports/sysdeps/m68k/dl-machine.h b/ports/sysdeps/m68k/dl-machine.h
index 9bc35e769..51272125d 100644
--- a/ports/sysdeps/m68k/dl-machine.h
+++ b/ports/sysdeps/m68k/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
- Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2010
+ Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2010, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -211,7 +211,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
auto inline void __attribute__ ((unused, always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -269,7 +269,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
case R_68K_PC32:
*reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr;
break;
-#if defined USE_TLS && !defined RTLD_BOOTSTRAP
+#ifndef RTLD_BOOTSTRAP
case R_68K_TLS_DTPMOD32:
/* Get the information from the link map returned by the
resolv function. */
@@ -287,7 +287,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
*reloc_addr = TLS_TPREL_VALUE (sym_map, sym, reloc);
}
break;
-#endif /* defined USE_TLS && !defined RTLD_BOOTSTRAP */
+#endif /* !RTLD_BOOTSTRAP */
case R_68K_NONE: /* Alright, Wilbur. */
break;
default:
@@ -307,7 +307,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void __attribute__ ((unused, always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
if (ELF32_R_TYPE (reloc->r_info) == R_68K_JMP_SLOT)
diff --git a/ports/sysdeps/m68k/libc-tls.c b/ports/sysdeps/m68k/libc-tls.c
index e865fac16..b16eac21e 100644
--- a/ports/sysdeps/m68k/libc-tls.c
+++ b/ports/sysdeps/m68k/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. m68k version.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
@@ -21,8 +21,6 @@
#include <csu/libc-tls.c>
#include <dl-tls.h>
-#if USE_TLS
-
/* On M68K, linker optimizations are not required, so __tls_get_addr
can be called even in statically linked binaries. In this case module
must be always 1 and PT_TLS segment exist in the binary, otherwise it
@@ -34,5 +32,3 @@ __tls_get_addr (tls_index *ti)
dtv_t *dtv = THREAD_DTV ();
return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
}
-
-#endif
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_acos.c b/ports/sysdeps/m68k/m680x0/fpu/e_acos.c
index c9f6c6a16..5afa8bd9c 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_acos.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_acos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999, 2011 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
@@ -21,10 +21,11 @@
#include "mathimpl.h"
#ifndef FUNC
-#define FUNC __ieee754_acos
+# define FUNC __ieee754_acos
+# define FUNC_FINITE __acos_finite
#endif
#ifndef float_type
-#define float_type double
+# define float_type double
#endif
float_type
@@ -33,3 +34,6 @@ FUNC (x)
{
return __m81_u(FUNC)(x);
}
+#ifdef FUNC_FINITE
+strong_alias (FUNC, FUNC_FINITE)
+#endif
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c b/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c
index 90665082d..300fff601 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_acosf.c
@@ -1,5 +1,6 @@
#ifndef FUNC
-#define FUNC __ieee754_acosf
+# define FUNC __ieee754_acosf
+# define FUNC_FINITE __acosf_finite
#endif
#define float_type float
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c b/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c
index e3dcd170f..35767f4e2 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_acosl.c
@@ -1,5 +1,6 @@
#ifndef FUNC
-#define FUNC __ieee754_acosl
+# define FUNC __ieee754_acosl
+# define FUNC_FINITE __acosl_finite
#endif
#define float_type long double
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_asin.c b/ports/sysdeps/m68k/m680x0/fpu/e_asin.c
index b6176c708..271a1f23d 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_asin.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_asin.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_asin
+#define FUNC_FINITE __asin_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c b/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c
index 05fb82670..ece691c6f 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_asinf.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_asinf
+#define FUNC __ieee754_asinf
+#define FUNC_FINITE __asinf_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c b/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c
index 0dd89fb9d..0c136f30e 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_asinl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_asinl
+#define FUNC_FINITE __asinl_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c b/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c
index 551b14db8..ac5982eab 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_atan2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2011 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
@@ -102,3 +102,4 @@ s(__ieee754_atan2) (float_type y, float_type x)
}
return z;
}
+strong_alias (s(__ieee754_atan2), CONCATX (s (__atan2), _finite))
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c b/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c
index 11bf43068..f5f7e7b52 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_atanh.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_atanh
+#define FUNC __ieee754_atanh
+#define FUNC_FINITE __atanh_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c b/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c
index 7a8f92ecf..cb464cbb7 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_atanhf.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_atanhf
+#define FUNC __ieee754_atanhf
+#define FUNC_FINITE __atanhf_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c b/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c
index d8975d678..8f276f5fa 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_atanhl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_atanhl
+#define FUNC_FINITE __atanhl_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c b/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c
index 93d753c51..aaba11be3 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_cosh.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_cosh
+#define FUNC __ieee754_cosh
+#define FUNC_FINITE __cosh_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c b/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c
index 433faf17b..0884741c5 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_coshf.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_coshf
+#define FUNC __ieee754_coshf
+#define FUNC_FINITE __coshf_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c b/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c
index 39144fd20..7fc9b7b91 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_coshl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_coshl
+#define FUNC_FINITE __coshl_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp.c
index 1e95ac474..9f228034a 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_exp.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_exp
+#define FUNC __ieee754_exp
+#define FUNC_FINITE __exp_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c
index a1dd22447..e66a80599 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp10.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_exp10
+#define FUNC_FINITE __exp10_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c
index 1b78bc372..7a3bdd418 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp10f.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_exp10f
+#define FUNC_FINITE __exp10f_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c
index 5e901999f..e2a6255a7 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp10l.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_exp10l
+#define FUNC_FINITE __exp10l_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c
index 24fac4fce..35e29ae65 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp2.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_exp2
+#define FUNC_FINITE __exp2_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c
index 593842e4e..e57ddb536 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp2f.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_exp2f
+#define FUNC_FINITE __exp2f_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c b/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c
index 0ab2a428c..c5854ae42 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_exp2l.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_exp2l
+#define FUNC_FINITE __exp2l_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_expf.c b/ports/sysdeps/m68k/m680x0/fpu/e_expf.c
index 2aeaacfab..af1e01950 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_expf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_expf.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_expf
+#define FUNC __ieee754_expf
+#define FUNC_FINITE __expf_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_expl.c b/ports/sysdeps/m68k/m680x0/fpu/e_expl.c
index 8805a1b83..543eb0edf 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_expl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_expl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_expl
+#define FUNC_FINITE __expl_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c b/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c
index bd229ae4b..293d7214d 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_fmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999, 2011 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
@@ -21,10 +21,11 @@
#include "mathimpl.h"
#ifndef FUNC
-#define FUNC __ieee754_fmod
+# define FUNC __ieee754_fmod
+# define FUNC_FINITE __fmod_finite
#endif
#ifndef float_type
-#define float_type double
+# define float_type double
#endif
float_type
@@ -34,3 +35,6 @@ FUNC (x, y)
{
return __m81_u(FUNC)(x, y);
}
+#ifdef FUNC_FINITE
+strong_alias (FUNC, FUNC_FINITE)
+#endif
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c b/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c
index 88c350ce9..38995c376 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_fmodf.c
@@ -1,5 +1,6 @@
#ifndef FUNC
-#define FUNC __ieee754_fmodf
+# define FUNC __ieee754_fmodf
+# define FUNC_FINITE __fmodf_finite
#endif
#define float_type float
#include <e_fmod.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c b/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c
index a46f19ea9..8d793b2de 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_fmodl.c
@@ -1,5 +1,6 @@
#ifndef FUNC
-#define FUNC __ieee754_fmodl
+# define FUNC __ieee754_fmodl
+# define FUNC_FINITE __fmodl_finite
#endif
#define float_type long double
#include <e_fmod.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log.c b/ports/sysdeps/m68k/m680x0/fpu/e_log.c
index 146dc0c78..628c62b31 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_log.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_log.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_log
+#define FUNC __ieee754_log
+#define FUNC_FINITE __log_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log10.c b/ports/sysdeps/m68k/m680x0/fpu/e_log10.c
index 06a9b87cb..78e0693e9 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_log10.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_log10.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_log10
+#define FUNC __ieee754_log10
+#define FUNC_FINITE __log10_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c b/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c
index 3896864ec..452a75ec1 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_log10f.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_log10f
+#define FUNC __ieee754_log10f
+#define FUNC_FINITE __log10f_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c b/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c
index 6dcfc5a10..7c5dcb8e1 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_log10l.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_log10l
+#define FUNC_FINITE __log10l_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log2.c b/ports/sysdeps/m68k/m680x0/fpu/e_log2.c
index 5528922b9..a00ddbdc9 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_log2.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_log2.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_log2
+#define FUNC __ieee754_log2
+#define FUNC_FINITE __log2_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c b/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c
index 6b4907686..670b69c8a 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_log2f.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_log2f
+#define FUNC __ieee754_log2f
+#define FUNC_FINITE __log2f_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c b/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c
index 4c92a11ac..4a97a0023 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_log2l.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_log2l
+#define FUNC __ieee754_log2l
+#define FUNC_FINITE __log2l_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_logf.c b/ports/sysdeps/m68k/m680x0/fpu/e_logf.c
index bc23217c3..1989a9543 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_logf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_logf.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_logf
+#define FUNC __ieee754_logf
+#define FUNC_FINITE __logf_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_logl.c b/ports/sysdeps/m68k/m680x0/fpu/e_logl.c
index 03b183075..9ab842c3f 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_logl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_logl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_logl
+#define FUNC_FINITE __logl_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_pow.c b/ports/sysdeps/m68k/m680x0/fpu/e_pow.c
index 0b6cee6f1..1bded0b7b 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_pow.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_pow.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2011 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
@@ -124,3 +124,4 @@ s(__ieee754_pow) (float_type x, float_type y)
z = m81(__ieee754_exp) (y * m81(__ieee754_log) (x));
return z;
}
+strong_alias (s(__ieee754_pow), CONCATX (s(__pow), _finite))
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c b/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c
index aa31bc011..f7732af8c 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_remainder.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_remainder
+#define FUNC_FINITE __remainder_finite
#include <e_fmod.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c b/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c
index b04f0c87c..94b53e7a8 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_remainderf.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_remainderf
+#define FUNC_FINITE __remainderf_finite
#include <e_fmodf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c b/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c
index b9dc540cc..d5b59607a 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_remainderl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_remainderl
+#define FUNC_FINITE __remainderl_finite
#include <e_fmodl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c b/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c
index 88edba1ca..c03fd671a 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_scalb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
@@ -58,3 +58,4 @@ s(__ieee754_scalb) (float_type x, float_type fn)
__asm ("fscale%.x %1, %0" : "=f" (retval) : "f" (fn), "0" (x));
return retval;
}
+strong_alias (s(__ieee754_scalb), CONCATX (s(__scalb), _finite))
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c b/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c
index c6fed7ff4..1e1b1c118 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_sinh.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_sinh
+#define FUNC __ieee754_sinh
+#define FUNC_FINITE __sinh_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c b/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c
index b5034b7b0..13c79f9d9 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_sinhf.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_sinhf
+#define FUNC __ieee754_sinhf
+#define FUNC_FINITE __sinhf_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c b/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c
index 2f42d96a3..47f0f2440 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_sinhl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_sinhl
+#define FUNC_FINITE __sinhl_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c b/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c
index 70f19710c..9a250cbc2 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_sqrt.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_sqrt
+#define FUNC __ieee754_sqrt
+#define FUNC_FINITE __sqrt_finite
#include <e_acos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c
index 5dc1904cb..372c3eb2f 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtf.c
@@ -1,2 +1,3 @@
-#define FUNC __ieee754_sqrtf
+#define FUNC __ieee754_sqrtf
+#define FUNC_FINITE __sqrtf_finite
#include <e_acosf.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c
index fede1024a..df5f44e6a 100644
--- a/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c
+++ b/ports/sysdeps/m68k/m680x0/fpu/e_sqrtl.c
@@ -1,2 +1,3 @@
#define FUNC __ieee754_sqrtl
+#define FUNC_FINITE __sqrtl_finite
#include <e_acosl.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c
deleted file mode 100644
index 823915964..000000000
--- a/ports/sysdeps/m68k/m680x0/fpu/s_ccos.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Complex cosine function. m68k fpu version
- Copyright (C) 1997, 1999, 2010 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <complex.h>
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-__complex__ float_type
-s(__ccos) (__complex__ float_type x)
-{
- __complex__ float_type retval;
- unsigned long rx_cond = __m81_test (__real__ x);
-
- if ((rx_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
- {
- /* Real part is finite. */
- float_type sin_rx, cos_rx;
-
- __asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx)
- : "f" (__real__ x));
- __real__ retval = cos_rx * m81(__ieee754_cosh) (__imag__ x);
- if (rx_cond & __M81_COND_ZERO)
- __imag__ retval = (signbit (__imag__ x)
- ? __real__ x : -__real__ x);
- else
- __imag__ retval = -sin_rx * m81(__ieee754_sinh) (__imag__ x);
- }
- else
- {
- unsigned long ix_cond = __m81_test (__imag__ x);
-
- if (ix_cond & __M81_COND_INF)
- __real__ retval = s(fabs) (__imag__ x);
- else
- __real__ retval = __real__ x - __real__ x;
- if (ix_cond & __M81_COND_ZERO)
- __imag__ retval = __imag__ x;
- else
- __imag__ retval = __real__ x - __real__ x;
- }
-
- return retval;
-}
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (s(__ccos), s(ccos))
diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccosf.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccosf.c
deleted file mode 100644
index f5e8a41fa..000000000
--- a/ports/sysdeps/m68k/m680x0/fpu/s_ccosf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_ccos.c>
diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_ccosl.c b/ports/sysdeps/m68k/m680x0/fpu/s_ccosl.c
deleted file mode 100644
index aaff36520..000000000
--- a/ports/sysdeps/m68k/m680x0/fpu/s_ccosl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_ccos.c>
diff --git a/ports/sysdeps/m68k/nptl/tls.h b/ports/sysdeps/m68k/nptl/tls.h
index c29824cfb..3c5b165d8 100644
--- a/ports/sysdeps/m68k/nptl/tls.h
+++ b/ports/sysdeps/m68k/nptl/tls.h
@@ -43,9 +43,6 @@ typedef union dtv
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
-/* Signal that TLS support is available. */
-#define USE_TLS 1
-
#ifndef __ASSEMBLER__
/* Get system call information. */
diff --git a/ports/sysdeps/mips/dl-machine.h b/ports/sysdeps/mips/dl-machine.h
index e2c782afd..836c47f81 100644
--- a/ports/sysdeps/mips/dl-machine.h
+++ b/ports/sysdeps/mips/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. MIPS version.
- Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
@@ -343,7 +343,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
switch (r_type)
{
-#if defined (USE_TLS) && !defined (RTLD_BOOTSTRAP)
+#if !defined (RTLD_BOOTSTRAP)
# if _MIPS_SIM == _ABI64
case R_MIPS_TLS_DTPMOD64:
case R_MIPS_TLS_DTPREL64:
@@ -528,7 +528,7 @@ elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
strtab + refsym->st_name);
}
memcpy (reloc_addr, (void *) value,
- MIN (sym->st_size, refsym->st_size));
+ MIN (sym->st_size, refsym->st_size));
break;
}
@@ -559,7 +559,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr)
+ void *const reloc_addr, int skip_ifunc)
{
elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info,
sym, version, reloc_addr, 0, 1);
@@ -576,7 +576,8 @@ elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
auto inline void
__attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- ElfW(Addr) l_addr, const ElfW(Rel) *reloc)
+ ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
+ int skip_ifunc)
{
ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELFW(R_TYPE) (reloc->r_info);
@@ -599,7 +600,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr)
+ void *const reloc_addr, int skip_ifunc)
{
elf_machine_reloc (map, (ElfW(Addr)) reloc->r_info, sym, version,
reloc_addr, reloc->r_addend, 0);
@@ -627,7 +628,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
({ \
const ElfW(Sym) *ref = sym; \
const struct r_found_version *version \
- = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \
+ = vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL; \
struct link_map *sym_map; \
sym_map = RESOLVE_MAP (&ref, version, reloc); \
ref ? sym_map->l_addr + ref->st_value : 0; \
@@ -649,7 +650,7 @@ elf_machine_got_rel (struct link_map *map, int lazy)
i = (got[1] & ELF_MIPS_GNU_GOT1_MASK)? 2 : 1;
/* Add the run-time displacement to all local got entries if
- needed. */
+ needed. */
if (__builtin_expect (map->l_addr != 0, 0))
{
while (i < n)
diff --git a/ports/sysdeps/mips/elf/configure b/ports/sysdeps/mips/elf/configure
index b1b3d0baf..bee99287d 100644
--- a/ports/sysdeps/mips/elf/configure
+++ b/ports/sysdeps/mips/elf/configure
@@ -1,7 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/mips/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
{ $as_echo "$as_me:$LINENO: checking for MIPS TLS support" >&5
@@ -36,11 +35,9 @@ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_mips_tls" >&5
$as_echo "$libc_cv_mips_tls" >&6; }
-if test $libc_cv_mips_tls = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TLS_SUPPORT 1
-_ACEOF
-
-fi
+if test $libc_cv_mips_tls = no; then
+ { { $as_echo "$as_me:$LINENO: error: the assembler must support TLS" >&5
+$as_echo "$as_me: error: the assembler must support TLS" >&2;}
+ { (exit 1); exit 1; }; }
fi
diff --git a/ports/sysdeps/mips/elf/configure.in b/ports/sysdeps/mips/elf/configure.in
index ecb9108c1..5cb5a742e 100644
--- a/ports/sysdeps/mips/elf/configure.in
+++ b/ports/sysdeps/mips/elf/configure.in
@@ -1,7 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/mips/elf.
-if test "$usetls" != no; then
# Check for support of thread-local storage handling in assembler and
# linker.
AC_CACHE_CHECK(for MIPS TLS support, libc_cv_mips_tls, [dnl
@@ -25,9 +24,8 @@ else
libc_cv_mips_tls=no
fi
rm -f conftest*])
-if test $libc_cv_mips_tls = yes; then
- AC_DEFINE(HAVE_TLS_SUPPORT)
-fi
+if test $libc_cv_mips_tls = no; then
+ AC_MSG_ERROR([the assembler must support TLS])
fi
dnl No MIPS GCC supports accessing static and hidden symbols in an
diff --git a/ports/sysdeps/mips/fpu/e_sqrt.c b/ports/sysdeps/mips/fpu/e_sqrt.c
index 5449710af..d1a8afc3c 100644
--- a/ports/sysdeps/mips/fpu/e_sqrt.c
+++ b/ports/sysdeps/mips/fpu/e_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hartvig Ekner <hartvige@mips.com>, 2002.
@@ -30,6 +30,7 @@ __ieee754_sqrt (double x)
__asm__ ("sqrt.d %0,%1" : "=f" (z) : "f" (x));
return z;
}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
#else
diff --git a/ports/sysdeps/mips/fpu/e_sqrtf.c b/ports/sysdeps/mips/fpu/e_sqrtf.c
index 3590ad46d..da58b46f8 100644
--- a/ports/sysdeps/mips/fpu/e_sqrtf.c
+++ b/ports/sysdeps/mips/fpu/e_sqrtf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hartvig Ekner <hartvige@mips.com>, 2002.
@@ -30,6 +30,7 @@ __ieee754_sqrtf (float x)
__asm__ ("sqrt.s %0,%1" : "=f" (z) : "f" (x));
return z;
}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
#else
diff --git a/ports/sysdeps/mips/libc-tls.c b/ports/sysdeps/mips/libc-tls.c
index a3d6301d1..2c7805625 100644
--- a/ports/sysdeps/mips/libc-tls.c
+++ b/ports/sysdeps/mips/libc-tls.c
@@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. MIPS version.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2011 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
@@ -20,8 +20,6 @@
#include <csu/libc-tls.c>
#include <dl-tls.h>
-#if USE_TLS
-
/* On MIPS, linker optimizations are not required, so __tls_get_addr
can be called even in statically linked binaries. In this case module
must be always 1 and PT_TLS segment exist in the binary, otherwise it
@@ -33,5 +31,3 @@ __tls_get_addr (tls_index *ti)
dtv_t *dtv = THREAD_DTV ();
return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
}
-
-#endif
diff --git a/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c b/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c
index 81fd58ae1..c2e1faf24 100644
--- a/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c
+++ b/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c
@@ -1,5 +1,5 @@
/* long double square root in software floating-point emulation.
- Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
@@ -37,3 +37,4 @@ __ieee754_sqrtl (const long double a)
FP_HANDLE_EXCEPTIONS;
return c;
}
+strong_alias (__ieee754_sqrtl, __sqrtl_finite)
diff --git a/ports/sysdeps/mips/nptl/tls.h b/ports/sysdeps/mips/nptl/tls.h
index 20f9f9683..0f215d447 100644
--- a/ports/sysdeps/mips/nptl/tls.h
+++ b/ports/sysdeps/mips/nptl/tls.h
@@ -56,14 +56,6 @@ typedef union dtv
#endif /* __ASSEMBLER__ */
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
-/* Signal that TLS support is available. */
-#define USE_TLS 1
-
#ifndef __ASSEMBLER__
/* Get system call information. */
diff --git a/ports/sysdeps/unix/arm/sysdep.S b/ports/sysdeps/unix/arm/sysdep.S
index d3ad81b7b..dcd3ce252 100644
--- a/ports/sysdeps/unix/arm/sysdep.S
+++ b/ports/sysdeps/unix/arm/sysdep.S
@@ -1,5 +1,5 @@
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003,
- 2004, 2005, 2009
+ 2004, 2005, 2009, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -42,7 +42,6 @@ syscall_error:
moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */
#endif
-#if USE___THREAD
mov ip, lr
cfi_register (lr, ip)
mov r1, r0
@@ -58,46 +57,6 @@ syscall_error:
RETINSTR (, ip)
1: .word errno(gottpoff) + (. - 2b - 8)
-#elif RTLD_PRIVATE_ERRNO
- ldr r1, 1f
-0: str r0, [pc, r1]
- mvn r0, $0
- DO_RET(r14)
-
-1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8
-#elif defined(_LIBC_REENTRANT)
- str lr, [sp, #-4]!
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (lr, 0)
- str r0, [sp, #-4]!
- cfi_adjust_cfa_offset (4)
- bl PLTJMP(C_SYMBOL_NAME(__errno_location))
- ldr r1, [sp], #4
- cfi_adjust_cfa_offset (-4)
- str r1, [r0]
- mvn r0, $0
- ldr pc, [sp], #4
-#else
-#ifndef PIC
- ldr r1, 1f
- str r0, [r1]
- mvn r0, $0
- DO_RET (r14)
-
-1: .long C_SYMBOL_NAME(errno)
-#else
- @ we have to establish our PIC register
- ldr r2, 1f
- ldr r1, 2f
-0: add r2, pc, r2
- str r0, [r1, r2]
- mvn r0, $0
- DO_RET (r14)
-
-1: .word _GLOBAL_OFFSET_TABLE_ - 0b - 8
-2: .word C_SYMBOL_NAME(errno)(GOTOFF)
-#endif
-#endif
#undef __syscall_error
END (__syscall_error)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
index 7691a94b1..8eeff6b26 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
@@ -35,8 +35,6 @@
#include <sysdep.h>
-#ifdef HAVE_TLS_SUPPORT
-
/* GCC will emit calls to this routine under -mtp=soft. Linux has an
equivalent helper function (which clobbers fewer registers than
a normal function call) in a high page of memory; tail call to the
@@ -47,5 +45,3 @@ ENTRY (__aeabi_read_tp)
mov r0, #0xffff0fff
sub pc, r0, #31
END (__aeabi_read_tp)
-
-#endif
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
index a2c64827a..8f42111cf 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -1,5 +1,5 @@
-/* O_*, F_*, FD_* bit values for Linux/HPPA.
- Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2004
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 1995-1999, 2000, 2002, 2004, 2010, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -29,7 +29,7 @@
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
- located on an ext2 file system */
+ located on a few file systems. */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
@@ -46,13 +46,15 @@
#define O_ASYNC 020000
#define O_BLKSEEK 00000100 /* HPUX only */
-#ifdef __USE_GNU
-# define O_DIRECT 000040000 /* Direct disk access. */
+#ifdef __USE_XOPEN2K8
# define O_DIRECTORY 000010000 /* Must be a directory. */
# define O_NOFOLLOW 000000200 /* Do not follow links. */
-# define O_NOATIME 004000000 /* Do not set atime. */
# define O_CLOEXEC 010000000 /* Set close_on_exec. */
#endif
+#ifdef __USE_GNU
+# define O_DIRECT 040000 /* Direct disk access. */
+# define O_NOATIME 004000000 /* Do not set atime. */
+#endif
/* For now Linux has synchronisity options for data and read operations.
We define the symbols here but let them do the same as O_SYNC since
@@ -85,7 +87,7 @@
#define F_SETLK64 9 /* Set record locking info (non-blocking). */
#define F_SETLKW64 10 /* Set record locking info (blocking). */
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
# define F_GETOWN 11 /* Get owner of socket (receiver of SIGIO). */
# define F_SETOWN 12 /* Set owner of socket (receiver of SIGIO). */
#endif
@@ -101,6 +103,10 @@
# define F_SETLEASE 1024 /* Set a lease. */
# define F_GETLEASE 1025 /* Enquire what lease is active. */
# define F_NOTIFY 1026 /* Request notfications on a directory. */
+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
+# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
+#endif
+#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
close-on-exit set. */
#endif
@@ -227,6 +233,19 @@ struct f_owner_ex
we splice from/to). */
# define SPLICE_F_MORE 4 /* Expect more data. */
# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
+
+
+/* File handle structure. */
+struct file_handle
+{
+ unsigned int handle_bytes;
+ int handle_type;
+ /* File identifier. */
+ unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now). */
+# define MAX_HANDLE_SZ 128
#endif
__BEGIN_DECLS
@@ -243,20 +262,32 @@ extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
unsigned int __flags);
-/* Splice address range into a pipe. */
+/* Splice address range into a pipe.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
size_t __count, unsigned int __flags);
-/* Splice two files together. */
+/* Splice two files together.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
__off64_t *__offout, size_t __len,
unsigned int __flags);
-/* In-kernel implementation of tee for pipe buffers. */
+/* In-kernel implementation of tee for pipe buffers.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
extern ssize_t tee (int __fdin, int __fdout, size_t __len,
unsigned int __flags);
-/* Reserve storage for the data of the file associated with FD. */
+/* Reserve storage for the data of the file associated with FD.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
# else
@@ -273,6 +304,19 @@ extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
__off64_t __len);
# endif
+
+/* Map file name to file handle. */
+extern int name_to_handle_at (int __dfd, const char *__name,
+ struct file_handle *__handle, int *__mnt_id,
+ int __flags) __THROW;
+
+/* Open file using the file handle.
+
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+ int __flags);
+
#endif
__END_DECLS
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c
deleted file mode 100644
index 0d6da8291..000000000
--- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/aio_cancel.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <shlib-compat.h>
-
-#define aio_cancel64 XXX
-#include <aio.h>
-#undef aio_cancel64
-#include <errno.h>
-
-extern __typeof (aio_cancel) __new_aio_cancel;
-extern __typeof (aio_cancel) __old_aio_cancel;
-
-#define aio_cancel __new_aio_cancel
-
-#include <sysdeps/pthread/aio_cancel.c>
-
-#undef aio_cancel
-strong_alias (__new_aio_cancel, __new_aio_cancel64);
-versioned_symbol (librt, __new_aio_cancel, aio_cancel, GLIBC_2_3);
-versioned_symbol (librt, __new_aio_cancel64, aio_cancel64, GLIBC_2_3);
-
-#if SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_3)
-
-#undef ECANCELED
-#define aio_cancel __old_aio_cancel
-#define ECANCELED 125
-
-#include <sysdeps/pthread/aio_cancel.c>
-
-#undef aio_cancel
-strong_alias (__old_aio_cancel, __old_aio_cancel64);
-compat_symbol (librt, __old_aio_cancel, aio_cancel, GLIBC_2_1);
-compat_symbol (librt, __old_aio_cancel64, aio_cancel64, GLIBC_2_1);
-
-#endif
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h
deleted file mode 100644
index ff0ec200f..000000000
--- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/initspin.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* PA-RISC specific definitions for spinlock initializers.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Initial value of a spinlock. PA-RISC only implements atomic load
- and clear so this must be non-zero. */
-#define __LT_SPINLOCK_INIT ((__atomic_lock_t) { { 1, 1, 1, 1 } })
-
-/* Initialize global spinlocks without cast, generally macro wrapped */
-#define __LT_SPINLOCK_ALT_INIT { { 1, 1, 1, 1 } }
-
-/* Macros for lock initializers, not using the above definition.
- The above definition is not used in the case that static initializers
- use this value. */
-#define __LOCK_ALT_INITIALIZER { __LT_SPINLOCK_ALT_INIT, 0 }
-
-/* Used to initialize _pthread_fastlock's in non-static case */
-#define __LOCK_INITIALIZER ((struct _pthread_fastlock){ __LT_SPINLOCK_INIT, 0 })
-
-/* Used in pthread_atomic initialization */
-#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_ALT_INIT }
-
-/* Tell the rest of the code that the initializer is non-zero without
- explaining it's internal structure */
-#define __LT_INITIALIZER_NOT_ZERO
-
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
deleted file mode 100644
index 717371831..000000000
--- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/bits/pthreadtypes.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Linuxthreads - a simple clone()-based implementation of Posix */
-/* threads for Linux. */
-/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
-/* */
-/* This program 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. */
-/* */
-/* This program 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. */
-
-#if !defined _BITS_TYPES_H && !defined _PTHREAD_H
-# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead."
-#endif
-
-#ifndef _BITS_PTHREADTYPES_H
-#define _BITS_PTHREADTYPES_H 1
-
-#define __need_schedparam
-#include <bits/sched.h>
-
-/* We need 128-bit alignment for the ldcw semaphore. At most, we are
- assured of 64-bit alignment for stack locals and malloc'd data. Thus,
- we use a struct with four ints for the atomic lock type. The locking
- code will figure out which of the four to use for the ldcw semaphore. */
-typedef volatile struct {
- int lock[4];
-} __attribute__ ((aligned(16))) __atomic_lock_t;
-
-/* Fast locks (not abstract because mutexes and conditions aren't abstract). */
-struct _pthread_fastlock
-{
- __atomic_lock_t __spinlock; /* Used by compare_and_swap emulation. Also,
- adaptive SMP lock stores spin count here. */
- long int __status; /* "Free" or "taken" or head of waiting list */
-};
-
-#ifndef _PTHREAD_DESCR_DEFINED
-/* Thread descriptors */
-typedef struct _pthread_descr_struct *_pthread_descr;
-# define _PTHREAD_DESCR_DEFINED
-#endif
-
-
-/* Attributes for threads. */
-typedef struct __pthread_attr_s
-{
- int __detachstate;
- int __schedpolicy;
- struct __sched_param __schedparam;
- int __inheritsched;
- int __scope;
- size_t __guardsize;
- int __stackaddr_set;
- void *__stackaddr;
- size_t __stacksize;
-} pthread_attr_t;
-
-
-/* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */
-
-#ifdef __GLIBC_HAVE_LONG_LONG
-__extension__ typedef long long __pthread_cond_align_t;
-#else
-typedef long __pthread_cond_align_t;
-#endif
-
-typedef struct
-{
- struct _pthread_fastlock __c_lock; /* Protect against concurrent access */
- _pthread_descr __c_waiting; /* Threads waiting on this condition */
- char __padding[48 - sizeof (struct _pthread_fastlock)
- - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)];
- __pthread_cond_align_t __align;
-} pthread_cond_t;
-
-
-/* Attribute for conditionally variables. */
-typedef struct
-{
- int __dummy;
-} pthread_condattr_t;
-
-/* Keys for thread-specific data */
-typedef unsigned int pthread_key_t;
-
-
-/* Mutexes (not abstract because of PTHREAD_MUTEX_INITIALIZER). */
-/* (The layout is unnatural to maintain binary compatibility
- with earlier releases of LinuxThreads.) */
-typedef struct
-{
- int __m_reserved; /* Reserved for future use */
- int __m_count; /* Depth of recursive locking */
- _pthread_descr __m_owner; /* Owner thread (if recursive or errcheck) */
- int __m_kind; /* Mutex kind: fast, recursive or errcheck */
- struct _pthread_fastlock __m_lock; /* Underlying fast lock */
-} pthread_mutex_t;
-
-
-/* Attribute for mutex. */
-typedef struct
-{
- int __mutexkind;
-} pthread_mutexattr_t;
-
-
-/* Once-only execution */
-typedef int pthread_once_t;
-
-#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-/* Read-write locks. */
-typedef struct _pthread_rwlock_t
-{
- struct _pthread_fastlock __rw_lock; /* Lock to guarantee mutual exclusion */
- int __rw_readers; /* Number of readers */
- _pthread_descr __rw_writer; /* Identity of writer, or NULL if none */
- _pthread_descr __rw_read_waiting; /* Threads waiting for reading */
- _pthread_descr __rw_write_waiting; /* Threads waiting for writing */
- int __rw_kind; /* Reader/Writer preference selection */
- int __rw_pshared; /* Shared between processes or not */
-} pthread_rwlock_t;
-
-
-/* Attribute for read-write locks. */
-typedef struct
-{
- int __lockkind;
- int __pshared;
-} pthread_rwlockattr_t;
-#endif
-
-#ifdef __USE_XOPEN2K
-/* POSIX spinlock data type. */
-typedef __atomic_lock_t pthread_spinlock_t;
-
-/* POSIX barrier. */
-typedef struct {
- struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */
- int __ba_required; /* Threads needed for completion */
- int __ba_present; /* Threads waiting */
- _pthread_descr __ba_waiting; /* Queue of waiting threads */
-} pthread_barrier_t;
-
-/* barrier attribute */
-typedef struct {
- int __pshared;
-} pthread_barrierattr_t;
-
-#endif
-
-
-/* Thread identifiers */
-typedef unsigned long int pthread_t;
-
-#endif /* bits/pthreadtypes.h */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h
deleted file mode 100644
index 5dc6e6fa7..000000000
--- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/malloc-machine.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* HP-PARISC macro definitions for mutexes, thread-specific data
- and parameters for malloc.
- Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@baldric.uwo.ca>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _MALLOC_MACHINE_H
-#define _MALLOC_MACHINE_H
-
-#undef thread_atfork_static
-
-#include <atomic.h>
-#include <bits/libc-lock.h>
-
-__libc_lock_define (typedef, mutex_t)
-
-/* Since our lock structure does not tolerate being initialized to zero, we must
- modify the standard function calls made by malloc */
-# define mutex_init(m) \
- __libc_maybe_call (__pthread_mutex_init, (m, NULL), \
- (((m)->__m_lock.__spinlock = __LT_SPINLOCK_INIT),(*(int *)(m))) )
-# define mutex_lock(m) \
- __libc_maybe_call (__pthread_mutex_lock, (m), \
- (__load_and_clear(&((m)->__m_lock.__spinlock)), 0))
-# define mutex_trylock(m) \
- __libc_maybe_call (__pthread_mutex_trylock, (m), \
- (*(int *)(m) ? 1 : (__load_and_clear(&((m)->__m_lock.__spinlock)), 0)))
-# define mutex_unlock(m) \
- __libc_maybe_call (__pthread_mutex_unlock, (m), \
- (((m)->__m_lock.__spinlock = __LT_SPINLOCK_INIT), (*(int *)(m))) )
-
-/* This is defined by newer gcc version unique for each module. */
-extern void *__dso_handle __attribute__ ((__weak__));
-
-#include <fork.h>
-
-#ifdef SHARED
-# define thread_atfork(prepare, parent, child) \
- __register_atfork (prepare, parent, child, __dso_handle)
-#else
-# define thread_atfork(prepare, parent, child) \
- __register_atfork (prepare, parent, child, \
- &__dso_handle == NULL ? NULL : __dso_handle)
-#endif
-
-/* thread specific data for glibc */
-
-#include <bits/libc-tsd.h>
-
-typedef int tsd_key_t[1]; /* no key data structure, libc magic does it */
-__libc_tsd_define (static, void *, MALLOC) /* declaration/common definition */
-#define tsd_key_create(key, destr) ((void) (key))
-#define tsd_setspecific(key, data) __libc_tsd_set (void *, MALLOC, (data))
-#define tsd_getspecific(key, vptr) ((vptr) = __libc_tsd_get (void *, MALLOC))
-
-#include <sysdeps/generic/malloc-machine.h>
-
-#endif /* !defined(_MALLOC_MACHINE_H) */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c
deleted file mode 100644
index 27f850cf8..000000000
--- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/pt-initfini.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Special .init and .fini section support for HPPA. Linuxthreads version.
- Copyright (C) 2001, 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it
- and/or modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- In addition to the permissions in the GNU Lesser General Public
- License, the Free Software Foundation gives you unlimited
- permission to link the compiled version of this file with other
- programs, and to distribute those programs without any restriction
- coming from the use of this file. (The Lesser General Public
- License restrictions do apply in other respects; for example, they
- cover modification of the file, and distribution when not linked
- into another program.)
-
- The GNU C Library is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file is compiled into assembly code which is then munged by a sed
- script into two files: crti.s and crtn.s.
-
- * crti.s puts a function prologue at the beginning of the
- .init and .fini sections and defines global symbols for
- those addresses, so they can be called as functions.
-
- * crtn.s puts the corresponding function epilogues
- in the .init and .fini sections. */
-
-/* If we use the standard C version, the linkage table pointer won't
- be properly preserved due to the splitting up of function prologues
- and epilogues. Therefore we write these in assembly to make sure
- they do the right thing. */
-
-__asm__ (
-"#include \"defs.h\"\n"
-"\n"
-"/*@HEADER_ENDS*/\n"
-"\n"
-"/*@_init_PROLOG_BEGINS*/\n"
-" .section .init\n"
-" .align 4\n"
-" .globl _init\n"
-" .type _init,@function\n"
-"_init:\n"
-" stw %rp,-20(%sp)\n"
-" stwm %r4,64(%sp)\n"
-" stw %r19,-32(%sp)\n"
-" bl __pthread_initialize_minimal,%rp\n"
-" copy %r19,%r4 /* delay slot */\n"
-" copy %r4,%r19\n"
-"/*@_init_PROLOG_ENDS*/\n"
-"\n"
-"/*@_init_EPILOG_BEGINS*/\n"
-"/* Here is the tail end of _init. */\n"
-" .section .init\n"
-" ldw -84(%sp),%rp\n"
-" copy %r4,%r19\n"
-" bv %r0(%rp)\n"
-"_end_init:\n"
-" ldwm -64(%sp),%r4\n"
-"\n"
-"/* Our very own unwind info, because the assembler can't handle\n"
-" functions split into two or more pieces. */\n"
-" .section .PARISC.unwind,\"a\",@progbits\n"
-" .extern _init\n"
-" .word _init, _end_init\n"
-" .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n"
-"\n"
-"/*@_init_EPILOG_ENDS*/\n"
-"\n"
-"/*@_fini_PROLOG_BEGINS*/\n"
-" .section .fini\n"
-" .align 4\n"
-" .globl _fini\n"
-" .type _fini,@function\n"
-"_fini:\n"
-" stw %rp,-20(%sp)\n"
-" stwm %r4,64(%sp)\n"
-" stw %r19,-32(%sp)\n"
-" copy %r19,%r4\n"
-"/*@_fini_PROLOG_ENDS*/\n"
-"\n"
-"/*@_fini_EPILOG_BEGINS*/\n"
-" .section .fini\n"
-" ldw -84(%sp),%rp\n"
-" copy %r4,%r19\n"
-" bv %r0(%rp)\n"
-"_end_fini:\n"
-" ldwm -64(%sp),%r4\n"
-"\n"
-" .section .PARISC.unwind,\"a\",@progbits\n"
-" .extern _fini\n"
-" .word _fini, _end_fini\n"
-" .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n"
-"\n"
-"/*@_fini_EPILOG_ENDS*/\n"
-"\n"
-"/*@TRAILER_BEGINS*/\n"
-);
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h
deleted file mode 100644
index 51d6cf394..000000000
--- a/ports/sysdeps/unix/sysv/linux/hppa/linuxthreads/sysdep-cancel.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/* cancellable system calls for Linux/HPPA.
- Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Carlos O'Donell <carlos@baldric.uwo.ca>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sysdep.h>
-#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <linuxthreads/internals.h>
-#endif
-
-#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
-
-# ifndef NO_ERROR
-# define NO_ERROR -0x1000
-# endif
-
-/* The syscall cancellation mechanism requires userspace
- assistance, the following code does roughly this:
-
- do arguments (read arg5 and arg6 to registers)
- setup frame
-
- check if there are threads, yes jump to pseudo_cancel
-
- unthreaded:
- syscall
- check syscall return (jump to pre_end)
- set errno
- set return to -1
- (jump to pre_end)
-
- pseudo_cancel:
- cenable
- syscall
- cdisable
- check syscall return (jump to pre_end)
- set errno
- set return to -1
-
- pre_end
- restore stack
-
- It is expected that 'ret' and 'END' macros will
- append an 'undo arguments' and 'return' to the
- this PSEUDO macro. */
-
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- ENTRY (name) \
- DOARGS_##args ASM_LINE_SEP \
- copy TREG, %r1 ASM_LINE_SEP \
- copy %sp, TREG ASM_LINE_SEP \
- stwm %r1, 64(%sp) ASM_LINE_SEP \
- stw %rp, -20(%sp) ASM_LINE_SEP \
- stw TREG, -4(%sp) ASM_LINE_SEP \
- /* Done setting up frame, continue... */ ASM_LINE_SEP \
- SINGLE_THREAD_P ASM_LINE_SEP \
- cmpib,<>,n 0,%ret0,L(pseudo_cancel) ASM_LINE_SEP \
-L(unthreaded): ASM_LINE_SEP \
- /* Save r19 */ ASM_LINE_SEP \
- SAVE_PIC(TREG) ASM_LINE_SEP \
- /* Do syscall, delay loads # */ ASM_LINE_SEP \
- ble 0x100(%sr2,%r0) ASM_LINE_SEP \
- ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \
- ldi NO_ERROR,%r1 ASM_LINE_SEP \
- cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \
- /* Restore r19 from TREG */ ASM_LINE_SEP \
- LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \
- SYSCALL_ERROR_HANDLER ASM_LINE_SEP \
- /* Use TREG for temp storage */ ASM_LINE_SEP \
- copy %ret0, TREG /* delay */ ASM_LINE_SEP \
- /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \
- /* do a -1*syscall_ret0 */ ASM_LINE_SEP \
- sub %r0, TREG, TREG ASM_LINE_SEP \
- /* Store into errno location */ ASM_LINE_SEP \
- stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \
- b L(pre_end) ASM_LINE_SEP \
- /* return -1 as error */ ASM_LINE_SEP \
- ldo -1(%r0), %ret0 /* delay */ ASM_LINE_SEP \
-L(pseudo_cancel): ASM_LINE_SEP \
- PUSHARGS_##args /* Save args */ ASM_LINE_SEP \
- /* Save r19 into TREG */ ASM_LINE_SEP \
- CENABLE /* FUNC CALL */ ASM_LINE_SEP \
- SAVE_PIC(TREG) /* delay */ ASM_LINE_SEP \
- /* restore syscall args */ ASM_LINE_SEP \
- POPARGS_##args ASM_LINE_SEP \
- /* save mask from cenable (use stub rp slot) */ ASM_LINE_SEP \
- stw %ret0, -24(%sp) ASM_LINE_SEP \
- /* ... SYSCALL ... */ ASM_LINE_SEP \
- ble 0x100(%sr2,%r0) ASM_LINE_SEP \
- ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \
- /* ............... */ ASM_LINE_SEP \
- LOAD_PIC(TREG) ASM_LINE_SEP \
- /* pass mask as arg0 to cdisable */ ASM_LINE_SEP \
- ldw -24(%sp), %r26 ASM_LINE_SEP \
- CDISABLE ASM_LINE_SEP \
- stw %ret0, -24(%sp) /* delay */ ASM_LINE_SEP \
- /* Restore syscall return */ ASM_LINE_SEP \
- ldw -24(%sp), %ret0 ASM_LINE_SEP \
- /* compare error */ ASM_LINE_SEP \
- ldi NO_ERROR,%r1 ASM_LINE_SEP \
- /* branch if no error */ ASM_LINE_SEP \
- cmpb,>>=,n %r1,%ret0,L(pre_end) ASM_LINE_SEP \
- LOAD_PIC(TREG) /* cond. nullify */ ASM_LINE_SEP \
- copy %ret0, TREG /* save syscall return */ ASM_LINE_SEP \
- SYSCALL_ERROR_HANDLER ASM_LINE_SEP \
- /* make syscall res value positive */ ASM_LINE_SEP \
- sub %r0, TREG, TREG /* delay */ ASM_LINE_SEP \
- /* No need to LOAD_PIC */ ASM_LINE_SEP \
- /* store into errno location */ ASM_LINE_SEP \
- stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \
- /* return -1 */ ASM_LINE_SEP \
- ldo -1(%r0), %ret0 ASM_LINE_SEP \
-L(pre_end): ASM_LINE_SEP \
- /* Restore rp before exit */ ASM_LINE_SEP \
- ldw -84(%sr0,%sp), %rp ASM_LINE_SEP \
- /* Undo frame */ ASM_LINE_SEP \
- ldwm -64(%sp),TREG ASM_LINE_SEP \
- /* No need to LOAD_PIC */ ASM_LINE_SEP
-
-/* Save arguments into our frame */
-# define PUSHARGS_0 /* nothing to do */
-# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP
-
-/* Bring them back from the stack */
-# define POPARGS_0 /* nothing to do */
-# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP
-# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP
-# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP
-# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP
-# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP
-# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP
-
-# ifdef IS_IN_libpthread
-# ifdef PIC
-# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP
-# else
-# define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \
- bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP
-# endif
-# elif !defined NOT_IN_libc
-# ifdef PIC
-# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
- bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \
- bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
-# else
-# define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
- bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __libc_disable_asynccancel,code ASM_LINE_SEP \
- bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
-# endif
-# else
-# ifdef PIC
-# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
- bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
- bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP
-# else
-# define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
- bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
-# define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
- bl __librt_disable_asynccancel,%r2 ASM_LINE_SEP
-# endif
-# endif
-
-/* p_header.multiple_threads is +12 from the pthread_descr struct start,
- We could have called __get_cr27() but we really want less overhead */
-# define MULTIPLE_THREADS_OFFSET 0xC
-
-/* cr27 has been initialized to 0x0 by kernel */
-# define NO_THREAD_CR27 0x0
-
-# ifdef IS_IN_libpthread
-# define __local_multiple_threads __pthread_multiple_threads
-# elif !defined NOT_IN_libc
-# define __local_multiple_threads __libc_multiple_threads
-# else
-# define __local_multiple_threads __librt_multiple_threads
-# endif
-
-# ifndef __ASSEMBLER__
-# if !defined NOT_IN_libc || defined IS_IN_libpthread
-extern int __local_multiple_threads attribute_hidden;
-# else
-extern int __local_multiple_threads;
-# endif
-# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
-# else
-/* This ALT version requires newer kernel support */
-# define SINGLE_THREAD_P_MFCTL \
- mfctl %cr27, %ret0 ASM_LINE_SEP \
- cmpib,= NO_THREAD_CR27,%ret0,L(stp) ASM_LINE_SEP \
- nop ASM_LINE_SEP \
- ldw MULTIPLE_THREADS_OFFSET(%sr0,%ret0),%ret0 ASM_LINE_SEP \
-L(stp): ASM_LINE_SEP
-# ifdef PIC
-/* Slower version uses GOT to get value of __local_multiple_threads */
-# define SINGLE_THREAD_P \
- addil LT%__local_multiple_threads, %r19 ASM_LINE_SEP \
- ldw RT%__local_multiple_threads(%sr0,%r1), %ret0 ASM_LINE_SEP \
- ldw 0(%sr0,%ret0), %ret0 ASM_LINE_SEP
-# else
-/* Slow non-pic version using DP */
-# define SINGLE_THREAD_P \
- addil LR%__local_multiple_threads-$global$,%r27 ASM_LINE_SEP \
- ldw RR%__local_multiple_threads-$global$(%sr0,%r1),%ret0 ASM_LINE_SEP
-# endif
-# endif
-#elif !defined __ASSEMBLER__
-
-/* This code should never be used but we define it anyhow. */
-# define SINGLE_THREAD_P (1)
-
-#endif
-/* !defined NOT_IN_libc || defined IS_IN_libpthread */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
index 6cffa7631..d704345fe 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2011 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
@@ -61,11 +61,53 @@
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
+ ENTRY (__##syscall_name##_nocancel) \
+ DOARGS_##args ASM_LINE_SEP \
+ stwm TREG, 64(%sp) ASM_LINE_SEP \
+ .cfi_offset TREG, 0 ASM_LINE_SEP \
+ .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \
+ stw %sp, -4(%sp) ASM_LINE_SEP \
+ .cfi_offset 30, -4 ASM_LINE_SEP \
+ stw %r19, -32(%sp) ASM_LINE_SEP \
+ .cfi_offset 19, -32 ASM_LINE_SEP \
+ /* Save r19 */ ASM_LINE_SEP \
+ SAVE_PIC(TREG) ASM_LINE_SEP \
+ /* Do syscall, delay loads # */ ASM_LINE_SEP \
+ ble 0x100(%sr2,%r0) ASM_LINE_SEP \
+ ldi SYS_ify (syscall_name), %r20 /* delay */ ASM_LINE_SEP \
+ ldi NO_ERROR,%r1 ASM_LINE_SEP \
+ cmpb,>>=,n %r1,%ret0,L(pre_nc_end) ASM_LINE_SEP \
+ /* Restore r19 from TREG */ ASM_LINE_SEP \
+ LOAD_PIC(TREG) /* delay */ ASM_LINE_SEP \
+ SYSCALL_ERROR_HANDLER ASM_LINE_SEP \
+ /* Use TREG for temp storage */ ASM_LINE_SEP \
+ copy %ret0, TREG /* delay */ ASM_LINE_SEP \
+ /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \
+ /* do a -1*syscall_ret0 */ ASM_LINE_SEP \
+ sub %r0, TREG, TREG ASM_LINE_SEP \
+ /* Store into errno location */ ASM_LINE_SEP \
+ stw TREG, 0(%sr0,%ret0) ASM_LINE_SEP \
+ /* return -1 as error */ ASM_LINE_SEP \
+ ldi -1, %ret0 ASM_LINE_SEP \
+L(pre_nc_end): ASM_LINE_SEP \
+ /* No need to LOAD_PIC */ ASM_LINE_SEP \
+ /* Undo frame */ ASM_LINE_SEP \
+ ldwm -64(%sp),TREG ASM_LINE_SEP \
+ .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \
+ /* Restore rp before exit */ ASM_LINE_SEP \
+ ldw -20(%sp), %rp ASM_LINE_SEP \
+ .cfi_restore 2 ASM_LINE_SEP \
+ ret ASM_LINE_SEP \
+ END(__##syscall_name##_nocancel) ASM_LINE_SEP \
+ /**********************************************/ASM_LINE_SEP \
ENTRY (name) \
DOARGS_##args ASM_LINE_SEP \
stwm TREG, 64(%sp) ASM_LINE_SEP \
+ .cfi_adjust_cfa_offset 64 ASM_LINE_SEP \
stw %sp, -4(%sp) ASM_LINE_SEP \
+ .cfi_offset 30, -4 ASM_LINE_SEP \
stw %r19, -32(%sp) ASM_LINE_SEP \
+ .cfi_offset 19, -32 ASM_LINE_SEP \
/* Done setting up frame, continue... */ ASM_LINE_SEP \
SINGLE_THREAD_P ASM_LINE_SEP \
cmpib,<>,n 0,%ret0,L(pseudo_cancel) ASM_LINE_SEP \
@@ -128,26 +170,40 @@ L(pre_end): ASM_LINE_SEP \
/* No need to LOAD_PIC */ ASM_LINE_SEP \
/* Undo frame */ ASM_LINE_SEP \
ldwm -64(%sp),TREG ASM_LINE_SEP \
+ .cfi_adjust_cfa_offset -64 ASM_LINE_SEP \
/* Restore rp before exit */ ASM_LINE_SEP \
- ldw -20(%sp), %rp ASM_LINE_SEP
+ ldw -20(%sp), %rp ASM_LINE_SEP \
+ .cfi_restore 2 ASM_LINE_SEP
/* Save arguments into our frame */
# define PUSHARGS_0 /* nothing to do */
-# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP
-# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP
+# define PUSHARGS_1 PUSHARGS_0 stw %r26, -36(%sr0,%sp) ASM_LINE_SEP \
+ .cfi_offset 26, -36 ASM_LINE_SEP
+# define PUSHARGS_2 PUSHARGS_1 stw %r25, -40(%sr0,%sp) ASM_LINE_SEP \
+ .cfi_offset 25, -40 ASM_LINE_SEP
+# define PUSHARGS_3 PUSHARGS_2 stw %r24, -44(%sr0,%sp) ASM_LINE_SEP \
+ .cfi_offset 24, -44 ASM_LINE_SEP
+# define PUSHARGS_4 PUSHARGS_3 stw %r23, -48(%sr0,%sp) ASM_LINE_SEP \
+ .cfi_offset 23, -48 ASM_LINE_SEP
+# define PUSHARGS_5 PUSHARGS_4 stw %r22, -52(%sr0,%sp) ASM_LINE_SEP \
+ .cfi_offset 22, -52 ASM_LINE_SEP
+# define PUSHARGS_6 PUSHARGS_5 stw %r21, -56(%sr0,%sp) ASM_LINE_SEP \
+ .cfi_offset 21, -56 ASM_LINE_SEP
/* Bring them back from the stack */
# define POPARGS_0 /* nothing to do */
-# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP
-# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP
-# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP
-# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP
-# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP
-# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP
+# define POPARGS_1 POPARGS_0 ldw -36(%sr0,%sp), %r26 ASM_LINE_SEP \
+ .cfi_restore 26 ASM_LINE_SEP
+# define POPARGS_2 POPARGS_1 ldw -40(%sr0,%sp), %r25 ASM_LINE_SEP \
+ .cfi_restore 25 ASM_LINE_SEP
+# define POPARGS_3 POPARGS_2 ldw -44(%sr0,%sp), %r24 ASM_LINE_SEP \
+ .cfi_restore 24 ASM_LINE_SEP
+# define POPARGS_4 POPARGS_3 ldw -48(%sr0,%sp), %r23 ASM_LINE_SEP \
+ .cfi_restore 23 ASM_LINE_SEP
+# define POPARGS_5 POPARGS_4 ldw -52(%sr0,%sp), %r22 ASM_LINE_SEP \
+ .cfi_restore 22 ASM_LINE_SEP
+# define POPARGS_6 POPARGS_5 ldw -56(%sr0,%sp), %r21 ASM_LINE_SEP \
+ .cfi_restore 21 ASM_LINE_SEP
# ifdef IS_IN_libpthread
# ifdef PIC
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h
new file mode 100644
index 000000000..1931cc687
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h
@@ -0,0 +1,144 @@
+/* Copyright (C) 2002-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_EPOLL_H
+#define _SYS_EPOLL_H 1
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/* Get __sigset_t. */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+
+/* Flags to be passed to epoll_create1. */
+enum
+ {
+ EPOLL_CLOEXEC = 010000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+ EPOLL_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+ };
+
+
+enum EPOLL_EVENTS
+ {
+ EPOLLIN = 0x001,
+#define EPOLLIN EPOLLIN
+ EPOLLPRI = 0x002,
+#define EPOLLPRI EPOLLPRI
+ EPOLLOUT = 0x004,
+#define EPOLLOUT EPOLLOUT
+ EPOLLRDNORM = 0x040,
+#define EPOLLRDNORM EPOLLRDNORM
+ EPOLLRDBAND = 0x080,
+#define EPOLLRDBAND EPOLLRDBAND
+ EPOLLWRNORM = 0x100,
+#define EPOLLWRNORM EPOLLWRNORM
+ EPOLLWRBAND = 0x200,
+#define EPOLLWRBAND EPOLLWRBAND
+ EPOLLMSG = 0x400,
+#define EPOLLMSG EPOLLMSG
+ EPOLLERR = 0x008,
+#define EPOLLERR EPOLLERR
+ EPOLLHUP = 0x010,
+#define EPOLLHUP EPOLLHUP
+ EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
+ EPOLLONESHOT = (1 << 30),
+#define EPOLLONESHOT EPOLLONESHOT
+ EPOLLET = (1 << 31)
+#define EPOLLET EPOLLET
+ };
+
+
+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
+#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */
+#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */
+#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */
+
+
+typedef union epoll_data
+{
+ void *ptr;
+ int fd;
+ uint32_t u32;
+ uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event
+{
+ uint32_t events; /* Epoll events */
+ epoll_data_t data; /* User data variable */
+};
+
+
+__BEGIN_DECLS
+
+/* Creates an epoll instance. Returns an fd for the new instance.
+ The "size" parameter is a hint specifying the number of file
+ descriptors to be associated with the new instance. The fd
+ returned by epoll_create() should be closed with close(). */
+extern int epoll_create (int __size) __THROW;
+
+/* Same as epoll_create but with an FLAGS parameter. The unused SIZE
+ parameter has been dropped. */
+extern int epoll_create1 (int __flags) __THROW;
+
+
+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+ -1 in case of error ( the "errno" variable will contain the
+ specific error code ) The "op" parameter is one of the EPOLL_CTL_*
+ constants defined above. The "fd" parameter is the target of the
+ operation. The "event" parameter describes which events the caller
+ is interested in and any associated user data. */
+extern int epoll_ctl (int __epfd, int __op, int __fd,
+ struct epoll_event *__event) __THROW;
+
+
+/* Wait for events on an epoll instance "epfd". Returns the number of
+ triggered events returned in "events" buffer. Or -1 in case of
+ error with the "errno" variable set to the specific error code. The
+ "events" parameter is a buffer that will contain triggered
+ events. The "maxevents" is the maximum number of events to be
+ returned ( usually size of "events" ). The "timeout" parameter
+ specifies the maximum wait time in milliseconds (-1 == infinite).
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int epoll_wait (int __epfd, struct epoll_event *__events,
+ int __maxevents, int __timeout);
+
+
+/* Same as epoll_wait, but the thread's signal mask is temporarily
+ and atomically replaced with the one provided as parameter.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
+ int __maxevents, int __timeout,
+ __const __sigset_t *__ss);
+
+__END_DECLS
+
+#endif /* sys/epoll.h */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h
new file mode 100644
index 000000000..751f27675
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_EVENTFD_H
+#define _SYS_EVENTFD_H 1
+
+#include <stdint.h>
+
+
+/* Type for event counter. */
+typedef uint64_t eventfd_t;
+
+/* Flags for signalfd. */
+enum
+ {
+ EFD_SEMAPHORE = 1,
+#define EFD_SEMAPHORE EFD_SEMAPHORE
+ EFD_CLOEXEC = 010000000,
+#define EFD_CLOEXEC EFD_CLOEXEC
+ EFD_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define EFD_NONBLOCK EFD_NONBLOCK
+ };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for generic event channel. Set initial
+ value to COUNT. */
+extern int eventfd (int __count, int __flags) __THROW;
+
+/* Read event counter and possibly wait for events. */
+extern int eventfd_read (int __fd, eventfd_t *__value);
+
+/* Increment event counter. */
+extern int eventfd_write (int __fd, eventfd_t __value);
+
+__END_DECLS
+
+#endif /* sys/eventfd.h */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h
new file mode 100644
index 000000000..080497d7b
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h
@@ -0,0 +1,107 @@
+/* Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_INOTIFY_H
+#define _SYS_INOTIFY_H 1
+
+#include <stdint.h>
+
+
+/* Flags for the parameter of inotify_init1. */
+enum
+ {
+ IN_CLOEXEC = 010000000,
+#define IN_CLOEXEC IN_CLOEXEC
+ IN_NONBLOCK = 000200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define IN_NONBLOCK IN_NONBLOCK
+ };
+
+
+/* Structure describing an inotify event. */
+struct inotify_event
+{
+ int wd; /* Watch descriptor. */
+ uint32_t mask; /* Watch mask. */
+ uint32_t cookie; /* Cookie to synchronize two events. */
+ uint32_t len; /* Length (including NULs) of name. */
+ char name __flexarr; /* Name. */
+};
+
+
+/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */
+#define IN_ACCESS 0x00000001 /* File was accessed. */
+#define IN_MODIFY 0x00000002 /* File was modified. */
+#define IN_ATTRIB 0x00000004 /* Metadata changed. */
+#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed. */
+#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed. */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
+#define IN_OPEN 0x00000020 /* File was opened. */
+#define IN_MOVED_FROM 0x00000040 /* File was moved from X. */
+#define IN_MOVED_TO 0x00000080 /* File was moved to Y. */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
+#define IN_CREATE 0x00000100 /* Subfile was created. */
+#define IN_DELETE 0x00000200 /* Subfile was deleted. */
+#define IN_DELETE_SELF 0x00000400 /* Self was deleted. */
+#define IN_MOVE_SELF 0x00000800 /* Self was moved. */
+
+/* Events sent by the kernel. */
+#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted. */
+#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */
+#define IN_IGNORED 0x00008000 /* File was ignored. */
+
+/* Helper events. */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
+
+/* Special flags. */
+#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a
+ directory. */
+#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */
+#define IN_EXCL_UNLINK 0x04000000 /* Exclude events on unlinked
+ objects. */
+#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already
+ existing watch. */
+#define IN_ISDIR 0x40000000 /* Event occurred against dir. */
+#define IN_ONESHOT 0x80000000 /* Only send event once. */
+
+/* All events which a program can wait on. */
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \
+ | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \
+ | IN_MOVED_TO | IN_CREATE | IN_DELETE \
+ | IN_DELETE_SELF | IN_MOVE_SELF)
+
+
+__BEGIN_DECLS
+
+/* Create and initialize inotify instance. */
+extern int inotify_init (void) __THROW;
+
+/* Create and initialize inotify instance. */
+extern int inotify_init1 (int __flags) __THROW;
+
+/* Add watch of object NAME to inotify instance FD. Notify about
+ events specified by MASK. */
+extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+ __THROW;
+
+/* Remove the watch specified by WD from the inotify instance FD. */
+extern int inotify_rm_watch (int __fd, int __wd) __THROW;
+
+__END_DECLS
+
+#endif /* sys/inotify.h */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
index ca35489f5..0c076337e 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996, 1997, 1999, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999, 2000, 2006, 2011
+ 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
@@ -29,10 +30,8 @@
GDB unless you know what you are doing. */
#include <features.h>
-#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <sys/ucontext.h>
#include <sys/user.h>
__BEGIN_DECLS
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h
new file mode 100644
index 000000000..da8264e7c
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SIGNALFD_H
+#define _SYS_SIGNALFD_H 1
+
+#define __need_sigset_t
+#include <signal.h>
+#include <stdint.h>
+
+
+struct signalfd_siginfo
+{
+ uint32_t ssi_signo;
+ int32_t ssi_errno;
+ int32_t ssi_code;
+ uint32_t ssi_pid;
+ uint32_t ssi_uid;
+ int32_t ssi_fd;
+ uint32_t ssi_tid;
+ uint32_t ssi_band;
+ uint32_t ssi_overrun;
+ uint32_t ssi_trapno;
+ int32_t ssi_status;
+ int32_t ssi_int;
+ uint64_t ssi_ptr;
+ uint64_t ssi_utime;
+ uint64_t ssi_stime;
+ uint64_t ssi_addr;
+ uint8_t __pad[48];
+};
+
+/* Flags for signalfd. */
+enum
+ {
+ SFD_CLOEXEC = 010000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+ SFD_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define SFD_NONBLOCK SFD_NONBLOCK
+ };
+
+__BEGIN_DECLS
+
+/* Request notification for delivery of signals in MASK to be
+ performed using descriptor FD.*/
+extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
+ __THROW __nonnull ((2));
+
+__END_DECLS
+
+#endif /* sys/signalfd.h */
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h b/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h
new file mode 100644
index 000000000..78cdfc478
--- /dev/null
+++ b/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h
@@ -0,0 +1,60 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_TIMERFD_H
+#define _SYS_TIMERFD_H 1
+
+#include <time.h>
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'. */
+enum
+ {
+ TFD_CLOEXEC = 010000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+ TFD_NONBLOCK = 000200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define TFD_NONBLOCK TFD_NONBLOCK
+ };
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */
+enum
+ {
+ TFD_TIMER_ABSTIME = 1 << 0
+#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
+ };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for new interval timer source. */
+extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
+
+/* Set next expiration time of interval timer source UFD to UTMR. If
+ FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
+ absolute. Optionally return the old expiration time in OTMR. */
+extern int timerfd_settime (int __ufd, int __flags,
+ __const struct itimerspec *__utmr,
+ struct itimerspec *__otmr) __THROW;
+
+/* Return the next expiration time of UFD. */
+extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timerfd.h */
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
index d381189fe..28113ac5c 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/m68k/sysdep.h
@@ -106,7 +106,7 @@ SYSCALL_ERROR_LABEL: \
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
-# elif USE___THREAD
+# elif defined _LIBC_REENTRANT
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
@@ -125,18 +125,6 @@ SYSCALL_ERROR_LABEL: \
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
-# elif defined _LIBC_REENTRANT
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_LABEL: \
- neg.l %d0; \
- move.l %d0, -(%sp); \
- jbsr __errno_location@PLTPC; \
- move.l (%sp)+, (%a0); \
- move.l &-1, %d0; \
- /* Copy return value to %a0 for syscalls that are declared to return \
- a pointer (e.g., mmap). */ \
- move.l %d0, %a0; \
- rts;
# else /* !_LIBC_REENTRANT */
/* Store (- %d0) into errno through the GOT. */
# define SYSCALL_ERROR_HANDLER \
diff --git a/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h b/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 239949092..4aacfae99 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -312,7 +312,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
{
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
- return 0;
+ return (struct cmsghdr *) 0;
__cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ CMSG_ALIGN (__cmsg->cmsg_len));
@@ -321,7 +321,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
|| ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
> ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
- return 0;
+ return (struct cmsghdr *) 0;
return __cmsg;
}
#endif /* Use `extern inline'. */