aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2016-11-08 18:41:49 -0500
committerDJ Delorie <dj@delorie.com>2016-11-08 18:44:02 -0500
commit4f460c8944fa682376dfe63ceb39ac4a5a031232 (patch)
tree00c4304114700c78fefbd742a1b3a976a5dd7c15
parent275d577540a54d9fe3a7ae4ac1c73810cd2ee7e5 (diff)
parent3c7f1f59cd1611e0727f9b5ffc32dae78cb05000 (diff)
downloadglibc-4f460c8944fa682376dfe63ceb39ac4a5a031232.tar
glibc-4f460c8944fa682376dfe63ceb39ac4a5a031232.tar.gz
glibc-4f460c8944fa682376dfe63ceb39ac4a5a031232.tar.bz2
glibc-4f460c8944fa682376dfe63ceb39ac4a5a031232.zip
Merge branch 'master' into dj/malloc
-rw-r--r--ChangeLog3637
-rw-r--r--INSTALL17
-rw-r--r--Makeconfig4
-rw-r--r--Makefile23
-rw-r--r--Makerules9
-rw-r--r--NEWS93
-rw-r--r--Rules33
-rw-r--r--argp/argp-fmtstream.h19
-rw-r--r--argp/argp.h46
-rw-r--r--benchtests/Makefile1
-rw-r--r--bits/fenv.h8
-rw-r--r--bits/in.h4
-rw-r--r--bits/iscanonical.h28
-rw-r--r--bits/resource.h3
-rw-r--r--bits/sigcontext.h7
-rw-r--r--bits/sigstack.h7
-rw-r--r--bits/socket.h4
-rw-r--r--bits/time.h54
-rw-r--r--bits/wordsize.h26
-rw-r--r--config.h.in6
-rw-r--r--config.make.in2
-rwxr-xr-xconfigure56
-rw-r--r--configure.ac45
-rw-r--r--conform/Makefile7
-rw-r--r--crypt/sha256-block.c2
-rw-r--r--crypt/sha256.c13
-rw-r--r--crypt/sha512-block.c2
-rw-r--r--crypt/sha512.c14
-rw-r--r--csu/libc-start.c3
-rw-r--r--debug/tst-chk1.c61
-rw-r--r--dlfcn/bug-atexit3-lib.cc12
-rw-r--r--elf/Makefile28
-rw-r--r--elf/dl-addr-obj.c75
-rw-r--r--elf/dl-addr.c16
-rw-r--r--elf/dl-open.c30
-rw-r--r--elf/dl-reloc.c6
-rw-r--r--elf/dl-tls.c4
-rw-r--r--elf/sln.c15
-rw-r--r--elf/tst-_dl_addr_inside_object.c223
-rw-r--r--elf/tst-linkall-static.c45
-rw-r--r--elf/tst-noload.c73
-rw-r--r--gmon/sys/gmon.h30
-rw-r--r--hurd/exc2signal.c24
-rw-r--r--hurd/hurdmalloc.c15
-rw-r--r--hurd/hurdmalloc.h4
-rw-r--r--iconv/gconv.h2
-rw-r--r--iconvdata/ibm930.c9
-rw-r--r--iconvdata/ibm930.h78
-rw-r--r--iconvdata/ibm933.c9
-rw-r--r--iconvdata/ibm933.h64
-rw-r--r--iconvdata/ibm935.c9
-rw-r--r--iconvdata/ibm935.h56
-rw-r--r--iconvdata/ibm939.c9
-rw-r--r--iconvdata/ibm939.h78
-rw-r--r--iconvdata/iso-2022-cn-ext.c12
-rw-r--r--iconvdata/iso646.c84
-rw-r--r--include/aliases.h3
-rw-r--r--include/alloca.h4
-rw-r--r--include/argz.h3
-rw-r--r--include/arpa/nameser.h7
-rw-r--r--include/arpa/nameser_compat.h3
-rw-r--r--include/atomic.h19
-rw-r--r--include/bits/types/clock_t.h1
-rw-r--r--include/bits/types/clockid_t.h1
-rw-r--r--include/bits/types/struct_itimerspec.h1
-rw-r--r--include/bits/types/struct_osockaddr.h1
-rw-r--r--include/bits/types/struct_timespec.h1
-rw-r--r--include/bits/types/struct_timeval.h1
-rw-r--r--include/bits/types/struct_tm.h1
-rw-r--r--include/bits/types/time_t.h1
-rw-r--r--include/bits/types/timer_t.h1
-rw-r--r--include/crypt.h3
-rw-r--r--include/elf.h9
-rw-r--r--include/envz.h3
-rw-r--r--include/err.h6
-rw-r--r--include/execinfo.h3
-rw-r--r--include/fpu_control.h6
-rw-r--r--include/getopt.h5
-rw-r--r--include/gshadow.h3
-rw-r--r--include/ifaddrs.h4
-rw-r--r--include/libc-internal.h15
-rw-r--r--include/libc-symbols.h172
-rw-r--r--include/libintl.h4
-rw-r--r--include/limits.h42
-rw-r--r--include/link.h11
-rw-r--r--include/malloc.h2
-rw-r--r--include/mcheck.h3
-rw-r--r--include/mntent.h3
-rw-r--r--include/netinet/ether.h3
-rw-r--r--include/nss.h3
-rw-r--r--include/obstack.h6
-rw-r--r--include/printf.h4
-rw-r--r--include/pty.h3
-rw-r--r--include/resolv.h37
-rw-r--r--include/rpc/auth.h3
-rw-r--r--include/rpc/auth_des.h3
-rw-r--r--include/rpc/auth_unix.h6
-rw-r--r--include/rpc/clnt.h3
-rw-r--r--include/rpc/des_crypt.h3
-rw-r--r--include/rpc/key_prot.h6
-rw-r--r--include/rpc/netdb.h3
-rw-r--r--include/rpc/pmap_clnt.h7
-rw-r--r--include/rpc/pmap_prot.h6
-rw-r--r--include/rpc/pmap_rmt.h6
-rw-r--r--include/rpc/rpc.h4
-rw-r--r--include/rpc/rpc_msg.h3
-rw-r--r--include/rpc/svc.h3
-rw-r--r--include/rpc/svc_auth.h3
-rw-r--r--include/rpc/xdr.h6
-rw-r--r--include/rpcsvc/nis_callback.h3
-rw-r--r--include/rpcsvc/nislib.h3
-rw-r--r--include/rpcsvc/yp.h3
-rw-r--r--include/rpcsvc/ypclnt.h3
-rw-r--r--include/rpcsvc/ypupd.h3
-rw-r--r--include/shadow.h3
-rw-r--r--include/stdio_ext.h7
-rw-r--r--include/sys/epoll.h3
-rw-r--r--include/sys/file.h4
-rw-r--r--include/sys/gmon.h4
-rw-r--r--include/sys/ioctl.h4
-rw-r--r--include/sys/prctl.h3
-rw-r--r--include/sys/profil.h3
-rw-r--r--include/sys/statfs.h4
-rw-r--r--include/sys/sysctl.h3
-rw-r--r--include/sys/sysinfo.h3
-rw-r--r--include/time.h7
-rw-r--r--include/ttyent.h7
-rw-r--r--include/utmp.h3
-rw-r--r--inet/Makefile6
-rw-r--r--inet/Versions3
-rw-r--r--inet/inet6_scopeid_pton.c63
-rw-r--r--inet/net-internal.h (renamed from sysdeps/hppa/math_private.h)20
-rw-r--r--inet/netinet/ether.h2
-rw-r--r--inet/netinet/icmp6.h12
-rw-r--r--inet/netinet/igmp.h8
-rw-r--r--inet/netinet/ip6.h8
-rw-r--r--inet/protocols/routed.h6
-rw-r--r--inet/protocols/talkd.h22
-rw-r--r--inet/protocols/timed.h6
-rw-r--r--inet/tst-inet6_scopeid_pton.c131
-rw-r--r--intl/dcigettext.c2
-rw-r--r--io/Makefile3
-rw-r--r--io/fcntl.h3
-rw-r--r--io/fts.h20
-rw-r--r--io/sys/poll.h3
-rw-r--r--io/sys/stat.h13
-rw-r--r--io/tst-open-tmpfile.c319
-rw-r--r--io/tst-posix_fallocate-common.c85
-rw-r--r--io/tst-posix_fallocate.c107
-rw-r--r--io/tst-posix_fallocate64.c44
-rw-r--r--io/utime.h3
-rw-r--r--libio/Makefile4
-rw-r--r--libio/memstream.c2
-rw-r--r--libio/strops.c81
-rw-r--r--libio/tst-memstream3.c166
-rw-r--r--libio/tst-wmemstream3.c44
-rw-r--r--libio/wmemstream.c2
-rw-r--r--libio/wstrops.c89
-rw-r--r--locale/weight.h10
-rw-r--r--locale/weightwc.h10
-rw-r--r--localedata/ChangeLog5
-rw-r--r--localedata/locales/lt_LT2
-rw-r--r--mach/errstring.c6
-rw-r--r--mach/mach_error.c4
-rw-r--r--malloc/Makefile29
-rw-r--r--malloc/arena.c62
-rw-r--r--malloc/hooks.c95
-rw-r--r--malloc/malloc.c400
-rw-r--r--malloc/malloc.h7
-rw-r--r--malloc/tst-interpose-aux-nothread.c20
-rw-r--r--malloc/tst-interpose-aux-thread.c20
-rw-r--r--malloc/tst-interpose-aux.c270
-rw-r--r--malloc/tst-interpose-aux.h30
-rw-r--r--malloc/tst-interpose-nothread.c20
-rw-r--r--malloc/tst-interpose-skeleton.c204
-rw-r--r--malloc/tst-interpose-static-nothread.c19
-rw-r--r--malloc/tst-interpose-static-thread.c19
-rw-r--r--malloc/tst-interpose-thread.c20
-rw-r--r--malloc/tst-mallocstate.c505
-rw-r--r--manual/argp.texi10
-rw-r--r--manual/arith.texi261
-rw-r--r--manual/conf.texi10
-rw-r--r--manual/contrib.texi6
-rw-r--r--manual/crypt.texi8
-rw-r--r--manual/debug.texi4
-rw-r--r--manual/examples/memstrm.c4
-rw-r--r--manual/filesys.texi42
-rw-r--r--manual/getopt.texi10
-rw-r--r--manual/install.texi14
-rw-r--r--manual/job.texi2
-rw-r--r--manual/lang.texi86
-rwxr-xr-xmanual/libm-err-tab.pl46
-rw-r--r--manual/llio.texi74
-rw-r--r--manual/maint.texi2
-rw-r--r--manual/math.texi40
-rw-r--r--manual/memory.texi175
-rw-r--r--manual/nss.texi81
-rw-r--r--manual/probes.texi4
-rw-r--r--manual/process.texi2
-rw-r--r--manual/resource.texi52
-rw-r--r--manual/setjmp.texi8
-rw-r--r--manual/signal.texi6
-rw-r--r--manual/socket.texi28
-rw-r--r--manual/startup.texi8
-rw-r--r--manual/stdio.texi83
-rw-r--r--manual/string.texi69
-rw-r--r--manual/sysinfo.texi50
-rw-r--r--manual/syslog.texi4
-rw-r--r--manual/terminal.texi18
-rw-r--r--manual/threads.texi2
-rw-r--r--manual/time.texi38
-rw-r--r--manual/users.texi33
-rw-r--r--math/Makefile78
-rw-r--r--math/Versions8
-rw-r--r--math/bits/mathcalls.h17
-rw-r--r--math/cabs.c32
-rw-r--r--math/cabs_template.c (renamed from math/s_cpow.c)18
-rw-r--r--math/cabsf.c28
-rw-r--r--math/cabsl.c28
-rw-r--r--math/carg_template.c (renamed from math/carg.c)17
-rw-r--r--math/cargf.c28
-rw-r--r--math/cimag_template.c (renamed from math/cimag.c)15
-rw-r--r--math/conj_template.c (renamed from math/conj.c)15
-rw-r--r--math/conjl.c27
-rw-r--r--math/creal_template.c (renamed from math/creal.c)15
-rw-r--r--math/creall.c27
-rw-r--r--math/fegetmode.c (renamed from math/crealf.c)16
-rw-r--r--math/fenv.h33
-rw-r--r--math/fesetexcept.c (renamed from math/cimagf.c)16
-rw-r--r--math/fesetmode.c27
-rw-r--r--math/fetestexceptflag.c27
-rwxr-xr-xmath/gen-libm-test.pl9
-rw-r--r--math/k_casinh.c210
-rw-r--r--math/k_casinh_template.c205
-rw-r--r--math/k_casinhf.c212
-rw-r--r--math/k_casinhl.c219
-rw-r--r--math/k_rem_pio2l.c15
-rw-r--r--math/libm-test.inc920
-rw-r--r--math/math.h68
-rw-r--r--math/mul_split.h50
-rw-r--r--math/mul_splitl.h50
-rw-r--r--math/s_cacos.c58
-rw-r--r--math/s_cacos_template.c (renamed from math/s_cacosf.c)27
-rw-r--r--math/s_cacosh_template.c (renamed from math/s_cacosh.c)50
-rw-r--r--math/s_cacoshf.c92
-rw-r--r--math/s_cacoshl.c90
-rw-r--r--math/s_cacosl.c54
-rw-r--r--math/s_canonicalize_template.c37
-rw-r--r--math/s_casin.c66
-rw-r--r--math/s_casin_template.c (renamed from math/s_casinf.c)29
-rw-r--r--math/s_casinh_template.c (renamed from math/s_casinh.c)34
-rw-r--r--math/s_casinhf.c71
-rw-r--r--math/s_casinhl.c69
-rw-r--r--math/s_casinl.c62
-rw-r--r--math/s_catan.c143
-rw-r--r--math/s_catan_template.c145
-rw-r--r--math/s_catanf.c143
-rw-r--r--math/s_catanh.c137
-rw-r--r--math/s_catanh_template.c139
-rw-r--r--math/s_catanhf.c137
-rw-r--r--math/s_catanhl.c141
-rw-r--r--math/s_catanl.c147
-rw-r--r--math/s_ccos.c40
-rw-r--r--math/s_ccos_template.c (renamed from math/s_ccosf.c)18
-rw-r--r--math/s_ccosh.c147
-rw-r--r--math/s_ccosh_template.c (renamed from math/s_ccoshf.c)82
-rw-r--r--math/s_ccoshl.c143
-rw-r--r--math/s_cexp.c157
-rw-r--r--math/s_cexp_template.c (renamed from math/s_cexpf.c)65
-rw-r--r--math/s_cexpl.c153
-rw-r--r--math/s_clog.c118
-rw-r--r--math/s_clog10.c124
-rw-r--r--math/s_clog10_template.c128
-rw-r--r--math/s_clog10f.c122
-rw-r--r--math/s_clog10l.c127
-rw-r--r--math/s_clog_template.c (renamed from math/s_clogf.c)81
-rw-r--r--math/s_clogl.c121
-rw-r--r--math/s_cpow_template.c (renamed from math/s_cpowf.c)16
-rw-r--r--math/s_cpowl.c29
-rw-r--r--math/s_cproj_template.c (renamed from math/s_cprojf.c)17
-rw-r--r--math/s_cprojl.c40
-rw-r--r--math/s_csin.c171
-rw-r--r--math/s_csin_template.c (renamed from math/s_csinf.c)84
-rw-r--r--math/s_csinh.c166
-rw-r--r--math/s_csinh_template.c (renamed from math/s_csinhf.c)84
-rw-r--r--math/s_csinhl.c162
-rw-r--r--math/s_csinl.c167
-rw-r--r--math/s_csqrt.c165
-rw-r--r--math/s_csqrt_template.c (renamed from math/s_csqrtf.c)103
-rw-r--r--math/s_csqrtl.c161
-rw-r--r--math/s_ctan.c129
-rw-r--r--math/s_ctan_template.c (renamed from math/s_ctanf.c)67
-rw-r--r--math/s_ctanh.c129
-rw-r--r--math/s_ctanh_template.c (renamed from math/s_ctanhf.c)67
-rw-r--r--math/s_ctanhl.c132
-rw-r--r--math/s_ctanl.c132
-rw-r--r--math/s_fdim_template.c (renamed from math/s_fdimf.c)14
-rw-r--r--math/s_fdiml.c35
-rw-r--r--math/s_fmax_template.c (renamed from math/s_fmax.c)14
-rw-r--r--math/s_fmaxl.c28
-rw-r--r--math/s_fmin_template.c (renamed from math/s_fmin.c)12
-rw-r--r--math/s_iscanonicall.c1
-rw-r--r--math/s_iseqsig_template.c (renamed from math/s_fdim.c)41
-rw-r--r--math/s_ldexp_template.c (renamed from math/s_ldexp.c)20
-rw-r--r--math/s_ldexpf.c32
-rw-r--r--math/s_ldexpl.c33
-rw-r--r--math/s_nan_template.c (renamed from math/s_nan.c)16
-rw-r--r--math/s_nanf.c33
-rw-r--r--math/s_nextdown_template.c (renamed from math/s_nextdownf.c)8
-rw-r--r--math/test-double.h1
-rw-r--r--math/test-femode-traps.c149
-rw-r--r--math/test-femode.c231
-rw-r--r--math/test-fesetexcept-traps.c68
-rw-r--r--math/test-fesetexcept.c129
-rw-r--r--math/test-fetestexceptflag.c130
-rw-r--r--math/test-float.h1
-rw-r--r--math/test-iseqsig-excess-precision.c80
-rw-r--r--math/test-iszero-excess-precision.c49
-rw-r--r--math/test-ldouble.h1
-rw-r--r--math/test-math-iszero.cc87
-rw-r--r--math/test-nan-overflow.c1
-rw-r--r--math/test-tgmath.c22
-rw-r--r--math/test-tgmath2.c131
-rw-r--r--math/tgmath.h10
-rw-r--r--misc/getauxval.c2
-rw-r--r--misc/sys/cdefs.h40
-rw-r--r--misc/sys/select.h8
-rw-r--r--misc/tsearch.c398
-rw-r--r--nis/rpcsvc/nislib.h2
-rw-r--r--nptl/Makefile25
-rw-r--r--nptl/allocatestack.c9
-rw-r--r--nptl/pt-longjmp.c24
-rw-r--r--nptl/pt-system.c19
-rw-r--r--nptl/pt-vfork.c22
-rw-r--r--nptl/pthreadP.h2
-rw-r--r--nptl/pthread_rwlock_unlock.c4
-rw-r--r--nptl/pthread_testcancel.c4
-rw-r--r--nptl/sem_init.c2
-rw-r--r--nptl/sem_open.c27
-rw-r--r--nptl/sem_timedwait.c3
-rw-r--r--nptl/sem_wait.c13
-rw-r--r--nptl/tst-basic1.c15
-rw-r--r--nptl/tst-cancel12.c29
-rw-r--r--nptl/tst-cancel13.c23
-rw-r--r--nptl/tst-cancel14.c17
-rw-r--r--nptl/tst-cancel15.c23
-rw-r--r--nptl/tst-cleanup1.c11
-rw-r--r--nptl/tst-cleanup3.c11
-rw-r--r--nptl/tst-cond3.c19
-rw-r--r--nptl/tst-eintr1.c16
-rw-r--r--nptl/tst-eintr2.c11
-rw-r--r--nptl/tst-eintr3.c20
-rw-r--r--nptl/tst-eintr4.c20
-rw-r--r--nptl/tst-eintr5.c19
-rw-r--r--nptl/tst-exec5.c176
-rw-r--r--nptl/tst-exit2.c10
-rw-r--r--nptl/tst-exit3.c10
-rw-r--r--nptl/tst-key1.c11
-rw-r--r--nptl/tst-key2.c23
-rw-r--r--nptl/tst-key3.c31
-rw-r--r--nptl/tst-kill3.c13
-rw-r--r--nptl/tst-kill6.c15
-rw-r--r--nptl/tst-mutex6.c17
-rw-r--r--nptl/tst-once5.cc2
-rw-r--r--nptl/tst-rwlock5.c14
-rw-r--r--nptl/tst-sem16.c130
-rw-r--r--nptl/tst-sem2.c12
-rw-r--r--nptl/tst-spin3.c13
-rw-r--r--nptl/tst-stdio1.c16
-rw-r--r--nptl/tst-stdio2.c11
-rw-r--r--nptl/tst-tls2.c15
-rw-r--r--nptl/tst-tls3-malloc.c161
-rw-r--r--nptl/tst-tls3.c23
-rw-r--r--nptl_db/thread_db.h2
-rw-r--r--nptl_db/thread_dbP.h10
-rw-r--r--nscd/aicache.c3
-rw-r--r--nss/getXXbyYY_r.c3
-rw-r--r--posix/Makefile5
-rw-r--r--posix/glob.c65
-rw-r--r--posix/glob.h2
-rwxr-xr-xposix/globtest.sh16
-rw-r--r--posix/sched.h9
-rw-r--r--posix/sys/times.h4
-rw-r--r--posix/sys/types.h9
-rw-r--r--posix/tst-posix_fadvise-common.c103
-rw-r--r--posix/tst-posix_fadvise.c25
-rw-r--r--posix/tst-posix_fadvise64.c46
-rw-r--r--posix/tst-spawn3.c189
-rw-r--r--resolv/Makefile5
-rw-r--r--resolv/arpa/nameser.h253
-rw-r--r--resolv/arpa/nameser_compat.h11
-rw-r--r--resolv/compat-hooks.c56
-rw-r--r--resolv/gethnamaddr.c6
-rw-r--r--resolv/herror.c4
-rw-r--r--resolv/netdb.h3
-rw-r--r--resolv/ns_name.c256
-rw-r--r--resolv/ns_print.c198
-rw-r--r--resolv/nss_dns/dns-host.c22
-rw-r--r--resolv/res_comp.c2
-rw-r--r--resolv/res_data.c10
-rw-r--r--resolv/res_debug.c183
-rw-r--r--resolv/res_hconf.c3
-rw-r--r--resolv/res_hconf.h9
-rw-r--r--resolv/res_init.c37
-rw-r--r--resolv/res_send.c94
-rw-r--r--resolv/resolv.h156
-rw-r--r--rt/Makefile2
-rw-r--r--rt/aio.h3
-rw-r--r--rt/clock-compat.c34
-rw-r--r--rt/mqueue.h3
-rw-r--r--rt/tst-shm-cancel.c130
-rw-r--r--scripts/check-installed-headers.sh174
-rwxr-xr-xscripts/check-local-headers.sh2
-rw-r--r--scripts/sysd-rules.awk4
-rw-r--r--signal/signal.h3
-rw-r--r--socket/Makefile3
-rw-r--r--socket/bits/types/struct_osockaddr.h12
-rw-r--r--socket/sys/socket.h8
-rw-r--r--soft-fp/extended.h4
-rw-r--r--soft-fp/extendhftf2.c53
-rw-r--r--soft-fp/fixhfti.c45
-rw-r--r--soft-fp/fixunshfti.c45
-rw-r--r--soft-fp/floattihf.c45
-rw-r--r--soft-fp/floatuntihf.c45
-rw-r--r--soft-fp/half.h170
-rw-r--r--soft-fp/trunctfhf2.c52
-rw-r--r--stdio-common/tst-printf.c5
-rw-r--r--stdio-common/vfprintf.c2
-rw-r--r--stdio-common/vfscanf.c37
-rw-r--r--stdlib/Makefile12
-rw-r--r--stdlib/Versions4
-rw-r--r--stdlib/bits/stdlib-ldbl.h4
-rw-r--r--stdlib/bug-strtod.c6
-rw-r--r--stdlib/bug-strtod2.c2
-rw-r--r--stdlib/gen-tst-strtod-round.c4
-rw-r--r--stdlib/stdlib.h18
-rw-r--r--stdlib/strfrom-skeleton.c149
-rw-r--r--stdlib/strfromd.c22
-rw-r--r--stdlib/strfromf.c22
-rw-r--r--stdlib/strfroml.c22
-rw-r--r--stdlib/strtod_l.c14
-rw-r--r--stdlib/tst-strfrom-locale.c91
-rw-r--r--stdlib/tst-strfrom.c91
-rw-r--r--stdlib/tst-strfrom.h120
-rw-r--r--stdlib/tst-strtod-round-data.h26
-rw-r--r--stdlib/tst-strtod-round-skeleton.c252
-rw-r--r--stdlib/tst-strtod-round.c206
-rw-r--r--stdlib/tst-strtod.h7
-rw-r--r--stdlib/tst-strtod6.c2
-rw-r--r--stdlib/tst-width-stdint.c185
-rw-r--r--stdlib/tst-width.c87
-rw-r--r--string/Makefile2
-rw-r--r--string/bits/string3.h2
-rw-r--r--string/strcoll_l.c13
-rw-r--r--string/tst-cmp.c212
-rw-r--r--sunrpc/rpc/rpc_des.h8
-rw-r--r--sysdeps/aarch64/bits/fenv.h8
-rw-r--r--sysdeps/aarch64/bits/wordsize.h (renamed from math/s_fminf.c)22
-rw-r--r--sysdeps/aarch64/fpu/fegetmode.c27
-rw-r--r--sysdeps/aarch64/fpu/fesetexcept.c (renamed from sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c)24
-rw-r--r--sysdeps/aarch64/fpu/fesetmode.c34
-rw-r--r--sysdeps/aarch64/fpu/s_fmax.c2
-rw-r--r--sysdeps/aarch64/fpu/s_fmaxf.c2
-rw-r--r--sysdeps/aarch64/fpu/s_fminf.c2
-rw-r--r--sysdeps/aarch64/libm-test-ulps-name1
-rw-r--r--sysdeps/aarch64/memchr.S157
-rw-r--r--sysdeps/aarch64/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/alpha/fpu/bits/fenv.h8
-rw-r--r--sysdeps/alpha/fpu/fegetmode.c33
-rw-r--r--sysdeps/alpha/fpu/feholdexcpt.c2
-rw-r--r--sysdeps/alpha/fpu/fesetexcept.c31
-rw-r--r--sysdeps/alpha/fpu/fesetmode.c44
-rw-r--r--sysdeps/alpha/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/alpha/fpu/s_cacosf.c11
-rw-r--r--sysdeps/alpha/fpu/s_cacoshf.c10
-rw-r--r--sysdeps/alpha/fpu/s_casinf.c12
-rw-r--r--sysdeps/alpha/fpu/s_casinhf.c12
-rw-r--r--sysdeps/alpha/fpu/s_catanf.c12
-rw-r--r--sysdeps/alpha/fpu/s_catanhf.c12
-rw-r--r--sysdeps/alpha/fpu/s_ccosf.c12
-rw-r--r--sysdeps/alpha/fpu/s_ccoshf.c12
-rw-r--r--sysdeps/alpha/fpu/s_cexpf.c12
-rw-r--r--sysdeps/alpha/fpu/s_clog10f.c12
-rw-r--r--sysdeps/alpha/fpu/s_clogf.c12
-rw-r--r--sysdeps/alpha/fpu/s_cpowf.c12
-rw-r--r--sysdeps/alpha/fpu/s_cprojf.c12
-rw-r--r--sysdeps/alpha/fpu/s_csinf.c12
-rw-r--r--sysdeps/alpha/fpu/s_csinhf.c12
-rw-r--r--sysdeps/alpha/fpu/s_csqrtf.c12
-rw-r--r--sysdeps/alpha/fpu/s_ctanf.c12
-rw-r--r--sysdeps/alpha/fpu/s_ctanhf.c12
-rw-r--r--sysdeps/arm/bits/fenv.h8
-rw-r--r--sysdeps/arm/e_sqrt.c45
-rw-r--r--sysdeps/arm/e_sqrtf.c45
-rw-r--r--sysdeps/arm/fegetmode.c29
-rw-r--r--sysdeps/arm/fesetexcept.c38
-rw-r--r--sysdeps/arm/fesetmode.c45
-rw-r--r--sysdeps/arm/libm-test-ulps-name1
-rw-r--r--sysdeps/arm/nacl/include/bits/setjmp.h3
-rw-r--r--sysdeps/arm/nacl/libc.abilist3
-rw-r--r--sysdeps/arm/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/arm/sys/ucontext.h6
-rw-r--r--sysdeps/generic/fix-fp-int-compare-invalid.h27
-rw-r--r--sysdeps/generic/libm-test-ulps-name1
-rw-r--r--sysdeps/generic/math-tests.h8
-rw-r--r--sysdeps/generic/math-type-macros-double.h50
-rw-r--r--sysdeps/generic/math-type-macros-float.h36
-rw-r--r--sysdeps/generic/math-type-macros-ldouble.h33
-rw-r--r--sysdeps/generic/math-type-macros.h136
-rw-r--r--sysdeps/generic/math_private.h9
-rw-r--r--sysdeps/generic/nan-high-order-bit.h27
-rw-r--r--sysdeps/generic/netinet/if_ether.h2
-rw-r--r--sysdeps/generic/netinet/in_systm.h8
-rw-r--r--sysdeps/generic/netinet/ip.h46
-rw-r--r--sysdeps/generic/netinet/tcp.h34
-rw-r--r--sysdeps/generic/stdint.h57
-rw-r--r--sysdeps/generic/sys/ucontext.h6
-rw-r--r--sysdeps/gnu/bits/utmp.h4
-rw-r--r--sysdeps/gnu/bits/utmpx.h2
-rw-r--r--sysdeps/gnu/netinet/ip_icmp.h56
-rw-r--r--sysdeps/gnu/netinet/tcp.h178
-rw-r--r--sysdeps/gnu/netinet/udp.h19
-rw-r--r--sysdeps/hppa/fpu/bits/fenv.h8
-rw-r--r--sysdeps/hppa/fpu/fegetmode.c27
-rw-r--r--sysdeps/hppa/fpu/fesetexcept.c35
-rw-r--r--sysdeps/hppa/fpu/fesetmode.c36
-rw-r--r--sysdeps/hppa/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/hppa/nan-high-order-bit.h27
-rw-r--r--sysdeps/hppa/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/i386/dl-machine.h18
-rw-r--r--sysdeps/i386/fpu/fegetmode.c32
-rw-r--r--sysdeps/i386/fpu/fesetexcept.c31
-rw-r--r--sysdeps/i386/fpu/fesetmode.c54
-rw-r--r--sysdeps/i386/fpu/k_rem_pio2l.c3
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/i386/i686/Makefile2
-rw-r--r--sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name1
-rw-r--r--sysdeps/i386/sys/ucontext.h6
-rw-r--r--sysdeps/ia64/bits/fenv.h8
-rw-r--r--sysdeps/ia64/fpu/fegetmode.c26
-rw-r--r--sysdeps/ia64/fpu/fesetexcept.c31
-rw-r--r--sysdeps/ia64/fpu/fesetmode.c42
-rw-r--r--sysdeps/ia64/fpu/k_rem_pio2l.c1
-rw-r--r--sysdeps/ia64/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/ia64/nptl/Makefile3
-rw-r--r--sysdeps/ia64/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/ieee754/dbl-64/dla.h4
-rw-r--r--sysdeps/ieee754/dbl-64/e_pow.c8
-rw-r--r--sysdeps/ieee754/dbl-64/gamma_product.c32
-rw-r--r--sysdeps/ieee754/dbl-64/k_rem_pio2.c10
-rw-r--r--sysdeps/ieee754/dbl-64/lgamma_product.c32
-rw-r--r--sysdeps/ieee754/dbl-64/s_getpayload.c37
-rw-r--r--sysdeps/ieee754/dbl-64/s_issignaling.c3
-rw-r--r--sysdeps/ieee754/dbl-64/s_sin.c545
-rw-r--r--sysdeps/ieee754/dbl-64/s_sincos.c8
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalorder.c54
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalordermag.c49
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c (renamed from math/s_nextdownl.c)18
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c3
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c50
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c47
-rw-r--r--sysdeps/ieee754/dbl-64/x2y2m1.c32
-rw-r--r--sysdeps/ieee754/flt-32/k_rem_pio2f.c10
-rw-r--r--sysdeps/ieee754/flt-32/s_getpayloadf.c (renamed from math/s_nextdown.c)22
-rw-r--r--sysdeps/ieee754/flt-32/s_issignalingf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_totalorderf.c46
-rw-r--r--sysdeps/ieee754/flt-32/s_totalordermagf.c (renamed from math/s_cproj.c)42
-rw-r--r--sysdeps/ieee754/ldbl-128/e_acoshl.c16
-rw-r--r--sysdeps/ieee754/ldbl-128/e_acosl.c148
-rw-r--r--sysdeps/ieee754/ldbl-128/e_asinl.c103
-rw-r--r--sysdeps/ieee754/ldbl-128/e_atan2l.c26
-rw-r--r--sysdeps/ieee754/ldbl-128/e_atanhl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/e_coshl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/e_exp10l.c16
-rw-r--r--sysdeps/ieee754/ldbl-128/e_expl.c46
-rw-r--r--sysdeps/ieee754/ldbl-128/e_fmodl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/e_gammal_r.c118
-rw-r--r--sysdeps/ieee754/ldbl-128/e_hypotl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128/e_ilogbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j0l.c860
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j1l.c858
-rw-r--r--sysdeps/ieee754/ldbl-128/e_jnl.c68
-rw-r--r--sysdeps/ieee754/ldbl-128/e_lgammal_r.c928
-rw-r--r--sysdeps/ieee754/ldbl-128/e_log10l.c134
-rw-r--r--sysdeps/ieee754/ldbl-128/e_log2l.c128
-rw-r--r--sysdeps/ieee754/ldbl-128/e_logl.c240
-rw-r--r--sysdeps/ieee754/ldbl-128/e_powl.c106
-rw-r--r--sysdeps/ieee754/ldbl-128/e_rem_pio2l.c14
-rw-r--r--sysdeps/ieee754/ldbl-128/e_remainderl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/e_sinhl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/gamma_productl.c42
-rw-r--r--sysdeps/ieee754/ldbl-128/k_cosl.c48
-rw-r--r--sysdeps/ieee754/ldbl-128/k_sincosl.c62
-rw-r--r--sysdeps/ieee754/ldbl-128/k_sinl.c48
-rw-r--r--sysdeps/ieee754/ldbl-128/k_tanl.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/lgamma_negl.c758
-rw-r--r--sysdeps/ieee754/ldbl-128/lgamma_productl.c60
-rw-r--r--sysdeps/ieee754/ldbl-128/math_ldbl.h8
-rw-r--r--sysdeps/ieee754/ldbl-128/s_asinhl.c14
-rw-r--r--sysdeps/ieee754/ldbl-128/s_atanl.c202
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cbrtl.c30
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ceill.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_copysignl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cosl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_erfl.c916
-rw-r--r--sysdeps/ieee754/ldbl-128/s_expm1l.c54
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fabsl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_finitel.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_floorl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fmal.c54
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fpclassifyl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_frexpl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_getpayloadl.c57
-rw-r--r--sysdeps/ieee754/ldbl-128/s_isinfl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_isnanl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_issignalingl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_llrintl.c20
-rw-r--r--sysdeps/ieee754/ldbl-128/s_llroundl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_log1pl.c118
-rw-r--r--sysdeps/ieee754/ldbl-128/s_logbl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lrintl.c22
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lroundl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_modfl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nearbyintl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nextafterl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nextupl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_remquol.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/s_rintl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_roundl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_scalblnl.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/s_scalbnl.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/s_signbitl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sincosl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sinl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanhl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_totalorderl.c54
-rw-r--r--sysdeps/ieee754/ldbl-128/s_totalordermagl.c48
-rw-r--r--sysdeps/ieee754/ldbl-128/s_truncl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/t_expl.h1862
-rw-r--r--sysdeps/ieee754/ldbl-128/t_sincosl.c669
-rw-r--r--sysdeps/ieee754/ldbl-128/x2y2m1l.c55
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/Makefile3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h39
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_expl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j0l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j1l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fmal.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c34
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c60
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c62
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c64
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c230
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c73
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c32
-rw-r--r--sysdeps/ieee754/ldbl-96/Makefile21
-rw-r--r--sysdeps/ieee754/ldbl-96/bits/iscanonical.h35
-rw-r--r--sysdeps/ieee754/ldbl-96/gamma_productl.c34
-rw-r--r--sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h5
-rw-r--r--sysdeps/ieee754/ldbl-96/lgamma_productl.c36
-rw-r--r--sysdeps/ieee754/ldbl-96/s_getpayloadl.c (renamed from math/cargl.c)18
-rw-r--r--sysdeps/ieee754/ldbl-96/s_iscanonicall.c44
-rw-r--r--sysdeps/ieee754/ldbl-96/s_issignalingl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_totalorderl.c57
-rw-r--r--sysdeps/ieee754/ldbl-96/s_totalordermagl.c51
-rw-r--r--sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c141
-rw-r--r--sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c82
-rw-r--r--sysdeps/ieee754/ldbl-96/x2y2m1l.c36
-rw-r--r--sysdeps/ieee754/ldbl-opt/Makefile8
-rw-r--r--sysdeps/ieee754/ldbl-opt/cabs.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cabsl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/carg.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cargl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cimag.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cimagl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/conj.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/conjl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/creal.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/creall.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/math-type-macros-double.h66
-rw-r--r--sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h31
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacos.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacosh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacosl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_canonicalizel.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casin.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catan.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccos.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccosh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccosl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cexp.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cexpl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog10.c7
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog10l.c35
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clogl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cpow.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cpowl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cproj.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cprojl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csin.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csqrt.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csqrtl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctan.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdim.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdiml.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmax.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmaxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmin.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fminl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexp.c25
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexpl.c27
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nanl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nextdownl.c5
-rw-r--r--sysdeps/m68k/coldfire/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/m68k/fpu/bits/fenv.h8
-rw-r--r--sysdeps/m68k/fpu/fegetmode.c27
-rw-r--r--sysdeps/m68k/fpu/fesetexcept.c (renamed from math/s_fminl.c)21
-rw-r--r--sysdeps/m68k/fpu/fesetmode.c32
-rw-r--r--sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccosh_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_ccosh.c)18
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccoshf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_ccoshl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexp_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_cexp.c)15
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexpf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_cexpl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csin_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_csin.c)18
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinh_template.c (renamed from sysdeps/m68k/m680x0/fpu/s_csinh.c)17
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinhf.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinhl.c3
-rw-r--r--sysdeps/m68k/m680x0/fpu/s_csinl.c3
-rw-r--r--sysdeps/m68k/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/m68k/sys/ucontext.h6
-rw-r--r--sysdeps/mach/hurd/adjtime.c4
-rw-r--r--sysdeps/mach/hurd/bits/socket.h4
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c3
-rw-r--r--sysdeps/mach/hurd/fork.c19
-rw-r--r--sysdeps/mach/hurd/i386/bits/sigcontext.h7
-rw-r--r--sysdeps/mach/hurd/malloc-machine.h21
-rw-r--r--sysdeps/mach/hurd/net/ethernet.h8
-rw-r--r--sysdeps/mach/hurd/net/if_arp.h2
-rw-r--r--sysdeps/mach/hurd/net/if_ppp.h7
-rw-r--r--sysdeps/mach/hurd/net/route.h12
-rw-r--r--sysdeps/mach/i386/syscall.S3
-rw-r--r--sysdeps/mach/sys/reboot.h6
-rw-r--r--sysdeps/microblaze/bits/fenv.h8
-rw-r--r--sysdeps/microblaze/libm-test-ulps-name1
-rw-r--r--sysdeps/microblaze/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/mips/Makefile1
-rw-r--r--sysdeps/mips/bits/fenv.h8
-rw-r--r--sysdeps/mips/bits/wordsize.h10
-rw-r--r--sysdeps/mips/fpu/fegetmode.c27
-rw-r--r--sysdeps/mips/fpu/fesetexcept.c (renamed from math/conjf.c)21
-rw-r--r--sysdeps/mips/fpu/fesetmode.c38
-rw-r--r--sysdeps/mips/include/sys/asm.h6
-rw-r--r--sysdeps/mips/localplt.data3
-rw-r--r--sysdeps/mips/math-tests.h6
-rw-r--r--sysdeps/mips/math_private.h8
-rw-r--r--sysdeps/mips/mips32/libm-test-ulps-name1
-rw-r--r--sysdeps/mips/mips64/libm-test-ulps-name1
-rw-r--r--sysdeps/mips/nan-high-order-bit.h (renamed from sysdeps/unix/sysv/linux/wordsize-64/fallocate.c)28
-rw-r--r--sysdeps/mips/nptl/Makefile1
-rw-r--r--sysdeps/mips/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/mips/sys/ucontext.h9
-rw-r--r--sysdeps/nacl/Makefile3
-rw-r--r--sysdeps/nacl/clock.c2
-rw-r--r--sysdeps/nacl/dup.c1
-rw-r--r--sysdeps/nacl/libm.abilist19
-rw-r--r--sysdeps/nios2/bits/fenv.h8
-rw-r--r--sysdeps/nios2/libm-test-ulps-name1
-rw-r--r--sysdeps/nios2/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/nptl/Makeconfig4
-rw-r--r--sysdeps/nptl/fork.c6
-rw-r--r--sysdeps/nptl/malloc-machine.h8
-rw-r--r--sysdeps/nptl/pthread.h1
-rw-r--r--sysdeps/posix/dup.c2
-rw-r--r--sysdeps/posix/getaddrinfo.c34
-rw-r--r--sysdeps/posix/shm_open.c7
-rw-r--r--sysdeps/posix/wait3.c2
-rw-r--r--sysdeps/powerpc/Versions3
-rw-r--r--sysdeps/powerpc/bits/fenv.h9
-rw-r--r--sysdeps/powerpc/fpu/fegetmode.c26
-rw-r--r--sysdeps/powerpc/fpu/fenv_const.c4
-rw-r--r--sysdeps/powerpc/fpu/fenv_private.h156
-rw-r--r--sysdeps/powerpc/fpu/fesetexcept.c42
-rw-r--r--sysdeps/powerpc/fpu/fesetmode.c49
-rw-r--r--sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h28
-rw-r--r--sysdeps/powerpc/fpu/libm-test-ulps110
-rw-r--r--sysdeps/powerpc/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/powerpc/nofpu/fegetmode.c33
-rw-r--r--sysdeps/powerpc/nofpu/fenv_const.c4
-rw-r--r--sysdeps/powerpc/nofpu/fesetexcept.c (renamed from math/s_fmaxf.c)18
-rw-r--r--sysdeps/powerpc/nofpu/fesetmode.c34
-rw-r--r--sysdeps/powerpc/nofpu/libm-test-ulps-name1
-rw-r--r--sysdeps/powerpc/nptl/elide.h3
-rw-r--r--sysdeps/powerpc/powerpc32/bits/wordsize.h3
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c37
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c4
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c37
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c (renamed from sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c)34
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c25
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_copysignl.S23
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c16
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c10
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c16
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c10
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c24
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c17
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c10
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c23
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c10
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c15
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/memset.c14
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c11
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c12
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c10
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c12
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c13
-rw-r--r--sysdeps/powerpc/powerpc32/power6/memset.S2
-rw-r--r--sysdeps/powerpc/powerpc32/power9/multiarch/Implies2
-rw-r--r--sysdeps/powerpc/powerpc32/ppc-mcount.S27
-rw-r--r--sysdeps/powerpc/powerpc64/bits/wordsize.h3
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c20
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c14
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c20
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c14
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c32
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c25
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_copysignl.S10
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp.c14
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/mempcpy.c15
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c10
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy.c13
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpncpy.c17
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat.c14
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr.c12
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy.c14
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp.c20
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncpy.c16
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen.c14
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr.c10
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strstr.c10
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/wcschr.c17
-rw-r--r--sysdeps/powerpc/powerpc64/power6/memset.S2
-rw-r--r--sysdeps/powerpc/powerpc64/power9/fpu/Implies1
-rw-r--r--sysdeps/powerpc/sys/platform/ppc.h18
-rw-r--r--sysdeps/pthread/semaphore.h3
-rw-r--r--sysdeps/s390/configure36
-rw-r--r--sysdeps/s390/configure.ac26
-rw-r--r--sysdeps/s390/fpu/bits/fenv.h8
-rw-r--r--sysdeps/s390/fpu/fegetmode.c27
-rw-r--r--sysdeps/s390/fpu/fesetexcept.c33
-rw-r--r--sysdeps/s390/fpu/fesetmode.c (renamed from math/s_ccosl.c)29
-rw-r--r--sysdeps/s390/fpu/fetestexceptflag.c31
-rw-r--r--sysdeps/s390/fpu/fix-fp-int-compare-invalid.h36
-rw-r--r--sysdeps/s390/fpu/fraiseexcpt.c41
-rw-r--r--sysdeps/s390/fpu/fsetexcptflg.c3
-rw-r--r--sysdeps/s390/fpu/libm-test-ulps10
-rw-r--r--sysdeps/s390/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/s390/multiarch/ifunc-resolve.h77
-rw-r--r--sysdeps/s390/multiarch/memchr.c5
-rw-r--r--sysdeps/s390/multiarch/mempcpy.c12
-rw-r--r--sysdeps/s390/multiarch/rawmemchr.c5
-rw-r--r--sysdeps/s390/multiarch/stpcpy.c9
-rw-r--r--sysdeps/s390/multiarch/stpncpy.c6
-rw-r--r--sysdeps/s390/multiarch/strcat.c4
-rw-r--r--sysdeps/s390/multiarch/strchr.c6
-rw-r--r--sysdeps/s390/multiarch/strcmp.c7
-rw-r--r--sysdeps/s390/multiarch/strcpy.c5
-rw-r--r--sysdeps/s390/multiarch/strcspn.c6
-rw-r--r--sysdeps/s390/multiarch/strlen.c4
-rw-r--r--sysdeps/s390/multiarch/strncmp.c9
-rw-r--r--sysdeps/s390/multiarch/strncpy.c7
-rw-r--r--sysdeps/s390/multiarch/strnlen.c7
-rw-r--r--sysdeps/s390/multiarch/strpbrk.c6
-rw-r--r--sysdeps/s390/multiarch/strrchr.c6
-rw-r--r--sysdeps/s390/multiarch/strspn.c6
-rw-r--r--sysdeps/s390/multiarch/wcschr.c7
-rw-r--r--sysdeps/s390/multiarch/wcscmp.c4
-rw-r--r--sysdeps/s390/multiarch/wcspbrk.c4
-rw-r--r--sysdeps/s390/multiarch/wcsspn.c4
-rw-r--r--sysdeps/s390/multiarch/wmemchr.c7
-rw-r--r--sysdeps/s390/multiarch/wmemset.c7
-rw-r--r--sysdeps/s390/nptl/Makefile3
-rw-r--r--sysdeps/s390/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/s390/s390-32/bits/wordsize.h3
-rw-r--r--sysdeps/s390/s390-32/multiarch/memcmp.c7
-rw-r--r--sysdeps/s390/s390-32/multiarch/memcpy.c5
-rw-r--r--sysdeps/s390/s390-32/multiarch/memset.c5
-rw-r--r--sysdeps/s390/s390-64/bits/wordsize.h3
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcmp.c7
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcpy.c5
-rw-r--r--sysdeps/s390/s390-64/multiarch/memset.c5
-rw-r--r--sysdeps/sh/bits/fenv.h8
-rw-r--r--sysdeps/sh/libm-test-ulps-name1
-rw-r--r--sysdeps/sh/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/sh/sh4/fpu/fegetmode.c27
-rw-r--r--sysdeps/sh/sh4/fpu/fesetexcept.c32
-rw-r--r--sysdeps/sh/sh4/fpu/fesetmode.c38
-rw-r--r--sysdeps/sparc/fpu/bits/fenv.h8
-rw-r--r--sysdeps/sparc/fpu/fegetmode.c26
-rw-r--r--sysdeps/sparc/fpu/fesetexcept.c31
-rw-r--r--sysdeps/sparc/fpu/fesetmode.c38
-rw-r--r--sysdeps/sparc/fpu/libm-test-ulps-name1
-rw-r--r--sysdeps/sparc/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/sparc/sparc32/bits/wordsize.h3
-rw-r--r--sysdeps/sparc/sparc32/sem_init.c85
-rw-r--r--sysdeps/sparc/sparc32/sem_open.c300
-rw-r--r--sysdeps/sparc/sparc32/sem_wait.c93
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/Makefile2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/sem_init.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/sem_open.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/sem_wait.c1
-rw-r--r--sysdeps/sparc/sparc64/Makefile1
-rw-r--r--sysdeps/sparc/sparc64/bits/wordsize.h3
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sha256-block.c16
-rw-r--r--sysdeps/sparc/sparc64/multiarch/sha512-block.c16
-rw-r--r--sysdeps/tile/bits/fenv.h8
-rw-r--r--sysdeps/tile/libm-test-ulps-name1
-rw-r--r--sysdeps/tile/nptl/bits/pthreadtypes.h2
-rw-r--r--sysdeps/tile/preconfigure2
-rw-r--r--sysdeps/tile/tilegx/bits/wordsize.h3
-rw-r--r--sysdeps/tile/tilepro/bits/wordsize.h3
-rw-r--r--sysdeps/unix/alpha/Makefile1
-rw-r--r--sysdeps/unix/sysdep.h73
-rw-r--r--sysdeps/unix/sysv/linux/Makefile7
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h25
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libm.abilist20
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h9
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Makefile5
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/resource.h3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/sigstack.h25
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/wordsize.h1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libm.abilist20
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/acct.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/ucontext.h3
-rw-r--r--sysdeps/unix/sysv/linux/arm/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/arm/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/arm/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/arm/posix_fadvise64.c38
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/ucontext.h6
-rw-r--r--sysdeps/unix/sysv/linux/bits/in.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/resource.h3
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigcontext.h5
-rw-r--r--sysdeps/unix/sysv/linux/bits/sigstack.h25
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/time.h68
-rw-r--r--sysdeps/unix/sysv/linux/bits/timex.h1
-rw-r--r--sysdeps/unix/sysv/linux/fallocate.c11
-rw-r--r--sysdeps/unix/sysv/linux/fallocate64.c14
-rw-r--r--sysdeps/unix/sysv/linux/fxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/fxstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/generic/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c46
-rw-r--r--sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c37
-rw-r--r--sysdeps/unix/sysv/linux/hppa/atomic-machine.h22
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sys/ucontext.h5
-rw-r--r--sysdeps/unix/sysv/linux/i386/Makefile48
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/gettimeofday.c14
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/i386/libm.abilist21
-rw-r--r--sysdeps/unix/sysv/linux/i386/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/posix_fadvise64.S92
-rw-r--r--sysdeps/unix/sysv/linux/i386/time.c14
-rw-r--r--sysdeps/unix/sysv/linux/i386/xstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/Makefile1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/sigstack.h29
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libm.abilist21
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/ucontext.h4
-rw-r--r--sysdeps/unix/sysv/linux/include/sys/sysinfo.h3
-rw-r--r--sysdeps/unix/sysv/linux/include/sys/timex.h3
-rw-r--r--sysdeps/unix/sysv/linux/llseek.c46
-rw-r--r--sysdeps/unix/sysv/linux/lseek.c (renamed from sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c)35
-rw-r--r--sysdeps/unix/sysv/linux/lseek64.c55
-rw-r--r--sysdeps/unix/sysv/linux/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/lxstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist21
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/ucontext.h6
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/Makefile3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/mips/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/resource.h3
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigstack.h25
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c41
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c60
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libm.abilist20
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/llseek.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c33
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c37
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c55
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c37
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c38
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c50
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c34
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/ucontext.h9
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/user.h1
-rw-r--r--sysdeps/unix/sysv/linux/net/ethernet.h11
-rw-r--r--sysdeps/unix/sysv/linux/net/if_arp.h5
-rw-r--r--sysdeps/unix/sysv/linux/net/if_ppp.h12
-rw-r--r--sysdeps/unix/sysv/linux/net/if_shaper.h6
-rw-r--r--sysdeps/unix/sysv/linux/net/ppp_defs.h4
-rw-r--r--sysdeps/unix/sysv/linux/net/route.h12
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_ether.h16
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_fddi.h10
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_tr.h36
-rw-r--r--sysdeps/unix/sysv/linux/netipx/ipx.h9
-rw-r--r--sysdeps/unix/sysv/linux/netrose/rose.h3
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sys/ucontext.h6
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise.c45
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise64.c51
-rw-r--r--sysdeps/unix/sysv/linux/posix_fallocate.c6
-rw-r--r--sysdeps/unix/sysv/linux/posix_fallocate64.c14
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h25
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/gettimeofday.c60
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel-features.h5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist22
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist22
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c55
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist22
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist22
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/user.h1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/time.c67
-rw-r--r--sysdeps/unix/sysv/linux/pread.c3
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c3
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c3
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c3
-rw-r--r--sysdeps/unix/sysv/linux/s390/Makefile1
-rw-r--r--sysdeps/unix/sysv/linux/s390/localplt.data9
-rw-r--r--sysdeps/unix/sysv/linux/s390/pt-longjmp.c4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist20
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist20
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/ucontext.h14
-rw-r--r--sysdeps/unix/sysv/linux/sh/kernel-features.h6
-rw-r--r--sysdeps/unix/sysv/linux/sh/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sh/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/sh/pread.c23
-rw-r--r--sysdeps/unix/sysv/linux/sh/pread64.c23
-rw-r--r--sysdeps/unix/sysv/linux/sh/pwrite.c23
-rw-r--r--sysdeps/unix/sysv/linux/sh/pwrite64.c23
-rw-r--r--sysdeps/unix/sysv/linux/sh/sys/ucontext.h5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/resource.h3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigstack.h25
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/wordsize.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist20
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist20
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sys/ucontext.h7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sys/user.h2
-rw-r--r--sysdeps/unix/sysv/linux/spawni.c93
-rw-r--r--sysdeps/unix/sysv/linux/sync_file_range.c35
-rw-r--r--sysdeps/unix/sysv/linux/sys/acct.h34
-rw-r--r--sysdeps/unix/sysv/linux/sys/quota.h171
-rw-r--r--sysdeps/unix/sysv/linux/sys/timerfd.h3
-rw-r--r--sysdeps/unix/sysv/linux/sysdep.h10
-rw-r--r--sysdeps/unix/sysv/linux/tile/Makefile1
-rw-r--r--sysdeps/unix/sysv/linux/tile/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/tile/sys/ucontext.h6
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist19
-rw-r--r--sysdeps/unix/sysv/linux/tst-fallocate-common.c93
-rw-r--r--sysdeps/unix/sysv/linux/tst-fallocate.c25
-rw-r--r--sysdeps/unix/sysv/linux/tst-fallocate64.c47
-rw-r--r--sysdeps/unix/sysv/linux/tst-quota.c58
-rw-r--r--sysdeps/unix/sysv/linux/tst-setgetname.c2
-rw-r--r--sysdeps/unix/sysv/linux/tst-sync_file_range.c131
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c40
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c46
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/x86/gettimeofday.c28
-rw-r--r--sysdeps/unix/sysv/linux/x86/sys/ucontext.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86/time.c26
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libm.abilist21
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist21
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/xstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/xstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.c2
-rw-r--r--sysdeps/wordsize-32/bits/wordsize.h5
-rw-r--r--sysdeps/wordsize-64/bits/wordsize.h3
-rw-r--r--sysdeps/x86/bits/pthreadtypes.h2
-rw-r--r--sysdeps/x86/bits/wordsize.h4
-rw-r--r--sysdeps/x86/cacheinfo.c4
-rw-r--r--sysdeps/x86/cpu-features.c38
-rw-r--r--sysdeps/x86/cpu-features.h8
-rw-r--r--sysdeps/x86/fpu/bits/fenv.h14
-rw-r--r--sysdeps/x86/fpu/fix-fp-int-compare-invalid.h28
-rw-r--r--sysdeps/x86/fpu/include/bits/fenv.h6
-rw-r--r--sysdeps/x86_64/dl-machine.h42
-rw-r--r--sysdeps/x86_64/dl-trampoline.S20
-rw-r--r--sysdeps/x86_64/dl-trampoline.h106
-rw-r--r--sysdeps/x86_64/fpu/dla.h8
-rw-r--r--sysdeps/x86_64/fpu/fegetmode.c (renamed from math/cimagl.c)17
-rw-r--r--sysdeps/x86_64/fpu/fesetexcept.c31
-rw-r--r--sysdeps/x86_64/fpu/fesetmode.c50
-rw-r--r--sysdeps/x86_64/fpu/k_rem_pio2l.c1
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps-name1
-rw-r--r--sysvipc/sys/ipc.h4
-rw-r--r--sysvipc/sys/msg.h3
-rw-r--r--sysvipc/sys/sem.h3
-rw-r--r--sysvipc/sys/shm.h3
-rw-r--r--test-skeleton.c207
-rw-r--r--time/Makefile7
-rw-r--r--time/bits/types/clock_t.h15
-rw-r--r--time/bits/types/clockid_t.h9
-rw-r--r--time/bits/types/struct_itimerspec.h14
-rw-r--r--time/bits/types/struct_timespec.h14
-rw-r--r--time/bits/types/struct_timeval.h13
-rw-r--r--time/bits/types/struct_tm.h33
-rw-r--r--time/bits/types/time_t.h14
-rw-r--r--time/bits/types/timer_t.h9
-rw-r--r--time/sys/time.h9
-rw-r--r--time/sys/timeb.h4
-rw-r--r--time/time.h237
-rw-r--r--time/tst-strptime2.c11
-rw-r--r--wcsmbs/Makefile3
-rw-r--r--wcsmbs/tst-wcstod-round.c (renamed from math/s_nanl.c)26
1201 files changed, 28843 insertions, 18196 deletions
diff --git a/ChangeLog b/ChangeLog
index 62f60dceea..2b30e114f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,3643 @@
+2016-11-08 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * nptl/Makefile (libpthread-routines): Remove ptw-llseek and add
+ ptw-lseek64.
+ * sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Remove llseek.
+ * sysdeps/unix/sysv/linux/alpha/Makefile (sysdeps_routines):
+ Likewise.
+ * sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c: Remove file.
+ * sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c: Remove file.
+ * sysdeps/unix/sysv/linux/mips/mips64/llseek.c: Likewise.
+ * sysdeps/unix/sysv/linux/llseek.c: Remove file.
+ * sysdeps/unix/sysv/linux/lseek.c: New file.
+ * sysdeps/unix/sysv/linux/lseek64.c: Add default Linux implementation.
+ * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list: Remove lseek and
+ __libc_lseek64 from auto-generation.
+ * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S: New file.
+
+2016-11-07 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
+
+ * nptl/tst-basic1.c (tf, do_test): Use write_message.
+ * nptl/tst-cleanup1.c (do_test): Likewise.
+ * nptl/tst-cleanup3.c (do_test): Likewise.
+ * nptl/tst-key1.c (do_test): Likewise.
+ * nptl/tst-key2.c (tf, do_test): Likewise.
+ * nptl/tst-key3.c (tf, do_test): Likewise.
+ * nptl/tst-stdio1.c (do_test): Likewise.
+ * nptl/tst-stdio2.c (do_test): Likewise.
+
+ * nptl/tst-kill3.c (handler): Use write_message in place of write.
+ * nptl/tst-kill6.c (handler): Likewise.
+ * nptl/tst-tls2.c (CB): Likewise.
+ * nptl/tst-tls3.c (CB): Likewise.
+
+2016-11-07 Joseph Myers <joseph@codesourcery.com>
+
+ * scripts/check-installed-headers.sh: Ignore sys/sysctl.h for x32.
+
+2016-11-07 Yury Norov <ynorov@caviumnetworks.com>
+ Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * sysdeps/unix/sysv/linux/alpha/kernel-features.h: #define
+ __ASSUME_ST_INO_64_BIT as 0
+ * sysdeps/unix/sysv/linux/sh/kernel-features.h: Likewise.
+ * sysdeps/unix/sysv/linux/fxstat64.c: Replace #ifdef with #if
+ over the code where __ASSUME_ST_INO_64_BIT is used.
+ * sysdeps/unix/sysv/linux/lxstat64.c: Likewise.
+ * sysdeps/unix/sysv/linux/xstat64.c: Likewise.
+ * sysdeps/unix/sysv/linux/xstatconv.c: Likewise.
+
+2016-11-07 Florian Weimer <fweimer@redhat.com>
+
+ * sysdeps/aarch64/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Document ABI exposure of the __kind offset.
+ * sysdeps/arm/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Mention reason for the __kind offset exposure in the ABI.
+ * sysdeps/hppa/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/ia64/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/m68k/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/microblaze/nptl/bits/pthreadtypes.h
+ (struct __pthread_mutex_s): Likewise.
+ * sysdeps/mips/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/nios2/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/s390/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/sh/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/sparc/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/tile/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+ * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
+ (struct __pthread_mutex_s): Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
+ (struct __pthread_mutex_s): Likewise.
+ * sysdeps/x86/bits/pthreadtypes.h (struct __pthread_mutex_s):
+ Likewise.
+
+2016-11-07 Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * test-skeleton.c: Document do_test usage.
+
+2016-11-06 Aurelien Jarno <aurelien@aurel32.net>
+
+ * iconv/gconv.h (__gconv_info): Define __data element using a
+ zero-length array.
+
+2016-11-04 Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * math/test-tgmath2.c: Split up test function.
+
+2016-11-04 Joseph Myers <joseph@codesourcery.com>
+
+ * Rules (tests-expected): New variable, depending on
+ $(run-built-tests).
+ (tests): Pass $(tests-expected) to merge-test-results.sh, not
+ $(tests).
+
+ * Rules [$(run-built-tests) = no] (tests): Do not depend on
+ $(tests-unsupported).
+
+2016-11-04 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
+ (__WORDSIZE_TIME64_COMPAT32): Define for both 32 and 64 bits.
+
+2016-11-04 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #20768]
+ * sysdeps/alpha/fpu/feholdexcpt.c (__feholdexcept): Call
+ __fegetenv instead of fegetenv.
+
+ [BZ #14139]
+ * manual/libm-err-tab.pl (%pplatforms): Initialize to empty.
+ (find_files): Obtain platform name from libm-test-ulps-name and
+ store in %pplatforms.
+ (canonicalize_platform): Remove.
+ (print_platforms): Use $pplatforms directly.
+ (by_platforms): Do not allow for platforms missing from
+ %pplatforms.
+ * sysdeps/aarch64/libm-test-ulps-name: New file.
+ * sysdeps/alpha/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/arm/libm-test-ulps-name: Likewise.
+ * sysdeps/generic/libm-test-ulps-name: Likewise.
+ * sysdeps/hppa/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/i386/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name: Likewise.
+ * sysdeps/ia64/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/m68k/coldfire/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/m68k/m680x0/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/microblaze/libm-test-ulps-name: Likewise.
+ * sysdeps/mips/mips32/libm-test-ulps-name: Likewise.
+ * sysdeps/mips/mips64/libm-test-ulps-name: Likewise.
+ * sysdeps/nios2/libm-test-ulps-name: Likewise.
+ * sysdeps/powerpc/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/powerpc/nofpu/libm-test-ulps-name: Likewise.
+ * sysdeps/s390/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/sh/libm-test-ulps-name: Likewise.
+ * sysdeps/sparc/fpu/libm-test-ulps-name: Likewise.
+ * sysdeps/tile/libm-test-ulps-name: Likewise.
+ * sysdeps/x86_64/fpu/libm-test-ulps-name: Likewise.
+
+ * sysdeps/unix/sysv/linux/mips/sys/user.h: Include <stddef.h>.
+
+ * sysdeps/unix/sysv/linux/mips/Makefile [$(subdir) = elf]
+ (test-xfail-check-execstack): New variable.
+
+ * sysdeps/mips/localplt.data: New file.
+
+2016-11-04 Yury Norov <ynorov@caviumnetworks.com>
+ Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * bits/wordsize.h: Add documentation.
+ * sysdeps/aarch64/bits/wordsize.h : New file
+ * sysdeps/generic/stdint.h (PTRDIFF_MIN, PTRDIFF_MAX): Update
+ definitions.
+ (SIZE_MAX): Change ifdef to if in __WORDSIZE32_SIZE_ULONG check.
+ * sysdeps/gnu/bits/utmp.h (__WORDSIZE_TIME64_COMPAT32): Check
+ with #if instead of #ifdef.
+ * sysdeps/gnu/bits/utmpx.h (__WORDSIZE_TIME64_COMPAT32): Ditto.
+ * sysdeps/mips/bits/wordsize.h (__WORDSIZE32_SIZE_ULONG,
+ __WORDSIZE32_PTRDIFF_LONG, __WORDSIZE_TIME64_COMPAT32):
+ Add or change defines.
+ * sysdeps/powerpc/powerpc32/bits/wordsize.h: Likewise.
+ * sysdeps/powerpc/powerpc64/bits/wordsize.h: Likewise.
+ * sysdeps/s390/s390-32/bits/wordsize.h: Likewise.
+ * sysdeps/s390/s390-64/bits/wordsize.h: Likewise.
+ * sysdeps/sparc/sparc32/bits/wordsize.h: Likewise.
+ * sysdeps/sparc/sparc64/bits/wordsize.h: Likewise.
+ * sysdeps/tile/tilegx/bits/wordsize.h: Likewise.
+ * sysdeps/tile/tilepro/bits/wordsize.h: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/bits/wordsize.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/wordsize.h: Likewise.
+ * sysdeps/wordsize-32/bits/wordsize.h: Likewise.
+ * sysdeps/wordsize-64/bits/wordsize.h: Likewise.
+ * sysdeps/x86/bits/wordsize.h: Likewise.
+
+2016-11-04 Wilco Dijkstra <wdijkstr@arm.com>
+ Kevin Petit <kevin.petit@arm.com>
+
+ * sysdeps/aarch64/memchr.S (__memchr): New file.
+
+2016-11-04 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/tile/preconfigure: Accept tilegx* instead of tilegx.
+
+2016-11-03 Joseph Myers <joseph@codesourcery.com>
+
+ * conform/Makefile ($(linknamespace-header-tests)): Also depend on
+ $(linknamespace-symlists-tests).
+
+2016-11-02 Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * time/tst-strptime2.c: Ignore -Wformat-length warning.
+
+2016-11-02 Florian Weimer <fweimer@redhat.com>
+ Carlos O'Donell <carlos@redhat.com>
+
+ [Bug #20729]
+ * resolv/res_send.c (send_vc): Revert DIAG_IGNORE_Os_NEEDS_COMMENT
+ change to non -Os related diagnostic. Use DIAG_IGNORE_Os_NEEDS_COMMENT
+ for -Os related change.
+
+2016-11-01 Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * stdio-common/tst-printf.c: Ignore -Wformat-length warning.
+
+2016-11-01 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #19673]
+ * manual/math.texi (Exponents and Logarithms): Correct description
+ of clog10.
+
+2016-10-31 Carlos O'Donell <carlos@redhat.com>
+
+ [Bz #20729]
+ * locale/weight.h: Include libc-internal.h.
+ * locale/weightwc.h: Likewise.
+ * nptl/nptl_dbP.h: Likewise.
+
+2016-10-31 Brent W. Baccala <cosine@freesoft.org>
+
+ * sysdeps/mach/hurd/dl-sysdep.c (__mmap): Do not deallocate memobj_wr
+ when it is MACH_PORT_NULL.
+
+2016-10-31 Andreas Schwab <schwab@suse.de>
+
+ [BZ #20707]
+ * posix/glob.c (glob): Initialize pglob before checking for
+ GLOB_BRACE. Don't call glob recursively if pattern contains no
+ valid brace expression despite GLOB_BRACE.
+ * posix/globtest.sh: Test it.
+
+2016-10-28 Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #20729]
+ * include/libc-internal.h (DIAG_IGNORE_Os_NEEDS_COMMENT):
+ Define.
+ * iconvdata/iso-2022-cn-ext.c: Include libc-internal.h and ignore
+ -Wmaybe-uninitialized for BODY macro only for -Os compiles.
+ * locale/weight.h (findix): Ignore -Wmaybe-uninitialized error
+ for seq2.back_us and seq1.back_us only for -Os compiles.
+ * locale/weightwc.h (findix): Likewise.
+ * nptl_db/thread_dbP.h: Ignore -Wmaybe-uninitialized error for
+ DB_GET_FIELD_ADDRESS only for -Os compiles.
+ * resolv/res_send (reopen): Ignore -Wmaybe-uninitialized error
+ for slen only for -Os compiles.
+ * string/strcoll_l.c (get_next_seq): Ignore
+ -Wmaybe-uninitialized for seq2.save_idx and seq1.save_idx only
+ for -Os compiles.
+
+ * elf/Makefile (CFALGS-tst-linkall-static): Remove.
+ * include/crypt.h: New file.
+
+2016-10-28 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
+
+ * dlfcn/bug-atexit3-lib.cc (write_message): New function, copied
+ from test-skeleton.c.
+ (statclass): Replace calls to write with calls to write_message.
+
+2016-10-28 Joseph Myers <joseph@codesourcery.com>
+
+ * math/math.h
+ [__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANF):
+ New macro.
+ [__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNAN):
+ Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANL):
+ Likewise.
+ * manual/arith.texi (Infinity and NaN): Document SNANF, SNAN and
+ SNANL.
+ * math/test-double.h (snan_value_MACRO): New macro.
+ * math/test-float.h (snan_value_MACRO): Likewise.
+ * math/test-ldouble.h (snan_value_MACRO): Likewise.
+ * math/libm-test.inc (issignaling_test_data): Add tests of
+ snan_value_MACRO.
+
+2016-10-28 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ * nptl/pthread_rwlock_unlock.c: Add a comment explaining its
+ behavior when eliding a lock not held by the current thread.
+ * sysdeps/powerpc/nptl/elide.h: Likewise.
+
+2016-10-28 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ [BZ #20728]
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Replace a
+ branch to _exit() by a function call.
+
+2016-10-28 Florian Weimer <fweimer@redhat.com>
+
+ * malloc/malloc.c: Update chunk layout comments.
+ (chunk_main_arena): Update comment.
+
+2016-10-28 Florian Weimer <fweimer@redhat.com>
+
+ * crypt/sha256.c, crypt/sha256-block.c,
+ sysdeps/sparc/sparc64/multiarch/sha256-block.c: Rename
+ sha256_process_block to __sha256_process_block.
+ * crypt/sha512.c, crypt/sha512-block.c,
+ sysdeps/sparc/sparc64/multiarch/sha512-block.c: Rename
+ sha512_process_block to __sha512_process_block.
+
+2016-10-28 Carlos O'Donell <carlos@redhat.com>
+
+ * elf/Makefile (CFLAGS-tst-linkall-static): Define.
+
+ * math/test-nan-overflow.c: Include stdlib.h for malloc.
+
+2016-10-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #20019]
+ * sysdeps/i386/dl-machine.h (elf_machine_rel): Check IFUNC
+ definition in unrelocated shared library.
+ * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
+
+2016-10-28 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20729]
+ Support i386 builds with CFLAGS which imply -fno-omit-frame-pointer.
+ * sysdeps/unix/sysv/linux/i386/Makefile
+ (uses-6-syscall-arguments): Define.
+ [subdir == misc] (CFLAGS-epoll_pwait.o, CFLAGS-epoll_pwait.os)
+ (CFLAGS-mmap.o, CFLAGS-mmap.os, CFLAGS-mmap64.o, CFLAGS-mmap64.os)
+ (CFLAGS-pselect.o, CFLAGS-pselect.os, CFLAGS-rtld-mmap.os): Use it.
+ [subdir = sysvipc] (CFLAGS-semtimedop.o, CFLAGS-semtimedop.os):
+ Likewise.
+ [subdir = io] (CFLAGS-posix_fadvise64.o, CFLAGS-posix_fadvise64.os)
+ (CFLAGS-posix_fallocate.o, CFLAGS-posix_fallocate.os)
+ (CFLAGS-posix_fallocate64.o, CFLAGS-posix_fallocate64.os)
+ (CFLAGS-sync_file_range.o, CFLAGS-sync_file_range.os)
+ (CFLAGS-fallocate.o, CFLAGS-fallocate.os, CFLAGS-fallocate64.o)
+ (CFLAGS-fallocate64.os): Likewise.
+ [subdir = nptl] (CFLAGS-pthread_rwlock_timedrdlock.o)
+ (CFLAGS-pthread_rwlock_timedrdlock.os)
+ (CFLAGS-pthread_rwlock_timedwrlock.o)
+ (CFLAGS-pthread_rwlock_timedwrlock.os, CFLAGS-sem_wait.o)
+ (CFLAGS-sem_wait.os, CFLAGS-sem_timedwait.o)
+ (CFLAGS-sem_timedwait.os): Likewise.
+
+2016-10-28 Florian Weimer <fweimer@redhat.com>
+
+ * elf/tst-linkall-static.c: New file.
+ * elf/Makefile (tests-static): Add tst-linkall-static.
+ (tst-linkall-static): Link against static libraries.
+
+2016-10-27 Florian Weimer <fweimer@redhat.com>
+
+ * malloc/malloc.c (sysmalloc): Initialize previous size field of
+ mmaped chunks.
+
+2016-10-28 Florian Weimer <fweimer@redhat.com>
+
+ * malloc/malloc.c (struct malloc_chunk): Rename prev_size, size
+ members to mchunk_prev_size, mchunk_size.
+ (chunk_main_arena): Reverse sense and rename from
+ chunk_non_main_arena.
+ (prev_inuse, chunk_is_mmapped, chunk_main_arena): Use
+ mchunk_size instead of size.
+ (set_non_main_arena): Define.
+ (chunksize): Use chunksize_nomask instead of direct member access.
+ (chunksize_nomask): Define.
+ (next_chunk): Use chunksize instead of direct member access.
+ (prev_size, set_prev_size): Define.
+ (prev_chunk): Use prev_size instead of direct member access.
+ (inuse, set_inuse, clear_inuse): Use chunksize and mchunk_size member.
+ (inuse_bit_at_offset, set_inuse_bit_at_offset)
+ (clear_inuse_bit_at_offset): Use mchunk_size member instead of size.
+ (mchunk_prev_size, mchunk_size): Poison tokens.
+ (unlink): Use chunksize_nomask, prev_size accessors.
+ (do_check_remalloced_chunk): Use chunk_main_arena accessor.
+ (do_check_free_chunk): Use prev_size accessor.
+ (sysmalloc): Use set_prev_size, set_head accessors.
+ (munmap_chunk, mremap_chunk): Use prev_size accessor.
+ (__libc_free): Use chunksize_nomask accessor.
+ (_int_malloc): Use set_non_main_arena, chunksize_nomask,
+ chunk_main_arena accessors.
+ (_int_free): Use chunksize_nomask, prev_size accessors.
+ (malloc_consolidate): Use chunksize, prev_size accessors.
+ (_int_realloc): Use chunksize_nomask accessor.
+ (_int_memalign): Use set_prev_size accessor.
+ (__malloc_info): Use chunksize_nomask accessor.
+ * malloc/hooks.c (mem2chunk_check): Use prev_size, prev_inuse
+ accessors.
+ * malloc/arena.c (arena_for_chunk): Use chunk_main_arena accessor.
+ (heap_trim): Use chunksize_nomask, prev_size accessors.
+
+2016-10-28 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #19380]
+ * stdlib/strtod_l.c (round_and_return): Force "inexact" exception
+ for inexact results.
+ * stdlib/gen-tst-strtod-round.c (string_to_fp): Return indication
+ of inexact result where mpfr_subnormalize is the only inexact
+ step.
+ * stdlib/tst-strtod-round-data.h: Regenerated.
+ * stdlib/tst-strtod-round-skeleton.c [!FE_INEXACT] (FE_INEXACT):
+ Define to 0.
+ (GEN_ONE_TEST): Test inexact exceptions raised are as expected.
+
+2016-10-27 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/unix/sysv/linux/sparc/sys/user.h: Include stddef.h
+
+2016-10-27 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * malloc/malloc.c (do_set_mallopt_check): New function.
+ (do_set_mmap_threshold): Likewise.
+ (do_set_mmaps_max): Likewise.
+ (do_set_top_pad): Likewise.
+ (do_set_perturb_byte): Likewise.
+ (do_set_trim_threshold): Likewise.
+ (do_set_arena_max): Likewise.
+ (do_set_arena_test): Likewise.
+ (__libc_mallopt): Use them.
+
+2016-10-26 Joseph Myers <joseph@codesourcery.com>
+
+ * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (canonicalize): New declaration.
+ * math/Versions (canonicalize): New libm symbol at version
+ GLIBC_2.25.
+ (canonicalizef): Likewise.
+ (canonicalizel): Likewise.
+ * math/Makefile (gen-libm-calls): Add s_canonicalizeF.
+ * math/s_canonicalize_template.c: New file.
+ * math/libm-test.inc: Update comment on functions tested and
+ testing of NaN payloads.
+ (TEST_NAN_PAYLOAD): New macro.
+ (NO_TEST_INLINE): Update value.
+ (XFAIL_TEST): Likewise.
+ (ERRNO_UNCHANGED): Likewise.
+ (ERRNO_EDOM): Likewise.
+ (ERRNO_ERANGE): Likewise.
+ (IGNORE_RESULT): Likewise.
+ (NON_FINITE): Likewise.
+ (TEST_SNAN): Likewise.
+ (NO_TEST_MATHVEC): Likewise.
+ (TEST_NAN_PAYLOAD_CANONICALIZE): New macro.
+ (check_float_internal): Check NaN payloads if TEST_NAN_PAYLOAD.
+ (struct test_Ffp_b1_data): New type.
+ (RUN_TEST_Ffp_b1): New macro.
+ (RUN_TEST_LOOP_Ffp_b1): Likewise.
+ (canonicalize_test_data): New array.
+ (canonicalize_test): New function.
+ (main): Call canonicalize_test.
+ * manual/arith.texi (FP Bit Twiddling): Document canonicalize,
+ canonicalizef and canonicalizel.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+ * sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c: New file.
+ * sysdeps/ieee754/ldbl-opt/s_canonicalizel.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
+ canonicalize.
+ (CFLAGS-nldbl-canonicalize.c): New variable.
+ * sysdeps/ieee754/ldbl-128ibm/test-iscanonical-ldbl-128ibm.c: Move
+ to ...
+ * sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c:
+ ... here.
+ (do_test): Also test canonicalizel.
+ * sysdeps/ieee754/ldbl-128ibm/Makefile (tests): Change
+ test-iscanonical-ldbl-128ibm to test-canonical-ldbl-128ibm.
+ * sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h: New
+ file.
+ * sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c (__iscanonicall):
+ Use libm_hidden_def.
+ * sysdeps/ieee754/ldbl-96/test-iscanonical-ldbl-96.c: Move to ...
+ * sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c: ... here.
+ (do_test): Also test canonicalizel.
+ * sysdeps/ieee754/ldbl-96/Makefile (tests): Change
+ test-iscanonical-ldbl-96 to test-canonical-ldbl-96.
+ * sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h: New file.
+ * sysdeps/ieee754/ldbl-96/s_iscanonicall.c (__iscanonicall): Use
+ libm_hidden_def.
+ * sysdeps/generic/math-tests.h (SNAN_TESTS_PRESERVE_PAYLOAD): New
+ macro.
+ * sysdeps/mips/math-tests.h [__mips_hard_float && !__mips_nan2008]
+ (SNAN_TESTS_PRESERVE_PAYLOAD): Likewise.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+ * sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c: New file.
+ * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
+ getpayload.
+ (CFLAGS-nldbl-getpayload.c): New variable.
+
+2016-10-26 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
+
+ * stdio-common/vfscanf.c (_IO_vfwscanf): Use read_int to parse
+ integer from the format string.
+
+2016-10-26 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #19473]
+ * malloc/malloc.h (malloc_get_state, malloc_set_state): Remove
+ declarations.
+ * malloc/malloc.c (malloc_get_state, malloc_set_state): Remove
+ weak aliases.
+ * malloc/hooks.c (__malloc_get_state): Remove definition.
+ (malloc_get_state): New stub implementation as
+ compatibility symbol.
+ (malloc_set_state): Rename from __malloc_set_state. Turn into
+ compat symbol.
+ * malloc/tst-mallocstate.c: Rewrite to approximate how Emacs uses
+ malloc_set_state.
+ * malloc/Makefile (LDFLAGS-tst-mallocstate): Link with -rdynamic.
+
+2016-10-26 Florian Weimer <fweimer@redhat.com>
+
+ * iconvdata/iso646.c (enum variant): Drop illegal_var.
+ (names): Turn into concatenation of strings.
+ (gconv_init): Adapt iteration over names.
+
+2016-10-26 Florian Weimer <fweimer@redhat.com>
+
+ * iconvdata/ibm930.h (__ucs4_to_ibm930sb): Remove indirection and
+ make const.
+ * iconvdata/ibm933.h (__ucs4_to_ibm933sb): Likewise.
+ * iconvdata/ibm935.h (__ucs4_to_ibm935sb): Likewise.
+ * iconvdata/ibm939.h (__ucs4_to_ibm939sb): Likewise.
+ * iconvdata/ibm930.c [TO_LOOP] (BODY): Store converted single-byte
+ character in sbconv.
+ * iconvdata/ibm933.c [TO_LOOP] (BODY): Likewise.
+ * iconvdata/ibm935.c [TO_LOOP] (BODY): Likewise.
+ * iconvdata/ibm939.c [TO_LOOP] (BODY): Likewise.
+
+2016-10-26 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * malloc/malloc.c (M_ARENA_TEST, M_ARENA_MAX): Remove.
+
+ * manual/memory.texi (M_TOP_PAD): Remove reference to sbrk.
+ (M_TRIM_THRESHOLD): Likewise.
+
+ * manual/memory.texi (M_ARENA_TEST): Add documentation.
+ (M_ARENA_MAX): Likewise.
+ * malloc/malloc.c: Remove obsolete comment.
+
+ * manual/memory.texi: Add environment variable alternatives to
+ setting mallopt parameters.
+
+2016-10-26 Carlos O'Donell <carlos@redhat.com>
+
+ * include/atomic.h
+ [USE_COMPILER_ATOMIC_BUILTINS && !atomic_fetch_xor_release]
+ (atomic_fetch_xor_release): Use atomic_compare_exchange_weak_release.
+
+2016-10-25 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
+
+ * stdlib/Makefile (tests): Add tst-strfrom and tst-strfrom-locale.
+ * stdlib/tst-strfrom.h: New file.
+ * stdlib/tst-strfrom.c: New file.
+ * stdlib/tst-strfrom-locale.c: New file.
+
+ * stdlib/bug-strtod.c: Refactor based on GEN_TEST_STRTOD_FOREACH.
+ * stdlib/bug-strtod2.c: Likewise.
+ * stdlib/tst-strtod-round-skeleton.c: Likewise.
+ * stdlib/tst-strtod6.c: Likewise.
+ * stdlib/tst-strtod.h (GEN_TEST_STRTOD_FOREACH): Use strfrom.
+
+2016-10-25 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
+
+ * NEWS: Mention the addition of strfromd, strfromf, and strfroml.
+ * manual/arith.texi: Document strfromd, strfromf, strfroml.
+ * stdlib/Makefile: Add strfromd, strfromf, and strfroml.
+ * stdlib/Versions (GLIBC_2.25): Add strfromd, strfromf, and strfroml.
+ * stdlib/stdlib.h (strfromd): New declaration.
+ (strfromf): Likewise.
+ (strfroml): Likewise.
+ * stdlib/strfrom-skeleton.c: New file. Generic implementation for
+ strfrom.
+ * stdlib/strfromd.c: New file.
+ * stdlib/strfromf.c: Likewise.
+ * stdlib/strfroml.c: Likewise.
+ * stdlib/bits/stdlib-ldbl.h: Add redirection from strfroml to strfromd.
+ * sysdeps/ieee754/ldbl-opt/Makefile: Add rule for nldbl-strfroml.c.
+ * sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c: New file;
+ * sysdeps/arm/nacl/libc.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
+
+2016-10-25 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/powerpc/powerpc32/power6/memset.S (memset): Use cmplwi
+ instead of cmpli.
+ * sysdeps/powerpc/powerpc64/power6/memset.S (memset): Use cmpldi
+ instead of cmpli.
+
+2016-10-24 Yury Norov <ynorov@caviumnetworks.com>
+
+ * sysdeps/unix/sysv/linux/fxstat.c: Remove useless cast.
+ * sysdeps/unix/sysv/linux/lxstat.c: Likewise.
+ * sysdeps/unix/sysv/linux/xstat.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/fxstat.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/xstat.c: Likewise.
+
+2016-10-24 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/pread.c (__libc_pread): Use SYSCALL_LL_PRW.
+ * sysdeps/unix/sysv/linux/pwrite.c (__libc_pwrite): Likewise.
+ * sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Use
+ SYSCALL_LL64_PRW.
+ * sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Likewise.
+ * sysdeps/unix/sysv/linux/sh/kernel-features.h: Define
+ __ASSUME_PRW_DUMMY_ARG.
+ * sysdeps/unix/sysv/linux/sh/pread.c: Remove file.
+ * sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
+ * sysdeps/unix/sysv/linux/sh/pwrite.c: Likewise.
+ * sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.
+ * sysdeps/unix/sysv/linux/sysdep.h: Define SYSCALL_LL_PRW and
+ SYSCALL_LL_PRW64 based on __ASSUME_PRW_DUMMY_ARG.
+
+2016-10-24 Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * sysdeps/unix/sysv/linux/tst-setgetname.c: Increase buffer size.
+
+2016-10-22 Florian Weimer <fweimer@redhat.com>
+
+ * math/math.h [__cplusplus] (iszero): Wrap C++ bits in extern
+ "C++", to override a potential extern "C" directive around the
+ header file inclusion.
+
+2016-10-21 Joseph Myers <joseph@codesourcery.com>
+
+ * benchtests/Makefile (CFLAGS-bench-sqrt.c): New variable.
+
+2016-10-21 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/fpu/fenv_private.h:
+ (_FPU_MASK_ALL): Rename to...
+ (_FPU_ALL_TRAPS): New macro representing ISA VE OE UE ZE and
+ XE FPSCR bits.
+
+ (_FPU_MASK_RN): New macro to mask out ISA RN bits in FPSCR.
+
+ (_FPU_MASK_ROUNDING): Rename to...
+ (_FPU_MASK_NOT_RN_NI): New macro to mask out all but ISA RN and
+ NI bits.
+
+ (_FPU_MASK_EXCEPT_ROUND): Rename to...
+ (_FPU_MASK_TRAPS_RN): New macro to mask out exception enable
+ bits and rounding bits.
+
+ (__libc_feholdbits_ppc): New inline function to mask, set,
+ and pontentially clear FSPCR bits, and change MSR[FE] bits.
+ (libc_feholdexcept_ppc): Redefine using __libc_feholdbits_ppc.
+ (libc_feholdexcept_setround_ppc): Likewise.
+
+ (__libc_femergeenv_ppc): New function to dynamically mask both
+ old and new FP environments and merge.
+ (libc_fesetenv_ppc): Redefine in terms of __libc_femergeenv_ppc.
+ (libc_feresetround_ppc): Likewise.
+ (libc_feupdateenv_test_ppc): Likewise.
+ (libc_feupdateenv_ppc): Likewise.
+
+ (libc_feholdsetround_ppc_ctx): Fix usage to include masking
+ of ISA RN bits, and update macro names.
+ (libc_feholdexcept_setround_ppc_ctx): Remove as it is
+ effectively the same as the previously mentioned function.
+
+ (libc_feupdateenv_ppc_ctx): Replace libc_feupdatedenv_test_ppc
+ usage with fe_resetround_ppc.
+
+ (libc_feholdexcept_setround_ctx): Remove, this doesn't appear
+ to be used.
+ (libc_feholdexcept_setround_ctxf): Likewise.
+ (libc_feholdexcept_setround_ctxl): Likewise.
+
+2016-10-21 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20715]
+ * math/math.h [__cplusplus] (iszero): Define as function template.
+ * math/Makefile [CXX] (tests): Add test-math-iszero.
+ (CFLAGS-test-math-iszero.cc): Set.
+ * math/test-math-iszero.cc: New file.
+
+2016-10-20 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #20660]
+ * sysdeps/arm/e_sqrt.c: New file.
+ * sysdeps/arm/e_sqrtf.c: Likewise.
+
+2016-10-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #20718]
+ * sysdeps/powerpc/powerpc32/fpu/s_copysignl.S (__copysignl): Do
+ not use floating-point comparisons to test sign.
+ * sysdeps/powerpc/powerpc64/fpu/s_copysignl.S (__copysignl):
+ Likewise.
+
+ * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (getpayload): New declaration.
+ * math/Versions (getpayload): New libm symbol at version
+ GLIBC_2.25.
+ (getpayloadf): Likewise.
+ (getpayloadl): Likewise.
+ * math/Makefile (libm-calls): Add s_getpayloadF.
+ * math/libm-test.inc: Include <nan-high-order-bit.h>.
+ (struct test_f_f_data): Add comment.
+ (RUN_TEST_fp_f): New macro.
+ (RUN_TEST_LOOP_fp_f): Likewise.
+ (getpayload_test_data): New array.
+ (getpayload_test): New function.
+ (main): Call getpayload_test.
+ * math/gen-libm-test.pl (parse_args): Handle 'p' in argument
+ descriptor.
+ * manual/arith.texi (FP Bit Twiddling): Document getpayload,
+ getpayloadf and getpayloadl.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+ * sysdeps/ieee754/dbl-64/s_getpayload.c: New file.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_getpayloadf.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_getpayloadl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_getpayloadl.c: Likewise.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-10-18 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/Makefile [$(subdir) = math] (tests): Move
+ tst-fallocate{64}.
+ * sysdeps/unix/sysv/linux/tst-fallocate-common.c: Check for EOPNOTSUPP
+ on syscall return.
+
+2016-10-17 Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #20689]
+ * sysdeps/x86/cpu-features.c: Only enable FMA and AVX2 if AVX is
+ usable.
+
+2016-10-17 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/generic/nan-high-order-bit.h: New file.
+ * sysdeps/hppa/nan-high-order-bit.h: Likewise.
+ * sysdeps/mips/nan-high-order-bit.h: Likewise.
+ * sysdeps/hppa/math_private.h: Remove file.
+ * sysdeps/mips/math_private.h (HIGH_ORDER_BIT_IS_SET_FOR_SNAN): Do
+ not define here.
+ * sysdeps/ieee754/dbl-64/s_issignaling.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/dbl-64/s_totalorder.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/dbl-64/s_totalordermag.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/flt-32/s_issignalingf.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/flt-32/s_totalorderf.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/flt-32/s_totalordermagf.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-128/s_issignalingl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-128/s_totalorderl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-128/s_totalordermagl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-96/s_issignalingl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-96/s_totalorderl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+ * sysdeps/ieee754/ldbl-96/s_totalordermagl.c: Include
+ <nan-high-order-bit.h>.
+ [HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
+
+2016-10-17 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * sysdeps/s390/fpu/fix-fp-int-compare-invalid.h: New file.
+
+2016-09-22 John David Anglin <dave.anglin@bell.net>
+
+ * sysdeps/unix/sysv/linux/hppa/atomic-machine.h: Don't include
+ abort-instr.h.
+ (EFAULT): Remove conditional define.
+ (ENOSYS): Likewise.
+ (atomic_compare_and_exchange_val_acq): Use instruction nullification
+ instead of conditional branch instructions.
+
+2016-10-15 Joseph Myers <joseph@codesourcery.com>
+
+ * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (totalordermag): New declaration.
+ * math/tgmath.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (totalordermag):
+ New macro.
+ * math/Versions (totalordermag): New libm symbol at version
+ GLIBC_2.25.
+ (totalordermagf): Likewise.
+ (totalordermagl): Likewise.
+ * math/Makefile (libm-calls): Add s_totalordermagF.
+ * math/libm-test.inc (totalordermag_test_data): New array.
+ (totalordermag_test): New function.
+ (main): Call totalordermag_test.
+ * math/test-tgmath.c (NCALLS): Increase to 125.
+ (F(compile_test)): Call totalordermag.
+ (F(totalordermag)): New function.
+ * manual/arith.texi (FP Comparison Functions): Document
+ totalordermag, totalordermagf and totalordermagl.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+ * sysdeps/ieee754/dbl-64/s_totalordermag.c: New file.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_totalordermagf.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_totalordermagl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_totalordermagl.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
+ totalordermag.
+ (CFLAGS-nldbl-totalordermag.c): New variable.
+ * sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
+ (do_test): Also test totalordermagl.
+ * sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c (do_test):
+ Likewise.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-10-14 Steve Ellcey <sellcey@caviumnetworks.com>
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+2016-10-13 Joseph Myers <joseph@codesourcery.com>
+
+ * math/s_ccosh_template.c (M_DECL_FUNC (__ccosh)): Instead of
+ raising FE_INVALID with feraisexcept in case where part of
+ argument is infinite, subtract that part of argument from itself.
+ * math/s_cexp_template.c (M_DECL_FUNC (__cexp)): Likewise.
+ * math/s_csin_template.c (M_DECL_FUNC (__csin)): Likewise.
+ * math/s_csinh_template.c (M_DECL_FUNC (__csinh)): Likewise.
+
+2016-10-12 Joseph Myers <joseph@codesourcery.com>
+
+ * math/libm-test.inc (totalorder_test_data): Add more tests.
+
+2016-10-12 Adhemerval Zanela <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c:
+ Undefine weak_alias and add a comment why mips64 require
+ versioning.
+
+2016-10-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #20647]
+ * sysdeps/x86/cacheinfo.c (handle_intel): Return -1 if the
+ maximum CPUID level is less than 2.
+
+2016-10-12 Joseph Myers <joseph@codesourcery.com>
+
+ * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (totalorder): New declaration.
+ * math/tgmath.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (totalorder):
+ New macro.
+ * math/Versions (totalorder): New libm symbol at version
+ GLIBC_2.25.
+ (totalorderf): Likewise.
+ (totalorderl): Likewise.
+ * math/Makefile (libm-calls): Add s_totalorderF.
+ * math/gen-libm-test.pl (parse_args): Escape quotes in test name
+ string.
+ * math/libm-test.inc (PAYLOAD_DIG): New macro.
+ (qnan_value_pl): Likewise.
+ (snan_value_pl): Likewise.
+ (qnan_value): Define using qnan_value_pl.
+ (snan_value): Define using snan_value_pl.
+ (struct test_ff_i_data): Add comment about which tests use this
+ structure.
+ (RUN_TEST_ff_b): New macro.
+ (RUN_TEST_LOOP_ff_b): Likewise.
+ (totalorder_test_data): New array.
+ (totalorder_test): New function.
+ (main): Call totalorder_test.
+ * math/test-tgmath.c (NCALLS): Increase to 122.
+ (F(compile_test)): Call totalorder.
+ (F(totalorder)): New function.
+ * manual/arith.texi (FP Comparison Functions): Document
+ totalorder, totalorderf and totalorderl.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+ * sysdeps/ieee754/dbl-64/s_totalorder.c: New file.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_totalorderf.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_totalorderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_totalorderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c: Likewise.
+ * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
+ totalorder.
+ (CFLAGS-nldbl-totalorder.c): New variable.
+ * sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c: New
+ file.
+ * sysdeps/ieee754/ldbl-128ibm/Makefile [$(subdir) = math] (tests):
+ Add test-totalorderl-ldbl-128ibm.
+ * sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c: New file.
+ * sysdeps/ieee754/ldbl-96/Makefile [$(subdir) = math] (tests): Add
+ test-totalorderl-ldbl-96.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-10-11 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/Makefile (tests): Add tst-sync_file_range.
+ * sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: Remove file.
+ * sysdeps/sysv/linux/powerpc/powerpc64/sync_file_range.c: Likewise.
+ * sysdeps/unix/sysv/linux/sync_file_range.c: Use SYSCALL_LL64 and
+ remove ENOSYS implementation.
+ * sysdeps/unix/sysv/linux/tst-sync_file_range.c (sync_file_range):
+ Consolidate all Linux implementations.
+
+2016-10-11 Florian Weimer <fweimer@redhat.com>
+
+ * resolv/Makefile (+cflags): Do not set -Wno-write-strings.
+ * resolv/herror.c (herror): Cast away const-ness.
+ * resolv/res_debug.c (__p_class_syms, __p_default_section_syms)
+ (__p_update_section_syms, __p_type_syms, __p_rcode_syms): Likewise.
+
+2016-10-11 Joseph Myers <joseph@codesourcery.com>
+
+ * math/s_ccosh_template.c (M_DECL_FUNC (__ccosh)): Use M_NAN
+ instead of M_NAN + M_NAN.
+ * math/s_csinh_template.c (M_DECL_FUNC (__csinh)): Likewise.
+
+2016-10-10 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * misc/getauxval.c [!HAVE_AUX_VECTOR] (__getauxval): Do not define
+ unused variable 'p'.
+
+2016-10-09 Alan Modra <amodra@gmail.com>
+ Andreas Schwab <schwab@linux-m68k.org>
+
+ [BZ #20554]
+ * sysdeps/powerpc/powerpc32/ppc-mcount.S (_mcount)
+ [PIC && !SHARED]: Set up PIC register for PLT call.
+
+2016-10-07 Joseph Myers <joseph@codesourcery.com>
+
+ * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iseqsig): Define
+ conditional on value of [__FLT_EVAL_METHOD__].
+ * math/test-iseqsig-excess-precision.c: New file.
+ * math/Makefile (tests): Add test-iseqsig-excess-precision.
+
+2016-10-07 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * math/s_iseqsig_template.c: Include math-private.h.
+
+ * posix/Makefile (tests): Add tst-posix_fadvise and tst-posix_fadvise64.
+ * posix/tst-posix_fadvise.c: New file.
+ * posix/tst-posix_fadvise64.c: Likewise.
+ * posix/tst-posix_fadvise-common.c: Likewise.
+ * sysdeps/unix/sysv/linux/arm/kernel-features.h
+ (__ASSUME_FADVISE64_64_6ARG): Define.
+ * sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+ [!__powerpc64__] (__ASSUME_FADVISE64_64_6ARG): Define.
+ * sysdeps/unix/sysv/linux/tile/kernel-features.h
+ [!LP64] (__ASSUME_FADVISE64_64_NO_ALIGN): Define.
+ * sysdeps/unix/sysv/linux/arm/posix_fadvise64.c: Remove file.
+ * sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise64.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
+ (SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) [__posix_fadvise64_l64]:
+ Alias to __posix_fadvise64_l32.
+ (SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) [__posix_fadvise64_l32]:
+ Add compat definition to posix_fadvise64.
+ (SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) [__posix_fadvise64_l64]:
+ Add versioned definition to posix_fadvise64.
+ * sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Build iff
+ __OFF_T_MATCHES_OFF64_T is defined, use INTERNAL_SYSCALL_CALL, add
+ __ASSUME_FADVISE64_64_6ARG/__ASSUME_FADVISE64_64_NO_ALIGN support.
+ * sysdeps/unix/sysv/linux/posix_fadvise64.c (posix_fadvise64): Add
+ __ASSUME_FADVISE64_64_NO_ALIGN support and use INTERNAL_SYSCALL_CALL.
+
+ * io/Makefile (tests): Add tst-posix_fallocate and
+ tst-posix_fallocate64.
+ * io/tst-posix_fallocate-common.c: New file.
+ * io/tst-posix_fallocate.c: Likewise.
+ * io/tst-posix_fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c: Remove
+ file.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/posix_fallocate.c (posix_fallocate): Use
+ SYSCALL_LL to pass both offset and len arguments.
+ * sysdeps/unix/sysv/linux/posix_fallocate64.c (posix_fallocate64):
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/syscalls.list (pwrite64): Add
+ __libc_pwrite64 alias used by posix_fallocate64.
+
+ * sysdeps/unix/sysv/linux/Makefile (test): Add tst-fallocate and
+ tst-fallocate64.
+ * sysdeps/unix/sysv/linux/tst-fallocate.c: New file.
+ * sysdeps/unix/sysv/linux/tst-fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/tst-fallocate-common.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c: Remove file.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/fallocate.c (fallocate): Use SYSCALL_LL
+ macro on offset argument.
+ * sysdeps/unix/sysv/linux/fallocate64.c (fallocate64): Use
+ SYSCALL_LL64 on offset argument.
+
+ * sysdeps/unix/sysv/linux/Makefile (test): Add tst-fallocate and
+ tst-fallocate64.
+ * sysdeps/unix/sysv/linux/tst-fallocate.c: New file.
+ * sysdeps/unix/sysv/linux/tst-fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/tst-fallocate-common.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c: Remove file.
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c: Likewise.
+ * sysdeps/unix/sysv/linux/fallocate.c (fallocate): Use SYSCALL_LL
+ macro on offset argument.
+ * sysdeps/unix/sysv/linux/fallocate64.c (fallocate64): Use
+ SYSCALL_LL64 on offset argument.
+ * test-skeleton.c (FAIL_RET): Add macro.
+ (FAIL_EXIT): Likewise.
+ (FAIL_EXIT1): Likewise.
+ (_FAIL): Likewise.
+
+2016-10-07 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20629]
+ resolv: Remove RES_USEBSTRING and its implementation.
+ * resolv/resolv.h (RES_USEBSTRING): Remove.
+ * resolv/ns_name.c (NS_TYPE_ELT, DNS_LABELTYPE_BITSTRING)
+ (digitvalue, encode_bitstring, decode_bitstring): Remove.
+ (ns_name_ntop, ns_name_pton, ns_name_unpack, ns_name_skip)
+ (labellen): Remove extended label types support.
+ * resolv/res_debug.c (p_option): Remove RES_USEBSTRING handling.
+ * resolv/res_init.c (res_setoptions): Likewise.
+ * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r): Likewise.
+
+2016-10-07 Florian Weimer <fweimer@redhat.com>
+
+ resolv: Remove RES_NOIP6DOTINT and its implementation.
+ * resolv/resolv.h (RES_DEFAULT): Remove RES_NOIP6DOTINT.
+ (RES_NOIP6DOTINT): Remove.
+ * resolv/gethnamaddr.c (gethostbyaddr): Remove RES_NOIP6DOTINT
+ handling.
+ * resolv/res_debug.c (p_option): Likewise.
+ * resolv/res_init.c (res_setoptions): Likewise.
+ * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r): Likewise.
+
+2016-10-07 Florian Weimer <fweimer@redhat.com>
+
+ resolv: Deprecate unimplemented flags.
+ * misc/sys/cdefs.h (__glibc_macro_warning1)
+ (__glibc_macro_warning): Define.
+ * resolv/resolv.h (RES_AAONLY, RES_PRIMARY, RES_NOCHECKNAME)
+ (RES_KEEPTSIG): Mark as deprecated.
+ * resolv/res_debug.c (p_option): Remove RES_AAONLY, RES_PRIMARY,
+ RES_NOCHECKNAME, RES_KEEPTSIG.
+ * resolv/res_init.c (res_setoptions): Remove RES_NOCHECKNAME handling.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * nptl/pt-longjmp.c (DEFINE_LONGJMP): Use libc_ifunc macro.
+ * sysdeps/unix/sysv/linux/s390/pt-longjmp.c (longjmp, siglongjmp):
+ Use strong_alias to create symbols for glibc verison 2.19.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * nptl/pt-system.c (system_ifunc): Use libc_ifunc macro.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * rt/clock-compat.c (COMPAT_REDIRECT): Use libc_ifunc macro.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday):
+ Use libc_ifunc_hidden and libc_hidden_def macro. Redirect ifunced function
+ in header for using it as type for ifunc function because __GI_* symbols
+ for ppc32 do not target the ifunc symbols.
+ * sysdeps/unix/sysv/linux/powerpc/time.c (time): Likewise.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * sysdeps/unix/sysv/linux/x86/gettimeofday.c (__gettimeofday):
+ Use libc_ifunc_hidden macro. Use libc_hidden_def instead of
+ libc_ifunc_hidden_def.
+ * sysdeps/unix/sysv/linux/x86/time.c (time): Likewise.
+ * sysdeps/unix/sysv/linux/i386/gettimeofday.c (__gettimeofday):
+ Redirect ifunced function in header for using it as type of ifunc'ed
+ function. Redefine libc_hidden_def to use fallback non ifunc'ed
+ function for __GI_* symbol.
+ * sysdeps/unix/sysv/linux/i386/time.c (time): Likewise.
+ * include/libc-symbols.h
+ (libc_ifunc_hidden_def, libc_ifunc_hidden_def1): Delete macro.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ [BZ #20478]
+ * sysdeps/s390/multiarch/ifunc-resolve.h
+ (s390_vx_libc_ifunc2, s390_libc_ifunc): Use __ifunc from libc-symbols.h
+ to create ifunc symbols.
+ (s390_vx_libc_ifunc_init, s390_vx_libc_ifunc_redirected
+ , s390_vx_libc_ifunc2_redirected, s390_libc_ifunc_init): New define.
+ * sysdeps/s390/multiarch/memchr.c: Redirect ifunced function in header
+ for using it as type for ifunc function.
+ * sysdeps/s390/multiarch/mempcpy.c: Likewise.
+ * sysdeps/s390/multiarch/rawmemchr.c: Likewise.
+ * sysdeps/s390/multiarch/stpcpy.c: Likewise.
+ * sysdeps/s390/multiarch/stpncpy.c: Likewise.
+ * sysdeps/s390/multiarch/strcat.c: Likewise.
+ * sysdeps/s390/multiarch/strchr.c: Likewise.
+ * sysdeps/s390/multiarch/strcmp.c: Likewise.
+ * sysdeps/s390/multiarch/strcpy.c: Likewise.
+ * sysdeps/s390/multiarch/strcspn.c: Likewise.
+ * sysdeps/s390/multiarch/strlen.c: Likewise.
+ * sysdeps/s390/multiarch/strncmp.c: Likewise.
+ * sysdeps/s390/multiarch/strncpy.c: Likewise.
+ * sysdeps/s390/multiarch/strnlen.c: Likewise.
+ * sysdeps/s390/multiarch/strpbrk.c: Likewise.
+ * sysdeps/s390/multiarch/strrchr.c: Likewise.
+ * sysdeps/s390/multiarch/strspn.c: Likewise.
+ * sysdeps/s390/multiarch/wcschr.c: Likewise.
+ * sysdeps/s390/multiarch/wcscmp.c: Likewise.
+ * sysdeps/s390/multiarch/wcspbrk.c: Likewise.
+ * sysdeps/s390/multiarch/wcsspn.c: Likewise.
+ * sysdeps/s390/multiarch/wmemchr.c: Likewise.
+ * sysdeps/s390/multiarch/wmemset.c: Likewise.
+ * sysdeps/s390/s390-32/multiarch/memcmp.c: Likewise.
+ * sysdeps/s390/s390-32/multiarch/memcpy.c: Likewise.
+ * sysdeps/s390/s390-32/multiarch/memset.c: Likewise.
+ * sysdeps/s390/s390-64/multiarch/memcmp.c: Likewise.
+ * sysdeps/s390/s390-64/multiarch/memcpy.c: Likewise.
+ * sysdeps/s390/s390-64/multiarch/memset.c: Likewise.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * include/libc-symbols.h (__ifunc_resolver):
+ New macro is used by __ifunc* macros.
+ (__ifunc): New macro uses gcc attribute ifunc or inline assembly
+ depending on HAVE_GCC_IFUNC.
+ (libc_ifunc, libm_ifunc): Use __ifunc as base macro.
+ (libc_ifunc_redirected, libc_ifunc_hidden, libm_ifunc_init): New macro.
+ * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c:
+ Redirect ifunced function in header for using as type for ifunc function.
+ * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/memset.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c: Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c: Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c: Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c: Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c: Likewise.
+ * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/memcmp.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/mempcpy.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/stpncpy.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strcat.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strchr.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strcmp.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strcpy.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strncmp.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strncpy.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strnlen.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strrchr.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/strstr.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise.
+ * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c:
+ Add libc_hidden_def() and use libc_ifunc_hidden() macro
+ instead of libc_ifunc() macro.
+ * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c: Likewise.
+ * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Likewise.
+
+2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * config.h.in (HAVE_GCC_IFUNC): New undef.
+ * configure.ac: Add check if gcc supports attribute ifunc feature.
+ * configure: Regenerated.
+ * manual/install.texi: Add recommendation for gcc with
+ indirect-function support.
+ * INSTALL: Regenerated.
+
+2016-10-06 Joseph Myers <joseph@codesourcery.com>
+
+ * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iseqsig): New
+ macro.
+ * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (__iseqsig): New declaration.
+ * math/s_iseqsig_template.c: New file.
+ * math/Versions (__iseqsigf): New libm symbol at version
+ GLIBC_2.25.
+ (__iseqsig): Likewise.
+ (__iseqsigl): Likewise.
+ * math/libm-test.inc (iseqsig_test_data): New array.
+ (iseqsig_test): New function.
+ (main): Call iseqsig_test.
+ * math/Makefile (gen-libm-calls): Add s_iseqsigF.
+ * manual/arith.texi (FP Comparison Functions): Document iseqsig.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+ * sysdeps/generic/fix-fp-int-compare-invalid.h: New file.
+ * sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h: Likewise.
+ * sysdeps/x86/fpu/fix-fp-int-compare-invalid.h: Likewise.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-10-06 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute, do_sincos_1,
+ do_sincos_2, sloww, sloww1): Update comments.
+
+ * sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Adjust calls to
+ do_sincos_1 and do_sincos_2 to pass a boolean shift_quadrant.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute): Make
+ K boolean and rename it.
+ (__sin): Adjust.
+ (__cos): Adjust.
+
+2016-10-06 Rical Jasan <ricaljasan@pacific.net>
+ Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * manual/nss.texi: Fix typos in the manual.
+
+2016-10-06 Rical Jasan <ricaljasan@pacific.net>
+
+ * manual/contrib.texi: Fix typos in the manual.
+
+ * manual/maint.texi: Fix typos in the manual.
+
+ * manual/install.texi: Fix typos in the manual.
+ * INSTALL: Regenerated.
+
+ * manual/lang.texi: Fix typos in the manual.
+
+ * manual/probes.texi: Fix typos in the manual.
+
+ * manual/threads.texi: Fix typos in the manual.
+
+ * manual/debug.texi: Fix typos in the manual.
+
+ * manual/crypt.texi: Fix typos in the manual.
+
+ * manual/conf.texi: Fix typos in the manual.
+
+ * manual/sysinfo.texi: Fix typos in the manual.
+
+ * manual/users.texi: Fix typos in the manual.
+
+ * manual/job.texi: Fix typos in the manual.
+
+ * manual/process.texi: Fix typos in the manual.
+
+ * manual/argp.texi: Fix typos in the manual.
+ * manual/getopt.texi: Likewise.
+ * manual/startup.texi: Likewise.
+
+ * manual/signal.texi: Fix typos in the manual.
+
+ * manual/setjmp.texi: Fix typos in the manual.
+
+ * manual/resource.texi: Fix typos in the manual.
+
+ * manual/time.texi: Fix typos in the manual.
+
+ * manual/arith.texi: Fix typos in the manual.
+
+ * manual/math.texi: Fix typos in the manual.
+
+ * manual/syslog.texi: Fix typos in the manual.
+
+ * manual/terminal.texi: Fix typos in the manual.
+
+ * manual/socket.texi: Fix typos in the manual.
+
+ * manual/filesys.texi: Fix typos in the manual.
+
+ * manual/llio.texi: Fix typos in the manual.
+
+ * manual/stdio.text: Fix typos in the manual.
+
+2016-10-05 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (do_sincos_1): Check N
+ instead of K1.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (do_sincos_1): Rename K to
+ SHIFT_QUADRANT and make it bool.
+ (do_sincos_2): Likewise.
+ (sloww): Likewise.
+ (sloww1): Likewise.
+ (__sin): Adjust calls to do_sincos_1 and do_sincos_2.
+ (__cos): Likewise.
+
+2016-10-05 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
+
+2016-10-04 Joseph Myers <joseph@codesourcery.com>
+
+ * include/limits.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH):
+ Define to __WORDSIZE, not conditional on [LONG_MAX ==
+ 0x7fffffffL].
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise.
+
+2016-10-04 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ * sysdeps/powerpc/sys/platform/ppc.h (__ppc_get_timebase): Replace
+ inline by __inline__.
+ (__ppc_yield, __ppc_mdoio, __ppc_mdoom, __ppc_set_ppr_med): Likewise.
+ (__ppc_set_ppr_med_low, __ppc_set_ppr_low): Likewise.
+ (__ppc_set_ppr_very_low, __ppc_set_ppr_med_high): Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Require
+ sigset_t from signal.h.
+ * sysdeps/unix/sysv/linux/powerpc/sys/user.h: Include stddef.h,
+ which is already required.
+
+2016-10-04 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * sysdeps/s390/fpu/libm-test-ulps: Regenerated.
+
+2016-10-03 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/gnu/netinet/tcp.h (TCP_REPAIR_WINDOW): New macro.
+ (struct tcp_repair_window): New type.
+
+2016-10-02 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * libio/tst-memstream3.c: Include string.h.
+
+2016-09-30 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #18241]
+ [BZ #20181]
+ * libio/Makefile (test): Add tst-memstream3 and tst-wmemstream3.
+ * libio/memstream.c (_IO_mem_sync): Only append a null byte if
+ write position is at the end the buffer.
+ * libio/wmemstream.c (_IO_wmem_sync): Likewise.
+ * libio/strops.c (_IO_str_switch_to_get_mode): New function.
+ (_IO_str_seekoff): Set correct offset from negative displacement and
+ set EINVAL for invalid ones.
+ * libio/wstrops.c (enlarge_userbuf): Use correct function to calculate
+ buffer length.
+ (_IO_wstr_switch_to_get_mode): New function.
+ (_IO_wstr_seekoff): Set correct offset from negative displacement and
+ set EINVAL for invalid ones.
+ * libio/tst-memstream3.c: New file.
+ * libio/tst-wmemstream3.c: Likewise.
+ * manual/examples/memstrm.c: Remove warning when priting size_t.
+
+2016-09-30 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/ieee754/dbl-64/dla.h [__FP_FAST_FMA] (DLA_FMS): Define
+ macro to use __builtin_fma.
+ * sysdeps/x86_64/fpu/dla.h: Remove file.
+
+ * sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
+ [__NO_LONG_DOUBLE_MATH] (__iscanonicall): Do not declare.
+ [__NO_LONG_DOUBLE_MATH] (iscanonical): Define to evaluate to 1.
+
+2016-09-30 Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #20292]
+ * elf/Makefile (routines): Add dl-addr-obj.
+ [ifeq (yesyes,$(have-fpie)$(build-shared))] (tests): Add
+ tst-_dl_addr_inside_object.
+ [ifeq (yesyes,$(have-fpie)$(build-shared))] (tests-pie): Likewise.
+ [ifeq (yesyes,$(have-fpie)$(build-shared))]
+ ($(objpfx)tst-_dl_addr_inside_object): Add $(objpfx)dl-addr-obj.os.
+ [ifeq (yesyes,$(have-fpie)$(build-shared))]
+ (CFLAGS-tst-_dl_addr_inside_object.c): Add $(PIE-ccflag).
+ * elf/dl-addr.c: Remove _dl_addr_inside_object function.
+ * elf/dl-open.c: Likewise.
+ * elf/dl-addr-obj.c: New file.
+ * elf/tst-_dl_addr_inside_object.c: New file.
+
+2016-09-30 Joseph Myers <joseph@codesourcery.com>
+
+ * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Include
+ <bits/iscanonical.h>.
+ * bits/iscanonical.h: New file.
+ * math/s_iscanonicall.c: Likewise.
+ * math/Versions (__iscanonicall): New libm symbol at version
+ GLIBC_2.25.
+ * math/libm-test.inc (iscanonical_test_data): New array.
+ (iscanonical_test): New function.
+ (main): Call iscanonical_test.
+ * math/Makefile (headers): Add bits/iscanonical.h.
+ (type-ldouble-routines): Add s_iscanonicall.
+ * manual/arith.texi (Floating Point Classes): Document
+ iscanonical.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+ * sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h: New file.
+ * sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/test-iscanonical-ldbl-128ibm.c:
+ Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/Makefile (tests): Add
+ test-iscanonical-ldbl-128ibm.
+ * sysdeps/ieee754/ldbl-96/bits/iscanonical.h: New file.
+ * sysdeps/ieee754/ldbl-96/s_iscanonicall.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/test-iscanonical-ldbl-96.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/Makefile: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-09-29 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * string/bits/string3.h: Remove C++ style comments.
+
+2016-09-29 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (do_sincos_1): Use copysign
+ instead of ternary condition.
+ (do_sincos_2): Likewise.
+ (__sin): Likewise.
+ (__cos): Likewise.
+ (slow): Likewise.
+ (sloww): Likewise.
+ (sloww1): Likewise.
+ (bsloww): Likewise.
+ (bsloww1): Likewise.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (do_cos_slow): use copysign
+ instead of ternary condition.
+ (do_sin_slow): Likewise.
+ (do_sincos_1): Likewise.
+ (do_sincos_2): Likewise.
+ (__cos): Likewise.
+ (sloww): Likewise.
+ (sloww1): Likewise.
+ (sloww2): Likewise.
+ (bsloww): Likewise.
+ (bsloww1): Likewise.
+ (bsloww2): Likewise.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (slow1): Consolidate sign
+ check from here...
+ (slow2): ... and here...
+ (__sin): ... to here.
+
+2016-09-28 Joseph Myers <joseph@codesourcery.com>
+
+ * math/math.h
+ [__GLIBC_USE (IEC_60559_BFP_EXT) && !__SUPPORT_SNAN__] (iszero):
+ Cast argument to its own type.
+ * math/test-iszero-excess-precision.c: New file.
+ * math/Makefile (tests): Add test-iszero-excess-precision.
+ (CFLAGS-test-iszero-excess-precision.c): New variable.
+
+2016-09-28 Rasmus Villemoes <rv@rasmusvillemoes.dk>
+
+ * sysdeps/unix/sysv/linux/spawni.c (posix_spawn_args): Remove pipe
+ field, add err field.
+ (__spawni_child): Report error through err member instead of pipe.
+ (__spawnix): Likewise.
+
+2016-09-28 Zack Weinberg <zackw@panix.com>
+
+ * scripts/check-installed-headers.sh: Generalize treatment of
+ sys/elf.h to all target architectures.
+
+ * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Restore accidentally-
+ deleted typedef ucontext_t.
+
+2016-09-26 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysdep.h (__INTERNAL_SYSCALL0): New macro.
+ (__INTERNAL_SYSCALL1): Likewise.
+ (__INTERNAL_SYSCALL2): Likewise.
+ (__INTERNAL_SYSCALL3): Likewise.
+ (__INTERNAL_SYSCALL4): Likewise.
+ (__INTERNAL_SYSCALL5): Likewise.
+ (__INTERNAL_SYSCALL6): Likewise.
+ (__INTERNAL_SYSCALL7): Likewise.
+ (__INTERNAL_SYSCALL_NARGS_X): Likewise.
+ (__INTERNAL_SYSCALL_NARGS): Likewise.
+ (__INTERNAL_SYSCALL_DISP): Likewise.
+ (INTERNAL_SYSCALL_CALL): Likewise.
+ (__SYSCALL0): Rename to __INLINE_SYSCALL0.
+ (__SYSCALL1): Rename to __INLINE_SYSCALL1.
+ (__SYSCALL2): Rename to __INLINE_SYSCALL2.
+ (__SYSCALL3): Rename to __INLINE_SYSCALL3.
+ (__SYSCALL4): Rename to __INLINE_SYSCALL4.
+ (__SYSCALL5): Rename to __INLINE_SYSCALL5.
+ (__SYSCALL6): Rename to __INLINE_SYSCALL6.
+ (__SYSCALL7): Rename to __INLINE_SYSCALL7.
+ (__SYSCALL_NARGS_X): Rename to __INLINE_SYSCALL_NARGS_X.
+ (__SYSCALL_NARGS): Rename to __INLINE_SYSCALL_NARGS.
+ (__SYSCALL_DISP): Rename to __INLINE_SYSCALL_DISP.
+ (__SYSCALL_CALL): Rename to INLINE_SYSCALL_CALL.
+ (SYSCALL_CANCEL): Replace __SYSCALL_CALL with INLINE_SYSCALL_CALL.
+
+2016-09-23 Joseph Myers <joseph@codesourcery.com>
+
+ * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iszero): New
+ macro.
+ * math/libm-test.inc (iszero_test_data): New array.
+ (iszero_test): New function.
+ (main): Call iszero_test.
+ * manual/arith.texi (Floating Point Classes): Document iszero.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+
+2016-09-23 Zack Weinberg <zackw@panix.com>
+
+ * scripts/check-installed-headers.sh: New script.
+ * Rules: In each directory that defines header files to be installed,
+ run check-installed-headers.sh on them as a special test.
+ * Makefile: Likewise for the headers installed at top level.
+
+ * include/aliases.h, include/alloca.h, include/argz.h
+ * include/arpa/nameser.h, include/arpa/nameser_compat.h
+ * include/elf.h, include/envz.h, include/err.h
+ * include/execinfo.h, include/fpu_control.h, include/getopt.h
+ * include/gshadow.h, include/ifaddrs.h, include/libintl.h
+ * include/link.h, include/malloc.h, include/mcheck.h
+ * include/mntent.h, include/netinet/ether.h
+ * include/nss.h, include/obstack.h, include/printf.h
+ * include/pty.h, include/resolv.h, include/rpc/auth.h
+ * include/rpc/auth_des.h, include/rpc/auth_unix.h
+ * include/rpc/clnt.h, include/rpc/des_crypt.h
+ * include/rpc/key_prot.h, include/rpc/netdb.h
+ * include/rpc/pmap_clnt.h, include/rpc/pmap_prot.h
+ * include/rpc/pmap_rmt.h, include/rpc/rpc.h
+ * include/rpc/rpc_msg.h, include/rpc/svc.h
+ * include/rpc/svc_auth.h, include/rpc/xdr.h
+ * include/rpcsvc/nis_callback.h, include/rpcsvc/nislib.h
+ * include/rpcsvc/yp.h, include/rpcsvc/ypclnt.h
+ * include/rpcsvc/ypupd.h, include/shadow.h
+ * include/stdio_ext.h, include/sys/epoll.h
+ * include/sys/file.h, include/sys/gmon.h, include/sys/ioctl.h
+ * include/sys/prctl.h, include/sys/profil.h
+ * include/sys/statfs.h, include/sys/sysctl.h
+ * include/sys/sysinfo.h, include/ttyent.h, include/utmp.h
+ * sysdeps/arm/nacl/include/bits/setjmp.h
+ * sysdeps/mips/include/sys/asm.h
+ * sysdeps/unix/sysv/linux/include/sys/sysinfo.h
+ * sysdeps/unix/sysv/linux/include/sys/timex.h
+ * sysdeps/x86/fpu/include/bits/fenv.h:
+ Add #ifndef _ISOMAC guard around internal declarations.
+ Add multiple-inclusion guard if not already present.
+
+2016-09-23 Zack Weinberg <zackw@panix.com>
+
+ * sysdeps/generic/sys/ucontext.h
+ * sysdeps/arm/sys/ucontext.h
+ * sysdeps/i386/sys/ucontext.h
+ * sysdeps/m68k/sys/ucontext.h
+ * sysdeps/mips/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/arm/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/sh/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/tile/sys/ucontext.h
+ * sysdeps/unix/sysv/linux/x86/sys/ucontext.h:
+ Include both bits/sigcontext.h and bits/sigstack.h.
+ Fix grammar error in comment, if present.
+
+ * bits/sigstack.h
+ * sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
+ * sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
+ * sysdeps/unix/sysv/linux/bits/sigstack.h
+ * sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
+ * sysdeps/unix/sysv/linux/mips/bits/sigstack.h
+ * sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
+ * sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
+ * bits/sigcontext.h
+ * sysdeps/mach/hurd/i386/bits/sigcontext.h
+ * sysdeps/unix/sysv/linux/bits/sigcontext.h
+ * sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
+ * sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h:
+ Add multiple inclusion guard. Permit inclusion by sys/ucontext.h
+ as well as signal.h, if this was not already allowed. Request
+ definition of size_t if necessary. Minimize semantically-null
+ differences across files.
+
+2016-09-23 Zack Weinberg <zackw@panix.com>
+
+ * time/time.h, bits/time.h, sysdeps/unix/sysv/linux/bits/time.h:
+ Remove all logic conditional on __need macros. Move all the
+ conditionally defined types to their own headers...
+ * time/bits/types/clock_t.h: Define clock_t here.
+ * time/bits/types/clockid_t.h: Define clockid_t here.
+ * time/bits/types/struct_itimerspec.h: Define struct itimerspec here.
+ * time/bits/types/struct_timespec.h: Define struct timespec here.
+ * time/bits/types/struct_timeval.h: Define struct timeval here.
+ * time/bits/types/struct_tm.h: Define struct tm here.
+ * time/bits/types/time_t.h: Define time_t here.
+ * time/bits/types/timer_t.h: Define timer_t here.
+ * time/Makefile: Install the new headers.
+
+ * bits/resource.h, io/fcntl.h, io/sys/poll.h, io/sys/stat.h
+ * io/utime.h, misc/sys/select.h, posix/sched.h, posix/sys/times.h
+ * posix/sys/types.h, resolv/netdb.h, rt/aio.h, rt/mqueue.h
+ * signal/signal.h, pthread/semaphore.h, sysdeps/nptl/pthread.h
+ * sysdeps/unix/sysv/linux/alpha/bits/resource.h
+ * sysdeps/unix/sysv/linux/alpha/sys/acct.h
+ * sysdeps/unix/sysv/linux/bits/resource.h
+ * sysdeps/unix/sysv/linux/bits/timex.h
+ * sysdeps/unix/sysv/linux/mips/bits/resource.h
+ * sysdeps/unix/sysv/linux/net/ppp_defs.h
+ * sysdeps/unix/sysv/linux/sparc/bits/resource.h
+ * sysdeps/unix/sysv/linux/sys/acct.h
+ * sysdeps/unix/sysv/linux/sys/timerfd.h
+ * sysvipc/sys/msg.h, sysvipc/sys/sem.h, sysvipc/sys/shm.h
+ * time/sys/time.h, time/sys/timeb.h
+ Use the new bits/types headers.
+
+ * include/time.h: Remove __need logic.
+ * include/bits/time.h
+ * include/bits/types/clock_t.h, include/bits/types/clockid_t.h
+ * include/bits/types/time_t.h, include/bits/types/timer_t.h
+ * include/bits/types/struct_itimerspec.h
+ * include/bits/types/struct_timespec.h
+ * include/bits/types/struct_timeval.h
+ * include/bits/types/struct_tm.h:
+ New wrapper headers.
+
+2016-09-23 Zack Weinberg <zackw@panix.com>
+
+ * sysdeps/mach/hurd/net/if_ppp.h
+ * sysdeps/unix/sysv/linux/net/if_ppp.h:
+ Only define struct ifpppstatsreq and struct ifpppcstatsreq
+ if __USE_MISC is defined, to ensure struct ifreq is declared.
+
+ * inet/netinet/ether.h: Condition all function prototypes
+ on __USE_MISC, to ensure struct ether_addr is declared.
+
+ * socket/bits/types/struct_osockaddr.h: New header.
+ * include/bits/types/struct_osockaddr.h: New wrapper.
+ * socket/Makefile: Install the new header.
+ * socket/sys/socket.h, inet/protocols/talkd.h:
+ Refer to bits/types/struct_osockaddr.h for the definition of
+ struct osockaddr.
+
+2016-09-23 Zack Weinberg <zackw@panix.com>
+
+ * bits/in.h, gmon/sys/gmon.h, inet/netinet/igmp.h
+ * inet/protocols/routed.h, inet/protocols/talkd.h
+ * inet/protocols/timed.h, io/fts.h, nptl_db/thread_db.h
+ * resolv/arpa/nameser.h, resolv/resolv.h, sunrpc/rpc/rpc_des.h
+ * sysdeps/generic/netinet/if_ether.h
+ * sysdeps/generic/netinet/in_systm.h
+ * sysdeps/generic/netinet/ip.h, sysdeps/generic/netinet/tcp.h
+ * sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h
+ * sysdeps/gnu/netinet/udp.h, sysdeps/mach/hurd/net/ethernet.h
+ * sysdeps/mach/hurd/net/if_arp.h
+ * sysdeps/mach/hurd/net/if_ppp.h
+ * sysdeps/mach/hurd/net/route.h, sysdeps/mach/sys/reboot.h
+ * sysdeps/unix/sysv/linux/bits/in.h
+ * sysdeps/unix/sysv/linux/net/ethernet.h
+ * sysdeps/unix/sysv/linux/net/if_arp.h
+ * sysdeps/unix/sysv/linux/net/if_ppp.h
+ * sysdeps/unix/sysv/linux/net/if_shaper.h
+ * sysdeps/unix/sysv/linux/net/route.h
+ * sysdeps/unix/sysv/linux/netinet/if_ether.h
+ * sysdeps/unix/sysv/linux/netinet/if_fddi.h
+ * sysdeps/unix/sysv/linux/netinet/if_tr.h
+ * sysdeps/unix/sysv/linux/netipx/ipx.h
+ * sysdeps/unix/sysv/linux/sys/acct.h
+ * include/arpa/nameser.h, include/resolv.h:
+ Change all uses of u_char to unsigned char,
+ u_short and ushort to unsigned short, u_int and uint to unsigned int,
+ u_long and ulong to unsigned long, u_int8_t to uint8_t,
+ u_int16_t to uint16_t, u_int32_t to uint32_t, quad_t to int64_t,
+ and u_int64_t and u_quad_t to uint64_t.
+
+ * mach/sys/reboot.h: Remove two casts of integer literals
+ to the types they already have.
+
+ * bits/in.h: Correct error in description of IP_MULTICAST_LOOP.
+ * sysdeps/unix/sysv/linux/bits/in.h: Likewise.
+ * sysdeps/unix/sysv/linux/netinet/if_ether.h: Change a comment
+ from referring to 'unsigned char' to 'uint8_t' for consistency with
+ the macro definition below.
+
+ * gmon/sys/gmon.h, inet/netinet/igmp.h, inet/protocols/talkd.h
+ * io/fts.h, resolv/arpa/nameser.h, resolv/resolv.h
+ * sunrpc/rpc/rpc_des.h, sysdeps/generic/netinet/ip.h
+ * sysdeps/gnu/netinet/tcp.h, sysdeps/gnu/netinet/udp.h
+ * sysdeps/mach/hurd/net/if_ppp.h, sysdeps/unix/sysv/linux/net/if_ppp.h
+ * sysdeps/unix/sysv/linux/sys/acct.h
+ * include/arpa/nameser.h, include/resolv.h:
+ Fix indentation disrupted by mechanical edits.
+
+ * inet/protocols/talkd.h, resolv/arpa/nameser.h
+ * sysdeps/generic/netinet/in_systm.h
+ * sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h
+ * sysdeps/gnu/netinet/udp.h
+ * sysdeps/unix/sysv/linux/net/ethernet.h
+ * sysdeps/unix/sysv/linux/net/if_arp.h
+ * sysdeps/unix/sysv/linux/net/if_ppp.h
+ * sysdeps/unix/sysv/linux/net/if_shaper.h
+ * sysdeps/unix/sysv/linux/netinet/if_fddi.h
+ * sysdeps/unix/sysv/linux/netinet/if_tr.h
+ * sysdeps/unix/sysv/linux/netipx/ipx.h
+ * sysdeps/unix/sysv/linux/sys/acct.h
+ Include stdint.h for uintNN_t definitions.
+ Don't include sys/cdefs.h, features.h, or asm/types.h directly.
+
+2016-09-23 Zack Weinberg <zackw@panix.com>
+
+ * rpcsvc/nislib.h: Include rpcsvc/nis.h.
+ * sysdeps/unix/sysv/linux/netrose/rose.h:
+ Include sys/socket.h and netax25/ax25.h.
+
+ * inet/netinet/icmp6.h, inet/netinet/ip6.h
+ * resolv/arpa/nameser_compat.h:
+ Use __BYTE_ORDER etc. instead of BYTE_ORDER etc.
+
+ * sysdeps/unix/sysv/linux/sys/quota.h:
+ Use __caddr_t instead of caddr_t.
+ * sysdeps/unix/sysv/linux/sys/timerfd.h:
+ Use __clockid_t instead of clockid_t.
+
+ * sysvipc/sys/ipc.h: Remove unnecessary #warning.
+
+ * argp/argp.h: Check whether _LIBC is defined before expanding it.
+ * posix/glob.h: Check whether __USE_XOPEN2K8 is defined instead of
+ expanding it.
+
+ * misc/sys/cdefs.h: Tidy up conditional nest defining __flexarr.
+ Define __glibc_c99_flexarr_available to 1 when the compiler
+ supports C99-compatible flexible array members, 0 otherwise.
+ * sysdeps/unix/sysv/linux/bits/socket.h
+ * sysdeps/mach/hurd/bits/socket.h
+ * bits/socket.h: Use __glibc_c99_flexarr_available in
+ definitions of struct cmsghdr and CMSG_DATA.
+
+2016-09-23 Florian Weimer <fweimer@redhat.com>
+
+ * manual/nss.texi (NSS Modules Interface): Adjust function return
+ type to enum nss_status. Document errnop argument. Clarify
+ h_errnop semantics. Fix cross-reference formatting.
+ (NSS Module Function Internals): Mention that *errnop needs to be
+ set on failure, but not to zero.
+
+2016-09-23 Florian Weimer <fweimer@redhat.com>
+
+ * io/tst-open-tmpfile.c (wrap_open64, wrap_openat64)
+ (get_random_name): New functions.
+ (check_wrapper_flags_mode): Use linkat to give the new file a name
+ determined by get_random_name.
+ (do_test): Add calls to test open64 and openat64.
+
+2016-09-23 Florian Weimer <fweimer@redhat.com>
+
+ * test-skeleton.c: Remove #include <stdarg.h>.
+
+2016-09-21 Alexandre Oliva <aoliva@redhat.com>
+
+ [BZ #19826]
+ * elf/dl-tls.c (_dl_allocate_tls_init): Restore DTV early
+ initialization of static TLS entries.
+ * elf/dl-reloc.c (_dl_nothread_init_static_tls): Likewise.
+ * nptl/allocatestack.c (init_one_static_tls): Likewise.
+
+2016-09-22 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * hurd/hurdmalloc.c (malloc_fork_prepare): Rename to
+ _hurd_malloc_fork_prepare.
+ (malloc_fork_parent): Rename to _hurd_malloc_fork_parent.
+ (malloc_fork_child): Rename to _hurd_malloc_fork_child.
+ (_hurd_fork_prepare_hook): Drop malloc_fork_prepare.
+ (_hurd_fork_parent_hook): Drop malloc_fork_parent.
+ (_hurd_fork_child_hook): Drop malloc_fork_child.
+ * hurd/hurdmalloc.h (_hurd_malloc_fork_prepare,
+ _hurd_malloc_fork_parent, _hurd_malloc_fork_child): Add declarations.
+ * sysdeps/mach/hurd/fork.c (__fork): Call __malloc_fork_lock_parent
+ after locking locks (notably hurd_dtable_lock). Call
+ _hurd_malloc_fork_prepare after that. Call _hurd_malloc_fork_parent
+ before __malloc_fork_unlock_parent and _hurd_malloc_fork_child before
+ __malloc_fork_unlock_child.
+ * sysdeps/mach/i386/syscall.S (syscall): Push back syscall number.
+
+2016-09-21 James Greenhalgh <james.greenhalgh@arm.com>
+
+ * soft-fp/extendhftf2.c: New.
+ * soft-fp/fixhfti.c: Likewise.
+ * soft-fp/fixunshfti.c: Likewise.
+ * soft-fp/floattihf.c: Likewise.
+ * soft-fp/floatuntihf.c: Likewise.
+ * soft-fp/half.h: Likewise.
+ * soft-fp/trunctfhf2.c: Likewise.
+
+2016-09-21 Joseph Myers <joseph@codesourcery.com>
+
+ * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (issubnormal): New
+ macro.
+ * math/libm-test.inc (issubnormal_test_data): New array.
+ (issubnormal_test): New function.
+ * manual/arith.texi (Floating Point Classes): Document
+ issubnormal.
+ * manual/libm-err-tab.pl: Update comment on interfaces without
+ ulps tabulated.
+
+ * sysdeps/generic/stdint.h: Define
+ __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include
+ <bits/libc-header-start.h> instead of including <features.h>.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise.
+ * manual/arith.texi (Integers): Document these macros for types
+ specified by width properties.
+ * manual/lang.texi (Width of Type): Document these macros for
+ other standard typedefs.
+ * stdlib/tst-width-stdint.c: New file.
+ * stdlib/Makefile (tests): Add tst-width-stdint.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20016]
+ * resolv/res_send.c (__libc_res_nsend): Remove USE_HOOK code.
+ * resolv/res_data.c (res_send_setqhook, res_send_setrhook):
+ Move ...
+ * resolv/compat-hooks.c (res_send_setqhook, res_send_setrhook):
+ ... here, as compatibility symbols in a new file.
+ * resolv/Makefile (libresolv-routines): Add compat-hooks.
+ * resolv/res_init.c (__res_vinit): Adjust member names.
+ * include/resolv.h (res_send_setqhook, res_send_setrhook): Remove.
+ * resolv/resolv.h (res_sendhookact, res_send_qhook)
+ (res_send_rhook): Remove.
+ (struct __res_state): Rename qhook, rhook members.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ malloc: Use __libc_lock wrappers.
+ * malloc/arena.c (list_lock, free_list_lock): Define using
+ __libc_lock_define_initialized.
+ (arena_lock): Adjust formatting.
+ * malloc/malloc.c (struct malloc_state): Define mutex using
+ __libc_lock_define.
+ * sysdeps/generic/malloc-machine.h (mutex_t, mutex_init)
+ (mutex_lock, mutex_trylock, mutex_unlock): Remove.
+ * sysdeps/mach/hurd/malloc-machine.h (mutex_t, mutex_lock)
+ (mutex_unlock, mutex_trylock): Remove.
+ (__pthread_initialize): Remove unused macro.
+ * sysdeps/nptl/malloc-machine.h (mutex_t, mutex_lock)
+ (mutex_unlock, mutex_trylock): Remove.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20592]
+ Remove RR type classification macros.
+ * resolv/arpa/nameser.h (ns_t_qt_p, ns_t_mrr_p, ns_t_rr_p)
+ (ns_t_udp_p, ns_t_xfr_p): Remove.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ Remove misleading version information.
+ * resolv/arpa/nameser.h (__NAMESER): Remove.
+ * resolv/arpa/nameser_compat.h (__BIND): Remove.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ Remove the always-defined BIND_4_COMPAT macro.
+ * resolv/arpa/nameser.h: Unconditionally include
+ <arpa/nameser_compat.h>.
+ (BIND_4_COMPAT): Remove.
+ * resolv/res_comp.c: Do not check BIND_4_COMPAT.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20591]
+ Remove obsolete DNSSEC support.
+ * resolv/arpa/nameser.h (ns_key_types, NS_KEY_*, NS_ALG_*)
+ (NS_MD5_RSA_*, NS_DSA_*, NS_NXT_*, ns_sign, ns_sign2, ns_sign_tcp)
+ (ns_sign_tcp2, ns_sign_tcp_init, ns_find_tsig, ns_verify)
+ (ns_verify_tcp, ns_verify_tcp_init): Remove.
+ (ns_cert_types): Add comment.
+ * resolv/ns_print.c (ns_sprintrrf): Do not handle DNSSEC records
+ separately.
+ (KEY_RSA, KEY_HMAC_MD5, dst_s_id_calc, dst_s_get_int16)
+ (dst_s_dns_key_id): Remove.
+ * resolv/res_debug.c (__p_key_syms, __p_cert_syms): Remove unused
+ variables.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20524]
+ * manual/string.texi (String/Array Comparison): Clarify the
+ strverscmp behavior.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ * test-skeleton.c (xasprintf): Add function.
+ * io/tst-open-tmpfile.c: New test.
+ * io/Makefile (tests): Add it.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ Avoid running $(CXX) during build to obtain header file paths.
+ * configure.ac (CXX_SYSINCLUDES, CXX_CMATH_HEADER): Set.
+ * config.make.in (c++-cstdlib-header, c++-cmath-header): Define.
+ * Makerules (cstdlib, cmath): Remove variables. Use
+ $(c++-cstdlib-header), $(c++-cmath-header) instead.
+ * configure: Regenerate.
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ * Makeconfig (all-object-suffixes): Include .op only if
+ $(build-profile).
+
+2016-09-21 Florian Weimer <fweimer@redhat.com>
+
+ * elf/sln.c: Remove HAVE_CONFIG_H, S_ISDIR, S_ISLNK preprocessor
+ conditionals. Do not define PATH_MAX.
+
+2016-09-20 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * posix/Makefile (tests): Add tst-spawn3.
+ * posix/tst-spawn3.c: New file.
+ * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Close file descriptor
+ if it is already opened for open action.
+
+ * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Correctly block and unblock
+ all signals when executing the clone vfork child.
+ (SIGALL_SET): Remove macro.
+
+ * nptl/Makefile (tests): Add tst-exec5.
+ * nptl/tst-exec5.c: New file.
+ * sysdeps/unix/sysv/linux/spawni.c (__spawni): Correctly enable and disable
+ asynchronous cancellation.
+
+2016-09-20 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * hurd/exc2signal.c: #include <hurd/signal.h>
+ (_hurd_exception2signal): Replace 'exception', 'code', 'subcode',
+ 'sigcode', 'error' parameters with 'detail' parameter. Fix code
+ accordingly.
+ * mach/mach_error.c (mach_error): Fix old-style function definition.
+ * mach/errstring.c (mach_error_type, mach_error_string): Likewise.
+
+2016-09-20 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (libm-calls): Remove s_nanF.
+ (gen-libm-calls): Add s_nanF.
+
+ * math/s_nan.c: Refactor into ...
+ * math/s_nan_template.c: New file.
+
+ * math/s_nanf.c: Removed.
+ * math/s_nanl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_nan.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_nanl.c: Removed.
+
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-double.h:
+ (LDOUBLE_nanl_libm_version): New macro.
+
+ * sysdeps/generic/math-type-macros-double.h:
+ (M_STRTO_NAN): New macro.
+ * sysdeps/generic/math-type-macros-float.h: Likewise.
+ * sysdeps/generic/math-type-macros-ldouble.h: Likewise.
+
+ * sysdeps/generic/math-type-macros.h: Document
+ M_STRTO_NAN.
+
+2016-09-20 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/s_nanf.c: Remove __nanf undef.
+ * math/s_nan.c: Remove __nan undef.
+ * math/s_nanl.c: Remove __nanl undef.
+
+ * sysdeps/generic/math_private.h (__nan): Remove macro
+ override.
+ (__nanf): Likewise.
+ (__nanl): Likewise.
+
+2016-09-20 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (gen-all-calls): New variable.
+ (generated): Replace gen-libm-calls with gen-all-calls.
+ (gen-libm-templates.stmp): Likewise. Also, ensure
+ the output directory exists or is created and add
+ dependency on the Makefile.
+ (calls): Move s_ldexpF into gen-calls.
+ (gen-calls): New variable.
+
+ * math/s_ldexpf.c: Removed.
+ * math/s_ldexpl.c: Removed.
+ * math/s_ldexp.c: Refactored into ...
+ * math/s_ldexp_template.c: New file.
+
+ * sysdeps/generic/math-type-macros-double.h: Remove
+ redundant fall-through definition of declare_mgen_alias.
+ (declare_mgen_alias_2): New macro.
+
+ * sysdeps/generc/math-type-macros.h (declare_mgen_alias_2):
+ New macro for function aliased to two exported symbols.
+
+ * sysdeps/ieee754/ldbl-opt/s_ldexp.c: Update to use
+ new template file.
+ sysdeps/ieee754/ldbl-opt/s_ldexpl.c: Likewise.
+
+2016-09-20 Florian Weimer <fweimer@redhat.com>
+
+ * Makeconfig (all-object-suffixes): Remove .og.
+ * Makerules (elide-routines.og): Remove.
+ * sysdeps/i386/i686/Makefile (CFLAGS-.og, ASFLAGS-.og): Remove.
+ * sysdeps/sparc/sparc32/sparcv9/Makefile (ASFLAGS-.og): Remove.
+ * sysdeps/sparc/sparc64/Makefile (ASFLAGS-.op): Remove.
+
+2016-09-20 Florian Weimer <fweimer@redhat.com>
+
+ * scripts/sysd-rules.awk (BEGIN): Only generate rtld patterns for
+ .os objects.
+
+2016-09-19 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ [BZ #20615]
+ * sysdeps/powerpc/powerpc32/power9/multiarch/Implies: Replace
+ fpu directory by non-fpu.
+ * sysdeps/powerpc/powerpc64/power9/fpu/Implies: Remove dependency
+ on non-fpu directory from a fpu directory.
+
+2016-09-19 Joseph Myers <joseph@codesourcery.com>
+
+ * include/limits.h: Define
+ __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include
+ <bits/libc-header-start.h> instead of including <features.h>.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (CHAR_WIDTH): New macro.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (SCHAR_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UCHAR_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (SHRT_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (USHRT_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (LLONG_WIDTH): Likewise.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULLONG_WIDTH): Likewise.
+ * manual/lang.texi (Width of Type): Document these macros.
+ * stdlib/tst-width.c: New file.
+ * stdlib/Makefile (tests): Add tst-width.
+
+2016-09-18 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * intl/dcigettext.c (PATH_MAX): Call __pathconf instead of pathconf.
+ * sysdeps/posix/dup.c (__dup): Call __fcntl instead of fcntl.
+
+2016-09-15 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * nptl/sem_init.c (__new_sem_init): Init pad value to 0.
+ * sysdeps/sparc/sparc32/sem_open.c: Remove file.
+ * sysdeps/sparc/sparc32/sparcv9/sem_open.c: Likewise.
+
+2016-09-15 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #18243]
+ * rt/Makefile (test): Add tst-shm-cancel.
+ * rt/tst-shm-cancel.c: New file.
+ * sysdeps/posix/shm_open.c: Disable asynchronous cancellation.
+
+ [BZ #18243]
+ * nptl/pthreadP.h (__pthread_testcancel): Add prototype and hidden_proto.
+ * nptl/pthread_testcancel.c (pthread_cancel): Add internal aliais
+ definition.
+ * nptl/sem_timedwait.c (sem_timedwait): Add cancellation check for
+ uncontended case.
+ * nptl/sem_wait.c (__new_sem_wait): Likewise.
+ * nptl/tst-cancel12.c (cleanup): Remove wrong cancellation point.
+ (tf): Fix check for uncontended case.
+ (do_test): Likewise.
+ * nptl/tst-cancel13.c (cleanup): Remove wrong cancellation point.
+ (tf): Fix check for uncontended case.
+ (do_test): Likewise.
+ * nptl/tst-cancel14.c (cleanup): Remove wrong cancellation point.
+ (tf): Fix check for uncontended case.
+ (do_test): Likewise.
+ * nptl/tst-cancel15.c (cleanup): Remove wrong cancellation point.
+ (tf): Fix check for uncontended case.
+ (do_test): Likewise.
+
+ * sysdeps/sparc/sparc32/sem_wait.c: Remove file.
+ * sysdeps/sparc/sparc32/sparcv9/sem_wait.c: Likewise.
+
+ [BZ #15765]
+ * nptl/Makefile (tests): Add tst-sem16.
+ * nptl/tst-sem16.c: New file.
+ * nptl/sem_open.c (sem_open): Disable asynchronous cancellation.
+
+ * nptl/sem_open.c (sem_open): Init pad value to 0.
+ * sysdeps/sparc/sparc32/sem_open.c: Remove file.
+ * sysdeps/sparc/sparc32/sparcv9/sem_open.c: Likewise.
+
+2016-09-15 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20611]
+ * inet/Makefile (routines): Add inet6_scopeid_pton.
+ (tests): Add tst-inet6_scopeid_pton.
+ * inet/inet6_scopeid_pton.c: New file.
+ * inet/net-internal.h: Likewise.
+ * inet/tst-inet6_scopeid_pton.c: New test.
+ * inet/Versions (GLIBC_PRIVATE): Add __inet6_scopeid_pton.
+ * resolv/res_init.c (__res_vinit): Use __inet6_scopeid_pton.
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
+
+2016-09-14 Florian Weimer <fweimer@redhat.com>
+
+ Remove support for compiling wrappers with PTW.
+ * sysdeps/nptl/Makeconfig: Drop ptw- support.
+ * nptl/Makefile (pthread-compat-wrappers): Define.
+ (libpthread-routines): Use pthread-compat-wrappers.
+ * sysdeps/unix/sysv/linux/alpha/Makefile
+ (libpthread-routines, libpthread-shared-only-routines): Remove
+ ptw- prefix.
+ * sysdeps/s390/nptl/Makefile
+ (libpthread-routines, libpthread-shared-only-routines): Likewise.
+ * sysdeps/ia64/nptl/Makefile
+ (libpthread-routines, libpthread-shared-only-routines): Likewise.
+ * sysdeps/nacl/Makefile (libpthread-routines): Use
+ pthread-compat-wrappers to filter the routines list instead of the
+ ptw- prefix.
+
+2016-09-13 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128/e_acoshl.c: Wrap long double literals
+ with L() and remove explicit suffix, convert real literals
+ which can be equivalentally substituted with integers, and
+ transform -L(x) to L(-x).
+
+ * 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_exp10l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_expl.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_rem_pio2l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_remainderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_sinhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_cosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_sincosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_sinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_tanl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/lgamma_negl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_asinhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_atanl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_cbrtl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_cosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_erfl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_expm1l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_fmal.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_frexpl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_llrintl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_llroundl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_log1pl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_lrintl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_lroundl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_nearbyintl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_nextafterl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_remquol.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_scalblnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_scalbnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_sincosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_sinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_tanhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_tanl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/t_expl.h: Likewise.
+ * sysdeps/ieee754/ldbl-128/t_sincosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/x2y2m1l.c: Likewise.
+
+2016-09-13 Florian Weimer <fweimer@redhat.com>
+
+ * resolv/res_init.c: Remove _LIBC_REENTRANT; it is always defined.
+
+2016-09-10 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * malloc/Makefile (tests): Remove individual static test names
+ and just add all of tests-static.
+
+ * csu/libc-start.c (__libc_csu_irel): Remove declaration.
+
+2016-09-07 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c: New
+ file.
+
+ * sysdeps/sparc/fpu/fegetmode.c: New file.
+ * sysdeps/sparc/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/sh/sh4/fpu/fegetmode.c: New file.
+ * sysdeps/sh/sh4/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/s390/fpu/fegetmode.c: New file.
+ * sysdeps/s390/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/powerpc/fpu/fegetmode.c: New file.
+ * sysdeps/powerpc/fpu/fesetmode.c: Likewise.
+ * sysdeps/powerpc/nofpu/fegetmode.c: Likewise.
+ * sysdeps/powerpc/nofpu/fesetmode.c: Likewise.
+ * sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c: Likewise.
+ * sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c: Likewise.
+
+ * sysdeps/mips/fpu/fegetmode.c: New file.
+ * sysdeps/mips/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/m68k/fpu/fegetmode.c: New file.
+ * sysdeps/m69k/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/ia64/fpu/fegetmode.c: New file.
+ * sysdeps/ia64/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/hppa/fpu/fegetmode.c: New file.
+ * sysdeps/hppa/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/arm/fegetmode.c: New file.
+ * sysdeps/arm/fesetmode.c: Likewise.
+
+ * sysdeps/alpha/fpu/fegetmode.c: New file.
+ * sysdeps/alpha/fpu/fesetmode.c: Likewise.
+
+ * sysdeps/aarch64/fpu/fegetmode.c: New file.
+ * sysdeps/aarch64/fpu/fesetmode.c: Likewise.
+
+ * math/fegetmode.c: New file.
+ * math/fesetmode.c: Likewise.
+ * sysdeps/i386/fpu/fegetmode.c: Likewise.
+ * sysdeps/i386/fpu/fesetmode.c: Likewise.
+ * sysdeps/x86_64/fpu/fegetmode.c: Likewise.
+ * sysdeps/x86_64/fpu/fesetmode.c: Likewise.
+ * math/fenv.h: Update comment on inclusion of <bits/fenv.h>.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (fegetmode): New function
+ declaration.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetmode): Likewise.
+ * bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (femode_t): New
+ typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/aarch64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/alpha/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/arm/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/hppa/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/ia64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/m68k/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/microblaze/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/mips/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/nios2/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/powerpc/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (__fe_dfl_mode): New variable
+ declaration.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/s390/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/sh/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/sparc/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/tile/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * sysdeps/x86/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (femode_t): New typedef.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
+ * manual/arith.texi (FE_DFL_MODE): Document macro.
+ (fegetmode): Document function.
+ (fesetmode): Likewise.
+ * math/Versions (fegetmode): New libm symbol at version
+ GLIBC_2.25.
+ (fesetmode): Likewise.
+ * math/Makefile (libm-support): Add fegetmode and fesetmode.
+ (tests): Add test-femode and test-femode-traps.
+ * math/test-femode-traps.c: New file.
+ * math/test-femode.c: Likewise.
+ * sysdeps/powerpc/fpu/fenv_const.c (__fe_dfl_mode): Declare as
+ alias for __fe_dfl_env.
+ * sysdeps/powerpc/nofpu/fenv_const.c (__fe_dfl_mode): Likewise.
+ * sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
+ (__fe_dfl_mode): Likewise.
+ * sysdeps/powerpc/Versions (__fe_dfl_mode): New libm symbol at
+ version GLIBC_2.25.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-09-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #20495]
+ [BZ #20508]
+ * sysdeps/x86/cpu-features.c (init_cpu_features): For Intel
+ processors, set Use_dl_runtime_resolve_slow and set
+ Use_dl_runtime_resolve_opt if XGETBV suports ECX == 1.
+ * sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
+ New.
+ (bit_arch_Use_dl_runtime_resolve_slow): Likewise.
+ (index_arch_Use_dl_runtime_resolve_opt): Likewise.
+ (index_arch_Use_dl_runtime_resolve_slow): Likewise.
+ * sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup): Use
+ _dl_runtime_resolve_avx512_opt and _dl_runtime_resolve_avx_opt
+ if Use_dl_runtime_resolve_opt is set. Use
+ _dl_runtime_resolve_slow if Use_dl_runtime_resolve_slow is set.
+ * sysdeps/x86_64/dl-trampoline.S: Include <cpu-features.h>.
+ (_dl_runtime_resolve_opt): New. Defined for AVX and AVX512.
+ (_dl_runtime_resolve): Add one for _dl_runtime_resolve_sse_vex.
+ * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx_slow):
+ New.
+ (_dl_runtime_resolve_opt): Likewise.
+ (_dl_runtime_profile): Define only if _dl_runtime_profile is
+ defined.
+
+2016-09-06 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * sysdeps/unix/sysv/linux/s390/localplt.data: Mark ld.so:
+ __libc_memalign with "+ RELA R_390_GLOB_DAT".
+
+2016-09-06 Florian Weimer <fweimer@redhat.com>
+
+ Convert malloc to __libc_lock. Automated part, using this Perl
+ s/// command:
+ s/(?:\(void\)\s*)?mutex_((?:|un|try)lock|init)
+ \s*\(\&([^\)]+)\)/__libc_lock_$1\ ($2)/gx;
+ * malloc/malloc.c, malloc/arena.c, malloc/hooks.c: Perform
+ conversion.
+
+2016-09-05 Aurelien Jarno <aurelien@aurel32.net>
+
+ * conform/Makefile (conformtest-header-tests): Pass -I. to $(PERL).
+ (linknamespace-symlists-tests): Likewise.
+ (linknamespace-header-tests): Likewise.
+
+2016-09-03 Aurelien Jarno <aurelien@aurel32.net>
+
+ [BZ #19810]
+ * elf/dl-open.c (dl_open_worker): Set DF_1_NODELETE flag later.
+ * elf/tst-noload.c: New test case.
+ * elf/Makefile (tests): Add tst-noload.
+
+2016-09-02 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/nacl/dup.c: Add libc_hidden_def.
+
+ * sysdeps/posix/wait3.c: Don't treat STAT_LOC as a union, since it's
+ not any more.
+
+ * sysdeps/nacl/clock.c (clock): nacl_abi_clock_t -> nacl_irt_clock_t
+
+2016-09-02 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (do_cos): Mark as inline.
+ (do_cos_slow): Likewise.
+ (do_sin): Likewise.
+ (do_sin_slow): Likewise.
+ (slow): Likewise.
+ (slow1): Likewise.
+ (slow2): Likewise.
+ (sloww): Likewise.
+ (sloww1): Likewise.
+ (sloww2): Likewise.
+ (bsloww): Likewise.
+ (bsloww1): Likewise.
+ (bsloww2): Likewise.
+ (cslow2): Likewise.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (__sin): Use do_sin.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (do_cos): Accept X and DX as input
+ arguments. Consolidate input partitioning from callers here.
+ (do_cos_slow): Likewise.
+ (do_sin): Likewise.
+ (do_sin_slow): Likewise.
+ (do_sincos_1): Remove the no longer necessary input partitioning.
+ (do_sincos_2): Likewise.
+ (__sin): Likewise.
+ (__cos): Likewise.
+ (slow1): Likewise.
+ (slow2): Likewise.
+ (sloww1): Likewise.
+ (sloww2): Likewise.
+ (bsloww1): Likewise.
+ (bsloww2): Likewise.
+ (cslow2): Likewise.
+
+2016-09-02 Florian Weimer <fweimer@redhat.com>
+
+ * stdio-common/vfscanf.c (_IO_vfwscanf): Use MB_LEN_MAX instead of
+ MB_CUR_MAX to avoid race condition. Avoid pointer arithmetic
+ outside of allocated array.
+
+2016-09-02 Florian Weimer <fweimer@redhat.com>
+
+ * stdio-common/vfprintf.c (process_string_arg): Use MB_LEN_MAX
+ instead of MB_CUR_MAX to avoid variable-length array.
+
+2016-09-01 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (libm-calls): Remove k_rem_pio2F.
+ (type-double-routines): Add k_rem_pio2.
+ (type-float-routines): Add k_rem_pio2f.
+
+ * sysdeps/generic/math_private.h:
+ (__kernel_rem_pio2l): Removed.
+
+ * math/k_rem_pio2l.c: Removed.
+ * sysdeps/i386/fpu/k_rem_pio2l.c: Removed.
+ * sysdeps/ia64/fpu/k_rem_pio2l.c: Removed.
+ * sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c: Removed.
+ * sysdeps/x86_64/fpu/k_rem_pio2l.c: Removed.
+
+2016-09-01 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (gen-libm-calls): Add s_fmin
+ (libm-calls): Remove above.
+
+ * math/s_fmin.c: Refactor into ...
+ * math/s_fmin_template.c: New file.
+
+ * math/s_fminf.c: Removed.
+ * math/s_fminl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-double.h:
+ (LDOUBLE_fmin_libm_version): New macro.
+
+ * sysdeps/ieee754/ldbl-opt/s_fmin.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_fminl.c: Removed.
+
+2016-09-01 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile: (gen-libm-calls): Add s_fmax.
+ (libm-calls): Remove above.
+
+ * math/s_fmax.c: Refactor into ...
+ * math/s_fmax_template.c: New file.
+ * math/s_fmaxf.c: Removed.
+ * math/s_fmaxl.c: Removed.
+
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-double.h:
+ (LDOUBLE_fmaxl_libm_version): New macro.
+
+ * sysdeps/ieee754/ldbl-opt/s_fmax.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_fmaxl.c: Removed.
+
+ * sysdeps/aarch64/fpu/s_fmax.c: Append fpu/ to include of
+ s_fmin.c to pick the aarch64 version of the file.
+ * sysdeps/aarch64/fpu/s_fmaxf.c: Likewise.
+ * sysdeps/aarch64/fpu/s_fminf.c: Likewise.
+
+2016-09-01 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile: (gen-libm-calls): Add s_nextdown.
+ (libm-calls): Remove above.
+
+ * math/s_nextdown.c: Refactor into ...
+ * math/s_nextdown_template.c: New file.
+ * math/s_nextdownf.c: Removed.
+ * math/s_nextdownl.c: Removed.
+
+ * sysdeps/ieee754/ldbl-opt/s_nextdownl.c: New file.
+
+2016-09-01 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (gen-libm-calls): Add s_fdim.
+ (libm-calls): Move to above.
+
+ * math/s_fdim.c: Renamed and refactored into to ...
+ * math/s_fdim_template.c: New file.
+ * math/s_fdiml.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_fdim.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_fdiml.c: Removed.
+
+ * sysdeps/generic/math-type-macros-double.h:
+ (declare_mgen_alias): Don't declare if already declared.
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h:
+ Likewise.
+
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-double.h:
+ (declare_mgen_alias): Don't declare if already declared.
+ (M_LIBM_NEED_COMPAT): Likewise.
+ (declare_mgen_libm_compat): Likewise.
+ (LDOUBLE_fdiml_libm_version): New macro.
+
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c:
+ Include math/s_fdim.c now that ldbl-opt version is not needed.
+ (declare_mgen_alias): New macro to disable aliasing.
+
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c:
+ (declare_mgen_alias): Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c:
+ (declare_mgen_alias): Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c:
+ (declare_mgen_alias): Likewise.
+ (M_LIBM_NEED_COMPAT): Likewise.
+
+2016-09-01 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20525]
+ * sysdeps/unix/sysv/linux/sys/quota.h: Update copyright.
+ Include <linux/quota.h>.
+ (fs_to_dq_blocks): Hard-code BLOCK_SIZE as 1024, to match dbtob
+ and btodb.
+ (_LINUX_QUOTA_VERSION, MAXQUOTAS, USRQUOTA, GRPQUOTA, INITQFNAMES)
+ (SUBCMDMASK, SUBCMDSHIFT, QCMD, Q_QUOTAON, Q_QUOTAOFF, Q_GETQUOTA)
+ (Q_SETQUOTA, Q_SETUSE, Q_SYNC, Q_SETQLIM, Q_GETSTATS, Q_RSQUASH)
+ (Q_GETFMT, Q_GETINFO, Q_SETINFO, Q_GETNEXTQUOTA, QIF_BLIMITS)
+ (QIF_SPACE, QIF_ILIMITS, QIF_INODES, QIF_BTIME, QIF_ITIME)
+ (QIF_LIMITS, QIF_USAGE, QIF_TIMES, QIF_ALL, IIF_BGRACE)
+ (IIF_IGRACE, IIF_FLAGS, IIF_ALL): Remove.
+ (struct dqblock, struct dqinfo): Use __uint64_t and __uint32_t
+ types.
+ * sysdeps/unix/sysv/linux/tst-quota.c: New test.
+ * sysdeps/unix/sysv/linux/Makefile (tests): Add it.
+
+2016-08-31 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128/e_gammal_r.c:
+ (gammal_positive): Fix spacing.
+ (__ieee754_gammal_r): Likewise.
+
+2016-08-31 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128/math_ldbl.h:
+ (_Float128): Define as long double, always.
+ (L): Apply long double type suffix, always.
+
+ * sysdeps/ieee754/ldbl-128/e_acoshl.c: Rename long double
+ _Float128, excepting comments.
+
+ * sysdeps/ieee754/ldbl-128/e_acosl.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_exp10l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_expl.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_ilogbl.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_rem_pio2l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_remainderl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_sinhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/gamma_productl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_cosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_sincosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_sinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/k_tanl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/lgamma_negl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/lgamma_productl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_asinhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_atanl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_cbrtl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_ceill.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_copysignl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_cosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_erfl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_expm1l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_fabsl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_finitel.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_floorl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_fmal.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_fpclassifyl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_frexpl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_issignalingl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_llrintl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_llroundl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_log1pl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_logbl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_lrintl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_lroundl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_modfl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_nearbyintl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_nextafterl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_nextupl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_remquol.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_rintl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_roundl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_scalblnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_scalbnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_sincosl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_sinl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_tanhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_tanl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/s_truncl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/t_expl.h: Likewise.
+ * sysdeps/ieee754/ldbl-128/x2y2m1l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_asinl.c: Likewise.
+
+ * sysdeps/ieee754/ldbl-128/s_signbitl.c: Rename long double
+ _Float128, and include math_private.h.
+ * sysdeps/ieee754/ldbl-128/t_sincosl.c: Likewise.
+
+ * sysdeps/ieee754/ldbl-128ibm/e_expl.c (L): Define using
+ long double semantics.
+ (_Float128): Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_j0l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_j1l.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c: Likewise.
+
+2016-08-31 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * config.h.in (HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT): New undefine.
+ * sysdeps/s390/configure.ac: Add test for z196 zarch support.
+ * sysdeps/s390/configure: Regenerated.
+ * sysdeps/s390/fpu/fraiseexcpt.c (__feraiseexcept): Use ledbra
+ instruction for raising over-/underflow if z196 zarch is supported
+ by default.
+ * sysdeps/s390/fpu/fsetexcptflg.c (fesetexceptflag): Correct comment.
+
+2016-08-30 Svante Signell <svante.signell@gmail.com>
+
+ * sysdeps/mach/hurd/adjtime.c (__adjtime): When OLDDELTA is NULL, make
+ it point to a dumb buffer for RPC to fill it.
+
+2016-08-30 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (do_cos_slow): Use ternary
+ instead of if/else.
+ (do_sin_slow): Likewise.
+ (do_sincos_1): Use fabs instead of if/else.
+ (do_sincos_2): Likewise.
+ (__sin): Likewise.
+ (__cos): Likewise.
+ (slow2): Likewise.
+ (sloww): Likewise.
+ (sloww1): Likewise. Drop argument M.
+ (sloww2): Use fabs instead of if/else.
+ (bsloww): Likewise.
+ (bsloww1): Likewise.
+ (bsloww2): Likewise.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute): Add
+ fall through comment.
+ (do_sincos_1): Likewise.
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute):
+ Consolidate switch cases 0 and 2.
+
+2016-08-29 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (libm-gen-calls): Add cpow, clog, clog10, cexp, cproj.
+ (libm-calls): Remove the above.
+
+ * math/s_cexp_template.c: Update using type-generic macros.
+ * math/s_clog10_template.c: Likewise.
+ * math/s_cpow_template.c: Likewise.
+ * math/s_clog_template.c: Likewise.
+ * math/s_cproj_template.c: Likewise.
+ * math/s_csqrt_template.c: Likewise.
+
+ * math/s_cexp.c: Removed.
+ * math/s_cexpf.c: Removed.
+ * math/s_cexpl.c: Removed.
+ * math/s_clog10.c: Removed.
+ * math/s_clog10f.c: Removed.
+ * math/s_clog10l.c: Removed.
+ * math/s_cpow.c: Removed.
+ * math/s_cpowf.c: Removed.
+ * math/s_cpowl.c: Removed.
+ * math/s_clog.c: Removed.
+ * math/s_clogf.c: Removed.
+ * math/s_clogl.c: Removed.
+ * math/s_cproj.c: Removed.
+ * math/s_cprojf.c: Removed.
+ * math/s_cprojl.c: Removed.
+ * math/s_csqrt.c: Removed.
+ * math/s_csqrtf.c: Removed.
+ * math/s_csqrtl.c: Removed.
+
+ * sysdeps/alpha/fpu/s_cexpf.c: Update using templated version.
+ * sysdeps/alpha/fpu/s_clog10f.c: Update using templated version.
+ * sysdeps/alpha/fpu/s_clogf.c: Update using templated version.
+ * sysdeps/alpha/fpu/s_cpowf.c: Update using templated version.
+ * sysdeps/alpha/fpu/s_cprojf.c: Update using templated version.
+ * sysdeps/alpha/fpu/s_csqrtf.c: Update using templated version.
+
+ * sysdeps/ieee754/ldbl-opt/s_cexp.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_cexpl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_clog.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_clog10.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_clog10l.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_cpow.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_cpowl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_cproj.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_cprojl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_csqrt.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_csqrtl.c: Removed.
+
+ * sysdeps/ieee754/ldbl-opt/s_clogl.c: Update using templated
+ version.
+
+ * sysdeps/m68k/m680x0/fpu/s_cexp.c: Refactor into.
+ * sysdeps/m68k/m680x0/fpu/s_cexp_template.c: New file.
+ * sysdeps/m68k/m680x0/fpu/s_cexpf.c: Removed.
+ * sysdeps/m68k/m680x0/fpu/s_cexpl.c: Removed.
+
+2016-08-29 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * s_cexp_template.c: Copy of s_cexp.c.
+ * s_clog_template.c: Copy of s_clog.c.
+ * s_clog10_template.c: Copy of s_clog10.c.
+ * s_cpow_template.c: Copy of s_cpow.c.
+ * s_cproj_template.c: Copy of s_cproj.c.
+ * s_csqrt_template.c: Copy of s_csqrt.c.
+
+2016-08-29 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ [BZ #20517]
+ * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c:
+ Include ldbl-opt/s_fdim.c to ensure fdiml@GLIBC_2.1 is
+ exported.
+
+2016-08-29 Joseph Myers <joseph@codesourcery.com>
+
+ * math/fetestexceptflag.c: New file.
+ * sysdeps/s390/fpu/fetestexceptflag.c: Likewise. Comment by
+ Stefan Liebler.
+ * math/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
+ (fetestexceptflag): New function declaration.
+ * manual/arith.texi (fetestexceptflag): Document function.
+ * math/Versions (fetestexceptflag): New libm symbol at version
+ GLIBC_2.25.
+ * math/Makefile (libm-support): Add fetestexceptflag.
+ (tests): Add test-fetestexceptflag.
+ * math/test-fetestexceptflag.c: New file.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-08-26 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20432]
+ Avoid strong references to malloc-internal symbols when linking
+ statically, to support statically interposed mallocs.
+ * include/libc-symbols.h (call_function_static_weak): New macro.
+ * malloc/Makefile (tests): Add tst-interpose-nothread,
+ tst-interpose-thread, tst-interpose-static-nothread,
+ tst-interpose-static-thread.
+ (tests-static): Add tst-interpose-static-nothread,
+ tst-interpose-static-thread.
+ (extra-tests-objs): Add tst-interpose-aux-nothread.o,
+ tst-interpose-aux-thread.o.
+ (test-extras): Add tst-interpose-aux-nothread,
+ tst-interpose-aux-thread.
+ (tst-interpose-nothread, tst-interpose-static-nothread): Link with
+ tst-interpose-aux-nothread.o.
+ (tst-interpose-thread, tst-interpose-static-thread): Link with
+ tst-interpose-aux-thread.o and libthread.
+ * malloc/tst-interpose-aux-nothread.c: New file.
+ * malloc/tst-interpose-aux-thread.c: Likewise.
+ * malloc/tst-interpose-aux.c: Likewise.
+ * malloc/tst-interpose-aux.h: Likewise.
+ * malloc/tst-interpose-nothread.c: Likewise.
+ * malloc/tst-interpose-skeleton.c: Likewise.
+ * malloc/tst-interpose-static-nothread.c: Likewise.
+ * malloc/tst-interpose-static-thread.c: Likewise.
+ * malloc/tst-interpose-thread.c: Likewise.
+ * nptl/tst-tls3-malloc.c: Use new interposed malloc.
+ * sysdeps/mach/hurd/fork.c (__fork): Only call
+ __malloc_fork_lock_parent, __malloc_fork_unlock_parent,
+ __malloc_fork_unlock_child if defined.
+ * sysdeps/nptl/fork.c (__libc_fork): Likewise.
+
+2016-08-26 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * test-skeleton.c (delayed_exit_thread): Add initializer on struct
+ timespec C99 designated initialization.
+
+2016-08-26 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #19946]
+ Avoid expected SIGALRM signals.
+ * test-skeleton.c (xpthread_sigmask, xpthread_mutex_lock)
+ (xpthread_spin_lock, xpthread_cond_wait, xpthread_barrier_wait)
+ (xpthread_create, xpthread_detach, xpthread_join)
+ (delayed_exit_thread, delayed_exit): New functions.
+ * nptl/tst-cond3 (EXPECTED_SIGNAL): Remove.
+ (tf): Use xpthread_cond_wait.
+ (do_test): Likewise. Replace alarm with delayed_exit.
+ * nptl/tst-eintr1.c (EXPECTED_SIGNAL, TIMEOUT): Remove.
+ (do_test): Call delayed_exit. Report failure.
+ * nptl/tst-eintr2.c (EXPECTED_SIGNAL, TIMEOUT): Remove.
+ (do_test): Call delayed_exit.
+ * nptl/tst-eintr3.c (EXPECTED_SIGNAL, TIMEOUT): Remove.
+ (do_test): Call delayed_exit. Use xpthread_join. Report error.
+ * nptl/tst-eintr4.c (EXPECTED_SIGNAL, TIMEOUT): Remove.
+ (do_test): Call delayed_exit. Use xpthread_barrier_wait. Report
+ error.
+ * nptl/tst-eintr5.c (EXPECTED_SIGNAL, TIMEOUT): Remove.
+ (do_test): Call delayed_exit. Use xpthread_cond_wait. Report
+ error.
+ * nptl/tst-exit2.c (EXPECTED_SIGNAL): Remove.
+ (do_test): Call delayed_exit.
+ * nptl/tst-exit3.c (EXPECTED_SIGNAL): Remove.
+ (do_test): Call delayed_exit.
+ * nptl/tst-mutex6.c (EXPECTED_SIGNAL): Remove.
+ (do_test): Call delayed_exit instead of alarm. Use
+ xpthread_mutex_lock.
+ * nptl/tst-rwlock5.c (EXPECTED_SIGNAL): Remove.
+ (do_test): Call delayed_exit instead of alarm. Use
+ xpthread_mutex_lock.
+ * nptl/tst-sem2.c (EXPECTED_SIGNAL): Remove.
+ (do_test): Call delayed_exit instead of alarm.
+ * nptl/tst-spin3.c (EXPECTED_SIGNAL): Remove.
+ (do_test): Call delayed_exit instead of alarm. Use
+ xpthread_spin_lock.
+ * nptl/tst-stdio1.c (EXPECTED_SIGNAL): Remove.
+ (do_test): Call delayed_exit instead of alarm. Use
+ xpthread_join.
+
+2016-08-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve): Don't
+ adjust CFA when allocating register save area on re-aligned
+ stack.
+
+2016-08-26 Florian Weimer <fweimer@redhat.com>
+
+ * string/tst-cmp.c: New test.
+ * string/Makefile (tests): Add it.
+
+2016-08-25 Mark Wielaard <mark@klomp.org>
+
+ * misc/tsearch.c (struct node_t): Reduce to 3 pointers if
+ USE_MALLOC_LOW_BIT. Define pointer/value accessors.
+ (check_tree_recurse): Use newly defined accessors.
+ (check_tree): Likewise.
+ (maybe_split_for_insert): Likewise.
+ (__tfind): Likewise.
+ (__tdelete): Likewise.
+ (trecurse): Likewise.
+ (tdestroy_recurse): Likewise.
+ (__tsearch): Likewise. And add asserts for malloc alignment.
+ (__twalk): Cast root to node in case CHECK_TREE is defined.
+
+2016-08-21 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * scripts/check-local-headers.sh (exclude): Add mach_debug/.
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (libm-gen-calls): Add
+ catan, catanh, ctan, ctanh.
+ (libm-calls): Remove the above.
+
+ * math/s_catan_template.c: Update using type-generic macros.
+ * math/s_catanh_template.c: Likewise.
+ * math/s_ctan_template.c: Likewise.
+ * math/s_ctanh_template.c: Likewise.
+
+ * math/s_catanf.c: Removed.
+ * math/s_catan.c: Removed.
+ * math/s_catanl.c: Removed.
+ * math/s_catanhf.c: Removed.
+ * math/s_catanh.c: Removed.
+ * math/s_catanhl.c: Removed.
+ * math/s_ctanf.c: Removed.
+ * math/s_ctan.c: Removed.
+ * math/s_ctanl.c: Removed.
+ * math/s_ctanhf.c: Removed.
+ * math/s_ctanh.c: Removed.
+ * math/s_ctanhl.c: Removed.
+
+ * sysdeps/ieee754/ldbl-opt/s_catanhl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_catanl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ctan.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ctanh.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ctanhl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ctanl.c: Removed.
+
+ * sysdeps/alpha/fpu/s_catanf.c: Update to use template file.
+ * sysdeps/alpha/fpu/s_catanhf.c: Likewise.
+ * sysdeps/alpha/fpu/s_ctanf.c: Likewise.
+ * sysdeps/alpha/fpu/s_ctanhf.c: Likewise.
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * s_catan_template.c: Copy of s_catan.c.
+ * s_catanh_template.c: Copy of s_catanh.c.
+ * s_ctan_template.c: Copy of s_ctan.c.
+ * s_ctanh_template.c: Copy of s_ctanh.c.
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (gen-libm-calls): Move
+ casin, casinh, csin, csinh here.
+ (libm-calls): Remove the above.
+
+ * math/s_casin_template.c: Update using type-generic macros.
+ * math/s_casinh_template.c: Likewise.
+ * math/s_csin_template.c: Likewise.
+ * math/s_csinh_template.c: Likewise.
+ * math/k_casinh_template.c: Likewise.
+
+ * math/s_casinf.c: Removed.
+ * math/s_casin.c: Removed.
+ * math/s_casinl.c: Removed.
+ * math/s_casinh.c: Removed.
+ * math/s_casinhf.c: Removed.
+ * math/s_casinhl.c: Removed.
+ * math/s_csin.c: Removed.
+ * math/s_csinf.c: Removed.
+ * math/s_csinl.c: Removed.
+ * math/s_csinh.c: Removed.
+ * math/s_csinhf.c: Removed.
+ * math/s_csinhl.c: Removed.
+ * math/k_casinh.c: Removed.
+ * math/k_casinhf.c: Removed.
+ * math/k_casinhl.c: Removed.
+
+ * sysdeps/alpha/fpu/s_casinf.c: Refactor using templated version.
+ * sysdeps/alpha/fpu/s_casinhf.c: Likewise.
+ * sysdeps/alpha/fpu/s_csinf.c: Likewise.
+ * sysdeps/alpha/fpu/s_csinhf.c: Likewise.
+
+ * sysdeps/ieee754/ldbl-opt/s_casin.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_casinh.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_casinhl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_casinl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_csin.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_csinh.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_csinhl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_csinl.c: Removed.
+
+ * sysdeps/m68k/m680x0/fpu/s_csin.c: Refactor into ...
+ * sysdeps/m68k/m680x0/fpu/s_csin_template.c: New file.
+ * sysdeps/m68k/m680x0/fpu/s_csinf.c: Removed.
+ * sysdeps/m68k/m680x0/fpu/s_csinl.c: Removed.
+
+ * sysdeps/m68k/m680x0/fpu/s_csinh.c: Refactor into.
+ * sysdeps/m68k/m680x0/fpu/s_csinh_template.c: New file.
+ * sysdeps/m68k/m680x0/fpu/s_csinhf.c: Removed.
+ * sysdeps/m68k/m680x0/fpu/s_csinhl.c: Removed.
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * s_casin_template.c: Copy of s_casin.c.
+ * s_casinh_template.c: Copy of s_casinh.c.
+ * s_csin_template.c: Copy of s_csin.c.
+ * s_csinh_template.c: Copy of s_csinh.c.
+ * k_casinh_template.c: Copy of k_casinh.c.
+
+2016-08-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86/cpu-features.h (bit_YMM_state): Set to (1 << 2).
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128/gamma_productl.c:
+ (mul_split) Remove, rename as mul_splitl, remove
+ redundant float.h include, and include via mul_splitl.h
+
+ * sysdeps/ieee754/ldbl-128/lgamma_productl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/x2y2m1l.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/gamma_product.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/lgamma_product.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/x2y2m1.c: Likewise.
+
+ * math/mul_splitl.h: New file.
+
+ * sysdeps/ieee754/dbl-64/gamma_product.c (mul_split):
+ Move into mul_split.h, and remove redundant float.h include.
+
+ * sysdeps/ieee754/dbl-64/lgamma_product.c: Likewise.
+ * sysdeps/ieee754/dbl-64/x2y2m1.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_fmal.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/x2y2m1.c: Likewise.
+
+ * math/mul_split.h: New file.
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile (libm-gen-calls): Move
+ s_cacos, s_cacosh, s_ccos, s_ccosh from ...
+ (libm-calls): Remove above.
+
+ * math/s_cacos_template.c: Update using type-generic macros.
+ * math/s_cacosh_template.c: Likewise.
+ * math/s_ccos_template.c: Likewise.
+ * math/s_ccosh_template.c: Likwise.
+
+ * math/s_cacosf.c: Removed.
+ * math/s_cacos.c: Removed.
+ * math/s_cacosl.c: Removed.
+ * math/s_cacoshf.c: Removed.
+ * math/s_cacosh.c: Removed.
+ * math/s_cacoshl.c: Removed.
+ * math/s_ccosf.c: Removed.
+ * math/s_ccos.c: Removed.
+ * math/s_ccosl.c: Removed.
+ * math/s_ccoshf.c: Removed.
+ * math/s_ccosh.c: Removed.
+ * math/s_ccoshl.c: Removed.
+
+ * sysdeps/ieee754/ldbl-opt/s_cacoshl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_cacosl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ccos.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ccosh.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ccoshl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/s_ccosl.c: Removed.
+
+ * sysdeps/m68k/m680x0/fpu/s_ccosh.c: Refactor into.
+ * sysdeps/m68k/m680x0/fpu/s_ccosh_template.c: New file.
+ * sysdeps/m68k/m680x0/fpu/s_ccoshf.c: Removed.
+ * sysdeps/m68k/m680x0/fpu/s_ccoshl.c: Removed.
+
+ * sysdeps/alpha/fpu/s_cacosf.c: Update to use template file.
+ * sysdeps/alpha/fpu/s_cacoshf.c: Likewise.
+ * sysdeps/alpha/fpu/s_ccosf.c: Likewise.
+ * sysdeps/alpha/fpu/s_ccoshf.c: Likewise.
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * s_cacos_template.c: Copy of s_cacos.c.
+ * s_cacosh_template.c: Copy of s_cacosh.c.
+ * s_ccos_template.c: Copy of s_ccos.c.
+ * s_ccosh_template.c: Copy of s_ccosh.c.
+
+2016-08-19 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * stdlib/tst-strtod-round-skeleton.c:
+ Refactored from tst-strtod-round.c.
+
+ (L_): New macro to apply literal modifier.
+ (FNPFX): New macro to select str or wcs prefix.
+ (CHAR): New macro to choose wchar_t or char.
+ (STRM): New macro to choose printf for tested character type.
+
+ (STRTO): New macro to choose appropriate string -> real function.
+ (FNPFXS): Stringitized version of FNPFX.
+ (STR): Support for above macro.
+ (STRX): Likewise.
+
+ (TEST): Update with above macros.
+ (test): Likewise.
+ (GEN_ONE_TEST): Likewise.
+ (test_in_one_mode): Likewise.
+
+ * stdlib/tst-strtod-round.c: New file.
+ * wcsmbs/tst-wcstod-round.c: New file.
+
+ * wcsmbs/Makefile: (tests): Add tst-wcstod-round
+ (tst-wcstod-round): Add libm depencency for fesetround.
+
+2016-08-19 Zack Weinberg <zackw@panix.com>
+
+ * debug/tst-chk1.c: Add tests for fortification of bcopy and bzero.
+
+2016-08-18 Torvald Riegel <triegel@redhat.com>
+
+ [BZ #20477]
+ * resolv/res_hconf.c (do_init): Use atomic access.
+ * resolv/res_hconf.h: Add comments.
+ * nscd/aicache.c (addhstaiX): Call _res_hconf_init unconditionally.
+ * nss/getXXbyYY_r.c (REENTRANT_NAME): Likewise.
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
+
+2016-08-18 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2):
+ Use DIAG_*_NEEDS_COMMENT macro to get rid of array-bounds warning.
+ * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f):
+ Likewise.
+
+2016-08-18 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #16907]
+ * argp/argp.h: Switch to __BEGIN_DECLS and __END_DECLS.
+ (__THROW, __NTH, __attribute__, __restrict): Remove definitions.
+ * argp/argp-fmtstream.h: Add __BEGIN_DECLS and __END_DECLS.
+ (__attribute__): Remove definition.
+
+2016-08-17 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128/e_asinl.c:
+ Remove unused sqrtl declaration.
+
+2016-08-17 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
+
+ * math/Makefile: (gen-libm-templates.stmp): New rule.
+ (libm-calls): Move carg conj cimag and cabs into ...
+ (gen-libm-calls): New variable.
+ (generated): Inform Make objects from gen-libm-calls
+ may be generated.
+
+ * sysdeps/generic/math-type-macros.h: New file.
+ * sysdeps/generic/math-type-macros-float.h: Likewise.
+ * sysdeps/generic/math-type-macros-double.h: Likewise.
+ * sysdeps/generic/math-type-macros-ldouble.h: Likewise.
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-double.h: Likewise.
+ * sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h: Likewise.
+
+ * math/cabs.c: Refactor into
+ * math/cabs_template.c: new file.
+ * math/cabsf.c: Removed.
+ * math/cabsl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cabsf.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cabsl.c: Removed.
+
+ * math/carg.c: Refactor into
+ * math/carg_template.c: new file.
+ * math/cargf.c: Removed.
+ * math/cargl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cargf.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cargl.c: Removed.
+
+ * math/conj.c: Refactor into
+ * math/conj_template.c: new file.
+ * math/conjf.c: Removed.
+ * math/conjl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/conjf.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/conjl.c: Removed.
+
+ * math/cimag.c: Refactor into
+ * math/cimag_template.c: new file.
+ * math/cimagf.c: Removed.
+ * math/cimagl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cimagf.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cimagl.c: Removed.
+
+ * math/cimag.c: Refactor into
+ * math/cimag_template.c: new file.
+ * math/cimagf.c: Removed.
+ * math/cimagl.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cimagf.c: Removed.
+ * sysdeps/ieee754/ldbl-opt/cimagl.c: Removed.
+
+2016-08-17 Florian Weimer <fweimer@redhat.com>
+
+ Reduce time to expected nptl/tst-once5 failure.
+ * nptl/tst-once5.cc (TIMEOUT): Define.
+
+2016-08-17 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20452]
+ Avoid additional copies of objects in libc.a in static libraries.
+ * sysdeps/ia64/nptl/Makefile (libpthread-shared-only-routines):
+ Add ptw-sysdep, ptw-sigblock, ptw-sigprocmask.
+ * sysdeps/mips/Makefile (librt-shared-only-routines): Add
+ rt-sysdep.
+ * sysdeps/mips/nptl/Makefile (libpthread-shared-only-routines):
+ Add nptl-sysdep.
+ * sysdeps/s390/nptl/Makefile (libpthread-shared-only-routines):
+ Add ptw-sysdep.
+ * sysdeps/unix/alpha/Makefile (librt-shared-only-routines): Add
+ rt-sysdep.
+ * sysdeps/unix/sysv/linux/alpha/Makefile
+ (libpthread-shared-only-routines): Add ptw-sysdep,
+ ptw-sigprocmask, ptw-rt_sigaction.
+ * sysdeps/unix/sysv/linux/ia64/Makefile
+ (librt-shared-only-routines): Add rt-sysdep.
+ * sysdeps/unix/sysv/linux/i386/Makefile
+ (libpthread-shared-only-routines): Add libc-do-syscall.
+ * sysdeps/unix/sysv/linux/microblaze/Makefile
+ (libpthread-shared-only-routines): Add sysdep.
+ * sysdeps/unix/sysv/linux/powerpc/Makefile
+ (librt-shared-only-routines): Add rt-sysdep.
+ (libpthread-shared-only-routines): Add sysdep.
+ * sysdeps/unix/sysv/linux/s390/Makefile
+ (librt-shared-only-routines): Add rt-sysdep.
+ * sysdeps/unix/sysv/linux/sparc/Makefile
+ (librt-shared-only-routines): Add rt-sysdep.
+ (libpthread-shared-only-routines): Add sysdep.
+ * sysdeps/unix/sysv/linux/tile/Makefile
+ (libpthread-shared-only-routines): Likewise.
+
+2016-08-16 Joseph Myers <joseph@codesourcery.com>
+
+ * soft-fp/extended.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_E):
+ Mask implicit bit out of unpacked value.
+ [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_EP): Likewise.
+ [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_E): Likewise.
+ [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_EP): Likewise.
+
+ * sysdeps/sparc/fpu/fesetexcept.c: New file.
+
+ * sysdeps/sh/sh4/fpu/fesetexcept.c: New file.
+
+ * sysdeps/s390/fpu/fesetexcept.c: New file.
+
+ * sysdeps/powerpc/fpu/fesetexcept.c: New file.
+ * sysdeps/powerpc/nofpu/fesetexcept.c: Likewise.
+ * sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c: Likewise.
+
+ * sysdeps/mips/fpu/fesetexcept.c: New file.
+
+ * sysdeps/m68k/fpu/fesetexcept.c: New file.
+
+ * sysdeps/ia64/fpu/fesetexcept.c: New file.
+
+ * sysdeps/hppa/fpu/fesetexcept.c: New file.
+
+ * sysdeps/arm/fesetexcept.c: New file.
+
+ * sysdeps/alpha/fpu/fesetexcept.c: New file.
+
+ * sysdeps/aarch64/fpu/fesetexcept.c: New file.
+
+ * math/fesetexcept.c: New file.
+ * sysdeps/i386/fpu/fesetexcept.c: Likewise.
+ * sysdeps/x86_64/fpu/fesetexcept.c: Likewise.
+ * math/fenv.h: Define
+ __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include
+ <bits/libc-header-start.h> instead of including <features.h>.
+ [__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetexcept): New function
+ declaration.
+ * manual/arith.texi (fesetexcept): Document function.
+ * math/Versions (fesetexcept): New libm symbol at version
+ GLIBC_2.25.
+ * math/Makefile (libm-support): Add fesetexcept.
+ (tests): Add test-fesetexcept and test-fesetexcept-traps.
+ * math/test-fesetexcept.c: New file.
+ * math/test-fesetexcept-traps.c: Likewise.
+ * sysdeps/nacl/libm.abilist: Update.
+ * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
+
+2016-08-16 Florian Weimer <fweimer@redhat.com>
+
+ * nptl/tst-tls3.c (default_stack_size_in_mb, stack_size_in_mb):
+ New.
+ (do_test): Apply default_stack_size_in_mb if not set.
+ * nptl/tst-tls3-malloc.c (stack_size_in_mb): Override default.
+
2016-08-15 Andreas Schwab <schwab@suse.de>
[BZ #20435]
+ CVE-2016-6323
* sysdeps/unix/sysv/linux/arm/setcontext.S (__startcontext): Mark
as .cantunwind.
diff --git a/INSTALL b/INSTALL
index ec3445f2d6..b5acedcc96 100644
--- a/INSTALL
+++ b/INSTALL
@@ -155,8 +155,8 @@ will be used, and CFLAGS sets optimization options for the compiler.
can configure with '--disable-werror'.
'--disable-mathvec'
- By default for x86_64, the GNU C Library is built with vector math
- library. Use this option to disable vector math library.
+ By default for x86_64, the GNU C Library is built with the vector
+ math library. Use this option to disable the vector math library.
'--build=BUILD-SYSTEM'
'--host=HOST-SYSTEM'
@@ -193,8 +193,8 @@ will be used, and CFLAGS sets optimization options for the compiler.
To build the library and related programs, type 'make'. This will
produce a lot of output, some of which may look like errors from 'make'
-but isn't. Look for error messages from 'make' containing '***'. Those
-indicate that something is seriously wrong.
+but aren't. Look for error messages from 'make' containing '***'.
+Those indicate that something is seriously wrong.
The compilation process can take a long time, depending on the
configuration and the speed of your machine. Some complex modules may
@@ -359,6 +359,15 @@ build the GNU C Library:
better code. As of release time, GCC 5.3 is the newest compiler
verified to work to build the GNU C Library.
+ For multi-arch support it is recommended to use a GCC which has
+ been built with support for GNU indirect functions. This ensures
+ that correct debugging information is generated for functions
+ selected by IFUNC resolvers. This support can either be enabled by
+ configuring GCC with '--enable-gnu-indirect-function', or by
+ enabling it by default by setting 'default_gnu_indirect_function'
+ variable for a particular architecture in the GCC source file
+ 'gcc/config.gcc'.
+
You can use whatever compiler you like to compile programs that use
the GNU C Library.
diff --git a/Makeconfig b/Makeconfig
index e4f16d1800..b7454290a7 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -905,7 +905,8 @@ endif
# The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
# to pass different flags for each flavor.
libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
-all-object-suffixes := .o .os .op .og .oS
+# .op may be added to all-object-suffixes below.
+all-object-suffixes := .o .os .oS
object-suffixes :=
CPPFLAGS-.o = $(pic-default)
CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
@@ -930,6 +931,7 @@ PIE-ccflag = -fPIE
ifeq (yes,$(build-profile))
# Under --enable-profile, we will build a static library of profiled objects.
# The profiled object files are named foo.op.
+all-object-suffixes += .op
object-suffixes += .op
CPPFLAGS-.op = -DPROF $(pic-default)
CFLAGS-.op = -pg
diff --git a/Makefile b/Makefile
index 4478c97126..1ae3281184 100644
--- a/Makefile
+++ b/Makefile
@@ -318,6 +318,29 @@ $(objpfx)begin-end-check.out: scripts/begin-end-check.pl
$(evaluate-test)
endif
+ifneq "$(headers)" ""
+# Special test of all the installed headers in this directory.
+tests-special += $(objpfx)check-installed-headers-c.out
+libof-check-installed-headers-c := nonlib
+$(objpfx)check-installed-headers-c.out: \
+ scripts/check-installed-headers.sh $(headers)
+ $(SHELL) $(..)scripts/check-installed-headers.sh c \
+ "$(CC) $(filter-out -std=%,$(CFLAGS)) -D_ISOMAC $(+includes)" \
+ $(headers) > $@; \
+ $(evaluate-test)
+
+ifneq "$(CXX)" ""
+tests-special += $(objpfx)check-installed-headers-cxx.out
+libof-check-installed-headers-cxx := nonlib
+$(objpfx)check-installed-headers-cxx.out: \
+ scripts/check-installed-headers.sh $(headers)
+ $(SHELL) $(..)scripts/check-installed-headers.sh c++ \
+ "$(CXX) $(filter-out -std=%,$(CXXFLAGS)) -D_ISOMAC $(+includes)" \
+ $(headers) > $@; \
+ $(evaluate-test)
+endif
+endif
+
define summarize-tests
@egrep -v '^(PASS|XFAIL):' $(objpfx)$1 || true
@echo "Summary of test results$2:"
diff --git a/Makerules b/Makerules
index 7e4077ee50..e865782b43 100644
--- a/Makerules
+++ b/Makerules
@@ -121,14 +121,10 @@ ifneq (,$(CXX))
# will be used instead of /usr/include/stdlib.h and /usr/include/math.h.
before-compile := $(common-objpfx)cstdlib $(common-objpfx)cmath \
$(before-compile)
-cstdlib=$(shell echo "\#include <cstdlib>" | $(CXX) -M -MP -x c++ - \
- | sed -n "/cstdlib:/{s/:$$//;p}")
-$(common-objpfx)cstdlib: $(cstdlib)
+$(common-objpfx)cstdlib: $(c++-cstdlib-header)
$(INSTALL_DATA) $< $@T
$(move-if-change) $@T $@
-cmath=$(shell echo "\#include <cmath>" | $(CXX) -M -MP -x c++ - \
- | sed -n "/cmath:/{s/:$$//;p}")
-$(common-objpfx)cmath: $(cmath)
+$(common-objpfx)cmath: $(c++-cmath-header)
$(INSTALL_DATA) $< $@T
$(move-if-change) $@T $@
endif
@@ -497,7 +493,6 @@ elide-routines.os += $(static-only-routines)
# static libraries.
elide-routines.o += $(shared-only-routines)
elide-routines.op += $(shared-only-routines)
-elide-routines.og += $(shared-only-routines)
# Shared library building.
diff --git a/NEWS b/NEWS
index fe9ff1c451..65184b11da 100644
--- a/NEWS
+++ b/NEWS
@@ -32,9 +32,100 @@ Version 2.25
presently cannot avoid being compiled under _GNU_SOURCE, exacerbating the
problem.
+* New <fenv.h> features from TS 18661-1:2014 are added to libm: the
+ fesetexcept, fetestexceptflag, fegetmode and fesetmode functions,
+ the femode_t type and the FE_DFL_MODE macro.
+
+* Integer width macros from TS 18661-1:2014 are added to <limits.h>:
+ CHAR_WIDTH, SCHAR_WIDTH, UCHAR_WIDTH, SHRT_WIDTH, USHRT_WIDTH, INT_WIDTH,
+ UINT_WIDTH, LONG_WIDTH, ULONG_WIDTH, LLONG_WIDTH, ULLONG_WIDTH; and to
+ <stdint.h>: INT8_WIDTH, UINT8_WIDTH, INT16_WIDTH, UINT16_WIDTH,
+ INT32_WIDTH, UINT32_WIDTH, INT64_WIDTH, UINT64_WIDTH, INT_LEAST8_WIDTH,
+ UINT_LEAST8_WIDTH, INT_LEAST16_WIDTH, UINT_LEAST16_WIDTH,
+ INT_LEAST32_WIDTH, UINT_LEAST32_WIDTH, INT_LEAST64_WIDTH,
+ UINT_LEAST64_WIDTH, INT_FAST8_WIDTH, UINT_FAST8_WIDTH, INT_FAST16_WIDTH,
+ UINT_FAST16_WIDTH, INT_FAST32_WIDTH, UINT_FAST32_WIDTH, INT_FAST64_WIDTH,
+ UINT_FAST64_WIDTH, INTPTR_WIDTH, UINTPTR_WIDTH, INTMAX_WIDTH,
+ UINTMAX_WIDTH, PTRDIFF_WIDTH, SIG_ATOMIC_WIDTH, SIZE_WIDTH, WCHAR_WIDTH,
+ WINT_WIDTH.
+
+* New <math.h> features are added from TS 18661-1:2014:
+
+ - Signaling NaN macros: SNANF, SNAN, SNANL.
+
+ - Comparison macros: iseqsig.
+
+ - Classification macros: iscanonical, issubnormal, iszero.
+
+ - Total order functions: totalorder, totalorderf, totalorderl,
+ totalordermag, totalordermagf, totalordermagl.
+
+ - Canonicalize functions: canonicalize, canonicalizef, canonicalizel.
+
+ - NaN functions: getpayload, getpayloadf, getpayloadl.
+
+* The functions strfromd, strfromf, and strfroml, from ISO/IEC TS 18661-1:2014,
+ are added to libc. They convert a floating-point number into string.
+
+* The <sys/quota.h> header now includes the <linux/quota.h> header. Support
+ for the Linux quota interface which predates kernel version 2.4.22 has
+ been removed.
+
+* The malloc_get_state and malloc_set_state functions have been removed.
+ Already-existing binaries that dynamically link to these functions will
+ get a hidden implementation in which malloc_get_state is a stub. As far
+ as we know, these functions are used only by GNU Emacs and this change
+ will not adversely affect already-built Emacs executables. Any undumped
+ Emacs executables, which normally exist only during an Emacs build, should
+ be rebuilt by re-running “./configure; make” in the Emacs build tree.
+
+* The “ip6-dotint” and “no-ip6-dotint” resolver options, and the
+ corresponding RES_NOIP6DOTINT flag from <resolv.h> have been removed.
+ “no-ip6-dotint” had already been the default, and support for the
+ “ip6-dotint” option was removed from the Internet in 2006.
+
+* The "ip6-bytestring" resolver option and the corresponding RES_NOIP6DOTINT
+ flag from <resolv.h> have been removed. The option relied on a
+ backwards-incompatible DNS extension which was never deployed on the
+ Internet.
+
+* The flags RES_AAONLY, RES_PRIMARY, RES_NOCHECKNAME, RES_KEEPTSIG defined
+ in the <resolv.h> header file have been deprecated. They were already
+ unimplemented.
+
+* DNSSEC-related declarations and definitions have been removed from the
+ <arpa/nameser.h> header file, and libresolv will no longer attempt to
+ decode the data part of DNSSEC record types. Previous versions of glibc
+ only implemented minimal support for the previous version of DNSSEC, which
+ is incompatible with the currently deployed version.
+
+* The resource record type classification macros ns_t_qt_p, ns_t_mrr_p,
+ ns_t_rr_p, ns_t_udp_p, ns_t_xfr_p have been removed from the
+ <arpa/nameser.h> header file because the distinction between RR types and
+ meta-RR types is not officially standardized, subject to revision, and
+ thus not suitable for encoding in a macro.
+
+* The types res_sendhookact, res_send_qhook, re_send_rhook, and the qhook
+ and rhook members of the res_state type in <resolv.h> have been removed.
+ The glibc stub resolver did not support these hooks, but the header file
+ did not reflect that.
+
+* For multi-arch support it is recommended to use a GCC which has
+ been built with support for GNU indirect functions. This ensures
+ that correct debugging information is generated for functions
+ selected by IFUNC resolvers. This support can either be enabled by
+ configuring GCC with '--enable-gnu-indirect-function', or by
+ enabling it by default by setting 'default_gnu_indirect_function'
+ variable for a particular architecture in the GCC source file
+ 'gcc/config.gcc'.
+
Security related changes:
- [Add security related changes here]
+ On ARM EABI (32-bit), generating a backtrace for execution contexts which
+ have been created with makecontext could fail to terminate due to a
+ missing .cantunwind annotation. This has been observed to lead to a hang
+ (denial of service) in some Go applications compiled with gccgo. Reported
+ by Andreas Schwab. (CVE-2016-6323)
The following bugs are resolved with this release:
diff --git a/Rules b/Rules
index 8306d36a07..466db076f0 100644
--- a/Rules
+++ b/Rules
@@ -80,6 +80,29 @@ $(common-objpfx)dummy.c:
(echo 'extern void __dummy__ (void);'; \
echo 'void __dummy__ (void) { }') > $@
common-generated += dummy.o dummy.c
+
+ifneq "$(headers)" ""
+# Special test of all the installed headers in this directory.
+tests-special += $(objpfx)check-installed-headers-c.out
+libof-check-installed-headers-c := nonlib
+$(objpfx)check-installed-headers-c.out: \
+ $(..)scripts/check-installed-headers.sh $(headers)
+ $(SHELL) $(..)scripts/check-installed-headers.sh c \
+ "$(CC) $(filter-out -std=%,$(CFLAGS)) -D_ISOMAC $(+includes)" \
+ $(headers) > $@; \
+ $(evaluate-test)
+
+ifneq "$(CXX)" ""
+tests-special += $(objpfx)check-installed-headers-cxx.out
+libof-check-installed-headers-cxx := nonlib
+$(objpfx)check-installed-headers-cxx.out: \
+ $(..)scripts/check-installed-headers.sh $(headers)
+ $(SHELL) $(..)scripts/check-installed-headers.sh c++ \
+ "$(CXX) $(filter-out -std=%,$(CXXFLAGS)) -D_ISOMAC $(+includes)" \
+ $(headers) > $@; \
+ $(evaluate-test)
+endif
+endif
# This makes all the auxiliary and test programs.
@@ -91,7 +114,8 @@ else
others: $(addprefix $(objpfx),$(extra-objs))
endif
ifeq ($(run-built-tests),no)
-tests: $(addprefix $(objpfx),$(tests) $(test-srcs)) $(tests-special)
+tests: $(addprefix $(objpfx),$(filter-out $(tests-unsupported),$(tests)) \
+ $(test-srcs)) $(tests-special)
xtests: tests $(xtests-special)
else
tests: $(tests:%=$(objpfx)%.out) $(tests-special)
@@ -100,9 +124,14 @@ endif
tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
xtests-special-notdir = $(patsubst $(objpfx)%, %, $(xtests-special))
+ifeq ($(run-built-tests),no)
+tests-expected =
+else
+tests-expected = $(tests)
+endif
tests:
$(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
- $(sort $(tests) $(tests-special-notdir:.out=)) \
+ $(sort $(tests-expected) $(tests-special-notdir:.out=)) \
> $(objpfx)subdir-tests.sum
xtests:
$(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \
diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h
index bdeaa54dc2..e8c5797f38 100644
--- a/argp/argp-fmtstream.h
+++ b/argp/argp-fmtstream.h
@@ -29,21 +29,6 @@
#include <string.h>
#include <unistd.h>
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
- defined __STRICT_ANSI__
-# define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
- defined __STRICT_ANSI__
-# define __format__ format
-# define __printf__ printf
-# endif
-#endif
-
#if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
/* line_wrap_stream is available, so use that. */
#define ARGP_FMTSTREAM_USE_LINEWRAP
@@ -111,6 +96,8 @@ struct argp_fmtstream
typedef struct argp_fmtstream *argp_fmtstream_t;
+__BEGIN_DECLS
+
/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
written on it with LMARGIN spaces and limits them to RMARGIN columns
total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
@@ -297,6 +284,8 @@ __argp_fmtstream_point (argp_fmtstream_t __fs)
#endif /* __OPTIMIZE__ */
+__END_DECLS
+
#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
#endif /* argp-fmtstream.h */
diff --git a/argp/argp.h b/argp/argp.h
index e67bbef739..50667762ee 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -28,48 +28,12 @@
#define __need_error_t
#include <errno.h>
-#ifndef __THROW
-# define __THROW
-#endif
-#ifndef __NTH
-# define __NTH(fct) fct __THROW
-#endif
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
- defined __STRICT_ANSI__
-# define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
- are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
- defined __STRICT_ANSI__
-# define __format__ format
-# define __printf__ printf
-# endif
-#endif
-
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
- "restrict", and "configure" may have defined "restrict". */
-#ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
-# if defined restrict || 199901L <= __STDC_VERSION__
-# define __restrict restrict
-# else
-# define __restrict
-# endif
-# endif
-#endif
-
#ifndef __error_t_defined
typedef int error_t;
# define __error_t_defined
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+__BEGIN_DECLS
/* A description of a particular option. A pointer to an array of
these is passed in the OPTIONS field of an argp structure. Each option
@@ -547,7 +511,7 @@ extern void *__argp_input (const struct argp *__restrict __argp,
#ifdef __USE_EXTERN_INLINES
-# if !_LIBC
+# if !(defined _LIBC && _LIBC)
# define __argp_usage argp_usage
# define __argp_state_help argp_state_help
# define __option_is_short _option_is_short
@@ -582,7 +546,7 @@ __NTH (__option_is_end (const struct argp_option *__opt))
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
}
-# if !_LIBC
+# if !(defined _LIBC && _LIBC)
# undef __argp_usage
# undef __argp_state_help
# undef __option_is_short
@@ -590,8 +554,6 @@ __NTH (__option_is_end (const struct argp_option *__opt))
# endif
#endif /* Use extern inlines. */
-#ifdef __cplusplus
-}
-#endif
+__END_DECLS
#endif /* argp.h */
diff --git a/benchtests/Makefile b/benchtests/Makefile
index 144b32ea38..5a61522689 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -72,6 +72,7 @@ benchset := $(string-benchset-all) $(stdlib-benchset) $(stdio-common-benchset) \
CFLAGS-bench-ffs.c += -fno-builtin
CFLAGS-bench-ffsll.c += -fno-builtin
+CFLAGS-bench-sqrt.c += -fno-builtin
bench-malloc := malloc-thread
diff --git a/bits/fenv.h b/bits/fenv.h
index f9b61d5e42..deeceeeec0 100644
--- a/bits/fenv.h
+++ b/bits/fenv.h
@@ -53,3 +53,11 @@ fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1l)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/bits/in.h b/bits/in.h
index 7dc93c192f..8063a753e6 100644
--- a/bits/in.h
+++ b/bits/in.h
@@ -39,8 +39,8 @@
#define IP_RECVDSTADDR 7 /* bool; Receive IP dst addr w/datagram. */
#define IP_RETOPTS 8 /* ip_opts; Set/get IP per-packet options. */
#define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 11 /* i_char; set/get IP multicast loopback */
+#define IP_MULTICAST_TTL 10 /* unsigned char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 11 /* bool; set/get IP multicast loopback */
#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
diff --git a/bits/iscanonical.h b/bits/iscanonical.h
new file mode 100644
index 0000000000..97eb736ce3
--- /dev/null
+++ b/bits/iscanonical.h
@@ -0,0 +1,28 @@
+/* Define iscanonical macro.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
+#endif
+
+/* Return nonzero value if X is canonical. By default, we only have
+ IEEE interchange binary formats, in which all values are canonical,
+ but the argument must still be converted to its semantic type for
+ any exceptions arising from the conversion, before being
+ discarded. */
+#define iscanonical(x) ((void) (__typeof (x)) (x), 1)
diff --git a/bits/resource.h b/bits/resource.h
index 7d2d66c7c9..5cd2fe56a2 100644
--- a/bits/resource.h
+++ b/bits/resource.h
@@ -129,8 +129,7 @@ enum __rusage_who
#define RUSAGE_CHILDREN RUSAGE_CHILDREN
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
+#include <bits/types/struct_timeval.h>
/* Structure which says how much of each resource has been used. */
struct rusage
diff --git a/bits/sigcontext.h b/bits/sigcontext.h
index 85b2a96d9f..ddc4966d6b 100644
--- a/bits/sigcontext.h
+++ b/bits/sigcontext.h
@@ -16,7 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
@@ -30,3 +33,5 @@ struct sigcontext
};
/* Signal subcodes should be defined here. */
+
+#endif /* bits/sigcontext.h */
diff --git a/bits/sigstack.h b/bits/sigstack.h
index b4b911e7d1..62020b396e 100644
--- a/bits/sigstack.h
+++ b/bits/sigstack.h
@@ -16,7 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
@@ -52,3 +55,5 @@ enum
/* System default stack size. */
#define SIGSTKSZ (MINSIGSTKSZ + 32768)
+
+#endif /* bits/sigstack.h */
diff --git a/bits/socket.h b/bits/socket.h
index a22fd56031..18adca4557 100644
--- a/bits/socket.h
+++ b/bits/socket.h
@@ -216,13 +216,13 @@ struct cmsghdr
of cmsghdr structure. */
int cmsg_level; /* Originating protocol. */
int cmsg_type; /* Protocol specific type. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+#if __glibc_c99_flexarr_available
__extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
#endif
};
/* Ancillary data object manipulation macros. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+#if __glibc_c99_flexarr_available
# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
#else
# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
diff --git a/bits/time.h b/bits/time.h
index 19c7ab0997..84e0e94a17 100644
--- a/bits/time.h
+++ b/bits/time.h
@@ -20,9 +20,10 @@
* Never include this file directly; use <time.h> instead.
*/
-#ifndef __need_timeval
-# ifndef _BITS_TIME_H
-# define _BITS_TIME_H 1
+#ifndef _BITS_TIME_H
+#define _BITS_TIME_H 1
+
+#include <bits/types.h>
/* ISO/IEC 9899:1999 7.23.1: Components of time
The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is
@@ -30,51 +31,34 @@
/* CAE XSH, Issue 4, Version 2: <time.h>
The value of CLOCKS_PER_SEC is required to be 1 million on all
XSI-conformant systems. */
-# define CLOCKS_PER_SEC ((clock_t) 1000000)
+#define CLOCKS_PER_SEC ((__clock_t) 1000000)
-# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+#if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \
+ && !defined __USE_XOPEN2K
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
presents the real value for clock ticks per second for the system. */
-# include <bits/types.h>
extern long int __sysconf (int);
-# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
-# endif
+# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
+#endif
-# ifdef __USE_POSIX199309
+#ifdef __USE_POSIX199309
/* Identifier for system-wide realtime clock. */
-# define CLOCK_REALTIME 0
+# define CLOCK_REALTIME 0
/* Monotonic system-wide clock. */
-# define CLOCK_MONOTONIC 1
+# define CLOCK_MONOTONIC 1
/* High-resolution timer from the CPU. */
-# define CLOCK_PROCESS_CPUTIME_ID 2
+# define CLOCK_PROCESS_CPUTIME_ID 2
/* Thread-specific CPU-time clock. */
-# define CLOCK_THREAD_CPUTIME_ID 3
+# define CLOCK_THREAD_CPUTIME_ID 3
/* Monotonic system-wide clock, not adjusted for frequency scaling. */
-# define CLOCK_MONOTONIC_RAW 4
+# define CLOCK_MONOTONIC_RAW 4
/* Identifier for system-wide realtime clock, updated only on ticks. */
-# define CLOCK_REALTIME_COARSE 5
+# define CLOCK_REALTIME_COARSE 5
/* Monotonic system-wide clock, updated only on ticks. */
-# define CLOCK_MONOTONIC_COARSE 6
+# define CLOCK_MONOTONIC_COARSE 6
/* Flag to indicate time is absolute. */
-# define TIMER_ABSTIME 1
-# endif
-
-# endif /* bits/time.h */
+# define TIMER_ABSTIME 1
#endif
-#ifdef __need_timeval
-# undef __need_timeval
-# ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL 1
-# include <bits/types.h>
-
-/* A time value that is accurate to the nearest
- microsecond but also has a range of years. */
-struct timeval
- {
- __time_t tv_sec; /* Seconds. */
- __suseconds_t tv_usec; /* Microseconds. */
- };
-# endif /* struct timeval */
-#endif /* need timeval */
+#endif /* bits/time.h */
diff --git a/bits/wordsize.h b/bits/wordsize.h
index 9ef0e8526a..14edae3a11 100644
--- a/bits/wordsize.h
+++ b/bits/wordsize.h
@@ -1 +1,27 @@
#error "This file must be written based on the data type sizes of the target"
+
+/* The following entries are a template for what defines should be in the
+ wordsize.h header file for a target. */
+
+/* Size in bits of the 'long int' and pointer types. */
+#define __WORDSIZE
+
+/* This should be set to 1 if __WORDSIZE is 32 and size_t is type
+ 'unsigned long' instead of type 'unsigned int'. This will ensure
+ that SIZE_MAX is defined as an unsigned long constant instead of an
+ unsigned int constant. Set to 0 if __WORDSIZE is 32 and size_t is
+ 'unsigned int' and leave undefined if __WORDSIZE is 64. */
+#define __WORDSIZE32_SIZE_ULONG
+
+/* This should be set to 1 if __WORDSIZE is 32 and ptrdiff_t is type 'long'
+ instead of type 'int'. This will ensure that PTRDIFF_MIN and PTRDIFF_MAX
+ are defined as long constants instead of int constants. Set to 0 if
+ __WORDSIZE is 32 and ptrdiff_t is type 'int' and leave undefined if
+ __WORDSIZE is 64. */
+#define __WORDSIZE32_PTRDIFF_LONG
+
+/* Set to 1 in order to force time types to be 32 bits instead of 64 bits in
+ struct lastlog and struct utmp{,x} on 64-bit ports. This may be done in
+ order to make 64-bit ports compatible with 32-bit ports. Set to 0 for
+ 64-bit ports where the time types are 64-bits or for any 32-bit ports. */
+#define __WORDSIZE_TIME64_COMPAT32
diff --git a/config.h.in b/config.h.in
index 856ef6a69c..33757bd553 100644
--- a/config.h.in
+++ b/config.h.in
@@ -70,6 +70,9 @@
/* Define if assembler supports AVX512DQ. */
#undef HAVE_AVX512DQ_ASM_SUPPORT
+/* Define if assembler supports z196 zarch instructions as default on S390. */
+#undef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
+
/* Define if assembler supports vector instructions on S390. */
#undef HAVE_S390_VX_ASM_SUPPORT
@@ -171,6 +174,9 @@
/* Define to 1 if STT_GNU_IFUNC support actually works. */
#define HAVE_IFUNC 0
+/* Define if gcc supports attribute ifunc. */
+#undef HAVE_GCC_IFUNC
+
/* Define if the linker defines __ehdr_start. */
#undef HAVE_EHDR_START
diff --git a/config.make.in b/config.make.in
index 95c6f36876..04a8b3ed7f 100644
--- a/config.make.in
+++ b/config.make.in
@@ -45,6 +45,8 @@ defines = @DEFINES@
sysheaders = @sysheaders@
sysincludes = @SYSINCLUDES@
c++-sysincludes = @CXX_SYSINCLUDES@
+c++-cstdlib-header = @CXX_CSTDLIB_HEADER@
+c++-cmath-header = @CXX_CMATH_HEADER@
all-warnings = @all_warnings@
enable-werror = @enable_werror@
diff --git a/configure b/configure
index 17625e1041..e80e0ad56c 100755
--- a/configure
+++ b/configure
@@ -635,6 +635,8 @@ BISON
INSTALL_INFO
PERL
BASH_SHELL
+CXX_CMATH_HEADER
+CXX_CSTDLIB_HEADER
CXX_SYSINCLUDES
SYSINCLUDES
AUTOCONF
@@ -3914,6 +3916,36 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ld_gnu_indirect_function" >&5
$as_echo "$libc_cv_ld_gnu_indirect_function" >&6; }
+# Check if gcc supports attribute ifunc as it is used in libc_ifunc macro.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc attribute ifunc support" >&5
+$as_echo_n "checking for gcc attribute ifunc support... " >&6; }
+if ${libc_cv_gcc_indirect_function+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.c <<EOF
+extern int func (int);
+int used_func (int a)
+{
+ return a;
+}
+static void *resolver ()
+{
+ return &used_func;
+}
+extern __typeof (func) func __attribute__ ((ifunc ("resolver")));
+EOF
+libc_cv_gcc_indirect_function=no
+if ${CC-cc} -c conftest.c -o conftest.o 1>&5 \
+ 2>&5 ; then
+ if $READELF -s conftest.o | grep IFUNC >/dev/null 2>&5; then
+ libc_cv_gcc_indirect_function=yes
+ fi
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_indirect_function" >&5
+$as_echo "$libc_cv_gcc_indirect_function" >&6; }
+
if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
if test x"$multi_arch" = xyes; then
as_fn_error $? "--enable-multi-arch support requires assembler and linker support" "$LINENO" 5
@@ -3921,6 +3953,13 @@ if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
multi_arch=no
fi
fi
+if test x"$libc_cv_gcc_indirect_function" != xyes &&
+ test x"$multi_arch" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-multi-arch support recommends a gcc with gnu-indirect-function support.
+Please use a gcc which supports it by default or configure gcc with --enable-gnu-indirect-function" >&5
+$as_echo "$as_me: WARNING: --enable-multi-arch support recommends a gcc with gnu-indirect-function support.
+Please use a gcc which supports it by default or configure gcc with --enable-gnu-indirect-function" >&2;}
+fi
multi_arch_d=
if test x"$multi_arch" != xno; then
multi_arch_d=/multiarch
@@ -5054,6 +5093,18 @@ fi
+# Obtain some C++ header file paths. This is used to make a local
+# copy of those headers in Makerules.
+if test -n "$CXX"; then
+ find_cxx_header () {
+ echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+ }
+ CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
+ CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+fi
+
+
+
# Test if LD_LIBRARY_PATH contains the notation for the current directory
# since this would lead to problems installing/building glibc.
# LD_LIBRARY_PATH contains the current directory if one of the following
@@ -6504,6 +6555,11 @@ if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
fi
+if test x"$libc_cv_gcc_indirect_function" = xyes; then
+ $as_echo "#define HAVE_GCC_IFUNC 1" >>confdefs.h
+
+fi
+
# This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
# configure fragment can override the value to prevent this AC_DEFINE.
diff --git a/configure.ac b/configure.ac
index 33bcd62180..a64aeb9979 100644
--- a/configure.ac
+++ b/configure.ac
@@ -634,6 +634,30 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
fi
rm -f conftest*])
+# Check if gcc supports attribute ifunc as it is used in libc_ifunc macro.
+AC_CACHE_CHECK([for gcc attribute ifunc support],
+ libc_cv_gcc_indirect_function, [dnl
+cat > conftest.c <<EOF
+extern int func (int);
+int used_func (int a)
+{
+ return a;
+}
+static void *resolver ()
+{
+ return &used_func;
+}
+extern __typeof (func) func __attribute__ ((ifunc ("resolver")));
+EOF
+libc_cv_gcc_indirect_function=no
+if ${CC-cc} -c conftest.c -o conftest.o 1>&AS_MESSAGE_LOG_FD \
+ 2>&AS_MESSAGE_LOG_FD ; then
+ if $READELF -s conftest.o | grep IFUNC >/dev/null 2>&AS_MESSAGE_LOG_FD; then
+ libc_cv_gcc_indirect_function=yes
+ fi
+fi
+rm -f conftest*])
+
if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
if test x"$multi_arch" = xyes; then
AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support])
@@ -641,6 +665,11 @@ if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then
multi_arch=no
fi
fi
+if test x"$libc_cv_gcc_indirect_function" != xyes &&
+ test x"$multi_arch" = xyes; then
+ AC_MSG_WARN([--enable-multi-arch support recommends a gcc with gnu-indirect-function support.
+Please use a gcc which supports it by default or configure gcc with --enable-gnu-indirect-function])
+fi
multi_arch_d=
if test x"$multi_arch" != xno; then
multi_arch_d=/multiarch
@@ -1039,6 +1068,18 @@ fi
AC_SUBST(SYSINCLUDES)
AC_SUBST(CXX_SYSINCLUDES)
+# Obtain some C++ header file paths. This is used to make a local
+# copy of those headers in Makerules.
+if test -n "$CXX"; then
+ find_cxx_header () {
+ echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+ }
+ CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
+ CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+fi
+AC_SUBST(CXX_CSTDLIB_HEADER)
+AC_SUBST(CXX_CMATH_HEADER)
+
# Test if LD_LIBRARY_PATH contains the notation for the current directory
# since this would lead to problems installing/building glibc.
# LD_LIBRARY_PATH contains the current directory if one of the following
@@ -1770,6 +1811,10 @@ if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
AC_DEFINE(HAVE_IFUNC)
fi
+if test x"$libc_cv_gcc_indirect_function" = xyes; then
+ AC_DEFINE(HAVE_GCC_IFUNC)
+fi
+
# This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
# configure fragment can override the value to prevent this AC_DEFINE.
AC_SUBST(use_nscd)
diff --git a/conform/Makefile b/conform/Makefile
index 32a0937b06..7883624c81 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -196,13 +196,13 @@ $(conformtest-header-tests): $(objpfx)%/conform.out: \
conformtest.pl $(conformtest-headers-data)
(set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \
mkdir -p $(@D)/scratch; \
- $(PERL) conformtest.pl --tmpdir=$(@D)/scratch --cc='$(CC)' \
+ $(PERL) -I. conformtest.pl --tmpdir=$(@D)/scratch --cc='$(CC)' \
--flags='$(conformtest-cc-flags)' --standard=$$std \
--headers=$$hdr > $@); \
$(evaluate-test)
$(linknamespace-symlists-tests): $(objpfx)symlist-%: list-header-symbols.pl
- $(PERL) -w $< --tmpdir=$(objpfx) --cc='$(CC)' \
+ $(PERL) -I. -w $< --tmpdir=$(objpfx) --cc='$(CC)' \
--flags='$(conformtest-cc-flags)' --standard=$* \
--headers="$(strip $(conformtest-headers-$*))" \
> $@ 2> $@.err; \
@@ -229,10 +229,11 @@ $(linknamespace-symlist-stdlibs-tests): $(objpfx)symlist-stdlibs-%: \
$(linknamespace-header-tests): $(objpfx)%/linknamespace.out: \
linknamespace.pl \
+ $(linknamespace-symlists-tests) \
$(linknamespace-symlist-stdlibs-tests)
(set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \
mkdir -p $(@D)/scratch; \
- $(PERL) -w $< --tmpdir=$(@D)/scratch --cc='$(CC)' \
+ $(PERL) -I. -w $< --tmpdir=$(@D)/scratch --cc='$(CC)' \
--flags='$(conformtest-cc-flags)' --standard=$$std \
--stdsyms=$(objpfx)symlist-$$std --header=$$hdr \
--libsyms=$(objpfx)symlist-stdlibs-$$std \
diff --git a/crypt/sha256-block.c b/crypt/sha256-block.c
index 8a77096999..a44fe01d5b 100644
--- a/crypt/sha256-block.c
+++ b/crypt/sha256-block.c
@@ -3,7 +3,7 @@
/* Process LEN bytes of BUFFER, accumulating context into CTX.
It is assumed that LEN % 64 == 0. */
void
-sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
+__sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
{
const uint32_t *words = buffer;
size_t nwords = len / sizeof (uint32_t);
diff --git a/crypt/sha256.c b/crypt/sha256.c
index e858f4b760..b5497d935d 100644
--- a/crypt/sha256.c
+++ b/crypt/sha256.c
@@ -81,8 +81,7 @@ static const uint32_t K[64] =
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
-void
-sha256_process_block (const void *, size_t, struct sha256_ctx *);
+void __sha256_process_block (const void *, size_t, struct sha256_ctx *);
/* Initialize structure containing state of computation.
(FIPS 180-2:5.3.2) */
@@ -131,7 +130,7 @@ __sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
#endif
/* Process last bytes. */
- sha256_process_block (ctx->buffer, bytes + pad + 8, ctx);
+ __sha256_process_block (ctx->buffer, bytes + pad + 8, ctx);
/* Put result from CTX in first 32 bytes following RESBUF. */
for (unsigned int i = 0; i < 8; ++i)
@@ -156,7 +155,7 @@ __sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
if (ctx->buflen > 64)
{
- sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
+ __sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
ctx->buflen &= 63;
/* The regions in the following copy operation cannot overlap. */
@@ -182,14 +181,14 @@ __sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
if (UNALIGNED_P (buffer))
while (len > 64)
{
- sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
+ __sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
buffer = (const char *) buffer + 64;
len -= 64;
}
else
#endif
{
- sha256_process_block (buffer, len & ~63, ctx);
+ __sha256_process_block (buffer, len & ~63, ctx);
buffer = (const char *) buffer + (len & ~63);
len &= 63;
}
@@ -204,7 +203,7 @@ __sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
left_over += len;
if (left_over >= 64)
{
- sha256_process_block (ctx->buffer, 64, ctx);
+ __sha256_process_block (ctx->buffer, 64, ctx);
left_over -= 64;
memcpy (ctx->buffer, &ctx->buffer[64], left_over);
}
diff --git a/crypt/sha512-block.c b/crypt/sha512-block.c
index c542db1c9c..577839fe5c 100644
--- a/crypt/sha512-block.c
+++ b/crypt/sha512-block.c
@@ -3,7 +3,7 @@
/* Process LEN bytes of BUFFER, accumulating context into CTX.
It is assumed that LEN % 128 == 0. */
void
-sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
+__sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
{
const uint64_t *words = buffer;
size_t nwords = len / sizeof (uint64_t);
diff --git a/crypt/sha512.c b/crypt/sha512.c
index 47f3f7c60e..dd2af3c0aa 100644
--- a/crypt/sha512.c
+++ b/crypt/sha512.c
@@ -101,8 +101,8 @@ static const uint64_t K[80] =
UINT64_C (0x5fcb6fab3ad6faec), UINT64_C (0x6c44198c4a475817)
};
-void
-sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx);
+void __sha512_process_block (const void *buffer, size_t len,
+ struct sha512_ctx *ctx);
/* Initialize structure containing state of computation.
(FIPS 180-2:5.3.3) */
@@ -153,7 +153,7 @@ __sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
(ctx->total[TOTAL128_low] >> 61));
/* Process last bytes. */
- sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
+ __sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
/* Put result from CTX in first 64 bytes following RESBUF. */
for (unsigned int i = 0; i < 8; ++i)
@@ -178,7 +178,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
if (ctx->buflen > 128)
{
- sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx);
+ __sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx);
ctx->buflen &= 127;
/* The regions in the following copy operation cannot overlap. */
@@ -204,7 +204,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
if (UNALIGNED_P (buffer))
while (len > 128)
{
- sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128,
+ __sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128,
ctx);
buffer = (const char *) buffer + 128;
len -= 128;
@@ -212,7 +212,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
else
#endif
{
- sha512_process_block (buffer, len & ~127, ctx);
+ __sha512_process_block (buffer, len & ~127, ctx);
buffer = (const char *) buffer + (len & ~127);
len &= 127;
}
@@ -227,7 +227,7 @@ __sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
left_over += len;
if (left_over >= 128)
{
- sha512_process_block (ctx->buffer, 128, ctx);
+ __sha512_process_block (ctx->buffer, 128, ctx);
left_over -= 128;
memcpy (ctx->buffer, &ctx->buffer[128], left_over);
}
diff --git a/csu/libc-start.c b/csu/libc-start.c
index f4aa01a988..99c040ab97 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -23,9 +23,6 @@
#include <exit-thread.h>
extern void __libc_init_first (int argc, char **argv, char **envp);
-#ifndef SHARED
-extern void __libc_csu_irel (void);
-#endif
extern int __libc_multiple_libcs;
diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c
index 4f968eee42..478c2fbb81 100644
--- a/debug/tst-chk1.c
+++ b/debug/tst-chk1.c
@@ -143,6 +143,11 @@ do_test (void)
if (memcmp (buf, "aabcdefghi", 10))
FAIL ();
+ memcpy (buf, "abcdefghij", 10);
+ bcopy (buf, buf + 1, 9);
+ if (memcmp (buf, "aabcdefghi", 10))
+ FAIL ();
+
if (mempcpy (buf + 5, "abcde", 5) != buf + 10
|| memcmp (buf, "aabcdabcde", 10))
FAIL ();
@@ -151,6 +156,10 @@ do_test (void)
if (memcmp (buf, "aabcdabcjj", 10))
FAIL ();
+ bzero (buf + 8, 2);
+ if (memcmp (buf, "aabcdabc\0\0", 10))
+ FAIL ();
+
strcpy (buf + 4, "EDCBA");
if (memcmp (buf, "aabcEDCBA", 10))
FAIL ();
@@ -175,6 +184,11 @@ do_test (void)
if (memcmp (buf, "aabcdefghi", 10))
FAIL ();
+ memcpy (buf, "abcdefghij", l0 + 10);
+ bcopy (buf, buf + 1, l0 + 9);
+ if (memcmp (buf, "aabcdefghi", 10))
+ FAIL ();
+
if (mempcpy (buf + 5, "abcde", l0 + 5) != buf + 10
|| memcmp (buf, "aabcdabcde", 10))
FAIL ();
@@ -183,6 +197,10 @@ do_test (void)
if (memcmp (buf, "aabcdabcjj", 10))
FAIL ();
+ bzero (buf + 8, l0 + 2);
+ if (memcmp (buf, "aabcdabc\0\0", 10))
+ FAIL ();
+
strcpy (buf + 4, str1 + 5);
if (memcmp (buf, "aabcEDCBA", 10))
FAIL ();
@@ -214,11 +232,18 @@ do_test (void)
if (memcmp (buf, "aabcEcdZY", 10))
FAIL ();
+ /* The following tests are supposed to succeed at all fortify
+ levels, even though they overflow a.buf1 into a.buf2. */
memcpy (a.buf1, "abcdefghij", l0 + 10);
memmove (a.buf1 + 1, a.buf1, l0 + 9);
if (memcmp (a.buf1, "aabcdefghi", 10))
FAIL ();
+ memcpy (a.buf1, "abcdefghij", l0 + 10);
+ bcopy (a.buf1, a.buf1 + 1, l0 + 9);
+ if (memcmp (a.buf1, "aabcdefghi", 10))
+ FAIL ();
+
if (mempcpy (a.buf1 + 5, "abcde", l0 + 5) != a.buf1 + 10
|| memcmp (a.buf1, "aabcdabcde", 10))
FAIL ();
@@ -227,6 +252,10 @@ do_test (void)
if (memcmp (a.buf1, "aabcdabcjj", 10))
FAIL ();
+ bzero (a.buf1 + 8, l0 + 2);
+ if (memcmp (a.buf1, "aabcdabc\0\0", 10))
+ FAIL ();
+
#if __USE_FORTIFY_LEVEL < 2
/* The following tests are supposed to crash with -D_FORTIFY_SOURCE=2
and sufficient GCC support, as the string operations overflow
@@ -285,6 +314,14 @@ do_test (void)
CHK_FAIL_END
CHK_FAIL_START
+ bcopy (buf + 1, buf + 2, 9);
+ CHK_FAIL_END
+
+ CHK_FAIL_START
+ bcopy (buf + 1, buf + 2, l0 + 9);
+ CHK_FAIL_END
+
+ CHK_FAIL_START
p = (char *) mempcpy (buf + 6, "abcde", 5);
CHK_FAIL_END
@@ -301,6 +338,14 @@ do_test (void)
CHK_FAIL_END
CHK_FAIL_START
+ bzero (buf + 9, 2);
+ CHK_FAIL_END
+
+ CHK_FAIL_START
+ bzero (buf + 9, l0 + 2);
+ CHK_FAIL_END
+
+ CHK_FAIL_START
strcpy (buf + 5, str1 + 5);
CHK_FAIL_END
@@ -378,6 +423,14 @@ do_test (void)
CHK_FAIL_END
CHK_FAIL_START
+ bcopy (a.buf1 + 1, a.buf1 + 2, 9);
+ CHK_FAIL_END
+
+ CHK_FAIL_START
+ bcopy (a.buf1 + 1, a.buf1 + 2, l0 + 9);
+ CHK_FAIL_END
+
+ CHK_FAIL_START
p = (char *) mempcpy (a.buf1 + 6, "abcde", 5);
CHK_FAIL_END
@@ -393,6 +446,14 @@ do_test (void)
memset (a.buf1 + 9, 'j', l0 + 2);
CHK_FAIL_END
+ CHK_FAIL_START
+ bzero (a.buf1 + 9, 2);
+ CHK_FAIL_END
+
+ CHK_FAIL_START
+ bzero (a.buf1 + 9, l0 + 2);
+ CHK_FAIL_END
+
# if __USE_FORTIFY_LEVEL >= 2
# define O 0
# else
diff --git a/dlfcn/bug-atexit3-lib.cc b/dlfcn/bug-atexit3-lib.cc
index 3d01ea81d2..aba772004d 100644
--- a/dlfcn/bug-atexit3-lib.cc
+++ b/dlfcn/bug-atexit3-lib.cc
@@ -1,14 +1,22 @@
#include <unistd.h>
+#include <string.h>
+
+static void
+write_message (const char *message)
+{
+ ssize_t unused __attribute__ ((unused));
+ unused = write (STDOUT_FILENO, message, strlen (message));
+}
struct statclass
{
statclass()
{
- write (1, "statclass\n", 10);
+ write_message ("statclass\n");
}
~statclass()
{
- write (1, "~statclass\n", 11);
+ write_message ("~statclass\n");
}
};
diff --git a/elf/Makefile b/elf/Makefile
index 593403c640..82c7e0559d 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -23,7 +23,7 @@ include ../Makeconfig
headers = elf.h bits/elfclass.h link.h bits/link.h
routines = $(all-dl-routines) dl-support dl-iteratephdr \
- dl-addr enbl-secure dl-profstub \
+ dl-addr dl-addr-obj enbl-secure dl-profstub \
dl-origin dl-libc dl-sym dl-tsd dl-sysdep
# The core dynamic linking functions are in libc for the static and
@@ -122,7 +122,8 @@ tests = tst-tls1 tst-tls2 tst-tls9 tst-leaks1 \
tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static \
tst-leaks1-static tst-array1-static tst-array5-static \
tst-ptrguard1-static tst-dl-iter-static \
- tst-tlsalign-static tst-tlsalign-extern-static
+ tst-tlsalign-static tst-tlsalign-extern-static \
+ tst-linkall-static
ifeq (yes,$(build-shared))
tests-static += tst-tls9-static
tst-tls9-static-ENV = \
@@ -149,7 +150,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
tst-nodelete) \
tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
- tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error
+ tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload
# reldep9
ifeq ($(build-hardcoded-path-in-tests),yes)
tests += tst-dlopen-aout
@@ -319,6 +320,16 @@ tests-special += $(objpfx)tst-prelink-cmp.out
endif
endif
+# The test requires shared _and_ PIE because the executable
+# unit test driver must be able to link with the shared object
+# that is going to eventually go into an installed DSO.
+ifeq (yesyes,$(have-fpie)$(build-shared))
+tests += tst-_dl_addr_inside_object
+tests-pie += tst-_dl_addr_inside_object
+$(objpfx)tst-_dl_addr_inside_object: $(objpfx)dl-addr-obj.os
+CFLAGS-tst-_dl_addr_inside_object.c += $(PIE-ccflag)
+endif
+
include ../Rules
ifeq (yes,$(build-shared))
@@ -554,6 +565,7 @@ $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so
$(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so
$(objpfx)tst-nodelete-opened.out: $(objpfx)tst-nodelete-opened-lib.so
$(objpfx)tst-nodelete-opened: $(libdl)
+$(objpfx)tst-noload: $(libdl)
$(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o
$(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o
@@ -1267,3 +1279,13 @@ $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig
$(evaluate-test)
$(objpfx)tst-dlsym-error: $(libdl)
+
+$(objpfx)tst-linkall-static: \
+ $(common-objpfx)math/libm.a \
+ $(common-objpfx)crypt/libcrypt.a \
+ $(common-objpfx)resolv/libresolv.a \
+ $(common-objpfx)dlfcn/libdl.a \
+ $(common-objpfx)login/libutil.a \
+ $(common-objpfx)rt/librt.a \
+ $(common-objpfx)resolv/libanl.a \
+ $(static-thread-library) \
diff --git a/elf/dl-addr-obj.c b/elf/dl-addr-obj.c
new file mode 100644
index 0000000000..f6407610d1
--- /dev/null
+++ b/elf/dl-addr-obj.c
@@ -0,0 +1,75 @@
+/* Determine if address is inside object load segments.
+ Copyright (C) 1996-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <link.h>
+#include <elf.h>
+
+/* Return non-zero if ADDR lies within one of L's loadable segments.
+ We have three cases we care about.
+
+ Case 1: addr is above a segment.
+ +==================+<- l_map_end
+ | |<- addr
+ |------------------|<- l_addr + p_vaddr + p_memsz
+ | |
+ | |
+ |------------------|<- l_addr + p_vaddr
+ |------------------|<- l_addr
+ | |
+ +==================+<- l_map_start
+
+ Case 2: addr is within a segments.
+ +==================+<- l_map_end
+ | |
+ |------------------|<- l_addr + p_vaddr + p_memsz
+ | |<- addr
+ | |
+ |------------------|<- l_addr + p_vaddr
+ |------------------|<- l_addr
+ | |
+ +==================+<- l_map_start
+
+ Case 3: addr is below a segments.
+ +==================+<- l_map_end
+ | |
+ |------------------|<- l_addr + p_vaddr + p_memsz
+ | |
+ | |
+ |------------------|<- l_addr + p_vaddr
+ |------------------|<- l_addr
+ | |<- addr
+ +==================+<- l_map_start
+
+ All the arithmetic is unsigned and we shift all the values down by
+ l_addr + p_vaddr and then compare the normalized addr to the range
+ of interest i.e. 0 <= addr < p_memsz.
+
+*/
+int
+internal_function
+_dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr)
+{
+ int n = l->l_phnum;
+ const ElfW(Addr) reladdr = addr - l->l_addr;
+
+ while (--n >= 0)
+ if (l->l_phdr[n].p_type == PT_LOAD
+ && reladdr - l->l_phdr[n].p_vaddr < l->l_phdr[n].p_memsz)
+ return 1;
+ return 0;
+}
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 1b16a58ced..045e746680 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -144,19 +144,3 @@ _dl_addr (const void *address, Dl_info *info,
return result;
}
libc_hidden_def (_dl_addr)
-
-/* Return non-zero if ADDR lies within one of L's segments. */
-int
-internal_function
-_dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr)
-{
- int n = l->l_phnum;
- const ElfW(Addr) reladdr = addr - l->l_addr;
-
- while (--n >= 0)
- if (l->l_phdr[n].p_type == PT_LOAD
- && reladdr - l->l_phdr[n].p_vaddr >= 0
- && reladdr - l->l_phdr[n].p_vaddr < l->l_phdr[n].p_memsz)
- return 1;
- return 0;
-}
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 6f178b333d..f5ca26180e 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -226,12 +226,6 @@ dl_open_worker (void *a)
args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,
mode | __RTLD_CALLMAP, args->nsid);
- /* Mark the object as not deletable if the RTLD_NODELETE flags was passed.
- Do this early so that we don't skip marking the object if it was
- already loaded. */
- if (__glibc_unlikely (mode & RTLD_NODELETE))
- new->l_flags_1 |= DF_1_NODELETE;
-
/* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
set and the object is not already loaded. */
if (new == NULL)
@@ -240,6 +234,12 @@ dl_open_worker (void *a)
return;
}
+ /* Mark the object as not deletable if the RTLD_NODELETE flags was passed.
+ Do this early so that we don't skip marking the object if it was
+ already loaded. */
+ if (__glibc_unlikely (mode & RTLD_NODELETE))
+ new->l_flags_1 |= DF_1_NODELETE;
+
if (__glibc_unlikely (mode & __RTLD_SPROF))
/* This happens only if we load a DSO for 'sprof'. */
return;
@@ -735,21 +735,3 @@ _dl_show_scope (struct link_map *l, int from)
_dl_debug_printf (" no scope\n");
_dl_debug_printf ("\n");
}
-
-#if IS_IN (rtld)
-/* Return non-zero if ADDR lies within one of L's segments. */
-int
-internal_function
-_dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr)
-{
- int n = l->l_phnum;
- const ElfW(Addr) reladdr = addr - l->l_addr;
-
- while (--n >= 0)
- if (l->l_phdr[n].p_type == PT_LOAD
- && reladdr - l->l_phdr[n].p_vaddr >= 0
- && reladdr - l->l_phdr[n].p_vaddr < l->l_phdr[n].p_memsz)
- return 1;
- return 0;
-}
-#endif
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 42bddc1e2c..dcab666d56 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -137,6 +137,12 @@ _dl_nothread_init_static_tls (struct link_map *map)
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
#endif
+ /* Fill in the DTV slot so that a later LD/GD access will find it. */
+ dtv_t *dtv = THREAD_DTV ();
+ assert (map->l_tls_modid <= dtv[-1].counter);
+ dtv[map->l_tls_modid].pointer.to_free = NULL;
+ dtv[map->l_tls_modid].pointer.val = dest;
+
/* Initialize the memory. */
memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
'\0', map->l_tls_blocksize - map->l_tls_initimage_size);
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 17567ad1b3..60f4c1da5c 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -538,6 +538,10 @@ _dl_allocate_tls_init (void *result)
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
#endif
+ /* Set up the DTV entry. The simplified __tls_get_addr that
+ some platforms use in static programs requires it. */
+ dtv[map->l_tls_modid].pointer.val = dest;
+
/* Copy the initialization image and clear the BSS part. */
memset (__mempcpy (dest, map->l_tls_initimage,
map->l_tls_initimage_size), '\0',
diff --git a/elf/sln.c b/elf/sln.c
index f52cb9f44a..fa4cceca80 100644
--- a/elf/sln.c
+++ b/elf/sln.c
@@ -16,10 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
#include <error.h>
#include <errno.h>
#include <libintl.h>
@@ -37,10 +33,6 @@
#define PACKAGE _libc_intl_domainname
-#if !defined S_ISDIR && defined S_IFDIR
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-
static int makesymlink (const char *src, const char *dest);
static int makesymlinks (const char *file);
static void usage (void);
@@ -89,9 +81,6 @@ usage (void)
static int
makesymlinks (const char *file)
{
-#ifndef PATH_MAX
-#define PATH_MAX 4095
-#endif
char *buffer = NULL;
size_t bufferlen = 0;
int ret;
@@ -190,11 +179,7 @@ makesymlink (const char *src, const char *dest)
return -1;
}
-#ifdef S_ISLNK
if (symlink (src, dest) == 0)
-#else
- if (link (src, dest) == 0)
-#endif
{
/* Destination must exist by now. */
if (access (dest, F_OK))
diff --git a/elf/tst-_dl_addr_inside_object.c b/elf/tst-_dl_addr_inside_object.c
new file mode 100644
index 0000000000..d1e45815c8
--- /dev/null
+++ b/elf/tst-_dl_addr_inside_object.c
@@ -0,0 +1,223 @@
+/* Unit test for _dl_addr_inside_object.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <link.h>
+#include <elf.h>
+#include <libc-symbols.h>
+
+extern int internal_function _dl_addr_inside_object (struct link_map *l,
+ const ElfW(Addr) addr);
+
+static int
+do_test (void)
+{
+ int ret, err = 0;
+ ElfW(Addr) addr;
+ struct link_map map;
+ ElfW(Phdr) header;
+ map.l_phdr = &header;
+ map.l_phnum = 1;
+ map.l_addr = 0x0;
+ /* Segment spans 0x2000 -> 0x4000. */
+ header.p_vaddr = 0x2000;
+ header.p_memsz = 0x2000;
+ header.p_type = PT_LOAD;
+ /* Address is above the segment e.g. > 0x4000. */
+ addr = 0x5000;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("PASS: Above: Address is detected as outside the segment.\n");
+ break;
+ case 1:
+ printf ("FAIL: Above: Address is detected as inside the segment.\n");
+ err++;
+ break;
+ default:
+ printf ("FAIL: Above: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is inside the segment e.g. 0x2000 < addr < 0x4000. */
+ addr = 0x3000;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("FAIL: Inside: Address is detected as outside the segment.\n");
+ err++;
+ break;
+ case 1:
+ printf ("PASS: Inside: Address is detected as inside the segment.\n");
+ break;
+ default:
+ printf ("FAIL: Inside: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is below the segment e.g. < 0x2000. */
+ addr = 0x1000;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("PASS: Below: Address is detected as outside the segment.\n");
+ break;
+ case 1:
+ printf ("FAIL: Below: Address is detected as inside the segment.\n");
+ err++;
+ break;
+ default:
+ printf ("FAIL: Below: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is in the segment and addr == p_vaddr. */
+ addr = 0x2000;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("FAIL: At p_vaddr: Address is detected as outside the segment.\n");
+ err++;
+ break;
+ case 1:
+ printf ("PASS: At p_vaddr: Address is detected as inside the segment.\n");
+ break;
+ default:
+ printf ("FAIL: At p_vaddr: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is in the segment and addr == p_vaddr + p_memsz - 1. */
+ addr = 0x2000 + 0x2000 - 0x1;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("FAIL: At p_memsz-1: Address is detected as outside the segment.\n");
+ err++;
+ break;
+ case 1:
+ printf ("PASS: At p_memsz-1: Address is detected as inside the segment.\n");
+ break;
+ default:
+ printf ("FAIL: At p_memsz-1: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is outside the segment and addr == p_vaddr + p_memsz. */
+ addr = 0x2000 + 0x2000;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("PASS: At p_memsz: Address is detected as outside the segment.\n");
+ break;
+ case 1:
+ printf ("FAIL: At p_memsz: Address is detected as inside the segment.\n");
+ err++;
+ break;
+ default:
+ printf ("FAIL: At p_memsz: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is outside the segment and p_vaddr at maximum address. */
+ addr = 0x0 - 0x2;
+ header.p_vaddr = 0x0 - 0x1;
+ header.p_memsz = 0x1;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("PASS: At max: Address is detected as outside the segment.\n");
+ break;
+ case 1:
+ printf ("FAIL: At max: Address is detected as inside the segment.\n");
+ err++;
+ break;
+ default:
+ printf ("FAIL: At max: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is outside the segment and p_vaddr at minimum address. */
+ addr = 0x1;
+ header.p_vaddr = 0x0;
+ header.p_memsz = 0x1;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("PASS: At min: Address is detected as outside the segment.\n");
+ break;
+ case 1:
+ printf ("FAIL: At min: Address is detected as inside the segment.\n");
+ err++;
+ break;
+ default:
+ printf ("FAIL: At min: Invalid return value.\n");
+ exit (1);
+ }
+ /* Address is always inside the segment with p_memsz at max. */
+ addr = 0x0;
+ header.p_vaddr = 0x0;
+ header.p_memsz = 0x0 - 0x1;
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("FAIL: At maxmem: Address is detected as outside the segment.\n");
+ err++;
+ break;
+ case 1:
+ printf ("PASS: At maxmem: Address is detected as inside the segment.\n");
+ break;
+ default:
+ printf ("FAIL: At maxmem: Invalid return value.\n");
+ exit (1);
+ }
+ /* Attempt to wrap addr into the segment.
+ Pick a load address in the middle of the address space.
+ Place the test address at 0x0 so it wraps to the middle again. */
+ map.l_addr = 0x0 - 0x1;
+ map.l_addr = map.l_addr / 2;
+ addr = 0;
+ /* Setup a segment covering 1/2 the address space. */
+ header.p_vaddr = 0x0;
+ header.p_memsz = 0x0 - 0x1 - map.l_addr;
+ /* No matter where you place addr everything is shifted modulo l_addr
+ and even with this underflow you're always 1 byte away from being
+ in the range. */
+ ret = _dl_addr_inside_object (&map, addr);
+ switch (ret)
+ {
+ case 0:
+ printf ("PASS: Underflow: Address is detected as outside the segment.\n");
+ break;
+ case 1:
+ printf ("FAIL: Underflow: Address is detected as inside the segment.\n");
+ err++;
+ break;
+ default:
+ printf ("FAIL: Underflow: Invalid return value.\n");
+ exit (1);
+ }
+
+ return err;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/elf/tst-linkall-static.c b/elf/tst-linkall-static.c
new file mode 100644
index 0000000000..7a4aaccf58
--- /dev/null
+++ b/elf/tst-linkall-static.c
@@ -0,0 +1,45 @@
+/* Test static linking against multiple libraries, to find symbol conflicts.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <pthread.h>
+#include <crypt.h>
+#include <resolv.h>
+#include <dlfcn.h>
+#include <utmp.h>
+#include <aio.h>
+#include <netdb.h>
+
+/* These references force linking the executable against central
+ functions in the static libraries, pulling significant parts of
+ each library into the link. */
+void *references[] =
+ {
+ &pow, /* libm */
+ &pthread_create, /* libpthread */
+ &crypt, /* libcrypt */
+ &res_send, /* libresolv */
+ &dlopen, /* libdl */
+ &login, /* libutil */
+ &aio_init, /* librt */
+ &getaddrinfo_a, /* libanl */
+ };
+
+/* This is a link-time test. There is nothing to run here. */
+#define TEST_FUNCTION 0
+#include "../test-skeleton.c"
diff --git a/elf/tst-noload.c b/elf/tst-noload.c
new file mode 100644
index 0000000000..941450c10b
--- /dev/null
+++ b/elf/tst-noload.c
@@ -0,0 +1,73 @@
+/* Verify that RTLD_NOLOAD works as expected.
+
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <dlfcn.h>
+#include <stdio.h>
+#include <gnu/lib-names.h>
+
+static int
+do_test (void)
+{
+ /* Test that no object is loaded with RTLD_NOLOAD. */
+ void *h1 = dlopen (LIBM_SO, RTLD_LAZY | RTLD_NOLOAD);
+ if (h1 != NULL)
+ {
+ printf ("h1: DSO has been loaded while it should have not\n");
+ return 1;
+ }
+
+ /* This used to segfault in some glibc versions. */
+ void *h2 = dlopen (LIBM_SO, RTLD_LAZY | RTLD_NOLOAD | RTLD_NODELETE);
+ if (h2 != NULL)
+ {
+ printf ("h2: DSO has been loaded while it should have not\n");
+ return 1;
+ }
+
+ /* Test that loading an already loaded object returns the same. */
+ void *h3 = dlopen (LIBM_SO, RTLD_LAZY);
+ if (h3 == NULL)
+ {
+ printf ("h3: failed to open DSO: %s\n", dlerror ());
+ return 1;
+ }
+ void *h4 = dlopen (LIBM_SO, RTLD_LAZY | RTLD_NOLOAD);
+ if (h4 == NULL)
+ {
+ printf ("h4: failed to open DSO: %s\n", dlerror ());
+ return 1;
+ }
+ if (h4 != h3)
+ {
+ printf ("h4: should return the same object\n");
+ return 1;
+ }
+
+ /* Cleanup */
+ if (dlclose (h3) != 0)
+ {
+ printf ("h3: dlclose failed: %s\n", dlerror ());
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/gmon/sys/gmon.h b/gmon/sys/gmon.h
index 5b430abc3e..b4cc3b043a 100644
--- a/gmon/sys/gmon.h
+++ b/gmon/sys/gmon.h
@@ -117,7 +117,7 @@ extern struct __bb *__bb_head;
/*
* The type used to represent indices into gmonparam.tos[].
*/
-#define ARCINDEX u_long
+#define ARCINDEX unsigned long
/*
* Maximum number of arcs we want to allow.
@@ -130,7 +130,7 @@ extern struct __bb *__bb_head;
#define MAXARCS (1 << 20)
struct tostruct {
- u_long selfpc;
+ unsigned long selfpc;
long count;
ARCINDEX link;
};
@@ -140,9 +140,9 @@ struct tostruct {
* the called site and a count.
*/
struct rawarc {
- u_long raw_frompc;
- u_long raw_selfpc;
- long raw_count;
+ unsigned long raw_frompc;
+ unsigned long raw_selfpc;
+ long raw_count;
};
/*
@@ -156,17 +156,17 @@ struct rawarc {
*/
struct gmonparam {
long int state;
- u_short *kcount;
- u_long kcountsize;
+ unsigned short *kcount;
+ unsigned long kcountsize;
ARCINDEX *froms;
- u_long fromssize;
+ unsigned long fromssize;
struct tostruct *tos;
- u_long tossize;
+ unsigned long tossize;
long tolimit;
- u_long lowpc;
- u_long highpc;
- u_long textsize;
- u_long hashfraction;
+ unsigned long lowpc;
+ unsigned long highpc;
+ unsigned long textsize;
+ unsigned long hashfraction;
long log_hashfraction;
};
@@ -190,8 +190,8 @@ struct gmonparam {
__BEGIN_DECLS
/* Set up data structures and start profiling. */
-extern void __monstartup (u_long __lowpc, u_long __highpc) __THROW;
-extern void monstartup (u_long __lowpc, u_long __highpc) __THROW;
+extern void __monstartup (unsigned long __lowpc, unsigned long __highpc) __THROW;
+extern void monstartup (unsigned long __lowpc, unsigned long __highpc) __THROW;
/* Clean up profiling and write out gmon.out. */
extern void _mcleanup (void) __THROW;
diff --git a/hurd/exc2signal.c b/hurd/exc2signal.c
index 3a2ec08124..2527d83bf1 100644
--- a/hurd/exc2signal.c
+++ b/hurd/exc2signal.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <hurd.h>
+#include <hurd/signal.h>
/* This file must be modified with machine-dependent details. */
#error "need to write sysdeps/mach/hurd/MACHINE/exc2signal.c"
@@ -25,46 +26,45 @@
into a signal number and signal subcode. */
void
-_hurd_exception2signal (int exception, int code, int subcode,
- int *signo, int *sigcode, int *error)
+_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
{
- *error = 0;
+ detail->error = 0;
- switch (exception)
+ switch (detail->exc)
{
default:
*signo = SIGIOT;
- *sigcode = exception;
+ detail->code = detail->exc;
break;
case EXC_BAD_ACCESS:
- if (code == KERN_PROTECTION_FAILURE)
+ if (detail->exc_code == KERN_PROTECTION_FAILURE)
*signo = SIGSEGV;
else
*signo = SIGBUS;
- *sigcode = subcode;
- *error = code;
+ detail->code = detail->exc_subcode;
+ detail->error = detail->exc_code;
break;
case EXC_BAD_INSTRUCTION:
*signo = SIGILL;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_ARITHMETIC:
*signo = SIGFPE;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_EMULATION:
case EXC_SOFTWARE:
*signo = SIGEMT;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_BREAKPOINT:
*signo = SIGTRAP;
- *sigcode = 0;
+ detail->code = 0;
break;
}
}
diff --git a/hurd/hurdmalloc.c b/hurd/hurdmalloc.c
index 58c29fa07d..65fb959d84 100644
--- a/hurd/hurdmalloc.c
+++ b/hurd/hurdmalloc.c
@@ -405,8 +405,8 @@ print_malloc_free_list (void)
}
#endif /* DEBUG */
-static void
-malloc_fork_prepare(void)
+void
+_hurd_malloc_fork_prepare(void)
/*
* Prepare the malloc module for a fork by insuring that no thread is in a
* malloc critical section.
@@ -419,8 +419,8 @@ malloc_fork_prepare(void)
}
}
-static void
-malloc_fork_parent(void)
+void
+_hurd_malloc_fork_parent(void)
/*
* Called in the parent process after a fork() to resume normal operation.
*/
@@ -432,8 +432,8 @@ malloc_fork_parent(void)
}
}
-static void
-malloc_fork_child(void)
+void
+_hurd_malloc_fork_child(void)
/*
* Called in the child process after a fork() to resume normal operation.
*/
@@ -446,7 +446,4 @@ malloc_fork_child(void)
}
-text_set_element (_hurd_fork_prepare_hook, malloc_fork_prepare);
-text_set_element (_hurd_fork_parent_hook, malloc_fork_parent);
-text_set_element (_hurd_fork_child_hook, malloc_fork_child);
text_set_element (_hurd_preinit_hook, malloc_init);
diff --git a/hurd/hurdmalloc.h b/hurd/hurdmalloc.h
index e11c208a8f..3520ffacd8 100644
--- a/hurd/hurdmalloc.h
+++ b/hurd/hurdmalloc.h
@@ -12,6 +12,10 @@ extern void *_hurd_malloc (size_t);
extern void *_hurd_realloc (void *, size_t);
extern void _hurd_free (void *);
+extern void _hurd_malloc_fork_prepare (void);
+extern void _hurd_malloc_fork_parent (void);
+extern void _hurd_malloc_fork_child (void);
+
#define malloc _hurd_malloc
#define realloc _hurd_realloc
#define free _hurd_free
diff --git a/iconv/gconv.h b/iconv/gconv.h
index 8d8ce5813b..a87028047b 100644
--- a/iconv/gconv.h
+++ b/iconv/gconv.h
@@ -139,7 +139,7 @@ typedef struct __gconv_info
{
size_t __nsteps;
struct __gconv_step *__steps;
- __extension__ struct __gconv_step_data __data __flexarr;
+ __extension__ struct __gconv_step_data __data[0];
} *__gconv_t;
/* Transliteration using the locale's data. */
diff --git a/iconvdata/ibm930.c b/iconvdata/ibm930.c
index 9d35734b3a..f632997eb2 100644
--- a/iconvdata/ibm930.c
+++ b/iconvdata/ibm930.c
@@ -191,7 +191,6 @@ enum
uint32_t ch = get32 (inptr); \
const struct gap *rp1 = __ucs4_to_ibm930sb_idx; \
const struct gap *rp2 = __ucs4_to_ibm930db_idx; \
- const char *cp; \
\
if (__glibc_unlikely (ch >= 0xffff)) \
{ \
@@ -204,14 +203,16 @@ enum
++rp1; \
\
/* Use the UCS4 table for single byte. */ \
+ unsigned char sbconv; \
if (__builtin_expect (ch < rp1->start, 0) \
- || (cp = __ucs4_to_ibm930sb[ch + rp1->idx], \
- __builtin_expect (cp[0], L'\1') == L'\0' && ch != '\0')) \
+ || (sbconv = __ucs4_to_ibm930sb[ch + rp1->idx], \
+ __builtin_expect (sbconv, L'\1') == L'\0' && ch != '\0')) \
{ \
/* Use the UCS4 table for double byte. */ \
while (ch > rp2->end) \
++rp2; \
\
+ const char *cp; \
if (__builtin_expect (ch < rp2->start, 0) \
|| (cp = __ucs4_to_ibm930db[ch + rp2->idx], \
__builtin_expect (cp[0], L'\1')== L'\0' && ch != '\0')) \
@@ -264,7 +265,7 @@ enum
else if (ch == 0x5c) \
*outptr++ = 0x5b; \
else \
- *outptr++ = cp[0]; \
+ *outptr++ = sbconv; \
} \
\
/* Now that we wrote the output increment the input pointer. */ \
diff --git a/iconvdata/ibm930.h b/iconvdata/ibm930.h
index 1afda568e9..749623e86d 100644
--- a/iconvdata/ibm930.h
+++ b/iconvdata/ibm930.h
@@ -1499,46 +1499,46 @@ static const struct gap __ucs4_to_ibm930sb_idx[] =
{ .start = 0xffff, .end = 0xffff, .idx = 0 }
};
-static const char * __ucs4_to_ibm930sb[] =
+static const unsigned char __ucs4_to_ibm930sb[] =
{
- "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16",
- "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11",
- "\x12", "\x13", "\x3c", "\x3d", "\x32", "\x26", "\x18", "\x19", "\x3f",
- "\x27", "\x1c", "\x1d", "\x1e", "\x1f", "\x40", "\x5a", "\x7f", "\x7b",
- "\xe0", "\x6c", "\x50", "\x7d", "\x4d", "\x5d", "\x5c", "\x4e", "\x6b",
- "\x60", "\x4b", "\x61", "\xf0", "\xf1", "\xf2", "\xf3", "\xf4", "\xf5",
- "\xf6", "\xf7", "\xf8", "\xf9", "\x7a", "\x5e", "\x4c", "\x7e", "\x6e",
- "\x6f", "\x7c", "\xc1", "\xc2", "\xc3", "\xc4", "\xc5", "\xc6", "\xc7",
- "\xc8", "\xc9", "\xd1", "\xd2", "\xd3", "\xd4", "\xd5", "\xd6", "\xd7",
- "\xd8", "\xd9", "\xe2", "\xe3", "\xe4", "\xe5", "\xe6", "\xe7", "\xe8",
- "\xe9", "\x70", "\xb2", "\x80", "\xb0", "\x6d", "\x79", "\x62", "\x63",
- "\x64", "\x65", "\x66", "\x67", "\x68", "\x69", "\x71", "\x72", "\x73",
- "\x74", "\x75", "\x76", "\x77", "\x78", "\x8b", "\x9b", "\xab", "\xb3",
- "\xb4", "\xb5", "\xb6", "\xb7", "\xb8", "\xb9", "\xc0", "\x4f", "\xd0",
- "\xa0", "\x07", "\x20", "\x21", "\x22", "\x23", "\x24", "\x15", "\x06",
- "\x17", "\x28", "\x29", "\x2a", "\x2b", "\x2c", "\x09", "\x0a", "\x1b",
- "\x30", "\x31", "\x1a", "\x33", "\x34", "\x35", "\x36", "\x08", "\x38",
- "\x39", "\x3a", "\x3b", "\x04", "\x14", "\x3e", "\xff", "\x3f", "\x3f",
- "\xb1", "\x4a", "\x3f", "\x5b", "\x3f", "\x3f", "\x3f", "\x5f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\xa1", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x41", "\x42", "\x43", "\x44", "\x45",
- "\x46", "\x47", "\x48", "\x49", "\x51", "\x52", "\x53", "\x54", "\x55",
- "\x56", "\x58", "\x81", "\x82", "\x83", "\x84", "\x85", "\x86", "\x87",
- "\x88", "\x89", "\x8a", "\x8c", "\x8d", "\x8e", "\x8f", "\x90", "\x91",
- "\x92", "\x93", "\x94", "\x95", "\x96", "\x97", "\x98", "\x99", "\x9a",
- "\x9d", "\x9e", "\x9f", "\xa2", "\xa3", "\xa4", "\xa5", "\xa6", "\xa7",
- "\xa8", "\xa9", "\xaa", "\xac", "\xad", "\xae", "\xaf", "\xba", "\xbb",
- "\xbc", "\xbd", "\xbe", "\xbf", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f"
+ '\x00', '\x01', '\x02', '\x03', '\x37', '\x2d', '\x2e', '\x2f', '\x16',
+ '\x05', '\x25', '\x0b', '\x0c', '\x0d', '\x3f', '\x3f', '\x10', '\x11',
+ '\x12', '\x13', '\x3c', '\x3d', '\x32', '\x26', '\x18', '\x19', '\x3f',
+ '\x27', '\x1c', '\x1d', '\x1e', '\x1f', '\x40', '\x5a', '\x7f', '\x7b',
+ '\xe0', '\x6c', '\x50', '\x7d', '\x4d', '\x5d', '\x5c', '\x4e', '\x6b',
+ '\x60', '\x4b', '\x61', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5',
+ '\xf6', '\xf7', '\xf8', '\xf9', '\x7a', '\x5e', '\x4c', '\x7e', '\x6e',
+ '\x6f', '\x7c', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
+ '\xc8', '\xc9', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7',
+ '\xd8', '\xd9', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8',
+ '\xe9', '\x70', '\xb2', '\x80', '\xb0', '\x6d', '\x79', '\x62', '\x63',
+ '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x71', '\x72', '\x73',
+ '\x74', '\x75', '\x76', '\x77', '\x78', '\x8b', '\x9b', '\xab', '\xb3',
+ '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xc0', '\x4f', '\xd0',
+ '\xa0', '\x07', '\x20', '\x21', '\x22', '\x23', '\x24', '\x15', '\x06',
+ '\x17', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x09', '\x0a', '\x1b',
+ '\x30', '\x31', '\x1a', '\x33', '\x34', '\x35', '\x36', '\x08', '\x38',
+ '\x39', '\x3a', '\x3b', '\x04', '\x14', '\x3e', '\xff', '\x3f', '\x3f',
+ '\xb1', '\x4a', '\x3f', '\x5b', '\x3f', '\x3f', '\x3f', '\x5f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\xa1', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x41', '\x42', '\x43', '\x44', '\x45',
+ '\x46', '\x47', '\x48', '\x49', '\x51', '\x52', '\x53', '\x54', '\x55',
+ '\x56', '\x58', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87',
+ '\x88', '\x89', '\x8a', '\x8c', '\x8d', '\x8e', '\x8f', '\x90', '\x91',
+ '\x92', '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\x9a',
+ '\x9d', '\x9e', '\x9f', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7',
+ '\xa8', '\xa9', '\xaa', '\xac', '\xad', '\xae', '\xaf', '\xba', '\xbb',
+ '\xbc', '\xbd', '\xbe', '\xbf', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f'
};
static const struct gap __ucs4_to_ibm930db_idx[] =
diff --git a/iconvdata/ibm933.c b/iconvdata/ibm933.c
index 669e357066..8abc05ab2b 100644
--- a/iconvdata/ibm933.c
+++ b/iconvdata/ibm933.c
@@ -189,7 +189,6 @@ enum
uint32_t ch = get32 (inptr); \
const struct gap *rp1 = __ucs4_to_ibm933sb_idx; \
const struct gap *rp2 = __ucs4_to_ibm933db_idx; \
- const char *cp; \
\
if (__glibc_unlikely (ch >= 0xffff)) \
{ \
@@ -202,14 +201,16 @@ enum
++rp1; \
\
/* Use the UCS4 table for single byte. */ \
+ unsigned char sbconv; \
if (__builtin_expect (ch < rp1->start, 0) \
- || (cp = __ucs4_to_ibm933sb[ch + rp1->idx], \
- __builtin_expect (cp[0], L'\1') == L'\0' && ch != '\0')) \
+ || (sbconv = __ucs4_to_ibm933sb[ch + rp1->idx], \
+ __builtin_expect (sbconv, L'\1') == L'\0' && ch != '\0')) \
{ \
/* Use the UCS4 table for double byte. */ \
while (ch > rp2->end) \
++rp2; \
\
+ const char *cp; \
if (__builtin_expect (ch < rp2->start, 0) \
|| (cp = __ucs4_to_ibm933db[ch + rp2->idx], \
__builtin_expect (cp[0], L'\1')==L'\0' && ch != '\0')) \
@@ -257,7 +258,7 @@ enum
result = __GCONV_FULL_OUTPUT; \
break; \
} \
- *outptr++ = cp[0]; \
+ *outptr++ = sbconv; \
} \
\
/* Now that we wrote the output increment the input pointer. */ \
diff --git a/iconvdata/ibm933.h b/iconvdata/ibm933.h
index cb0013758e..1b69dd7847 100644
--- a/iconvdata/ibm933.h
+++ b/iconvdata/ibm933.h
@@ -3371,39 +3371,39 @@ static const struct gap __ucs4_to_ibm933sb_idx[] =
{ .start = 0xffff, .end = 0xffff, .idx = 0 }
};
-static const char *__ucs4_to_ibm933sb[] =
+static const unsigned char __ucs4_to_ibm933sb[] =
{
- "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16",
- "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11",
- "\x12", "\x13", "\x3c", "\x3d", "\x32", "\x26", "\x18", "\x19", "\x3f",
- "\x27", "\x1c", "\x1d", "\x1e", "\x1f", "\x40", "\x5a", "\x7f", "\x7b",
- "\x5b", "\x6c", "\x50", "\x7d", "\x4d", "\x5d", "\x5c", "\x4e", "\x6b",
- "\x60", "\x4b", "\x61", "\xf0", "\xf1", "\xf2", "\xf3", "\xf4", "\xf5",
- "\xf6", "\xf7", "\xf8", "\xf9", "\x7a", "\x5e", "\x4c", "\x7e", "\x6e",
- "\x6f", "\x7c", "\xc1", "\xc2", "\xc3", "\xc4", "\xc5", "\xc6", "\xc7",
- "\xc8", "\xc9", "\xd1", "\xd2", "\xd3", "\xd4", "\xd5", "\xd6", "\xd7",
- "\xd8", "\xd9", "\xe2", "\xe3", "\xe4", "\xe5", "\xe6", "\xe7", "\xe8",
- "\xe9", "\x70", "\xb2", "\x80", "\xb0", "\x6d", "\x79", "\x81", "\x82",
- "\x83", "\x84", "\x85", "\x86", "\x87", "\x88", "\x89", "\x91", "\x92",
- "\x93", "\x94", "\x95", "\x96", "\x97", "\x98", "\x99", "\xa2", "\xa3",
- "\xa4", "\xa5", "\xa6", "\xa7", "\xa8", "\xa9", "\xc0", "\x4f", "\xd0",
- "\xa1", "\x07", "\x20", "\x21", "\x22", "\x23", "\x24", "\x15", "\x06",
- "\x17", "\x28", "\x29", "\x2a", "\x2b", "\x2c", "\x09", "\x0a", "\x1b",
- "\x30", "\x31", "\x1a", "\x33", "\x34", "\x35", "\x36", "\x08", "\x38",
- "\x39", "\x3a", "\x3b", "\x04", "\x14", "\x3e", "\xff", "\x3f", "\x4a",
- "\x3f", "\x3f", "\x6a", "\x3f", "\x3f", "\x5f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\xa0", "\xe0", "\x42", "\x43", "\x44", "\x45", "\x46", "\x47", "\x48",
- "\x49", "\x52", "\x53", "\x54", "\x55", "\x56", "\x57", "\x58", "\x59",
- "\x62", "\x63", "\x64", "\x65", "\x66", "\x67", "\x68", "\x69", "\x72",
- "\x73", "\x74", "\x75", "\x76", "\x77", "\x78", "\x8a", "\x8b", "\x8c",
- "\x8d", "\x8e", "\x8f", "\x9a", "\x9b", "\x9c", "\x9d", "\x9e", "\x9f",
- "\xaa", "\xab", "\xac", "\xad", "\xae", "\xaf", "\xba", "\xbb", "\xbc"
+ '\x00', '\x01', '\x02', '\x03', '\x37', '\x2d', '\x2e', '\x2f', '\x16',
+ '\x05', '\x25', '\x0b', '\x0c', '\x0d', '\x3f', '\x3f', '\x10', '\x11',
+ '\x12', '\x13', '\x3c', '\x3d', '\x32', '\x26', '\x18', '\x19', '\x3f',
+ '\x27', '\x1c', '\x1d', '\x1e', '\x1f', '\x40', '\x5a', '\x7f', '\x7b',
+ '\x5b', '\x6c', '\x50', '\x7d', '\x4d', '\x5d', '\x5c', '\x4e', '\x6b',
+ '\x60', '\x4b', '\x61', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5',
+ '\xf6', '\xf7', '\xf8', '\xf9', '\x7a', '\x5e', '\x4c', '\x7e', '\x6e',
+ '\x6f', '\x7c', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
+ '\xc8', '\xc9', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7',
+ '\xd8', '\xd9', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8',
+ '\xe9', '\x70', '\xb2', '\x80', '\xb0', '\x6d', '\x79', '\x81', '\x82',
+ '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x91', '\x92',
+ '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\xa2', '\xa3',
+ '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xc0', '\x4f', '\xd0',
+ '\xa1', '\x07', '\x20', '\x21', '\x22', '\x23', '\x24', '\x15', '\x06',
+ '\x17', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x09', '\x0a', '\x1b',
+ '\x30', '\x31', '\x1a', '\x33', '\x34', '\x35', '\x36', '\x08', '\x38',
+ '\x39', '\x3a', '\x3b', '\x04', '\x14', '\x3e', '\xff', '\x3f', '\x4a',
+ '\x3f', '\x3f', '\x6a', '\x3f', '\x3f', '\x5f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\xa0', '\xe0', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48',
+ '\x49', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59',
+ '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x72',
+ '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x8a', '\x8b', '\x8c',
+ '\x8d', '\x8e', '\x8f', '\x9a', '\x9b', '\x9c', '\x9d', '\x9e', '\x9f',
+ '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xba', '\xbb', '\xbc'
};
static const struct gap __ucs4_to_ibm933db_idx[] =
diff --git a/iconvdata/ibm935.c b/iconvdata/ibm935.c
index 2d3065e54c..d6574e89e2 100644
--- a/iconvdata/ibm935.c
+++ b/iconvdata/ibm935.c
@@ -190,7 +190,6 @@ enum
uint32_t ch = get32 (inptr); \
const struct gap *rp1 = __ucs4_to_ibm935sb_idx; \
const struct gap *rp2 = __ucs4_to_ibm935db_idx; \
- const char *cp; \
\
if (__glibc_unlikely (ch >= 0xffff)) \
{ \
@@ -203,14 +202,16 @@ enum
++rp1; \
\
/* Use the UCS4 table for single byte. */ \
+ unsigned char sbconv; \
if (__builtin_expect (ch < rp1->start, 0) \
- || (cp = __ucs4_to_ibm935sb[ch + rp1->idx], \
- __builtin_expect (cp[0], L'\1') == L'\0' && ch != '\0')) \
+ || (sbconv = __ucs4_to_ibm935sb[ch + rp1->idx], \
+ __builtin_expect (sbconv, L'\1') == L'\0' && ch != '\0')) \
{ \
/* Use the UCS4 table for double byte. */ \
while (ch > rp2->end) \
++rp2; \
\
+ const char *cp; \
if (__builtin_expect (ch < rp2->start, 0) \
|| (cp = __ucs4_to_ibm935db[ch + rp2->idx], \
__builtin_expect (cp[0], L'\1')==L'\0' && ch != '\0')) \
@@ -258,7 +259,7 @@ enum
result = __GCONV_FULL_OUTPUT; \
break; \
} \
- *outptr++ = cp[0]; \
+ *outptr++ = sbconv; \
} \
\
/* Now that we wrote the output increment the input pointer. */ \
diff --git a/iconvdata/ibm935.h b/iconvdata/ibm935.h
index f7a96e9a4b..30b44aba84 100644
--- a/iconvdata/ibm935.h
+++ b/iconvdata/ibm935.h
@@ -1282,35 +1282,35 @@ static const struct gap __ucs4_to_ibm935sb_idx[] =
{ .start = 0xffff, .end = 0xffff, .idx = 0 }
};
-static const char *__ucs4_to_ibm935sb[] =
+static const unsigned char __ucs4_to_ibm935sb[] =
{
- "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16",
- "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11",
- "\x12", "\x13", "\x3c", "\x3d", "\x32", "\x26", "\x18", "\x19", "\x3f",
- "\x27", "\x1c", "\x1d", "\x1e", "\x1f", "\x40", "\x5a", "\x7f", "\x7b",
- "\xe0", "\x6c", "\x50", "\x7d", "\x4d", "\x5d", "\x5c", "\x4e", "\x6b",
- "\x60", "\x4b", "\x61", "\xf0", "\xf1", "\xf2", "\xf3", "\xf4", "\xf5",
- "\xf6", "\xf7", "\xf8", "\xf9", "\x7a", "\x5e", "\x4c", "\x7e", "\x6e",
- "\x6f", "\x7c", "\xc1", "\xc2", "\xc3", "\xc4", "\xc5", "\xc6", "\xc7",
- "\xc8", "\xc9", "\xd1", "\xd2", "\xd3", "\xd4", "\xd5", "\xd6", "\xd7",
- "\xd8", "\xd9", "\xe2", "\xe3", "\xe4", "\xe5", "\xe6", "\xe7", "\xe8",
- "\xe9", "\xba", "\xb2", "\xbb", "\xb0", "\x6d", "\x79", "\x81", "\x82",
- "\x83", "\x84", "\x85", "\x86", "\x87", "\x88", "\x89", "\x91", "\x92",
- "\x93", "\x94", "\x95", "\x96", "\x97", "\x98", "\x99", "\xa2", "\xa3",
- "\xa4", "\xa5", "\xa6", "\xa7", "\xa8", "\xa9", "\xc0", "\x4f", "\xd0",
- "\xa0", "\x07", "\x20", "\x21", "\x22", "\x23", "\x24", "\x15", "\x06",
- "\x17", "\x28", "\x29", "\x2a", "\x2b", "\x2c", "\x09", "\x0a", "\x1b",
- "\x30", "\x31", "\x1a", "\x33", "\x34", "\x35", "\x36", "\x08", "\x38",
- "\x39", "\x3a", "\x3b", "\x04", "\x14", "\x3e", "\xff", "\x3f", "\x3f",
- "\x3f", "\x4a", "\x5b", "\x6a", "\x3f", "\x3f", "\x3f", "\x5f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\xa1"
+ '\x00', '\x01', '\x02', '\x03', '\x37', '\x2d', '\x2e', '\x2f', '\x16',
+ '\x05', '\x25', '\x0b', '\x0c', '\x0d', '\x3f', '\x3f', '\x10', '\x11',
+ '\x12', '\x13', '\x3c', '\x3d', '\x32', '\x26', '\x18', '\x19', '\x3f',
+ '\x27', '\x1c', '\x1d', '\x1e', '\x1f', '\x40', '\x5a', '\x7f', '\x7b',
+ '\xe0', '\x6c', '\x50', '\x7d', '\x4d', '\x5d', '\x5c', '\x4e', '\x6b',
+ '\x60', '\x4b', '\x61', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5',
+ '\xf6', '\xf7', '\xf8', '\xf9', '\x7a', '\x5e', '\x4c', '\x7e', '\x6e',
+ '\x6f', '\x7c', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
+ '\xc8', '\xc9', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7',
+ '\xd8', '\xd9', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8',
+ '\xe9', '\xba', '\xb2', '\xbb', '\xb0', '\x6d', '\x79', '\x81', '\x82',
+ '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x91', '\x92',
+ '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\xa2', '\xa3',
+ '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xc0', '\x4f', '\xd0',
+ '\xa0', '\x07', '\x20', '\x21', '\x22', '\x23', '\x24', '\x15', '\x06',
+ '\x17', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x09', '\x0a', '\x1b',
+ '\x30', '\x31', '\x1a', '\x33', '\x34', '\x35', '\x36', '\x08', '\x38',
+ '\x39', '\x3a', '\x3b', '\x04', '\x14', '\x3e', '\xff', '\x3f', '\x3f',
+ '\x3f', '\x4a', '\x5b', '\x6a', '\x3f', '\x3f', '\x3f', '\x5f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\xa1'
};
static const struct gap __ucs4_to_ibm935db_idx[] =
diff --git a/iconvdata/ibm939.c b/iconvdata/ibm939.c
index c0a75f7797..5122975452 100644
--- a/iconvdata/ibm939.c
+++ b/iconvdata/ibm939.c
@@ -190,7 +190,6 @@ enum
uint32_t ch = get32 (inptr); \
const struct gap *rp1 = __ucs4_to_ibm939sb_idx; \
const struct gap *rp2 = __ucs4_to_ibm939db_idx; \
- const char *cp; \
\
if (__glibc_unlikely (ch >= 0xffff)) \
{ \
@@ -202,14 +201,16 @@ enum
++rp1; \
\
/* Use the UCS4 table for single byte. */ \
+ unsigned char sbconv; \
if (__builtin_expect (ch < rp1->start, 0) \
- || (cp = __ucs4_to_ibm939sb[ch + rp1->idx], \
- __builtin_expect (cp[0], L'\1') == L'\0' && ch != '\0')) \
+ || (sbconv = __ucs4_to_ibm939sb[ch + rp1->idx], \
+ __builtin_expect (sbconv, L'\1') == L'\0' && ch != '\0')) \
{ \
/* Use the UCS4 table for double byte. */ \
while (ch > rp2->end) \
++rp2; \
\
+ const char *cp; \
if (__builtin_expect (ch < rp2->start, 0) \
|| (cp = __ucs4_to_ibm939db[ch + rp2->idx], \
__builtin_expect (cp[0], L'\1')==L'\0' && ch != '\0')) \
@@ -263,7 +264,7 @@ enum
else if (ch == 0x5c) \
*outptr++ = 0xb2; \
else \
- *outptr++ = cp[0]; \
+ *outptr++ = sbconv; \
} \
\
/* Now that we wrote the output increment the input pointer. */ \
diff --git a/iconvdata/ibm939.h b/iconvdata/ibm939.h
index bb8a8de1da..9c0a6576c4 100644
--- a/iconvdata/ibm939.h
+++ b/iconvdata/ibm939.h
@@ -1499,46 +1499,46 @@ static const struct gap __ucs4_to_ibm939sb_idx[] =
{ .start = 0xffff, .end = 0xffff, .idx = 0 }
};
-static const char * __ucs4_to_ibm939sb[] =
+static const unsigned char __ucs4_to_ibm939sb[] =
{
- "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16",
- "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11",
- "\x12", "\x13", "\x3c", "\x3d", "\x32", "\x26", "\x18", "\x19", "\x3f",
- "\x27", "\x1c", "\x1d", "\x1e", "\x1f", "\x40", "\x5a", "\x7f", "\x7b",
- "\x5b", "\x6c", "\x50", "\x7d", "\x4d", "\x5d", "\x5c", "\x4e", "\x6b",
- "\x60", "\x4b", "\x61", "\xf0", "\xf1", "\xf2", "\xf3", "\xf4", "\xf5",
- "\xf6", "\xf7", "\xf8", "\xf9", "\x7a", "\x5e", "\x4c", "\x7e", "\x6e",
- "\x6f", "\x7c", "\xc1", "\xc2", "\xc3", "\xc4", "\xc5", "\xc6", "\xc7",
- "\xc8", "\xc9", "\xd1", "\xd2", "\xd3", "\xd4", "\xd5", "\xd6", "\xd7",
- "\xd8", "\xd9", "\xe2", "\xe3", "\xe4", "\xe5", "\xe6", "\xe7", "\xe8",
- "\xe9", "\xad", "\xe0", "\xbd", "\xb0", "\x6d", "\x79", "\x81", "\x82",
- "\x83", "\x84", "\x85", "\x86", "\x87", "\x88", "\x89", "\x91", "\x92",
- "\x93", "\x94", "\x95", "\x96", "\x97", "\x98", "\x99", "\xa2", "\xa3",
- "\xa4", "\xa5", "\xa6", "\xa7", "\xa8", "\xa9", "\xc0", "\x4f", "\xd0",
- "\xa1", "\x07", "\x20", "\x21", "\x22", "\x23", "\x24", "\x15", "\x06",
- "\x17", "\x28", "\x29", "\x2a", "\x2b", "\x2c", "\x09", "\x0a", "\x1b",
- "\x30", "\x31", "\x1a", "\x33", "\x34", "\x35", "\x36", "\x08", "\x38",
- "\x39", "\x3a", "\x3b", "\x04", "\x14", "\x3e", "\xff", "\x3f", "\x3f",
- "\x4a", "\xb1", "\x3f", "\xb2", "\x3f", "\x3f", "\x3f", "\x5f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\xa0", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f", "\x3f", "\x3f", "\x42", "\x43", "\x44", "\x45", "\x46",
- "\x47", "\x48", "\x49", "\x51", "\x52", "\x53", "\x54", "\x55", "\x56",
- "\x57", "\x58", "\x59", "\x62", "\x63", "\x64", "\x65", "\x66", "\x67",
- "\x68", "\x69", "\x70", "\x71", "\x72", "\x73", "\x74", "\x75", "\x76",
- "\x77", "\x78", "\x8a", "\x8b", "\x8c", "\x8d", "\x8e", "\x8f", "\x9a",
- "\x9b", "\x9c", "\x9d", "\x9e", "\x9f", "\xaa", "\xab", "\xac", "\xae",
- "\xaf", "\xb3", "\xb4", "\xb5", "\xb6", "\xb7", "\xb8", "\xb9", "\xba",
- "\xbb", "\xbc", "\xbe", "\xbf", "\x3f", "\x3f", "\x3f", "\x3f", "\x3f",
- "\x3f", "\x3f"
+ '\x00', '\x01', '\x02', '\x03', '\x37', '\x2d', '\x2e', '\x2f', '\x16',
+ '\x05', '\x25', '\x0b', '\x0c', '\x0d', '\x3f', '\x3f', '\x10', '\x11',
+ '\x12', '\x13', '\x3c', '\x3d', '\x32', '\x26', '\x18', '\x19', '\x3f',
+ '\x27', '\x1c', '\x1d', '\x1e', '\x1f', '\x40', '\x5a', '\x7f', '\x7b',
+ '\x5b', '\x6c', '\x50', '\x7d', '\x4d', '\x5d', '\x5c', '\x4e', '\x6b',
+ '\x60', '\x4b', '\x61', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5',
+ '\xf6', '\xf7', '\xf8', '\xf9', '\x7a', '\x5e', '\x4c', '\x7e', '\x6e',
+ '\x6f', '\x7c', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
+ '\xc8', '\xc9', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7',
+ '\xd8', '\xd9', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8',
+ '\xe9', '\xad', '\xe0', '\xbd', '\xb0', '\x6d', '\x79', '\x81', '\x82',
+ '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x91', '\x92',
+ '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\xa2', '\xa3',
+ '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xc0', '\x4f', '\xd0',
+ '\xa1', '\x07', '\x20', '\x21', '\x22', '\x23', '\x24', '\x15', '\x06',
+ '\x17', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x09', '\x0a', '\x1b',
+ '\x30', '\x31', '\x1a', '\x33', '\x34', '\x35', '\x36', '\x08', '\x38',
+ '\x39', '\x3a', '\x3b', '\x04', '\x14', '\x3e', '\xff', '\x3f', '\x3f',
+ '\x4a', '\xb1', '\x3f', '\xb2', '\x3f', '\x3f', '\x3f', '\x5f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\xa0', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f', '\x3f', '\x3f', '\x42', '\x43', '\x44', '\x45', '\x46',
+ '\x47', '\x48', '\x49', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56',
+ '\x57', '\x58', '\x59', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67',
+ '\x68', '\x69', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76',
+ '\x77', '\x78', '\x8a', '\x8b', '\x8c', '\x8d', '\x8e', '\x8f', '\x9a',
+ '\x9b', '\x9c', '\x9d', '\x9e', '\x9f', '\xaa', '\xab', '\xac', '\xae',
+ '\xaf', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba',
+ '\xbb', '\xbc', '\xbe', '\xbf', '\x3f', '\x3f', '\x3f', '\x3f', '\x3f',
+ '\x3f', '\x3f'
};
static const struct gap __ucs4_to_ibm939db_idx[] =
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
index df5b5df1fd..92970a06eb 100644
--- a/iconvdata/iso-2022-cn-ext.c
+++ b/iconvdata/iso-2022-cn-ext.c
@@ -27,6 +27,7 @@
#include "cns11643.h"
#include "cns11643l1.h"
#include "cns11643l2.h"
+#include <libc-internal.h>
#include <assert.h>
@@ -394,6 +395,16 @@ enum
#define MIN_NEEDED_OUTPUT TO_LOOP_MIN_NEEDED_TO
#define MAX_NEEDED_OUTPUT TO_LOOP_MAX_NEEDED_TO
#define LOOPFCT TO_LOOP
+/* With GCC 5.3 when compiling with -Os the compiler emits a warning
+ that buf[0] and buf[1] may be used uninitialized. This can only
+ happen in the case where tmpbuf[3] is used, and in that case the
+ write to the tmpbuf[1] and tmpbuf[2] was assured because
+ ucs4_to_cns11643 would have filled in those entries. The difficulty
+ is in getting the compiler to see this logic because tmpbuf[0] is
+ involved in determining the code page and is the indicator that
+ tmpbuf[2] is initialized. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
#define BODY \
{ \
uint32_t ch; \
@@ -645,6 +656,7 @@ enum
/* Now that we wrote the output increment the input pointer. */ \
inptr += 4; \
}
+DIAG_POP_NEEDS_COMMENT;
#define EXTRA_LOOP_DECLS , int *setp
#define INIT_PARAMS int set = (*setp >> 3) & CURRENT_MASK; \
int ann = (*setp >> 3) & ~CURRENT_MASK
diff --git a/iconvdata/iso646.c b/iconvdata/iso646.c
index b048c2018e..54e6b33596 100644
--- a/iconvdata/iso646.c
+++ b/iconvdata/iso646.c
@@ -60,9 +60,9 @@ enum direction
from_iso646
};
+/* See names below, must be in the same order. */
enum variant
{
- illegal_var,
GB, /* BS_4730 */
CA, /* CSA_Z243.4-1985-1 */
CA2, /* CSA_Z243.4-1985-2 */
@@ -88,33 +88,33 @@ enum variant
SE2 /* SEN_850200_C */
};
-static const char *names[] =
-{
- [GB] = "BS_4730//",
- [CA] = "CSA_Z243.4-1985-1//",
- [CA2] = "CSA_Z243.4-1985-2//",
- [DE] = "DIN_66003//",
- [DK] = "DS_2089//",
- [ES] = "ES//",
- [ES2] = "ES2//",
- [CN] = "GB_1988-80//",
- [IT] = "IT//",
- [JP] = "JIS_C6220-1969-RO//",
- [JP_OCR_B] = "JIS_C6229-1984-B//",
- [YU] = "JUS_I.B1.002//",
- [KR] = "KSC5636//",
- [HU] = "MSZ_7795.3//",
- [CU] = "NC_NC00-10//",
- [FR] = "NF_Z_62-010//",
- [FR1] = "NF_Z_62-010_1973//", /* Note that we don't have the parenthesis
- in the name. */
- [NO] = "NS_4551-1//",
- [NO2] = "NS_4551-2//",
- [PT] = "PT//",
- [PT2] = "PT2//",
- [SE] = "SEN_850200_B//",
- [SE2] = "SEN_850200_C//"
-};
+/* Must be in the same order as enum variant above. */
+static const char names[] =
+ "BS_4730//\0"
+ "CSA_Z243.4-1985-1//\0"
+ "CSA_Z243.4-1985-2//\0"
+ "DIN_66003//\0"
+ "DS_2089//\0"
+ "ES//\0"
+ "ES2//\0"
+ "GB_1988-80//\0"
+ "IT//\0"
+ "JIS_C6220-1969-RO//\0"
+ "JIS_C6229-1984-B//\0"
+ "JUS_I.B1.002//\0"
+ "KSC5636//\0"
+ "MSZ_7795.3//\0"
+ "NC_NC00-10//\0"
+ "NF_Z_62-010//\0"
+ "NF_Z_62-010_1973//\0" /* Note that we don't have the parenthesis in
+ the name. */
+ "NS_4551-1//\0"
+ "NS_4551-2//\0"
+ "PT//\0"
+ "PT2//\0"
+ "SEN_850200_B//\0"
+ "SEN_850200_C//\0"
+ "\0";
struct iso646_data
{
@@ -130,20 +130,24 @@ gconv_init (struct __gconv_step *step)
/* Determine which direction. */
struct iso646_data *new_data;
enum direction dir = illegal_dir;
- enum variant var;
int result;
- for (var = sizeof (names) / sizeof (names[0]) - 1; var > illegal_var; --var)
- if (__strcasecmp (step->__from_name, names[var]) == 0)
- {
- dir = from_iso646;
- break;
- }
- else if (__strcasecmp (step->__to_name, names[var]) == 0)
- {
- dir = to_iso646;
- break;
- }
+ enum variant var = 0;
+ for (const char *name = names; *name != '\0';
+ name = __rawmemchr (name, '\0') + 1)
+ {
+ if (__strcasecmp (step->__from_name, name) == 0)
+ {
+ dir = from_iso646;
+ break;
+ }
+ else if (__strcasecmp (step->__to_name, name) == 0)
+ {
+ dir = to_iso646;
+ break;
+ }
+ ++var;
+ }
result = __GCONV_NOCONV;
if (__builtin_expect (dir, from_iso646) != illegal_dir)
diff --git a/include/aliases.h b/include/aliases.h
index f7cfafcd6c..ece69ebe43 100644
--- a/include/aliases.h
+++ b/include/aliases.h
@@ -1,6 +1,8 @@
#ifndef _ALIASES_H
#include <inet/aliases.h>
+# ifndef _ISOMAC
+
extern int __getaliasent_r (struct aliasent *__restrict __result_buf,
char *__restrict __buffer, size_t __buflen,
struct aliasent **__restrict __result)
@@ -34,4 +36,5 @@ DECLARE_NSS_PROTOTYPES (nis)
DECLARE_NSS_PROTOTYPES (nisplus)
#undef DECLARE_NSS_PROTOTYPES
+# endif /* !_ISOMAC */
#endif
diff --git a/include/alloca.h b/include/alloca.h
index 01500259b8..fd90664f0a 100644
--- a/include/alloca.h
+++ b/include/alloca.h
@@ -1,6 +1,9 @@
#ifndef _ALLOCA_H
#include <stdlib/alloca.h>
+
+# ifndef _ISOMAC
+
#include <stackinfo.h>
#undef __alloca
@@ -73,4 +76,5 @@ libc_hidden_proto (__libc_alloca_cutoff)
extend_alloca (buf, len, s__); })
#endif
+# endif /* !_ISOMAC */
#endif
diff --git a/include/argz.h b/include/argz.h
index 4eab0b680b..0388c23277 100644
--- a/include/argz.h
+++ b/include/argz.h
@@ -2,8 +2,11 @@
#include <string/argz.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (argz_delete)
libc_hidden_proto (__argz_count)
libc_hidden_proto (__argz_stringify)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index 57f7457848..cd7ab6e925 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -2,6 +2,8 @@
#include <resolv/arpa/nameser.h>
+# ifndef _ISOMAC
+
/* If the machine allows unaligned access we can do better than using
the NS_GET16, NS_GET32, NS_PUT16, and NS_PUT32 macros from the
installed header. */
@@ -47,8 +49,8 @@ extern const struct _ns_flagdata _ns_flagdata[] attribute_hidden;
#endif
-extern u_int __ns_get16 (const u_char *) __THROW;
-extern u_long __ns_get32 (const u_char *) __THROW;
+extern unsigned int __ns_get16 (const unsigned char *) __THROW;
+extern unsigned long __ns_get32 (const unsigned char *) __THROW;
#define ns_msg_getflag(handle, flag) \
(((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
@@ -74,4 +76,5 @@ libresolv_hidden_proto (ns_samename)
libresolv_hidden_proto (ns_makecanon)
libresolv_hidden_proto (ns_format_ttl)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h
index 2e735ede4c..69280009b5 100644
--- a/include/arpa/nameser_compat.h
+++ b/include/arpa/nameser_compat.h
@@ -1,8 +1,11 @@
#ifndef _ARPA_NAMESER_COMPAT_
#include <resolv/arpa/nameser_compat.h>
+# ifndef _ISOMAC
+
/* Picksome unused number to represent lookups of IPv4 and IPv6 (i.e.,
T_A and T_AAAA). */
#define T_UNSPEC 62321
+# endif /* !_ISOMAC */
#endif
diff --git a/include/atomic.h b/include/atomic.h
index 5a8e7e7966..c8b46649c5 100644
--- a/include/atomic.h
+++ b/include/atomic.h
@@ -777,18 +777,21 @@ void __atomic_link_error (void);
# endif
# ifndef atomic_fetch_xor_release
+/* Failing the atomic_compare_exchange_weak_release reloads the value in
+ __atg104_expected, so we need only do the XOR again and retry. */
# define atomic_fetch_xor_release(mem, operand) \
- ({ __typeof (*(mem)) __atg104_old; \
- __typeof (mem) __atg104_memp = (mem); \
+ ({ __typeof (mem) __atg104_memp = (mem); \
+ __typeof (*(mem)) __atg104_expected = (*__atg104_memp); \
+ __typeof (*(mem)) __atg104_desired; \
__typeof (*(mem)) __atg104_op = (operand); \
\
do \
- __atg104_old = (*__atg104_memp); \
- while (__builtin_expect \
- (atomic_compare_and_exchange_bool_rel ( \
- __atg104_memp, __atg104_old ^ __atg104_op, __atg104_old), 0));\
- \
- __atg104_old; })
+ __atg104_desired = __atg104_expected ^ __atg104_op; \
+ while (__glibc_unlikely \
+ (atomic_compare_exchange_weak_release ( \
+ __atg104_memp, &__atg104_expected, __atg104_desired) \
+ == 0)); \
+ __atg104_expected; })
#endif
#endif /* !USE_ATOMIC_COMPILER_BUILTINS */
diff --git a/include/bits/types/clock_t.h b/include/bits/types/clock_t.h
new file mode 100644
index 0000000000..a08940dbef
--- /dev/null
+++ b/include/bits/types/clock_t.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/clock_t.h"
diff --git a/include/bits/types/clockid_t.h b/include/bits/types/clockid_t.h
new file mode 100644
index 0000000000..fb0a514446
--- /dev/null
+++ b/include/bits/types/clockid_t.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/clockid_t.h"
diff --git a/include/bits/types/struct_itimerspec.h b/include/bits/types/struct_itimerspec.h
new file mode 100644
index 0000000000..7d325d6f3c
--- /dev/null
+++ b/include/bits/types/struct_itimerspec.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/struct_itimerspec.h"
diff --git a/include/bits/types/struct_osockaddr.h b/include/bits/types/struct_osockaddr.h
new file mode 100644
index 0000000000..78f3188596
--- /dev/null
+++ b/include/bits/types/struct_osockaddr.h
@@ -0,0 +1 @@
+#include "../../socket/bits/types/struct_osockaddr.h"
diff --git a/include/bits/types/struct_timespec.h b/include/bits/types/struct_timespec.h
new file mode 100644
index 0000000000..b8ec6a3862
--- /dev/null
+++ b/include/bits/types/struct_timespec.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/struct_timespec.h"
diff --git a/include/bits/types/struct_timeval.h b/include/bits/types/struct_timeval.h
new file mode 100644
index 0000000000..5d2cb78259
--- /dev/null
+++ b/include/bits/types/struct_timeval.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/struct_timeval.h"
diff --git a/include/bits/types/struct_tm.h b/include/bits/types/struct_tm.h
new file mode 100644
index 0000000000..b70ac52f68
--- /dev/null
+++ b/include/bits/types/struct_tm.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/struct_tm.h"
diff --git a/include/bits/types/time_t.h b/include/bits/types/time_t.h
new file mode 100644
index 0000000000..16e75e19be
--- /dev/null
+++ b/include/bits/types/time_t.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/time_t.h"
diff --git a/include/bits/types/timer_t.h b/include/bits/types/timer_t.h
new file mode 100644
index 0000000000..e6b279bfcc
--- /dev/null
+++ b/include/bits/types/timer_t.h
@@ -0,0 +1 @@
+#include "../../time/bits/types/timer_t.h"
diff --git a/include/crypt.h b/include/crypt.h
new file mode 100644
index 0000000000..544551da21
--- /dev/null
+++ b/include/crypt.h
@@ -0,0 +1,3 @@
+#ifndef _CRYPT_H
+# include <crypt/crypt.h>
+#endif /* _CRYPT_H */
diff --git a/include/elf.h b/include/elf.h
index 60658c617c..f06a33f256 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -1,5 +1,8 @@
#ifndef _ELF_H
-# include <elf/elf.h>
+#include <elf/elf.h>
+
+# ifndef _ISOMAC
+
/* Some information which is not meant for the public and therefore not
in <elf.h>. */
# include <dl-dtprocnum.h>
@@ -9,4 +12,6 @@
# define DT_1_SUPPORTED_MASK \
(DF_1_NOW | DF_1_NODELETE | DF_1_INITFIRST | DF_1_NOOPEN \
| DF_1_ORIGIN | DF_1_NODEFLIB)
-#endif
+
+# endif /* !_ISOMAC */
+#endif /* elf.h */
diff --git a/include/envz.h b/include/envz.h
index 8cfd9b57e9..633fcc6f40 100644
--- a/include/envz.h
+++ b/include/envz.h
@@ -2,7 +2,10 @@
#include <string/envz.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (envz_entry)
libc_hidden_proto (envz_remove)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/err.h b/include/err.h
index 737dfc1b6f..382855938e 100644
--- a/include/err.h
+++ b/include/err.h
@@ -1,8 +1,14 @@
+#ifndef _ERR_H
#include <misc/err.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (warn)
libc_hidden_proto (warnx)
libc_hidden_proto (vwarn)
libc_hidden_proto (vwarnx)
libc_hidden_proto (verr)
libc_hidden_proto (verrx)
+
+# endif /* !_ISOMAC */
+#endif /* err.h */
diff --git a/include/execinfo.h b/include/execinfo.h
index c929821e8c..0b132b089f 100644
--- a/include/execinfo.h
+++ b/include/execinfo.h
@@ -1,6 +1,8 @@
#ifndef _EXECINFO_H
#include <debug/execinfo.h>
+# ifndef _ISOMAC
+
extern int __backtrace (void **__array, int __size);
libc_hidden_proto (__backtrace)
@@ -10,4 +12,5 @@ extern void __backtrace_symbols_fd (void *const *__array, int __size,
int __fd);
libc_hidden_proto (__backtrace_symbols_fd)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/fpu_control.h b/include/fpu_control.h
index d0b5e9c0d1..4498a83b87 100644
--- a/include/fpu_control.h
+++ b/include/fpu_control.h
@@ -1,4 +1,10 @@
+#ifndef _FPU_CONTROL_H
#include_next <fpu_control.h>
+# ifndef _ISOMAC
+
/* Called at startup. It can be used to manipulate fpu control register. */
extern void __setfpucw (fpu_control_t);
+
+# endif /* !_ISOMAC */
+#endif /* fpu_control.h */
diff --git a/include/getopt.h b/include/getopt.h
index 6f2693d21b..c094972c97 100644
--- a/include/getopt.h
+++ b/include/getopt.h
@@ -3,11 +3,10 @@
#include <features.h> /* Get __GNU_LIBRARY__ defined now. */
#include <posix/getopt.h>
-# ifdef _GETOPT_H
+# if defined _GETOPT_H && !defined _ISOMAC
/* Now define the internal interfaces. */
extern void __getopt_clean_environment (char **__env);
-# endif
-
+# endif /* _GETOPT_H && !_ISOMAC */
#endif
diff --git a/include/gshadow.h b/include/gshadow.h
index 8a981f688a..532801afd0 100644
--- a/include/gshadow.h
+++ b/include/gshadow.h
@@ -1,6 +1,8 @@
#ifndef _GSHADOW_H
#include <gshadow/gshadow.h>
+# ifndef _ISOMAC
+
extern int __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer,
size_t buflen, struct sgrp **result);
extern int __sgetsgent_r (const char *string, struct sgrp *resbuf,
@@ -12,4 +14,5 @@ extern int _nss_files_parse_sgent (char *line, struct sgrp *result,
size_t datalen, int *errnop);
libc_hidden_proto (_nss_files_parse_sgent)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/ifaddrs.h b/include/ifaddrs.h
index 2787f21115..54f4b7a3ce 100644
--- a/include/ifaddrs.h
+++ b/include/ifaddrs.h
@@ -1,5 +1,8 @@
#ifndef _IFADDRS_H
#include <inet/ifaddrs.h>
+
+# ifndef _ISOMAC
+
#include <stdbool.h>
#include <stdint.h>
@@ -30,4 +33,5 @@ extern void __check_native (uint32_t a1_index, int *a1_native,
extern uint32_t __bump_nl_timestamp (void) attribute_hidden;
#endif
+# endif /* !_ISOMAC */
#endif /* ifaddrs.h */
diff --git a/include/libc-internal.h b/include/libc-internal.h
index 7a185bbdc7..e4395dd5c5 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -111,4 +111,19 @@ extern __typeof (__profile_frequency) __profile_frequency attribute_hidden;
#define DIAG_IGNORE_NEEDS_COMMENT(version, option) \
_Pragma (_DIAG_STR (GCC diagnostic ignored option))
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT the following macro ignores the
+ diagnostic OPTION but only if optimizations for size are enabled.
+ This is required because different warnings may be generated for
+ different optimization levels. For example a key piece of code may
+ only generate a warning when compiled at -Os, but at -O2 you could
+ still want the warning to be enabled to catch errors. In this case
+ you would use DIAG_IGNORE_Os_NEEDS_COMMENT to disable the warning
+ only for -Os. */
+#ifdef __OPTIMIZE_SIZE__
+# define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option) \
+ _Pragma (_DIAG_STR (GCC diagnostic ignored option))
+#else
+# define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
+#endif
+
#endif /* _LIBC_INTERNAL */
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index c2b499ae36..1c91f2e6a3 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -121,6 +121,21 @@
# define weak_extern(symbol) _weak_extern (weak symbol)
# define _weak_extern(expr) _Pragma (#expr)
+/* In shared builds, the expression call_function_static_weak
+ (FUNCTION-SYMBOL, ARGUMENTS) invokes FUNCTION-SYMBOL (an
+ identifier) unconditionally, with the (potentially empty) argument
+ list ARGUMENTS. In static builds, if FUNCTION-SYMBOL has a
+ definition, the function is invoked as before; if FUNCTION-SYMBOL
+ is NULL, no call is performed. */
+# ifdef SHARED
+# define call_function_static_weak(func, ...) func (__VA_ARGS__)
+# else /* !SHARED */
+# define call_function_static_weak(func, ...) \
+ ({ \
+ extern __typeof__ (func) func weak_function; \
+ (func != NULL ? func (__VA_ARGS__) : (void)0); \
+ })
+# endif
#else /* __ASSEMBLER__ */
@@ -722,42 +737,137 @@ for linking")
# define compat_data_section .section ".data.compat", "aw";
#endif
-/* Marker used for indirection function symbols. */
-#define libc_ifunc(name, expr) \
- extern void *name##_ifunc (void) __asm__ (#name); \
- void *name##_ifunc (void) \
+/* Helper / base macros for indirect function symbols. */
+#define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
+ classifier void *name##_ifunc (arg) \
{ \
- INIT_ARCH (); \
- __typeof (name) *res = expr; \
+ init (); \
+ __typeof (type_name) *res = expr; \
return res; \
- } \
- __asm__ (".type " #name ", %gnu_indirect_function");
+ }
-/* The body of the function is supposed to use __get_cpu_features
- which will, if necessary, initialize the data first. */
-#define libm_ifunc(name, expr) \
- extern void *name##_ifunc (void) __asm__ (#name); \
- void *name##_ifunc (void) \
- { \
- __typeof (name) *res = expr; \
- return res; \
- } \
- __asm__ (".type " #name ", %gnu_indirect_function");
-
-#ifdef HAVE_ASM_SET_DIRECTIVE
-# define libc_ifunc_hidden_def1(local, name) \
- __asm__ (".globl " #local "\n\t" \
- ".hidden " #local "\n\t" \
- ".set " #local ", " #name);
+#ifdef HAVE_GCC_IFUNC
+# define __ifunc(type_name, name, expr, arg, init) \
+ extern __typeof (type_name) name __attribute__ \
+ ((ifunc (#name "_ifunc"))); \
+ __ifunc_resolver (type_name, name, expr, arg, init, static)
+
+# define __ifunc_hidden(type_name, name, expr, arg, init) \
+ __ifunc (type_name, name, expr, arg, init)
#else
-# define libc_ifunc_hidden_def1(local, name) \
- __asm__ (".globl " #local "\n\t" \
- ".hidden " #local "\n\t" \
- #local " = " #name);
-#endif
+/* Gcc does not support __attribute__ ((ifunc (...))). Use the old behaviour
+ as fallback. But keep in mind that the debug information for the ifunc
+ resolver functions is not correct. It contains the ifunc'ed function as
+ DW_AT_linkage_name. E.g. lldb uses this field and an inferior function
+ call of the ifunc'ed function will fail due to "no matching function for
+ call to ..." because the ifunc'ed function and the resolver function have
+ different signatures. (Gcc support is disabled at least on a ppc64le
+ Ubuntu 14.04 system.) */
+
+# define __ifunc(type_name, name, expr, arg, init) \
+ extern __typeof (type_name) name; \
+ void *name##_ifunc (arg) __asm__ (#name); \
+ __ifunc_resolver (type_name, name, expr, arg, init,) \
+ __asm__ (".type " #name ", %gnu_indirect_function");
+
+# define __ifunc_hidden(type_name, name, expr, arg, init) \
+ extern __typeof (type_name) __libc_##name; \
+ __ifunc (type_name, __libc_##name, expr, arg, init) \
+ strong_alias (__libc_##name, name);
+#endif /* !HAVE_GCC_IFUNC */
+
+/* The following macros are used for indirect function symbols in libc.so.
+ First of all, you need to have the function prototyped somewhere,
+ say in foo.h:
+
+ int foo (int __bar);
+
+ If you have an implementation for foo which e.g. uses a special hardware
+ feature which isn't available on all machines where this libc.so will be
+ used but decideable if available at runtime e.g. via hwcaps, you can provide
+ two or multiple implementations of foo:
+
+ int __foo_default (int __bar)
+ {
+ return __bar;
+ }
+
+ int __foo_special (int __bar)
+ {
+ return __bar;
+ }
+
+ If your function foo has no libc_hidden_proto (foo) defined for PLT
+ bypassing, you can use:
-#define libc_ifunc_hidden_def(name) \
- libc_ifunc_hidden_def1 (__GI_##name, name)
+ #define INIT_ARCH() unsigned long int hwcap = __GLRO(dl_hwcap);
+
+ libc_ifunc (foo, (hwcap & HWCAP_SPECIAL) ? __foo_special : __foo_default);
+
+ This will define a resolver function for foo which returns __foo_special or
+ __foo_default depending on your specified expression. Please note that you
+ have to define a macro function INIT_ARCH before using libc_ifunc macro as
+ it is called by the resolver function before evaluating the specified
+ expression. In this example it is used to prepare the hwcap variable.
+ The resolver function is assigned to an ifunc'ed symbol foo. Calls to foo
+ from inside or outside of libc.so will be indirected by a PLT call.
+
+ If your function foo has a libc_hidden_proto (foo) defined for PLT bypassing
+ and calls to foo within libc.so should always go to one specific
+ implementation of foo e.g. __foo_default then you have to add:
+
+ __hidden_ver1 (__foo_default, __GI_foo, __foo_default);
+
+ or a tweaked definition of libc_hidden_def macro after the __foo_default
+ function definition. Calls to foo within libc.so will always go directly to
+ __foo_default. Calls to foo from outside libc.so will be indirected by a
+ PLT call to ifunc'ed symbol foo which you have to define in a separate
+ compile unit:
+
+ #define foo __redirect_foo
+ #include <foo.h>
+ #undef foo
+
+ extern __typeof (__redirect_foo) __foo_default attribute_hidden;
+ extern __typeof (__redirect_foo) __foo_special attribute_hidden;
+
+ libc_ifunc_redirected (__redirect_foo, foo,
+ (hwcap & HWCAP_SPECIAL)
+ ? __foo_special
+ : __foo_default);
+
+ This will define the ifunc'ed symbol foo like above. The redirection of foo
+ in header file is needed to omit an additional defintion of __GI_foo which
+ would end in a linker error while linking libc.so. You have to specify
+ __redirect_foo as first parameter which is used within libc_ifunc_redirected
+ macro in conjunction with typeof to define the ifunc'ed symbol foo.
+
+ If your function foo has a libc_hidden_proto (foo) defined and calls to foo
+ within or from outside libc.so should go via ifunc'ed symbol, then you have
+ to use:
+
+ libc_ifunc_hidden (foo, foo,
+ (hwcap & HWCAP_SPECIAL)
+ ? __foo_special
+ : __foo_default);
+ libc_hidden_def (foo)
+
+ The first parameter foo of libc_ifunc_hidden macro is used in the same way
+ as for libc_ifunc_redirected macro. */
+
+#define libc_ifunc(name, expr) __ifunc (name, name, expr, void, INIT_ARCH)
+
+#define libc_ifunc_redirected(redirected_name, name, expr) \
+ __ifunc (redirected_name, name, expr, void, INIT_ARCH)
+
+#define libc_ifunc_hidden(redirected_name, name, expr) \
+ __ifunc_hidden (redirected_name, name, expr, void, INIT_ARCH)
+
+/* The body of the function is supposed to use __get_cpu_features
+ which will, if necessary, initialize the data first. */
+#define libm_ifunc_init()
+#define libm_ifunc(name, expr) \
+ __ifunc (name, name, expr, void, libm_ifunc_init)
/* Add the compiler optimization to inhibit loop transformation to library
calls. This is used to avoid recursive calls in memset and memmove
diff --git a/include/libintl.h b/include/libintl.h
index 0551a04084..9a11367ec6 100644
--- a/include/libintl.h
+++ b/include/libintl.h
@@ -1,5 +1,8 @@
#ifndef _LIBINTL_H
#include <intl/libintl.h>
+
+# ifndef _ISOMAC
+
#include <locale.h>
/* Now define the internal interfaces. */
@@ -46,4 +49,5 @@ libc_hidden_proto (_libc_intl_domainname)
# define _(msgid) \
__dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/limits.h b/include/limits.h
index 5add8fceb9..dd601d5793 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -22,7 +22,8 @@
#ifndef _LIBC_LIMITS_H_
#define _LIBC_LIMITS_H_ 1
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
/* Maximum length of any multibyte character in any locale.
@@ -138,6 +139,45 @@
# endif
#endif
+/* The integer width macros are not defined by GCC's <limits.h> before
+ GCC 7, or if _GNU_SOURCE rather than
+ __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+# ifndef CHAR_WIDTH
+# define CHAR_WIDTH 8
+# endif
+# ifndef SCHAR_WIDTH
+# define SCHAR_WIDTH 8
+# endif
+# ifndef UCHAR_WIDTH
+# define UCHAR_WIDTH 8
+# endif
+# ifndef SHRT_WIDTH
+# define SHRT_WIDTH 16
+# endif
+# ifndef USHRT_WIDTH
+# define USHRT_WIDTH 16
+# endif
+# ifndef INT_WIDTH
+# define INT_WIDTH 32
+# endif
+# ifndef UINT_WIDTH
+# define UINT_WIDTH 32
+# endif
+# ifndef LONG_WIDTH
+# define LONG_WIDTH __WORDSIZE
+# endif
+# ifndef ULONG_WIDTH
+# define ULONG_WIDTH __WORDSIZE
+# endif
+# ifndef LLONG_WIDTH
+# define LLONG_WIDTH 64
+# endif
+# ifndef ULLONG_WIDTH
+# define ULLONG_WIDTH 64
+# endif
+#endif /* Use IEC_60559_BFP_EXT. */
+
#ifdef __USE_POSIX
/* POSIX adds things to <limits.h>. */
# include <bits/posix1_lim.h>
diff --git a/include/link.h b/include/link.h
index 32a7392f38..055844285c 100644
--- a/include/link.h
+++ b/include/link.h
@@ -24,12 +24,18 @@
# error this should be impossible
#endif
+# ifndef _ISOMAC
/* Get most of the contents from the public header, but we define a
different `struct link_map' type for private use. The la_objopen
prototype uses the type, so we have to declare it separately. */
-#define link_map link_map_public
-#define la_objopen la_objopen_wrongproto
+# define link_map link_map_public
+# define la_objopen la_objopen_wrongproto
+# endif
+
#include <elf/link.h>
+
+# ifndef _ISOMAC
+
#undef link_map
#undef la_objopen
@@ -341,4 +347,5 @@ extern int __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
`ELF64_R_TYPE'. */
#define ELFW(type) _ElfW (ELF, __ELF_NATIVE_CLASS, type)
+# endif /* !_ISOMAC */
#endif /* include/link.h */
diff --git a/include/malloc.h b/include/malloc.h
index 42fc8ed696..70d32c7c84 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -1,6 +1,7 @@
#ifndef _MALLOC_H
#include <malloc/malloc.h>
+# ifndef _ISOMAC
/* In the GNU libc we rename the global variable
`__malloc_initialized' to `__libc_malloc_initialized'. */
@@ -11,4 +12,5 @@ extern int __malloc_initialized attribute_hidden;
struct malloc_state;
typedef struct malloc_state *mstate;
+# endif /* !_ISOMAC */
#endif
diff --git a/include/mcheck.h b/include/mcheck.h
index b0037a7107..8883c3d53e 100644
--- a/include/mcheck.h
+++ b/include/mcheck.h
@@ -2,7 +2,10 @@
#include <malloc/mcheck.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (mcheck)
libc_hidden_proto (mcheck_check_all)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/mntent.h b/include/mntent.h
index b34674aa3e..169210fc66 100644
--- a/include/mntent.h
+++ b/include/mntent.h
@@ -1,6 +1,8 @@
#ifndef _MNTENT_H
#include <misc/mntent.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern FILE *__setmntent (const char *__file, const char *__mode);
extern struct mntent *__getmntent_r (FILE *__stream,
@@ -14,4 +16,5 @@ libc_hidden_proto (__setmntent)
libc_hidden_proto (__getmntent_r)
libc_hidden_proto (__endmntent)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/netinet/ether.h b/include/netinet/ether.h
index 2efe4c04e4..8bfe7e03ad 100644
--- a/include/netinet/ether.h
+++ b/include/netinet/ether.h
@@ -1,6 +1,8 @@
#ifndef _NETINET_ETHER_H
#include <inet/netinet/ether.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (ether_aton_r)
libc_hidden_proto (ether_ntoa_r)
@@ -39,4 +41,5 @@ DECLARE_NSS_PROTOTYPES (nisplus)
#undef DECLARE_NSS_PROTOTYPES
+# endif /* !_ISOMAC */
#endif
diff --git a/include/nss.h b/include/nss.h
index 1e8cc3910d..6358a10fd3 100644
--- a/include/nss.h
+++ b/include/nss.h
@@ -1,6 +1,8 @@
#ifndef _NSS_H
#include <nss/nss.h>
+# ifndef _ISOMAC
+
#define NSS_INVALID_FIELD_CHARACTERS ":\n"
extern const char __nss_invalid_field_characters[] attribute_hidden;
@@ -11,4 +13,5 @@ _Bool __nss_valid_list_field (char **list)
const char *__nss_rewrite_field (const char *value, char **to_be_freed)
attribute_hidden internal_function;
+# endif /* !_ISOMAC */
#endif /* _NSS_H */
diff --git a/include/obstack.h b/include/obstack.h
index 349d59bb03..fe2e595381 100644
--- a/include/obstack.h
+++ b/include/obstack.h
@@ -1,3 +1,9 @@
+#ifndef _OBSTACK_H
#include <malloc/obstack.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (_obstack_newchunk)
+
+# endif /* !_ISOMAC */
+#endif /* obstack.h */
diff --git a/include/printf.h b/include/printf.h
index b12b5dc971..984f263167 100644
--- a/include/printf.h
+++ b/include/printf.h
@@ -1,6 +1,9 @@
#ifndef _PRINTF_H
#include <stdio-common/printf.h>
+
+# ifndef _ISOMAC
+
#include <xlocale.h>
/* Now define the internal interfaces. */
@@ -13,4 +16,5 @@ extern int __printf_fp_l (FILE *, locale_t, const struct printf_info *,
const void *const *);
libc_hidden_proto (__printf_fp_l)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/pty.h b/include/pty.h
index a91be80852..4979bb765f 100644
--- a/include/pty.h
+++ b/include/pty.h
@@ -1,6 +1,9 @@
#ifndef _PTY_H
#include <login/pty.h>
+# ifndef _ISOMAC
+
libutil_hidden_proto (openpty)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/resolv.h b/include/resolv.h
index 4c614760a8..699cc81569 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -1,17 +1,19 @@
#ifndef _RESOLV_H_
-#define RES_SET_H_ERRNO(r,x) \
+# ifndef _ISOMAC
+# include <stdbool.h>
+# define RES_SET_H_ERRNO(r,x) \
do \
{ \
(r)->res_h_errno = x; \
__set_h_errno(x); \
} \
while (0)
+# endif
-#include <stdbool.h>
#include <resolv/resolv.h>
-#ifdef _RESOLV_H_
+# if defined _RESOLV_H_ && !defined _ISOMAC
# if IS_IN (libc)
# define __resp __libc_resp
@@ -29,16 +31,14 @@ extern struct hostent *_gethtent (void);
extern struct hostent *_gethtbyname (const char *__name);
extern struct hostent *_gethtbyname2 (const char *__name, int __af);
struct hostent *_gethtbyaddr (const char *addr, size_t __len, int __af);
-extern u_int32_t _getlong (const u_char *__src);
-extern u_int16_t _getshort (const u_char *__src);
-extern void res_pquery (const res_state __statp, const u_char *__msg,
+extern uint32_t _getlong (const unsigned char *__src);
+extern uint16_t _getshort (const unsigned char *__src);
+extern void res_pquery (const res_state __statp, const unsigned char *__msg,
int __len, FILE *__file);
-extern void res_send_setqhook (res_send_qhook __hook);
-extern void res_send_setrhook (res_send_rhook __hook);
extern int res_ourserver_p (const res_state __statp,
const struct sockaddr_in6 *__inp);
extern void __res_iclose (res_state statp, bool free_addr);
-extern int __res_nopt(res_state statp, int n0, u_char *buf, int buflen,
+extern int __res_nopt(res_state statp, int n0, unsigned char *buf, int buflen,
int anslen);
libc_hidden_proto (__res_ninit)
libc_hidden_proto (__res_maybe_init)
@@ -47,12 +47,16 @@ libc_hidden_proto (__res_iclose)
libc_hidden_proto (__res_randomid)
libc_hidden_proto (__res_state)
-int __libc_res_nquery (res_state, const char *, int, int, u_char *, int,
- u_char **, u_char **, int *, int *, int *);
-int __libc_res_nsearch (res_state, const char *, int, int, u_char *, int,
- u_char **, u_char **, int *, int *, int *);
-int __libc_res_nsend (res_state, const u_char *, int, const u_char *, int,
- u_char *, int, u_char **, u_char **, int *, int *, int *)
+int __libc_res_nquery (res_state, const char *, int, int,
+ unsigned char *, int, unsigned char **,
+ unsigned char **, int *, int *, int *);
+int __libc_res_nsearch (res_state, const char *, int, int,
+ unsigned char *, int, unsigned char **,
+ unsigned char **, int *, int *, int *);
+int __libc_res_nsend (res_state, const unsigned char *, int,
+ const unsigned char *, int, unsigned char *,
+ int, unsigned char **, unsigned char **,
+ int *, int *, int *)
attribute_hidden;
libresolv_hidden_proto (_sethtent)
@@ -95,6 +99,5 @@ libresolv_hidden_proto (__p_secstodate)
extern const char *_res_opcodes[];
libresolv_hidden_proto (_res_opcodes)
-#endif
-
+# endif /* _RESOLV_H_ && !_ISOMAC */
#endif
diff --git a/include/rpc/auth.h b/include/rpc/auth.h
index 0219fd9316..2e55cce11d 100644
--- a/include/rpc/auth.h
+++ b/include/rpc/auth.h
@@ -1,6 +1,8 @@
#ifndef _RPC_AUTH_H
#include <sunrpc/rpc/auth.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (getnetname)
libc_hidden_proto (netname2user)
libc_hidden_proto (host2netname)
@@ -41,4 +43,5 @@ libc_hidden_proto (key_setnet)
libc_hidden_proto (key_setsecret)
libc_hidden_proto (netname2host)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/auth_des.h b/include/rpc/auth_des.h
index 0e9db1a226..6afed56b71 100644
--- a/include/rpc/auth_des.h
+++ b/include/rpc/auth_des.h
@@ -2,6 +2,8 @@
#include <sunrpc/rpc/auth_des.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (getpublickey)
libc_hidden_proto (getsecretkey)
libc_hidden_proto (rtime)
@@ -32,4 +34,5 @@ libc_hidden_proto (authdes_getucred)
libc_hidden_proto (xdr_authdes_cred)
libc_hidden_proto (xdr_authdes_verf)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/auth_unix.h b/include/rpc/auth_unix.h
index 07031c9bd9..019efa275a 100644
--- a/include/rpc/auth_unix.h
+++ b/include/rpc/auth_unix.h
@@ -1,3 +1,9 @@
+#ifndef _RPC_AUTH_UNIX_H
#include <sunrpc/rpc/auth_unix.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (xdr_authunix_parms)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/auth_unix.h */
diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h
index d79a6a7b5b..a397023a93 100644
--- a/include/rpc/clnt.h
+++ b/include/rpc/clnt.h
@@ -1,6 +1,8 @@
#ifndef _RPC_CLNT_H
#include <sunrpc/rpc/clnt.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern int _openchild (const char *command, FILE **fto, FILE **ffrom);
@@ -27,4 +29,5 @@ libc_hidden_proto (get_myaddress)
libc_hidden_proto (clntunix_create)
libc_hidden_proto (__libc_clntudp_bufcreate)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/des_crypt.h b/include/rpc/des_crypt.h
index 44f7e669b0..7a34957df8 100644
--- a/include/rpc/des_crypt.h
+++ b/include/rpc/des_crypt.h
@@ -1,6 +1,8 @@
#ifndef __DES_CRYPT_H__
#include <sunrpc/rpc/des_crypt.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern int xencrypt (char *secret, char *passwd);
@@ -12,4 +14,5 @@ libc_hidden_proto (cbc_crypt)
libc_hidden_proto (xencrypt)
libc_hidden_proto (xdecrypt)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/key_prot.h b/include/rpc/key_prot.h
index 29d14cc8a0..4711a94edf 100644
--- a/include/rpc/key_prot.h
+++ b/include/rpc/key_prot.h
@@ -1,5 +1,8 @@
+#ifndef _KEY_PROT_H_RPCGEN
#include <sunrpc/rpc/key_prot.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (xdr_cryptkeyarg)
libc_hidden_proto (xdr_cryptkeyarg2)
libc_hidden_proto (xdr_cryptkeyres)
@@ -10,3 +13,6 @@ libc_hidden_proto (xdr_keystatus)
libc_hidden_proto (xdr_getcredres)
libc_hidden_proto (xdr_netnamestr)
libc_hidden_proto (xdr_unixcred)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/key_prot.h */
diff --git a/include/rpc/netdb.h b/include/rpc/netdb.h
index 65af237e50..9b84668be7 100644
--- a/include/rpc/netdb.h
+++ b/include/rpc/netdb.h
@@ -1,6 +1,8 @@
#ifndef _RPC_NETDB_H
#include <sunrpc/rpc/netdb.h>
+# ifndef _ISOMAC
+
extern int __getrpcbyname_r (const char *__name, struct rpcent *__result_buf,
char *__buffer, size_t __buflen,
struct rpcent **__result);
@@ -48,4 +50,5 @@ DECLARE_NSS_PROTOTYPES (nisplus)
#undef DECLARE_NSS_PROTOTYPES
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/pmap_clnt.h b/include/rpc/pmap_clnt.h
index 67628e0589..ec907c28cc 100644
--- a/include/rpc/pmap_clnt.h
+++ b/include/rpc/pmap_clnt.h
@@ -1,5 +1,7 @@
#ifndef _RPC_PMAP_CLNT_H
-# include <sunrpc/rpc/pmap_clnt.h>
+#include <sunrpc/rpc/pmap_clnt.h>
+
+# ifndef _ISOMAC
libc_hidden_proto (pmap_getport)
libc_hidden_proto (pmap_set)
@@ -18,4 +20,5 @@ libc_hidden_proto (clnt_broadcast)
libc_hidden_proto (pmap_getmaps)
libc_hidden_proto (pmap_rmtcall)
-#endif
+# endif /* !_ISOMAC */
+#endif /* rpc/pmap_clnt.h */
diff --git a/include/rpc/pmap_prot.h b/include/rpc/pmap_prot.h
index 2e9076ee3d..a2573d106f 100644
--- a/include/rpc/pmap_prot.h
+++ b/include/rpc/pmap_prot.h
@@ -1,4 +1,10 @@
+#ifndef _RPC_PMAP_PROT_H
#include <sunrpc/rpc/pmap_prot.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (xdr_pmap)
libc_hidden_proto (xdr_pmaplist)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/pmap_prot.h */
diff --git a/include/rpc/pmap_rmt.h b/include/rpc/pmap_rmt.h
index e8822dabe9..ae53a02652 100644
--- a/include/rpc/pmap_rmt.h
+++ b/include/rpc/pmap_rmt.h
@@ -1,4 +1,10 @@
+#ifndef _RPC_PMAP_RMT_H
#include <sunrpc/rpc/pmap_rmt.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (xdr_rmtcall_args)
libc_hidden_proto (xdr_rmtcallres)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/pmap_rmt.h */
diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
index 58bdef3cc9..4c9ee82617 100644
--- a/include/rpc/rpc.h
+++ b/include/rpc/rpc.h
@@ -1,5 +1,8 @@
#ifndef _RPC_RPC_H
#include <sunrpc/rpc/rpc.h>
+
+# ifndef _ISOMAC
+
#include <libc-tsd.h>
/* Now define the internal interfaces. */
@@ -56,4 +59,5 @@ libc_hidden_proto (__rpc_thread_createerr)
#endif /* _RPC_THREAD_SAFE_ */
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/rpc_msg.h b/include/rpc/rpc_msg.h
index be1f4838c9..93c5ab8764 100644
--- a/include/rpc/rpc_msg.h
+++ b/include/rpc/rpc_msg.h
@@ -1,6 +1,8 @@
#ifndef _RPC_MSG_H
#include <sunrpc/rpc/rpc_msg.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (_seterr_reply)
/* Now define the internal interfaces. */
@@ -14,4 +16,5 @@ libc_hidden_proto (xdr_callmsg)
libc_hidden_proto (xdr_rejected_reply)
libc_hidden_proto (xdr_replymsg)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/svc.h b/include/rpc/svc.h
index 61a8ab3503..465bf4427d 100644
--- a/include/rpc/svc.h
+++ b/include/rpc/svc.h
@@ -1,6 +1,8 @@
#ifndef _RPC_SVC_H
#include <sunrpc/rpc/svc.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (xprt_register)
libc_hidden_proto (xprt_unregister)
libc_hidden_proto (svc_register)
@@ -37,4 +39,5 @@ libc_hidden_proto (svc_getreq_poll)
extern void __svc_accept_failed (void) attribute_hidden;
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/svc_auth.h b/include/rpc/svc_auth.h
index 582bb31aea..2609d19544 100644
--- a/include/rpc/svc_auth.h
+++ b/include/rpc/svc_auth.h
@@ -1,6 +1,8 @@
#ifndef _RPC_SVC_AUTH_H
#include <sunrpc/rpc/svc_auth.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern enum auth_stat _svcauth_unix (struct svc_req *rqst,
struct rpc_msg *msg);
@@ -9,4 +11,5 @@ extern enum auth_stat _svcauth_short (struct svc_req *rqst,
libc_hidden_proto (_authenticate)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 57971d0758..e1bff1cd1c 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -1,5 +1,8 @@
+#ifndef _RPC_XDR_H
#include <sunrpc/rpc/xdr.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (xdrstdio_create)
libc_hidden_proto (xdr_array)
libc_hidden_proto (xdr_bool)
@@ -45,3 +48,6 @@ libc_hidden_proto (xdr_int64_t)
libc_hidden_proto (xdr_uint64_t)
libc_hidden_proto (xdr_quad_t)
libc_hidden_proto (xdr_u_quad_t)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/xdr.h */
diff --git a/include/rpcsvc/nis_callback.h b/include/rpcsvc/nis_callback.h
index dfa9cd3ef7..0515d07887 100644
--- a/include/rpcsvc/nis_callback.h
+++ b/include/rpcsvc/nis_callback.h
@@ -1,7 +1,10 @@
#ifndef _RPCSVC_NIS_CALLBACK_H
#include <nis/rpcsvc/nis_callback.h>
+# ifndef _ISOMAC
+
libnsl_hidden_proto (xdr_obj_p)
libnsl_hidden_proto (xdr_cback_data)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpcsvc/nislib.h b/include/rpcsvc/nislib.h
index 635c513e4d..05b19877e7 100644
--- a/include/rpcsvc/nislib.h
+++ b/include/rpcsvc/nislib.h
@@ -1,6 +1,8 @@
#ifndef __RPCSVC_NISLIB_H__
#include <nis/rpcsvc/nislib.h>
+# ifndef _ISOMAC
+
libnsl_hidden_proto (nis_leaf_of_r)
libnsl_hidden_proto (nis_name_of_r)
libnsl_hidden_proto (nis_getnames)
@@ -44,4 +46,5 @@ libnsl_hidden_proto (nis_clone_object)
extern const_nis_name __nis_domain_of (const_nis_name) __THROW;
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpcsvc/yp.h b/include/rpcsvc/yp.h
index 04a973eae7..b6d7c15f62 100644
--- a/include/rpcsvc/yp.h
+++ b/include/rpcsvc/yp.h
@@ -1,6 +1,8 @@
#ifndef __RPCSVC_YP_H__
#include <nis/rpcsvc/yp.h>
+# ifndef _ISOMAC
+
libnsl_hidden_proto (xdr_ypstat)
libnsl_hidden_proto (xdr_ypxfrstat)
libnsl_hidden_proto (xdr_domainname)
@@ -23,4 +25,5 @@ libnsl_hidden_proto (xdr_ypresp_order)
libnsl_hidden_proto (xdr_ypbind_resp)
libnsl_hidden_proto (xdr_ypresp_master)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpcsvc/ypclnt.h b/include/rpcsvc/ypclnt.h
index b38dc6bb4c..1b4e2f215c 100644
--- a/include/rpcsvc/ypclnt.h
+++ b/include/rpcsvc/ypclnt.h
@@ -1,10 +1,13 @@
#ifndef __RPCSVC_YPCLNT_H__
#include <nis/rpcsvc/ypclnt.h>
+# ifndef _ISOMAC
+
libnsl_hidden_proto (ypbinderr_string)
libnsl_hidden_proto (yp_bind)
libnsl_hidden_proto (yp_get_default_domain)
libnsl_hidden_proto (ypprot_err)
libnsl_hidden_proto (yp_master)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/rpcsvc/ypupd.h b/include/rpcsvc/ypupd.h
index 7601971512..6d179dd306 100644
--- a/include/rpcsvc/ypupd.h
+++ b/include/rpcsvc/ypupd.h
@@ -1,8 +1,11 @@
#ifndef __RPCSVC_YPUPD_H__
#include <nis/rpcsvc/ypupd.h>
+# ifndef _ISOMAC
+
libnsl_hidden_proto (xdr_yp_buf)
libnsl_hidden_proto (xdr_ypdelete_args)
libnsl_hidden_proto (xdr_ypupdate_args)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/shadow.h b/include/shadow.h
index a3f897cba1..124a1ab50a 100644
--- a/include/shadow.h
+++ b/include/shadow.h
@@ -1,6 +1,8 @@
#ifndef _SHADOW_H
#include <shadow/shadow.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern int __getspent_r (struct spwd *__result_buf, char *__buffer,
size_t __buflen, struct spwd **__result)
@@ -47,4 +49,5 @@ DECLARE_NSS_PROTOTYPES (nisplus)
#undef DECLARE_NSS_PROTOTYPES
+# endif /* !_ISOMAC */
#endif
diff --git a/include/stdio_ext.h b/include/stdio_ext.h
index 354146f8e8..29c6e68cdb 100644
--- a/include/stdio_ext.h
+++ b/include/stdio_ext.h
@@ -1,6 +1,7 @@
#ifndef _STDIO_EXT_H
+#include <stdio-common/stdio_ext.h>
-# include <stdio-common/stdio_ext.h>
+# ifndef _ISOMAC
libc_hidden_proto (__fsetlocking)
@@ -18,5 +19,5 @@ libc_hidden_proto (__fsetlocking)
__result; \
})
-
-#endif
+# endif /* !_ISOMAC */
+#endif /* stdio_ext.h */
diff --git a/include/sys/epoll.h b/include/sys/epoll.h
index ce1c2e26d5..86e0a54e62 100644
--- a/include/sys/epoll.h
+++ b/include/sys/epoll.h
@@ -1,6 +1,9 @@
#ifndef _SYS_EPOLL_H
#include_next <sys/epoll.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (epoll_pwait)
+# endif /* !_ISOMAC */
#endif
diff --git a/include/sys/file.h b/include/sys/file.h
index e73a4d1c94..d0cd1f9e15 100644
--- a/include/sys/file.h
+++ b/include/sys/file.h
@@ -1,6 +1,10 @@
#ifndef _SYS_FILE_H
#include <misc/sys/file.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern int __flock (int __fd, int __operation);
+
+# endif /* !_ISOMAC */
#endif
diff --git a/include/sys/gmon.h b/include/sys/gmon.h
index 55739cf00c..30889d8bc3 100644
--- a/include/sys/gmon.h
+++ b/include/sys/gmon.h
@@ -1,6 +1,8 @@
#ifndef _SYS_GMON_H
#include <gmon/sys/gmon.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
/* Write current profiling data to file. */
@@ -12,4 +14,6 @@ extern void __bb_init_func (struct __bb *bb);
extern void __bb_exit_func (void);
extern struct gmonparam _gmonparam attribute_hidden;
+
+# endif /* !_ISOMAC */
#endif
diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h
index ebadd526b9..bfc6909dbc 100644
--- a/include/sys/ioctl.h
+++ b/include/sys/ioctl.h
@@ -1,6 +1,10 @@
#ifndef _SYS_IOCTL_H
#include <misc/sys/ioctl.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern int __ioctl (int __fd, unsigned long int __request, ...);
+
+# endif /* !_ISOMAC */
#endif
diff --git a/include/sys/prctl.h b/include/sys/prctl.h
index 316f454c1c..0920ed642b 100644
--- a/include/sys/prctl.h
+++ b/include/sys/prctl.h
@@ -1,6 +1,9 @@
#ifndef _SYS_PRCTL_H
#include_next <sys/prctl.h>
+# ifndef _ISOMAC
+
extern int __prctl (int __option, ...);
+# endif /* !_ISOMAC */
#endif
diff --git a/include/sys/profil.h b/include/sys/profil.h
index 7bf17003ad..2b1133073e 100644
--- a/include/sys/profil.h
+++ b/include/sys/profil.h
@@ -1,9 +1,12 @@
#ifndef _PROFIL_H
#include <gmon/sys/profil.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern int __sprofil (struct prof *__profp, int __profcnt,
struct timeval *__tvp, unsigned int __flags);
+# endif /* !_ISOMAC */
#endif /* _PROFIL_H */
diff --git a/include/sys/statfs.h b/include/sys/statfs.h
index e34ad02965..3fac4a3490 100644
--- a/include/sys/statfs.h
+++ b/include/sys/statfs.h
@@ -1,10 +1,14 @@
#ifndef _SYS_STATFS_H
#include <io/sys/statfs.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern int __statfs (const char *__file, struct statfs *__buf);
libc_hidden_proto (__statfs)
extern int __fstatfs (int __fildes, struct statfs *__buf);
extern int __statfs64 (const char *__file, struct statfs64 *__buf);
extern int __fstatfs64 (int __fildes, struct statfs64 *__buf);
+
+# endif /* !_ISOMAC */
#endif
diff --git a/include/sys/sysctl.h b/include/sys/sysctl.h
index 4fffb4ff49..2a15e91354 100644
--- a/include/sys/sysctl.h
+++ b/include/sys/sysctl.h
@@ -1,10 +1,13 @@
#ifndef _SYS_SYSCTL_H
#include_next <sys/sysctl.h>
+# ifndef _ISOMAC
+
/* Read or write system parameters (Linux, FreeBSD specific). */
extern int __sysctl (int *__name, int __nlen, void *__oldval,
size_t *__oldlenp, void *__newval, size_t __newlen);
libc_hidden_proto (__sysctl)
+# endif /* !_ISOMAC */
#endif /* _SYS_SYSCTL_H */
diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h
index d33055a2b3..c33eae2883 100644
--- a/include/sys/sysinfo.h
+++ b/include/sys/sysinfo.h
@@ -1,6 +1,8 @@
#ifndef _SYS_SYSINFO_H
#include_next <sys/sysinfo.h>
+# ifndef _ISOMAC
+
/* Now we define the internal interface. */
/* Return number of configured processors. */
@@ -18,4 +20,5 @@ extern long int __get_avphys_pages (void);
/* Return maximum number of processes this real user ID can have. */
extern long int __get_child_max (void);
+# endif /* !_ISOMAC */
#endif /* sys/sysinfo.h */
diff --git a/include/time.h b/include/time.h
index 8dd10dcdd8..684ceb812f 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,8 +1,7 @@
#ifndef _TIME_H
-#if defined __need_time_t || defined __need_clock_t || defined __need_timespec || defined _ISOMAC
-# include <time/time.h>
-#else
-# include <time/time.h>
+#include <time/time.h>
+
+#ifndef _ISOMAC
# include <xlocale.h>
__BEGIN_DECLS
diff --git a/include/ttyent.h b/include/ttyent.h
index 81e52116e5..53a66681d2 100644
--- a/include/ttyent.h
+++ b/include/ttyent.h
@@ -1,5 +1,7 @@
#ifndef _TTYENT_H
-# include <misc/ttyent.h>
+#include <misc/ttyent.h>
+
+# ifndef _ISOMAC
extern __typeof (getttyent) __getttyent __THROW;
libc_hidden_proto (__getttyent)
@@ -8,4 +10,5 @@ libc_hidden_proto (__setttyent)
extern __typeof (endttyent) __endttyent __THROW;
libc_hidden_proto (__endttyent)
-#endif
+# endif /* !_ISOMAC */
+#endif /* ttyent.h */
diff --git a/include/utmp.h b/include/utmp.h
index 28207d1282..6b2e262362 100644
--- a/include/utmp.h
+++ b/include/utmp.h
@@ -1,6 +1,8 @@
#ifndef _UTMP_H
#include <login/utmp.h>
+# ifndef _ISOMAC
+
/* Now define the internal interfaces. */
extern void __updwtmp (const char *__wtmp_file, const struct utmp *__utmp);
extern int __utmpname (const char *__file);
@@ -18,4 +20,5 @@ extern int __getutline_r (const struct utmp *__line,
libutil_hidden_proto (login_tty)
+# endif /* !_ISOMAC */
#endif
diff --git a/inet/Makefile b/inet/Makefile
index 2207b93977..1c30932997 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -44,13 +44,15 @@ routines := htonl htons \
getaliasent_r getaliasent getaliasname getaliasname_r \
in6_addr getnameinfo if_index ifaddrs inet6_option \
getipv4sourcefilter setipv4sourcefilter \
- getsourcefilter setsourcefilter inet6_opt inet6_rth
+ getsourcefilter setsourcefilter inet6_opt inet6_rth \
+ inet6_scopeid_pton
aux := check_pf check_native ifreq
tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
- tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-sockaddr
+ tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-sockaddr \
+ tst-inet6_scopeid_pton
include ../Rules
diff --git a/inet/Versions b/inet/Versions
index 56eb274634..6f663f3648 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -85,5 +85,8 @@ libc {
# functions used in other libraries
__internal_endnetgrent; __internal_getnetgrent_r;
__internal_setnetgrent;
+
+ # Used from nscd.
+ __inet6_scopeid_pton;
}
}
diff --git a/inet/inet6_scopeid_pton.c b/inet/inet6_scopeid_pton.c
new file mode 100644
index 0000000000..aa37392771
--- /dev/null
+++ b/inet/inet6_scopeid_pton.c
@@ -0,0 +1,63 @@
+/* Convert an IPv6 scope ID from text to the internal representation.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <net-internal.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <locale.h>
+#include <net/if.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+/* Parse SOURCE as a scope ID for ADDRESS. Return 0 on success and -1
+ on error. */
+internal_function int
+__inet6_scopeid_pton (const struct in6_addr *address, const char *scope,
+ uint32_t *result)
+{
+ if (IN6_IS_ADDR_LINKLOCAL (address)
+ || IN6_IS_ADDR_MC_LINKLOCAL (address))
+ {
+ uint32_t number = __if_nametoindex (scope);
+ if (number != 0)
+ {
+ *result = number;
+ return 0;
+ }
+ }
+
+ if (isdigit_l (scope[0], _nl_C_locobj_ptr))
+ {
+ char *end;
+ unsigned long long number
+ = ____strtoull_l_internal (scope, &end, /*base */ 10, /* group */ 0,
+ _nl_C_locobj_ptr);
+ if (*end == '\0' && number <= UINT32_MAX)
+ {
+ *result = number;
+ return 0;
+ }
+ }
+
+ __set_errno (EINVAL);
+ return -1;
+}
+
+libc_hidden_def (__inet6_scopeid_pton)
diff --git a/sysdeps/hppa/math_private.h b/inet/net-internal.h
index 1acfb9ae4a..961d1f715b 100644
--- a/sysdeps/hppa/math_private.h
+++ b/inet/net-internal.h
@@ -1,5 +1,5 @@
-/* Internal math stuff. HPPA version.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Network-related functions for internal library use.
+ Copyright (C) 2016 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,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef HPPA_MATH_PRIVATE_H
-#define HPPA_MATH_PRIVATE_H 1
+#ifndef _NET_INTERNAL_H
+#define _NET_INTERNAL_H 1
-/* One of the few architectures where the meaning of the quiet/signaling bit is
- inverse to IEEE 754-2008 (as well as common practice for IEEE 754-1985). */
-#define HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#include <arpa/inet.h>
+#include <stdint.h>
-#include_next <math_private.h>
+int __inet6_scopeid_pton (const struct in6_addr *address,
+ const char *scope, uint32_t *result)
+ internal_function attribute_hidden;
+libc_hidden_proto (__inet6_scopeid_pton)
-#endif
+#endif /* _NET_INTERNAL_H */
diff --git a/inet/netinet/ether.h b/inet/netinet/ether.h
index 3dff523b2f..0952b23f97 100644
--- a/inet/netinet/ether.h
+++ b/inet/netinet/ether.h
@@ -24,6 +24,7 @@
/* Get definition of `struct ether_addr'. */
#include <netinet/if_ether.h>
+#ifdef __USE_MISC
__BEGIN_DECLS
/* Convert 48 bit Ethernet ADDRess to ASCII. */
@@ -49,5 +50,6 @@ extern int ether_line (const char *__line, struct ether_addr *__addr,
char *__hostname) __THROW;
__END_DECLS
+#endif /* Use misc. */
#endif /* netinet/ether.h */
diff --git a/inet/netinet/icmp6.h b/inet/netinet/icmp6.h
index b7a9637b52..89e3f8d7c5 100644
--- a/inet/netinet/icmp6.h
+++ b/inet/netinet/icmp6.h
@@ -160,11 +160,11 @@ struct nd_neighbor_advert /* neighbor advertisement */
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
#define ND_NA_FLAG_ROUTER 0x80000000
#define ND_NA_FLAG_SOLICITED 0x40000000
#define ND_NA_FLAG_OVERRIDE 0x20000000
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
#define ND_NA_FLAG_ROUTER 0x00000080
#define ND_NA_FLAG_SOLICITED 0x00000040
#define ND_NA_FLAG_OVERRIDE 0x00000020
@@ -298,10 +298,10 @@ struct rr_pco_use /* use prefix part */
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
-#elif BYTE_ORDER == LITTLE_ENDIAN
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
#endif
@@ -315,10 +315,10 @@ struct rr_result /* router renumbering result message */
struct in6_addr rrr_prefix;
};
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
-#elif BYTE_ORDER == LITTLE_ENDIAN
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
#endif
diff --git a/inet/netinet/igmp.h b/inet/netinet/igmp.h
index fc7599e5e8..ffbebc7caf 100644
--- a/inet/netinet/igmp.h
+++ b/inet/netinet/igmp.h
@@ -64,10 +64,10 @@ __BEGIN_DECLS
*/
struct igmp {
- u_int8_t igmp_type; /* IGMP type */
- u_int8_t igmp_code; /* routing code */
- u_int16_t igmp_cksum; /* checksum */
- struct in_addr igmp_group; /* group address */
+ uint8_t igmp_type; /* IGMP type */
+ uint8_t igmp_code; /* routing code */
+ uint16_t igmp_cksum; /* checksum */
+ struct in_addr igmp_group; /* group address */
};
#define IGMP_MINLEN 8
diff --git a/inet/netinet/ip6.h b/inet/netinet/ip6.h
index 929d4b5dc0..bd02c94d09 100644
--- a/inet/netinet/ip6.h
+++ b/inet/netinet/ip6.h
@@ -101,11 +101,11 @@ struct ip6_frag
uint32_t ip6f_ident; /* identification */
};
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
# define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
# define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
# define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
# define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
# define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
@@ -175,11 +175,11 @@ struct ip6_opt_router
};
/* Router alert values (in network byte order) */
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define IP6_ALERT_MLD 0x0000
# define IP6_ALERT_RSVP 0x0001
# define IP6_ALERT_AN 0x0002
-#else /* BYTE_ORDER == LITTLE_ENDING */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
# define IP6_ALERT_MLD 0x0000
# define IP6_ALERT_RSVP 0x0100
# define IP6_ALERT_AN 0x0200
diff --git a/inet/protocols/routed.h b/inet/protocols/routed.h
index befd8654d7..adb1767dca 100644
--- a/inet/protocols/routed.h
+++ b/inet/protocols/routed.h
@@ -48,9 +48,9 @@ struct netinfo {
};
struct rip {
- u_char rip_cmd; /* request/response */
- u_char rip_vers; /* protocol version # */
- u_char rip_res1[2]; /* pad to 32-bit boundary */
+ unsigned char rip_cmd; /* request/response */
+ unsigned char rip_vers; /* protocol version # */
+ unsigned char rip_res1[2]; /* pad to 32-bit boundary */
union {
struct netinfo ru_nets[1]; /* variable length... */
char ru_tracefile[1]; /* ditto ... */
diff --git a/inet/protocols/talkd.h b/inet/protocols/talkd.h
index a8f33b1bab..09bd8a90ba 100644
--- a/inet/protocols/talkd.h
+++ b/inet/protocols/talkd.h
@@ -52,16 +52,18 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <stdint.h>
+#include <bits/types/struct_osockaddr.h>
/*
* Client->server request message format.
*/
typedef struct {
- u_char vers; /* protocol version */
- u_char type; /* request type, see below */
- u_char answer; /* not used */
- u_char pad;
- u_int32_t id_num; /* message id */
+ unsigned char vers; /* protocol version */
+ unsigned char type; /* request type, see below */
+ unsigned char answer; /* not used */
+ unsigned char pad;
+ uint32_t id_num; /* message id */
struct osockaddr addr; /* old (4.3) style */
struct osockaddr ctl_addr; /* old (4.3) style */
int32_t pid; /* caller's process id */
@@ -76,11 +78,11 @@ typedef struct {
* Server->client response message format.
*/
typedef struct {
- u_char vers; /* protocol version */
- u_char type; /* type of request message, see below */
- u_char answer; /* response to request message, see below */
- u_char pad;
- u_int32_t id_num; /* message id */
+ unsigned char vers; /* protocol version */
+ unsigned char type; /* type of request message, see below */
+ unsigned char answer; /* response to request message, see below */
+ unsigned char pad;
+ uint32_t id_num; /* message id */
struct osockaddr addr; /* address for establishing conversation */
} CTL_RESPONSE;
diff --git a/inet/protocols/timed.h b/inet/protocols/timed.h
index b5d4702ff3..cabdce44a6 100644
--- a/inet/protocols/timed.h
+++ b/inet/protocols/timed.h
@@ -44,9 +44,9 @@
#define MAXHOSTNAMELEN 64
struct tsp {
- u_char tsp_type;
- u_char tsp_vers;
- u_short tsp_seq;
+ unsigned char tsp_type;
+ unsigned char tsp_vers;
+ unsigned short tsp_seq;
union {
struct timeval tspu_time;
char tspu_hopcnt;
diff --git a/inet/tst-inet6_scopeid_pton.c b/inet/tst-inet6_scopeid_pton.c
new file mode 100644
index 0000000000..f9f541e30a
--- /dev/null
+++ b/inet/tst-inet6_scopeid_pton.c
@@ -0,0 +1,131 @@
+/* Tests for __inet6_scopeid_pton.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <arpa/inet.h>
+#include <inttypes.h>
+#include <net-internal.h>
+#include <net/if.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* An interface which is known to the system. */
+static const char *interface_name;
+static uint32_t interface_index;
+
+/* Initiale the variables above. */
+static void
+setup_interface (void)
+{
+ struct if_nameindex *list = if_nameindex ();
+ if (list != NULL && list[0].if_index != 0 && list[0].if_name[0] != '\0')
+ {
+ interface_name = list[0].if_name;
+ interface_index = list[0].if_index;
+ }
+}
+
+/* Convert ADDRESS to struct in6_addr. */
+static struct in6_addr
+from_string (const char *address)
+{
+ struct in6_addr addr;
+ if (inet_pton (AF_INET6, address, &addr) != 1)
+ {
+ printf ("error: inet_pton (\"%s\") failed\n", address);
+ exit (1);
+ }
+ return addr;
+}
+
+/* Check a single address were we expected a failure. */
+static void
+expect_failure (const char *address, const char *scope)
+{
+ struct in6_addr addr = from_string (address);
+ uint32_t result = 1234;
+ if (__inet6_scopeid_pton (&addr, scope, &result) == 0)
+ {
+ printf ("error: unexpected success for %s%%%s\n",
+ address, scope);
+ exit (1);
+ }
+ if (result != 1234)
+ {
+ printf ("error: unexpected result update for %s%%%s\n",
+ address, scope);
+ exit (1);
+ }
+}
+
+/* Check a single address were we expected a success. */
+static void
+expect_success (const char *address, const char *scope, uint32_t expected)
+{
+ struct in6_addr addr = from_string (address);
+ uint32_t actual = expected + 1;
+ if (__inet6_scopeid_pton (&addr, scope, &actual) != 0)
+ {
+ printf ("error: unexpected failure for %s%%%s\n",
+ address, scope);
+ exit (1);
+ }
+ if (actual != expected)
+ {
+ printf ("error: unexpected result for for %s%%%s\n",
+ address, scope);
+ printf (" expected: %" PRIu32 "\n", expected);
+ printf (" actual: %" PRIu32 "\n", actual);
+ exit (1);
+ }
+}
+
+static int
+do_test (void)
+{
+ setup_interface ();
+
+ static const char *test_addresses[]
+ = { "::", "::1", "2001:db8::1", NULL };
+ for (int i = 0; test_addresses[i] != NULL; ++i)
+ {
+ expect_success (test_addresses[i], "0", 0);
+ expect_success (test_addresses[i], "5555", 5555);
+
+ expect_failure (test_addresses[i], "");
+ expect_failure (test_addresses[i], "-1");
+ expect_failure (test_addresses[i], "-99");
+ expect_failure (test_addresses[i], "037777777777");
+ expect_failure (test_addresses[i], "0x");
+ expect_failure (test_addresses[i], "0x1");
+ }
+
+ if (interface_name != NULL)
+ {
+ expect_success ("fe80::1", interface_name, interface_index);
+ expect_success ("ff02::1", interface_name, interface_index);
+ expect_failure ("::", interface_name);
+ expect_failure ("::1", interface_name);
+ expect_failure ("ff01::1", interface_name);
+ expect_failure ("2001:db8::1", interface_name);
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 3d38de99e7..dd0db4e6b2 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -187,7 +187,7 @@ static void *mempcpy (void *dest, const void *src, size_t n);
#endif
#if !defined PATH_MAX && defined _PC_PATH_MAX
-# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+# define PATH_MAX (__pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : __pathconf ("/", _PC_PATH_MAX))
#endif
/* Don't include sys/param.h if it already has been. */
diff --git a/io/Makefile b/io/Makefile
index deb6100156..e5493b3266 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -71,7 +71,8 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \
tst-renameat tst-fchownat tst-fchmodat tst-faccessat \
tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \
tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \
- tst-posix_fallocate tst-fts tst-fts-lfs
+ tst-posix_fallocate tst-posix_fallocate64 \
+ tst-fts tst-fts-lfs tst-open-tmpfile
ifeq ($(run-built-tests),yes)
tests-special += $(objpfx)ftwtest.out
diff --git a/io/fcntl.h b/io/fcntl.h
index cb706b4f0f..12099a2181 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -72,8 +72,7 @@ typedef __pid_t pid_t;
/* For XPG all symbols from <sys/stat.h> should also be available. */
#ifdef __USE_XOPEN2K8
-# define __need_timespec
-# include <time.h>
+# include <bits/types/struct_timespec.h>
#endif
#if defined __USE_XOPEN || defined __USE_XOPEN2K8
# include <bits/stat.h>
diff --git a/io/fts.h b/io/fts.h
index 127a0d2721..607e8b12d6 100644
--- a/io/fts.h
+++ b/io/fts.h
@@ -105,8 +105,8 @@ typedef struct _ftsent {
char *fts_path; /* root path */
int fts_errno; /* errno for this node */
int fts_symfd; /* fd for symlink */
- u_short fts_pathlen; /* strlen(fts_path) */
- u_short fts_namelen; /* strlen(fts_name) */
+ unsigned short fts_pathlen; /* strlen(fts_path) */
+ unsigned short fts_namelen; /* strlen(fts_name) */
ino_t fts_ino; /* inode */
dev_t fts_dev; /* device */
@@ -130,17 +130,17 @@ typedef struct _ftsent {
#define FTS_SL 12 /* symbolic link */
#define FTS_SLNONE 13 /* symbolic link without target */
#define FTS_W 14 /* whiteout object */
- u_short fts_info; /* user flags for FTSENT structure */
+ unsigned short fts_info; /* user flags for FTSENT structure */
#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
- u_short fts_flags; /* private flags for FTSENT structure */
+ unsigned short fts_flags; /* private flags for FTSENT structure */
#define FTS_AGAIN 1 /* read node again */
#define FTS_FOLLOW 2 /* follow symbolic link */
#define FTS_NOINSTR 3 /* no instructions */
#define FTS_SKIP 4 /* discard node */
- u_short fts_instr; /* fts_set() instructions */
+ unsigned short fts_instr; /* fts_set() instructions */
struct stat *fts_statp; /* stat(2) information */
char fts_name[1]; /* file name */
@@ -157,8 +157,8 @@ typedef struct _ftsent64 {
char *fts_path; /* root path */
int fts_errno; /* errno for this node */
int fts_symfd; /* fd for symlink */
- u_short fts_pathlen; /* strlen(fts_path) */
- u_short fts_namelen; /* strlen(fts_name) */
+ unsigned short fts_pathlen; /* strlen(fts_path) */
+ unsigned short fts_namelen; /* strlen(fts_name) */
ino64_t fts_ino; /* inode */
dev_t fts_dev; /* device */
@@ -166,11 +166,11 @@ typedef struct _ftsent64 {
short fts_level; /* depth (-1 to N) */
- u_short fts_info; /* user flags for FTSENT structure */
+ unsigned short fts_info; /* user flags for FTSENT structure */
- u_short fts_flags; /* private flags for FTSENT structure */
+ unsigned short fts_flags; /* private flags for FTSENT structure */
- u_short fts_instr; /* fts_set() instructions */
+ unsigned short fts_instr; /* fts_set() instructions */
struct stat64 *fts_statp; /* stat(2) information */
char fts_name[1]; /* file name */
diff --git a/io/sys/poll.h b/io/sys/poll.h
index e751860acd..58498b0187 100644
--- a/io/sys/poll.h
+++ b/io/sys/poll.h
@@ -27,8 +27,7 @@
/* Get the __sigset_t definition. */
# include <bits/sigset.h>
/* Get the timespec definition. */
-# define __need_timespec
-# include <time.h>
+#include <bits/types/struct_timespec.h>
#endif
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 6925f61ae5..71462a7f62 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -26,19 +26,16 @@
#include <bits/types.h> /* For __mode_t and __dev_t. */
-#if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_ATFILE
-# if defined __USE_XOPEN || defined __USE_XOPEN2K
-# define __need_time_t
-# endif
-# ifdef __USE_ATFILE
-# define __need_timespec
-# endif
-# include <time.h> /* For time_t resp. timespec. */
+#ifdef __USE_ATFILE
+# include <bits/types/struct_timespec.h>
#endif
#if defined __USE_XOPEN || defined __USE_XOPEN2K
/* The Single Unix specification says that some more types are
available here. */
+
+# include <bits/types/time_t.h>
+
# ifndef __dev_t_defined
typedef __dev_t dev_t;
# define __dev_t_defined
diff --git a/io/tst-open-tmpfile.c b/io/tst-open-tmpfile.c
new file mode 100644
index 0000000000..9242d62392
--- /dev/null
+++ b/io/tst-open-tmpfile.c
@@ -0,0 +1,319 @@
+/* Test open and openat with O_TMPFILE.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This test verifies that open and openat work as expected, i.e. they
+ create a deleted file with the requested file mode. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+#ifdef O_TMPFILE
+typedef int (*wrapper_func) (const char *, int, mode_t);
+
+/* Error-checking wrapper for the open function, compatible with the
+ wrapper_func type. */
+static int
+wrap_open (const char *path, int flags, mode_t mode)
+{
+ int ret = open (path, flags, mode);
+ if (ret < 0)
+ {
+ printf ("error: open (\"%s\", 0x%x, 0%03o): %m\n", path, flags, mode);
+ exit (1);
+ }
+ return ret;
+}
+
+/* Error-checking wrapper for the openat function, compatible with the
+ wrapper_func type. */
+static int
+wrap_openat (const char *path, int flags, mode_t mode)
+{
+ int ret = openat (AT_FDCWD, path, flags, mode);
+ if (ret < 0)
+ {
+ printf ("error: openat (\"%s\", 0x%x, 0%03o): %m\n", path, flags, mode);
+ exit (1);
+ }
+ return ret;
+}
+
+/* Error-checking wrapper for the open64 function, compatible with the
+ wrapper_func type. */
+static int
+wrap_open64 (const char *path, int flags, mode_t mode)
+{
+ int ret = open64 (path, flags, mode);
+ if (ret < 0)
+ {
+ printf ("error: open64 (\"%s\", 0x%x, 0%03o): %m\n", path, flags, mode);
+ exit (1);
+ }
+ return ret;
+}
+
+/* Error-checking wrapper for the openat64 function, compatible with the
+ wrapper_func type. */
+static int
+wrap_openat64 (const char *path, int flags, mode_t mode)
+{
+ int ret = openat64 (AT_FDCWD, path, flags, mode);
+ if (ret < 0)
+ {
+ printf ("error: openat64 (\"%s\", 0x%x, 0%03o): %m\n", path, flags, mode);
+ exit (1);
+ }
+ return ret;
+}
+
+/* Return true if FD is flagged as deleted in /proc/self/fd, false if
+ not. */
+static bool
+is_file_deteted (int fd)
+{
+ char *proc_fd_path = xasprintf ("/proc/self/fd/%d", fd);
+ char file_path[4096];
+ ssize_t file_path_length
+ = readlink (proc_fd_path, file_path, sizeof (file_path));
+ if (file_path_length < 0)
+ {
+ printf ("error: readlink (\"%s\"): %m", proc_fd_path);
+ free (proc_fd_path);
+ exit (1);
+ }
+ free (proc_fd_path);
+ if (file_path_length == sizeof (file_path))
+ {
+ printf ("error: path in /proc resolves to overlong file name: %.*s\n",
+ (int) file_path_length, file_path);
+ exit (1);
+ }
+ const char *deleted = " (deleted)";
+ if (file_path_length < strlen (deleted))
+ {
+ printf ("error: path in /proc is too short: %.*s\n",
+ (int) file_path_length, file_path);
+ exit (1);
+ }
+ return memcmp (file_path + file_path_length - strlen (deleted),
+ deleted, strlen (deleted)) == 0;
+}
+
+/* Obtain a file name which is difficult to guess. */
+static char *
+get_random_name (void)
+{
+ unsigned long long bytes[2];
+ int random_device = open ("/dev/urandom", O_RDONLY);
+ if (random_device < 0)
+ {
+ printf ("error: open (\"/dev/urandom\"): %m\n");
+ exit (1);
+ }
+ ssize_t ret = read (random_device, bytes, sizeof (bytes));
+ if (ret < 0)
+ {
+ printf ("error: read (\"/dev/urandom\"): %m\n");
+ exit (1);
+ }
+ if (ret != sizeof (bytes))
+ {
+ printf ("error: short read from /dev/urandom: %zd\n", ret);
+ exit (1);
+ }
+ close (random_device);
+ return xasprintf ("tst-open-tmpfile-%08llx%08llx.tmp", bytes[0], bytes[1]);
+}
+
+/* Check open/openat (as specified by OP and WRAPPER) with a specific
+ PATH/FLAGS/MODE combination. */
+static void
+check_wrapper_flags_mode (const char *op, wrapper_func wrapper,
+ const char *path, int flags, mode_t mode)
+{
+ int fd = wrapper (path, flags | O_TMPFILE, mode);
+ struct stat64 st;
+ if (fstat64 (fd, &st) != 0)
+ {
+ printf ("error: fstat64: %m\n");
+ exit (1);
+ }
+
+ /* Verify that the mode was correctly processed. */
+ int actual_mode = st.st_mode & 0777;
+ if (actual_mode != mode)
+ {
+ printf ("error: unexpected mode; expected 0%03o, actual 0%03o\n",
+ mode, actual_mode);
+ exit (1);
+ }
+
+ /* Check that the file is marked as deleted in /proc. */
+ if (!is_file_deteted (fd))
+ {
+ printf ("error: path in /proc is not marked as deleted\n");
+ exit (1);
+ }
+
+ /* Check that the file can be turned into a regular file with
+ linkat. Open a file descriptor for the directory at PATH. Use
+ AT_FDCWD if PATH is ".", to exercise that functionality as
+ well. */
+ int path_fd;
+ if (strcmp (path, ".") == 0)
+ path_fd = AT_FDCWD;
+ else
+ {
+ path_fd = open (path, O_RDONLY | O_DIRECTORY);
+ if (path_fd < 0)
+ {
+ printf ("error: open (\"%s\"): %m\n", path);
+ exit (1);
+ }
+ }
+
+ /* Use a hard-to-guess name for the new directory entry. */
+ char *new_name = get_random_name ();
+
+ /* linkat does not require privileges if the path in /proc/self/fd
+ is used. */
+ char *proc_fd_path = xasprintf ("/proc/self/fd/%d", fd);
+ if (linkat (AT_FDCWD, proc_fd_path, path_fd, new_name,
+ AT_SYMLINK_FOLLOW) == 0)
+ {
+ if (unlinkat (path_fd, new_name, 0) != 0 && errno != ENOENT)
+ {
+ printf ("error: unlinkat (\"%s/%s\"): %m\n", path, new_name);
+ exit (1);
+ }
+ }
+ else
+ {
+ /* linkat failed. This is expected if O_EXCL was specified. */
+ if ((flags & O_EXCL) == 0)
+ {
+ printf ("error: linkat failed after %s (\"%s\", 0x%x, 0%03o): %m\n",
+ op, path, flags, mode);
+ exit (1);
+ }
+ }
+
+ free (proc_fd_path);
+ free (new_name);
+ if (path_fd != AT_FDCWD)
+ close (path_fd);
+ close (fd);
+}
+
+/* Check OP/WRAPPER with various flags at a specific PATH and
+ MODE. */
+static void
+check_wrapper_mode (const char *op, wrapper_func wrapper,
+ const char *path, mode_t mode)
+{
+ check_wrapper_flags_mode (op, wrapper, path, O_WRONLY, mode);
+ check_wrapper_flags_mode (op, wrapper, path, O_WRONLY | O_EXCL, mode);
+ check_wrapper_flags_mode (op, wrapper, path, O_RDWR, mode);
+ check_wrapper_flags_mode (op, wrapper, path, O_RDWR | O_EXCL, mode);
+}
+
+/* Check open/openat with varying permissions. */
+static void
+check_wrapper (const char *op, wrapper_func wrapper,
+ const char *path)
+{
+ printf ("info: testing %s at: %s\n", op, path);
+ check_wrapper_mode (op, wrapper, path, 0);
+ check_wrapper_mode (op, wrapper, path, 0640);
+ check_wrapper_mode (op, wrapper, path, 0600);
+ check_wrapper_mode (op, wrapper, path, 0755);
+ check_wrapper_mode (op, wrapper, path, 0750);
+}
+
+/* Verify that the directory at PATH supports O_TMPFILE. Exit with
+ status 77 (unsupported) if the kernel does not support O_TMPFILE.
+ Even with kernel support, not all file systems O_TMPFILE, so return
+ true if the directory supports O_TMPFILE, false if not. */
+static bool
+probe_path (const char *path)
+{
+ int fd = openat (AT_FDCWD, path, O_TMPFILE | O_RDWR, 0);
+ if (fd < 0)
+ {
+ if (errno == EISDIR)
+ /* The system does not support O_TMPFILE. */
+ {
+ printf ("info: kernel does not support O_TMPFILE\n");
+ exit (77);
+ }
+ if (errno == EOPNOTSUPP)
+ {
+ printf ("info: path does not support O_TMPFILE: %s\n", path);
+ return false;
+ }
+ printf ("error: openat (\"%s\", O_TMPFILE | O_RDWR): %m\n", path);
+ exit (1);
+ }
+ close (fd);
+ return true;
+}
+
+static int
+do_test (void)
+{
+ umask (0);
+ const char *paths[] = { ".", "/dev/shm", "/tmp",
+ getenv ("TEST_TMPFILE_PATH"),
+ NULL };
+ bool supported = false;
+ for (int i = 0; paths[i] != NULL; ++i)
+ if (probe_path (paths[i]))
+ {
+ supported = true;
+ check_wrapper ("open", wrap_open, paths[i]);
+ check_wrapper ("openat", wrap_openat, paths[i]);
+ check_wrapper ("open64", wrap_open64, paths[i]);
+ check_wrapper ("openat64", wrap_openat64, paths[i]);
+ }
+
+ if (!supported)
+ return 77;
+
+ return 0;
+}
+
+#else /* !O_TMPFILE */
+
+static int
+do_test (void)
+{
+ return 77;
+}
+
+#endif /* O_TMPFILE */
diff --git a/io/tst-posix_fallocate-common.c b/io/tst-posix_fallocate-common.c
new file mode 100644
index 0000000000..2f15a5df18
--- /dev/null
+++ b/io/tst-posix_fallocate-common.c
@@ -0,0 +1,85 @@
+/* Common posix_fallocate tests definitions.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+static void do_prepare (void);
+#define PREPARE(argc, argv) do_prepare ()
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+
+#define TIMEOUT 20 /* sec. */
+
+#include <test-skeleton.c>
+
+static char *temp_filename;
+static int temp_fd;
+
+static void
+do_prepare (void)
+{
+ temp_fd = create_temp_file ("tst-posix_fallocate.", &temp_filename);
+ if (temp_fd == -1)
+ FAIL_EXIT1 ("cannot create temporary file: %m\n");
+}
+
+#define FAIL(str) \
+ do { printf ("error: %s (line %d)\n", str, __LINE__); return 1; } while (0)
+
+static int
+do_test_with_offset (off_t offset)
+{
+ struct stat st;
+
+ if (posix_fallocate (temp_fd, offset, 768) != 0)
+ FAIL_EXIT1 ("1st posix_fallocate call failed");
+
+ if (fstat (temp_fd, &st) != 0)
+ FAIL_EXIT1 ("2nd fstat failed");
+
+ if (st.st_size != (offset + 768))
+ FAIL_EXIT1 ("file size after first posix_fallocate call is %lu, "
+ "expected %lu",
+ (unsigned long int) st.st_size, 512lu + 768lu);
+
+ if (posix_fallocate (temp_fd, 0, 1024) != 0)
+ FAIL_EXIT1 ("2nd posix_fallocate call failed");
+
+ if (fstat (temp_fd, &st) != 0)
+ FAIL_EXIT1 ("3rd fstat failed");
+
+ if (st.st_size != (offset) + 768)
+ FAIL_EXIT1 ("file size changed in second posix_fallocate");
+
+ offset += 2048;
+ if (posix_fallocate (temp_fd, offset, 64) != 0)
+ FAIL_EXIT1 ("3rd posix_fallocate call failed");
+
+ if (fstat (temp_fd, &st) != 0)
+ FAIL_EXIT1 ("4th fstat failed");
+
+ if (st.st_size != (offset + 64))
+ FAIL_EXIT1 ("file size after first posix_fallocate call is %llu, "
+ "expected %u",
+ (unsigned long long int) st.st_size, 2048u + 64u);
+
+ return 0;
+}
diff --git a/io/tst-posix_fallocate.c b/io/tst-posix_fallocate.c
index 53f0704c34..f05f00fd3f 100644
--- a/io/tst-posix_fallocate.c
+++ b/io/tst-posix_fallocate.c
@@ -1,100 +1,33 @@
-#include <fcntl.h>
-#include <sys/stat.h>
+/* Basic posix_fallocate tests.
+ Copyright (C) 2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-static void do_prepare (void);
-#define PREPARE(argc, argv) do_prepare ()
-static int do_test (void);
-#define TEST_FUNCTION do_test ()
-#include <test-skeleton.c>
+ 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.
-static int fd;
+ 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.
-static void
-do_prepare (void)
-{
- fd = create_temp_file ("tst-posix_fallocate.", NULL);
- if (fd == -1)
- {
- printf ("cannot create temporary file: %m\n");
- exit (1);
- }
-}
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include "tst-posix_fallocate-common.c"
static int
do_test (void)
{
- struct stat64 st;
+ struct stat st;
- if (fstat64 (fd, &st) != 0)
- {
- puts ("1st fstat failed");
- return 1;
- }
+ if (fstat (temp_fd, &st) != 0)
+ FAIL_EXIT1 ("1st fstat failed");
if (st.st_size != 0)
- {
- puts ("file not created with size 0");
- return 1;
- }
-
- if (posix_fallocate (fd, 512, 768) != 0)
- {
- puts ("1st posix_fallocate call failed");
- return 1;
- }
-
- if (fstat64 (fd, &st) != 0)
- {
- puts ("2nd fstat failed");
- return 1;
- }
-
- if (st.st_size != 512 + 768)
- {
- printf ("file size after first posix_fallocate call is %llu, expected %u\n",
- (unsigned long long int) st.st_size, 512u + 768u);
- return 1;
- }
-
- if (posix_fallocate (fd, 0, 1024) != 0)
- {
- puts ("2nd posix_fallocate call failed");
- return 1;
- }
-
- if (fstat64 (fd, &st) != 0)
- {
- puts ("3rd fstat failed");
- return 1;
- }
-
- if (st.st_size != 512 + 768)
- {
- puts ("file size changed in second posix_fallocate");
- return 1;
- }
-
- if (posix_fallocate (fd, 2048, 64) != 0)
- {
- puts ("3rd posix_fallocate call failed");
- return 1;
- }
-
- if (fstat64 (fd, &st) != 0)
- {
- puts ("4th fstat failed");
- return 1;
- }
-
- if (st.st_size != 2048 + 64)
- {
- printf ("file size after first posix_fallocate call is %llu, expected %u\n",
- (unsigned long long int) st.st_size, 2048u + 64u);
- return 1;
- }
-
- close (fd);
+ FAIL_EXIT1 ("file not created with size 0");
- return 0;
+ return do_test_with_offset (512);
}
diff --git a/io/tst-posix_fallocate64.c b/io/tst-posix_fallocate64.c
new file mode 100644
index 0000000000..0c2f66eb8c
--- /dev/null
+++ b/io/tst-posix_fallocate64.c
@@ -0,0 +1,44 @@
+/* Basic posix_fallocate tests (with _FILE_OFFSET_BITS).
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define _FILE_OFFSET_BITS 64
+#include "tst-posix_fallocate-common.c"
+
+static int
+do_test (void)
+{
+ struct stat st;
+ int ret;
+
+ if (fstat (temp_fd, &st) != 0)
+ FAIL_EXIT1 ("1st fstat failed");
+
+ if (st.st_size != 0)
+ FAIL_EXIT1 ("file not created with size 0");
+
+ ret = do_test_with_offset (512);
+ if (ret == 1)
+ return 1;
+
+ off_t base_offset = UINT32_MAX + 512LL;
+ ret = do_test_with_offset (base_offset);
+ if (ret == 1)
+ return 1;
+
+ return 0;
+}
diff --git a/io/utime.h b/io/utime.h
index 3cc0d5e99d..b30e1cc022 100644
--- a/io/utime.h
+++ b/io/utime.h
@@ -29,8 +29,7 @@ __BEGIN_DECLS
#include <bits/types.h>
#if defined __USE_XOPEN || defined __USE_XOPEN2K
-# define __need_time_t
-# include <time.h>
+# include <bits/types/time_t.h>
#endif
/* Structure describing file times. */
diff --git a/libio/Makefile b/libio/Makefile
index 12589f2875..0c7751c953 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -56,8 +56,8 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \
tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \
bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
- tst-memstream1 tst-memstream2 \
- tst-wmemstream1 tst-wmemstream2 \
+ tst-memstream1 tst-memstream2 tst-memstream3 \
+ tst-wmemstream1 tst-wmemstream2 tst-wmemstream3 \
bug-memstream1 bug-wmemstream1 \
tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \
diff --git a/libio/memstream.c b/libio/memstream.c
index e20b9c2250..f1e8d58456 100644
--- a/libio/memstream.c
+++ b/libio/memstream.c
@@ -112,8 +112,6 @@ _IO_mem_sync (_IO_FILE *fp)
_IO_str_overflow (fp, '\0');
--fp->_IO_write_ptr;
}
- else
- *fp->_IO_write_ptr = '\0';
*mp->bufloc = fp->_IO_write_base;
*mp->sizeloc = fp->_IO_write_ptr - fp->_IO_write_base;
diff --git a/libio/strops.c b/libio/strops.c
index 2ba3704dd2..1bb8a77932 100644
--- a/libio/strops.c
+++ b/libio/strops.c
@@ -230,6 +230,21 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
return 0;
}
+static void
+_IO_str_switch_to_get_mode (_IO_FILE *fp)
+{
+ if (_IO_in_backup (fp))
+ fp->_IO_read_base = fp->_IO_backup_base;
+ else
+ {
+ fp->_IO_read_base = fp->_IO_buf_base;
+ if (fp->_IO_write_ptr > fp->_IO_read_end)
+ fp->_IO_read_end = fp->_IO_write_ptr;
+ }
+ fp->_IO_read_ptr = fp->_IO_read_end = fp->_IO_write_ptr;
+
+ fp->_flags &= ~_IO_CURRENTLY_PUTTING;
+}
_IO_off64_t
_IO_str_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
@@ -239,14 +254,14 @@ _IO_str_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))
mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);
+ bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base
+ || _IO_in_put_mode (fp));
+ if (was_writing)
+ _IO_str_switch_to_get_mode (fp);
+
if (mode == 0)
{
- /* Don't move any pointers. But there is no clear indication what
- mode FP is in. Let's guess. */
- if (fp->_IO_file_flags & _IO_NO_WRITES)
- new_pos = fp->_IO_read_ptr - fp->_IO_read_base;
- else
- new_pos = fp->_IO_write_ptr - fp->_IO_write_base;
+ new_pos = fp->_IO_read_ptr - fp->_IO_read_base;
}
else
{
@@ -256,48 +271,62 @@ _IO_str_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
/* Move the get pointer, if requested. */
if (mode & _IOS_INPUT)
{
+ _IO_ssize_t base;
switch (dir)
{
- case _IO_seek_end:
- offset += cur_size;
+ case _IO_seek_set:
+ base = 0;
break;
case _IO_seek_cur:
- offset += fp->_IO_read_ptr - fp->_IO_read_base;
+ base = fp->_IO_read_ptr - fp->_IO_read_base;
break;
- default: /* case _IO_seek_set: */
+ default: /* case _IO_seek_end: */
+ base = cur_size;
break;
}
- if (offset < 0)
- return EOF;
- if ((_IO_ssize_t) offset > cur_size
- && enlarge_userbuf (fp, offset, 1) != 0)
+ _IO_ssize_t maxval = SSIZE_MAX - base;
+ if (offset < -base || offset > maxval)
+ {
+ __set_errno (EINVAL);
+ return EOF;
+ }
+ base += offset;
+ if (base > cur_size
+ && enlarge_userbuf (fp, base, 1) != 0)
return EOF;
- fp->_IO_read_ptr = fp->_IO_read_base + offset;
+ fp->_IO_read_ptr = fp->_IO_read_base + base;
fp->_IO_read_end = fp->_IO_read_base + cur_size;
- new_pos = offset;
+ new_pos = base;
}
/* Move the put pointer, if requested. */
if (mode & _IOS_OUTPUT)
{
+ _IO_ssize_t base;
switch (dir)
{
- case _IO_seek_end:
- offset += cur_size;
+ case _IO_seek_set:
+ base = 0;
break;
case _IO_seek_cur:
- offset += fp->_IO_write_ptr - fp->_IO_write_base;
+ base = fp->_IO_write_ptr - fp->_IO_write_base;
break;
- default: /* case _IO_seek_set: */
+ default: /* case _IO_seek_end: */
+ base = cur_size;
break;
}
- if (offset < 0)
- return EOF;
- if ((_IO_ssize_t) offset > cur_size
- && enlarge_userbuf (fp, offset, 0) != 0)
+ _IO_ssize_t maxval = SSIZE_MAX - base;
+ if (offset < -base || offset > maxval)
+ {
+ __set_errno (EINVAL);
+ return EOF;
+ }
+ base += offset;
+ if (base > cur_size
+ && enlarge_userbuf (fp, base, 0) != 0)
return EOF;
- fp->_IO_write_ptr = fp->_IO_write_base + offset;
- new_pos = offset;
+ fp->_IO_write_ptr = fp->_IO_write_base + base;
+ new_pos = base;
}
}
return new_pos;
diff --git a/libio/tst-memstream3.c b/libio/tst-memstream3.c
new file mode 100644
index 0000000000..b55f256e11
--- /dev/null
+++ b/libio/tst-memstream3.c
@@ -0,0 +1,166 @@
+/* Test for open_memstream implementation.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <mcheck.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <errno.h>
+
+
+#ifndef CHAR_T
+# define CHAR_T char
+# define W(o) o
+# define OPEN_MEMSTREAM open_memstream
+# define PRINTF printf
+# define FWRITE fwrite
+# define FPUTC fputc
+# define STRCMP strcmp
+#endif
+
+#define S(s) S1 (s)
+#define S1(s) #s
+
+static void
+mcheck_abort (enum mcheck_status ev)
+{
+ printf ("mecheck failed with status %d\n", (int) ev);
+ exit (1);
+}
+
+static void
+error_printf (int line, const char *fmt, ...)
+{
+ va_list ap;
+
+ printf ("error: %s:%i: ", __FILE__, line);
+ va_start (ap, fmt);
+ vprintf (fmt, ap);
+ va_end (ap);
+}
+
+#define ERROR_RET1(...) \
+ { error_printf(__LINE__, __VA_ARGS__); return 1; }
+
+static int
+do_test_bz18241 (void)
+{
+ CHAR_T *buf;
+ size_t size;
+
+ FILE *fp = OPEN_MEMSTREAM (&buf, &size);
+ if (fp == NULL)
+ ERROR_RET1 ("%s failed\n", S(OPEN_MEMSTREAM));
+
+ if (FPUTC (W('a'), fp) != W('a'))
+ ERROR_RET1 ("%s failed (errno = %d)\n", S(FPUTC), errno);
+ if (fflush (fp) != 0)
+ ERROR_RET1 ("fflush failed (errno = %d)\n", errno);
+ if (fseek (fp, -2, SEEK_SET) != -1)
+ ERROR_RET1 ("fseek failed (errno = %d)\n", errno);
+ if (errno != EINVAL)
+ ERROR_RET1 ("errno != EINVAL\n");
+ if (ftell (fp) != 1)
+ ERROR_RET1 ("ftell failed (errno = %d)\n", errno);
+ if (ferror (fp) != 0)
+ ERROR_RET1 ("ferror != 0\n");
+
+ if (fseek (fp, -1, SEEK_CUR) == -1)
+ ERROR_RET1 ("fseek failed (errno = %d)\n", errno);
+ if (ftell (fp) != 0)
+ ERROR_RET1 ("ftell failed (errno = %d)\n", errno);
+ if (ferror (fp) != 0)
+ ERROR_RET1 ("ferror != 0\n");
+ if (FPUTC (W('b'), fp) != W('b'))
+ ERROR_RET1 ("%s failed (errno = %d)\n", S(FPUTC), errno);
+ if (fflush (fp) != 0)
+ ERROR_RET1 ("fflush failed (errno = %d)\n", errno);
+
+ if (fclose (fp) != 0)
+ ERROR_RET1 ("fclose failed (errno = %d\n", errno);
+
+ if (STRCMP (buf, W("b")) != 0)
+ ERROR_RET1 ("%s failed\n", S(STRCMP));
+
+ free (buf);
+
+ return 0;
+}
+
+static int
+do_test_bz20181 (void)
+{
+ CHAR_T *buf;
+ size_t size;
+ size_t ret;
+
+ FILE *fp = OPEN_MEMSTREAM (&buf, &size);
+ if (fp == NULL)
+ ERROR_RET1 ("%s failed\n", S(OPEN_MEMSTREAM));
+
+ if ((ret = FWRITE (W("abc"), 1, 3, fp)) != 3)
+ ERROR_RET1 ("%s failed (errno = %d)\n", S(FWRITE), errno);
+
+ if (fseek (fp, 0, SEEK_SET) != 0)
+ ERROR_RET1 ("fseek failed (errno = %d)\n", errno);
+
+ if (FWRITE (W("z"), 1, 1, fp) != 1)
+ ERROR_RET1 ("%s failed (errno = %d)\n", S(FWRITE), errno);
+
+ if (fflush (fp) != 0)
+ ERROR_RET1 ("fflush failed (errno = %d)\n", errno);
+
+ /* Avoid truncating the buffer on close. */
+ if (fseek (fp, 3, SEEK_SET) != 0)
+ ERROR_RET1 ("fseek failed (errno = %d)\n", errno);
+
+ if (fclose (fp) != 0)
+ ERROR_RET1 ("fclose failed (errno = %d\n", errno);
+
+ if (size != 3)
+ ERROR_RET1 ("size != 3\n");
+
+ if (buf[0] != W('z')
+ || buf[1] != W('b')
+ || buf[2] != W('c'))
+ {
+ PRINTF (W("error: buf {%c,%c,%c} != {z,b,c}\n"),
+ buf[0], buf[1], buf[2]);
+ return 1;
+ }
+
+ free (buf);
+
+ return 0;
+}
+
+static int
+do_test (void)
+{
+ int ret = 0;
+
+ mcheck_pedantic (mcheck_abort);
+
+ ret += do_test_bz18241 ();
+ ret += do_test_bz20181 ();
+
+ return ret;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libio/tst-wmemstream3.c b/libio/tst-wmemstream3.c
new file mode 100644
index 0000000000..878db2d7dd
--- /dev/null
+++ b/libio/tst-wmemstream3.c
@@ -0,0 +1,44 @@
+/* Test for open_memstream implementation.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <wchar.h>
+
+/* Straighforward implementation so tst-memstream3 could use check
+ fwrite on open_memstream. */
+static size_t
+fwwrite (const void *ptr, size_t size, size_t nmemb, FILE *arq)
+{
+ const wchar_t *wcs = (const wchar_t*) (ptr);
+ for (size_t s = 0; s < size; s++)
+ {
+ for (size_t n = 0; n < nmemb; n++)
+ if (fputwc (wcs[n], arq) == WEOF)
+ return n;
+ }
+ return size * nmemb;
+}
+
+#define CHAR_T wchar_t
+#define W(o) L##o
+#define OPEN_MEMSTREAM open_wmemstream
+#define PRINTF wprintf
+#define FWRITE fwwrite
+#define FPUTC fputwc
+#define STRCMP wcscmp
+
+#include "tst-memstream3.c"
diff --git a/libio/wmemstream.c b/libio/wmemstream.c
index bf2a50b523..fd01be08ed 100644
--- a/libio/wmemstream.c
+++ b/libio/wmemstream.c
@@ -112,8 +112,6 @@ _IO_wmem_sync (_IO_FILE *fp)
_IO_wstr_overflow (fp, '\0');
--fp->_wide_data->_IO_write_ptr;
}
- else
- *fp->_wide_data->_IO_write_ptr = '\0';
*mp->bufloc = fp->_wide_data->_IO_write_base;
*mp->sizeloc = (fp->_wide_data->_IO_write_ptr
diff --git a/libio/wstrops.c b/libio/wstrops.c
index 09fa543f77..0b2bec350c 100644
--- a/libio/wstrops.c
+++ b/libio/wstrops.c
@@ -169,7 +169,7 @@ _IO_wstr_count (_IO_FILE *fp)
static int
enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
{
- if ((_IO_ssize_t) offset <= _IO_blen (fp))
+ if ((_IO_ssize_t) offset <= _IO_wblen (fp))
return 0;
struct _IO_wide_data *wd = fp->_wide_data;
@@ -235,6 +235,22 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
return 0;
}
+static void
+_IO_wstr_switch_to_get_mode (_IO_FILE *fp)
+{
+ if (_IO_in_backup (fp))
+ fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_backup_base;
+ else
+ {
+ fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_buf_base;
+ if (fp->_wide_data->_IO_write_ptr > fp->_wide_data->_IO_read_end)
+ fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_write_ptr;
+ }
+ fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_write_ptr;
+ fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_write_ptr;
+
+ fp->_flags &= ~_IO_CURRENTLY_PUTTING;
+}
_IO_off64_t
_IO_wstr_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
@@ -244,15 +260,16 @@ _IO_wstr_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))
mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);
+ bool was_writing = (fp->_wide_data->_IO_write_ptr >
+ fp->_wide_data->_IO_write_base
+ || _IO_in_put_mode (fp));
+ if (was_writing)
+ _IO_wstr_switch_to_get_mode (fp);
+
if (mode == 0)
{
- /* Don't move any pointers. But there is no clear indication what
- mode FP is in. Let's guess. */
- if (fp->_IO_file_flags & _IO_NO_WRITES)
- new_pos = fp->_wide_data->_IO_read_ptr - fp->_wide_data->_IO_read_base;
- else
- new_pos = (fp->_wide_data->_IO_write_ptr
- - fp->_wide_data->_IO_write_base);
+ new_pos = (fp->_wide_data->_IO_write_ptr
+ - fp->_wide_data->_IO_write_base);
}
else
{
@@ -262,25 +279,32 @@ _IO_wstr_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
/* Move the get pointer, if requested. */
if (mode & _IOS_INPUT)
{
+ _IO_ssize_t base;
switch (dir)
{
- case _IO_seek_end:
- offset += cur_size;
+ case _IO_seek_set:
+ base = 0;
break;
case _IO_seek_cur:
- offset += (fp->_wide_data->_IO_read_ptr
- - fp->_wide_data->_IO_read_base);
+ base = (fp->_wide_data->_IO_read_ptr
+ - fp->_wide_data->_IO_read_base);
break;
- default: /* case _IO_seek_set: */
+ default: /* case _IO_seek_end: */
+ base = cur_size;
break;
}
- if (offset < 0)
- return EOF;
- if ((_IO_ssize_t) offset > cur_size
- && enlarge_userbuf (fp, offset, 1) != 0)
+ _IO_ssize_t maxval = SSIZE_MAX/sizeof (wchar_t) - base;
+ if (offset < -base || offset > maxval)
+ {
+ __set_errno (EINVAL);
+ return EOF;
+ }
+ base += offset;
+ if (base > cur_size
+ && enlarge_userbuf (fp, base, 1) != 0)
return EOF;
fp->_wide_data->_IO_read_ptr = (fp->_wide_data->_IO_read_base
- + offset);
+ + base);
fp->_wide_data->_IO_read_end = (fp->_wide_data->_IO_read_base
+ cur_size);
new_pos = offset;
@@ -289,26 +313,33 @@ _IO_wstr_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
/* Move the put pointer, if requested. */
if (mode & _IOS_OUTPUT)
{
+ _IO_ssize_t base;
switch (dir)
{
- case _IO_seek_end:
- offset += cur_size;
+ case _IO_seek_set:
+ base = 0;
break;
case _IO_seek_cur:
- offset += (fp->_wide_data->_IO_write_ptr
- - fp->_wide_data->_IO_write_base);
+ base = (fp->_wide_data->_IO_write_ptr
+ - fp->_wide_data->_IO_write_base);
break;
- default: /* case _IO_seek_set: */
+ default: /* case _IO_seek_end: */
+ base = cur_size;
break;
}
- if (offset < 0)
- return EOF;
- if ((_IO_ssize_t) offset > cur_size
- && enlarge_userbuf (fp, offset, 0) != 0)
+ _IO_ssize_t maxval = SSIZE_MAX/sizeof (wchar_t) - base;
+ if (offset < -base || offset > maxval)
+ {
+ __set_errno (EINVAL);
+ return EOF;
+ }
+ base += offset;
+ if (base > cur_size
+ && enlarge_userbuf (fp, base, 0) != 0)
return EOF;
fp->_wide_data->_IO_write_ptr = (fp->_wide_data->_IO_write_base
- + offset);
- new_pos = offset;
+ + base);
+ new_pos = base;
}
}
return new_pos;
diff --git a/locale/weight.h b/locale/weight.h
index c99730c4fb..19b8e4a2df 100644
--- a/locale/weight.h
+++ b/locale/weight.h
@@ -19,6 +19,8 @@
#ifndef _WEIGHT_H_
#define _WEIGHT_H_ 1
+#include <libc-internal.h>
+
/* Find index of weight. */
static inline int32_t __attribute__ ((always_inline))
findidx (const int32_t *table,
@@ -61,9 +63,17 @@ findidx (const int32_t *table,
already. */
size_t cnt;
+ /* With GCC 5.3 when compiling with -Os the compiler warns
+ that seq2.back_us, which becomes usrc, might be used
+ uninitialized. This can't be true because we pass a length
+ of -1 for len at the same time which means that this loop
+ never executes. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
+ DIAG_POP_NEEDS_COMMENT;
if (cnt == nhere)
{
diff --git a/locale/weightwc.h b/locale/weightwc.h
index ab26482996..ae189658eb 100644
--- a/locale/weightwc.h
+++ b/locale/weightwc.h
@@ -19,6 +19,8 @@
#ifndef _WEIGHTWC_H_
#define _WEIGHTWC_H_ 1
+#include <libc-internal.h>
+
/* Find index of weight. */
static inline int32_t __attribute__ ((always_inline))
findidx (const int32_t *table,
@@ -59,9 +61,17 @@ findidx (const int32_t *table,
already. */
size_t cnt;
+ /* With GCC 5.3 when compiling with -Os the compiler warns
+ that seq2.back_us, which becomes usrc, might be used
+ uninitialized. This can't be true because we pass a length
+ of -1 for len at the same time which means that this loop
+ never executes. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
+ DIAG_POP_NEEDS_COMMENT;
if (cnt == nhere)
{
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index 1ce824d3a5..f5c58ae0dc 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-24 Ernestas Kulik <ernestas.kulik@gmail.com>
+
+ [BZ #20497]
+ * locales/lt_LT (d_fmt): Change periods to dashes.
+
2016-08-15 Märt Põder <tramm@p6drad-teel.net>
[BZ #20459]
diff --git a/localedata/locales/lt_LT b/localedata/locales/lt_LT
index 78ed64cb8b..e36a8952ed 100644
--- a/localedata/locales/lt_LT
+++ b/localedata/locales/lt_LT
@@ -2188,7 +2188,7 @@ mon "<U0073><U0061><U0075><U0073><U0069><U006F>";/
"<U006C><U0061><U0070><U006B><U0072><U0069><U010D><U0069><U006F>";/
"<U0067><U0072><U0075><U006F><U0064><U017E><U0069><U006F>"
d_t_fmt "<U0025><U0059><U0020><U006D><U002E><U0020><U0025><U0042><U0020><U0025><U0064><U0020><U0064><U002E><U0020><U0025><U0054>"
-d_fmt "<U0025><U0059><U002E><U0025><U006D><U002E><U0025><U0064>"
+d_fmt "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064>"
t_fmt "<U0025><U0054>"
am_pm "";""
t_fmt_ampm ""
diff --git a/mach/errstring.c b/mach/errstring.c
index 52cf1eb46e..c00b02c2a6 100644
--- a/mach/errstring.c
+++ b/mach/errstring.c
@@ -46,8 +46,7 @@
extern void __mach_error_map_compat (mach_error_t *);
const char *
-mach_error_type( err )
- mach_error_t err;
+mach_error_type(mach_error_t err)
{
int sub, system;
@@ -86,8 +85,7 @@ mach_error_string_int(mach_error_t err,
}
const char *
-mach_error_string( err )
- mach_error_t err;
+mach_error_string(mach_error_t err)
{
boolean_t diag;
diff --git a/mach/mach_error.c b/mach/mach_error.c
index 8bbb2ec74e..0d3082d021 100644
--- a/mach/mach_error.c
+++ b/mach/mach_error.c
@@ -63,9 +63,7 @@
extern char * mach_error_string_int(mach_error_t, boolean_t *);
void
-mach_error( str, err )
- char *str;
- mach_error_t err;
+mach_error(char *str, mach_error_t err)
{
char * err_str;
char buf[1024];
diff --git a/malloc/Makefile b/malloc/Makefile
index 761a976fa3..f34c2a75ba 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -30,7 +30,15 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
tst-pvalloc tst-memalign tst-mallopt tst-scratch_buffer \
tst-malloc-backtrace tst-malloc-thread-exit \
tst-malloc-thread-fail tst-malloc-fork-deadlock \
- tst-mallocfork2
+ tst-mallocfork2 \
+ tst-interpose-nothread \
+ tst-interpose-thread \
+
+tests-static := \
+ tst-interpose-static-nothread \
+ tst-interpose-static-thread \
+
+tests += $(tests-static)
test-srcs = tst-mtrace
routines = malloc morecore mcheck mtrace obstack \
@@ -44,6 +52,15 @@ non-lib.a := libmcheck.a
extra-libs = libmemusage libmtracectl
extra-libs-others = $(extra-libs)
+# Helper objects for some tests.
+extra-tests-objs += \
+ tst-interpose-aux-nothread.o \
+ tst-interpose-aux-thread.o \
+
+test-extras = \
+ tst-interpose-aux-nothread \
+ tst-interpose-aux-thread \
+
libmemusage-routines = memusage
libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes))
@@ -71,6 +88,9 @@ $(objpfx)tst-malloc-thread-exit: $(shared-thread-library)
$(objpfx)tst-malloc-thread-fail: $(shared-thread-library)
$(objpfx)tst-malloc-fork-deadlock: $(shared-thread-library)
+# Export the __malloc_initialize_hook variable to libc.so.
+LDFLAGS-tst-mallocstate = -rdynamic
+
# These should be removed by `make clean'.
extra-objs = mcheck-init.o libmcheck.a
@@ -189,3 +209,10 @@ $(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c
# Compile the tests with a flag which suppresses the mallopt call in
# the test skeleton.
$(tests:%=$(objpfx)%.o): CPPFLAGS += -DTEST_NO_MALLOPT
+
+$(objpfx)tst-interpose-nothread: $(objpfx)tst-interpose-aux-nothread.o
+$(objpfx)tst-interpose-thread: \
+ $(objpfx)tst-interpose-aux-thread.o $(shared-thread-library)
+$(objpfx)tst-interpose-static-nothread: $(objpfx)tst-interpose-aux-nothread.o
+$(objpfx)tst-interpose-static-thread: \
+ $(objpfx)tst-interpose-aux-thread.o $(static-thread-library)
diff --git a/malloc/arena.c b/malloc/arena.c
index 6c23c8e107..ada1a7245e 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -73,7 +73,7 @@ static __thread mstate thread_arena attribute_tls_model_ie;
members of struct malloc_state objects. No other locks must be
acquired after free_list_lock has been acquired. */
-static mutex_t free_list_lock = _LIBC_LOCK_INITIALIZER;
+__libc_lock_define_initialized (static, free_list_lock);
static size_t narenas = 1;
static mstate free_list;
@@ -89,7 +89,7 @@ static mstate free_list;
acquired, no arena lock must have been acquired, but it is
permitted to acquire arena locks subsequently, while list_lock is
acquired. */
-static mutex_t list_lock = _LIBC_LOCK_INITIALIZER;
+__libc_lock_define_initialized (static, list_lock);
/* Already initialized? */
int __malloc_initialized = -1;
@@ -112,7 +112,7 @@ int __malloc_initialized = -1;
#define arena_lock(ptr, size) do { \
if (ptr && !arena_is_corrupt (ptr)) \
- (void) mutex_lock (&ptr->mutex); \
+ __libc_lock_lock (ptr->mutex); \
else \
ptr = arena_get2 ((size), NULL); \
} while (0)
@@ -122,7 +122,7 @@ int __malloc_initialized = -1;
#define heap_for_ptr(ptr) \
((heap_info *) ((unsigned long) (ptr) & ~(HEAP_MAX_SIZE - 1)))
#define arena_for_chunk(ptr) \
- (chunk_non_main_arena (ptr) ? heap_for_ptr (ptr)->ar_ptr : &main_arena)
+ (chunk_main_arena (ptr) ? &main_arena : heap_for_ptr (ptr)->ar_ptr)
/**************************************************************************/
@@ -145,11 +145,11 @@ __malloc_fork_lock_parent (void)
/* We do not acquire free_list_lock here because we completely
reconstruct free_list in __malloc_fork_unlock_child. */
- (void) mutex_lock (&list_lock);
+ __libc_lock_lock (list_lock);
for (mstate ar_ptr = &main_arena;; )
{
- (void) mutex_lock (&ar_ptr->mutex);
+ __libc_lock_lock (ar_ptr->mutex);
ar_ptr = ar_ptr->next;
if (ar_ptr == &main_arena)
break;
@@ -165,12 +165,12 @@ __malloc_fork_unlock_parent (void)
for (mstate ar_ptr = &main_arena;; )
{
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
ar_ptr = ar_ptr->next;
if (ar_ptr == &main_arena)
break;
}
- (void) mutex_unlock (&list_lock);
+ __libc_lock_unlock (list_lock);
}
void
@@ -182,13 +182,13 @@ __malloc_fork_unlock_child (void)
/* Push all arenas to the free list, except thread_arena, which is
attached to the current thread. */
- mutex_init (&free_list_lock);
+ __libc_lock_init (free_list_lock);
if (thread_arena != NULL)
thread_arena->attached_threads = 1;
free_list = NULL;
for (mstate ar_ptr = &main_arena;; )
{
- mutex_init (&ar_ptr->mutex);
+ __libc_lock_init (ar_ptr->mutex);
if (ar_ptr != thread_arena)
{
/* This arena is no longer attached to any thread. */
@@ -201,7 +201,7 @@ __malloc_fork_unlock_child (void)
break;
}
- mutex_init (&list_lock);
+ __libc_lock_init (list_lock);
}
/* Initialization routine. */
@@ -574,12 +574,12 @@ heap_trim (heap_info *heap, size_t pad)
/* fencepost must be properly aligned. */
misalign = ((long) p) & MALLOC_ALIGN_MASK;
p = chunk_at_offset (prev_heap, prev_size - misalign);
- assert (p->size == (0 | PREV_INUSE)); /* must be fencepost */
+ assert (chunksize_nomask (p) == (0 | PREV_INUSE)); /* must be fencepost */
p = prev_chunk (p);
new_size = chunksize (p) + (MINSIZE - 2 * SIZE_SZ) + misalign;
assert (new_size > 0 && new_size < (long) (2 * MINSIZE));
if (!prev_inuse (p))
- new_size += p->prev_size;
+ new_size += prev_size (p);
assert (new_size > 0 && new_size < HEAP_MAX_SIZE);
if (new_size + (HEAP_MAX_SIZE - prev_heap->size) < pad + MINSIZE + pagesz)
break;
@@ -682,9 +682,9 @@ _int_new_arena (size_t size)
LIBC_PROBE (memory_arena_new, 2, a, size);
mstate replaced_arena = thread_arena;
thread_arena = a;
- mutex_init (&a->mutex);
+ __libc_lock_init (a->mutex);
- (void) mutex_lock (&list_lock);
+ __libc_lock_lock (list_lock);
/* Add the new arena to the global list. */
a->next = main_arena.next;
@@ -694,11 +694,11 @@ _int_new_arena (size_t size)
atomic_write_barrier ();
main_arena.next = a;
- (void) mutex_unlock (&list_lock);
+ __libc_lock_unlock (list_lock);
- (void) mutex_lock (&free_list_lock);
+ __libc_lock_lock (free_list_lock);
detach_arena (replaced_arena);
- (void) mutex_unlock (&free_list_lock);
+ __libc_lock_unlock (free_list_lock);
/* Lock this arena. NB: Another thread may have been attached to
this arena because the arena is now accessible from the
@@ -710,7 +710,7 @@ _int_new_arena (size_t size)
but this could result in a deadlock with
__malloc_fork_lock_parent. */
- (void) mutex_lock (&a->mutex);
+ __libc_lock_lock (a->mutex);
return a;
}
@@ -724,7 +724,7 @@ get_free_list (void)
mstate result = free_list;
if (result != NULL)
{
- (void) mutex_lock (&free_list_lock);
+ __libc_lock_lock (free_list_lock);
result = free_list;
if (result != NULL)
{
@@ -736,12 +736,12 @@ get_free_list (void)
detach_arena (replaced_arena);
}
- (void) mutex_unlock (&free_list_lock);
+ __libc_lock_unlock (free_list_lock);
if (result != NULL)
{
LIBC_PROBE (memory_arena_reuse_free_list, 1, result);
- (void) mutex_lock (&result->mutex);
+ __libc_lock_lock (result->mutex);
thread_arena = result;
}
}
@@ -786,7 +786,7 @@ reused_arena (mstate avoid_arena)
result = next_to_use;
do
{
- if (!arena_is_corrupt (result) && !mutex_trylock (&result->mutex))
+ if (!arena_is_corrupt (result) && !__libc_lock_trylock (result->mutex))
goto out;
/* FIXME: This is a data race, see _int_new_arena. */
@@ -813,14 +813,14 @@ reused_arena (mstate avoid_arena)
/* No arena available without contention. Wait for the next in line. */
LIBC_PROBE (memory_arena_reuse_wait, 3, &result->mutex, result, avoid_arena);
- (void) mutex_lock (&result->mutex);
+ __libc_lock_lock (result->mutex);
out:
/* Attach the arena to the current thread. */
{
/* Update the arena thread attachment counters. */
mstate replaced_arena = thread_arena;
- (void) mutex_lock (&free_list_lock);
+ __libc_lock_lock (free_list_lock);
detach_arena (replaced_arena);
/* We may have picked up an arena on the free list. We need to
@@ -835,7 +835,7 @@ out:
++result->attached_threads;
- (void) mutex_unlock (&free_list_lock);
+ __libc_lock_unlock (free_list_lock);
}
LIBC_PROBE (memory_arena_reuse, 2, result, avoid_arena);
@@ -906,17 +906,17 @@ arena_get_retry (mstate ar_ptr, size_t bytes)
LIBC_PROBE (memory_arena_retry, 2, bytes, ar_ptr);
if (ar_ptr != &main_arena)
{
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
/* Don't touch the main arena if it is corrupt. */
if (arena_is_corrupt (&main_arena))
return NULL;
ar_ptr = &main_arena;
- (void) mutex_lock (&ar_ptr->mutex);
+ __libc_lock_lock (ar_ptr->mutex);
}
else
{
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
ar_ptr = arena_get2 (bytes, ar_ptr);
}
@@ -931,7 +931,7 @@ arena_thread_freeres (void)
if (a != NULL)
{
- (void) mutex_lock (&free_list_lock);
+ __libc_lock_lock (free_list_lock);
/* If this was the last attached thread for this arena, put the
arena on the free list. */
assert (a->attached_threads > 0);
@@ -940,7 +940,7 @@ arena_thread_freeres (void)
a->next_free = free_list;
free_list = a;
}
- (void) mutex_unlock (&free_list_lock);
+ __libc_lock_unlock (free_list_lock);
}
}
text_set_element (__libc_thread_subfreeres, arena_thread_freeres);
diff --git a/malloc/hooks.c b/malloc/hooks.c
index caa1e70d13..12995d3f0c 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -192,7 +192,7 @@ mem2chunk_check (void *mem, unsigned char **magic_p)
((char *) p < mp_.sbrk_base ||
((char *) p + sz) >= (mp_.sbrk_base + main_arena.system_mem))) ||
sz < MINSIZE || sz & MALLOC_ALIGN_MASK || !inuse (p) ||
- (!prev_inuse (p) && (p->prev_size & MALLOC_ALIGN_MASK ||
+ (!prev_inuse (p) && ((prev_size (p) & MALLOC_ALIGN_MASK) != 0 ||
(contig && (char *) prev_chunk (p) < mp_.sbrk_base) ||
next_chunk (prev_chunk (p)) != p)))
return NULL;
@@ -215,9 +215,9 @@ mem2chunk_check (void *mem, unsigned char **magic_p)
offset != 0x20 && offset != 0x40 && offset != 0x80 && offset != 0x100 &&
offset != 0x200 && offset != 0x400 && offset != 0x800 && offset != 0x1000 &&
offset < 0x2000) ||
- !chunk_is_mmapped (p) || (p->size & PREV_INUSE) ||
- ((((unsigned long) p - p->prev_size) & page_mask) != 0) ||
- ((p->prev_size + sz) & page_mask) != 0)
+ !chunk_is_mmapped (p) || prev_inuse (p) ||
+ ((((unsigned long) p - prev_size (p)) & page_mask) != 0) ||
+ ((prev_size (p) + sz) & page_mask) != 0)
return NULL;
for (sz -= 1; (c = ((unsigned char *) p)[sz]) != magic; sz -= c)
@@ -291,9 +291,9 @@ malloc_check (size_t sz, const void *caller)
return NULL;
}
- (void) mutex_lock (&main_arena.mutex);
+ __libc_lock_lock (main_arena.mutex);
victim = (top_check () >= 0) ? _int_malloc (&main_arena, sz + 1) : NULL;
- (void) mutex_unlock (&main_arena.mutex);
+ __libc_lock_unlock (main_arena.mutex);
return mem2mem_check (victim, sz);
}
@@ -305,11 +305,11 @@ free_check (void *mem, const void *caller)
if (!mem)
return;
- (void) mutex_lock (&main_arena.mutex);
+ __libc_lock_lock (main_arena.mutex);
p = mem2chunk_check (mem, NULL);
if (!p)
{
- (void) mutex_unlock (&main_arena.mutex);
+ __libc_lock_unlock (main_arena.mutex);
malloc_printerr (check_action, "free(): invalid pointer", mem,
&main_arena);
@@ -317,12 +317,12 @@ free_check (void *mem, const void *caller)
}
if (chunk_is_mmapped (p))
{
- (void) mutex_unlock (&main_arena.mutex);
+ __libc_lock_unlock (main_arena.mutex);
munmap_chunk (p);
return;
}
_int_free (&main_arena, p, 1);
- (void) mutex_unlock (&main_arena.mutex);
+ __libc_lock_unlock (main_arena.mutex);
}
static void *
@@ -345,9 +345,9 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
free_check (oldmem, NULL);
return NULL;
}
- (void) mutex_lock (&main_arena.mutex);
+ __libc_lock_lock (main_arena.mutex);
const mchunkptr oldp = mem2chunk_check (oldmem, &magic_p);
- (void) mutex_unlock (&main_arena.mutex);
+ __libc_lock_unlock (main_arena.mutex);
if (!oldp)
{
malloc_printerr (check_action, "realloc(): invalid pointer", oldmem,
@@ -357,7 +357,7 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
const INTERNAL_SIZE_T oldsize = chunksize (oldp);
checked_request2size (bytes + 1, nb);
- (void) mutex_lock (&main_arena.mutex);
+ __libc_lock_lock (main_arena.mutex);
if (chunk_is_mmapped (oldp))
{
@@ -400,7 +400,7 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
if (newmem == NULL)
*magic_p ^= 0xFF;
- (void) mutex_unlock (&main_arena.mutex);
+ __libc_lock_unlock (main_arena.mutex);
return mem2mem_check (newmem, bytes);
}
@@ -440,13 +440,14 @@ memalign_check (size_t alignment, size_t bytes, const void *caller)
alignment = a;
}
- (void) mutex_lock (&main_arena.mutex);
+ __libc_lock_lock (main_arena.mutex);
mem = (top_check () >= 0) ? _int_memalign (&main_arena, alignment, bytes + 1) :
NULL;
- (void) mutex_unlock (&main_arena.mutex);
+ __libc_lock_unlock (main_arena.mutex);
return mem2mem_check (mem, bytes);
}
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_25)
/* Get/set state: malloc_get_state() records the current state of all
malloc variables (_except_ for the actual heap contents and `hook'
@@ -492,60 +493,21 @@ struct malloc_save_state
unsigned long narenas;
};
+/* Dummy implementation which always fails. We need to provide this
+ symbol so that existing Emacs binaries continue to work with
+ BIND_NOW. */
void *
-__malloc_get_state (void)
+attribute_compat_text_section
+malloc_get_state (void)
{
- struct malloc_save_state *ms;
- int i;
- mbinptr b;
-
- ms = (struct malloc_save_state *) __libc_malloc (sizeof (*ms));
- if (!ms)
- return 0;
-
- (void) mutex_lock (&main_arena.mutex);
- malloc_consolidate (&main_arena);
- ms->magic = MALLOC_STATE_MAGIC;
- ms->version = MALLOC_STATE_VERSION;
- ms->av[0] = 0;
- ms->av[1] = 0; /* used to be binblocks, now no longer used */
- ms->av[2] = top (&main_arena);
- ms->av[3] = 0; /* used to be undefined */
- for (i = 1; i < NBINS; i++)
- {
- b = bin_at (&main_arena, i);
- if (first (b) == b)
- ms->av[2 * i + 2] = ms->av[2 * i + 3] = 0; /* empty bin */
- else
- {
- ms->av[2 * i + 2] = first (b);
- ms->av[2 * i + 3] = last (b);
- }
- }
- ms->sbrk_base = mp_.sbrk_base;
- ms->sbrked_mem_bytes = main_arena.system_mem;
- ms->trim_threshold = mp_.trim_threshold;
- ms->top_pad = mp_.top_pad;
- ms->n_mmaps_max = mp_.n_mmaps_max;
- ms->mmap_threshold = mp_.mmap_threshold;
- ms->check_action = check_action;
- ms->max_sbrked_mem = main_arena.max_system_mem;
- ms->max_total_mem = 0;
- ms->n_mmaps = mp_.n_mmaps;
- ms->max_n_mmaps = mp_.max_n_mmaps;
- ms->mmapped_mem = mp_.mmapped_mem;
- ms->max_mmapped_mem = mp_.max_mmapped_mem;
- ms->using_malloc_checking = using_malloc_checking;
- ms->max_fast = get_max_fast ();
- ms->arena_test = mp_.arena_test;
- ms->arena_max = mp_.arena_max;
- ms->narenas = narenas;
- (void) mutex_unlock (&main_arena.mutex);
- return (void *) ms;
+ __set_errno (ENOSYS);
+ return NULL;
}
+compat_symbol (libc, malloc_get_state, malloc_get_state, GLIBC_2_0);
int
-__malloc_set_state (void *msptr)
+attribute_compat_text_section
+malloc_set_state (void *msptr)
{
struct malloc_save_state *ms = (struct malloc_save_state *) msptr;
@@ -612,6 +574,9 @@ __malloc_set_state (void *msptr)
return 0;
}
+compat_symbol (libc, malloc_set_state, malloc_set_state, GLIBC_2_0);
+
+#endif /* SHLIB_COMPAT */
/*
* Local variables:
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 1fa9487f18..bd8a1d4bb8 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -273,8 +273,9 @@
#define MALLOC_DEBUG 0
#endif
-#define USE_TCACHE 1
-
+#ifndef USE_TCACHE
+#define USE_TCACHE 0
+#endif
#if USE_TCACHE
/* we want 64 entries */
#define MAX_TCACHE_SIZE (MALLOC_ALIGNMENT * 63)
@@ -1067,7 +1068,7 @@ typedef struct __malloc_trace_map_entry_s {
#define TRACE_COUNT_TO_MAPPING_IDX(count) ((count) % TRACE_N_PER_MAPPING)
/* Global mutex for the trace buffer tree itself. */
-mutex_t __malloc_trace_mutex;
+libc_lock_define_initialized (static, __malloc_trace_mutex);
/* Global counter, "full" when equal to TRACE_MAX_COUNT. Points to
the next available slot, so POST-INCREMENT it. */
@@ -1174,7 +1175,7 @@ __mtb_trace_record (void)
/* START W: Switch window. */
/* W1. Acquire the global window lock. */
- (void) mutex_lock (&__malloc_trace_mutex);
+ __libc_lock_lock (__malloc_trace_mutex);
/* W2. If the thread-local window number is not -1, decrement the reference
counter for the current thread window. */
@@ -1216,7 +1217,7 @@ __mtb_trace_record (void)
/* FIXME: Better handling of errors? */
__libc_message (0, "Can't open trace buffer file %s\n", __malloc_trace_filename);
atomic_store_release (&__malloc_trace_enabled, 0);
- (void) mutex_unlock (&__malloc_trace_mutex);
+ __libc_lock_unlock (__malloc_trace_mutex);
return;
}
@@ -1234,7 +1235,7 @@ __mtb_trace_record (void)
/* FIXME: Better handling of errors? */
__libc_message (0, "Can't map trace_buffer file %s\n", __malloc_trace_filename);
atomic_store_release (&__malloc_trace_enabled, 0);
- (void) mutex_unlock (&__malloc_trace_mutex);
+ __libc_lock_unlock (__malloc_trace_mutex);
return;
}
@@ -1253,7 +1254,7 @@ __mtb_trace_record (void)
__malloc_trace_last_num = new_window;
/* W8. Release the global window lock. */
- (void) mutex_unlock (&__malloc_trace_mutex);
+ __libc_lock_unlock (__malloc_trace_mutex);
/* W9. Continue at T1. */
goto alg_t1;
@@ -1302,7 +1303,7 @@ __malloc_trace_init (char *filename)
__malloc_trace_buffer = (__malloc_trace_map_entry *) mapping;
- mutex_init (&__malloc_trace_mutex);
+ __libc_lock_init (__malloc_trace_mutex);
__malloc_trace_count = 0;
__mtb_trace_entry (__MTB_TYPE_MAGIC, sizeof(void *), (void *)0x1234);
@@ -1457,8 +1458,8 @@ size_t __malloc_trace_sync (void) { return 0; }
struct malloc_chunk {
- INTERNAL_SIZE_T prev_size; /* Size of previous chunk (if free). */
- INTERNAL_SIZE_T size; /* Size in bytes, including overhead. */
+ INTERNAL_SIZE_T mchunk_prev_size; /* Size of previous chunk (if free). */
+ INTERNAL_SIZE_T mchunk_size; /* Size in bytes, including overhead. */
struct malloc_chunk* fd; /* double links -- used only if free. */
struct malloc_chunk* bk;
@@ -1487,18 +1488,19 @@ struct malloc_chunk {
chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk, if allocated | |
+ | Size of previous chunk, if unallocated (P clear) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of chunk, in bytes |M|P|
+ | Size of chunk, in bytes |A|M|P|
mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| User data starts here... .
. .
. (malloc_usable_size() bytes) .
. |
nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of chunk |
+ | (size of chunk, but used for application data) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of next chunk, in bytes |A|0|1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
Where "chunk" is the front of the chunk for the purpose of most of
the malloc code, but "mem" is the pointer that is returned to the
@@ -1511,9 +1513,9 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Free chunks are stored in circular doubly-linked lists, and look like this:
chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk |
+ | Size of previous chunk, if unallocated (P clear) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `head:' | Size of chunk, in bytes |P|
+ `head:' | Size of chunk, in bytes |A|0|P|
mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Forward pointer to next chunk in list |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -1525,6 +1527,8 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
`foot:' | Size of chunk, in bytes |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of next chunk, in bytes |A|0|0|
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The P (PREV_INUSE) bit, stored in the unused low-order bit of the
chunk size (which is always a multiple of two words), is an in-use
@@ -1537,12 +1541,21 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the size of the previous chunk, and might even get a memory
addressing fault when trying to do so.
+ The A (NON_MAIN_ARENA) bit is cleared for chunks on the initial,
+ main arena, described by the main_arena variable. When additional
+ threads are spawned, each thread receives its own arena (up to a
+ configurable limit, after which arenas are reused for multiple
+ threads), and the chunks in these arenas have the A bit set. To
+ find the arena for a chunk on such a non-main arena, heap_for_ptr
+ performs a bit mask operation and indirection through the ar_ptr
+ member of the per-heap header heap_info (see arena.c).
+
Note that the `foot' of the current chunk is actually represented
as the prev_size of the NEXT chunk. This makes it easier to
deal with alignments etc but can be very confusing when trying
to extend or adapt this code.
- The two exceptions to all this are
+ The three exceptions to all this are:
1. The special chunk `top' doesn't bother using the
trailing size field since there is no next contiguous chunk
@@ -1552,8 +1565,16 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2. Chunks allocated via mmap, which have the second-lowest-order
bit M (IS_MMAPPED) set in their size fields. Because they are
- allocated one-by-one, each must contain its own trailing size field.
-
+ allocated one-by-one, each must contain its own trailing size
+ field. If the M bit is set, the other bits are ignored
+ (because mmapped chunks are neither in an arena, nor adjacent
+ to a freed chunk). The M bit is also used for chunks which
+ originally came from a dumped heap via malloc_set_state in
+ hooks.c.
+
+ 3. Chunks in fastbins are treated as allocated chunks from the
+ point of view of the chunk allocator. They are consolidated
+ with their neighbors only in bulk, in malloc_consolidate.
*/
/*
@@ -1617,14 +1638,14 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#define PREV_INUSE 0x1
/* extract inuse bit of previous chunk */
-#define prev_inuse(p) ((p)->size & PREV_INUSE)
+#define prev_inuse(p) ((p)->mchunk_size & PREV_INUSE)
/* size field is or'ed with IS_MMAPPED if the chunk was obtained with mmap() */
#define IS_MMAPPED 0x2
/* check for mmap()'ed chunk */
-#define chunk_is_mmapped(p) ((p)->size & IS_MMAPPED)
+#define chunk_is_mmapped(p) ((p)->mchunk_size & IS_MMAPPED)
/* size field is or'ed with NON_MAIN_ARENA if the chunk was obtained
@@ -1632,8 +1653,11 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
the chunk to the user, if necessary. */
#define NON_MAIN_ARENA 0x4
-/* check for chunk from non-main arena */
-#define chunk_non_main_arena(p) ((p)->size & NON_MAIN_ARENA)
+/* Check for chunk from main arena. */
+#define chunk_main_arena(p) (((p)->mchunk_size & NON_MAIN_ARENA) == 0)
+
+/* Mark a chunk as not being on the main arena. */
+#define set_non_main_arena(p) ((p)->mchunk_size |= NON_MAIN_ARENA)
/*
@@ -1647,51 +1671,62 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#define SIZE_BITS (PREV_INUSE | IS_MMAPPED | NON_MAIN_ARENA)
/* Get size, ignoring use bits */
-#define chunksize(p) ((p)->size & ~(SIZE_BITS))
+#define chunksize(p) (chunksize_nomask (p) & ~(SIZE_BITS))
+/* Like chunksize, but do not mask SIZE_BITS. */
+#define chunksize_nomask(p) ((p)->mchunk_size)
/* Ptr to next physical malloc_chunk. */
-#define next_chunk(p) ((mchunkptr) (((char *) (p)) + ((p)->size & ~SIZE_BITS)))
+#define next_chunk(p) ((mchunkptr) (((char *) (p)) + chunksize (p)))
-/* Ptr to previous physical malloc_chunk */
-#define prev_chunk(p) ((mchunkptr) (((char *) (p)) - ((p)->prev_size)))
+/* Size of the chunk below P. Only valid if prev_inuse (P). */
+#define prev_size(p) ((p)->mchunk_prev_size)
+
+/* Set the size of the chunk below P. Only valid if prev_inuse (P). */
+#define set_prev_size(p, sz) ((p)->mchunk_prev_size = (sz))
+
+/* Ptr to previous physical malloc_chunk. Only valid if prev_inuse (P). */
+#define prev_chunk(p) ((mchunkptr) (((char *) (p)) - prev_size (p)))
/* Treat space at ptr + offset as a chunk */
#define chunk_at_offset(p, s) ((mchunkptr) (((char *) (p)) + (s)))
/* extract p's inuse bit */
#define inuse(p) \
- ((((mchunkptr) (((char *) (p)) + ((p)->size & ~SIZE_BITS)))->size) & PREV_INUSE)
+ ((((mchunkptr) (((char *) (p)) + chunksize (p)))->mchunk_size) & PREV_INUSE)
/* set/clear chunk as being inuse without otherwise disturbing */
#define set_inuse(p) \
- ((mchunkptr) (((char *) (p)) + ((p)->size & ~SIZE_BITS)))->size |= PREV_INUSE
+ ((mchunkptr) (((char *) (p)) + chunksize (p)))->mchunk_size |= PREV_INUSE
#define clear_inuse(p) \
- ((mchunkptr) (((char *) (p)) + ((p)->size & ~SIZE_BITS)))->size &= ~(PREV_INUSE)
+ ((mchunkptr) (((char *) (p)) + chunksize (p)))->mchunk_size &= ~(PREV_INUSE)
/* check/set/clear inuse bits in known places */
#define inuse_bit_at_offset(p, s) \
- (((mchunkptr) (((char *) (p)) + (s)))->size & PREV_INUSE)
+ (((mchunkptr) (((char *) (p)) + (s)))->mchunk_size & PREV_INUSE)
#define set_inuse_bit_at_offset(p, s) \
- (((mchunkptr) (((char *) (p)) + (s)))->size |= PREV_INUSE)
+ (((mchunkptr) (((char *) (p)) + (s)))->mchunk_size |= PREV_INUSE)
#define clear_inuse_bit_at_offset(p, s) \
- (((mchunkptr) (((char *) (p)) + (s)))->size &= ~(PREV_INUSE))
+ (((mchunkptr) (((char *) (p)) + (s)))->mchunk_size &= ~(PREV_INUSE))
/* Set size at head, without disturbing its use bit */
-#define set_head_size(p, s) ((p)->size = (((p)->size & SIZE_BITS) | (s)))
+#define set_head_size(p, s) ((p)->mchunk_size = (((p)->mchunk_size & SIZE_BITS) | (s)))
/* Set size/use field */
-#define set_head(p, s) ((p)->size = (s))
+#define set_head(p, s) ((p)->mchunk_size = (s))
/* Set size at footer (only when chunk is not in use) */
-#define set_foot(p, s) (((mchunkptr) ((char *) (p) + (s)))->prev_size = (s))
+#define set_foot(p, s) (((mchunkptr) ((char *) (p) + (s)))->mchunk_prev_size = (s))
+#pragma GCC poison mchunk_size
+#pragma GCC poison mchunk_prev_size
+
/*
-------------------- Internal data structures --------------------
@@ -1766,7 +1801,7 @@ typedef struct malloc_chunk *mbinptr;
else { \
FD->bk = BK; \
BK->fd = FD; \
- if (!in_smallbin_range (P->size) \
+ if (!in_smallbin_range (chunksize_nomask (P)) \
&& __builtin_expect (P->fd_nextsize != NULL, 0)) { \
if (__builtin_expect (P->fd_nextsize->bk_nextsize != P, 0) \
|| __builtin_expect (P->bk_nextsize->fd_nextsize != P, 0)) \
@@ -2033,7 +2068,7 @@ typedef struct malloc_chunk *mfastbinptr;
struct malloc_state
{
/* Serialize access. */
- mutex_t mutex;
+ __libc_lock_define (, mutex);
/* Flags (formerly in max_fast). */
int flags;
@@ -2146,13 +2181,11 @@ static struct malloc_par mp_ =
#endif
};
-
/* Non public mallopt parameters. */
-#define M_ARENA_TEST -7
-#define M_ARENA_MAX -8
+#if USE_TCACHE
#define M_TCACHE_COUNT -9
#define M_TCACHE_MAX -10
-
+#endif
/* Maximum size of memory handled in fastbins. */
static INTERNAL_SIZE_T global_max_fast;
@@ -2340,7 +2373,7 @@ do_check_chunk (mstate av, mchunkptr p)
assert (((char *) p) < min_address || ((char *) p) >= max_address);
}
/* chunk is page-aligned */
- assert (((p->prev_size + sz) & (GLRO (dl_pagesize) - 1)) == 0);
+ assert (((prev_size (p) + sz) & (GLRO (dl_pagesize) - 1)) == 0);
/* mem is aligned */
assert (aligned_OK (chunk2mem (p)));
}
@@ -2368,7 +2401,7 @@ do_check_free_chunk (mstate av, mchunkptr p)
assert ((sz & MALLOC_ALIGN_MASK) == 0);
assert (aligned_OK (chunk2mem (p)));
/* ... matching footer field */
- assert (next->prev_size == sz);
+ assert (prev_size (p) == sz);
/* ... and is fully consolidated */
assert (prev_inuse (p));
assert (next == av->top || inuse (next));
@@ -2433,10 +2466,10 @@ do_check_remalloced_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T s)
if (!chunk_is_mmapped (p))
{
assert (av == arena_for_chunk (p));
- if (chunk_non_main_arena (p))
- assert (av != &main_arena);
- else
+ if (chunk_main_arena (p))
assert (av == &main_arena);
+ else
+ assert (av != &main_arena);
}
do_check_inuse_chunk (av, p);
@@ -2729,12 +2762,13 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
{
correction = MALLOC_ALIGNMENT - front_misalign;
p = (mchunkptr) (mm + correction);
- p->prev_size = correction;
+ set_prev_size (p, correction);
set_head (p, (size - correction) | IS_MMAPPED);
}
else
{
p = (mchunkptr) mm;
+ set_prev_size (p, 0);
set_head (p, size | IS_MMAPPED);
}
@@ -3098,11 +3132,10 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
intentional. We need the fencepost, even if old_top otherwise gets
lost.
*/
- chunk_at_offset (old_top, old_size)->size =
- (2 * SIZE_SZ) | PREV_INUSE;
-
- chunk_at_offset (old_top, old_size + 2 * SIZE_SZ)->size =
- (2 * SIZE_SZ) | PREV_INUSE;
+ set_head (chunk_at_offset (old_top, old_size),
+ (2 * SIZE_SZ) | PREV_INUSE);
+ set_head (chunk_at_offset (old_top, old_size + 2 * SIZE_SZ),
+ (2 * SIZE_SZ) | PREV_INUSE);
/* If possible, release the rest. */
if (old_size >= MINSIZE)
@@ -3234,11 +3267,8 @@ munmap_chunk (mchunkptr p)
if (DUMPED_MAIN_ARENA_CHUNK (p))
return;
- uintptr_t block = (uintptr_t) p - p->prev_size;
- size_t total_size = p->prev_size + size;
-#if 0
- fprintf(stderr, "DJ: p %p sz %5lx ps %lx s %lx\n", p, (int64_t)p->size, (int64_t)p->prev_size, (int64_t)size);
-#endif
+ uintptr_t block = (uintptr_t) p - prev_size (p);
+ size_t total_size = prev_size (p) + size;
/* Unfortunately we have to do the compilers job by hand here. Normally
we would test BLOCK and TOTAL-SIZE separately for compliance with the
page size. But gcc does not recognize the optimization possibility
@@ -3268,7 +3298,7 @@ internal_function
mremap_chunk (mchunkptr p, size_t new_size)
{
size_t pagesize = GLRO (dl_pagesize);
- INTERNAL_SIZE_T offset = p->prev_size;
+ INTERNAL_SIZE_T offset = prev_size (p);
INTERNAL_SIZE_T size = chunksize (p);
char *cp;
@@ -3292,7 +3322,7 @@ mremap_chunk (mchunkptr p, size_t new_size)
assert (aligned_OK (chunk2mem (p)));
- assert ((p->prev_size == offset));
+ assert (prev_size (p) == offset);
set_head (p, (new_size - offset) | IS_MMAPPED);
INTERNAL_SIZE_T new;
@@ -3319,7 +3349,7 @@ typedef struct TCache {
} TCache;
static TCache *tcache_list = NULL;
-static mutex_t tcache_mutex = _LIBC_LOCK_INITIALIZER;
+__libc_lock_define_initialized (static, tcache_mutex);
static __thread TCache tcache = {0,0,0,{0},{0}};
@@ -3328,7 +3358,7 @@ tcache_thread_freeres (void)
{
if (tcache.initted == 1)
{
- (void) mutex_lock (&tcache_mutex);
+ libc_lock_lock (tcache_mutex);
tcache.initted = 2;
if (tcache.next)
tcache.next->prev = tcache.prev;
@@ -3336,7 +3366,7 @@ tcache_thread_freeres (void)
tcache.prev->next = tcache.next;
else
tcache_list = tcache.next;
- (void) mutex_unlock (&tcache_mutex);
+ libc_lock_unlock (tcache_mutex);
}
}
text_set_element (__libc_thread_subfreeres, tcache_thread_freeres);
@@ -3373,12 +3403,12 @@ __libc_malloc (size_t bytes)
if (tcache.initted == 0)
{
tcache.initted = 1;
- (void) mutex_lock (&tcache_mutex);
+ __libc_lock_lock (tcache_mutex);
tcache.next = tcache_list;
if (tcache.next)
tcache.next->prev = &tcache;
tcache_list = &tcache;
- (void) mutex_unlock (&tcache_mutex);
+ __libc_lock_unlock (tcache_mutex);
}
if (tc_idx < mp_.tcache_max
@@ -3480,7 +3510,7 @@ __libc_malloc (size_t bytes)
threads see our changes, even though we're sending this chunk
up to the app. */
if (ar_ptr != NULL)
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
__MTB_TRACE_RECORD ();
__MTB_TRACE_SET(ptr2, ent);
@@ -3505,7 +3535,7 @@ __libc_malloc (size_t bytes)
}
if (ar_ptr != NULL)
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
assert (!victim || chunk_is_mmapped (mem2chunk (victim)) ||
ar_ptr == arena_for_chunk (mem2chunk (victim)));
@@ -3553,8 +3583,8 @@ __libc_free (void *mem)
/* See if the dynamic brk/mmap threshold needs adjusting.
Dumped fake mmapped chunks do not affect the threshold. */
if (!mp_.no_dyn_threshold
- && p->size > mp_.mmap_threshold
- && p->size <= DEFAULT_MMAP_THRESHOLD_MAX
+ && chunksize_nomask (p) > mp_.mmap_threshold
+ && chunksize_nomask (p) <= DEFAULT_MMAP_THRESHOLD_MAX
&& !DUMPED_MAIN_ARENA_CHUNK (p))
{
mp_.mmap_threshold = chunksize (p);
@@ -3724,13 +3754,13 @@ __libc_realloc (void *oldmem, size_t bytes)
return newmem;
}
- (void) mutex_lock (&ar_ptr->mutex);
+ __libc_lock_lock (ar_ptr->mutex);
/* We expect _int_realloc() to call MTB_TRACE_RECORD for us, if it
returns non-NULL. */
newp = _int_realloc (ar_ptr, oldp, oldsize, nb);
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
assert (!newp || chunk_is_mmapped (mem2chunk (newp)) ||
ar_ptr == arena_for_chunk (mem2chunk (newp)));
@@ -3838,7 +3868,7 @@ _mid_memalign (size_t alignment, size_t bytes, void *address)
}
if (ar_ptr != NULL)
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
assert (!p || chunk_is_mmapped (mem2chunk (p)) ||
ar_ptr == arena_for_chunk (mem2chunk (p)));
@@ -3987,7 +4017,7 @@ __libc_calloc (size_t n, size_t elem_size)
}
if (av != NULL)
- (void) mutex_unlock (&av->mutex);
+ __libc_lock_unlock (av->mutex);
__MTB_TRACE_RECORD ();
@@ -4267,7 +4297,7 @@ _int_malloc (mstate av, size_t bytes)
bck->fd = bin;
if (av != &main_arena)
- victim->size |= NON_MAIN_ARENA;
+ set_non_main_arena (victim);
check_malloced_chunk (av, victim, nb);
#if USE_TCACHE
/* While we're here, if we see other chunk of the same size,
@@ -4287,7 +4317,7 @@ _int_malloc (mstate av, size_t bytes)
bck = tc_victim->bk;
set_inuse_bit_at_offset (tc_victim, nb);
if (av != &main_arena)
- tc_victim->size |= NON_MAIN_ARENA;
+ set_non_main_arena (tc_victim);
bin->bk = bck;
bck->fd = bin;
@@ -4364,8 +4394,9 @@ _int_malloc (mstate av, size_t bytes)
{
__MTB_TRACE_PATH(unsorted_remove);
bck = victim->bk;
- if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0)
- || __builtin_expect (victim->size > av->system_mem, 0))
+ if (__builtin_expect (chunksize_nomask (victim) <= 2 * SIZE_SZ, 0)
+ || __builtin_expect (chunksize_nomask (victim)
+ > av->system_mem, 0))
malloc_printerr (check_action, "malloc(): memory corruption",
chunk2mem (victim), av);
size = chunksize (victim);
@@ -4428,7 +4459,7 @@ _int_malloc (mstate av, size_t bytes)
{
set_inuse_bit_at_offset (victim, size);
if (av != &main_arena)
- victim->size |= NON_MAIN_ARENA;
+ set_non_main_arena (victim);
#if USE_TCACHE
/* Fill cache first, return to user only if cache fills.
@@ -4446,7 +4477,6 @@ _int_malloc (mstate av, size_t bytes)
else
{
#endif
-
check_malloced_chunk (av, victim, nb);
//_m_printf("%d: return %p\n", __LINE__, victim);
void *p = chunk2mem (victim);
@@ -4477,8 +4507,9 @@ _int_malloc (mstate av, size_t bytes)
/* Or with inuse bit to speed comparisons */
size |= PREV_INUSE;
/* if smaller than smallest, bypass loop below */
- assert ((bck->bk->size & NON_MAIN_ARENA) == 0);
- if ((unsigned long) (size) < (unsigned long) (bck->bk->size))
+ assert (chunk_main_arena (bck->bk));
+ if ((unsigned long) (size)
+ < (unsigned long) chunksize_nomask (bck->bk))
{
fwd = bck;
bck = bck->bk;
@@ -4489,14 +4520,15 @@ _int_malloc (mstate av, size_t bytes)
}
else
{
- assert ((fwd->size & NON_MAIN_ARENA) == 0);
- while ((unsigned long) size < fwd->size)
+ assert (chunk_main_arena (fwd));
+ while ((unsigned long) size < chunksize_nomask (fwd))
{
fwd = fwd->fd_nextsize;
- assert ((fwd->size & NON_MAIN_ARENA) == 0);
+ assert (chunk_main_arena (fwd));
}
- if ((unsigned long) size == (unsigned long) fwd->size)
+ if ((unsigned long) size
+ == (unsigned long) chunksize_nomask (fwd))
/* Always insert in the second position. */
fwd = fwd->fd;
else
@@ -4548,8 +4580,9 @@ _int_malloc (mstate av, size_t bytes)
bin = bin_at (av, idx);
/* skip scan if empty or largest chunk is too small */
- if ((victim = first (bin)) != bin &&
- (unsigned long) (victim->size) >= (unsigned long) (nb))
+ if ((victim = first (bin)) != bin
+ && (unsigned long) chunksize_nomask (victim)
+ >= (unsigned long) (nb))
{
victim = victim->bk_nextsize;
while (((unsigned long) (size = chunksize (victim)) <
@@ -4558,7 +4591,9 @@ _int_malloc (mstate av, size_t bytes)
/* Avoid removing the first entry for a size so that the skip
list does not have to be rerouted. */
- if (victim != last (bin) && victim->size == victim->fd->size)
+ if (victim != last (bin)
+ && chunksize_nomask (victim)
+ == chunksize_nomask (victim->fd))
victim = victim->fd;
remainder_size = size - nb;
@@ -4569,7 +4604,7 @@ _int_malloc (mstate av, size_t bytes)
{
set_inuse_bit_at_offset (victim, size);
if (av != &main_arena)
- victim->size |= NON_MAIN_ARENA;
+ set_non_main_arena (victim);
}
/* Split */
else
@@ -4680,7 +4715,7 @@ _int_malloc (mstate av, size_t bytes)
{
set_inuse_bit_at_offset (victim, size);
if (av != &main_arena)
- victim->size |= NON_MAIN_ARENA;
+ set_non_main_arena (victim);
}
/* Split */
@@ -4833,7 +4868,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
errstr = "free(): invalid pointer";
errout:
if (!have_lock && locked)
- (void) mutex_unlock (&av->mutex);
+ __libc_lock_unlock (av->mutex);
malloc_printerr (check_action, errstr, chunk2mem (p), av);
return;
}
@@ -4879,7 +4914,8 @@ _int_free (mstate av, mchunkptr p, int have_lock)
#endif
) {
- if (__builtin_expect (chunk_at_offset (p, size)->size <= 2 * SIZE_SZ, 0)
+ if (__builtin_expect (chunksize_nomask (chunk_at_offset (p, size))
+ <= 2 * SIZE_SZ, 0)
|| __builtin_expect (chunksize (chunk_at_offset (p, size))
>= av->system_mem, 0))
{
@@ -4888,9 +4924,9 @@ _int_free (mstate av, mchunkptr p, int have_lock)
after getting the lock. */
if (have_lock
|| ({ assert (locked == 0);
- mutex_lock(&av->mutex);
+ __libc_lock_lock (av->mutex);
locked = 1;
- chunk_at_offset (p, size)->size <= 2 * SIZE_SZ
+ chunksize_nomask (chunk_at_offset (p, size)) <= 2 * SIZE_SZ
|| chunksize (chunk_at_offset (p, size)) >= av->system_mem;
}))
{
@@ -4899,7 +4935,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
}
if (! have_lock)
{
- (void)mutex_unlock(&av->mutex);
+ __libc_lock_unlock (av->mutex);
locked = 0;
}
}
@@ -4946,7 +4982,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
else if (!chunk_is_mmapped(p)) {
if (! have_lock) {
- (void)mutex_lock(&av->mutex);
+ __libc_lock_lock (av->mutex);
locked = 1;
}
@@ -4975,7 +5011,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
}
nextsize = chunksize(nextchunk);
- if (__builtin_expect (nextchunk->size <= 2 * SIZE_SZ, 0)
+ if (__builtin_expect (chunksize_nomask (nextchunk) <= 2 * SIZE_SZ, 0)
|| __builtin_expect (nextsize >= av->system_mem, 0))
{
errstr = "free(): invalid next size (normal)";
@@ -4986,7 +5022,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
/* consolidate backward */
if (!prev_inuse(p)) {
- prevsize = p->prev_size;
+ prevsize = prev_size (p);
size += prevsize;
p = chunk_at_offset(p, -((long) prevsize));
unlink(av, p, bck, fwd);
@@ -5080,7 +5116,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
if (! have_lock) {
assert (locked);
- (void)mutex_unlock(&av->mutex);
+ __libc_lock_unlock (av->mutex);
}
}
/*
@@ -5155,12 +5191,12 @@ static void malloc_consolidate(mstate av)
__MTB_TRACE_PATH(fastbin_remove);
/* Slightly streamlined version of consolidation code in free() */
- size = p->size & ~(PREV_INUSE|NON_MAIN_ARENA);
+ size = chunksize (p);
nextchunk = chunk_at_offset(p, size);
nextsize = chunksize(nextchunk);
if (!prev_inuse(p)) {
- prevsize = p->prev_size;
+ prevsize = prev_size (p);
size += prevsize;
p = chunk_at_offset(p, -((long) prevsize));
unlink(av, p, bck, fwd);
@@ -5238,7 +5274,7 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize,
/* We must call __MTB_TRACE_RECORD if we return non-NULL. */
/* oldmem size */
- if (__builtin_expect (oldp->size <= 2 * SIZE_SZ, 0)
+ if (__builtin_expect (chunksize_nomask (oldp) <= 2 * SIZE_SZ, 0)
|| __builtin_expect (oldsize >= av->system_mem, 0))
{
errstr = "realloc(): invalid old size";
@@ -5254,7 +5290,7 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize,
next = chunk_at_offset (oldp, oldsize);
INTERNAL_SIZE_T nextsize = chunksize (next);
- if (__builtin_expect (next->size <= 2 * SIZE_SZ, 0)
+ if (__builtin_expect (chunksize_nomask (next) <= 2 * SIZE_SZ, 0)
|| __builtin_expect (nextsize >= av->system_mem, 0))
{
errstr = "realloc(): invalid next size";
@@ -5444,7 +5480,7 @@ _int_memalign (mstate av, size_t alignment, size_t bytes)
/* For mmapped chunks, just adjust offset */
if (chunk_is_mmapped (p))
{
- newp->prev_size = p->prev_size + leadsize;
+ set_prev_size (newp, prev_size (p) + leadsize);
set_head (newp, newsize | IS_MMAPPED);
return chunk2mem (newp);
}
@@ -5557,9 +5593,9 @@ __malloc_trim (size_t s)
mstate ar_ptr = &main_arena;
do
{
- (void) mutex_lock (&ar_ptr->mutex);
+ __libc_lock_lock (ar_ptr->mutex);
result |= mtrim (ar_ptr, s);
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
ar_ptr = ar_ptr->next;
}
@@ -5688,9 +5724,9 @@ __libc_mallinfo (void)
ar_ptr = &main_arena;
do
{
- (void) mutex_lock (&ar_ptr->mutex);
+ __libc_lock_lock (ar_ptr->mutex);
int_mallinfo (ar_ptr, &m);
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
ar_ptr = ar_ptr->next;
}
@@ -5720,7 +5756,7 @@ __malloc_stats (void)
struct mallinfo mi;
memset (&mi, 0, sizeof (mi));
- (void) mutex_lock (&ar_ptr->mutex);
+ __libc_lock_lock (ar_ptr->mutex);
int_mallinfo (ar_ptr, &mi);
fprintf (stderr, "Arena %d:\n", i);
fprintf (stderr, "system bytes = %10u\n", (unsigned int) mi.arena);
@@ -5731,7 +5767,7 @@ __malloc_stats (void)
#endif
system_b += mi.arena;
in_use_b += mi.uordblks;
- (void) mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
ar_ptr = ar_ptr->next;
if (ar_ptr == &main_arena)
break;
@@ -5750,6 +5786,91 @@ __malloc_stats (void)
/*
------------------------------ mallopt ------------------------------
*/
+static inline int
+__always_inline
+do_set_trim_threshold (size_t value)
+{
+ LIBC_PROBE (memory_mallopt_trim_threshold, 3, value, mp_.trim_threshold,
+ mp_.no_dyn_threshold);
+ mp_.trim_threshold = value;
+ mp_.no_dyn_threshold = 1;
+ return 1;
+}
+
+static inline int
+__always_inline
+do_set_top_pad (size_t value)
+{
+ LIBC_PROBE (memory_mallopt_top_pad, 3, value, mp_.top_pad,
+ mp_.no_dyn_threshold);
+ mp_.top_pad = value;
+ mp_.no_dyn_threshold = 1;
+ return 1;
+}
+
+static inline int
+__always_inline
+do_set_mmap_threshold (size_t value)
+{
+ /* Forbid setting the threshold too high. */
+ if (value <= HEAP_MAX_SIZE / 2)
+ {
+ LIBC_PROBE (memory_mallopt_mmap_threshold, 3, value, mp_.mmap_threshold,
+ mp_.no_dyn_threshold);
+ mp_.mmap_threshold = value;
+ mp_.no_dyn_threshold = 1;
+ return 1;
+ }
+ return 0;
+}
+
+static inline int
+__always_inline
+do_set_mmaps_max (int32_t value)
+{
+ LIBC_PROBE (memory_mallopt_mmap_max, 3, value, mp_.n_mmaps_max,
+ mp_.no_dyn_threshold);
+ mp_.n_mmaps_max = value;
+ mp_.no_dyn_threshold = 1;
+ return 1;
+}
+
+static inline int
+__always_inline
+do_set_mallopt_check (int32_t value)
+{
+ LIBC_PROBE (memory_mallopt_check_action, 2, value, check_action);
+ check_action = value;
+ return 1;
+}
+
+static inline int
+__always_inline
+do_set_perturb_byte (int32_t value)
+{
+ LIBC_PROBE (memory_mallopt_perturb, 2, value, perturb_byte);
+ perturb_byte = value;
+ return 1;
+}
+
+static inline int
+__always_inline
+do_set_arena_test (size_t value)
+{
+ LIBC_PROBE (memory_mallopt_arena_test, 2, value, mp_.arena_test);
+ mp_.arena_test = value;
+ return 1;
+}
+
+static inline int
+__always_inline
+do_set_arena_max (size_t value)
+{
+ LIBC_PROBE (memory_mallopt_arena_max, 2, value, mp_.arena_max);
+ mp_.arena_max = value;
+ return 1;
+}
+
int
__libc_mallopt (int param_number, int value)
@@ -5759,7 +5880,7 @@ __libc_mallopt (int param_number, int value)
if (__malloc_initialized < 0)
ptmalloc_init ();
- (void) mutex_lock (&av->mutex);
+ __libc_lock_lock (av->mutex);
/* Ensure initialization/consolidation */
malloc_consolidate (av);
@@ -5778,63 +5899,37 @@ __libc_mallopt (int param_number, int value)
break;
case M_TRIM_THRESHOLD:
- LIBC_PROBE (memory_mallopt_trim_threshold, 3, value,
- mp_.trim_threshold, mp_.no_dyn_threshold);
- mp_.trim_threshold = value;
- mp_.no_dyn_threshold = 1;
+ do_set_trim_threshold (value);
break;
case M_TOP_PAD:
- LIBC_PROBE (memory_mallopt_top_pad, 3, value,
- mp_.top_pad, mp_.no_dyn_threshold);
- mp_.top_pad = value;
- mp_.no_dyn_threshold = 1;
+ do_set_top_pad (value);
break;
case M_MMAP_THRESHOLD:
- /* Forbid setting the threshold too high. */
- if ((unsigned long) value > HEAP_MAX_SIZE / 2)
- res = 0;
- else
- {
- LIBC_PROBE (memory_mallopt_mmap_threshold, 3, value,
- mp_.mmap_threshold, mp_.no_dyn_threshold);
- mp_.mmap_threshold = value;
- mp_.no_dyn_threshold = 1;
- }
+ res = do_set_mmap_threshold (value);
break;
case M_MMAP_MAX:
- LIBC_PROBE (memory_mallopt_mmap_max, 3, value,
- mp_.n_mmaps_max, mp_.no_dyn_threshold);
- mp_.n_mmaps_max = value;
- mp_.no_dyn_threshold = 1;
+ do_set_mmaps_max (value);
break;
case M_CHECK_ACTION:
- LIBC_PROBE (memory_mallopt_check_action, 2, value, check_action);
- check_action = value;
+ do_set_mallopt_check (value);
break;
case M_PERTURB:
- LIBC_PROBE (memory_mallopt_perturb, 2, value, perturb_byte);
- perturb_byte = value;
+ do_set_perturb_byte (value);
break;
case M_ARENA_TEST:
if (value > 0)
- {
- LIBC_PROBE (memory_mallopt_arena_test, 2, value, mp_.arena_test);
- mp_.arena_test = value;
- }
+ do_set_arena_test (value);
break;
case M_ARENA_MAX:
if (value > 0)
- {
- LIBC_PROBE (memory_mallopt_arena_max, 2, value, mp_.arena_max);
- mp_.arena_max = value;
- }
+ do_set_arena_test (value);
break;
#if USE_TCACHE
case M_TCACHE_COUNT:
@@ -5857,7 +5952,7 @@ __libc_mallopt (int param_number, int value)
break;
#endif
}
- (void) mutex_unlock (&av->mutex);
+ __libc_lock_unlock (av->mutex);
return res;
}
libc_hidden_def (__libc_mallopt)
@@ -6114,7 +6209,7 @@ __malloc_info (int options, FILE *fp)
} sizes[NFASTBINS + NBINS - 1];
#define nsizes (sizeof (sizes) / sizeof (sizes[0]))
- mutex_lock (&ar_ptr->mutex);
+ __libc_lock_lock (ar_ptr->mutex);
for (size_t i = 0; i < NFASTBINS; ++i)
{
@@ -6157,12 +6252,13 @@ __malloc_info (int options, FILE *fp)
if (r != NULL)
while (r != bin)
{
+ size_t r_size = chunksize_nomask (r);
++sizes[NFASTBINS - 1 + i].count;
- sizes[NFASTBINS - 1 + i].total += r->size;
+ sizes[NFASTBINS - 1 + i].total += r_size;
sizes[NFASTBINS - 1 + i].from
- = MIN (sizes[NFASTBINS - 1 + i].from, r->size);
+ = MIN (sizes[NFASTBINS - 1 + i].from, r_size);
sizes[NFASTBINS - 1 + i].to = MAX (sizes[NFASTBINS - 1 + i].to,
- r->size);
+ r_size);
r = r->fd;
}
@@ -6173,7 +6269,7 @@ __malloc_info (int options, FILE *fp)
avail += sizes[NFASTBINS - 1 + i].total;
}
- mutex_unlock (&ar_ptr->mutex);
+ __libc_lock_unlock (ar_ptr->mutex);
total_nfastblocks += nfastblocks;
total_fastavail += fastavail;
@@ -6263,8 +6359,6 @@ strong_alias (__libc_mallopt, __mallopt) weak_alias (__libc_mallopt, mallopt)
weak_alias (__malloc_stats, malloc_stats)
weak_alias (__malloc_usable_size, malloc_usable_size)
weak_alias (__malloc_trim, malloc_trim)
-weak_alias (__malloc_get_state, malloc_get_state)
-weak_alias (__malloc_set_state, malloc_set_state)
/* ------------------------------------------------------------
diff --git a/malloc/malloc.h b/malloc/malloc.h
index 54b1862035..e0c27887cc 100644
--- a/malloc/malloc.h
+++ b/malloc/malloc.h
@@ -134,13 +134,6 @@ extern void malloc_stats (void) __THROW;
/* Output information about state of allocator to stream FP. */
extern int malloc_info (int __options, FILE *__fp) __THROW;
-/* Record the state of all malloc variables in an opaque data structure. */
-extern void *malloc_get_state (void) __THROW;
-
-/* Restore the state of all malloc variables from data obtained with
- malloc_get_state(). */
-extern int malloc_set_state (void *__ptr) __THROW;
-
/* Hooks for debugging and user-defined versions. */
extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr,
const void *)
diff --git a/malloc/tst-interpose-aux-nothread.c b/malloc/tst-interpose-aux-nothread.c
new file mode 100644
index 0000000000..0eae66fa6c
--- /dev/null
+++ b/malloc/tst-interpose-aux-nothread.c
@@ -0,0 +1,20 @@
+/* Interposed malloc, version without threading support.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#define INTERPOSE_THREADS 0
+#include "tst-interpose-aux.c"
diff --git a/malloc/tst-interpose-aux-thread.c b/malloc/tst-interpose-aux-thread.c
new file mode 100644
index 0000000000..354e4d8ed1
--- /dev/null
+++ b/malloc/tst-interpose-aux-thread.c
@@ -0,0 +1,20 @@
+/* Interposed malloc, version with threading support.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#define INTERPOSE_THREADS 1
+#include "tst-interpose-aux.c"
diff --git a/malloc/tst-interpose-aux.c b/malloc/tst-interpose-aux.c
new file mode 100644
index 0000000000..77866b2e5d
--- /dev/null
+++ b/malloc/tst-interpose-aux.c
@@ -0,0 +1,270 @@
+/* Minimal malloc implementation for interposition tests.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#include "tst-interpose-aux.h"
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/uio.h>
+#include <unistd.h>
+
+#if INTERPOSE_THREADS
+#include <pthread.h>
+#endif
+
+/* Print the error message and terminate the process with status 1. */
+__attribute__ ((noreturn))
+__attribute__ ((format (printf, 1, 2)))
+static void *
+fail (const char *format, ...)
+{
+ /* This assumes that vsnprintf will not call malloc. It does not do
+ so for the format strings we use. */
+ char message[4096];
+ va_list ap;
+ va_start (ap, format);
+ vsnprintf (message, sizeof (message), format, ap);
+ va_end (ap);
+
+ enum { count = 3 };
+ struct iovec iov[count];
+
+ iov[0].iov_base = (char *) "error: ";
+ iov[1].iov_base = (char *) message;
+ iov[2].iov_base = (char *) "\n";
+
+ for (int i = 0; i < count; ++i)
+ iov[i].iov_len = strlen (iov[i].iov_base);
+
+ int unused __attribute__ ((unused));
+ unused = writev (STDOUT_FILENO, iov, count);
+ _exit (1);
+}
+
+#if INTERPOSE_THREADS
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+static void
+lock (void)
+{
+#if INTERPOSE_THREADS
+ int ret = pthread_mutex_lock (&mutex);
+ if (ret != 0)
+ {
+ errno = ret;
+ fail ("pthread_mutex_lock: %m");
+ }
+#endif
+}
+
+static void
+unlock (void)
+{
+#if INTERPOSE_THREADS
+ int ret = pthread_mutex_unlock (&mutex);
+ if (ret != 0)
+ {
+ errno = ret;
+ fail ("pthread_mutex_unlock: %m");
+ }
+#endif
+}
+
+struct __attribute__ ((aligned (__alignof__ (max_align_t)))) allocation_header
+{
+ size_t allocation_index;
+ size_t allocation_size;
+};
+
+/* Array of known allocations, to track invalid frees. */
+enum { max_allocations = 65536 };
+static struct allocation_header *allocations[max_allocations];
+static size_t allocation_index;
+static size_t deallocation_count;
+
+/* Sanity check for successful malloc interposition. */
+__attribute__ ((destructor))
+static void
+check_for_allocations (void)
+{
+ if (allocation_index == 0)
+ {
+ /* Make sure that malloc is called at least once from libc. */
+ void *volatile ptr = strdup ("ptr");
+ free (ptr);
+ /* Compiler barrier. The strdup function calls malloc, which
+ updates allocation_index, but strdup is marked __THROW, so
+ the compiler could optimize away the reload. */
+ __asm__ volatile ("" ::: "memory");
+ /* If the allocation count is still zero, it means we did not
+ interpose malloc successfully. */
+ if (allocation_index == 0)
+ fail ("malloc does not seem to have been interposed");
+ }
+}
+
+static struct allocation_header *get_header (const char *op, void *ptr)
+{
+ struct allocation_header *header = ((struct allocation_header *) ptr) - 1;
+ if (header->allocation_index >= allocation_index)
+ fail ("%s: %p: invalid allocation index: %zu (not less than %zu)",
+ op, ptr, header->allocation_index, allocation_index);
+ if (allocations[header->allocation_index] != header)
+ fail ("%s: %p: allocation pointer does not point to header, but %p",
+ op, ptr, allocations[header->allocation_index]);
+ return header;
+}
+
+/* Internal helper functions. Those must be called while the lock is
+ acquired. */
+
+static void *
+malloc_internal (size_t size)
+{
+ if (allocation_index == max_allocations)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+ size_t allocation_size = size + sizeof (struct allocation_header);
+ if (allocation_size < size)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ size_t index = allocation_index++;
+ void *result = mmap (NULL, allocation_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (result == MAP_FAILED)
+ return NULL;
+ allocations[index] = result;
+ *allocations[index] = (struct allocation_header)
+ {
+ .allocation_index = index,
+ .allocation_size = allocation_size
+ };
+ return allocations[index] + 1;
+}
+
+static void
+free_internal (const char *op, struct allocation_header *header)
+{
+ size_t index = header->allocation_index;
+ int result = mprotect (header, header->allocation_size, PROT_NONE);
+ if (result != 0)
+ fail ("%s: mprotect (%p, %zu): %m", op, header, header->allocation_size);
+ /* Catch double-free issues. */
+ allocations[index] = NULL;
+ ++deallocation_count;
+}
+
+static void *
+realloc_internal (void *ptr, size_t new_size)
+{
+ struct allocation_header *header = get_header ("realloc", ptr);
+ size_t old_size = header->allocation_size - sizeof (struct allocation_header);
+ if (old_size >= new_size)
+ return ptr;
+
+ void *newptr = malloc_internal (new_size);
+ if (newptr == NULL)
+ return NULL;
+ memcpy (newptr, ptr, old_size);
+ free_internal ("realloc", header);
+ return newptr;
+}
+
+/* Public interfaces. These functions must perform locking. */
+
+size_t
+malloc_allocation_count (void)
+{
+ lock ();
+ size_t count = allocation_index;
+ unlock ();
+ return count;
+}
+
+size_t
+malloc_deallocation_count (void)
+{
+ lock ();
+ size_t count = deallocation_count;
+ unlock ();
+ return count;
+}
+void *
+malloc (size_t size)
+{
+ lock ();
+ void *result = malloc_internal (size);
+ unlock ();
+ return result;
+}
+
+void
+free (void *ptr)
+{
+ if (ptr == NULL)
+ return;
+ lock ();
+ struct allocation_header *header = get_header ("free", ptr);
+ free_internal ("free", header);
+ unlock ();
+}
+
+void *
+calloc (size_t a, size_t b)
+{
+ if (b > 0 && a > SIZE_MAX / b)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+ lock ();
+ /* malloc_internal uses mmap, so the memory is zeroed. */
+ void *result = malloc_internal (a * b);
+ unlock ();
+ return result;
+}
+
+void *
+realloc (void *ptr, size_t n)
+{
+ if (n ==0)
+ {
+ free (ptr);
+ return NULL;
+ }
+ else if (ptr == NULL)
+ return malloc (n);
+ else
+ {
+ lock ();
+ void *result = realloc_internal (ptr, n);
+ unlock ();
+ return result;
+ }
+}
diff --git a/malloc/tst-interpose-aux.h b/malloc/tst-interpose-aux.h
new file mode 100644
index 0000000000..2fb22d312a
--- /dev/null
+++ b/malloc/tst-interpose-aux.h
@@ -0,0 +1,30 @@
+/* Statistics interface for the minimal malloc implementation.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#ifndef TST_INTERPOSE_AUX_H
+#define TST_INTERPOSE_AUX_H
+
+#include <stddef.h>
+
+/* Return the number of allocations performed. */
+size_t malloc_allocation_count (void);
+
+/* Return the number of deallocations performed. */
+size_t malloc_deallocation_count (void);
+
+#endif /* TST_INTERPOSE_AUX_H */
diff --git a/malloc/tst-interpose-nothread.c b/malloc/tst-interpose-nothread.c
new file mode 100644
index 0000000000..9acb572098
--- /dev/null
+++ b/malloc/tst-interpose-nothread.c
@@ -0,0 +1,20 @@
+/* Malloc interposition test, dynamically-linked version without threads.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#define INTERPOSE_THREADS 0
+#include "tst-interpose-skeleton.c"
diff --git a/malloc/tst-interpose-skeleton.c b/malloc/tst-interpose-skeleton.c
new file mode 100644
index 0000000000..d1ebc9ae2d
--- /dev/null
+++ b/malloc/tst-interpose-skeleton.c
@@ -0,0 +1,204 @@
+/* Test driver for malloc interposition tests.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#if INTERPOSE_THREADS
+#include <pthread.h>
+#endif
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+/* Fills BUFFER with a test string. */
+static void
+line_string (int number, char *buffer, size_t length)
+{
+ for (size_t i = 0; i < length - 2; ++i)
+ buffer[i] = 'A' + ((number + i) % 26);
+ buffer[length - 2] = '\n';
+ buffer[length - 1] = '\0';
+}
+
+/* Perform the tests. */
+static void *
+run_tests (void *closure)
+{
+ char *temp_file_path;
+ int fd = create_temp_file ("tst-malloc-interpose", &temp_file_path);
+ if (fd < 0)
+ _exit (1);
+
+ /* Line lengths excluding the line terminator. */
+ static const int line_lengths[] = { 0, 45, 80, 2, 8201, 0, 17, -1 };
+
+ /* Fill the test file with data. */
+ {
+ FILE *fp = fdopen (fd, "w");
+ for (int lineno = 0; line_lengths[lineno] >= 0; ++lineno)
+ {
+ char buffer[line_lengths[lineno] + 2];
+ line_string (lineno, buffer, sizeof (buffer));
+ fprintf (fp, "%s", buffer);
+ }
+
+ if (ferror (fp))
+ {
+ printf ("error: fprintf: %m\n");
+ _exit (1);
+ }
+ if (fclose (fp) != 0)
+ {
+ printf ("error: fclose: %m\n");
+ _exit (1);
+ }
+ }
+
+ /* Read the test file. This tests libc-internal allocation with
+ realloc. */
+ {
+ FILE *fp = fopen (temp_file_path, "r");
+
+ char *actual = NULL;
+ size_t actual_size = 0;
+ for (int lineno = 0; ; ++lineno)
+ {
+ errno = 0;
+ ssize_t result = getline (&actual, &actual_size, fp);
+ if (result == 0)
+ {
+ printf ("error: invalid return value 0 from getline\n");
+ _exit (1);
+ }
+ if (result < 0 && errno != 0)
+ {
+ printf ("error: getline: %m\n");
+ _exit (1);
+ }
+ if (result < 0 && line_lengths[lineno] >= 0)
+ {
+ printf ("error: unexpected end of file after line %d\n", lineno);
+ _exit (1);
+ }
+ if (result > 0 && line_lengths[lineno] < 0)
+ {
+ printf ("error: no end of file after line %d\n", lineno);
+ _exit (1);
+ }
+ if (result == -1 && line_lengths[lineno] == -1)
+ /* End of file reached as expected. */
+ break;
+
+ if (result != line_lengths[lineno] + 1)
+ {
+ printf ("error: line length mismatch: expected %d, got %zd\n",
+ line_lengths[lineno], result);
+ _exit (1);
+ }
+
+ char expected[line_lengths[lineno] + 2];
+ line_string (lineno, expected, sizeof (expected));
+ if (strcmp (actual, expected) != 0)
+ {
+ printf ("error: line mismatch\n");
+ printf ("error: expected: [[%s]]\n", expected);
+ printf ("error: actual: [[%s]]\n", actual);
+ _exit (1);
+ }
+ }
+
+ if (fclose (fp) != 0)
+ {
+ printf ("error: fclose (after reading): %m\n");
+ _exit (1);
+ }
+ }
+
+ free (temp_file_path);
+
+ /* Make sure that fork is working. */
+ pid_t pid = fork ();
+ if (pid == -1)
+ {
+ printf ("error: fork: %m\n");
+ _exit (1);
+ }
+ enum { exit_code = 55 };
+ if (pid == 0)
+ _exit (exit_code);
+ int status;
+ int ret = waitpid (pid, &status, 0);
+ if (ret < 0)
+ {
+ printf ("error: waitpid: %m\n");
+ _exit (1);
+ }
+ if (!WIFEXITED (status) || WEXITSTATUS (status) != exit_code)
+ {
+ printf ("error: unexpected exit status from child process: %d\n",
+ status);
+ _exit (1);
+ }
+
+ return NULL;
+}
+
+/* This is used to detect if malloc has not been successfully
+ interposed. The interposed malloc does not use brk/sbrk. */
+static void *initial_brk;
+__attribute__ ((constructor))
+static void
+set_initial_brk (void)
+{
+ initial_brk = sbrk (0);
+}
+
+/* Terminate the process if the break value has been changed. */
+__attribute__ ((destructor))
+static void
+check_brk (void)
+{
+ void *current = sbrk (0);
+ if (current != initial_brk)
+ {
+ printf ("error: brk changed from %p to %p; no interposition?\n",
+ initial_brk, current);
+ _exit (1);
+ }
+}
+
+static int
+do_test (void)
+{
+ check_brk ();
+
+#if INTERPOSE_THREADS
+ pthread_t thr = xpthread_create (NULL, run_tests, NULL);
+ xpthread_join (thr);
+#else
+ run_tests (NULL);
+#endif
+
+ check_brk ();
+
+ return 0;
+}
diff --git a/malloc/tst-interpose-static-nothread.c b/malloc/tst-interpose-static-nothread.c
new file mode 100644
index 0000000000..3fb2dd8777
--- /dev/null
+++ b/malloc/tst-interpose-static-nothread.c
@@ -0,0 +1,19 @@
+/* Malloc interposition test, static version without threads.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#include "tst-interpose-nothread.c"
diff --git a/malloc/tst-interpose-static-thread.c b/malloc/tst-interpose-static-thread.c
new file mode 100644
index 0000000000..c78ebc70ba
--- /dev/null
+++ b/malloc/tst-interpose-static-thread.c
@@ -0,0 +1,19 @@
+/* Malloc interposition test, static version with threads.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#include "tst-interpose-nothread.c"
diff --git a/malloc/tst-interpose-thread.c b/malloc/tst-interpose-thread.c
new file mode 100644
index 0000000000..d3e20c7457
--- /dev/null
+++ b/malloc/tst-interpose-thread.c
@@ -0,0 +1,20 @@
+/* Malloc interposition test, dynamically-linked version with threads.
+ Copyright (C) 2016 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, see <http://www.gnu.org/licenses/>. */
+
+#define INTERPOSE_THREADS 1
+#include "tst-interpose-skeleton.c"
diff --git a/malloc/tst-mallocstate.c b/malloc/tst-mallocstate.c
index a00d045985..7e081c548a 100644
--- a/malloc/tst-mallocstate.c
+++ b/malloc/tst-mallocstate.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Emulate Emacs heap dumping to test malloc_set_state.
+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
@@ -17,68 +18,488 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <stdbool.h>
#include <stdio.h>
+#include <string.h>
+#include <libc-symbols.h>
+#include <shlib-compat.h>
+
#include "malloc.h"
-static int errors = 0;
+/* Make the compatibility symbols availabile to this test case. */
+void *malloc_get_state (void);
+compat_symbol_reference (libc, malloc_get_state, malloc_get_state, GLIBC_2_0);
+int malloc_set_state (void *);
+compat_symbol_reference (libc, malloc_set_state, malloc_set_state, GLIBC_2_0);
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+/* Maximum object size in the fake heap. */
+enum { max_size = 64 };
+
+/* Allocation actions. These are randomized actions executed on the
+ dumped heap (see allocation_tasks below). They are interspersed
+ with operations on the new heap (see heap_activity). */
+enum allocation_action
+ {
+ action_free, /* Dumped and freed. */
+ action_realloc, /* Dumped and realloc'ed. */
+ action_realloc_same, /* Dumped and realloc'ed, same size. */
+ action_realloc_smaller, /* Dumped and realloc'ed, shrinked. */
+ action_count
+ };
+
+/* Dumped heap. Initialize it, so that the object is placed into the
+ .data section, for increased realism. The size is an upper bound;
+ we use about half of the space. */
+static size_t dumped_heap[action_count * max_size * max_size
+ / sizeof (size_t)] = {1};
+
+/* Next free space in the dumped heap. Also top of the heap at the
+ end of the initialization procedure. */
+static size_t *next_heap_chunk;
+
+/* Copied from malloc.c and hooks.c. The version is deliberately
+ lower than the final version of malloc_set_state. */
+#define NBINS 128
+#define MALLOC_STATE_MAGIC 0x444c4541l
+#define MALLOC_STATE_VERSION (0 * 0x100l + 4l)
+static struct
+{
+ long magic;
+ long version;
+ void *av[NBINS * 2 + 2];
+ char *sbrk_base;
+ int sbrked_mem_bytes;
+ unsigned long trim_threshold;
+ unsigned long top_pad;
+ unsigned int n_mmaps_max;
+ unsigned long mmap_threshold;
+ int check_action;
+ unsigned long max_sbrked_mem;
+ unsigned long max_total_mem;
+ unsigned int n_mmaps;
+ unsigned int max_n_mmaps;
+ unsigned long mmapped_mem;
+ unsigned long max_mmapped_mem;
+ int using_malloc_checking;
+ unsigned long max_fast;
+ unsigned long arena_test;
+ unsigned long arena_max;
+ unsigned long narenas;
+} save_state =
+ {
+ .magic = MALLOC_STATE_MAGIC,
+ .version = MALLOC_STATE_VERSION,
+ };
+
+/* Allocate a blob in the fake heap. */
+static void *
+dumped_heap_alloc (size_t length)
+{
+ /* malloc needs three state bits in the size field, so the minimum
+ alignment is 8 even on 32-bit architectures. malloc_set_state
+ should be compatible with such heaps even if it currently
+ provides more alignment to applications. */
+ enum
+ {
+ heap_alignment = 8,
+ heap_alignment_mask = heap_alignment - 1
+ };
+ _Static_assert (sizeof (size_t) <= heap_alignment,
+ "size_t compatible with heap alignment");
+
+ /* Need at least this many bytes for metadata and application
+ data. */
+ size_t chunk_size = sizeof (size_t) + length;
+ /* Round up the allocation size to the heap alignment. */
+ chunk_size += heap_alignment_mask;
+ chunk_size &= ~heap_alignment_mask;
+ if ((chunk_size & 3) != 0)
+ {
+ /* The lower three bits in the chunk size have to be 0. */
+ write_message ("error: dumped_heap_alloc computed invalid chunk size\n");
+ _exit (1);
+ }
+ if (next_heap_chunk == NULL)
+ /* Initialize the top of the heap. Add one word of zero padding,
+ to match existing practice. */
+ {
+ dumped_heap[0] = 0;
+ next_heap_chunk = dumped_heap + 1;
+ }
+ else
+ /* The previous chunk is allocated. */
+ chunk_size |= 1;
+ *next_heap_chunk = chunk_size;
+
+ /* User data starts after the chunk header. */
+ void *result = next_heap_chunk + 1;
+ next_heap_chunk += chunk_size / sizeof (size_t);
+
+ /* Mark the previous chunk as used. */
+ *next_heap_chunk = 1;
+ return result;
+}
+
+/* Global seed variable for the random number generator. */
+static unsigned long long global_seed;
+
+/* Simple random number generator. The numbers are in the range from
+ 0 to UINT_MAX (inclusive). */
+static unsigned int
+rand_next (unsigned long long *seed)
+{
+ /* Linear congruential generated as used for MMIX. */
+ *seed = *seed * 6364136223846793005ULL + 1442695040888963407ULL;
+ return *seed >> 32;
+}
+
+/* Fill LENGTH bytes at BUFFER with random contents, as determined by
+ SEED. */
+static void
+randomize_buffer (unsigned char *buffer, size_t length,
+ unsigned long long seed)
+{
+ for (size_t i = 0; i < length; ++i)
+ buffer[i] = rand_next (&seed);
+}
+/* Dumps the buffer to standard output, in hexadecimal. */
static void
-merror (const char *msg)
+dump_hex (unsigned char *buffer, size_t length)
{
- ++errors;
- printf ("Error: %s\n", msg);
+ for (int i = 0; i < length; ++i)
+ printf (" %02X", buffer[i]);
+}
+
+/* Set to true if an error is encountered. */
+static bool errors = false;
+
+/* Keep track of object allocations. */
+struct allocation
+{
+ unsigned char *data;
+ unsigned int size;
+ unsigned int seed;
+};
+
+/* Check that the allocation task allocation has the expected
+ contents. */
+static void
+check_allocation (const struct allocation *alloc, int index)
+{
+ size_t size = alloc->size;
+ if (alloc->data == NULL)
+ {
+ printf ("error: NULL pointer for allocation of size %zu at %d, seed %u\n",
+ size, index, alloc->seed);
+ errors = true;
+ return;
+ }
+
+ unsigned char expected[4096];
+ if (size > sizeof (expected))
+ {
+ printf ("error: invalid allocation size %zu at %d, seed %u\n",
+ size, index, alloc->seed);
+ errors = true;
+ return;
+ }
+ randomize_buffer (expected, size, alloc->seed);
+ if (memcmp (alloc->data, expected, size) != 0)
+ {
+ printf ("error: allocation %d data mismatch, size %zu, seed %u\n",
+ index, size, alloc->seed);
+ printf (" expected:");
+ dump_hex (expected, size);
+ putc ('\n', stdout);
+ printf (" actual:");
+ dump_hex (alloc->data, size);
+ putc ('\n', stdout);
+ errors = true;
+ }
+}
+
+/* A heap allocation combined with pending actions on it. */
+struct allocation_task
+{
+ struct allocation allocation;
+ enum allocation_action action;
+};
+
+/* Allocation tasks. Initialized by init_allocation_tasks and used by
+ perform_allocations. */
+enum { allocation_task_count = action_count * max_size };
+static struct allocation_task allocation_tasks[allocation_task_count];
+
+/* Fisher-Yates shuffle of allocation_tasks. */
+static void
+shuffle_allocation_tasks (void)
+{
+ for (int i = 0; i < allocation_task_count - 1; ++i)
+ {
+ /* Pick pair in the tail of the array. */
+ int j = i + (rand_next (&global_seed)
+ % ((unsigned) (allocation_task_count - i)));
+ if (j < 0 || j >= allocation_task_count)
+ {
+ write_message ("error: test bug in shuffle\n");
+ _exit (1);
+ }
+ /* Exchange. */
+ struct allocation_task tmp = allocation_tasks[i];
+ allocation_tasks[i] = allocation_tasks[j];
+ allocation_tasks[j] = tmp;
+ }
+}
+
+/* Set up the allocation tasks and the dumped heap. */
+static void
+initial_allocations (void)
+{
+ /* Initialize in a position-dependent way. */
+ for (int i = 0; i < allocation_task_count; ++i)
+ allocation_tasks[i] = (struct allocation_task)
+ {
+ .allocation =
+ {
+ .size = 1 + (i / action_count),
+ .seed = i,
+ },
+ .action = i % action_count
+ };
+
+ /* Execute the tasks in a random order. */
+ shuffle_allocation_tasks ();
+
+ /* Initialize the contents of the dumped heap. */
+ for (int i = 0; i < allocation_task_count; ++i)
+ {
+ struct allocation_task *task = allocation_tasks + i;
+ task->allocation.data = dumped_heap_alloc (task->allocation.size);
+ randomize_buffer (task->allocation.data, task->allocation.size,
+ task->allocation.seed);
+ }
+
+ for (int i = 0; i < allocation_task_count; ++i)
+ check_allocation (&allocation_tasks[i].allocation, i);
+}
+
+/* Indicates whether init_heap has run. This variable needs to be
+ volatile because malloc is declared __THROW, which implies it is a
+ leaf function, but we expect it to run our hooks. */
+static volatile bool heap_initialized;
+
+/* Executed by glibc malloc, through __malloc_initialize_hook
+ below. */
+static void
+init_heap (void)
+{
+ write_message ("info: performing heap initialization\n");
+ heap_initialized = true;
+
+ /* Populate the dumped heap. */
+ initial_allocations ();
+
+ /* Complete initialization of the saved heap data structure. */
+ save_state.sbrk_base = (void *) dumped_heap;
+ save_state.sbrked_mem_bytes = sizeof (dumped_heap);
+ /* Top pointer. Adjust so that it points to the start of struct
+ malloc_chunk. */
+ save_state.av[2] = (void *) (next_heap_chunk - 1);
+
+ /* Integrate the dumped heap into the process heap. */
+ if (malloc_set_state (&save_state) != 0)
+ {
+ write_message ("error: malloc_set_state failed\n");
+ _exit (1);
+ }
+}
+
+/* Interpose the initialization callback. */
+void (*volatile __malloc_initialize_hook) (void) = init_heap;
+
+/* Simulate occasional unrelated heap activity in the non-dumped
+ heap. */
+enum { heap_activity_allocations_count = 32 };
+static struct allocation heap_activity_allocations
+ [heap_activity_allocations_count] = {};
+static int heap_activity_seed_counter = 1000 * 1000;
+
+static void
+heap_activity (void)
+{
+ /* Only do this from time to time. */
+ if ((rand_next (&global_seed) % 4) == 0)
+ {
+ int slot = rand_next (&global_seed) % heap_activity_allocations_count;
+ struct allocation *alloc = heap_activity_allocations + slot;
+ if (alloc->data == NULL)
+ {
+ alloc->size = rand_next (&global_seed) % (4096U + 1);
+ alloc->data = xmalloc (alloc->size);
+ alloc->seed = heap_activity_seed_counter++;
+ randomize_buffer (alloc->data, alloc->size, alloc->seed);
+ check_allocation (alloc, 1000 + slot);
+ }
+ else
+ {
+ check_allocation (alloc, 1000 + slot);
+ free (alloc->data);
+ alloc->data = NULL;
+ }
+ }
+}
+
+static void
+heap_activity_deallocate (void)
+{
+ for (int i = 0; i < heap_activity_allocations_count; ++i)
+ free (heap_activity_allocations[i].data);
+}
+
+/* Perform a full heap check across the dumped heap allocation tasks,
+ and the simulated heap activity directly above. */
+static void
+full_heap_check (void)
+{
+ /* Dumped heap. */
+ for (int i = 0; i < allocation_task_count; ++i)
+ if (allocation_tasks[i].allocation.data != NULL)
+ check_allocation (&allocation_tasks[i].allocation, i);
+
+ /* Heap activity allocations. */
+ for (int i = 0; i < heap_activity_allocations_count; ++i)
+ if (heap_activity_allocations[i].data != NULL)
+ check_allocation (heap_activity_allocations + i, i);
+}
+
+/* Used as an optimization barrier to force a heap allocation. */
+__attribute__ ((noinline, noclone))
+static void
+my_free (void *ptr)
+{
+ free (ptr);
}
static int
do_test (void)
{
- void *p1, *p2;
- void *save_state;
- long i;
+ my_free (malloc (1));
+ if (!heap_initialized)
+ {
+ printf ("error: heap was not initialized by malloc\n");
+ return 1;
+ }
- errno = 0;
+ /* The first pass performs the randomly generated allocation
+ tasks. */
+ write_message ("info: first pass through allocation tasks\n");
+ full_heap_check ();
+
+ /* Execute the post-undump tasks in a random order. */
+ shuffle_allocation_tasks ();
+
+ for (int i = 0; i < allocation_task_count; ++i)
+ {
+ heap_activity ();
+ struct allocation_task *task = allocation_tasks + i;
+ switch (task->action)
+ {
+ case action_free:
+ check_allocation (&task->allocation, i);
+ free (task->allocation.data);
+ task->allocation.data = NULL;
+ break;
- p1 = malloc (10);
- if (p1 == NULL)
- merror ("malloc (10) failed.");
+ case action_realloc:
+ check_allocation (&task->allocation, i);
+ task->allocation.data = xrealloc
+ (task->allocation.data, task->allocation.size + max_size);
+ check_allocation (&task->allocation, i);
+ break;
- p2 = malloc (20);
- if (p2 == NULL)
- merror ("malloc (20) failed.");
+ case action_realloc_same:
+ check_allocation (&task->allocation, i);
+ task->allocation.data = xrealloc
+ (task->allocation.data, task->allocation.size);
+ check_allocation (&task->allocation, i);
+ break;
- free (malloc (10));
+ case action_realloc_smaller:
+ check_allocation (&task->allocation, i);
+ size_t new_size = task->allocation.size - 1;
+ task->allocation.data = xrealloc (task->allocation.data, new_size);
+ if (new_size == 0)
+ {
+ if (task->allocation.data != NULL)
+ {
+ printf ("error: realloc with size zero did not deallocate\n");
+ errors = true;
+ }
+ /* No further action on this task. */
+ task->action = action_free;
+ }
+ else
+ {
+ task->allocation.size = new_size;
+ check_allocation (&task->allocation, i);
+ }
+ break;
- for (i = 0; i < 100; ++i)
+ case action_count:
+ abort ();
+ }
+ full_heap_check ();
+ }
+
+ /* The second pass frees the objects which were allocated during the
+ first pass. */
+ write_message ("info: second pass through allocation tasks\n");
+
+ shuffle_allocation_tasks ();
+ for (int i = 0; i < allocation_task_count; ++i)
{
- save_state = malloc_get_state ();
- if (save_state == NULL)
+ heap_activity ();
+ struct allocation_task *task = allocation_tasks + i;
+ switch (task->action)
{
- merror ("malloc_get_state () failed.");
+ case action_free:
+ /* Already freed, nothing to do. */
+ break;
+
+ case action_realloc:
+ case action_realloc_same:
+ case action_realloc_smaller:
+ check_allocation (&task->allocation, i);
+ free (task->allocation.data);
+ task->allocation.data = NULL;
break;
+
+ case action_count:
+ abort ();
}
- /*free (malloc (10)); This could change the top chunk! */
- malloc_set_state (save_state);
- p1 = realloc (p1, i * 4 + 4);
- if (p1 == NULL)
- merror ("realloc (i*4) failed.");
- free (save_state);
+ full_heap_check ();
}
- p1 = realloc (p1, 40);
- free (p2);
- p2 = malloc (10);
- if (p2 == NULL)
- merror ("malloc (10) failed.");
- free (p1);
-
- return errors != 0;
-}
+ heap_activity_deallocate ();
-/*
- * Local variables:
- * c-basic-offset: 2
- * End:
- */
+ /* Check that the malloc_get_state stub behaves in the intended
+ way. */
+ errno = 0;
+ if (malloc_get_state () != NULL)
+ {
+ printf ("error: malloc_get_state succeeded\n");
+ errors = true;
+ }
+ if (errno != ENOSYS)
+ {
+ printf ("error: malloc_get_state: %m\n");
+ errors = true;
+ }
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+ return errors;
+}
diff --git a/manual/argp.texi b/manual/argp.texi
index dae68099d5..bca3ca5ed9 100644
--- a/manual/argp.texi
+++ b/manual/argp.texi
@@ -347,7 +347,7 @@ be displayed in much the same manner as the options. This is known as a
If this flag is set, then the option @code{name} field is displayed
unmodified (e.g., no @samp{--} prefix is added) at the left-margin where
a @emph{short} option would normally be displayed, and this
-documentation string is left in it's usual place. For purposes of
+documentation string is left in its usual place. For purposes of
sorting, any leading whitespace and punctuation is ignored, unless the
first non-whitespace character is @samp{-}. This entry is displayed
after all options, after @code{OPTION_DOC} entries with a leading
@@ -692,7 +692,7 @@ parser function. @xref{Argp Parsing State}.
@safety{@prelim{}@mtunsafe{@mtasurace{:argpbuf} @mtsenv{} @mtslocale{}}@asunsafe{@ascuheap{} @ascuintl{} @asucorrupt{}}@acunsafe{@acsmem{} @acucorrupt{} @aculock{}}}
@c Just calls argp_state_help with stderr and ARGP_HELP_STD_USAGE.
Outputs the standard usage message for the argp parser referred to by
-@var{state} to @code{@var{state}->err_stream} and terminate the program
+@var{state} to @code{@var{state}->err_stream} and terminates the program
with @code{exit (argp_err_exit_status)}. @xref{Argp Global Variables}.
@end deftypefun
@@ -723,7 +723,7 @@ by the program name and @samp{:}, and followed by a @w{@samp{Try @dots{}
@c blank, release the buffer, call strerror_r with an automatic buffer,
@c print it out after colon and blank, put[w]c a line break, unlock the
@c stream, then exit unless ARGP_NO_EXIT.
-Similar to the standard gnu error-reporting function @code{error}, this
+Similar to the standard GNU error-reporting function @code{error}, this
prints the program name and @samp{:}, the printf format string
@var{fmt}, and the appropriate following args. If it is non-zero, the
standard unix error text for @var{errnum} is printed. If @var{status} is
@@ -1010,7 +1010,7 @@ Don't exit on errors, although they may still result in error messages.
@comment argp.h
@comment GNU
@item ARGP_LONG_ONLY
-Use the gnu getopt `long-only' rules for parsing arguments. This allows
+Use the GNU getopt `long-only' rules for parsing arguments. This allows
long-options to be recognized with only a single @samp{-}
(i.e., @samp{-help}). This results in a less useful interface, and its
use is discouraged as it conflicts with the way most GNU programs work
@@ -1213,7 +1213,7 @@ These example programs demonstrate the basic usage of argp.
@subsubsection A Minimal Program Using Argp
This is perhaps the smallest program possible that uses argp. It won't
-do much except give an error messages and exit when there are any
+do much except give an error message and exit when there are any
arguments, and prints a rather pointless message for @samp{--help}.
@smallexample
diff --git a/manual/arith.texi b/manual/arith.texi
index ea8ff48618..f0f3bb4031 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -20,6 +20,7 @@ These functions are declared in the header files @file{math.h} and
* Complex Numbers:: The types. Writing complex constants.
* Operations on Complex:: Projection, conjugation, decomposition.
* Parsing of Numbers:: Converting strings to numbers.
+* Printing of Floats:: Converting floating-point numbers to strings.
* System V Number Conversion:: An archaic way to convert numbers to strings.
@end menu
@@ -110,7 +111,9 @@ minimum possible values for each integer data type. The macro names
follow these examples: @code{INT32_MAX}, @code{UINT8_MAX},
@code{INT_FAST32_MIN}, @code{INT_LEAST64_MIN}, @code{UINTMAX_MAX},
@code{INTMAX_MAX}, @code{INTMAX_MIN}. Note that there are no macros for
-unsigned integer minima. These are always zero.
+unsigned integer minima. These are always zero. Similiarly, there
+are macros such as @code{INTMAX_WIDTH} for the width of these types.
+Those macros for integer type widths come from TS 18661-1:2014.
@cindex maximum possible integer
@cindex minimum possible integer
@@ -162,7 +165,7 @@ The remainder from the division.
@deftypefun div_t div (int @var{numerator}, int @var{denominator})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@c Functions in this section are pure, and thus safe.
-This function @code{div} computes the quotient and remainder from
+The function @code{div} computes the quotient and remainder from
the division of @var{numerator} by @var{denominator}, returning the
result in a structure of type @code{div_t}.
@@ -359,6 +362,23 @@ You should therefore use the specific macros whenever possible.
@comment math.h
@comment ISO
+@deftypefn {Macro} int iscanonical (@emph{float-type} @var{x})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+In some floating-point formats, some values have canonical (preferred)
+and noncanonical encodings (for IEEE interchange binary formats, all
+encodings are canonical). This macro returns a nonzero value if
+@var{x} has a canonical encoding. It is from TS 18661-1:2014.
+
+Note that some formats have multiple encodings of a value which are
+all equally canonical; @code{iscanonical} returns a nonzero value for
+all such encodings. Also, formats may have encodings that do not
+correspond to any valid value of the type. In ISO C terms these are
+@dfn{trap representations}; in @theglibc{}, @code{iscanonical} returns
+zero for such encodings.
+@end deftypefn
+
+@comment math.h
+@comment ISO
@deftypefn {Macro} int isfinite (@emph{float-type} @var{x})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
This macro returns a nonzero value if @var{x} is finite: not plus or
@@ -404,6 +424,22 @@ This macro returns a nonzero value if @var{x} is a signaling NaN
(sNaN). It is from TS 18661-1:2014.
@end deftypefn
+@comment math.h
+@comment ISO
+@deftypefn {Macro} int issubnormal (@emph{float-type} @var{x})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+This macro returns a nonzero value if @var{x} is subnormal. It is
+from TS 18661-1:2014.
+@end deftypefn
+
+@comment math.h
+@comment ISO
+@deftypefn {Macro} int iszero (@emph{float-type} @var{x})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+This macro returns a nonzero value if @var{x} is zero. It is from TS
+18661-1:2014.
+@end deftypefn
+
Another set of floating-point classification functions was provided by
BSD. @Theglibc{} also supports these functions; however, we
recommend that you use the ISO C99 macros in new code. Those are standard
@@ -532,7 +568,7 @@ Division: @math{0/0} or @math{@infinity{}/@infinity{}}.
Remainder: @math{x} REM @math{y}, where @math{y} is zero or @math{x} is
infinite.
@item
-Square root if the operand is less then zero. More generally, any
+Square root if the operand is less than zero. More generally, any
mathematical function evaluated outside its domain produces this
exception.
@item
@@ -675,6 +711,15 @@ such as by defining @code{_GNU_SOURCE}, and then you must include
@file{math.h}.)
@end deftypevr
+@comment math.h
+@comment ISO
+@deftypevr Macro float SNANF
+@deftypevrx Macro double SNAN
+@deftypevrx Macro {long double} SNANL
+These macros, defined by TS 18661-1:2014, are constant expressions for
+signaling NaNs.
+@end deftypevr
+
@w{IEEE 754} also allows for another unusual value: negative zero. This
value is produced when you divide a positive number by negative
infinity, or when a negative result is smaller than the limits of
@@ -759,6 +804,18 @@ non-zero value otherwise.
@comment fenv.h
@comment ISO
+@deftypefun int fesetexcept (int @var{excepts})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+This function sets the supported exception flags indicated by
+@var{excepts}, like @code{feraiseexcept}, but without causing enabled
+traps to be taken. @code{fesetexcept} is from TS 18661-1:2014.
+
+The function returns zero in case the operation was successful, a
+non-zero value otherwise.
+@end deftypefun
+
+@comment fenv.h
+@comment ISO
@deftypefun int fetestexcept (int @var{excepts})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Test whether the exception flags indicated by the parameter @var{except}
@@ -822,6 +879,17 @@ Note that the value stored in @code{fexcept_t} bears no resemblance to
the bit mask returned by @code{fetestexcept}. The type may not even be
an integer. Do not attempt to modify an @code{fexcept_t} variable.
+@comment fenv.h
+@comment ISO
+@deftypefun int fetestexceptflag (const fexcept_t *@var{flagp}, int @var{excepts})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+Test whether the exception flags indicated by the parameter
+@var{excepts} are set in the variable pointed to by @var{flagp}. If
+any of them are, a nonzero value is returned which specifies which
+exceptions are set. Otherwise the result is zero.
+@code{fetestexceptflag} is from TS 18661-1:2014.
+@end deftypefun
+
@node Math Error Reporting
@subsection Error Reporting by Mathematical Functions
@cindex errors, mathematical
@@ -969,7 +1037,7 @@ the calculation was negative, the result is @dfn{negative zero}.
Negative zero can also result from some operations on infinity, such as
@math{4/-@infinity{}}.
-At any time one of the above four rounding modes is selected. You can
+At any time, one of the above four rounding modes is selected. You can
find out which one with this function:
@comment fenv.h
@@ -990,7 +1058,7 @@ To change the rounding mode, use this function:
Changes the currently selected rounding mode to @var{round}. If
@var{round} does not correspond to one of the supported rounding modes
nothing is changed. @code{fesetround} returns zero if it changed the
-rounding mode, a nonzero value if the mode is not supported.
+rounding mode, or a nonzero value if the mode is not supported.
@end deftypefun
You should avoid changing the rounding mode if possible. It can be an
@@ -1104,6 +1172,39 @@ non-zero value otherwise.
@end deftypefun
@noindent
+TS 18661-1:2014 defines additional functions to save and restore
+floating-point control modes (such as the rounding mode and whether
+traps are enabled) while leaving other status (such as raised flags)
+unchanged.
+
+@vindex FE_DFL_MODE
+The special macro @code{FE_DFL_MODE} may be passed to
+@code{fesetmode}. It represents the floating-point control modes at
+program start.
+
+@comment fenv.h
+@comment ISO
+@deftypefun int fegetmode (femode_t *@var{modep})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+Store the floating-point control modes in the variable pointed to by
+@var{modep}.
+
+The function returns zero in case the operation was successful, a
+non-zero value otherwise.
+@end deftypefun
+
+@comment fenv.h
+@comment ISO
+@deftypefun int fesetmode (const femode_t *@var{modep})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+Set the floating-point control modes to those described by
+@var{modep}.
+
+The function returns zero in case the operation was successful, a
+non-zero value otherwise.
+@end deftypefun
+
+@noindent
To control for individual exceptions if raising them causes a trap to
occur, you can use the following two functions.
@@ -1113,8 +1214,8 @@ occur, you can use the following two functions.
@comment GNU
@deftypefun int feenableexcept (int @var{excepts})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-This functions enables traps for each of the exceptions as indicated by
-the parameter @var{except}. The individual exceptions are described in
+This function enables traps for each of the exceptions as indicated by
+the parameter @var{excepts}. The individual exceptions are described in
@ref{Status bit operations}. Only the specified exceptions are
enabled, the status of the other exceptions is not changed.
@@ -1126,8 +1227,8 @@ operation was successful, @code{-1} otherwise.
@comment GNU
@deftypefun int fedisableexcept (int @var{excepts})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-This functions disables traps for each of the exceptions as indicated by
-the parameter @var{except}. The individual exceptions are described in
+This function disables traps for each of the exceptions as indicated by
+the parameter @var{excepts}. The individual exceptions are described in
@ref{Status bit operations}. Only the specified exceptions are
disabled, the status of the other exceptions is not changed.
@@ -1763,6 +1864,56 @@ The argument @var{tagp} is used in an unspecified manner. On @w{IEEE
selects one. On other systems it may do nothing.
@end deftypefun
+@comment math.h
+@comment ISO
+@deftypefun int canonicalize (double *@var{cx}, const double *@var{x})
+@comment math.h
+@comment ISO
+@deftypefunx int canonicalizef (float *@var{cx}, const float *@var{x})
+@comment math.h
+@comment ISO
+@deftypefunx int canonicalizel (long double *@var{cx}, const long double *@var{x})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+In some floating-point formats, some values have canonical (preferred)
+and noncanonical encodings (for IEEE interchange binary formats, all
+encodings are canonical). These functions, defined by TS
+18661-1:2014, attempt to produce a canonical version of the
+floating-point value pointed to by @var{x}; if that value is a
+signaling NaN, they raise the invalid exception and produce a quiet
+NaN. If a canonical value is produced, it is stored in the object
+pointed to by @var{cx}, and these functions return zero. Otherwise
+(if a canonical value could not be produced because the object pointed
+to by @var{x} is not a valid representation of any floating-point
+value), the object pointed to by @var{cx} is unchanged and a nonzero
+value is returned.
+
+Note that some formats have multiple encodings of a value which are
+all equally canonical; when such an encoding is used as an input to
+this function, any such encoding of the same value (or of the
+corresponding quiet NaN, if that value is a signaling NaN) may be
+produced as output.
+@end deftypefun
+
+@comment math.h
+@comment ISO
+@deftypefun double getpayload (const double *@var{x})
+@comment math.h
+@comment ISO
+@deftypefunx float getpayloadf (const float *@var{x})
+@comment math.h
+@comment ISO
+@deftypefunx {long double} getpayloadl (const long double *@var{x})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+IEEE 754 defines the @dfn{payload} of a NaN to be an integer value
+encoded in the representation of the NaN. Payloads are typically
+propagated from NaN inputs to the result of a floating-point
+operation. These functions, defined by TS 18661-1:2014, return the
+payload of the NaN pointed to by @var{x} (returned as a positive
+integer, or positive zero, represented as a floating-point number); if
+@var{x} is not a NaN, they return an unspecified value. They raise no
+floating-point exceptions even for signaling NaNs.
+@end deftypefun
+
@node FP Comparison Functions
@subsection Floating-Point Comparison Functions
@cindex unordered comparison
@@ -1782,7 +1933,11 @@ undesirable. @w{ISO C99} therefore defines comparison functions that
do not raise exceptions when NaN is examined. All of the functions are
implemented as macros which allow their arguments to be of any
floating-point type. The macros are guaranteed to evaluate their
-arguments only once.
+arguments only once. TS 18661-1:2014 adds such a macro for an
+equality comparison that @emph{does} raise an exception for a NaN
+argument; it also adds functions that provide a total ordering on all
+floating-point values, including NaNs, without raising any exceptions
+even for signaling NaNs.
@comment math.h
@comment ISO
@@ -1841,6 +1996,52 @@ This macro determines whether its arguments are unordered. In other
words, it is true if @var{x} or @var{y} are NaN, and false otherwise.
@end deftypefn
+@comment math.h
+@comment ISO
+@deftypefn Macro int iseqsig (@emph{real-floating} @var{x}, @emph{real-floating} @var{y})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+This macro determines whether its arguments are equal. It is
+equivalent to @code{(@var{x}) == (@var{y})}, but it raises the invalid
+exception and sets @code{errno} to @code{EDOM} is either argument is a
+NaN.
+@end deftypefn
+
+@comment math.h
+@comment ISO
+@deftypefun int totalorder (double @var{x}, double @var{y})
+@comment ISO
+@deftypefunx int totalorderf (float @var{x}, float @var{y})
+@comment ISO
+@deftypefunx int totalorderl (long double @var{x}, long double @var{y})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+These functions determine whether the total order relationship,
+defined in IEEE 754-2008, is true for @var{x} and @var{y}, returning
+nonzero if it is true and zero if it is false. No exceptions are
+raised even for signaling NaNs. The relationship is true if they are
+the same floating-point value (including sign for zero and NaNs, and
+payload for NaNs), or if @var{x} comes before @var{y} in the following
+order: negative quiet NaNs, in order of decreasing payload; negative
+signaling NaNs, in order of decreasing payload; negative infinity;
+finite numbers, in ascending order, with negative zero before positive
+zero; positive infinity; positive signaling NaNs, in order of
+increasing payload; positive quiet NaNs, in order of increasing
+payload.
+@end deftypefun
+
+@comment math.h
+@comment ISO
+@deftypefun int totalordermag (double @var{x}, double @var{y})
+@comment ISO
+@deftypefunx int totalordermagf (float @var{x}, float @var{y})
+@comment ISO
+@deftypefunx int totalordermagl (long double @var{x}, long double @var{y})
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+These functions determine whether the total order relationship,
+defined in IEEE 754-2008, is true for the absolute values of @var{x}
+and @var{y}, returning nonzero if it is true and zero if it is false.
+No exceptions are raised even for signaling NaNs.
+@end deftypefun
+
Not all machines provide hardware support for these operations. On
machines that don't, the macros can be very slow. Therefore, you should
not use these functions when NaN is not a concern.
@@ -2645,6 +2846,46 @@ which take an additional argument, the locale to use in conversion.
See also @ref{Parsing of Integers}.
+@node Printing of Floats
+@section Printing of Floats
+
+@pindex stdlib.h
+The @samp{strfrom} functions are declared in @file{stdlib.h}.
+
+@comment stdlib.h
+@comment ISO/IEC TS 18661-1
+@deftypefun int strfromd (char *restrict @var{string}, size_t @var{size}, const char *restrict @var{format}, double @var{value})
+@deftypefunx int strfromf (char *restrict @var{string}, size_t @var{size}, const char *restrict @var{format}, float @var{value})
+@deftypefunx int strfroml (char *restrict @var{string}, size_t @var{size}, const char *restrict @var{format}, long double @var{value})
+@safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
+@comment these functions depend on __printf_fp and __printf_fphex, which are
+@comment AS-unsafe (ascuheap) and AC-unsafe (acsmem).
+The functions @code{strfromd} (``string-from-double''), @code{strfromf}
+(``string-from-float''), and @code{strfroml} (``string-from-long-double'')
+convert the floating-point number @var{value} to a string of characters and
+stores them into the area pointed to by @var{string}. The conversion
+writes at most @var{size} characters and respects the format specified by
+@var{format}.
+
+The format string must start with the character @samp{%}. An optional
+precision follows, which starts with a period, @samp{.}, and may be
+followed by a decimal integer, representing the precision. If a decimal
+integer is not specified after the period, the precision is taken to be
+zero. The character @samp{*} is not allowed. Finally, the format string
+ends with one of the following conversion specifiers: @samp{a}, @samp{A},
+@samp{e}, @samp{E}, @samp{f}, @samp{F}, @samp{g} or @samp{G} (@pxref{Table
+of Output Conversions}). Invalid format strings result in undefined
+behavior.
+
+These functions return the number of characters that would have been
+written to @var{string} had @var{size} been sufficiently large, not
+counting the terminating null character. Thus, the null-terminated output
+has been completely written if and only if the returned value is less than
+@var{size}.
+
+These functions were introduced by ISO/IEC TS 18661-1.
+@end deftypefun
+
@node System V Number Conversion
@section Old-fashioned System V number-to-string functions
diff --git a/manual/conf.texi b/manual/conf.texi
index 82a8766775..78b7a4d01a 100644
--- a/manual/conf.texi
+++ b/manual/conf.texi
@@ -148,7 +148,7 @@ should always be defined even if there is no specific imposed limit.
POSIX defines certain system-specific options that not all POSIX systems
support. Since these options are provided in the kernel, not in the
library, simply using @theglibc{} does not guarantee any of these
-features is supported; it depends on the system you are using.
+features are supported; it depends on the system you are using.
@pindex unistd.h
You can test for the availability of a given option using the macros in
@@ -466,7 +466,7 @@ Inquire about the parameter corresponding to @code{_POSIX_AIO_MAX}.
@comment unistd.h
@comment POSIX.1
@item _SC_AIO_PRIO_DELTA_MAX
-Inquire the value by which a process can decrease its asynchronous I/O
+Inquire about the value by which a process can decrease its asynchronous I/O
priority level from its own scheduling priority. This corresponds to the
run-time invariant value @code{AIO_PRIO_DELTA_MAX}.
@@ -573,7 +573,7 @@ Inquire about the parameter corresponding to @code{_POSIX_PII_OSI_M}.
@comment unistd.h
@comment POSIX.1g
@item _SC_T_IOV_MAX
-Inquire the value of the value associated with the @code{T_IOV_MAX}
+Inquire about the value associated with the @code{T_IOV_MAX}
variable.
@comment unistd.h
@@ -888,7 +888,7 @@ Inquire about the number of bits in a variable of a register word.
@comment unistd.h
@comment X/Open
@item _SC_MB_LEN_MAX
-Inquire the maximum length of a multi-byte representation of a wide
+Inquire about the maximum length of a multi-byte representation of a wide
character value.
@comment unistd.h
@@ -1553,7 +1553,7 @@ the collating sequence for a locale.
@comment limits.h
@comment POSIX.2
@deftypevr Macro int EXPR_NEST_MAX
-The maximum number of expressions that can be nested within parenthesis
+The maximum number of expressions that can be nested within parentheses
by the @code{expr} utility.
@end deftypevr
diff --git a/manual/contrib.texi b/manual/contrib.texi
index c1b0245906..c1cea97c04 100644
--- a/manual/contrib.texi
+++ b/manual/contrib.texi
@@ -159,7 +159,7 @@ Ultrix 4 (@code{mips-dec-ultrix4}) and the port to the DEC Alpha
running OSF/1 (@code{alpha-dec-osf1}).
@item
-Mark Kettenis for implementing the @code{utmpx} interface and an utmp
+Mark Kettenis for implementing the @code{utmpx} interface and a utmp
daemon, and for a Hesiod NSS module.
@item
@@ -183,7 +183,7 @@ Jeff Law for various fixes.
@item
Doug Lea for contributing the memory allocation functions
-functions @code{malloc}, @code{realloc} and @code{free} and related
+@code{malloc}, @code{realloc} and @code{free} and related
code.
@item
@@ -358,7 +358,7 @@ package by Arthur David Olson and his many contributors.
@item
Some of the support code for Mach is taken from Mach 3.0 by CMU;
-the file if_ppp.h is also copyright by CMU, but under a different license;
+the file @file{if_ppp.h} is also copyright by CMU, but under a different license;
see the file @file{LICENSES} for the text of the licenses.
@item
diff --git a/manual/crypt.texi b/manual/crypt.texi
index 659688b98b..9f4474023e 100644
--- a/manual/crypt.texi
+++ b/manual/crypt.texi
@@ -307,7 +307,7 @@ defined in @file{crypt.h}.
@comment rpc/des_crypt.h
@comment SUNRPC
-@deftypefun int ecb_crypt (char *@var{key}, char *@var{blocks}, unsigned @var{len}, unsigned @var{mode})
+@deftypefun int ecb_crypt (char *@var{key}, char *@var{blocks}, unsigned int @var{len}, unsigned int @var{mode})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The function @code{ecb_crypt} encrypts or decrypts one or more blocks
@@ -320,7 +320,7 @@ least-significant bit of @code{key[7]}. The @var{key} should have the
correct parity.
@var{len} is the number of bytes in @var{blocks}. It should be a
-multiple of 8 (so that there is a whole number of blocks to encrypt).
+multiple of 8 (so that there are a whole number of blocks to encrypt).
@var{len} is limited to a maximum of @code{DES_MAXDATA} bytes.
The result of the encryption replaces the input in @var{blocks}.
@@ -390,7 +390,7 @@ This macro returns 1 if @var{err} is a `success' result code from
@comment rpc/des_crypt.h
@comment SUNRPC
-@deftypefun int cbc_crypt (char *@var{key}, char *@var{blocks}, unsigned @var{len}, unsigned @var{mode}, char *@var{ivec})
+@deftypefun int cbc_crypt (char *@var{key}, char *@var{blocks}, unsigned int @var{len}, unsigned int @var{mode}, char *@var{ivec})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The function @code{cbc_crypt} encrypts or decrypts one or more blocks
@@ -409,7 +409,7 @@ Usually, @var{ivec} is set to 8 random bytes before encryption starts.
Then the 8 random bytes are transmitted along with the encrypted data
(without themselves being encrypted), and passed back in as @var{ivec}
for decryption. Another possibility is to set @var{ivec} to 8 zeroes
-initially, and have the first the block encrypted consist of 8 random
+initially, and have the first block encrypted consist of 8 random
bytes.
Otherwise, all the parameters are similar to those for @code{ecb_crypt}.
diff --git a/manual/debug.texi b/manual/debug.texi
index 25492c3291..ac5121b061 100644
--- a/manual/debug.texi
+++ b/manual/debug.texi
@@ -90,12 +90,12 @@ contains a printable representation of the corresponding element of
determined), an offset into the function, and the actual return address
(in hexadecimal).
-Currently, the function name and offset only be obtained on systems that
+Currently, the function name and offset can only be obtained on systems that
use the ELF binary format for programs and libraries. On other systems,
only the hexadecimal return address will be present. Also, you may need
to pass additional flags to the linker to make the function names
available to the program. (For example, on systems using GNU ld, you
-must pass (@code{-rdynamic}.)
+must pass @code{-rdynamic}.)
The return value of @code{backtrace_symbols} is a pointer obtained via
the @code{malloc} function, and it is the responsibility of the caller
diff --git a/manual/examples/memstrm.c b/manual/examples/memstrm.c
index 0d443b1371..5701ba1f39 100644
--- a/manual/examples/memstrm.c
+++ b/manual/examples/memstrm.c
@@ -27,10 +27,10 @@ main (void)
stream = open_memstream (&bp, &size);
fprintf (stream, "hello");
fflush (stream);
- printf ("buf = `%s', size = %d\n", bp, size);
+ printf ("buf = `%s', size = %zu\n", bp, size);
fprintf (stream, ", world");
fclose (stream);
- printf ("buf = `%s', size = %d\n", bp, size);
+ printf ("buf = `%s', size = %zu\n", bp, size);
return 0;
}
diff --git a/manual/filesys.texi b/manual/filesys.texi
index a22c21f012..26758e626e 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -314,7 +314,7 @@ A symbolic link.
This member is a BSD extension. The symbol @code{_DIRENT_HAVE_D_TYPE}
is defined if this member is available. On systems where it is used, it
corresponds to the file type bits in the @code{st_mode} member of
-@code{struct stat}. If the value cannot be determine the member
+@code{struct stat}. If the value cannot be determined the member
value is DT_UNKNOWN. These two macros convert between @code{d_type}
values and @code{st_mode} values:
@@ -335,7 +335,7 @@ This returns the @code{st_mode} value corresponding to @var{dtype}.
This structure may contain additional members in the future. Their
availability is always announced in the compilation environment by a
-macro names @code{_DIRENT_HAVE_D_@var{xxx}} where @var{xxx} is replaced
+macro named @code{_DIRENT_HAVE_D_@var{xxx}} where @var{xxx} is replaced
by the name of the new member. For instance, the member @code{d_reclen}
available on some systems is announced through the macro
@code{_DIRENT_HAVE_D_RECLEN}.
@@ -723,7 +723,7 @@ the result.
The @code{scandir} function scans the contents of the directory selected
by @var{dir}. The result in *@var{namelist} is an array of pointers to
-structure of type @code{struct dirent} which describe all selected
+structures of type @code{struct dirent} which describe all selected
directory entries and which is allocated using @code{malloc}. Instead
of always getting all directory entries returned, the user supplied
function @var{selector} can be used to decide which entries are in the
@@ -742,7 +742,7 @@ directory could not be opened for reading or the malloc call failed) and
the global variable @code{errno} contains more information on the error.
@end deftypefun
-As described above the fourth argument to the @code{scandir} function
+As described above, the fourth argument to the @code{scandir} function
must be a pointer to a sorting function. For the convenience of the
programmer @theglibc{} contains implementations of functions which
are very helpful for this purpose.
@@ -1009,7 +1009,7 @@ the @var{filename} parameter and appending the names of all passed
directories and then the local file name. So the callback function can
use this parameter to access the file. @code{ftw} also calls
@code{stat} for the file and passes that information on to the callback
-function. If this @code{stat} call was not successful the failure is
+function. If this @code{stat} call is not successful the failure is
indicated by setting the third argument of the callback function to
@code{FTW_NS}. Otherwise it is set according to the description given
in the account of @code{__ftw_func_t} above.
@@ -1261,7 +1261,7 @@ purpose is to obtain information about the link. @code{link}, the
function that makes a hard link, does too. It makes a hard link to the
symbolic link, which one rarely wants.
-Some systems have for some functions operating on files have a limit on
+Some systems have, for some functions operating on files, a limit on
how many symbolic links are followed when resolving a path name. The
limit if it exists is published in the @file{sys/param.h} header file.
@@ -1271,7 +1271,7 @@ limit if it exists is published in the @file{sys/param.h} header file.
The macro @code{MAXSYMLINKS} specifies how many symlinks some function
will follow before returning @code{ELOOP}. Not all functions behave the
-same and this value is not the same a that returned for
+same and this value is not the same as that returned for
@code{_SC_SYMLOOP} by @code{sysconf}. In fact, the @code{sysconf}
result can indicate that there is no fixed limit although
@code{MAXSYMLINKS} exists and has a finite value.
@@ -1376,7 +1376,7 @@ In some situations it is desirable to resolve all the
symbolic links to get the real
name of a file where no prefix names a symbolic link which is followed
and no filename in the path is @code{.} or @code{..}. This is for
-instance desirable if files have to be compare in which case different
+instance desirable if files have to be compared in which case different
names can refer to the same inode.
@comment stdlib.h
@@ -1392,7 +1392,7 @@ result is passed back as the return value of the function in a block of
memory allocated with @code{malloc}. If the result is not used anymore
the memory should be freed with a call to @code{free}.
-If any of the path components is missing the function returns a NULL
+If any of the path components are missing the function returns a NULL
pointer. This is also what is returned if the length of the path
reaches or exceeds @code{PATH_MAX} characters. In any case
@code{errno} is set accordingly.
@@ -1448,7 +1448,7 @@ This function is declared in @file{stdlib.h}.
@end deftypefun
The advantage of using this function is that it is more widely
-available. The drawback is that it reports failures for long path on
+available. The drawback is that it reports failures for long paths on
systems which have no limits on the file name length.
@node Deleting Files
@@ -1828,8 +1828,8 @@ might not be detected as sparse at all. For practical applications,
this is not a problem.
@item unsigned int st_blksize
-The optimal block size for reading of writing this file, in bytes. You
-might use this size for allocating the buffer space for reading of
+The optimal block size for reading or writing this file, in bytes. You
+might use this size for allocating the buffer space for reading or
writing the file. (This is unrelated to @code{st_blocks}.)
@end table
@end deftp
@@ -2254,10 +2254,10 @@ This is the file type constant of a FIFO or pipe.
@end table
The POSIX.1b standard introduced a few more objects which possibly can
-be implemented as object in the filesystem. These are message queues,
+be implemented as objects in the filesystem. These are message queues,
semaphores, and shared memory objects. To allow differentiating these
-objects from other files the POSIX standard introduces three new test
-macros. But unlike the other macros it does not take the value of the
+objects from other files the POSIX standard introduced three new test
+macros. But unlike the other macros they do not take the value of the
@code{st_mode} field as the parameter. Instead they expect a pointer to
the whole @code{struct stat} structure.
@@ -2265,7 +2265,7 @@ the whole @code{struct stat} structure.
@comment POSIX
@deftypefn Macro int S_TYPEISMQ (struct stat *@var{s})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-If the system implement POSIX message queues as distinct objects and the
+If the system implements POSIX message queues as distinct objects and the
file is a message queue object, this macro returns a non-zero value.
In all other cases the result is zero.
@end deftypefn
@@ -2274,7 +2274,7 @@ In all other cases the result is zero.
@comment POSIX
@deftypefn Macro int S_TYPEISSEM (struct stat *@var{s})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-If the system implement POSIX semaphores as distinct objects and the
+If the system implements POSIX semaphores as distinct objects and the
file is a semaphore object, this macro returns a non-zero value.
In all other cases the result is zero.
@end deftypefn
@@ -2283,7 +2283,7 @@ In all other cases the result is zero.
@comment POSIX
@deftypefn Macro int S_TYPEISSHM (struct stat *@var{s})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-If the system implement POSIX shared memory objects as distinct objects
+If the system implements POSIX shared memory objects as distinct objects
and the file is a shared memory object, this macro returns a non-zero
value. In all other cases the result is zero.
@end deftypefn
@@ -2760,7 +2760,7 @@ allow write access to files like @file{/etc/passwd}, which normally can
be written only by the super-user, the modifying program will have to be
owned by @code{root} and the setuid-bit must be set.
-But beside the files the program is intended to change the user should
+But besides the files the program is intended to change the user should
not be allowed to access any file to which s/he would not have access
anyway. The program therefore must explicitly check whether @emph{the
user} would have the necessary access to a file, before it reads or
@@ -2780,7 +2780,7 @@ want to try to keep track of the diverse features that different systems
have. Using @code{access} is simple and automatically does whatever is
appropriate for the system you are using.
-@code{access} is @emph{only} only appropriate to use in setuid programs.
+@code{access} is @emph{only} appropriate to use in setuid programs.
A non-setuid program will always use the effective ID rather than the
real ID.
@@ -3230,7 +3230,7 @@ add (off_t at, void *block, size_t size)
The function @code{add} writes a block of memory at an arbitrary
position in the file. If the current size of the file is too small it
-is extended. Note the it is extended by a round number of pages. This
+is extended. Note that it is extended by a whole number of pages. This
is a requirement of @code{mmap}. The program has to keep track of the
real size, and when it has finished a final @code{ftruncate} call should
set the real size of the file.
diff --git a/manual/getopt.texi b/manual/getopt.texi
index aa4134b0e5..20e11ef2e2 100644
--- a/manual/getopt.texi
+++ b/manual/getopt.texi
@@ -110,7 +110,7 @@ is treated specially. It permits arguments that are not options to be
returned as if they were associated with option character @samp{\1}.
@item
-POSIX demands the following behavior: The first non-option stops option
+POSIX demands the following behavior: the first non-option stops option
processing. This mode is selected by either setting the environment
variable @code{POSIXLY_CORRECT} or beginning the @var{options} argument
string with a plus sign (@samp{+}).
@@ -256,7 +256,7 @@ options to accept (see above).
When @code{getopt_long} encounters a short option, it does the same
thing that @code{getopt} would do: it returns the character code for the
-option, and stores the options argument (if it has one) in @code{optarg}.
+option, and stores the option's argument (if it has one) in @code{optarg}.
When @code{getopt_long} encounters a long option, it takes actions based
on the @code{flag} and @code{val} fields of the definition of that
@@ -293,8 +293,8 @@ When @code{getopt_long} has no more options to handle, it returns
@var{argv} of the next remaining argument.
@end deftypefun
-Since long option names were used before the @code{getopt_long}
-options was invented there are program interfaces which require programs
+Since long option names were used before @code{getopt_long}
+was invented there are program interfaces which require programs
to recognize options like @w{@samp{-option value}} instead of
@w{@samp{--option value}}. To enable these programs to use the GNU
getopt functionality there is one more function available.
@@ -306,7 +306,7 @@ getopt functionality there is one more function available.
@c Same issues as getopt.
The @code{getopt_long_only} function is equivalent to the
-@code{getopt_long} function but it allows to specify the user of the
+@code{getopt_long} function but it allows the user of the
application to pass long options with only @samp{-} instead of
@samp{--}. The @samp{--} prefix is still recognized but instead of
looking through the short options if a @samp{-} is seen it is first
diff --git a/manual/install.texi b/manual/install.texi
index 79ee45fcdb..de1c2030d3 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -186,8 +186,8 @@ new warnings cause the build with @option{-Werror} to fail), you can
configure with @option{--disable-werror}.
@item --disable-mathvec
-By default for x86_64, @theglibc{} is built with vector math library.
-Use this option to disable vector math library.
+By default for x86_64, @theglibc{} is built with the vector math library.
+Use this option to disable the vector math library.
@item --build=@var{build-system}
@itemx --host=@var{host-system}
@@ -225,7 +225,7 @@ information for @theglibc{}.
To build the library and related programs, type @code{make}. This will
produce a lot of output, some of which may look like errors from
-@code{make} but isn't. Look for error messages from @code{make}
+@code{make} but aren't. Look for error messages from @code{make}
containing @samp{***}. Those indicate that something is seriously wrong.
The compilation process can take a long time, depending on the
@@ -402,6 +402,14 @@ the newest version of the compiler that is known to work for building
release time, GCC 5.3 is the newest compiler verified to work to build
@theglibc{}.
+For multi-arch support it is recommended to use a GCC which has been built with
+support for GNU indirect functions. This ensures that correct debugging
+information is generated for functions selected by IFUNC resolvers. This
+support can either be enabled by configuring GCC with
+@samp{--enable-gnu-indirect-function}, or by enabling it by default by setting
+@samp{default_gnu_indirect_function} variable for a particular architecture in
+the GCC source file @file{gcc/config.gcc}.
+
You can use whatever compiler you like to compile programs that use
@theglibc{}.
diff --git a/manual/job.texi b/manual/job.texi
index 095c26d930..72b55997d2 100644
--- a/manual/job.texi
+++ b/manual/job.texi
@@ -100,7 +100,7 @@ for allowing the user to interactively continue stopped jobs and switch
jobs between foreground and background.
@xref{Access to the Terminal}, for more information about I/O to the
-controlling terminal,
+controlling terminal.
@node Job Control is Optional, Controlling Terminal, Concepts of Job Control , Job Control
@section Job Control is Optional
diff --git a/manual/lang.texi b/manual/lang.texi
index 7f8a36800c..6281840473 100644
--- a/manual/lang.texi
+++ b/manual/lang.texi
@@ -560,7 +560,7 @@ recommend instead adding a prototype for the function you are calling.
The result of subtracting two pointers in C is always an integer, but the
precise data type varies from C compiler to C compiler. Likewise, the
data type of the result of @code{sizeof} also varies between compilers.
-ISO defines standard aliases for these two types, so you can refer to
+ISO C defines standard aliases for these two types, so you can refer to
them in a portable fashion. They are defined in the header file
@file{stddef.h}.
@pindex stddef.h
@@ -653,6 +653,88 @@ sizeof (@var{type}) * CHAR_BIT
@end smallexample
@end table
+That expression includes padding bits as well as value and sign bits.
+On all systems supported by @theglibc{}, standard integer types other
+than @code{_Bool} do not have any padding bits. TS 18661-1:2014
+defines additional macros for the width of integer types (the number
+of value and sign bits); these macros can also be used in @code{#if}
+preprocessor directives, whereas @code{sizeof} cannot. The following
+macros are defined in @file{limits.h}.
+
+@table @code
+@comment limits.h
+@comment ISO
+@item CHAR_WIDTH
+@comment limits.h
+@comment ISO
+@itemx SCHAR_WIDTH
+@comment limits.h
+@comment ISO
+@itemx UCHAR_WIDTH
+@comment limits.h
+@comment ISO
+@itemx SHRT_WIDTH
+@comment limits.h
+@comment ISO
+@itemx USHRT_WIDTH
+@comment limits.h
+@comment ISO
+@itemx INT_WIDTH
+@comment limits.h
+@comment ISO
+@itemx UINT_WIDTH
+@comment limits.h
+@comment ISO
+@itemx LONG_WIDTH
+@comment limits.h
+@comment ISO
+@itemx ULONG_WIDTH
+@comment limits.h
+@comment ISO
+@itemx LLONG_WIDTH
+@comment limits.h
+@comment ISO
+@itemx ULLONG_WIDTH
+
+These are the widths of the types @code{char}, @code{signed char},
+@code{unsigned char}, @code{short int}, @code{unsigned short int},
+@code{int}, @code{unsigned int}, @code{long int}, @code{unsigned long
+int}, @code{long long int} and @code{unsigned long long int},
+respectively.
+@end table
+
+Further such macros are defined in @file{stdint.h}. Apart from those
+for types specified by width (@pxref{Integers}), the following are
+defined.
+
+@table @code
+@comment stdint.h
+@comment ISO
+@item INTPTR_WIDTH
+@comment stdint.h
+@comment ISO
+@itemx UINTPTR_WIDTH
+@comment stdint.h
+@comment ISO
+@itemx PTRDIFF_WIDTH
+@comment stdint.h
+@comment ISO
+@itemx SIG_ATOMIC_WIDTH
+@comment stdint.h
+@comment ISO
+@itemx SIZE_WIDTH
+@comment stdint.h
+@comment ISO
+@itemx WCHAR_WIDTH
+@comment stdint.h
+@comment ISO
+@itemx WINT_WIDTH
+
+These are the widths of the types @code{intptr_t}, @code{uintptr_t},
+@code{ptrdiff_t}, @code{sig_atomic_t}, @code{size_t}, @code{wchar_t}
+and @code{wint_t}, respectively.
+@end table
+
@node Range of Type
@subsection Range of an Integer Type
@cindex integer type range
@@ -1061,7 +1143,7 @@ macros are supposed to be at least @code{10}.
@comment ISO
@item FLT_MIN_EXP
This is the smallest possible exponent value for type @code{float}.
-More precisely, is the minimum negative integer such that the value
+More precisely, it is the minimum negative integer such that the value
@code{FLT_RADIX} raised to this power minus 1 can be represented as a
normalized floating point number of type @code{float}.
diff --git a/manual/libm-err-tab.pl b/manual/libm-err-tab.pl
index c2792c50d8..3ea62c549e 100755
--- a/manual/libm-err-tab.pl
+++ b/manual/libm-err-tab.pl
@@ -48,20 +48,7 @@ use vars qw (%results @all_floats %suffices @all_functions);
);
# Pretty description of platform
-%pplatforms =
- ( "i386/fpu" => "ix86",
- "generic" => "Generic",
- "alpha/fpu" => "Alpha",
- "ia64/fpu" => "IA64",
- "m68k/fpu" => "M68k",
- "mips/fpu" => "MIPS",
- "powerpc/fpu" => "PowerPC",
- "sparc/sparc32/fpu" => "Sparc 32-bit",
- "sparc/sparc64/fpu" => "Sparc 64-bit",
- "sh/sh4/fpu" => "SH4",
- "s390/fpu" => "S/390",
- "arm" => "ARM"
- );
+%pplatforms = ();
@all_functions =
( "acos", "acosh", "asin", "asinh", "atan", "atanh",
@@ -77,8 +64,10 @@ use vars qw (%results @all_floats %suffices @all_functions);
"nextup", "pow", "remainder", "remquo", "rint", "round", "scalb",
"scalbn", "sin", "sincos", "sinh", "sqrt", "tan", "tanh", "tgamma",
"trunc", "y0", "y1", "yn" );
-# fpclassify, isnormal, isfinite, isinf, isnan, issignaling, signbit,
-# isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered
+# canonicalize, fpclassify, getpayload, iscanonical, isnormal,
+# isfinite, isinf, isnan, issignaling, issubnormal, iszero, signbit,
+# iseqsig, isgreater, isgreaterequal, isless, islessequal,
+# islessgreater, isunordered, totalorder, totalordermag
# are not tabulated.
if ($#ARGV == 0) {
@@ -97,6 +86,13 @@ sub find_files {
if ($_ eq 'libm-test-ulps') {
# print "Parsing $File::Find::name\n";
push @platforms, $File::Find::dir;
+ my ($file, $name);
+ $file = "${File::Find::name}-name";
+ open NAME, $file or die ("Can't open $file: $!");
+ $name = <NAME>;
+ chomp $name;
+ close NAME;
+ $pplatforms{$File::Find::dir} = $name;
&parse_ulps ($File::Find::name, $File::Find::dir);
}
}
@@ -159,15 +155,6 @@ sub get_value {
? $results{$fct}{$platform}{$type}{$float} : "0");
}
-sub canonicalize_platform {
- my ($platform) = @_;
-
- $platform =~ s|^(.*/sysdeps/)||;
-
-
- return exists $pplatforms{$platform} ? $pplatforms{$platform} : $platform;
-}
-
sub print_platforms {
my (@p) = @_;
my ($fct, $platform, $float, $first, $i, $platform_no, $platform_total);
@@ -181,7 +168,7 @@ sub print_platforms {
print '@item Function ';
foreach (@p) {
print ' @tab ';
- print &canonicalize_platform ($_);
+ print $pplatforms{$_};
}
print "\n";
@@ -224,10 +211,5 @@ sub print_all {
}
sub by_platforms {
- my ($pa, $pb);
-
- $pa = $pplatforms{$a} ? $pplatforms{$a} : $a;
- $pb = $pplatforms{$b} ? $pplatforms{$b} : $b;
-
- return $pa cmp $pb;
+ return $pplatforms{$a} cmp $pplatforms{$b};
}
diff --git a/manual/llio.texi b/manual/llio.texi
index 019dea2c31..e2697aa090 100644
--- a/manual/llio.texi
+++ b/manual/llio.texi
@@ -103,7 +103,7 @@ for this function:
@table @code
@item EACCES
The file exists but is not readable/writable as requested by the @var{flags}
-argument, the file does not exist and the directory is unwritable so
+argument, or the file does not exist and the directory is unwritable so
it cannot be created.
@item EEXIST
@@ -152,7 +152,7 @@ If on a 32 bit machine the sources are translated with
descriptor opened in the large file mode which enables the file handling
functions to use files up to @twoexp{63} bytes in size and offset from
@minus{}@twoexp{63} to @twoexp{63}. This happens transparently for the user
-since all of the lowlevel file handling functions are equally replaced.
+since all of the low-level file handling functions are equally replaced.
This function is a cancellation point in multi-threaded programs. This
is a problem if the thread allocates some resources (like memory, file
@@ -203,7 +203,7 @@ If on a 32 bit machine the sources are translated with
descriptor opened in the large file mode which enables the file handling
functions to use files up to @twoexp{63} in size and offset from
@minus{}@twoexp{63} to @twoexp{63}. This happens transparently for the user
-since all of the lowlevel file handling functions are equally replaced.
+since all of the low-level file handling functions are equally replaced.
@end deftypefn
@comment fcntl.h
@@ -212,7 +212,7 @@ since all of the lowlevel file handling functions are equally replaced.
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}}
This function is similar to @code{creat}. It returns a file descriptor
which can be used to access the file named by @var{filename}. The only
-the difference is that on 32 bit systems the file is opened in the
+difference is that on 32 bit systems the file is opened in the
large file mode. I.e., file length and file offsets can exceed 31 bits.
To use this file descriptor one must not use the normal operations but
@@ -364,7 +364,7 @@ or is not open for reading.
@item EINTR
@code{read} was interrupted by a signal while it was waiting for input.
-@xref{Interrupted Primitives}. A signal will not necessary cause
+@xref{Interrupted Primitives}. A signal will not necessarily cause
@code{read} to return @code{EINTR}; it may instead result in a
successful @code{read} which returns fewer bytes than requested.
@@ -433,7 +433,7 @@ error codes are also the same, with these additions:
The value given for @var{offset} is negative and therefore illegal.
@item ESPIPE
-The file descriptor @var{filedes} is associate with a pipe or a FIFO and
+The file descriptor @var{filedes} is associated with a pipe or a FIFO and
this device does not allow positioning of the file pointer.
@end table
@@ -903,7 +903,7 @@ do not permit the access specified by the @var{opentype} argument), a
null pointer is returned instead.
In some other systems, @code{fdopen} may fail to detect that the modes
-for file descriptor do not permit the access specified by
+for file descriptors do not permit the access specified by
@code{opentype}. @Theglibc{} always checks for this.
@end deftypefun
@@ -1182,7 +1182,7 @@ Note that if the buffers are small (under about 1kB), high-level streams
may be easier to use than these functions. However, @code{readv} and
@code{writev} are more efficient when the individual buffers themselves
(as opposed to the total output), are large. In that case, a high-level
-stream would not be able to cache the data effectively.
+stream would not be able to cache the data efficiently.
@node Memory-mapped I/O
@section Memory-mapped I/O
@@ -1281,7 +1281,7 @@ This forces the system to use the exact mapping address specified in
@item MAP_ANONYMOUS
@itemx MAP_ANON
This flag tells the system to create an anonymous mapping, not connected
-to a file. @var{filedes} and @var{off} are ignored, and the region is
+to a file. @var{filedes} and @var{offset} are ignored, and the region is
initialized with zeros.
Anonymous maps are used as the basic primitive to extend the heap on some
@@ -1596,7 +1596,7 @@ On failure @code{errno} is set.
@c mempcpy dup ok
@c unlink dup ok
-This function is inverse of @code{shm_open} and removes the object with
+This function is the inverse of @code{shm_open} and removes the object with
the given @var{name} previously created by @code{shm_open}.
@code{shm_unlink} returns @math{0} on success or @math{-1} on error.
@@ -1863,7 +1863,7 @@ file descriptor. E.g., in database files which do not change in size it
is enough to write all the file content data to the device.
Meta-information, like the modification time etc., are not that important
and leaving such information uncommitted does not prevent a successful
-recovering of the file in case of a problem.
+recovery of the file in case of a problem.
@comment unistd.h
@comment POSIX
@@ -1897,7 +1897,7 @@ No synchronization is possible since the system does not implement this.
@section Perform I/O Operations in Parallel
The POSIX.1b standard defines a new set of I/O operations which can
-significantly reduce the time an application spends waiting at I/O. The
+significantly reduce the time an application spends waiting for I/O. The
new functions allow a program to initiate one or more I/O operations and
then immediately resume normal work while the I/O operations are
executed in parallel. This functionality is available if the
@@ -2035,16 +2035,16 @@ AIO operation.
@item struct sigevent aio_sigevent
This element specifies how the calling process is notified once the
-operation terminates. If the @code{sigev_notify}, element is
+operation terminates. If the @code{sigev_notify} element is
@code{SIGEV_NONE} no notification is sent. If it is @code{SIGEV_SIGNAL},
the signal determined by @code{sigev_signo} is sent. Otherwise,
@code{sigev_notify} must be @code{SIGEV_THREAD} in which case a thread
-which starts executing the function pointed to by
+is created which starts executing the function pointed to by
@code{sigev_notify_function}.
@item int aio_lio_opcode
This element is only used by the @code{lio_listio} and
-@code{[lio_listio64} functions. Since these functions allow an
+@code{lio_listio64} functions. Since these functions allow an
arbitrary number of operations to start at once, and since each operation can be
input or output (or nothing), the information must be stored in the
control block. See the description of @code{struct aiocb} for a description
@@ -2293,7 +2293,7 @@ difference is that on @w{32 bit} machines, the file descriptor should
be opened in the large file mode. Internally, @code{aio_read64} uses
functionality equivalent to @code{lseek64} (@pxref{File Position
Primitive}) to position the file descriptor correctly for the reading,
-as opposed to @code{lseek} functionality used in @code{aio_read}.
+as opposed to the @code{lseek} functionality used in @code{aio_read}.
When the sources are compiled with @code{_FILE_OFFSET_BITS == 64}, this
function is available under the name @code{aio_read} and so transparently
@@ -2345,12 +2345,12 @@ request and so this error might also be signaled asynchronously.
@end table
In the case @code{aio_write} returns zero, the current status of the
-request can be queried using @code{aio_error} and @code{aio_return}
+request can be queried using the @code{aio_error} and @code{aio_return}
functions. As long as the value returned by @code{aio_error} is
@code{EINPROGRESS} the operation has not yet completed. If
@code{aio_error} returns zero, the operation successfully terminated,
otherwise the value is to be interpreted as an error code. If the
-function terminated, the result of the operation can be get using a call
+function terminated, the result of the operation can be obtained using a call
to @code{aio_return}. The returned value is the same as an equivalent
call to @code{read} would have returned. Possible error codes returned
by @code{aio_error} are:
@@ -2379,7 +2379,7 @@ difference is that on @w{32 bit} machines the file descriptor should
be opened in the large file mode. Internally @code{aio_write64} uses
functionality equivalent to @code{lseek64} (@pxref{File Position
Primitive}) to position the file descriptor correctly for the writing,
-as opposed to @code{lseek} functionality used in @code{aio_write}.
+as opposed to the @code{lseek} functionality used in @code{aio_write}.
When the sources are compiled with @code{_FILE_OFFSET_BITS == 64}, this
function is available under the name @code{aio_write} and so transparently
@@ -2432,12 +2432,12 @@ waits until all requests terminated. Otherwise @var{mode} must be
having enqueued all the requests. In this case the caller gets a
notification of the termination of all requests according to the
@var{sig} parameter. If @var{sig} is @code{NULL} no notification is
-send. Otherwise a signal is sent or a thread is started, just as
+sent. Otherwise a signal is sent or a thread is started, just as
described in the description for @code{aio_read} or @code{aio_write}.
If @var{mode} is @code{LIO_WAIT}, the return value of @code{lio_listio}
is @math{0} when all requests completed successfully. Otherwise the
-function return @math{-1} and @code{errno} is set accordingly. To find
+function returns @math{-1} and @code{errno} is set accordingly. To find
out which request or requests failed one has to use the @code{aio_error}
function on all the elements of the array @var{list}.
@@ -2490,7 +2490,7 @@ difference is that on @w{32 bit} machines, the file descriptor should
be opened in the large file mode. Internally, @code{lio_listio64} uses
functionality equivalent to @code{lseek64} (@pxref{File Position
Primitive}) to position the file descriptor correctly for the reading or
-writing, as opposed to @code{lseek} functionality used in
+writing, as opposed to the @code{lseek} functionality used in
@code{lio_listio}.
When the sources are compiled with @code{_FILE_OFFSET_BITS == 64}, this
@@ -2553,7 +2553,7 @@ machines.
This function can be used to retrieve the return status of the operation
carried out by the request described in the variable pointed to by
@var{aiocbp}. As long as the error status of this request as returned
-by @code{aio_error} is @code{EINPROGRESS} the return of this function is
+by @code{aio_error} is @code{EINPROGRESS} the return value of this function is
undefined.
Once the request is finished this function can be used exactly once to
@@ -2589,7 +2589,7 @@ machines.
When dealing with asynchronous operations it is sometimes necessary to
get into a consistent state. This would mean for AIO that one wants to
-know whether a certain request or a group of request were processed.
+know whether a certain request or a group of requests were processed.
This could be done by waiting for the notification sent by the system
after the operation terminated, but this sometimes would mean wasting
resources (mainly computation time). Instead POSIX.1b defines two
@@ -2605,7 +2605,7 @@ if the symbol @code{_POSIX_SYNCHRONIZED_IO} is defined in @file{unistd.h}.
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{} @ascuheap{}}@acunsafe{@aculock{} @acsmem{}}}
@c After fcntl to check that the FD is open, it calls
@c aio_enqueue_request.
-Calling this function forces all I/O operations operating queued at the
+Calling this function forces all I/O operations queued at the
time of the function call operating on the file descriptor
@code{aiocbp->aio_fildes} into the synchronized I/O completion state
(@pxref{Synchronizing I/O}). The @code{aio_fsync} function returns
@@ -2626,7 +2626,7 @@ done @code{aio_error} return @math{0} if the synchronization was not
successful. Otherwise the value returned is the value to which the
@code{fsync} or @code{fdatasync} function would have set the
@code{errno} variable. In this case nothing can be assumed about the
-consistency for the data written to this file descriptor.
+consistency of the data written to this file descriptor.
The return value of this function is @math{0} if the request was
successfully enqueued. Otherwise the return value is @math{-1} and
@@ -2669,9 +2669,9 @@ functions to notify the initiating process about the termination but in
some situations this is not the ideal solution. In a program which
constantly updates clients somehow connected to the server it is not
always the best solution to go round robin since some connections might
-be slow. On the other hand letting the @code{aio_*} function notify the
+be slow. On the other hand letting the @code{aio_*} functions notify the
caller might also be not the best solution since whenever the process
-works on preparing data for on client it makes no sense to be
+works on preparing data for a client it makes no sense to be
interrupted by a notification since the new client will not be handled
before the current client is served. For situations like this
@code{aio_suspend} should be used.
@@ -2781,7 +2781,7 @@ The return value of the function is @code{AIO_CANCELED} if there were
requests which haven't terminated and which were successfully canceled.
If there is one or more requests left which couldn't be canceled, the
return value is @code{AIO_NOTCANCELED}. In this case @code{aio_error}
-must be used to find out which of the, perhaps multiple, requests (in
+must be used to find out which of the, perhaps multiple, requests (if
@var{aiocbp} is @code{NULL}) weren't successfully canceled. If all
requests already terminated at the time @code{aio_cancel} is called the
return value is @code{AIO_ALLDONE}.
@@ -2823,10 +2823,10 @@ The POSIX standard does not specify how the AIO functions are
implemented. They could be system calls, but it is also possible to
emulate them at userlevel.
-At the point of this writing, the available implementation is a userlevel
+At the time of writing, the available implementation is a user-level
implementation which uses threads for handling the enqueued requests.
While this implementation requires making some decisions about
-limitations, hard limitations are something which is best avoided
+limitations, hard limitations are something best avoided
in @theglibc{}. Therefore, @theglibc{} provides a means
for tuning the AIO implementation according to the individual use.
@@ -2867,13 +2867,13 @@ This function must be called before any other AIO function. Calling it
is completely voluntary, as it is only meant to help the AIO
implementation perform better.
-Before calling the @code{aio_init}, function the members of a variable of
+Before calling @code{aio_init}, the members of a variable of
type @code{struct aioinit} must be initialized. Then a reference to
this variable is passed as the parameter to @code{aio_init} which itself
may or may not pay attention to the hints.
The function has no return value and no error cases are defined. It is
-a extension which follows a proposal from the SGI implementation in
+an extension which follows a proposal from the SGI implementation in
@w{Irix 6}. It is not covered by POSIX.1b or Unix98.
@end deftypefun
@@ -3361,7 +3361,7 @@ clobber an existing file.
This prevents @code{open} from blocking for a ``long time'' to open the
file. This is only meaningful for some kinds of files, usually devices
such as serial ports; when it is not meaningful, it is harmless and
-ignored. Often opening a port to a modem blocks until the modem reports
+ignored. Often, opening a port to a modem blocks until the modem reports
carrier detection; if @code{O_NONBLOCK} is specified, @code{open} will
return immediately without a carrier.
@@ -3680,7 +3680,7 @@ can be one of @code{SEEK_SET}, @code{SEEK_CUR}, or @code{SEEK_END}.
@item off_t l_start
This specifies the offset of the start of the region to which the lock
-applies, and is given in bytes relative to the point specified by
+applies, and is given in bytes relative to the point specified by the
@code{l_whence} member.
@item off_t l_len
@@ -3759,8 +3759,8 @@ on that part is replaced with the new lock. You can remove a lock
by specifying a lock type of @code{F_UNLCK}.
If the lock cannot be set, @code{fcntl} returns immediately with a value
-of @math{-1}. This function does not block waiting for other processes
-to release locks. If @code{fcntl} succeeds, it return a value other
+of @math{-1}. This function does not block while waiting for other processes
+to release locks. If @code{fcntl} succeeds, it returns a value other
than @math{-1}.
The following @code{errno} error conditions are defined for this
diff --git a/manual/maint.texi b/manual/maint.texi
index 862b49d956..473ab162f0 100644
--- a/manual/maint.texi
+++ b/manual/maint.texi
@@ -152,7 +152,7 @@ functions should be called @file{sys/platform/@var{name}.h}.
@item
Each header file's name should include the platform name, to avoid
-users thinking there is anything in common between different the
+users thinking there is anything in common between the different
header files for different platforms. For example, a
@file{sys/platform/@var{arch}.h} name such as
@file{sys/platform/ppc.h} is better than @file{sys/platform.h}.
diff --git a/manual/math.texi b/manual/math.texi
index d689820c6c..b4bb32345e 100644
--- a/manual/math.texi
+++ b/manual/math.texi
@@ -210,7 +210,7 @@ function to do that.
@deftypefunx void sincosl (long double @var{x}, long double *@var{sinx}, long double *@var{cosx})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
These functions return the sine of @var{x} in @code{*@var{sinx}} and the
-cosine of @var{x} in @code{*@var{cos}}, where @var{x} is given in
+cosine of @var{x} in @code{*@var{cosx}}, where @var{x} is given in
radians. Both values, @code{*@var{sinx}} and @code{*@var{cosx}}, are in
the range of @code{-1} to @code{1}.
@@ -303,7 +303,7 @@ pole.
@section Inverse Trigonometric Functions
@cindex inverse trigonometric functions
-These are the usual arc sine, arc cosine and arc tangent functions,
+These are the usual arcsine, arccosine and arctangent functions,
which are the inverses of the sine, cosine and tangent functions
respectively.
@@ -317,12 +317,12 @@ respectively.
@comment ISO
@deftypefunx {long double} asinl (long double @var{x})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These functions compute the arc sine of @var{x}---that is, the value whose
+These functions compute the arcsine of @var{x}---that is, the value whose
sine is @var{x}. The value is in units of radians. Mathematically,
there are infinitely many such values; the one actually returned is the
one between @code{-pi/2} and @code{pi/2} (inclusive).
-The arc sine function is defined mathematically only
+The arcsine function is defined mathematically only
over the domain @code{-1} to @code{1}. If @var{x} is outside the
domain, @code{asin} signals a domain error.
@end deftypefun
@@ -337,12 +337,12 @@ domain, @code{asin} signals a domain error.
@comment ISO
@deftypefunx {long double} acosl (long double @var{x})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These functions compute the arc cosine of @var{x}---that is, the value
+These functions compute the arccosine of @var{x}---that is, the value
whose cosine is @var{x}. The value is in units of radians.
Mathematically, there are infinitely many such values; the one actually
returned is the one between @code{0} and @code{pi} (inclusive).
-The arc cosine function is defined mathematically only
+The arccosine function is defined mathematically only
over the domain @code{-1} to @code{1}. If @var{x} is outside the
domain, @code{acos} signals a domain error.
@end deftypefun
@@ -357,7 +357,7 @@ domain, @code{acos} signals a domain error.
@comment ISO
@deftypefunx {long double} atanl (long double @var{x})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These functions compute the arc tangent of @var{x}---that is, the value
+These functions compute the arctangent of @var{x}---that is, the value
whose tangent is @var{x}. The value is in units of radians.
Mathematically, there are infinitely many such values; the one actually
returned is the one between @code{-pi/2} and @code{pi/2} (inclusive).
@@ -373,7 +373,7 @@ returned is the one between @code{-pi/2} and @code{pi/2} (inclusive).
@comment ISO
@deftypefunx {long double} atan2l (long double @var{y}, long double @var{x})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-This function computes the arc tangent of @var{y}/@var{x}, but the signs
+This function computes the arctangent of @var{y}/@var{x}, but the signs
of both arguments are used to determine the quadrant of the result, and
@var{x} is permitted to be zero. The return value is given in radians
and is in the range @code{-pi} to @code{pi}, inclusive.
@@ -402,7 +402,7 @@ If both @var{x} and @var{y} are zero, @code{atan2} returns zero.
@comment ISO
@deftypefunx {complex long double} casinl (complex long double @var{z})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These functions compute the complex arc sine of @var{z}---that is, the
+These functions compute the complex arcsine of @var{z}---that is, the
value whose sine is @var{z}. The value returned is in radians.
Unlike the real-valued functions, @code{casin} is defined for all
@@ -419,7 +419,7 @@ values of @var{z}.
@comment ISO
@deftypefunx {complex long double} cacosl (complex long double @var{z})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These functions compute the complex arc cosine of @var{z}---that is, the
+These functions compute the complex arccosine of @var{z}---that is, the
value whose cosine is @var{z}. The value returned is in radians.
Unlike the real-valued functions, @code{cacos} is defined for all
@@ -437,7 +437,7 @@ values of @var{z}.
@comment ISO
@deftypefunx {complex long double} catanl (complex long double @var{z})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These functions compute the complex arc tangent of @var{z}---that is,
+These functions compute the complex arctangent of @var{z}---that is,
the value whose tangent is @var{z}. The value is in units of radians.
@end deftypefun
@@ -730,7 +730,7 @@ to subtraction of two numbers that are nearly equal.
@comment ISO
@deftypefunx {long double} log1pl (long double @var{x})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These functions returns a value equivalent to @w{@code{log (1 + @var{x})}}.
+These functions return a value equivalent to @w{@code{log (1 + @var{x})}}.
They are computed in a way that is accurate even if @var{x} is
near zero.
@end deftypefun
@@ -804,10 +804,10 @@ These functions return the base 10 logarithm of the complex value
@var{z}. Mathematically, this corresponds to the value
@ifnottex
-@math{log (z) = log10 (cabs (z)) + I * carg (z)}
+@math{log10 (z) = log10 (cabs (z)) + I * carg (z) / log (10)}
@end ifnottex
@tex
-$$\log_{10}(z) = \log_{10}|z| + i \arg z$$
+$$\log_{10}(z) = \log_{10}|z| + i \arg z / \log (10)$$
@end tex
These functions are GNU extensions.
@@ -873,7 +873,7 @@ may signal overflow if @var{x} is too large.
@comment ISO
@deftypefunx {long double} coshl (long double @var{x})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-These function return the hyperbolic cosine of @var{x},
+These functions return the hyperbolic cosine of @var{x},
defined mathematically as @w{@code{(exp (@var{x}) + exp (-@var{x})) / 2}}.
They may signal overflow if @var{x} is too large.
@end deftypefun
@@ -1146,7 +1146,7 @@ instead of in the @var{signgam} global. This means it is reentrant.
@safety{@prelim{}@mtunsafe{@mtasurace{:signgam}}@asunsafe{}@acsafe{}}
These functions exist for compatibility reasons. They are equivalent to
@code{lgamma} etc. It is better to use @code{lgamma} since for one the
-name reflects better the actual computation, moreover @code{lgamma} is
+name reflects better the actual computation, and moreover @code{lgamma} is
standardized in @w{ISO C99} while @code{gamma} is not.
@end deftypefun
@@ -1298,7 +1298,7 @@ for functions in the math library, and does not aim for correctness in
whether ``inexact'' exceptions are raised. Instead, the goals for
accuracy of functions without fully specified results are as follows;
some functions have bugs meaning they do not meet these goals in all
-cases. In future, @theglibc{} may provide some other correctly
+cases. In the future, @theglibc{} may provide some other correctly
rounding functions under the names such as @code{crsin} proposed for
an extension to ISO C.
@@ -1583,7 +1583,7 @@ pseudo-random number generator.
@Theglibc{} contains four additional functions which contain the
state as an explicit parameter and therefore make it possible to handle
-thread-local PRNGs. Beside this there is no difference. In fact, the
+thread-local PRNGs. Besides this there is no difference. In fact, the
four functions already discussed are implemented internally using the
following interfaces.
@@ -1785,7 +1785,7 @@ the user has called the @code{lcong48} function (see below).
The @code{seed48} function initializes all 48 bits of the state of the
internal random number generator from the contents of the parameter
@var{seed16v}. Here the lower 16 bits of the first element of
-@var{see16v} initialize the least significant 16 bits of the internal
+@var{seed16v} initialize the least significant 16 bits of the internal
state, the lower 16 bits of @code{@var{seed16v}[1]} initialize the mid-order
16 bits of the state and the 16 lower bits of @code{@var{seed16v}[2]}
initialize the most significant 16 bits of the state.
@@ -2027,7 +2027,7 @@ This means that no calls to the library functions may be necessary, and
can increase the speed of generated code significantly. The drawback is
that code size will increase, and the increase is not always negligible.
-There are two kind of inline functions: Those that give the same result
+There are two kinds of inline functions: those that give the same result
as the library functions and others that might not set @code{errno} and
might have a reduced precision and/or argument range in comparison with
the library functions. The latter inline functions are only available
diff --git a/manual/memory.texi b/manual/memory.texi
index 53831053dd..b66de60210 100644
--- a/manual/memory.texi
+++ b/manual/memory.texi
@@ -162,6 +162,8 @@ special to @theglibc{} and GNU Compiler.
@menu
* Memory Allocation and C:: How to get different kinds of allocation in C.
+* The GNU Allocator:: An overview of the GNU @code{malloc}
+ implementation.
* Unconstrained Allocation:: The @code{malloc} facility allows fully general
dynamic allocation.
* Allocation Debugging:: Finding memory leaks and not freed memory.
@@ -258,6 +260,45 @@ address of the space. Then you can use the operators @samp{*} and
@}
@end smallexample
+@node The GNU Allocator
+@subsection The GNU Allocator
+@cindex gnu allocator
+
+The @code{malloc} implementation in @theglibc{} is derived from ptmalloc
+(pthreads malloc), which in turn is derived from dlmalloc (Doug Lea malloc).
+This malloc may allocate memory in two different ways depending on their size
+and certain parameters that may be controlled by users. The most common way is
+to allocate portions of memory (called chunks) from a large contiguous area of
+memory and manage these areas to optimize their use and reduce wastage in the
+form of unusable chunks. Traditionally the system heap was set up to be the one
+large memory area but the @glibcadj{} @code{malloc} implementation maintains
+multiple such areas to optimize their use in multi-threaded applications. Each
+such area is internally referred to as an @dfn{arena}.
+
+As opposed to other versions, the @code{malloc} in @theglibc{} does not round
+up chunk sizes to powers of two, neither for large nor for small sizes.
+Neighboring chunks can be coalesced on a @code{free} no matter what their size
+is. This makes the implementation suitable for all kinds of allocation
+patterns without generally incurring high memory waste through fragmentation.
+The presence of multiple arenas allows multiple threads to allocate
+memory simultaneously in separate arenas, thus improving performance.
+
+The other way of memory allocation is for very large blocks, i.e. much larger
+than a page. These requests are allocated with @code{mmap} (anonymous or via
+@file{/dev/zero}; @pxref{Memory-mapped I/O})). This has the great advantage
+that these chunks are returned to the system immediately when they are freed.
+Therefore, it cannot happen that a large chunk becomes ``locked'' in between
+smaller ones and even after calling @code{free} wastes memory. The size
+threshold for @code{mmap} to be used is dynamic and gets adjusted according to
+allocation patterns of the program. @code{mallopt} can be used to statically
+adjust the threshold using @code{M_MMAP_THRESHOLD} and the use of @code{mmap}
+can be disabled completely with @code{M_MMAP_MAX};
+@pxref{Malloc Tunable Parameters}.
+
+A more detailed technical description of the GNU Allocator is maintained in
+the @glibcadj{} wiki. See
+@uref{https://sourceware.org/glibc/wiki/MallocInternals}.
+
@node Unconstrained Allocation
@subsection Unconstrained Allocation
@cindex unconstrained memory allocation
@@ -278,8 +319,6 @@ any time (or never).
bigger or smaller.
* Allocating Cleared Space:: Use @code{calloc} to allocate a
block and clear it.
-* Efficiency and Malloc:: Efficiency considerations in use of
- these functions.
* Aligned Memory Blocks:: Allocating specially aligned memory.
* Malloc Tunable Parameters:: Use @code{mallopt} to adjust allocation
parameters.
@@ -867,59 +906,6 @@ But in general, it is not guaranteed that @code{calloc} calls
@code{malloc}/@code{realloc}/@code{free} outside the C library, it
should always define @code{calloc}, too.
-@node Efficiency and Malloc
-@subsubsection Efficiency Considerations for @code{malloc}
-@cindex efficiency and @code{malloc}
-
-
-
-
-@ignore
-
-@c No longer true, see below instead.
-To make the best use of @code{malloc}, it helps to know that the GNU
-version of @code{malloc} always dispenses small amounts of memory in
-blocks whose sizes are powers of two. It keeps separate pools for each
-power of two. This holds for sizes up to a page size. Therefore, if
-you are free to choose the size of a small block in order to make
-@code{malloc} more efficient, make it a power of two.
-@c !!! xref getpagesize
-
-Once a page is split up for a particular block size, it can't be reused
-for another size unless all the blocks in it are freed. In many
-programs, this is unlikely to happen. Thus, you can sometimes make a
-program use memory more efficiently by using blocks of the same size for
-many different purposes.
-
-When you ask for memory blocks of a page or larger, @code{malloc} uses a
-different strategy; it rounds the size up to a multiple of a page, and
-it can coalesce and split blocks as needed.
-
-The reason for the two strategies is that it is important to allocate
-and free small blocks as fast as possible, but speed is less important
-for a large block since the program normally spends a fair amount of
-time using it. Also, large blocks are normally fewer in number.
-Therefore, for large blocks, it makes sense to use a method which takes
-more time to minimize the wasted space.
-
-@end ignore
-
-As opposed to other versions, the @code{malloc} in @theglibc{}
-does not round up block sizes to powers of two, neither for large nor
-for small sizes. Neighboring chunks can be coalesced on a @code{free}
-no matter what their size is. This makes the implementation suitable
-for all kinds of allocation patterns without generally incurring high
-memory waste through fragmentation.
-
-Very large blocks (much larger than a page) are allocated with
-@code{mmap} (anonymous or via @code{/dev/zero}) by this implementation.
-This has the great advantage that these chunks are returned to the
-system immediately when they are freed. Therefore, it cannot happen
-that a large chunk becomes ``locked'' in between smaller ones and even
-after calling @code{free} wastes memory. The size threshold for
-@code{mmap} to be used can be adjusted with @code{mallopt}. The use of
-@code{mmap} can also be disabled completely.
-
@node Aligned Memory Blocks
@subsubsection Allocating Aligned Memory Blocks
@@ -1105,21 +1091,32 @@ parameter to be set, and @var{value} the new value to be set. Possible
choices for @var{param}, as defined in @file{malloc.h}, are:
@table @code
-@comment TODO: @item M_ARENA_MAX
-@comment - Document ARENA_MAX env var.
-@comment TODO: @item M_ARENA_TEST
-@comment - Document ARENA_TEST env var.
@comment TODO: @item M_CHECK_ACTION
@item M_MMAP_MAX
The maximum number of chunks to allocate with @code{mmap}. Setting this
to zero disables all use of @code{mmap}.
+
+The default value of this parameter is @code{65536}.
+
+This parameter can also be set for the process at startup by setting the
+environment variable @env{MALLOC_MMAP_MAX_} to the desired value.
+
@item M_MMAP_THRESHOLD
All chunks larger than this value are allocated outside the normal
heap, using the @code{mmap} system call. This way it is guaranteed
that the memory for these chunks can be returned to the system on
@code{free}. Note that requests smaller than this threshold might still
be allocated via @code{mmap}.
+
+If this parameter is not set, the default value is set as 128 KiB and the
+threshold is adjusted dynamically to suit the allocation patterns of the
+program. If the parameter is set, the dynamic adjustment is disabled and the
+value is set statically to the input value.
+
+This parameter can also be set for the process at startup by setting the
+environment variable @env{MALLOC_MMAP_THRESHOLD_} to the desired value.
@comment TODO: @item M_MXFAST
+
@item M_PERTURB
If non-zero, memory blocks are filled with values depending on some
low order bits of this parameter when they are allocated (except when
@@ -1128,16 +1125,58 @@ use of uninitialized or freed heap memory. Note that this option does not
guarantee that the freed block will have any specific values. It only
guarantees that the content the block had before it was freed will be
overwritten.
+
+The default value of this parameter is @code{0}.
+
+This parameter can also be set for the process at startup by setting the
+environment variable @env{MALLOC_MMAP_PERTURB_} to the desired value.
+
@item M_TOP_PAD
-This parameter determines the amount of extra memory to obtain from the
-system when a call to @code{sbrk} is required. It also specifies the
-number of bytes to retain when shrinking the heap by calling @code{sbrk}
-with a negative argument. This provides the necessary hysteresis in
-heap size such that excessive amounts of system calls can be avoided.
+This parameter determines the amount of extra memory to obtain from the system
+when an arena needs to be extended. It also specifies the number of bytes to
+retain when shrinking an arena. This provides the necessary hysteresis in heap
+size such that excessive amounts of system calls can be avoided.
+
+The default value of this parameter is @code{0}.
+
+This parameter can also be set for the process at startup by setting the
+environment variable @env{MALLOC_TOP_PAD_} to the desired value.
+
@item M_TRIM_THRESHOLD
This is the minimum size (in bytes) of the top-most, releasable chunk
-that will cause @code{sbrk} to be called with a negative argument in
-order to return memory to the system.
+that will trigger a system call in order to return memory to the system.
+
+If this parameter is not set, the default value is set as 128 KiB and the
+threshold is adjusted dynamically to suit the allocation patterns of the
+program. If the parameter is set, the dynamic adjustment is disabled and the
+value is set statically to the provided input.
+
+This parameter can also be set for the process at startup by setting the
+environment variable @env{MALLOC_TRIM_THRESHOLD_} to the desired value.
+
+@item M_ARENA_TEST
+This parameter specifies the number of arenas that can be created before the
+test on the limit to the number of arenas is conducted. The value is ignored if
+@code{M_ARENA_MAX} is set.
+
+The default value of this parameter is 2 on 32-bit systems and 8 on 64-bit
+systems.
+
+This parameter can also be set for the process at startup by setting the
+environment variable @env{MALLOC_ARENA_TEST} to the desired value.
+
+@item M_ARENA_MAX
+This parameter sets the number of arenas to use regardless of the number of
+cores in the system.
+
+The default value of this tunable is @code{0}, meaning that the limit on the
+number of arenas is determined by the number of CPU cores online. For 32-bit
+systems the limit is twice the number of cores online and on 64-bit systems, it
+is eight times the number of cores online. Note that the default value is not
+derived from the default value of M_ARENA_TEST and is computed independently.
+
+This parameter can also be set for the process at startup by setting the
+environment variable @env{MALLOC_ARENA_MAX} to the desired value.
@end table
@end deftypefun
@@ -1479,8 +1518,8 @@ This is the total size of memory allocated with @code{sbrk} by
@item int ordblks
This is the number of chunks not in use. (The memory allocator
internally gets chunks of memory from the operating system, and then
-carves them up to satisfy individual @code{malloc} requests; see
-@ref{Efficiency and Malloc}.)
+carves them up to satisfy individual @code{malloc} requests;
+@pxref{The GNU Allocator}.)
@item int smblks
This field is unused.
diff --git a/manual/nss.texi b/manual/nss.texi
index 2770fed41d..058b9aeaee 100644
--- a/manual/nss.texi
+++ b/manual/nss.texi
@@ -12,7 +12,7 @@ Network Information Service (NIS) and the Domain Name Service (DNS))
became popular, and were hacked into the C library, usually with a fixed
search order.
-@Theglibc{} contains a cleaner solution of this problem. It is
+@Theglibc{} contains a cleaner solution to this problem. It is
designed after a method used by Sun Microsystems in the C library of
@w{Solaris 2}. @Theglibc{} follows their name and calls this
scheme @dfn{Name Service Switch} (NSS).
@@ -46,7 +46,7 @@ The modules can be updated separately.
The C library image is smaller.
@end enumerate
-To fulfill the first goal above the ABI of the modules will be described
+To fulfill the first goal above, the ABI of the modules will be described
below. For getting the implementation of a new service right it is
important to understand how the functions in the modules get called.
They are in no way designed to be used by the programmer directly.
@@ -106,7 +106,7 @@ There will be some more added later (@code{automount}, @code{bootparams},
@cindex @file{nsswitch.conf}
Somehow the NSS code must be told about the wishes of the user. For
this reason there is the file @file{/etc/nsswitch.conf}. For each
-database this file contain a specification how the lookup process should
+database, this file contains a specification of how the lookup process should
work. The file could look like this:
@example
@@ -141,7 +141,7 @@ the reaction on lookup result like @code{[NOTFOUND=return]}.
The above example file mentions five different services: @code{files},
@code{db}, @code{dns}, @code{nis}, and @code{nisplus}. This does not
mean these
-services are available on all sites and it does also not mean these are
+services are available on all sites and neither does it mean these are
all the services which will ever be available.
In fact, these names are simply strings which the NSS code uses to find
@@ -323,8 +323,8 @@ and the default value for the three databases above is
@code{compat [NOTFOUND=return] files}.
For all other databases the default value is
-@code{nis [NOTFOUND=return] files}. This solution give the best
-chance to be correct since NIS and file based lookup is used.
+@code{nis [NOTFOUND=return] files}. This solution gives the best
+chance to be correct since NIS and file based lookups are used.
@cindex optimizing NSS
A second point is that the user should try to optimize the lookup
@@ -360,7 +360,7 @@ interested in this topic should read about Dynamic Linking.
@subsection The Naming Scheme of the NSS Modules
@noindent
-The name of each function consist of various parts:
+The name of each function consists of various parts:
@quotation
_nss_@var{service}_@var{function}
@@ -393,7 +393,7 @@ functions. I.e., if the user would call the @code{gethostbyname_r}
function this also would end in the above function. For all user
interface functions the C library maps this call to a call to the
reentrant function. For reentrant functions this is trivial since the
-interface is (nearly) the same. For the non-reentrant version The
+interface is (nearly) the same. For the non-reentrant version the
library keeps internal buffers which are used to replace the user
supplied buffer.
@@ -423,7 +423,7 @@ not starting with @file{lib} but don't tell this to anybody.}
Now we know about the functions contained in the modules. It is now
time to describe the types. When we mentioned the reentrant versions of
the functions above, this means there are some additional arguments
-(compared with the standard, non-reentrant version). The prototypes for
+(compared with the standard, non-reentrant versions). The prototypes for
the non-reentrant and reentrant versions of our function above are:
@smallexample
@@ -445,9 +445,10 @@ enum nss_status _nss_files_gethostbyname_r (const char *name,
@end smallexample
I.e., the interface function is in fact the reentrant function with the
-change of the return value and the omission of the @var{result}
-parameter. While the user-level function returns a pointer to the
-result the reentrant function return an @code{enum nss_status} value:
+change of the return value, the omission of the @var{result} parameter,
+and the addition of the @var{errnop} parameter. While the user-level
+function returns a pointer to the result the reentrant function return
+an @code{enum nss_status} value:
@vtable @code
@item NSS_STATUS_TRYAGAIN
@@ -474,7 +475,7 @@ necessary the source code should be examined to learn about the details.
In case the interface function has to return an error it is important
that the correct error code is stored in @code{*@var{errnop}}. Some
-return status value have only one associated error code, others have
+return status values have only one associated error code, others have
more.
@multitable @columnfractions .3 .2 .50
@@ -505,15 +506,18 @@ These are proposed values. There can be other error codes and the
described error codes can have different meaning. @strong{With one
exception:} when returning @code{NSS_STATUS_TRYAGAIN} the error code
@code{ERANGE} @emph{must} mean that the user provided buffer is too
-small. Everything is non-critical.
+small. Everything else is non-critical.
+
+In statically linked programs, the main application and NSS modules do
+not share the same thread-local variable @code{errno}, which is the
+reason why there is an explicit @var{errnop} function argument.
The above function has something special which is missing for almost all
the other module functions. There is an argument @var{h_errnop}. This
points to a variable which will be filled with the error code in case
-the execution of the function fails for some reason. The reentrant
-function cannot use the global variable @var{h_errno};
-@code{gethostbyname} calls @code{gethostbyname_r} with the last argument
-set to @code{&h_errno}.
+the execution of the function fails for some reason. (In statically
+linked programs, the thread-local variable @code{h_errno} is not shared
+with the main application.)
The @code{get@var{XXX}by@var{YYY}} functions are the most important
functions in the NSS modules. But there are others which implement
@@ -525,14 +529,14 @@ signature of the module function:
@itemize @bullet
@item
-the return value is @code{int};
+the return value is @code{enum nss_status};
@item
-the name is as explained in @pxref{NSS Module Names};
+the name (@pxref{NSS Module Names});
@item
the first arguments are identical to the arguments of the non-reentrant
function;
@item
-the next three arguments are:
+the next four arguments are:
@table @code
@item STRUCT_TYPE *result_buf
@@ -543,11 +547,21 @@ pointer to a buffer where the function can store additional data for
the result etc.
@item size_t buflen
length of the buffer pointed to by @var{buffer}.
+@item int *errnop
+the low-level error code to return to the application. If the return
+value is not @code{NSS_STATUS_SUCCESS}, @code{*@var{errnop}} needs to be
+set to a non-zero value. An NSS module should never set
+@code{*@var{errnop}} to zero. The value @code{ERANGE} is special, as
+described above.
@end table
@item
possibly a last argument @var{h_errnop}, for the host name and network
-name lookup functions.
+name lookup functions. If the return value is not
+@code{NSS_STATUS_SUCCESS}, @code{*@var{h_errnop}} needs to be set to a
+non-zero value. A generic error code is @code{NETDB_INTERNAL}, which
+instructs the caller to examine @code{*@var{errnop}} for further
+details. (This includes the @code{ERANGE} special case.)
@end itemize
@noindent
@@ -653,7 +667,7 @@ This function simply closes all files which are still open or removes
buffer caches. If there are no files or buffers to remove this is again
a simple noop.
-There normally is no return value different to @var{NSS_STATUS_SUCCESS}.
+There normally is no return value other than @var{NSS_STATUS_SUCCESS}.
@item enum nss_status _nss_@var{database}_get@var{db}ent_r (@var{STRUCTURE} *result, char *buffer, size_t buflen, int *errnop)
Since this function will be called several times in a row to retrieve
@@ -672,10 +686,11 @@ guaranteed that the same buffer will be passed for the next call of this
function. Therefore one must not misuse this buffer to save some state
information from one call to another.
-Before the function returns the implementation should store the value of
-the local @var{errno} variable in the variable pointed to be
-@var{errnop}. This is important to guarantee the module working in
-statically linked programs.
+Before the function returns with a failure code, the implementation
+should store the value of the local @var{errno} variable in the variable
+pointed to be @var{errnop}. This is important to guarantee the module
+working in statically linked programs. The stored value must not be
+zero.
As explained above this function could also have an additional last
argument. This depends on the database used; it happens only for
@@ -686,7 +701,7 @@ more entries. When the last entry was read it should return
@code{NSS_STATUS_NOTFOUND}. When the buffer given as an argument is too
small for the data to be returned @code{NSS_STATUS_TRYAGAIN} should be
returned. When the service was not formerly initialized by a call to
-@code{_nss_@var{DATABASE}_set@var{db}ent} all return value allowed for
+@code{_nss_@var{DATABASE}_set@var{db}ent} all return values allowed for
this function can also be returned here.
@item enum nss_status _nss_@var{DATABASE}_get@var{db}by@var{XX}_r (@var{PARAMS}, @var{STRUCTURE} *result, char *buffer, size_t buflen, int *errnop)
@@ -697,17 +712,17 @@ interface functions. All arguments given to the non-reentrant version
are here described by @var{PARAMS}.
The result must be stored in the structure pointed to by @var{result}.
-If there is additional data to return (say strings, where the
+If there are additional data to return (say strings, where the
@var{result} structure only contains pointers) the function must use the
-@var{buffer} or length @var{buflen}. There must not be any references
+@var{buffer} of length @var{buflen}. There must not be any references
to non-constant global data.
The implementation of this function should honor the @var{stayopen}
flag set by the @code{set@var{DB}ent} function whenever this makes sense.
-Before the function returns the implementation should store the value of
-the local @var{errno} variable in the variable pointed to be
-@var{errnop}. This is important to guarantee the module working in
+Before the function returns, the implementation should store the value of
+the local @var{errno} variable in the variable pointed to by
+@var{errnop}. This is important to guarantee the module works in
statically linked programs.
Again, this function takes an additional last argument for the
diff --git a/manual/probes.texi b/manual/probes.texi
index 7dd56d8058..237a91855b 100644
--- a/manual/probes.texi
+++ b/manual/probes.texi
@@ -121,7 +121,7 @@ This occurs within
point to the same arena. In this configuration, this will usually only
occur once per thread. The exception is when a thread first selected
the main arena, but a subsequent allocation from it fails: then, and
-only then, may we switch to another arena to retry that allocations, and
+only then, may we switch to another arena to retry that allocation, and
for further allocations within that thread.
@end deftp
@@ -163,7 +163,7 @@ parameter.
@end deftp
@deftp Probe memory_mallopt_trim_threshold (int @var{$arg1}, int @var{$arg2}, int @var{$arg3})
-This probe is triggere shortly after the @code{memory_mallopt} probe,
+This probe is triggered shortly after the @code{memory_mallopt} probe,
when the parameter to be changed is @code{M_TRIM_THRESHOLD}. Argument
@var{$arg1} is the requested value, @var{$arg2} is the previous value of
this @code{malloc} parameter, and @var{$arg3} is nonzero if dynamic
diff --git a/manual/process.texi b/manual/process.texi
index 25bdb8ebb8..67b3237137 100644
--- a/manual/process.texi
+++ b/manual/process.texi
@@ -497,7 +497,7 @@ information about signals, see @ref{Signal Handling}.
File descriptors open in the existing process image remain open in the
new process image, unless they have the @code{FD_CLOEXEC}
(close-on-exec) flag set. The files that remain open inherit all
-attributes of the open file description from the existing process image,
+attributes of the open file descriptors from the existing process image,
including file locks. File descriptors are discussed in @ref{Low-Level I/O}.
Streams, by contrast, cannot survive through @code{exec} functions,
diff --git a/manual/resource.texi b/manual/resource.texi
index e68458b363..75e3a1bf71 100644
--- a/manual/resource.texi
+++ b/manual/resource.texi
@@ -452,7 +452,7 @@ above do. The functions above are better choices.
@code{ulimit} gets the current limit or sets the current and maximum
limit for a particular resource for the calling process according to the
-command @var{cmd}.a
+command @var{cmd}.
If you are getting a limit, the command argument is the only argument.
If you are setting a limit, there is a second argument:
@@ -652,7 +652,7 @@ instructions for your process.
Similarly, a page fault causes what looks like a straightforward
sequence of instructions to take a long time. The fact that other
processes get to run while the page faults in is of no consequence,
-because as soon as the I/O is complete, the high priority process will
+because as soon as the I/O is complete, the higher priority process will
kick them out and run again, but the wait for the I/O itself could be a
problem. To neutralize this threat, use @code{mlock} or
@code{mlockall}.
@@ -668,7 +668,7 @@ order to run. The errant program is in complete control. It controls
the vertical, it controls the horizontal.
There are two ways to avoid this: 1) keep a shell running somewhere with
-a higher absolute priority. 2) keep a controlling terminal attached to
+a higher absolute priority or 2) keep a controlling terminal attached to
the high priority process group. All the priority in the world won't
stop an interrupt handler from running and delivering a signal to the
process if you hit Control-C.
@@ -733,7 +733,7 @@ between Round Robin and First Come First Served.
To understand how scheduling works when processes of different scheduling
policies occupy the same absolute priority, you have to know the nitty
-gritty details of how processes enter and exit the ready to run list:
+gritty details of how processes enter and exit the ready to run list.
In both cases, the ready to run list is organized as a true queue, where
a process gets pushed onto the tail when it becomes ready to run and is
@@ -931,7 +931,7 @@ you want to know.
absolute priority of the process.
On success, the return value is @code{0}. Otherwise, it is @code{-1}
-and @code{ERRNO} is set accordingly. The @code{errno} values specific
+and @code{errno} is set accordingly. The @code{errno} values specific
to this function are:
@table @code
@@ -1067,7 +1067,7 @@ among the great unwashed processes gets them.
@subsubsection Introduction To Traditional Scheduling
Long before there was absolute priority (See @ref{Absolute Priority}),
-Unix systems were scheduling the CPU using this system. When Posix came
+Unix systems were scheduling the CPU using this system. When POSIX came
in like the Romans and imposed absolute priorities to accommodate the
needs of realtime processing, it left the indigenous Absolute Priority
Zero processes to govern themselves by their own familiar scheduling
@@ -1095,7 +1095,7 @@ The dynamic priority sometimes determines who gets the next turn on the
CPU. Sometimes it determines how long turns last. Sometimes it
determines whether a process can kick another off the CPU.
-In Linux, the value is a combination of these things, but mostly it is
+In Linux, the value is a combination of these things, but mostly it
just determines the length of the time slice. The higher a process'
dynamic priority, the longer a shot it gets on the CPU when it gets one.
If it doesn't use up its time slice before giving up the CPU to do
@@ -1124,7 +1124,7 @@ ability to refuse its equal share of CPU time that others might prosper.
Hence, the higher a process' nice value, the nicer the process is.
(Then a snake came along and offered some process a negative nice value
and the system became the crass resource allocation system we know
-today).
+today.)
Dynamic priorities tend upward and downward with an objective of
smoothing out allocation of CPU time and giving quick response time to
@@ -1181,7 +1181,7 @@ have the same nice value, this returns the lowest value that any of them
has.
On success, the return value is @code{0}. Otherwise, it is @code{-1}
-and @code{ERRNO} is set accordingly. The @code{errno} values specific
+and @code{errno} is set accordingly. The @code{errno} values specific
to this function are:
@table @code
@@ -1306,7 +1306,7 @@ over this aspect of the system as well:
@item
One thread or process is responsible for absolutely critical work
which under no circumstances must be interrupted or hindered from
-making process by other process or threads using CPU resources. In
+making progress by other processes or threads using CPU resources. In
this case the special process would be confined to a CPU which no
other process or thread is allowed to use.
@@ -1316,7 +1316,7 @@ from different CPUs. This is the case in NUMA (Non-Uniform Memory
Architecture) machines. Preferably memory should be accessed locally
but this requirement is usually not visible to the scheduler.
Therefore forcing a process or thread to the CPUs which have local
-access to the mostly used memory helps to significantly boost the
+access to the most-used memory helps to significantly boost the
performance.
@item
@@ -1331,7 +1331,7 @@ problem. The Linux kernel provides a set of interfaces to allow
specifying @emph{affinity sets} for a process. The scheduler will
schedule the thread or process on CPUs specified by the affinity
masks. The interfaces which @theglibc{} define follow to some
-extend the Linux kernel interface.
+extent the Linux kernel interface.
@comment sched.h
@comment GNU
@@ -1345,7 +1345,7 @@ different interface has to be used.
This type is a GNU extension and is defined in @file{sched.h}.
@end deftp
-To manipulate the bitset, to set and reset bits, a number of macros is
+To manipulate the bitset, to set and reset bits, a number of macros are
defined. Some of the macros take a CPU number as a parameter. Here
it is important to never exceed the size of the bitset. The following
macro specifies the number of bits in the @code{cpu_set_t} bitset.
@@ -1432,7 +1432,7 @@ affinity mask can be retrieved from the system.
@c Wrapped syscall to zero out past the kernel cpu set size; Linux
@c only.
-This functions stores the CPU affinity mask for the process or thread
+This function stores the CPU affinity mask for the process or thread
with the ID @var{pid} in the @var{cpusetsize} bytes long bitmap
pointed to by @var{cpuset}. If successful, the function always
initializes all bits in the @code{cpu_set_t} object and returns zero.
@@ -1446,7 +1446,7 @@ and @code{errno} is set to represent the error condition.
No process or thread with the given ID found.
@item EFAULT
-The pointer @var{cpuset} is does not point to a valid object.
+The pointer @var{cpuset} does not point to a valid object.
@end table
This function is a GNU extension and is declared in @file{sched.h}.
@@ -1465,7 +1465,7 @@ interface must be provided for that.
This function installs the @var{cpusetsize} bytes long affinity mask
pointed to by @var{cpuset} for the process or thread with the ID @var{pid}.
-If successful the function returns zero and the scheduler will in future
+If successful the function returns zero and the scheduler will in the future
take the affinity information into account.
If the function fails it will return @code{-1} and @code{errno} is set
@@ -1476,7 +1476,7 @@ to the error code:
No process or thread with the given ID found.
@item EFAULT
-The pointer @var{cpuset} is does not point to a valid object.
+The pointer @var{cpuset} does not point to a valid object.
@item EINVAL
The bitset is not valid. This might mean that the affinity set might
@@ -1518,7 +1518,7 @@ virtual addresses into physical addresses. This is normally done by the
hardware of the processor.
@cindex shared memory
-Using a virtual address space has several advantage. The most important
+Using a virtual address space has several advantages. The most important
is process isolation. The different processes running on the system
cannot interfere directly with each other. No process can write into
the address space of another process (except when shared memory is used
@@ -1548,16 +1548,16 @@ stores memory content externally it cannot do this on a byte-by-byte
basis. The administrative overhead does not allow this (leaving alone
the processor hardware). Instead several thousand bytes are handled
together and form a @dfn{page}. The size of each page is always a power
-of two byte. The smallest page size in use today is 4096, with 8192,
+of two bytes. The smallest page size in use today is 4096, with 8192,
16384, and 65536 being other popular sizes.
@node Query Memory Parameters
@subsection How to get information about the memory subsystem?
The page size of the virtual memory the process sees is essential to
-know in several situations. Some programming interface (e.g.,
+know in several situations. Some programming interfaces (e.g.,
@code{mmap}, @pxref{Memory-mapped I/O}) require the user to provide
-information adjusted to the page size. In the case of @code{mmap} is it
+information adjusted to the page size. In the case of @code{mmap} it is
necessary to provide a length argument which is a multiple of the page
size. Another place where the knowledge about the page size is useful
is in memory allocation. If one allocates pieces of memory in larger
@@ -1568,7 +1568,7 @@ of the page size the kernel's memory handling can work more effectively
since it only has to allocate memory pages which are fully used. (To do
this optimization it is necessary to know a bit about the memory
allocator which will require a bit of memory itself for each block and
-this overhead must not push the total size over the page size multiple.
+this overhead must not push the total size over the page size multiple.)
The page size traditionally was a compile time constant. But recent
development of processors changed this. Processors now support
@@ -1605,7 +1605,7 @@ information about the physical memory the system has. The call
@end smallexample
@noindent
-returns the total number of pages of physical the system has.
+returns the total number of pages of physical memory the system has.
This does not mean all this memory is available. This information can
be found using
@@ -1634,7 +1634,7 @@ get this information two functions. They are declared in the file
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsfd{} @acsmem{}}}
@c This fopens a /proc file and scans it for the requested information.
The @code{get_phys_pages} function returns the total number of pages of
-physical the system has. To get the amount of memory this number has to
+physical memory the system has. To get the amount of memory this number has to
be multiplied by the page size.
This function is a GNU extension.
@@ -1645,7 +1645,7 @@ This function is a GNU extension.
@deftypefun {long int} get_avphys_pages (void)
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsfd{} @acsmem{}}}
The @code{get_avphys_pages} function returns the number of available pages of
-physical the system has. To get the amount of memory this number has to
+physical memory the system has. To get the amount of memory this number has to
be multiplied by the page size.
This function is a GNU extension.
@@ -1712,7 +1712,7 @@ This function is a GNU extension.
Before starting more threads it should be checked whether the processors
are not already overused. Unix systems calculate something called the
@dfn{load average}. This is a number indicating how many processes were
-running. This number is average over different periods of times
+running. This number is an average over different periods of time
(normally 1, 5, and 15 minutes).
@comment stdlib.h
diff --git a/manual/setjmp.texi b/manual/setjmp.texi
index ec79c26bb3..94d16becdc 100644
--- a/manual/setjmp.texi
+++ b/manual/setjmp.texi
@@ -243,9 +243,9 @@ blocked signals.
The Unix standard provides one more set of functions to control the
execution path and these functions are more powerful than those
-discussed in this chapter so far. These function were part of the
+discussed in this chapter so far. These functions were part of the
original @w{System V} API and by this route were added to the Unix
-API. Beside on branded Unix implementations these interfaces are not
+API. Besides on branded Unix implementations these interfaces are not
widely available. Not all platforms and/or architectures @theglibc{}
is available on provide this interface. Use @file{configure} to
detect the availability.
@@ -350,7 +350,7 @@ heap memory are normally not tagged to allow this. The result is that
programs would fail. Examples for such code include the calling
sequences the GNU C compiler generates for calls to nested functions.
Safe ways to allocate stacks correctly include using memory on the
-original threads stack or explicitly allocate memory tagged for
+original thread's stack or explicitly allocating memory tagged for
execution using (@pxref{Memory-mapped I/O}).
@strong{Compatibility note}: The current Unix standard is very imprecise
@@ -360,7 +360,7 @@ the elements of the @code{stack_t} value are unclear. @Theglibc{}
and most other Unix implementations require the @code{ss_sp} value of
the @code{uc_stack} element to point to the base of the memory region
allocated for the stack and the size of the memory region is stored in
-@code{ss_size}. There are implements out there which require
+@code{ss_size}. There are implementations out there which require
@code{ss_sp} to be set to the value the stack pointer will have (which
can, depending on the direction the stack grows, be different). This
difference makes the @code{makecontext} function hard to use and it
diff --git a/manual/signal.texi b/manual/signal.texi
index 77f3d7cfda..79e190dc15 100644
--- a/manual/signal.texi
+++ b/manual/signal.texi
@@ -1207,7 +1207,7 @@ the signal. These are described in more detail in @ref{Flags for Sigaction}.
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The @var{action} argument is used to set up a new action for the signal
@var{signum}, while the @var{old-action} argument is used to return
-information about the action previously associated with this symbol.
+information about the action previously associated with this signal.
(In other words, @var{old-action} has the same purpose as the
@code{signal} function's return value---you can check to see what the
old action in effect for the signal was, and restore it later if you
@@ -2092,7 +2092,7 @@ it can also handle a signal in the middle of clearing the flag. (This
is an example of the sort of reasoning you need to do to figure out
whether non-atomic usage is safe.)
-Sometimes you can insure uninterrupted access to one object by
+Sometimes you can ensure uninterrupted access to one object by
protecting its use with another object, perhaps one whose type
guarantees atomicity. @xref{Merged Signals}, for an example.
@@ -3371,7 +3371,7 @@ signals. The return value is the previous set of blocked signals.
@c The exception are BSD systems other than 4.4, where it is a syscall.
@c sigsetmask @asulock/hurd @aculock/hurd
@c sigprocmask(SIG_SETMASK) dup @asulock/hurd @aculock/hurd [no @mtasurace:sigprocmask/bsd(SIG_UNBLOCK)]
-This function equivalent to @code{sigprocmask} (@pxref{Process
+This function is equivalent to @code{sigprocmask} (@pxref{Process
Signal Mask}) with a @var{how} argument of @code{SIG_SETMASK}: it sets
the calling process's signal mask to @var{mask}. The return value is
the previous set of blocked signals.
diff --git a/manual/socket.texi b/manual/socket.texi
index 1d9d527488..24b4563562 100644
--- a/manual/socket.texi
+++ b/manual/socket.texi
@@ -254,7 +254,7 @@ address. Other processes can find it for communication only if you
give it an address. We call this @dfn{binding} the address to the
socket, and the way to do it is with the @code{bind} function.
-You need be concerned with the address of a socket if other processes
+You need only be concerned with the address of a socket if other processes
are to find it and start communicating with it. You can specify an
address for other sockets, but this is usually pointless; the first time
you send data from a socket, or use it to initiate a connection, the
@@ -662,8 +662,8 @@ To create a socket in the local namespace, use the constant
@comment POSIX
@deftypevr Macro int PF_LOCAL
This designates the local namespace, in which socket addresses are local
-names, and its associated family of protocols. @code{PF_Local} is the
-macro used by Posix.1g.
+names, and its associated family of protocols. @code{PF_LOCAL} is the
+macro used by POSIX.1g.
@end deftypevr
@comment sys/socket.h
@@ -713,7 +713,7 @@ the file name string. This can be done using the macro @code{SUN_LEN}:
@comment BSD
@deftypefn {Macro} int SUN_LEN (@emph{struct sockaddr_un *} @var{ptr})
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
-The macro computes the length of socket address in the local namespace.
+This macro computes the length of the socket address in the local namespace.
@end deftypefn
@node Local Socket Example
@@ -1148,7 +1148,7 @@ a pointer into a statically-allocated buffer. Subsequent calls will
overwrite the same buffer, so you should copy the string if you need
to save it.
-In multi-threaded programs each thread has an own statically-allocated
+In multi-threaded programs each thread has its own statically-allocated
buffer. But still subsequent calls of @code{inet_ntoa} in the same
thread will overwrite the result of the last call.
@@ -1464,7 +1464,7 @@ The host database contains an entry for the name, but it doesn't have an
associated Internet address.
@end table
-The lookup functions above all have one in common: they are not
+The lookup functions above all have one thing in common: they are not
reentrant and therefore unusable in multi-threaded applications.
Therefore provides @theglibc{} a new set of functions which can be
used in this context.
@@ -1545,7 +1545,7 @@ used in this context.
The @code{gethostbyname_r} function returns information about the host
named @var{name}. The caller must pass a pointer to an object of type
@code{struct hostent} in the @var{result_buf} parameter. In addition
-the function may need extra buffer space and the caller must pass an
+the function may need extra buffer space and the caller must pass a
pointer and the size of the buffer in the @var{buf} and @var{buflen}
parameters.
@@ -2527,7 +2527,7 @@ connection in progress (see @code{EINPROGRESS} above).
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
-allocated resources (like memory, files descriptors, semaphores or
+allocated resources (like memory, file descriptors, semaphores or
whatever) are freed even if the thread is canceled.
@c @xref{pthread_cleanup_push}, for a method how to do this.
@end deftypefun
@@ -2663,7 +2663,7 @@ connections immediately available.
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
-allocated resources (like memory, files descriptors, semaphores or
+allocated resources (like memory, file descriptors, semaphores or
whatever) are freed even if the thread is canceled.
@c @xref{pthread_cleanup_push}, for a method how to do this.
@end deftypefun
@@ -2797,7 +2797,7 @@ signal is ignored or blocked, or if its handler returns, then
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
-allocated resources (like memory, files descriptors, semaphores or
+allocated resources (like memory, file descriptors, semaphores or
whatever) are freed even if the thread is canceled.
@c @xref{pthread_cleanup_push}, for a method how to do this.
@end deftypefun
@@ -2848,7 +2848,7 @@ You never connected this socket.
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
-allocated resources (like memory, files descriptors, semaphores or
+allocated resources (like memory, file descriptors, semaphores or
whatever) are freed even if the thread is canceled.
@c @xref{pthread_cleanup_push}, for a method how to do this.
@end deftypefun
@@ -3163,7 +3163,7 @@ owing to a problem related to a previous call.
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
-allocated resources (like memory, files descriptors, semaphores or
+allocated resources (like memory, file descriptors, semaphores or
whatever) are freed even if the thread is canceled.
@c @xref{pthread_cleanup_push}, for a method how to do this.
@end deftypefun
@@ -3202,7 +3202,7 @@ are also the same as for @code{recv}.
This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
-allocated resources (like memory, files descriptors, semaphores or
+allocated resources (like memory, file descriptors, semaphores or
whatever) are freed even if the thread is canceled.
@c @xref{pthread_cleanup_push}, for a method how to do this.
@end deftypefun
@@ -3431,7 +3431,7 @@ They are declared in @file{sys/socket.h}.
The @code{getsockopt} function gets information about the value of
option @var{optname} at level @var{level} for socket @var{socket}.
-The option value is stored in a buffer that @var{optval} points to.
+The option value is stored in the buffer that @var{optval} points to.
Before the call, you should supply in @code{*@var{optlen-ptr}} the
size of this buffer; on return, it contains the number of bytes of
information actually stored in the buffer.
diff --git a/manual/startup.texi b/manual/startup.texi
index 9a091a5151..e4c983ada6 100644
--- a/manual/startup.texi
+++ b/manual/startup.texi
@@ -18,7 +18,7 @@ one program.
Note that we are using a specific definition of ``program'' for the
purposes of this manual, which corresponds to a common definition in the
-context of Unix system. In popular usage, ``program'' enjoys a much
+context of Unix systems. In popular usage, ``program'' enjoys a much
broader definition; it can refer for example to a system's kernel, an
editor macro, a complex package of software, or a discrete section of
code executing within a process.
@@ -228,9 +228,9 @@ available.
@c strncmp dup ok
The @var{optionp} parameter must be a pointer to a variable containing
-the address of the string to process. When the function returns the
+the address of the string to process. When the function returns, the
reference is updated to point to the next suboption or to the
-terminating @samp{\0} character if there is no more suboption available.
+terminating @samp{\0} character if there are no more suboptions available.
The @var{tokens} parameter references an array of strings containing the
known suboptions. All strings must be @samp{\0} terminated and to mark
@@ -441,7 +441,7 @@ environment. If the environment contains an entry with the key
equivalent to a call to @code{putenv} when the @var{value} part of the
string is empty.
-The function return @code{-1} if @var{name} is a null pointer, points to
+The function returns @code{-1} if @var{name} is a null pointer, points to
an empty string, or points to a string containing a @code{=} character.
It returns @code{0} if the call succeeded.
diff --git a/manual/stdio.texi b/manual/stdio.texi
index 0326f29eae..355c56341a 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -250,7 +250,7 @@ meaningful in other systems.
If the open fails, @code{fopen} returns a null pointer.
-When the sources are compiling with @code{_FILE_OFFSET_BITS == 64} on a
+When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} on a
32 bit machine this function is in fact @code{fopen64} since the LFS
interface replaces transparently the old interface.
@end deftypefun
@@ -325,7 +325,7 @@ hard-coded. In @theglibc{}, you can simply close the standard
streams and open new ones with @code{fopen}. But other systems lack
this ability, so using @code{freopen} is more portable.
-When the sources are compiling with @code{_FILE_OFFSET_BITS == 64} on a
+When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} on a
32 bit machine this function is in fact @code{freopen64} since the LFS
interface replaces transparently the old interface.
@end deftypefun
@@ -374,7 +374,7 @@ is nonzero. For read-only streams the function returns zero.
This function is declared in @file{stdio_ext.h}.
@end deftypefun
-For slightly different kind of problems there are two more functions.
+For slightly different kinds of problems there are two more functions.
They provide even finer-grained information.
@comment stdio_ext.h
@@ -458,7 +458,7 @@ another function.
@c streams, without any locking. It's the flushing without locking that
@c makes it unsafe.
This function causes all open streams of the process to be closed and
-the connection to corresponding files to be broken. All buffered data
+the connections to corresponding files to be broken. All buffered data
is written and any buffered input is discarded. The @code{fcloseall}
function returns a value of @code{0} if all the files were closed
successfully, and @code{EOF} if an error was detected.
@@ -490,7 +490,7 @@ Streams can be used in multi-threaded applications in the same way they
are used in single-threaded applications. But the programmer must be
aware of the possible complications. It is important to know about
these also if the program one writes never use threads since the design
-and implementation of many stream functions is heavily influenced by the
+and implementation of many stream functions are heavily influenced by the
requirements added by multi-threaded programming.
The POSIX standard requires that by default the stream operations are
@@ -519,7 +519,7 @@ perform the stream locking in the application code.
The @code{flockfile} function acquires the internal locking object
associated with the stream @var{stream}. This ensures that no other
thread can explicitly through @code{flockfile}/@code{ftrylockfile} or
-implicit through a call of a stream function lock the stream. The
+implicitly through the call of a stream function lock the stream. The
thread will block until the lock is acquired. An explicit call to
@code{funlockfile} has to be used to release the lock.
@end deftypefun
@@ -566,7 +566,7 @@ FILE *fp;
@end smallexample
Without the explicit locking it would be possible for another thread to
-use the stream @var{fp} after the @code{fputs} call return and before
+use the stream @var{fp} after the @code{fputs} call returns and before
@code{fprintf} was called with the result that the number does not
follow the word @samp{number}.
@@ -609,7 +609,7 @@ foo (FILE *fp)
@}
@end smallexample
-Now that we covered why it is necessary to have these locking it is
+Now that we covered why it is necessary to have locking it is
necessary to talk about situations when locking is unwanted and what can
be done. The locking operations (explicit or implicit) don't come for
free. Even if a lock is not taken the cost is not zero. The operations
@@ -688,7 +688,7 @@ locking. Every stream operation with exception of the @code{_unlocked}
variants will implicitly lock the stream.
@item FSETLOCKING_BYCALLER
-After the @code{__fsetlocking} function returns the user is responsible
+After the @code{__fsetlocking} function returns, the user is responsible
for locking the stream. None of the stream operations will implicitly
do this anymore until the state is set back to
@code{FSETLOCKING_INTERNAL}.
@@ -758,12 +758,12 @@ call to @code{freopen} or @code{freopen64} can reset the
@itemize @bullet
@item
-If any of the normal character functions is used (this includes the
+If any of the normal character functions are used (this includes the
@code{fread} and @code{fwrite} functions) the stream is marked as not
wide oriented.
@item
-If any of the wide character functions is used the stream is marked as
+If any of the wide character functions are used the stream is marked as
wide oriented.
@item
@@ -773,7 +773,7 @@ The @code{fwide} function can be used to set the orientation either way.
It is important to never mix the use of wide and not wide operations on
a stream. There are no diagnostics issued. The application behavior
will simply be strange or the application will simply crash. The
-@code{fwide} function can help avoiding this.
+@code{fwide} function can help avoid this.
@comment wchar.h
@comment ISO
@@ -831,7 +831,7 @@ print_f (FILE *fp)
Note that in this case the function @code{print_f} decides about the
orientation of the stream if it was unoriented before (will not happen
-if the advise above is followed).
+if the advice above is followed).
The encoding used for the @code{wchar_t} values is unspecified and the
user must not make any assumptions about it. For I/O of @code{wchar_t}
@@ -843,7 +843,7 @@ chosen by the implementation for @code{wchar_t}. The external encoding
is determined by the @code{LC_CTYPE} category of the current locale or
by the @samp{ccs} part of the mode specification given to @code{fopen},
@code{fopen64}, @code{freopen}, or @code{freopen64}. How and when the
-conversion happens is unspecified and it happens invisible to the user.
+conversion happens is unspecified and it happens invisibly to the user.
Since a stream is created in the unoriented state it has at that point
no conversion associated with it. The conversion which will be used is
@@ -860,7 +860,7 @@ possible, perhaps with a call to @code{fwide}.
This section describes functions for performing character- and
line-oriented output.
-These narrow streams functions are declared in the header file
+These narrow stream functions are declared in the header file
@file{stdio.h} and the wide stream functions in @file{wchar.h}.
@pindex stdio.h
@pindex wchar.h
@@ -1079,7 +1079,7 @@ recommend you use @code{fwrite} instead (@pxref{Block Input/Output}).
@cindex reading from a stream, by characters
This section describes functions for performing character-oriented
-input. These narrow streams functions are declared in the header file
+input. These narrow stream functions are declared in the header file
@file{stdio.h} and the wide character functions are declared in
@file{wchar.h}.
@pindex stdio.h
@@ -1789,7 +1789,7 @@ extension allows an explicit parameter to be specified.
The @var{param-no} parts of the format must be integers in the range of
1 to the maximum number of arguments present to the function call. Some
-implementations limit this number to a certainly upper bound. The exact
+implementations limit this number to a certain upper bound. The exact
limit can be retrieved by the following constant.
@defvr Macro NL_ARGMAX
@@ -1799,7 +1799,7 @@ actual value in effect at runtime can be retrieved by using
@code{sysconf} using the @code{_SC_NL_ARGMAX} parameter @pxref{Sysconf
Definition}.
-Some system have a quite low limit such as @math{9} for @w{System V}
+Some systems have a quite low limit such as @math{9} for @w{System V}
systems. @Theglibc{} has no real limit.
@end defvr
@@ -1908,7 +1908,7 @@ lower-case letters and @samp{%G} uses upper-case. @xref{Floating-Point
Conversions}, for details.
@item @samp{%a}, @samp{%A}
-Print a floating-point number in a hexadecimal fractional notation which
+Print a floating-point number in a hexadecimal fractional notation with
the exponent to base 2 represented in decimal digits. @samp{%a} uses
lower-case letters and @samp{%A} uses upper-case. @xref{Floating-Point
Conversions}, for details.
@@ -2023,7 +2023,7 @@ modifiers:
Specifies that the argument is a @code{signed char} or @code{unsigned
char}, as appropriate. A @code{char} argument is converted to an
@code{int} or @code{unsigned int} by the default argument promotions
-anyway, but the @samp{h} modifier says to convert it back to a
+anyway, but the @samp{hh} modifier says to convert it back to a
@code{char} again.
This modifier was introduced in @w{ISO C99}.
@@ -2043,7 +2043,7 @@ This modifier was introduced in @w{ISO C99}.
@item l
Specifies that the argument is a @code{long int} or @code{unsigned long
-int}, as appropriate. Two @samp{l} characters is like the @samp{L}
+int}, as appropriate. Two @samp{l} characters are like the @samp{L}
modifier, below.
If used with @samp{%c} or @samp{%s} the corresponding parameter is
@@ -2139,7 +2139,7 @@ a decimal-point character appears only if it is followed by a digit.
The @samp{%a} and @samp{%A} conversions are meant for representing
floating-point numbers exactly in textual form so that they can be
exchanged as texts between different programs and/or machines. The
-numbers are represented is the form
+numbers are represented in the form
@w{[@code{-}]@code{0x}@var{h}@code{.}@var{hhh}@code{p}[@code{+}|@code{-}]@var{dd}}.
At the left of the decimal-point character exactly one digit is print.
This character is only @code{0} if the number is denormalized.
@@ -2265,7 +2265,7 @@ printf ("%c%c%c%c%c", 'h', 'e', 'l', 'l', 'o');
@noindent
prints @samp{hello}.
-If there is a @samp{l} modifier present the argument is expected to be
+If there is an @samp{l} modifier present the argument is expected to be
of type @code{wint_t}. If used in a multibyte function the wide
character is converted into a multibyte character before being added to
the output. In this case more than one output byte can be produced.
@@ -2273,7 +2273,7 @@ the output. In this case more than one output byte can be produced.
The @samp{%s} conversion prints a string. If no @samp{l} modifier is
present the corresponding argument must be of type @code{char *} (or
@code{const char *}). If used in a wide stream function the string is
-first converted in a wide character string. A precision can be
+first converted to a wide character string. A precision can be
specified to indicate the maximum number of characters to write;
otherwise characters in the string up to but not including the
terminating null character are written to the output stream. The
@@ -2288,7 +2288,8 @@ printf ("%3s%-6s", "no", "where");
@noindent
prints @samp{ nowhere }.
-If there is a @samp{l} modifier present the argument is expected to be of type @code{wchar_t} (or @code{const wchar_t *}).
+If there is an @samp{l} modifier present, the argument is expected to
+be of type @code{wchar_t} (or @code{const wchar_t *}).
If you accidentally pass a null pointer as the argument for a @samp{%s}
conversion, @theglibc{} prints it as @samp{(null)}. We think this
@@ -2441,7 +2442,7 @@ described below.
@comment wchar.h
@comment GNU
-@deftypefun int swprintf (wchar_t *@var{s}, size_t @var{size}, const wchar_t *@var{template}, @dots{})
+@deftypefun int swprintf (wchar_t *@var{ws}, size_t @var{size}, const wchar_t *@var{template}, @dots{})
@safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
This is like @code{wprintf}, except that the output is stored in the
wide character array @var{ws} instead of written to a stream. A null
@@ -2477,7 +2478,7 @@ If @var{size} is zero, nothing, not even the null byte, shall be written and
The return value is the number of characters which would be generated
for the given input, excluding the trailing null. If this value is
-greater or equal to @var{size}, not all characters from the result have
+greater than or equal to @var{size}, not all characters from the result have
been stored in @var{s}. You should try again with a bigger output
string. Here is an example of doing this:
@@ -2720,7 +2721,7 @@ specified directly as for @code{vprintf}.
@comment wchar.h
@comment GNU
-@deftypefun int vswprintf (wchar_t *@var{s}, size_t @var{size}, const wchar_t *@var{template}, va_list @var{ap})
+@deftypefun int vswprintf (wchar_t *@var{ws}, size_t @var{size}, const wchar_t *@var{template}, va_list @var{ap})
@safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
This is the equivalent of @code{swprintf} with the variable argument list
specified directly as for @code{vwprintf}.
@@ -3639,10 +3640,10 @@ Matches a string of one or more characters; the number of characters
read is controlled by the maximum field width given for the conversion.
@xref{String Input Conversions}.
-If the @samp{%c} is used in a wide stream function the read value is
+If @samp{%c} is used in a wide stream function the read value is
converted from a wide character to the corresponding multibyte character
before storing it. Note that this conversion can produce more than one
-byte of output and therefore the provided buffer be large enough for up
+byte of output and therefore the provided buffer must be large enough for up
to @code{MB_CUR_MAX} bytes for each character. If @samp{%lc} is used in
a multibyte function the input is treated as a multibyte sequence (and
not bytes) and the result is converted as with calls to @code{mbrtowc}.
@@ -3803,7 +3804,7 @@ conversions:
@item
Provide a buffer to store it in. This is the default. You should
provide an argument of type @code{char *} or @code{wchar_t *} (the
-latter of the @samp{l} modifier is present).
+latter if the @samp{l} modifier is present).
@strong{Warning:} To make a robust program, you must make sure that the
input (plus its terminating null) cannot possibly exceed the size of the
@@ -3834,7 +3835,7 @@ If the format is @samp{%lc} or @samp{%C} the function stores wide
characters which are converted using the conversion determined at the
time the stream was opened from the external byte stream. The number of
bytes read from the medium is limited by @code{MB_CUR_LEN * @var{n}} but
-at most @var{n} wide character get stored in the output string.
+at most @var{n} wide characters get stored in the output string.
The @samp{%s} conversion matches a string of non-whitespace characters.
It skips and discards initial whitespace, but stops when it encounters
@@ -3881,7 +3882,7 @@ last character of the set) is used to specify a range of characters.
@item
If a caret character @samp{^} immediately follows the initial @samp{[},
-then the set of allowed input characters is the everything @emph{except}
+then the set of allowed input characters is everything @emph{except}
the characters listed.
@end itemize
@@ -4450,7 +4451,7 @@ For this reason it is a good idea to prefer @code{ftello} whenever it is
available since its functionality is (if different at all) closer the
underlying definition.
-The functionality and return value is the same as for @code{fseek}.
+The functionality and return value are the same as for @code{fseek}.
The function is an extension defined in the Unix Single Specification
version 2.
@@ -4489,7 +4490,7 @@ function (@pxref{I/O Primitives}) and to specify offsets for file locks
@comment ISO
@deftypevr Macro int SEEK_SET
This is an integer constant which, when used as the @var{whence}
-argument to the @code{fseek} or @code{fseeko} function, specifies that
+argument to the @code{fseek} or @code{fseeko} functions, specifies that
the offset provided is relative to the beginning of the file.
@end deftypevr
@@ -4497,7 +4498,7 @@ the offset provided is relative to the beginning of the file.
@comment ISO
@deftypevr Macro int SEEK_CUR
This is an integer constant which, when used as the @var{whence}
-argument to the @code{fseek} or @code{fseeko} function, specifies that
+argument to the @code{fseek} or @code{fseeko} functions, specifies that
the offset provided is relative to the current file position.
@end deftypevr
@@ -4505,7 +4506,7 @@ the offset provided is relative to the current file position.
@comment ISO
@deftypevr Macro int SEEK_END
This is an integer constant which, when used as the @var{whence}
-argument to the @code{fseek} or @code{fseeko} function, specifies that
+argument to the @code{fseek} or @code{fseeko} functions, specifies that
the offset provided is relative to the end of the file.
@end deftypevr
@@ -4848,7 +4849,7 @@ The @code{__fpurge} function causes the buffer of the stream
@var{stream} to be emptied. If the stream is currently in read mode all
input in the buffer is lost. If the stream is in output mode the
buffered output is not written to the device (or whatever other
-underlying storage) and the buffer the cleared.
+underlying storage) and the buffer is cleared.
This function is declared in @file{stdio_ext.h}.
@end deftypefun
@@ -5015,7 +5016,7 @@ This function is declared in the @file{stdio_ext.h} header.
@safety{@prelim{}@mtsafe{@mtsrace{:stream}}@asunsafe{@asucorrupt{}}@acsafe{}}
The @code{__fpending}
function returns the number of bytes currently in the output buffer.
-For wide-oriented stream the measuring unit is wide characters. This
+For wide-oriented streams the measuring unit is wide characters. This
function should not be used on buffers in read mode or opened read-only.
This function is declared in the @file{stdio_ext.h} header.
@@ -5583,7 +5584,7 @@ the @code{fmtsmg} function is. It is available on System V systems.
@node Example
@subsection How to use @code{fmtmsg} and @code{addseverity}
-Here is a simple example program to illustrate the use of the both
+Here is a simple example program to illustrate the use of both
functions described in this section.
@smallexample
@@ -5613,7 +5614,7 @@ TO FIX: refer to manual UX:cat:001
@end smallexample
We see the different fields of the message and how the extra glue (the
-colons and the @code{TO FIX} string) are printed. But only one of the
+colons and the @code{TO FIX} string) is printed. But only one of the
three calls to @code{fmtmsg} produced output. The first call does not
print anything because the @var{label} parameter is not in the correct
form. The string must contain two fields, separated by a colon
diff --git a/manual/string.texi b/manual/string.texi
index bce81a7c92..1986357ee8 100644
--- a/manual/string.texi
+++ b/manual/string.texi
@@ -1374,46 +1374,75 @@ The @code{strverscmp} function compares the string @var{s1} against
@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}.
+digits, @code{strverscmp} behaves like @code{strcmp}
+(in the sense that the sign of the result is the same).
-Basically, we compare strings normally (byte by byte), until
-we find a digit in each string - then we enter a special comparison
-mode, where each sequence of digits is taken as a whole. If we reach the
-end of these two parts without noticing a difference, we return to the
-standard comparison mode. There are two types of numeric parts:
-"integral" and "fractional" (those begin with a '0'). The types
-of the numeric parts affect the way we sort them:
+The comparison algorithm which the @code{strverscmp} function implements
+differs slightly from other version-comparison algorithms. The
+implementation is based on a finite-state machine, whose behavior is
+approximated below.
@itemize @bullet
@item
-integral/integral: we compare values as you would expect.
+The input strings are each split into sequences of non-digits and
+digits. These sequences can be empty at the beginning and end of the
+string. Digits are determined by the @code{isdigit} function and are
+thus subject to the current locale.
@item
-fractional/integral: the fractional part is less than the integral one.
-Again, no surprise.
+Comparison starts with a (possibly empty) non-digit sequence. The first
+non-equal sequences of non-digits or digits determines the outcome of
+the comparison.
@item
-fractional/fractional: the things become a bit more complex.
-If the common prefix contains only leading zeroes, the longest part is less
-than the other one; else the comparison behaves normally.
+Corresponding non-digit sequences in both strings are compared
+lexicographically if their lengths are equal. If the lengths differ,
+the shorter non-digit sequence is extended with the input string
+character immediately following it (which may be the null terminator),
+the other sequence is truncated to be of the same (extended) length, and
+these two sequences are compared lexicographically. In the last case,
+the sequence comparison determines the result of the function because
+the extension character (or some character before it) is necessarily
+different from the character at the same offset in the other input
+string.
+
+@item
+For two sequences of digits, the number of leading zeros is counted (which
+can be zero). If the count differs, the string with more leading zeros
+in the digit sequence is considered smaller than the other string.
+
+@item
+If the two sequences of digits have no leading zeros, they are compared
+as integers, that is, the string with the longer digit sequence is
+deemed larger, and if both sequences are of equal length, they are
+compared lexicographically.
+
+@item
+If both digit sequences start with a zero and have an equal number of
+leading zeros, they are compared lexicographically if their lengths are
+the same. If the lengths differ, the shorter sequence is extended with
+the following character in its input string, and the other sequence is
+truncated to the same length, and both sequences are compared
+lexicographically (similar to the non-digit sequence case above).
@end itemize
+The treatment of leading zeros and the tie-breaking extension characters
+(which in effect propagate across non-digit/digit sequence boundaries)
+differs from other version-comparison algorithms.
+
@smallexample
strverscmp ("no digit", "no digit")
@result{} 0 /* @r{same behavior as strcmp.} */
strverscmp ("item#99", "item#100")
@result{} <0 /* @r{same prefix, but 99 < 100.} */
strverscmp ("alpha1", "alpha001")
- @result{} >0 /* @r{fractional part inferior to integral one.} */
+ @result{} >0 /* @r{different number of leading zeros (0 and 2).} */
strverscmp ("part1_f012", "part1_f01")
- @result{} >0 /* @r{two fractional parts.} */
+ @result{} >0 /* @r{lexicographical comparison with leading zeros.} */
strverscmp ("foo.009", "foo.0")
- @result{} <0 /* @r{idem, but with leading zeroes only.} */
+ @result{} <0 /* @r{different number of leading zeros (2 and 1).} */
@end smallexample
-This function is especially useful when dealing with filename sorting,
-because filenames frequently hold indices/version numbers.
-
@code{strverscmp} is a GNU extension.
@end deftypefun
diff --git a/manual/sysinfo.texi b/manual/sysinfo.texi
index 1fbfb95cb9..65ee7cf6f2 100644
--- a/manual/sysinfo.texi
+++ b/manual/sysinfo.texi
@@ -36,7 +36,7 @@ computer networks were an issue, it's just a word like @samp{chicken}.
But any system attached to the Internet or any network like it conforms
to a more rigorous naming convention as part of the Domain Name System
-(DNS). In DNS, every host name is composed of two parts:
+(DNS). In the DNS, every host name is composed of two parts:
@cindex DNS
@cindex Domain Name System
@@ -53,7 +53,7 @@ You will note that ``hostname'' looks a lot like ``host name'', but is
not the same thing, and that people often incorrectly refer to entire
host names as ``domain names.''
-In DNS, the full host name is properly called the FQDN (Fully Qualified
+In the DNS, the full host name is properly called the FQDN (Fully Qualified
Domain Name) and consists of the hostname, then a period, then the
domain name. The domain name itself usually has multiple components
separated by periods. So for example, a system's hostname may be
@@ -61,7 +61,7 @@ separated by periods. So for example, a system's hostname may be
its FQDN (which is its host name) is @samp{chicken.ai.mit.edu}.
@cindex FQDN
-Adding to the confusion, though, is that DNS is not the only name space
+Adding to the confusion, though, is that the DNS is not the only name space
in which a computer needs to be known. Another name space is the
NIS (aka YP) name space. For NIS purposes, there is another domain
name, which is called the NIS domain name or the YP domain name. It
@@ -71,7 +71,7 @@ need not have anything to do with the DNS domain name.
@cindex NIS domain name
@cindex YP domain name
-Confusing things even more is the fact that in DNS, it is possible for
+Confusing things even more is the fact that in the DNS, it is possible for
multiple FQDNs to refer to the same system. However, there is always
exactly one of them that is the true host name, and it is called the
canonical FQDN.
@@ -97,7 +97,7 @@ by calling these functions.
This function returns the host name of the system on which it is called,
in the array @var{name}. The @var{size} argument specifies the size of
this array, in bytes. Note that this is @emph{not} the DNS hostname.
-If the system participates in DNS, this is the FQDN (see above).
+If the system participates in the DNS, this is the FQDN (see above).
The return value is @code{0} on success and @code{-1} on failure. In
@theglibc{}, @code{gethostname} fails if @var{size} is not large
@@ -172,7 +172,7 @@ The specifics of this function are analogous to @code{gethostname}, above.
@cindex NIS domain name
@cindex YP domain name
-@code{getdomainname} sets the NIS (aka YP) domain name of the system
+@code{setdomainname} sets the NIS (aka YP) domain name of the system
on which it is called. Note that this is not the more popular DNS
domain name. Set that with @code{sethostname}.
@@ -295,7 +295,7 @@ This is the host name of this particular computer. In @theglibc{},
the value is the same as that returned by @code{gethostname};
see @ref{Host Identification}.
-@ gethostname() is implemented with a call to uname().
+@code{gethostname} is implemented with a call to @code{uname}.
@item char domainname[]
This is the NIS or YP domain name. It is the same value returned by
@@ -317,9 +317,9 @@ use of the rest of the structure.
@c proc_uname and then gethostname.
The @code{uname} function fills in the structure pointed to by
@var{info} with information about the operating system and host machine.
-A non-negative value indicates that the data was successfully stored.
+A non-negative return value indicates that the data was successfully stored.
-@code{-1} as the value indicates an error. The only error possible is
+@code{-1} as the return value indicates an error. The only error possible is
@code{EFAULT}, which we normally don't mention as it is always a
possibility.
@end deftypefun
@@ -373,7 +373,7 @@ necessary filesystems. The information about all the filesystems
actually mounted is normally kept in a file named either
@file{/var/run/mtab} or @file{/etc/mtab}. Both files share the same
syntax and it is crucial that this syntax is followed all the time.
-Therefore it is best to never directly write the files. The functions
+Therefore it is best to never directly write to the files. The functions
described in this section can do this and they also provide the
functionality to convert the external textual representation to the
internal representation.
@@ -392,7 +392,7 @@ files as described herein.
@vindex MNTTAB
@vindex MOUNTED
The filenames given above should never be used directly. The portable
-way to handle these file is to use the macro @code{_PATH_FSTAB},
+way to handle these files is to use the macros @code{_PATH_FSTAB},
defined in @file{fstab.h}, or @code{_PATH_MNTTAB}, defined in
@file{mntent.h} and @file{paths.h}, for @file{fstab}; and the macro
@code{_PATH_MOUNTED}, also defined in @file{mntent.h} and
@@ -458,9 +458,9 @@ possible values:
@vtable @code
@item FSTAB_RW
-The filesystems gets mounted with read and write enabled.
+The filesystem gets mounted with read and write enabled.
@item FSTAB_RQ
-The filesystems gets mounted with read and write enabled. Write access
+The filesystem gets mounted with read and write enabled. Write access
is restricted by quotas.
@item FSTAB_RO
The filesystem gets mounted read-only.
@@ -470,7 +470,7 @@ This is not a real filesystem, it is a swap device.
This entry from the @file{fstab} file is totally ignored.
@end vtable
-Testing for equality with these value must happen using @code{strcmp}
+Testing for equality with these values must happen using @code{strcmp}
since these are all strings. Comparing the pointer will probably always
fail.
@@ -594,7 +594,7 @@ The following functions and data structure access the @file{mtab} file.
@comment mntent.h
@comment BSD
@deftp {Data Type} {struct mntent}
-This structure is used with the @code{getmntent}, @code{getmntent_t},
+This structure is used with the @code{getmntent}, @code{getmntent_r},
@code{addmntent}, and @code{hasmntopt} functions.
@table @code
@@ -619,7 +619,7 @@ list of the symbols provided in @file{mntent.h}.
@vtable @code
@item MNTTYPE_IGNORE
-This symbol expands to @code{"ignore"}. The value is sometime used in
+This symbol expands to @code{"ignore"}. The value is sometimes used in
@file{fstab} files to make sure entries are not used without removing them.
@item MNTTYPE_NFS
Expands to @code{"nfs"}. Using this macro sometimes could make sense
@@ -650,7 +650,7 @@ default.
Expands to @code{"ro"}. See the @code{FSTAB_RO} value, it means the
filesystem is mounted read-only.
@item MNTOPT_RW
-Expand to @code{"rw"}. See the @code{FSTAB_RW} value, it means the
+Expands to @code{"rw"}. See the @code{FSTAB_RW} value, it means the
filesystem is mounted with read and write permissions.
@item MNTOPT_SUID
Expands to @code{"suid"}. This means that the SUID bit (@pxref{How
@@ -681,7 +681,7 @@ which is uninteresting for all programs beside @code{dump}.
For accessing the @file{mtab} file there is again a set of three
functions to access all entries in a row. Unlike the functions to
handle @file{fstab} these functions do not access a fixed file and there
-is even a thread safe variant of the get function. Beside this @theglibc
+is even a thread safe variant of the get function. Besides this @theglibc{}
contains functions to alter the file and test for specific options.
@comment mntent.h
@@ -702,7 +702,7 @@ parameter for @code{fopen} (@pxref{Opening Streams}) can be chosen. If
the file is opened for writing the file is also allowed to be empty.
If the file was successfully opened @code{setmntent} returns a file
-descriptor for future use. Otherwise the return value is @code{NULL}
+handle for future use. Otherwise the return value is @code{NULL}
and @code{errno} is set accordingly.
@end deftypefun
@@ -730,13 +730,13 @@ is @math{0}.
@c malloc dup @ascuheap @acsmem
@c getmntent_r dup @mtslocale @asucorrupt @ascuheap @acucorrupt @aculock @acsmem
The @code{getmntent} function takes as the parameter a file handle
-previously returned by successful call to @code{setmntent}. It returns
+previously returned by a successful call to @code{setmntent}. It returns
a pointer to a static variable of type @code{struct mntent} which is
filled with the information from the next entry from the file currently
read.
The file format used prescribes the use of spaces or tab characters to
-separate the fields. This makes it harder to use name containing one
+separate the fields. This makes it harder to use names containing one
of these characters (e.g., mount points using spaces). Therefore
these characters are encoded in the files and the @code{getmntent}
function takes care of the decoding while reading the entries back in.
@@ -809,7 +809,7 @@ chosen name.
This function takes care of spaces and tab characters in the names to be
written to the file. It converts them and the backslash character into
-the format describe in the @code{getmntent} description above.
+the format described in the @code{getmntent} description above.
This function returns @math{0} in case the operation was successful.
Otherwise the return value is @math{1} and @code{errno} is set
@@ -886,7 +886,7 @@ ignored. Remounting a filesystem means changing the options that control
operations on the filesystem while it is mounted. It does not mean
unmounting and mounting again.
-For a mount, you must identify the type of the filesystem as
+For a mount, you must identify the type of the filesystem with
@var{fstype}. This type tells the kernel how to access the filesystem
and can be thought of as the name of a filesystem driver. The
acceptable values are system dependent. On a system with a Linux kernel
@@ -1023,7 +1023,7 @@ The mount point is busy. (E.g. it is some process' working directory or
has a filesystem mounted on it already).
@item
-The request is to remount read-only, but there are files open for write.
+The request is to remount read-only, but there are files open for writing.
@end itemize
@item EINVAL
@@ -1177,7 +1177,7 @@ The set of available parameters depends on the kernel configuration and
can change while the system is running, particularly when you load and
unload loadable kernel modules.
-The system parameters with which @code{syslog} is concerned are arranged
+The system parameters with which @code{sysctl} is concerned are arranged
in a hierarchical structure like a hierarchical filesystem. To identify
a particular parameter, you specify a path through the structure in a
way analogous to specifying the pathname of a file. Each component of
diff --git a/manual/syslog.texi b/manual/syslog.texi
index a08e103bf3..91fabc6d8e 100644
--- a/manual/syslog.texi
+++ b/manual/syslog.texi
@@ -89,7 +89,7 @@ more meaning than the system administrator gives to it.
@item priority
This tells how important the content of the message is. Examples of
-defined priority values are: debug, informational, warning, critical.
+defined priority values are: debug, informational, warning and critical.
For the complete list, see @ref{syslog; vsyslog}. Except for
the fact that the priorities have a defined order, the meaning of each
of these priorities is entirely determined by the system administrator.
@@ -257,7 +257,7 @@ If any other bit in @var{options} is on, the result is undefined.
@var{facility} is the default facility code for this connection. A
@code{syslog} on this connection that specifies default facility causes
this facility to be associated with the message. See @code{syslog} for
-possible values. A value of zero means the default default, which is
+possible values. A value of zero means the default, which is
@code{LOG_USER}.
If a Syslog connection is already open when you call @code{openlog},
diff --git a/manual/terminal.texi b/manual/terminal.texi
index 0f0354b1ad..49f5097e7f 100644
--- a/manual/terminal.texi
+++ b/manual/terminal.texi
@@ -235,7 +235,7 @@ and set the attributes.
@comment termios.h
@comment POSIX.1
@deftp {Data Type} {struct termios}
-Structure that records all the I/O attributes of a terminal. The
+A @code{struct termios} records all the I/O attributes of a terminal. The
structure includes at least the following members:
@table @code
@@ -869,7 +869,7 @@ input, without which @code{ECHOE} is simply irrelevant.
@comment termios.h
@comment BSD
@deftypevr Macro tcflag_t ECHOPRT
-This bit is like @code{ECHOE}, enables display of the ERASE character in
+This bit, like @code{ECHOE}, enables display of the ERASE character in
a way that is geared to a hardcopy terminal. When you type the ERASE
character, a @samp{\} character is printed followed by the first
character erased. Typing the ERASE character again just prints the next
@@ -933,7 +933,7 @@ This is a BSD extension, and exists only in BSD systems and
This bit controls whether the INTR, QUIT, and SUSP characters are
recognized. The functions associated with these characters are performed
if and only if this bit is set. Being in canonical or noncanonical
-input mode has no affect on the interpretation of these characters.
+input mode has no effect on the interpretation of these characters.
You should use caution when disabling recognition of these characters.
Programs that cannot be interrupted interactively are very
@@ -1457,7 +1457,7 @@ The DSUSP (suspend) character is recognized only if the implementation
supports job control (@pxref{Job Control}). It sends a @code{SIGTSTP}
signal, like the SUSP character, but not right away---only when the
program tries to read it as input. Not all systems with job control
-support DSUSP; only BSD-compatible systems (including @gnuhurdsystems{}).
+support DSUSP; only BSD-compatible systems do (including @gnuhurdsystems{}).
@xref{Signal Handling}, for more information about signals.
@@ -1484,7 +1484,7 @@ input modes. If @code{IXON} is set, receiving a START character resumes
suspended output; the START character itself is discarded. If
@code{IXANY} is set, receiving any character at all resumes suspended
output; the resuming character is not discarded unless it is the START
-character. @code{IXOFF} is set, the system may also transmit START
+character. If @code{IXOFF} is set, the system may also transmit START
characters to the terminal.
The usual value for the START character is @kbd{C-q}. You may not be
@@ -1588,7 +1588,7 @@ The MIN and TIME are stored in elements of the @code{c_cc} array, which
is a member of the @w{@code{struct termios}} structure. Each element of
this array has a particular role, and each element has a symbolic
constant that stands for the index of that element. @code{VMIN} and
-@code{VMAX} are the names for the indices in the array of the MIN and
+@code{VTIME} are the names for the indices in the array of the MIN and
TIME slots.
@comment termios.h
@@ -1702,7 +1702,7 @@ It does exactly this:
The usual way to get and set terminal modes is with the functions described
in @ref{Terminal Modes}. However, on some systems you can use the
-BSD-derived functions in this section to do some of the same thing. On
+BSD-derived functions in this section to do some of the same things. On
many systems, these functions do not exist. Even with @theglibc{},
the functions simply fail with @code{errno} = @code{ENOSYS} with many
kernels, including Linux.
@@ -1749,7 +1749,7 @@ of the terminal which is open with file descriptor @var{filedes}.
This function sets the attributes of a terminal.
@code{stty} sets the terminal attributes of the terminal which is open with
-file descriptor @var{filedes} to those described by *@var{filedes}.
+file descriptor @var{filedes} to those described by *@var{attributes}.
@end deftypefun
@node Line Control
@@ -2254,7 +2254,7 @@ is not a null pointer, the file name of the slave pseudo-terminal
device is stored in @code{*name}. If @var{termp} is not a null pointer,
the terminal attributes of the slave are set to the ones specified in
the structure that @var{termp} points to (@pxref{Terminal Modes}).
-Likewise, if the @var{winp} is not a null pointer, the screen size of
+Likewise, if @var{winp} is not a null pointer, the screen size of
the slave is set to the values specified in the structure that
@var{winp} points to.
diff --git a/manual/threads.texi b/manual/threads.texi
index 00cc725f61..d7fac825c8 100644
--- a/manual/threads.texi
+++ b/manual/threads.texi
@@ -4,7 +4,7 @@
@c %MENU% POSIX Threads
@cindex pthreads
-This chapter describes the @glibcadj{} POSIX Thread implementation.
+This chapter describes the @glibcadj{} POSIX Threads implementation.
@menu
* Thread-specific Data:: Support for creating and
diff --git a/manual/time.texi b/manual/time.texi
index f94cbe4887..6a899b78a5 100644
--- a/manual/time.texi
+++ b/manual/time.texi
@@ -26,7 +26,7 @@ we use a rigorous terminology to avoid confusion, and the only thing we
use the simple word ``time'' for is to talk about the abstract concept.
A @dfn{calendar time} is a point in the time continuum, for example
-November 4, 1990 at 18:02.5 UTC. Sometimes this is called ``absolute
+November 4, 1990, at 18:02.5 UTC. Sometimes this is called ``absolute
time''.
@cindex calendar time
@@ -298,7 +298,7 @@ child processes which have not yet been reported by @code{wait} or
@item clock_t tms_cstime
This is similar to @code{tms_cutime}, but represents the total processor
-time system has used on behalf of all the terminated child processes
+time the system has used on behalf of all the terminated child processes
of the calling process.
@end table
@@ -501,7 +501,7 @@ The @code{gettimeofday} function returns the current calendar time as
the elapsed time since the epoch in the @code{struct timeval} structure
indicated by @var{tp}. (@pxref{Elapsed Time} for a description of
@code{struct timeval}). Information about the time zone is returned in
-the structure pointed at @var{tzp}. If the @var{tzp} argument is a null
+the structure pointed to by @var{tzp}. If the @var{tzp} argument is a null
pointer, time zone information is ignored.
The return value is @code{0} on success and @code{-1} on failure. The
@@ -1010,7 +1010,7 @@ system clock from the true calendar time.
The @code{ntp_gettime} function sets the structure pointed to by
@var{tptr} to current values. The elements of the structure afterwards
contain the values the timer implementation in the kernel assumes. They
-might or might not be correct. If they are not a @code{ntp_adjtime}
+might or might not be correct. If they are not, an @code{ntp_adjtime}
call is necessary.
The return value is @code{0} on success and other values on failure. The
@@ -1220,7 +1220,7 @@ for at least 26 bytes, including the terminating null.
If no error occurred the function returns a pointer to the string the
result was written into, i.e., it returns @var{buffer}. Otherwise
-return @code{NULL}.
+it returns @code{NULL}.
@end deftypefun
@@ -1260,7 +1260,7 @@ gcc extensions, @pxref{Statement Exprs,,,gcc,Porting and Using gcc}):
If no error occurred the function returns a pointer to the string the
result was written into, i.e., it returns @var{buffer}. Otherwise
-return @code{NULL}.
+it returns @code{NULL}.
@end deftypefun
@@ -1360,7 +1360,7 @@ padded, since there is no natural width for them.
Following the flag an optional specification of the width is possible.
This is specified in decimal notation. If the natural size of the
-output is of the field has less than the specified number of characters,
+output of the field has less than the specified number of characters,
the result is written right adjusted and space padded to the given
size.
@@ -1422,7 +1422,7 @@ The date using the format @code{%m/%d/%y}.
This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %e
-The day of the month like with @code{%d}, but padded with blank (range
+The day of the month like with @code{%d}, but padded with spaces (range
@code{ 1} through @code{31}).
This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@@ -1469,13 +1469,13 @@ The day of the year as a decimal number (range @code{001} through @code{366}).
@item %k
The hour as a decimal number, using a 24-hour clock like @code{%H}, but
-padded with blank (range @code{ 0} through @code{23}).
+padded with spaces (range @code{ 0} through @code{23}).
This format is a GNU extension.
@item %l
The hour as a decimal number, using a 12-hour clock like @code{%I}, but
-padded with blank (range @code{ 1} through @code{12}).
+padded with spaces (range @code{ 1} through @code{12}).
This format is a GNU extension.
@@ -1703,7 +1703,7 @@ function with the difference that it operates on wide character
strings. The buffer where the result is stored, pointed to by @var{s},
must be an array of wide characters. The parameter @var{size} which
specifies the size of the output buffer gives the number of wide
-character, not the number of bytes.
+characters, not the number of bytes.
Also the format string @var{template} is a wide character string. Since
all characters needed to specify the format string are in the basic
@@ -2105,7 +2105,7 @@ or date elements changed. This has two implications:
@item
Before calling the @code{strptime} function for a new input string, you
should prepare the @var{tm} structure you pass. Normally this will mean
-initializing all values are to zero. Alternatively, you can set all
+initializing all values to zero. Alternatively, you can set all
fields to values like @code{INT_MAX}, allowing you to determine which
elements were set by the function call. Zero does not work here since
it is a valid value for many of the fields.
@@ -2121,7 +2121,7 @@ time information. By parsing one after the other without clearing the
structure in-between, you can construct a complete broken-down time.
@end itemize
-The following example shows a function which parses a string which is
+The following example shows a function which parses a string which
contains the date information in either US style or @w{ISO 8601} form:
@smallexample
@@ -2225,7 +2225,7 @@ solution to this.
@item
If only the weekday is specified the selected day depends on the current
-date. If the current weekday is greater or equal to the @code{tm_wday}
+date. If the current weekday is greater than or equal to the @code{tm_wday}
value the current week's day is chosen, otherwise the day next week is chosen.
@item
@@ -2261,7 +2261,7 @@ run job at %I %p,%B %dnd
As you can see, the template list can contain very specific strings like
@code{run job at %I %p,%B %dnd}. Using the above list of templates and
-assuming the current time is Mon Sep 22 12:19:47 EDT 1986 we can obtain the
+assuming the current time is Mon Sep 22 12:19:47 EDT 1986, we can obtain the
following results for the given input.
@multitable {xxxxxxxxxxxx} {xxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
@@ -2671,7 +2671,7 @@ To be able to use the alarm function to interrupt a system call which
might block otherwise indefinitely it is important to @emph{not} set the
@code{SA_RESTART} flag when registering the signal handler using
@code{sigaction}. When not using @code{sigaction} things get even
-uglier: the @code{signal} function has to fixed semantics with respect
+uglier: the @code{signal} function has fixed semantics with respect
to restarts. The BSD semantics for this function is to set the flag.
Therefore, if @code{sigaction} for whatever reason cannot be used, it is
necessary to use @code{sysv_signal} and not @code{signal}.
@@ -2774,7 +2774,7 @@ can do this by calling @code{alarm} with a @var{seconds} argument of
zero.
The return value indicates how many seconds remain before the previous
-alarm would have been sent. If there is no previous alarm, @code{alarm}
+alarm would have been sent. If there was no previous alarm, @code{alarm}
returns zero.
@end deftypefun
@@ -2831,10 +2831,10 @@ any descriptors to wait for.
@c On Mach, it uses ports and calls time. On generic posix, it calls
@c nanosleep. On Linux, it temporarily blocks SIGCHLD, which is MT- and
@c AS-Unsafe, and in a way that makes it AC-Unsafe (C-unsafe, even!).
-The @code{sleep} function waits for @var{seconds} or until a signal
+The @code{sleep} function waits for @var{seconds} seconds or until a signal
is delivered, whichever happens first.
-If @code{sleep} function returns because the requested interval is over,
+If @code{sleep} returns because the requested interval is over,
it returns a value of zero. If it returns because of delivery of a
signal, its return value is the remaining time in the sleep interval.
diff --git a/manual/users.texi b/manual/users.texi
index e8f0f3bdf3..0d94db1cdb 100644
--- a/manual/users.texi
+++ b/manual/users.texi
@@ -152,7 +152,7 @@ by creating a new user ID and login name (say, @code{games}) to own the
scores file, and make the file writable only by this user. Then, when
the game program wants to update this file, it can change its effective
user ID to be that for @code{games}. In effect, the program must
-adopt the persona of @code{games} so it can write the scores file.
+adopt the persona of @code{games} so it can write to the scores file.
@node How Change Persona
@section How an Application Can Change Persona
@@ -357,7 +357,7 @@ have this function.
@c setuid @asulock @aculock
@c INLINE_SETXID_SYSCALL dup @asulock @aculock
If the calling process is privileged, this function sets both the real
-and effective user ID of the process to @var{newuid}. It also deletes
+and effective user IDs of the process to @var{newuid}. It also deletes
the file user ID of the process, if any. @var{newuid} may be any
legal value. (Once this has been done, there is no way to recover the
old effective user ID.)
@@ -1059,7 +1059,7 @@ The Internet address of a remote host.
The @code{ut_type}, @code{ut_pid}, @code{ut_id}, @code{ut_tv}, and
@code{ut_host} fields are not available on all systems. Portable
applications therefore should be prepared for these situations. To help
-doing this the @file{utmp.h} header provides macros
+do this the @file{utmp.h} header provides macros
@code{_HAVE_UT_TYPE}, @code{_HAVE_UT_PID}, @code{_HAVE_UT_ID},
@code{_HAVE_UT_TV}, and @code{_HAVE_UT_HOST} if the respective field is
available. The programmer can handle the situations by using
@@ -1081,7 +1081,7 @@ accounting information.
@comment SVID
@vindex RUN_LVL
@item RUN_LVL
-This macro is used to identify the systems runlevel.
+This macro is used to identify the system's runlevel.
@comment utmp.h
@comment SVID
@@ -1099,7 +1099,7 @@ This macro is used to identify the time when the system clock changed.
@comment SVID
@vindex NEW_TIME
@item NEW_TIME
-This macro is used to identify the time after the system changed.
+This macro is used to identify the time after the system clock changed.
@comment utmp.h
@comment SVID
@@ -1559,7 +1559,7 @@ accounting information.
@comment XPG4.2
@vindex RUN_LVL
@item RUN_LVL
-This macro is used to identify the systems runlevel.
+This macro is used to identify the system's runlevel.
@comment utmpx.h
@comment XPG4.2
@@ -1577,7 +1577,7 @@ This macro is used to identify the time when the system clock changed.
@comment XPG4.2
@vindex NEW_TIME
@item NEW_TIME
-This macro is used to identify the time after the system changed.
+This macro is used to identify the time after the system clock changed.
@comment utmpx.h
@comment XPG4.2
@@ -2153,7 +2153,7 @@ A null pointer return indicates there is no user named @var{name}.
@c
@c _nss_*_getpwnam_r (assumed) @asuinit @asulock @acucorrupt @aculock
-This function is similar to @code{getpwnam} in that is returns
+This function is similar to @code{getpwnam} in that it returns
information about the user whose user name is @var{name}. However, like
@code{getpwuid_r}, it fills the user supplied buffers in
@var{result_buf} and @var{buffer} with the information instead of using
@@ -2466,13 +2466,12 @@ A null pointer indicates there is no group named @var{name}.
@c nss_group_lookup2 dup @mtslocale @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem
@c *fct.l @ascuplugin
@c nss_next2 dup @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem
-This function is similar to @code{getgrnam} in that is returns
+This function is similar to @code{getgrnam} in that it returns
information about the group whose group name is @var{name}. Like
@code{getgrgid_r}, it uses the user supplied buffers in
@var{result_buf} and @var{buffer}, not a static buffer.
-The return values are the same as for @code{getgrgid_r}
-@code{ERANGE}.
+The return values are the same as for @code{getgrgid_r}.
@end deftypefun
@node Scanning All Groups
@@ -2570,7 +2569,7 @@ wish to save the information.
This function is similar to @code{getgrent} in that it returns the next
entry from the stream initialized by @code{setgrent}. Like
@code{fgetgrent_r}, it places the result in user-supplied buffers
-pointed to @var{result_buf} and @var{buffer}.
+pointed to by @var{result_buf} and @var{buffer}.
If the function returns zero @var{result} contains a pointer to the data
(normally equal to @var{result_buf}). If errors occurred the return
@@ -2630,7 +2629,7 @@ Sometimes it is useful to group users according to other criteria
group of users with a certain machine. On the other hand grouping of
host names is not supported so far.
-In Sun Microsystems SunOS appeared a new kind of database, the netgroup
+In Sun Microsystems' SunOS appeared a new kind of database, the netgroup
database. It allows grouping hosts, users, and domains freely, giving
them individual names. To be more concrete, a netgroup is a list of triples
consisting of a host name, a user name, and a domain name where any of
@@ -2657,7 +2656,7 @@ character @code{-} shall be used.
@node Lookup Netgroup
@subsection Looking up one Netgroup
-The lookup functions for netgroups are a bit different to all other
+The lookup functions for netgroups are a bit different than all other
system database handling functions. Since a single netgroup can contain
many entries a two-step process is needed. First a single netgroup is
selected and then one can iterate over all entries in this netgroup.
@@ -2701,7 +2700,7 @@ These functions are declared in @file{netdb.h}.
@c memcpy dup ok
@c libc_lock_unlock dup @aculock
A call to this function initializes the internal state of the library to
-allow following calls of the @code{getnetgrent} to iterate over all entries
+allow following calls of @code{getnetgrent} to iterate over all entries
in the netgroup with name @var{netgroup}.
When the call is successful (i.e., when a netgroup with this name exists)
@@ -2831,7 +2830,7 @@ selected netgroup.
@c nss_next2 dup @ascudlopen @ascuplugin @ascuheap @asulock @acucorrupt @aculock @acsfd @acsmem
@c free_memory dup @ascuheap @acsmem
This function tests whether the triple specified by the parameters
-@var{hostp}, @var{userp}, and @var{domainp} is part of the netgroup
+@var{host}, @var{user}, and @var{domain} is part of the netgroup
@var{netgroup}. Using this function has the advantage that
@enumerate
@@ -2843,7 +2842,7 @@ the function is implemented more efficiently than successive calls
to the other @code{set}/@code{get}/@code{endnetgrent} functions.
@end enumerate
-Any of the pointers @var{hostp}, @var{userp}, and @var{domainp} can be
+Any of the pointers @var{host}, @var{user}, or @var{domain} can be
@code{NULL} which means any value is accepted in this position. This is
also true for the name @code{-} which should not match any other string
otherwise.
diff --git a/math/Makefile b/math/Makefile
index 1da1797198..f400d7b741 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -27,7 +27,7 @@ headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
bits/math-finite.h bits/math-vector.h \
- bits/libm-simd-decl-stubs.h
+ bits/libm-simd-decl-stubs.h bits/iscanonical.h
# FPU support code.
aux := setfpucw fpu_control
@@ -41,14 +41,24 @@ libm-support = s_lib_version s_matherr s_signgam \
fclrexcpt fgetexcptflg fraiseexcpt fsetexcptflg \
ftestexcept fegetround fesetround fegetenv feholdexcpt \
fesetenv feupdateenv t_exp fedisblxcpt feenablxcpt \
- fegetexcept
+ fegetexcept fesetexcept fetestexceptflag fegetmode \
+ fesetmode
+
+# Wrappers for these functions generated per type using a file named
+# <func>_template.c and the appropriate math-type-macros-<TYPE>.h.
+gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF \
+ s_cacoshF s_ccosF s_ccoshF s_casinF s_csinF s_casinhF \
+ k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \
+ s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF \
+ s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF \
+ s_nanF s_iseqsigF s_canonicalizeF
libm-calls = \
e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
e_hypotF e_j0F e_j1F e_jnF e_lgammaF_r e_logF e_log10F e_powF \
e_rem_pio2F e_remainderF e_scalbF e_sinhF e_sqrtF e_gammaF_r \
e_ilogbF \
- k_cosF k_rem_pio2F k_sinF k_tanF s_asinhF s_atanF s_cbrtF \
+ k_cosF k_sinF k_tanF s_asinhF s_atanF s_cbrtF \
s_ceilF s_cosF s_erfF s_expm1F s_fabsF \
s_floorF s_log1pF w_log1pF s_logbF \
s_nextafterF s_nexttowardF s_rintF s_scalblnF w_scalblnF \
@@ -57,15 +67,13 @@ libm-calls = \
w_tgammaF w_hypotF w_j0F w_j1F w_jnF w_lgammaF w_lgammaF_r \
w_logF w_log10F w_powF w_remainderF w_scalbF w_sinhF w_sqrtF \
w_ilogbF \
- s_fpclassifyF s_fmaxF s_fminF s_fdimF s_nanF s_truncF \
+ s_fpclassifyF s_truncF \
s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF \
- conjF cimagF crealF cabsF cargF s_cexpF s_csinhF s_ccoshF s_clogF \
- s_catanF s_casinF s_ccosF s_csinF s_ctanF s_ctanhF s_cacosF \
- s_casinhF s_cacoshF s_catanhF s_csqrtF s_cpowF s_cprojF s_clog10F \
s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F w_log2F \
- s_issignalingF $(calls:s_%=m_%) x2y2m1F k_casinhF \
+ s_issignalingF $(calls:s_%=m_%) x2y2m1F \
gamma_productF lgamma_negF lgamma_productF \
- s_nextupF s_nextdownF
+ s_nextupF s_totalorderF s_totalordermagF s_getpayloadF \
+ $(gen-libm-calls)
libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl
libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \
@@ -87,18 +95,18 @@ types = $(type-ldouble-$(long-double-fcts)) double float
# long double support
type-ldouble-suffix := l
-type-ldouble-routines := t_sincosl k_sincosl
+type-ldouble-routines := t_sincosl k_sincosl s_iscanonicall
type-ldouble-yes := ldouble
# double support
type-double-suffix :=
type-double-routines := branred doasin dosincos halfulp mpa mpatan2 \
mpatan mpexp mplog mpsqrt mptan sincos32 slowexp \
- slowpow sincostab
+ slowpow sincostab k_rem_pio2
# float support
type-float-suffix := f
-type-float-routines :=
+type-float-routines := k_rem_pio2f
# Apply suffix to each type in arg 1
@@ -114,7 +122,8 @@ libm-routines = $(strip $(libm-support) $(libm-compat-calls) \
# In libm-calls (above), list m_foo in place of s_foo for any
# routine that should be compiled separately for its libc and libm versions.
calls = s_isinfF s_isnanF s_finiteF s_copysignF s_modfF s_scalbnF s_frexpF \
- s_ldexpF s_signbitF
+ s_signbitF $(gen-calls)
+gen-calls = s_ldexpF
generated += $(foreach s,.c .S,$(call type-foreach, $(calls:s_%=m_%$(s))))
routines = $(call type-foreach, $(calls))
@@ -146,14 +155,17 @@ tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
test-nearbyint-except-2 test-signgam-uchar test-signgam-uchar-init \
test-signgam-uint test-signgam-uint-init test-signgam-ullong \
test-signgam-ullong-init test-nan-overflow test-nan-payload \
- test-fexcept test-fexcept-traps $(tests-static)
+ test-fexcept test-fexcept-traps test-fesetexcept \
+ test-fesetexcept-traps test-fetestexceptflag test-femode \
+ test-femode-traps test-iszero-excess-precision \
+ test-iseqsig-excess-precision $(tests-static)
tests-static = test-fpucw-static test-fpucw-ieee-static \
test-signgam-uchar-static test-signgam-uchar-init-static \
test-signgam-uint-static test-signgam-uint-init-static \
test-signgam-ullong-static test-signgam-ullong-init-static
ifneq (,$(CXX))
-tests += test-math-isinff
+tests += test-math-isinff test-math-iszero
endif
ifneq (no,$(PERL))
@@ -255,6 +267,10 @@ CFLAGS-test-signgam-ullong-static.c = -std=c99
CFLAGS-test-signgam-ullong-init-static.c = -std=c99
CFLAGS-test-math-isinff.cc = -std=gnu++11
+CFLAGS-test-math-iszero.cc = -std=gnu++11
+
+CFLAGS-test-iszero-excess-precision.c = -fexcess-precision=standard
+CFLAGS-test-iseqsig-excess-precision.c = -fexcess-precision=standard
# The -lieee module sets the _LIB_VERSION_ switch to IEEE mode
# for error handling in the -lm functions.
@@ -264,6 +280,32 @@ extra-objs += libieee.a ieee-math.o
include ../Rules
+gen-all-calls = $(gen-libm-calls) $(gen-calls)
+
+generated += $(addsuffix .c,$(call type-foreach,$(gen-all-calls))) \
+ gen-libm-templates.stmp
+
+# Create wrappers in the math build directory.
+$(objpfx)gen-libm-templates.stmp: Makefile
+ $(make-target-directory)
+ for gcall in $(gen-all-calls); do \
+ func=$${gcall%F*}$${gcall#*F}; \
+ for type in $(foreach t,$(types),$(t)__$(type-$(t)-suffix)); do \
+ suff=$${type#*__}; \
+ type=$${type%__*}; \
+ file=$(objpfx)$${gcall%F*}$${suff}$${gcall#*F}.c; \
+ ( \
+ echo "#include <math-type-macros-$${type}.h>"; \
+ echo "#include <$${func}_template.c>"; \
+ ) > $${file}; \
+ done; \
+ done; \
+ echo > $(@)
+
+# Add dependency to ensure the generator runs prior.
+$(foreach t, $(call type-foreach, $(gen-all-calls)), \
+ $(objpfx)$(t).c): $(objpfx)gen-libm-templates.stmp
+
ifneq (no,$(PERL))
# This must come after the inclusion of sysdeps Makefiles via Rules.
$(addprefix $(objpfx), $(libm-tests.o)): $(objpfx)libm-test.stmp
@@ -303,6 +345,12 @@ endef
object-suffixes-left := $(all-object-suffixes)
include $(o-iterator)
+# Likewise, for those generated files shared with libc.
+define o-iterator-doit
+$(objpfx)m_%$o: $(objpfx)s_%.c $(before-compile); $$(compile-command.c)
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
# This file defines the default _LIB_VERSION variable that controls
# the error return conventions for the math functions.
diff --git a/math/Versions b/math/Versions
index 467d7ed3b5..0cd594b378 100644
--- a/math/Versions
+++ b/math/Versions
@@ -214,4 +214,12 @@ libm {
nextup; nextupf; nextupl;
nextdown; nextdownf; nextdownl;
}
+ GLIBC_2.25 {
+ fesetexcept; fetestexceptflag; fegetmode; fesetmode;
+ __iscanonicall; __iseqsigf; __iseqsig; __iseqsigl;
+ totalorder; totalorderf; totalorderl;
+ totalordermag; totalordermagf; totalordermagl;
+ getpayload; getpayloadf; getpayloadl;
+ canonicalize; canonicalizef; canonicalizel;
+ }
}
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index 951a3d0090..2fd1d289da 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -380,9 +380,26 @@ __END_NAMESPACE_C99
#endif
#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Test equality. */
+__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y));
+
/* Test for signaling NaN. */
__MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value))
__attribute__ ((__const__));
+
+/* Total order operation. */
+__MATHDECL_1 (int, totalorder,, (_Mdouble_ __x, _Mdouble_ __y))
+ __attribute__ ((__const__));
+
+/* Total order operation on absolute values. */
+__MATHDECL_1 (int, totalordermag,, (_Mdouble_ __x, _Mdouble_ __y))
+ __attribute__ ((__const__));
+
+/* Canonicalize floating-point representation. */
+__MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
+
+/* Get NaN payload. */
+__MATHCALL (getpayload,, (const _Mdouble_ *__x));
#endif
#if defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
diff --git a/math/cabs.c b/math/cabs.c
deleted file mode 100644
index d7e0665dad..0000000000
--- a/math/cabs.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Return the complex absolute value of double complex value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-double
-__cabs (double _Complex z)
-{
- return __hypot (__real__ z, __imag__ z);
-}
-weak_alias (__cabs, cabs)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cabs, __cabsl)
-weak_alias (__cabs, cabsl)
-#endif
diff --git a/math/s_cpow.c b/math/cabs_template.c
index 037e575b1a..5eff1b23f7 100644
--- a/math/s_cpow.c
+++ b/math/cabs_template.c
@@ -1,4 +1,4 @@
-/* Complex power of double values.
+/* Return the complex absolute value of complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,14 +20,14 @@
#include <complex.h>
#include <math.h>
-
-__complex__ double
-__cpow (__complex__ double x, __complex__ double c)
+FLOAT
+M_DECL_FUNC (__cabs) (CFLOAT z)
{
- return __cexp (c * __clog (x));
+ return M_SUF (__hypot) (__real__ z, __imag__ z);
}
-weak_alias (__cpow, cpow)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cpow, __cpowl)
-weak_alias (__cpow, cpowl)
+
+declare_mgen_alias (__cabs, cabs)
+
+#if M_LIBM_NEED_COMPAT (cabs)
+declare_mgen_libm_compat (__cabs, cabs)
#endif
diff --git a/math/cabsf.c b/math/cabsf.c
deleted file mode 100644
index 431a24471b..0000000000
--- a/math/cabsf.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Return the complex absolute value of float complex value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-float
-__cabsf (float _Complex z)
-{
- return __hypotf (__real__ z, __imag__ z);
-}
-weak_alias (__cabsf, cabsf)
diff --git a/math/cabsl.c b/math/cabsl.c
deleted file mode 100644
index d87e3a2256..0000000000
--- a/math/cabsl.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Return the complex absolute value of long double complex value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-long double
-__cabsl (long double _Complex z)
-{
- return __hypotl (__real__ z, __imag__ z);
-}
-weak_alias (__cabsl, cabsl)
diff --git a/math/carg.c b/math/carg_template.c
index 61f1e0da9b..6205be8f35 100644
--- a/math/carg.c
+++ b/math/carg_template.c
@@ -1,4 +1,4 @@
-/* Compute argument of complex double value.
+/* Compute argument of complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,13 +20,14 @@
#include <complex.h>
#include <math.h>
-double
-__carg (__complex__ double x)
+FLOAT
+M_DECL_FUNC (__carg) (CFLOAT x)
{
- return __atan2 (__imag__ x, __real__ x);
+ return M_SUF (__atan2) (__imag__ x, __real__ x);
}
-weak_alias (__carg, carg)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__carg, __cargl)
-weak_alias (__carg, cargl)
+
+declare_mgen_alias (__carg, carg)
+
+#if M_LIBM_NEED_COMPAT (carg)
+declare_mgen_libm_compat (__carg, carg)
#endif
diff --git a/math/cargf.c b/math/cargf.c
deleted file mode 100644
index 620db3eb33..0000000000
--- a/math/cargf.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Compute argument of complex float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-float
-__cargf (__complex__ float x)
-{
- return __atan2f (__imag__ x, __real__ x);
-}
-weak_alias (__cargf, cargf)
diff --git a/math/cimag.c b/math/cimag_template.c
index 1807ac2028..582147dc67 100644
--- a/math/cimag.c
+++ b/math/cimag_template.c
@@ -1,4 +1,4 @@
-/* Return imaginary part of complex double value.
+/* Return imaginary part of complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,13 +19,14 @@
#include <complex.h>
-double
-__cimag (double _Complex z)
+FLOAT
+M_DECL_FUNC (__cimag) (CFLOAT z)
{
return __imag__ z;
}
-weak_alias (__cimag, cimag)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cimag, __cimagl)
-weak_alias (__cimag, cimagl)
+
+declare_mgen_alias (__cimag, cimag)
+
+#if M_LIBM_NEED_COMPAT (cimag)
+declare_mgen_libm_compat (__cimag, cimag)
#endif
diff --git a/math/conj.c b/math/conj_template.c
index d282985002..72d1236298 100644
--- a/math/conj.c
+++ b/math/conj_template.c
@@ -1,4 +1,4 @@
-/* Return complex conjugate of complex double value.
+/* Return complex conjugate of complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,13 +19,14 @@
#include <complex.h>
-double _Complex
-__conj (double _Complex z)
+CFLOAT
+M_DECL_FUNC (__conj) (CFLOAT z)
{
return ~z;
}
-weak_alias (__conj, conj)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__conj, __conjl)
-weak_alias (__conj, conjl)
+
+declare_mgen_alias (__conj, conj)
+
+#if M_LIBM_NEED_COMPAT (conj)
+declare_mgen_libm_compat (__conj, conj)
#endif
diff --git a/math/conjl.c b/math/conjl.c
deleted file mode 100644
index 55bb393845..0000000000
--- a/math/conjl.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Return complex conjugate of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-
-long double _Complex
-__conjl (long double _Complex z)
-{
- return ~z;
-}
-weak_alias (__conjl, conjl)
diff --git a/math/creal.c b/math/creal_template.c
index 231d3b05a4..f840f43ebb 100644
--- a/math/creal.c
+++ b/math/creal_template.c
@@ -1,4 +1,4 @@
-/* Return real part of complex double value.
+/* Return real part of complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,13 +19,14 @@
#include <complex.h>
-double
-__creal (double _Complex z)
+FLOAT
+M_DECL_FUNC (__creal) (CFLOAT z)
{
return __real__ z;
}
-weak_alias (__creal, creal)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__creal, __creall)
-weak_alias (__creal, creall)
+
+declare_mgen_alias (__creal, creal)
+
+#if M_LIBM_NEED_COMPAT (creal)
+declare_mgen_libm_compat (__creal, creal)
#endif
diff --git a/math/creall.c b/math/creall.c
deleted file mode 100644
index 4a31557d86..0000000000
--- a/math/creall.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Return real part of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-
-long double
-__creall (long double _Complex z)
-{
- return __real__ z;
-}
-weak_alias (__creall, creall)
diff --git a/math/crealf.c b/math/fegetmode.c
index 58838490a1..25f299fc13 100644
--- a/math/crealf.c
+++ b/math/fegetmode.c
@@ -1,7 +1,6 @@
-/* Return real part of complex float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Store current floating-point control modes.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <complex.h>
+#include <fenv.h>
-float
-__crealf (float _Complex z)
+int
+fegetmode (femode_t *modep)
{
- return __real__ z;
+ /* Nothing to do. */
+ return 0;
}
-weak_alias (__crealf, crealf)
+stub_warning (fegetmode)
diff --git a/math/fenv.h b/math/fenv.h
index 9a1e112f72..9006aa2fff 100644
--- a/math/fenv.h
+++ b/math/fenv.h
@@ -22,7 +22,8 @@
#ifndef _FENV_H
#define _FENV_H 1
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
/* Get the architecture dependend definitions. The following definitions
are expected to be done:
@@ -37,6 +38,12 @@
fexcept_t type for object representing the floating-point exception
flags including status associated with the flags
+ femode_t type for object representing floating-point control modes
+
+ FE_DFL_MODE macro of type pointer to const femode_t to be used as the
+ argument to fesetmode; in this case the default control
+ modes will be used
+
The following macros are defined iff the implementation supports this
kind of exception.
FE_INEXACT inexact result
@@ -70,6 +77,12 @@ extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW;
/* Raise the supported exceptions represented by EXCEPTS. */
extern int feraiseexcept (int __excepts) __THROW;
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Set the supported exception flags represented by EXCEPTS, without
+ causing enabled traps to be taken. */
+extern int fesetexcept (int __excepts) __THROW;
+#endif
+
/* Set complete status for exceptions indicated by EXCEPTS according to
the representation in the object pointed to by FLAGP. */
extern int fesetexceptflag (const fexcept_t *__flagp, int __excepts) __THROW;
@@ -78,6 +91,12 @@ extern int fesetexceptflag (const fexcept_t *__flagp, int __excepts) __THROW;
currently set. */
extern int fetestexcept (int __excepts) __THROW;
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Determine which of subset of the exceptions specified by EXCEPTS
+ are set in *FLAGP. */
+extern int fetestexceptflag (const fexcept_t *__flagp, int __excepts) __THROW;
+#endif
+
/* Rounding control. */
@@ -109,6 +128,18 @@ extern int fesetenv (const fenv_t *__envp) __THROW;
extern int feupdateenv (const fenv_t *__envp) __THROW;
+/* Control modes. */
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Store the current floating-point control modes in the object
+ pointed to by MODEP. */
+extern int fegetmode (femode_t *__modep) __THROW;
+
+/* Establish the floating-point control modes represented by the
+ object pointed to by MODEP. */
+extern int fesetmode (const femode_t *__modep) __THROW;
+#endif
+
/* Include optimization. */
#ifdef __OPTIMIZE__
# include <bits/fenvinline.h>
diff --git a/math/cimagf.c b/math/fesetexcept.c
index 67c37f4b37..892d8adc5f 100644
--- a/math/cimagf.c
+++ b/math/fesetexcept.c
@@ -1,7 +1,6 @@
-/* Return imaginary part of complex float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Set given exception flags.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <complex.h>
+#include <fenv.h>
-float
-__cimagf (float _Complex z)
+int
+fesetexcept (int excepts)
{
- return __imag__ z;
+ /* This always fails unless nothing needs to be done. */
+ return (excepts != 0);
}
-weak_alias (__cimagf, cimagf)
+stub_warning (fesetexcept)
diff --git a/math/fesetmode.c b/math/fesetmode.c
new file mode 100644
index 0000000000..0d040e49a4
--- /dev/null
+++ b/math/fesetmode.c
@@ -0,0 +1,27 @@
+/* Install given floating-point control modes.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+ /* Nothing to do. */
+ return 0;
+}
+stub_warning (fesetmode)
diff --git a/math/fetestexceptflag.c b/math/fetestexceptflag.c
new file mode 100644
index 0000000000..6e3d218186
--- /dev/null
+++ b/math/fetestexceptflag.c
@@ -0,0 +1,27 @@
+/* Test exception in saved exception state.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fetestexceptflag (const fexcept_t *flagp, int excepts)
+{
+ /* Most versions of fegetexceptflag store exceptions in a form such
+ that this works. */
+ return *flagp & excepts & FE_ALL_EXCEPT;
+}
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index 577964c3c6..25e69a8998 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -229,6 +229,10 @@ sub parse_args {
++$current_arg;
next;
}
+ # Argument passed via pointer.
+ if ($descr[$i] =~ /p/) {
+ next;
+ }
# &FLOAT, &int - simplify call by not showing argument.
if ($descr[$i] =~ /F|I/) {
next;
@@ -280,6 +284,7 @@ sub parse_args {
# Put the C program line together
# Reset some variables to start again
$current_arg = 1;
+ $call_args =~ s/\"/\\\"/g;
$cline = "{ \"$call_args\"";
@descr = split //,$descr_args;
for ($i=0; $i <= $#descr; $i++) {
@@ -293,8 +298,8 @@ sub parse_args {
$current_arg++;
next;
}
- # &FLOAT, &int
- if ($descr[$i] =~ /F|I/) {
+ # &FLOAT, &int, argument passed via pointer
+ if ($descr[$i] =~ /F|I|p/) {
next;
}
# complex
diff --git a/math/k_casinh.c b/math/k_casinh.c
deleted file mode 100644
index 354dde1f3e..0000000000
--- a/math/k_casinh.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Return arc hyperbole sine for double value, with the imaginary part
- of the result possibly adjusted for use in computing other
- functions.
- Copyright (C) 1997-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* Return the complex inverse hyperbolic sine of finite nonzero Z,
- with the imaginary part of the result subtracted from pi/2 if ADJ
- is nonzero. */
-
-__complex__ double
-__kernel_casinh (__complex__ double x, int adj)
-{
- __complex__ double res;
- double rx, ix;
- __complex__ double y;
-
- /* Avoid cancellation by reducing to the first quadrant. */
- rx = fabs (__real__ x);
- ix = fabs (__imag__ x);
-
- if (rx >= 1.0 / DBL_EPSILON || ix >= 1.0 / DBL_EPSILON)
- {
- /* For large x in the first quadrant, x + csqrt (1 + x * x)
- is sufficiently close to 2 * x to make no significant
- difference to the result; avoid possible overflow from
- the squaring and addition. */
- __real__ y = rx;
- __imag__ y = ix;
-
- if (adj)
- {
- double t = __real__ y;
- __real__ y = __copysign (__imag__ y, __imag__ x);
- __imag__ y = t;
- }
-
- res = __clog (y);
- __real__ res += M_LN2;
- }
- else if (rx >= 0.5 && ix < DBL_EPSILON / 8.0)
- {
- double s = __ieee754_hypot (1.0, rx);
-
- __real__ res = __ieee754_log (rx + s);
- if (adj)
- __imag__ res = __ieee754_atan2 (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2 (ix, s);
- }
- else if (rx < DBL_EPSILON / 8.0 && ix >= 1.5)
- {
- double s = __ieee754_sqrt ((ix + 1.0) * (ix - 1.0));
-
- __real__ res = __ieee754_log (ix + s);
- if (adj)
- __imag__ res = __ieee754_atan2 (rx, __copysign (s, __imag__ x));
- else
- __imag__ res = __ieee754_atan2 (s, rx);
- }
- else if (ix > 1.0 && ix < 1.5 && rx < 0.5)
- {
- if (rx < DBL_EPSILON * DBL_EPSILON)
- {
- double ix2m1 = (ix + 1.0) * (ix - 1.0);
- double s = __ieee754_sqrt (ix2m1);
-
- __real__ res = __log1p (2.0 * (ix2m1 + ix * s)) / 2.0;
- if (adj)
- __imag__ res = __ieee754_atan2 (rx, __copysign (s, __imag__ x));
- else
- __imag__ res = __ieee754_atan2 (s, rx);
- }
- else
- {
- double ix2m1 = (ix + 1.0) * (ix - 1.0);
- double rx2 = rx * rx;
- double f = rx2 * (2.0 + rx2 + 2.0 * ix * ix);
- double d = __ieee754_sqrt (ix2m1 * ix2m1 + f);
- double dp = d + ix2m1;
- double dm = f / dp;
- double r1 = __ieee754_sqrt ((dm + rx2) / 2.0);
- double r2 = rx * ix / r1;
-
- __real__ res = __log1p (rx2 + dp + 2.0 * (rx * r1 + ix * r2)) / 2.0;
- if (adj)
- __imag__ res = __ieee754_atan2 (rx + r1, __copysign (ix + r2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2 (ix + r2, rx + r1);
- }
- }
- else if (ix == 1.0 && rx < 0.5)
- {
- if (rx < DBL_EPSILON / 8.0)
- {
- __real__ res = __log1p (2.0 * (rx + __ieee754_sqrt (rx))) / 2.0;
- if (adj)
- __imag__ res = __ieee754_atan2 (__ieee754_sqrt (rx),
- __copysign (1.0, __imag__ x));
- else
- __imag__ res = __ieee754_atan2 (1.0, __ieee754_sqrt (rx));
- }
- else
- {
- double d = rx * __ieee754_sqrt (4.0 + rx * rx);
- double s1 = __ieee754_sqrt ((d + rx * rx) / 2.0);
- double s2 = __ieee754_sqrt ((d - rx * rx) / 2.0);
-
- __real__ res = __log1p (rx * rx + d + 2.0 * (rx * s1 + s2)) / 2.0;
- if (adj)
- __imag__ res = __ieee754_atan2 (rx + s1, __copysign (1.0 + s2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2 (1.0 + s2, rx + s1);
- }
- }
- else if (ix < 1.0 && rx < 0.5)
- {
- if (ix >= DBL_EPSILON)
- {
- if (rx < DBL_EPSILON * DBL_EPSILON)
- {
- double onemix2 = (1.0 + ix) * (1.0 - ix);
- double s = __ieee754_sqrt (onemix2);
-
- __real__ res = __log1p (2.0 * rx / s) / 2.0;
- if (adj)
- __imag__ res = __ieee754_atan2 (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2 (ix, s);
- }
- else
- {
- double onemix2 = (1.0 + ix) * (1.0 - ix);
- double rx2 = rx * rx;
- double f = rx2 * (2.0 + rx2 + 2.0 * ix * ix);
- double d = __ieee754_sqrt (onemix2 * onemix2 + f);
- double dp = d + onemix2;
- double dm = f / dp;
- double r1 = __ieee754_sqrt ((dp + rx2) / 2.0);
- double r2 = rx * ix / r1;
-
- __real__ res
- = __log1p (rx2 + dm + 2.0 * (rx * r1 + ix * r2)) / 2.0;
- if (adj)
- __imag__ res = __ieee754_atan2 (rx + r1,
- __copysign (ix + r2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2 (ix + r2, rx + r1);
- }
- }
- else
- {
- double s = __ieee754_hypot (1.0, rx);
-
- __real__ res = __log1p (2.0 * rx * (rx + s)) / 2.0;
- if (adj)
- __imag__ res = __ieee754_atan2 (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2 (ix, s);
- }
- math_check_force_underflow_nonneg (__real__ res);
- }
- else
- {
- __real__ y = (rx - ix) * (rx + ix) + 1.0;
- __imag__ y = 2.0 * rx * ix;
-
- y = __csqrt (y);
-
- __real__ y += rx;
- __imag__ y += ix;
-
- if (adj)
- {
- double t = __real__ y;
- __real__ y = __copysign (__imag__ y, __imag__ x);
- __imag__ y = t;
- }
-
- res = __clog (y);
- }
-
- /* Give results the correct sign for the original argument. */
- __real__ res = __copysign (__real__ res, __real__ x);
- __imag__ res = __copysign (__imag__ res, (adj ? 1.0 : __imag__ x));
-
- return res;
-}
diff --git a/math/k_casinh_template.c b/math/k_casinh_template.c
new file mode 100644
index 0000000000..74626b1b3f
--- /dev/null
+++ b/math/k_casinh_template.c
@@ -0,0 +1,205 @@
+/* Return arc hyperbolic sine for a complex float type, with the
+ imaginary part of the result possibly adjusted for use in
+ computing other functions.
+ Copyright (C) 1997-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <complex.h>
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+/* Return the complex inverse hyperbolic sine of finite nonzero Z,
+ with the imaginary part of the result subtracted from pi/2 if ADJ
+ is nonzero. */
+
+CFLOAT
+M_DECL_FUNC (__kernel_casinh) (CFLOAT x, int adj)
+{
+ CFLOAT res;
+ FLOAT rx, ix;
+ CFLOAT y;
+
+ /* Avoid cancellation by reducing to the first quadrant. */
+ rx = M_FABS (__real__ x);
+ ix = M_FABS (__imag__ x);
+
+ if (rx >= 1 / M_EPSILON || ix >= 1 / M_EPSILON)
+ {
+ /* For large x in the first quadrant, x + csqrt (1 + x * x)
+ is sufficiently close to 2 * x to make no significant
+ difference to the result; avoid possible overflow from
+ the squaring and addition. */
+ __real__ y = rx;
+ __imag__ y = ix;
+
+ if (adj)
+ {
+ FLOAT t = __real__ y;
+ __real__ y = M_COPYSIGN (__imag__ y, __imag__ x);
+ __imag__ y = t;
+ }
+
+ res = M_SUF (__clog) (y);
+ __real__ res += (FLOAT) M_MLIT (M_LN2);
+ }
+ else if (rx >= M_LIT (0.5) && ix < M_EPSILON / 8)
+ {
+ FLOAT s = M_HYPOT (1, rx);
+
+ __real__ res = M_LOG (rx + s);
+ if (adj)
+ __imag__ res = M_ATAN2 (s, __imag__ x);
+ else
+ __imag__ res = M_ATAN2 (ix, s);
+ }
+ else if (rx < M_EPSILON / 8 && ix >= M_LIT (1.5))
+ {
+ FLOAT s = M_SQRT ((ix + 1) * (ix - 1));
+
+ __real__ res = M_LOG (ix + s);
+ if (adj)
+ __imag__ res = M_ATAN2 (rx, M_COPYSIGN (s, __imag__ x));
+ else
+ __imag__ res = M_ATAN2 (s, rx);
+ }
+ else if (ix > 1 && ix < M_LIT (1.5) && rx < M_LIT (0.5))
+ {
+ if (rx < M_EPSILON * M_EPSILON)
+ {
+ FLOAT ix2m1 = (ix + 1) * (ix - 1);
+ FLOAT s = M_SQRT (ix2m1);
+
+ __real__ res = M_LOG1P (2 * (ix2m1 + ix * s)) / 2;
+ if (adj)
+ __imag__ res = M_ATAN2 (rx, M_COPYSIGN (s, __imag__ x));
+ else
+ __imag__ res = M_ATAN2 (s, rx);
+ }
+ else
+ {
+ FLOAT ix2m1 = (ix + 1) * (ix - 1);
+ FLOAT rx2 = rx * rx;
+ FLOAT f = rx2 * (2 + rx2 + 2 * ix * ix);
+ FLOAT d = M_SQRT (ix2m1 * ix2m1 + f);
+ FLOAT dp = d + ix2m1;
+ FLOAT dm = f / dp;
+ FLOAT r1 = M_SQRT ((dm + rx2) / 2);
+ FLOAT r2 = rx * ix / r1;
+
+ __real__ res = M_LOG1P (rx2 + dp + 2 * (rx * r1 + ix * r2)) / 2;
+ if (adj)
+ __imag__ res = M_ATAN2 (rx + r1, M_COPYSIGN (ix + r2, __imag__ x));
+ else
+ __imag__ res = M_ATAN2 (ix + r2, rx + r1);
+ }
+ }
+ else if (ix == 1 && rx < M_LIT (0.5))
+ {
+ if (rx < M_EPSILON / 8)
+ {
+ __real__ res = M_LOG1P (2 * (rx + M_SQRT (rx))) / 2;
+ if (adj)
+ __imag__ res = M_ATAN2 (M_SQRT (rx), M_COPYSIGN (1, __imag__ x));
+ else
+ __imag__ res = M_ATAN2 (1, M_SQRT (rx));
+ }
+ else
+ {
+ FLOAT d = rx * M_SQRT (4 + rx * rx);
+ FLOAT s1 = M_SQRT ((d + rx * rx) / 2);
+ FLOAT s2 = M_SQRT ((d - rx * rx) / 2);
+
+ __real__ res = M_LOG1P (rx * rx + d + 2 * (rx * s1 + s2)) / 2;
+ if (adj)
+ __imag__ res = M_ATAN2 (rx + s1, M_COPYSIGN (1 + s2, __imag__ x));
+ else
+ __imag__ res = M_ATAN2 (1 + s2, rx + s1);
+ }
+ }
+ else if (ix < 1 && rx < M_LIT (0.5))
+ {
+ if (ix >= M_EPSILON)
+ {
+ if (rx < M_EPSILON * M_EPSILON)
+ {
+ FLOAT onemix2 = (1 + ix) * (1 - ix);
+ FLOAT s = M_SQRT (onemix2);
+
+ __real__ res = M_LOG1P (2 * rx / s) / 2;
+ if (adj)
+ __imag__ res = M_ATAN2 (s, __imag__ x);
+ else
+ __imag__ res = M_ATAN2 (ix, s);
+ }
+ else
+ {
+ FLOAT onemix2 = (1 + ix) * (1 - ix);
+ FLOAT rx2 = rx * rx;
+ FLOAT f = rx2 * (2 + rx2 + 2 * ix * ix);
+ FLOAT d = M_SQRT (onemix2 * onemix2 + f);
+ FLOAT dp = d + onemix2;
+ FLOAT dm = f / dp;
+ FLOAT r1 = M_SQRT ((dp + rx2) / 2);
+ FLOAT r2 = rx * ix / r1;
+
+ __real__ res = M_LOG1P (rx2 + dm + 2 * (rx * r1 + ix * r2)) / 2;
+ if (adj)
+ __imag__ res = M_ATAN2 (rx + r1, M_COPYSIGN (ix + r2,
+ __imag__ x));
+ else
+ __imag__ res = M_ATAN2 (ix + r2, rx + r1);
+ }
+ }
+ else
+ {
+ FLOAT s = M_HYPOT (1, rx);
+
+ __real__ res = M_LOG1P (2 * rx * (rx + s)) / 2;
+ if (adj)
+ __imag__ res = M_ATAN2 (s, __imag__ x);
+ else
+ __imag__ res = M_ATAN2 (ix, s);
+ }
+ math_check_force_underflow_nonneg (__real__ res);
+ }
+ else
+ {
+ __real__ y = (rx - ix) * (rx + ix) + 1;
+ __imag__ y = 2 * rx * ix;
+
+ y = M_SUF (__csqrt) (y);
+
+ __real__ y += rx;
+ __imag__ y += ix;
+
+ if (adj)
+ {
+ FLOAT t = __real__ y;
+ __real__ y = M_COPYSIGN (__imag__ y, __imag__ x);
+ __imag__ y = t;
+ }
+
+ res = M_SUF (__clog) (y);
+ }
+
+ /* Give results the correct sign for the original argument. */
+ __real__ res = M_COPYSIGN (__real__ res, __real__ x);
+ __imag__ res = M_COPYSIGN (__imag__ res, (adj ? 1 : __imag__ x));
+
+ return res;
+}
diff --git a/math/k_casinhf.c b/math/k_casinhf.c
deleted file mode 100644
index 7697f314be..0000000000
--- a/math/k_casinhf.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/* Return arc hyperbole sine for float value, with the imaginary part
- of the result possibly adjusted for use in computing other
- functions.
- Copyright (C) 1997-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* Return the complex inverse hyperbolic sine of finite nonzero Z,
- with the imaginary part of the result subtracted from pi/2 if ADJ
- is nonzero. */
-
-__complex__ float
-__kernel_casinhf (__complex__ float x, int adj)
-{
- __complex__ float res;
- float rx, ix;
- __complex__ float y;
-
- /* Avoid cancellation by reducing to the first quadrant. */
- rx = fabsf (__real__ x);
- ix = fabsf (__imag__ x);
-
- if (rx >= 1.0f / FLT_EPSILON || ix >= 1.0f / FLT_EPSILON)
- {
- /* For large x in the first quadrant, x + csqrt (1 + x * x)
- is sufficiently close to 2 * x to make no significant
- difference to the result; avoid possible overflow from
- the squaring and addition. */
- __real__ y = rx;
- __imag__ y = ix;
-
- if (adj)
- {
- float t = __real__ y;
- __real__ y = __copysignf (__imag__ y, __imag__ x);
- __imag__ y = t;
- }
-
- res = __clogf (y);
- __real__ res += (float) M_LN2;
- }
- else if (rx >= 0.5f && ix < FLT_EPSILON / 8.0f)
- {
- float s = __ieee754_hypotf (1.0f, rx);
-
- __real__ res = __ieee754_logf (rx + s);
- if (adj)
- __imag__ res = __ieee754_atan2f (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2f (ix, s);
- }
- else if (rx < FLT_EPSILON / 8.0f && ix >= 1.5f)
- {
- float s = __ieee754_sqrtf ((ix + 1.0f) * (ix - 1.0f));
-
- __real__ res = __ieee754_logf (ix + s);
- if (adj)
- __imag__ res = __ieee754_atan2f (rx, __copysignf (s, __imag__ x));
- else
- __imag__ res = __ieee754_atan2f (s, rx);
- }
- else if (ix > 1.0f && ix < 1.5f && rx < 0.5f)
- {
- if (rx < FLT_EPSILON * FLT_EPSILON)
- {
- float ix2m1 = (ix + 1.0f) * (ix - 1.0f);
- float s = __ieee754_sqrtf (ix2m1);
-
- __real__ res = __log1pf (2.0f * (ix2m1 + ix * s)) / 2.0f;
- if (adj)
- __imag__ res = __ieee754_atan2f (rx, __copysignf (s, __imag__ x));
- else
- __imag__ res = __ieee754_atan2f (s, rx);
- }
- else
- {
- float ix2m1 = (ix + 1.0f) * (ix - 1.0f);
- float rx2 = rx * rx;
- float f = rx2 * (2.0f + rx2 + 2.0f * ix * ix);
- float d = __ieee754_sqrtf (ix2m1 * ix2m1 + f);
- float dp = d + ix2m1;
- float dm = f / dp;
- float r1 = __ieee754_sqrtf ((dm + rx2) / 2.0f);
- float r2 = rx * ix / r1;
-
- __real__ res
- = __log1pf (rx2 + dp + 2.0f * (rx * r1 + ix * r2)) / 2.0f;
- if (adj)
- __imag__ res = __ieee754_atan2f (rx + r1, __copysignf (ix + r2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2f (ix + r2, rx + r1);
- }
- }
- else if (ix == 1.0f && rx < 0.5f)
- {
- if (rx < FLT_EPSILON / 8.0f)
- {
- __real__ res = __log1pf (2.0f * (rx + __ieee754_sqrtf (rx))) / 2.0f;
- if (adj)
- __imag__ res = __ieee754_atan2f (__ieee754_sqrtf (rx),
- __copysignf (1.0f, __imag__ x));
- else
- __imag__ res = __ieee754_atan2f (1.0f, __ieee754_sqrtf (rx));
- }
- else
- {
- float d = rx * __ieee754_sqrtf (4.0f + rx * rx);
- float s1 = __ieee754_sqrtf ((d + rx * rx) / 2.0f);
- float s2 = __ieee754_sqrtf ((d - rx * rx) / 2.0f);
-
- __real__ res = __log1pf (rx * rx + d + 2.0f * (rx * s1 + s2)) / 2.0f;
- if (adj)
- __imag__ res = __ieee754_atan2f (rx + s1,
- __copysignf (1.0f + s2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2f (1.0f + s2, rx + s1);
- }
- }
- else if (ix < 1.0f && rx < 0.5f)
- {
- if (ix >= FLT_EPSILON)
- {
- if (rx < FLT_EPSILON * FLT_EPSILON)
- {
- float onemix2 = (1.0f + ix) * (1.0f - ix);
- float s = __ieee754_sqrtf (onemix2);
-
- __real__ res = __log1pf (2.0f * rx / s) / 2.0f;
- if (adj)
- __imag__ res = __ieee754_atan2f (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2f (ix, s);
- }
- else
- {
- float onemix2 = (1.0f + ix) * (1.0f - ix);
- float rx2 = rx * rx;
- float f = rx2 * (2.0f + rx2 + 2.0f * ix * ix);
- float d = __ieee754_sqrtf (onemix2 * onemix2 + f);
- float dp = d + onemix2;
- float dm = f / dp;
- float r1 = __ieee754_sqrtf ((dp + rx2) / 2.0f);
- float r2 = rx * ix / r1;
-
- __real__ res
- = __log1pf (rx2 + dm + 2.0f * (rx * r1 + ix * r2)) / 2.0f;
- if (adj)
- __imag__ res = __ieee754_atan2f (rx + r1,
- __copysignf (ix + r2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2f (ix + r2, rx + r1);
- }
- }
- else
- {
- float s = __ieee754_hypotf (1.0f, rx);
-
- __real__ res = __log1pf (2.0f * rx * (rx + s)) / 2.0f;
- if (adj)
- __imag__ res = __ieee754_atan2f (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2f (ix, s);
- }
- math_check_force_underflow_nonneg (__real__ res);
- }
- else
- {
- __real__ y = (rx - ix) * (rx + ix) + 1.0f;
- __imag__ y = 2.0f * rx * ix;
-
- y = __csqrtf (y);
-
- __real__ y += rx;
- __imag__ y += ix;
-
- if (adj)
- {
- float t = __real__ y;
- __real__ y = __copysignf (__imag__ y, __imag__ x);
- __imag__ y = t;
- }
-
- res = __clogf (y);
- }
-
- /* Give results the correct sign for the original argument. */
- __real__ res = __copysignf (__real__ res, __real__ x);
- __imag__ res = __copysignf (__imag__ res, (adj ? 1.0f : __imag__ x));
-
- return res;
-}
diff --git a/math/k_casinhl.c b/math/k_casinhl.c
deleted file mode 100644
index 7c4b9c36bf..0000000000
--- a/math/k_casinhl.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* Return arc hyperbole sine for long double value, with the imaginary
- part of the result possibly adjusted for use in computing other
- functions.
- Copyright (C) 1997-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* To avoid spurious overflows, use this definition to treat IBM long
- double as approximating an IEEE-style format. */
-#if LDBL_MANT_DIG == 106
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 0x1p-106L
-#endif
-
-/* Return the complex inverse hyperbolic sine of finite nonzero Z,
- with the imaginary part of the result subtracted from pi/2 if ADJ
- is nonzero. */
-
-__complex__ long double
-__kernel_casinhl (__complex__ long double x, int adj)
-{
- __complex__ long double res;
- long double rx, ix;
- __complex__ long double y;
-
- /* Avoid cancellation by reducing to the first quadrant. */
- rx = fabsl (__real__ x);
- ix = fabsl (__imag__ x);
-
- if (rx >= 1.0L / LDBL_EPSILON || ix >= 1.0L / LDBL_EPSILON)
- {
- /* For large x in the first quadrant, x + csqrt (1 + x * x)
- is sufficiently close to 2 * x to make no significant
- difference to the result; avoid possible overflow from
- the squaring and addition. */
- __real__ y = rx;
- __imag__ y = ix;
-
- if (adj)
- {
- long double t = __real__ y;
- __real__ y = __copysignl (__imag__ y, __imag__ x);
- __imag__ y = t;
- }
-
- res = __clogl (y);
- __real__ res += M_LN2l;
- }
- else if (rx >= 0.5L && ix < LDBL_EPSILON / 8.0L)
- {
- long double s = __ieee754_hypotl (1.0L, rx);
-
- __real__ res = __ieee754_logl (rx + s);
- if (adj)
- __imag__ res = __ieee754_atan2l (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2l (ix, s);
- }
- else if (rx < LDBL_EPSILON / 8.0L && ix >= 1.5L)
- {
- long double s = __ieee754_sqrtl ((ix + 1.0L) * (ix - 1.0L));
-
- __real__ res = __ieee754_logl (ix + s);
- if (adj)
- __imag__ res = __ieee754_atan2l (rx, __copysignl (s, __imag__ x));
- else
- __imag__ res = __ieee754_atan2l (s, rx);
- }
- else if (ix > 1.0L && ix < 1.5L && rx < 0.5L)
- {
- if (rx < LDBL_EPSILON * LDBL_EPSILON)
- {
- long double ix2m1 = (ix + 1.0L) * (ix - 1.0L);
- long double s = __ieee754_sqrtl (ix2m1);
-
- __real__ res = __log1pl (2.0L * (ix2m1 + ix * s)) / 2.0L;
- if (adj)
- __imag__ res = __ieee754_atan2l (rx, __copysignl (s, __imag__ x));
- else
- __imag__ res = __ieee754_atan2l (s, rx);
- }
- else
- {
- long double ix2m1 = (ix + 1.0L) * (ix - 1.0L);
- long double rx2 = rx * rx;
- long double f = rx2 * (2.0L + rx2 + 2.0L * ix * ix);
- long double d = __ieee754_sqrtl (ix2m1 * ix2m1 + f);
- long double dp = d + ix2m1;
- long double dm = f / dp;
- long double r1 = __ieee754_sqrtl ((dm + rx2) / 2.0L);
- long double r2 = rx * ix / r1;
-
- __real__ res
- = __log1pl (rx2 + dp + 2.0L * (rx * r1 + ix * r2)) / 2.0L;
- if (adj)
- __imag__ res = __ieee754_atan2l (rx + r1, __copysignl (ix + r2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2l (ix + r2, rx + r1);
- }
- }
- else if (ix == 1.0L && rx < 0.5L)
- {
- if (rx < LDBL_EPSILON / 8.0L)
- {
- __real__ res = __log1pl (2.0L * (rx + __ieee754_sqrtl (rx))) / 2.0L;
- if (adj)
- __imag__ res = __ieee754_atan2l (__ieee754_sqrtl (rx),
- __copysignl (1.0L, __imag__ x));
- else
- __imag__ res = __ieee754_atan2l (1.0L, __ieee754_sqrtl (rx));
- }
- else
- {
- long double d = rx * __ieee754_sqrtl (4.0L + rx * rx);
- long double s1 = __ieee754_sqrtl ((d + rx * rx) / 2.0L);
- long double s2 = __ieee754_sqrtl ((d - rx * rx) / 2.0L);
-
- __real__ res = __log1pl (rx * rx + d + 2.0L * (rx * s1 + s2)) / 2.0L;
- if (adj)
- __imag__ res = __ieee754_atan2l (rx + s1,
- __copysignl (1.0L + s2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2l (1.0L + s2, rx + s1);
- }
- }
- else if (ix < 1.0L && rx < 0.5L)
- {
- if (ix >= LDBL_EPSILON)
- {
- if (rx < LDBL_EPSILON * LDBL_EPSILON)
- {
- long double onemix2 = (1.0L + ix) * (1.0L - ix);
- long double s = __ieee754_sqrtl (onemix2);
-
- __real__ res = __log1pl (2.0L * rx / s) / 2.0L;
- if (adj)
- __imag__ res = __ieee754_atan2l (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2l (ix, s);
- }
- else
- {
- long double onemix2 = (1.0L + ix) * (1.0L - ix);
- long double rx2 = rx * rx;
- long double f = rx2 * (2.0L + rx2 + 2.0L * ix * ix);
- long double d = __ieee754_sqrtl (onemix2 * onemix2 + f);
- long double dp = d + onemix2;
- long double dm = f / dp;
- long double r1 = __ieee754_sqrtl ((dp + rx2) / 2.0L);
- long double r2 = rx * ix / r1;
-
- __real__ res
- = __log1pl (rx2 + dm + 2.0L * (rx * r1 + ix * r2)) / 2.0L;
- if (adj)
- __imag__ res = __ieee754_atan2l (rx + r1,
- __copysignl (ix + r2,
- __imag__ x));
- else
- __imag__ res = __ieee754_atan2l (ix + r2, rx + r1);
- }
- }
- else
- {
- long double s = __ieee754_hypotl (1.0L, rx);
-
- __real__ res = __log1pl (2.0L * rx * (rx + s)) / 2.0L;
- if (adj)
- __imag__ res = __ieee754_atan2l (s, __imag__ x);
- else
- __imag__ res = __ieee754_atan2l (ix, s);
- }
- math_check_force_underflow_nonneg (__real__ res);
- }
- else
- {
- __real__ y = (rx - ix) * (rx + ix) + 1.0L;
- __imag__ y = 2.0L * rx * ix;
-
- y = __csqrtl (y);
-
- __real__ y += rx;
- __imag__ y += ix;
-
- if (adj)
- {
- long double t = __real__ y;
- __real__ y = __copysignl (__imag__ y, __imag__ x);
- __imag__ y = t;
- }
-
- res = __clogl (y);
- }
-
- /* Give results the correct sign for the original argument. */
- __real__ res = __copysignl (__real__ res, __real__ x);
- __imag__ res = __copysignl (__imag__ res, (adj ? 1.0L : __imag__ x));
-
- return res;
-}
diff --git a/math/k_rem_pio2l.c b/math/k_rem_pio2l.c
deleted file mode 100644
index 01bf158249..0000000000
--- a/math/k_rem_pio2l.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <math.h>
-#include <math_private.h>
-#include <stdio.h>
-#include <errno.h>
-
-int
-__kernel_rem_pio2l (long double *x, long double *y, int e0, int nx, int prec,
- const int *ipio2)
-{
- fputs ("__kernel_rem_pio2l not implemented\n", stderr);
- __set_errno (ENOSYS);
- return 0.0;
-}
-
-stub_warning (__kernel_rem_pio2l)
diff --git a/math/libm-test.inc b/math/libm-test.inc
index e4fcb5a198..88420ee613 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -43,17 +43,19 @@
/* This testsuite has currently tests for:
acos, acosh, asin, asinh, atan, atan2, atanh,
- cbrt, ceil, copysign, cos, cosh, drem, erf, erfc, exp, exp10, exp2, expm1,
+ canonicalize, cbrt, ceil, copysign, cos, cosh, drem,
+ erf, erfc, exp, exp10, exp2, expm1,
fabs, fdim, finite, floor, fma, fmax, fmin, fmod, fpclassify,
- frexp, gamma, hypot,
- ilogb, isfinite, isinf, isnan, isnormal, issignaling,
- isless, islessequal, isgreater, isgreaterequal, islessgreater, isunordered,
- j0, j1, jn,
+ frexp, gamma, getpayload, hypot,
+ ilogb, iscanonical, isfinite, isinf, isnan, isnormal, issignaling,
+ issubnormal, iszero, iseqsig, isless, islessequal, isgreater,
+ isgreaterequal, islessgreater, isunordered, j0, j1, jn,
ldexp, lgamma, log, log10, log1p, log2, logb,
modf, nearbyint, nextafter, nexttoward,
pow, pow10, remainder, remquo, rint, lrint, llrint,
round, lround, llround,
- scalb, scalbn, scalbln, signbit, sin, sincos, sinh, sqrt, tan, tanh, tgamma, trunc,
+ scalb, scalbn, scalbln, signbit, sin, sincos, sinh, sqrt,
+ tan, tanh, tgamma, totalorder, totalordermag, trunc,
y0, y1, yn, significand
and for the following complex math functions:
@@ -84,7 +86,9 @@
against. These implemented tests should check all cases that are
specified in ISO C99.
- NaN values: The payload of NaNs is not examined.
+ NaN values: The payload of NaNs is set in inputs for functions
+ where it is significant, and is examined in the outputs of some
+ functions.
Inline functions: Inlining functions should give an improvement in
speed - but not in precission. The inlined functions return
@@ -129,6 +133,7 @@
#include <tininess.h>
#include <math-tests.h>
#include <math-tests-arch.h>
+#include <nan-high-order-bit.h>
/* This header defines func_ulps, func_real_ulps and func_imag_ulps
arrays. */
@@ -169,17 +174,22 @@
/* Some special test flags, passed together with exceptions. */
#define IGNORE_ZERO_INF_SIGN 0x400
#define TEST_NAN_SIGN 0x800
-#define NO_TEST_INLINE 0x1000
-#define XFAIL_TEST 0x2000
+#define TEST_NAN_PAYLOAD 0x1000
+#define NO_TEST_INLINE 0x2000
+#define XFAIL_TEST 0x4000
/* Indicate errno settings required or disallowed. */
-#define ERRNO_UNCHANGED 0x4000
-#define ERRNO_EDOM 0x8000
-#define ERRNO_ERANGE 0x10000
+#define ERRNO_UNCHANGED 0x8000
+#define ERRNO_EDOM 0x10000
+#define ERRNO_ERANGE 0x20000
/* Flags generated by gen-libm-test.pl, not entered here manually. */
-#define IGNORE_RESULT 0x20000
-#define NON_FINITE 0x40000
-#define TEST_SNAN 0x80000
-#define NO_TEST_MATHVEC 0x100000
+#define IGNORE_RESULT 0x40000
+#define NON_FINITE 0x80000
+#define TEST_SNAN 0x100000
+#define NO_TEST_MATHVEC 0x200000
+
+#define TEST_NAN_PAYLOAD_CANONICALIZE (SNAN_TESTS_PRESERVE_PAYLOAD \
+ ? TEST_NAN_PAYLOAD \
+ : 0)
#define __CONCATX(a,b) __CONCAT(a,b)
@@ -224,6 +234,13 @@
&& MIN_EXP == -16382 \
&& MAX_EXP == 16384)
+/* Number of bits in NaN payload. */
+#if TEST_COND_ibm128
+# define PAYLOAD_DIG (DBL_MANT_DIG - 2)
+#else
+# define PAYLOAD_DIG (MANT_DIG - 2)
+#endif
+
/* Values underflowing only for float. */
#if TEST_COND_binary32
# define UNDERFLOW_EXCEPTION_FLOAT UNDERFLOW_EXCEPTION
@@ -312,8 +329,10 @@ static int ignore_max_ulp; /* Should we ignore max_ulp? */
#define minus_zero LIT (-0.0)
#define plus_infty FUNC (__builtin_inf) ()
#define minus_infty -(FUNC (__builtin_inf) ())
-#define qnan_value FUNC (__builtin_nan) ("")
-#define snan_value FUNC (__builtin_nans) ("")
+#define qnan_value_pl(S) FUNC (__builtin_nan) (S)
+#define qnan_value qnan_value_pl ("")
+#define snan_value_pl(S) FUNC (__builtin_nans) (S)
+#define snan_value snan_value_pl ("")
#define max_value TYPE_MAX
#define min_value TYPE_MIN
#define min_subnorm_value TYPE_TRUE_MIN
@@ -789,6 +808,13 @@ check_float_internal (const char *test_name, FLOAT computed, FLOAT expected,
ok = 0;
printf ("signaling NaN has wrong sign.\n");
}
+ else if ((exceptions & TEST_NAN_PAYLOAD) != 0
+ && (FUNC (getpayload) (&computed)
+ != FUNC (getpayload) (&expected)))
+ {
+ ok = 0;
+ printf ("signaling NaN has wrong payload.\n");
+ }
else
ok = 1;
}
@@ -802,6 +828,13 @@ check_float_internal (const char *test_name, FLOAT computed, FLOAT expected,
ok = 0;
printf ("quiet NaN has wrong sign.\n");
}
+ else if ((exceptions & TEST_NAN_PAYLOAD) != 0
+ && (FUNC (getpayload) (&computed)
+ != FUNC (getpayload) (&expected)))
+ {
+ ok = 0;
+ printf ("quiet NaN has wrong payload.\n");
+ }
else
ok = 1;
}
@@ -1064,6 +1097,7 @@ enable_test (int exceptions)
}
/* Structures for each kind of test. */
+/* Used for both RUN_TEST_LOOP_f_f and RUN_TEST_LOOP_fp_f. */
struct test_f_f_data
{
const char *arg_str;
@@ -1220,6 +1254,7 @@ struct test_f_i_data
int exceptions;
} rd, rn, rz, ru;
};
+/* Used for both RUN_TEST_LOOP_ff_b and RUN_TEST_LOOP_ff_i_tg. */
struct test_ff_i_data
{
const char *arg_str;
@@ -1263,6 +1298,18 @@ struct test_fFF_11_data
FLOAT extra2_expected;
} rd, rn, rz, ru;
};
+struct test_Ffp_b1_data
+{
+ const char *arg_str;
+ FLOAT arg;
+ struct
+ {
+ int expected;
+ int exceptions;
+ int extra_test;
+ FLOAT extra_expected;
+ } rd, rn, rz, ru;
+};
/* Set the rounding mode, or restore the saved value. */
#define IF_ROUND_INIT_ /* Empty. */
@@ -1340,6 +1387,24 @@ struct test_fFF_11_data
(ARRAY)[i].RM_##ROUNDING_MODE.expected, \
(ARRAY)[i].RM_##ROUNDING_MODE.exceptions); \
ROUND_RESTORE_ ## ROUNDING_MODE
+#define RUN_TEST_fp_f(ARG_STR, FUNC_NAME, ARG, EXPECTED, \
+ EXCEPTIONS) \
+ do \
+ if (enable_test (EXCEPTIONS)) \
+ { \
+ COMMON_TEST_SETUP (ARG_STR); \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (&(ARG)), \
+ EXPECTED, EXCEPTIONS); \
+ COMMON_TEST_CLEANUP; \
+ } \
+ while (0)
+#define RUN_TEST_LOOP_fp_f(FUNC_NAME, ARRAY, ROUNDING_MODE) \
+ IF_ROUND_INIT_ ## ROUNDING_MODE \
+ for (size_t i = 0; i < sizeof (ARRAY) / sizeof (ARRAY)[0]; i++) \
+ RUN_TEST_fp_f ((ARRAY)[i].arg_str, FUNC_NAME, (ARRAY)[i].arg, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.expected, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.exceptions); \
+ ROUND_RESTORE_ ## ROUNDING_MODE
#define RUN_TEST_2_f(ARG_STR, FUNC_NAME, ARG1, ARG2, EXPECTED, \
EXCEPTIONS) \
do \
@@ -1518,6 +1583,36 @@ struct test_fFF_11_data
(ARRAY)[i].RM_##ROUNDING_MODE.extra_test, \
(ARRAY)[i].RM_##ROUNDING_MODE.extra_expected); \
ROUND_RESTORE_ ## ROUNDING_MODE
+#define RUN_TEST_Ffp_b1(ARG_STR, FUNC_NAME, ARG, EXPECTED, \
+ EXCEPTIONS, EXTRA_VAR, EXTRA_TEST, \
+ EXTRA_EXPECTED) \
+ do \
+ if (enable_test (EXCEPTIONS)) \
+ { \
+ COMMON_TEST_SETUP (ARG_STR); \
+ (EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
+ check_bool (test_name, FUNC_TEST (FUNC_NAME) (&(EXTRA_VAR), \
+ &(ARG)), \
+ EXPECTED, EXCEPTIONS); \
+ EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
+ if (EXTRA_TEST) \
+ check_float (extra1_name, EXTRA_VAR, EXTRA_EXPECTED, \
+ (EXCEPTIONS) & TEST_NAN_PAYLOAD); \
+ EXTRA_OUTPUT_TEST_CLEANUP (1); \
+ COMMON_TEST_CLEANUP; \
+ } \
+ while (0)
+#define RUN_TEST_LOOP_Ffp_b1(FUNC_NAME, ARRAY, ROUNDING_MODE, \
+ EXTRA_VAR) \
+ IF_ROUND_INIT_ ## ROUNDING_MODE \
+ for (size_t i = 0; i < sizeof (ARRAY) / sizeof (ARRAY)[0]; i++) \
+ RUN_TEST_Ffp_b1 ((ARRAY)[i].arg_str, FUNC_NAME, (ARRAY)[i].arg, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.expected, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.exceptions, \
+ EXTRA_VAR, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.extra_test, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.extra_expected); \
+ ROUND_RESTORE_ ## ROUNDING_MODE
#define RUN_TEST_c_c(ARG_STR, FUNC_NAME, ARGR, ARGC, EXPR, EXPC, \
EXCEPTIONS) \
do \
@@ -1596,6 +1691,25 @@ struct test_fFF_11_data
(ARRAY)[i].RM_##ROUNDING_MODE.expected, \
(ARRAY)[i].RM_##ROUNDING_MODE.exceptions); \
ROUND_RESTORE_ ## ROUNDING_MODE
+#define RUN_TEST_ff_b(ARG_STR, FUNC_NAME, ARG1, ARG2, EXPECTED, \
+ EXCEPTIONS) \
+ do \
+ if (enable_test (EXCEPTIONS)) \
+ { \
+ COMMON_TEST_SETUP (ARG_STR); \
+ check_bool (test_name, FUNC_TEST (FUNC_NAME) (ARG1, ARG2), \
+ EXPECTED, EXCEPTIONS); \
+ COMMON_TEST_CLEANUP; \
+ } \
+ while (0)
+#define RUN_TEST_LOOP_ff_b(FUNC_NAME, ARRAY, ROUNDING_MODE) \
+ IF_ROUND_INIT_ ## ROUNDING_MODE \
+ for (size_t i = 0; i < sizeof (ARRAY) / sizeof (ARRAY)[0]; i++) \
+ RUN_TEST_ff_b ((ARRAY)[i].arg_str, FUNC_NAME, \
+ (ARRAY)[i].arg1, (ARRAY)[i].arg2, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.expected, \
+ (ARRAY)[i].RM_##ROUNDING_MODE.exceptions); \
+ ROUND_RESTORE_ ## ROUNDING_MODE
#define RUN_TEST_ff_i_tg(ARG_STR, FUNC_NAME, ARG1, ARG2, EXPECTED, \
EXCEPTIONS) \
do \
@@ -3506,6 +3620,71 @@ cacosh_test (void)
}
+static const struct test_Ffp_b1_data canonicalize_test_data[] =
+ {
+ TEST_Ffp_b1 (canonicalize, plus_infty, 0, plus_infty, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, minus_infty, 0, minus_infty, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, plus_zero, 0, plus_zero, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, minus_zero, 0, minus_zero, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, 1000, 0, 1000, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, max_value, 0, max_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, -max_value, 0, -max_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, min_value, 0, min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, -min_value, 0, -min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, min_subnorm_value, 0, min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, -min_subnorm_value, 0, -min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_Ffp_b1 (canonicalize, qnan_value, 0, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value, 0, -qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, snan_value, 0, qnan_value, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN),
+ TEST_Ffp_b1 (canonicalize, -snan_value, 0, -qnan_value, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN),
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ TEST_Ffp_b1 (canonicalize, snan_value_pl ("0x0"), 0, qnan_value, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN),
+ TEST_Ffp_b1 (canonicalize, -snan_value_pl ("0x0"), 0, -qnan_value, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN),
+#else
+ TEST_Ffp_b1 (canonicalize, qnan_value_pl ("0x0"), 0, qnan_value_pl ("0x0"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value_pl ("0x0"), 0, -qnan_value_pl ("0x0"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+#endif
+ TEST_Ffp_b1 (canonicalize, qnan_value_pl ("0x1"), 0, qnan_value_pl ("0x1"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value_pl ("0x1"), 0, -qnan_value_pl ("0x1"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, snan_value_pl ("0x1"), 0, qnan_value_pl ("0x1"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, -snan_value_pl ("0x1"), 0, -qnan_value_pl ("0x1"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, qnan_value_pl ("0x2"), 0, qnan_value_pl ("0x2"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value_pl ("0x2"), 0, -qnan_value_pl ("0x2"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, snan_value_pl ("0x2"), 0, qnan_value_pl ("0x2"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, -snan_value_pl ("0x2"), 0, -qnan_value_pl ("0x2"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, qnan_value_pl ("0x3fffff"), 0, qnan_value_pl ("0x3fffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value_pl ("0x3fffff"), 0, -qnan_value_pl ("0x3fffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, snan_value_pl ("0x3fffff"), 0, qnan_value_pl ("0x3fffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, -snan_value_pl ("0x3fffff"), 0, -qnan_value_pl ("0x3fffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+#if PAYLOAD_DIG >= 51
+ TEST_Ffp_b1 (canonicalize, qnan_value_pl ("0x7ffffffffffff"), 0, qnan_value_pl ("0x7ffffffffffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value_pl ("0x7ffffffffffff"), 0, -qnan_value_pl ("0x7ffffffffffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, snan_value_pl ("0x7ffffffffffff"), 0, qnan_value_pl ("0x7ffffffffffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, -snan_value_pl ("0x7ffffffffffff"), 0, -qnan_value_pl ("0x7ffffffffffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+#endif
+#if PAYLOAD_DIG >= 62
+ TEST_Ffp_b1 (canonicalize, qnan_value_pl ("0x3fffffffffffffff"), 0, qnan_value_pl ("0x3fffffffffffffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value_pl ("0x3fffffffffffffff"), 0, -qnan_value_pl ("0x3fffffffffffffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, snan_value_pl ("0x3fffffffffffffff"), 0, qnan_value_pl ("0x3fffffffffffffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, -snan_value_pl ("0x3fffffffffffffff"), 0, -qnan_value_pl ("0x3fffffffffffffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+#endif
+#if PAYLOAD_DIG >= 111
+ TEST_Ffp_b1 (canonicalize, qnan_value_pl ("0x7fffffffffffffffffffffffffff"), 0, qnan_value_pl ("0x7fffffffffffffffffffffffffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, -qnan_value_pl ("0x7fffffffffffffffffffffffffff"), 0, -qnan_value_pl ("0x7fffffffffffffffffffffffffff"), NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD),
+ TEST_Ffp_b1 (canonicalize, snan_value_pl ("0x7fffffffffffffffffffffffffff"), 0, qnan_value_pl ("0x7fffffffffffffffffffffffffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+ TEST_Ffp_b1 (canonicalize, -snan_value_pl ("0x7fffffffffffffffffffffffffff"), 0, -qnan_value_pl ("0x7fffffffffffffffffffffffffff"), NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_UNCHANGED|TEST_NAN_SIGN|TEST_NAN_PAYLOAD_CANONICALIZE),
+#endif
+ };
+
+static void
+canonicalize_test (void)
+{
+ FLOAT x;
+
+ ALL_RM_TEST (canonicalize, 1, canonicalize_test_data, RUN_TEST_LOOP_Ffp_b1, END, x);
+}
+
+
static const struct test_c_f_data carg_test_data[] =
{
/* carg (x + iy) is specified as atan2 (y, x) */
@@ -8015,6 +8194,66 @@ frexp_test (void)
ALL_RM_TEST (frexp, 1, frexp_test_data, RUN_TEST_LOOP_fI_f1, END, x);
}
+
+static const struct test_f_f_data getpayload_test_data[] =
+ {
+ TEST_fp_f (getpayload, plus_infty, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, minus_infty, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, plus_zero, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, minus_zero, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, 1000, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, max_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -max_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, min_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -min_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, min_subnorm_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -min_subnorm_value, IGNORE, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ TEST_fp_f (getpayload, snan_value_pl ("0x0"), plus_zero, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -snan_value_pl ("0x0"), plus_zero, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#else
+ TEST_fp_f (getpayload, qnan_value_pl ("0x0"), plus_zero, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -qnan_value_pl ("0x0"), plus_zero, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+ TEST_fp_f (getpayload, qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, qnan_value_pl ("0x2"), 2, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -qnan_value_pl ("0x2"), 2, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, snan_value_pl ("0x2"), 2, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -snan_value_pl ("0x2"), 2, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, qnan_value_pl ("0x3fffff"), 0x3fffff, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -qnan_value_pl ("0x3fffff"), 0x3fffff, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, snan_value_pl ("0x3fffff"), 0x3fffff, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -snan_value_pl ("0x3fffff"), 0x3fffff, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#if PAYLOAD_DIG >= 51
+ TEST_fp_f (getpayload, qnan_value_pl ("0x7ffffffffffff"), 0x7ffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -qnan_value_pl ("0x7ffffffffffff"), 0x7ffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, snan_value_pl ("0x7ffffffffffff"), 0x7ffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -snan_value_pl ("0x7ffffffffffff"), 0x7ffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if PAYLOAD_DIG >= 62
+ TEST_fp_f (getpayload, qnan_value_pl ("0x3fffffffffffffff"), 0x3fffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -qnan_value_pl ("0x3fffffffffffffff"), 0x3fffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, snan_value_pl ("0x3fffffffffffffff"), 0x3fffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -snan_value_pl ("0x3fffffffffffffff"), 0x3fffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if PAYLOAD_DIG >= 111
+ TEST_fp_f (getpayload, qnan_value_pl ("0x7fffffffffffffffffffffffffff"), 0x7fffffffffffffffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -qnan_value_pl ("0x7fffffffffffffffffffffffffff"), 0x7fffffffffffffffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, snan_value_pl ("0x7fffffffffffffffffffffffffff"), 0x7fffffffffffffffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_fp_f (getpayload, -snan_value_pl ("0x7fffffffffffffffffffffffffff"), 0x7fffffffffffffffffffffffffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+ };
+
+static void
+getpayload_test (void)
+{
+ ALL_RM_TEST (getpayload, 1, getpayload_test_data, RUN_TEST_LOOP_fp_f, END);
+}
+
+
static const struct test_ff_f_data hypot_test_data[] =
{
TEST_ff_f (hypot, plus_infty, 1, plus_infty, ERRNO_UNCHANGED),
@@ -8160,6 +8399,89 @@ ilogb_test (void)
ALL_RM_TEST (ilogb, 1, ilogb_test_data, RUN_TEST_LOOP_f_i, END);
}
+static const struct test_f_i_data iscanonical_test_data[] =
+ {
+ TEST_f_b (iscanonical, 0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, 10, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, -min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, min_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, -min_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, -max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iscanonical, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ };
+
+static void
+iscanonical_test (void)
+{
+ ALL_RM_TEST (iscanonical, 1, iscanonical_test_data, RUN_TEST_LOOP_f_b_tg, END);
+}
+
+static const struct test_ff_i_data iseqsig_test_data[] =
+ {
+ TEST_ff_i (iseqsig, minus_zero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, minus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, minus_zero, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, minus_zero, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, minus_zero, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, minus_zero, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, minus_zero, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, plus_zero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, plus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, plus_zero, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, plus_zero, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, plus_zero, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, plus_zero, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, plus_zero, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, (FLOAT) 1, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, (FLOAT) 1, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, (FLOAT) 1, (FLOAT) 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_i (iseqsig, (FLOAT) 1, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, (FLOAT) 1, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, (FLOAT) 1, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, (FLOAT) 1, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, qnan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -qnan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, qnan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -qnan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, qnan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -qnan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, snan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -snan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, snan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -snan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, snan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -snan_value, (FLOAT) 1, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, qnan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, qnan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -qnan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -qnan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, snan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, snan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -snan_value, qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -snan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, qnan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, qnan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -qnan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -qnan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, snan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, snan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -snan_value, snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_ff_i (iseqsig, -snan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION|ERRNO_EDOM),
+ };
+
+static void
+iseqsig_test (void)
+{
+ ALL_RM_TEST (iseqsig, 1, iseqsig_test_data, RUN_TEST_LOOP_ff_i_tg, END);
+}
static const struct test_f_i_data isfinite_test_data[] =
{
TEST_f_b (isfinite, 0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
@@ -8579,6 +8901,8 @@ static const struct test_f_i_data issignaling_test_data[] =
TEST_f_b (issignaling, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
TEST_f_b (issignaling, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
TEST_f_b (issignaling, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issignaling, snan_value_MACRO, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issignaling, -snan_value_MACRO, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
};
static void
@@ -8587,6 +8911,31 @@ issignaling_test (void)
ALL_RM_TEST (issignaling, 1, issignaling_test_data, RUN_TEST_LOOP_f_b_tg, END);
}
+static const struct test_f_i_data issubnormal_test_data[] =
+ {
+ TEST_f_b (issubnormal, 0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, 10, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, -min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, -min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, max_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, -max_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (issubnormal, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ };
+
+static void
+issubnormal_test (void)
+{
+ ALL_RM_TEST (issubnormal, 1, issubnormal_test_data, RUN_TEST_LOOP_f_b_tg, END);
+}
+
static const struct test_ff_i_data isunordered_test_data[] =
{
TEST_ff_i (isunordered, minus_zero, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
@@ -8646,6 +8995,31 @@ isunordered_test (void)
ALL_RM_TEST (isunordered, 1, isunordered_test_data, RUN_TEST_LOOP_ff_i_tg, END);
}
+static const struct test_f_i_data iszero_test_data[] =
+ {
+ TEST_f_b (iszero, 0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, 10, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, min_subnorm_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, -min_subnorm_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, -min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, max_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, -max_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_b (iszero, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ };
+
+static void
+iszero_test (void)
+{
+ ALL_RM_TEST (iszero, 1, iszero_test_data, RUN_TEST_LOOP_f_b_tg, END);
+}
+
static const struct test_f_f_data j0_test_data[] =
{
/* j0 is the Bessel function of the first kind of order 0 */
@@ -12105,6 +12479,502 @@ tgamma_test (void)
}
+static const struct test_ff_i_data totalorder_test_data[] =
+ {
+ TEST_ff_b (totalorder, minus_zero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_infty, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_infty, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, -qnan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, -min_subnorm_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, minus_zero, min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, -min_subnorm_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, plus_zero, min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -min_subnorm_value, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -min_subnorm_value, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, min_subnorm_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, min_subnorm_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, min_value, max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, min_value, -max_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -min_value, max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -min_value, -max_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, max_value, min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, max_value, -min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -max_value, min_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -max_value, -min_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x1"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x1"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x1"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x2"), qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x2"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x2"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x1"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x1"), -qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x1"), -qnan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x2"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x2"), -qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x2"), -qnan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x1"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x1"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x1"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x2"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x2"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x2"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x1"), -qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x1"), -qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x1"), -qnan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x2"), -qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x2"), -qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x2"), -qnan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x1"), snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x1"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x1"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x2"), snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x2"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x2"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x3fffff"), snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x3fffff"), snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x3fffff"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x1"), -snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x1"), -snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x1"), -snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x2"), -snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x2"), -snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x2"), -snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x3fffff"), -snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x3fffff"), -snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x3fffff"), -snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x1"), snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x1"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x1"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x2"), snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x2"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x2"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x3fffff"), snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x3fffff"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x3fffff"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x1"), -snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x1"), -snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x1"), -snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x2"), -snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x2"), -snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x2"), -snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x3fffff"), -snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x3fffff"), -snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x3fffff"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x3fffff"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x3fffff"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x1"), snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x1"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#if PAYLOAD_DIG >= 34
+ TEST_ff_b (totalorder, qnan_value_pl ("0xffffffff"), qnan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0xffffffff"), -qnan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x100000000"), qnan_value_pl ("0xffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x100000000"), -qnan_value_pl ("0xffffffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0xffffffff"), snan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0xffffffff"), -snan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x100000000"), snan_value_pl ("0xffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x100000000"), -snan_value_pl ("0xffffffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x100000000"), qnan_value_pl ("0x200000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x100000000"), -qnan_value_pl ("0x200000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x200000000"), qnan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x200000000"), -qnan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x100000000"), snan_value_pl ("0x200000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x100000000"), -snan_value_pl ("0x200000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x200000000"), snan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x200000000"), -snan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if PAYLOAD_DIG >= 66
+ TEST_ff_b (totalorder, qnan_value_pl ("0xffffffffffffffff"), qnan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0xffffffffffffffff"), -qnan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x10000000000000000"), qnan_value_pl ("0xffffffffffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x10000000000000000"), -qnan_value_pl ("0xffffffffffffffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0xffffffffffffffff"), snan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0xffffffffffffffff"), -snan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x10000000000000000"), snan_value_pl ("0xffffffffffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x10000000000000000"), -snan_value_pl ("0xffffffffffffffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x10000000000000000"), qnan_value_pl ("0x20000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x10000000000000000"), -qnan_value_pl ("0x20000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, qnan_value_pl ("0x20000000000000000"), qnan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -qnan_value_pl ("0x20000000000000000"), -qnan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x10000000000000000"), snan_value_pl ("0x20000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x10000000000000000"), -snan_value_pl ("0x20000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, snan_value_pl ("0x20000000000000000"), snan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, -snan_value_pl ("0x20000000000000000"), -snan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+ TEST_ff_b (totalorder, 1, 0x1.000002p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x1.000002p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, 0x0.ffffffp0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x0.ffffffp0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#if MANT_DIG >= 53
+ TEST_ff_b (totalorder, 1, 0x1.0000000000001p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x1.0000000000001p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, 0x0.fffffffffffff8p0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x0.fffffffffffff8p0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if MANT_DIG >= 64
+ TEST_ff_b (totalorder, 1, 0x1.0000000000000002p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x1.0000000000000002p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, 0x0.ffffffffffffffffp0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x0.ffffffffffffffffp0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if MANT_DIG >= 106
+ TEST_ff_b (totalorder, 1, 0x1.000000000000000000000000008p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x1.000000000000000000000000008p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, 0x0.ffffffffffffffffffffffffffcp0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x0.ffffffffffffffffffffffffffcp0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if MANT_DIG >= 113
+ TEST_ff_b (totalorder, 1, 0x1.0000000000000000000000000001p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x1.0000000000000000000000000001p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 1, 0x0.ffffffffffffffffffffffffffff8p0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalorder, 0x0.ffffffffffffffffffffffffffff8p0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+ };
+
+static void
+totalorder_test (void)
+{
+ ALL_RM_TEST (totalorder, 1, totalorder_test_data, RUN_TEST_LOOP_ff_b, END);
+}
+
+
+static const struct test_ff_i_data totalordermag_test_data[] =
+ {
+ TEST_ff_b (totalordermag, minus_zero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, minus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, plus_zero, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_infty, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, minus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, plus_infty, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_infty, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, minus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, plus_infty, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, -qnan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value, -snan_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value, -snan_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, -min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, minus_zero, min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, -min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, plus_zero, min_subnorm_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -min_subnorm_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -min_subnorm_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, min_subnorm_value, minus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, min_subnorm_value, plus_zero, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, min_value, max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, min_value, -max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -min_value, max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -min_value, -max_value, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, max_value, min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, max_value, -min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -max_value, min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -max_value, -min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x1"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x1"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x1"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x2"), qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x2"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x2"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x1"), -qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x1"), -qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x1"), -qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x2"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x2"), -qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x2"), -qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x1"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x1"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x1"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x2"), qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x2"), qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x2"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x3fffff"), qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x1"), -qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x1"), -qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x1"), -qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x2"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x2"), -qnan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x2"), -qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x3fffff"), -qnan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x1"), snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x1"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x1"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x2"), snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x2"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x2"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x3fffff"), snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x3fffff"), snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x3fffff"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x1"), -snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x1"), -snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x1"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x2"), -snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x2"), -snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x2"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x3fffff"), -snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x3fffff"), -snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x3fffff"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x1"), snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x1"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x1"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x2"), snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x2"), snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x2"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x3fffff"), snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x3fffff"), snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x3fffff"), snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x1"), -snan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x1"), -snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x1"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x2"), -snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x2"), -snan_value_pl ("0x2"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x2"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x3fffff"), -snan_value_pl ("0x1"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x3fffff"), -snan_value_pl ("0x2"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x3fffff"), -snan_value_pl ("0x3fffff"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x3fffff"), qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x3fffff"), -qnan_value_pl ("0x1"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x1"), snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x1"), -snan_value_pl ("0x3fffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#if PAYLOAD_DIG >= 34
+ TEST_ff_b (totalordermag, qnan_value_pl ("0xffffffff"), qnan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0xffffffff"), -qnan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x100000000"), qnan_value_pl ("0xffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x100000000"), -qnan_value_pl ("0xffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0xffffffff"), snan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0xffffffff"), -snan_value_pl ("0x100000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x100000000"), snan_value_pl ("0xffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x100000000"), -snan_value_pl ("0xffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x100000000"), qnan_value_pl ("0x200000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x100000000"), -qnan_value_pl ("0x200000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x200000000"), qnan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x200000000"), -qnan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x100000000"), snan_value_pl ("0x200000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x100000000"), -snan_value_pl ("0x200000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x200000000"), snan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x200000000"), -snan_value_pl ("0x100000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if PAYLOAD_DIG >= 66
+ TEST_ff_b (totalordermag, qnan_value_pl ("0xffffffffffffffff"), qnan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0xffffffffffffffff"), -qnan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x10000000000000000"), qnan_value_pl ("0xffffffffffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x10000000000000000"), -qnan_value_pl ("0xffffffffffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0xffffffffffffffff"), snan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0xffffffffffffffff"), -snan_value_pl ("0x10000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x10000000000000000"), snan_value_pl ("0xffffffffffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x10000000000000000"), -snan_value_pl ("0xffffffffffffffff"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x10000000000000000"), qnan_value_pl ("0x20000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x10000000000000000"), -qnan_value_pl ("0x20000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, qnan_value_pl ("0x20000000000000000"), qnan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -qnan_value_pl ("0x20000000000000000"), -qnan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x10000000000000000"), snan_value_pl ("0x20000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x10000000000000000"), -snan_value_pl ("0x20000000000000000"), 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, snan_value_pl ("0x20000000000000000"), snan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, -snan_value_pl ("0x20000000000000000"), -snan_value_pl ("0x10000000000000000"), 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+ TEST_ff_b (totalordermag, 1, 0x1.000002p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x1.000002p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, 0x0.ffffffp0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x0.ffffffp0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#if MANT_DIG >= 53
+ TEST_ff_b (totalordermag, 1, 0x1.0000000000001p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x1.0000000000001p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, 0x0.fffffffffffff8p0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x0.fffffffffffff8p0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if MANT_DIG >= 64
+ TEST_ff_b (totalordermag, 1, 0x1.0000000000000002p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x1.0000000000000002p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, 0x0.ffffffffffffffffp0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x0.ffffffffffffffffp0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if MANT_DIG >= 106
+ TEST_ff_b (totalordermag, 1, 0x1.000000000000000000000000008p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x1.000000000000000000000000008p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, 0x0.ffffffffffffffffffffffffffcp0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x0.ffffffffffffffffffffffffffcp0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+#if MANT_DIG >= 113
+ TEST_ff_b (totalordermag, 1, 0x1.0000000000000000000000000001p0, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x1.0000000000000000000000000001p0, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 1, 0x0.ffffffffffffffffffffffffffff8p0, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_ff_b (totalordermag, 0x0.ffffffffffffffffffffffffffff8p0, 1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+#endif
+ };
+
+static void
+totalordermag_test (void)
+{
+ ALL_RM_TEST (totalordermag, 1, totalordermag_test_data, RUN_TEST_LOOP_ff_b, END);
+}
+
+
static const struct test_f_f_data trunc_test_data[] =
{
TEST_f_f (trunc, plus_infty, plus_infty, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
@@ -12663,11 +13533,14 @@ main (int argc, char **argv)
/* Classification macros: */
finite_test ();
fpclassify_test ();
+ iscanonical_test ();
isfinite_test ();
isinf_test ();
isnan_test ();
isnormal_test ();
issignaling_test ();
+ issubnormal_test ();
+ iszero_test ();
signbit_test ();
/* Trigonometric functions: */
@@ -12756,6 +13629,7 @@ main (int argc, char **argv)
fma_test ();
/* Comparison macros: */
+ iseqsig_test ();
isgreater_test ();
isgreaterequal_test ();
isless_test ();
@@ -12763,6 +13637,16 @@ main (int argc, char **argv)
islessgreater_test ();
isunordered_test ();
+ /* Total order functions: */
+ totalorder_test ();
+ totalordermag_test ();
+
+ /* Canonicalize functions: */
+ canonicalize_test ();
+
+ /* NaN functions: */
+ getpayload_test ();
+
/* Complex functions: */
cabs_test ();
cacos_test ();
diff --git a/math/math.h b/math/math.h
index 2f77deec87..70d9b864e8 100644
--- a/math/math.h
+++ b/math/math.h
@@ -45,6 +45,15 @@ __BEGIN_DECLS
# include <bits/nan.h>
#endif /* __USE_ISOC99 */
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Signaling NaN macros, if supported. */
+# if __GNUC_PREREQ (3, 3)
+# define SNANF (__builtin_nansf (""))
+# define SNAN (__builtin_nans (""))
+# define SNANL (__builtin_nansl (""))
+# endif
+#endif
+
/* Get the architecture specific values describing the floating-point
evaluation. The following symbols will get defined:
@@ -317,6 +326,8 @@ enum
#endif /* Use ISO C99. */
#if __GLIBC_USE (IEC_60559_BFP_EXT)
+# include <bits/iscanonical.h>
+
/* Return nonzero value if X is a signaling NaN. */
# ifdef __NO_LONG_DOUBLE_MATH
# define issignaling(x) \
@@ -328,6 +339,30 @@ enum
: sizeof (x) == sizeof (double) \
? __issignaling (x) : __issignalingl (x))
# endif
+
+/* Return nonzero value if X is subnormal. */
+# define issubnormal(x) (fpclassify (x) == FP_SUBNORMAL)
+
+/* Return nonzero value if X is zero. */
+# ifndef __cplusplus
+# ifdef __SUPPORT_SNAN__
+# define iszero(x) (fpclassify (x) == FP_ZERO)
+# else
+# define iszero(x) (((__typeof (x)) (x)) == 0)
+# endif
+# else /* __cplusplus */
+extern "C++" {
+template <class __T> inline bool
+iszero (__T __val)
+{
+# ifdef __SUPPORT_SNAN__
+ return fpclassify (__val) == FP_ZERO;
+# else
+ return __val == 0;
+# endif
+}
+} /* extern C++ */
+# endif /* __cplusplus */
#endif /* Use IEC_60559_BFP_EXT. */
#ifdef __USE_MISC
@@ -519,6 +554,39 @@ extern int matherr (struct exception *__exc);
#endif
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Return X == Y but raising "invalid" and setting errno if X or Y is
+ a NaN. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# if (__FLT_EVAL_METHOD__ == 1 \
+ || __FLT_EVAL_METHOD__ == 2 \
+ || __FLT_EVAL_METHOD__ > 32)
+# define iseqsig(x, y) __iseqsig ((x), (y))
+# else
+# define iseqsig(x, y) \
+ (sizeof ((x) + (y)) == sizeof (float) \
+ ? __iseqsigf ((x), (y)) \
+ : __iseqsig ((x), (y)))
+# endif
+# else
+# if __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ > 64
+# define iseqsig(x, y) __iseqsigl ((x), (y))
+# elif __FLT_EVAL_METHOD__ == 1 || __FLT_EVAL_METHOD__ > 32
+# define iseqsig(x, y) \
+ (sizeof ((x) + (y)) <= sizeof (double) \
+ ? __iseqsig ((x), (y)) \
+ : __iseqsigl ((x), (y)))
+# else
+# define iseqsig(x, y) \
+ (sizeof ((x) + (y)) == sizeof (float) \
+ ? __iseqsigf ((x), (y)) \
+ : sizeof ((x) + (y)) == sizeof (double) \
+ ? __iseqsig ((x), (y)) \
+ : __iseqsigl ((x), (y)))
+# endif
+# endif
+#endif
+
__END_DECLS
diff --git a/math/mul_split.h b/math/mul_split.h
new file mode 100644
index 0000000000..85038dceae
--- /dev/null
+++ b/math/mul_split.h
@@ -0,0 +1,50 @@
+/* Compute full X * Y for double type.
+ Copyright (C) 2013-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MUL_SPLIT_H
+#define _MUL_SPLIT_H
+
+#include <float.h>
+
+/* Calculate X * Y exactly and store the result in *HI + *LO. It is
+ given that the values are small enough that no overflow occurs and
+ large enough (or zero) that no underflow occurs. */
+
+static void
+mul_split (double *hi, double *lo, double x, double y)
+{
+#ifdef __FP_FAST_FMA
+ /* Fast built-in fused multiply-add. */
+ *hi = x * y;
+ *lo = __builtin_fma (x, y, -*hi);
+#else
+ /* Apply Dekker's algorithm. */
+ *hi = x * y;
+# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
+ double x1 = x * C;
+ double y1 = y * C;
+# undef C
+ x1 = (x - x1) + x1;
+ y1 = (y - y1) + y1;
+ double x2 = x - x1;
+ double y2 = y - y1;
+ *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
+#endif
+}
+
+#endif /* _MUL_SPLIT_H */
diff --git a/math/mul_splitl.h b/math/mul_splitl.h
new file mode 100644
index 0000000000..8a39ce0553
--- /dev/null
+++ b/math/mul_splitl.h
@@ -0,0 +1,50 @@
+/* Compute full X * Y for long double type.
+ Copyright (C) 2013-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MUL_SPLITL_H
+#define _MUL_SPLITL_H
+
+#include <float.h>
+
+/* Calculate X * Y exactly and store the result in *HI + *LO. It is
+ given that the values are small enough that no overflow occurs and
+ large enough (or zero) that no underflow occurs. */
+
+static inline void
+mul_splitl (long double *hi, long double *lo, long double x, long double y)
+{
+#ifdef __FP_FAST_FMAL
+ /* Fast built-in fused multiply-add. */
+ *hi = x * y;
+ *lo = __builtin_fmal (x, y, -*hi);
+#else
+ /* Apply Dekker's algorithm. */
+ *hi = x * y;
+# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
+ long double x1 = x * C;
+ long double y1 = y * C;
+# undef C
+ x1 = (x - x1) + x1;
+ y1 = (y - y1) + y1;
+ long double x2 = x - x1;
+ long double y2 = y - y1;
+ *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
+#endif
+}
+
+#endif /* _MUL_SPLITL_H */
diff --git a/math/s_cacos.c b/math/s_cacos.c
deleted file mode 100644
index 234b12271b..0000000000
--- a/math/s_cacos.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Return cosine of complex double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-__complex__ double
-__cacos (__complex__ double x)
-{
- __complex__ double y;
- __complex__ double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE
- || (rcls == FP_ZERO && icls == FP_ZERO))
- {
- y = __casin (x);
-
- __real__ res = (double) M_PI_2 - __real__ y;
- if (__real__ res == 0.0)
- __real__ res = 0.0;
- __imag__ res = -__imag__ y;
- }
- else
- {
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- y = __kernel_casinh (y, 1);
-
- __real__ res = __imag__ y;
- __imag__ res = __real__ y;
- }
-
- return res;
-}
-weak_alias (__cacos, cacos)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cacos, __cacosl)
-weak_alias (__cacos, cacosl)
-#endif
diff --git a/math/s_cacosf.c b/math/s_cacos_template.c
index ab5239281d..6494a1f2f6 100644
--- a/math/s_cacosf.c
+++ b/math/s_cacos_template.c
@@ -1,4 +1,4 @@
-/* Return cosine of complex float value.
+/* Return cosine of a complex type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,22 +20,22 @@
#include <complex.h>
#include <math.h>
-__complex__ float
-__cacosf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__cacos) (CFLOAT x)
{
- __complex__ float y;
- __complex__ float res;
+ CFLOAT y;
+ CFLOAT res;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
if (rcls <= FP_INFINITE || icls <= FP_INFINITE
|| (rcls == FP_ZERO && icls == FP_ZERO))
{
- y = __casinf (x);
+ y = M_SUF (__casin) (x);
- __real__ res = (float) M_PI_2 - __real__ y;
- if (__real__ res == 0.0f)
- __real__ res = 0.0f;
+ __real__ res = (FLOAT) M_MLIT (M_PI_2) - __real__ y;
+ if (__real__ res == 0)
+ __real__ res = 0;
__imag__ res = -__imag__ y;
}
else
@@ -43,7 +43,7 @@ __cacosf (__complex__ float x)
__real__ y = -__imag__ x;
__imag__ y = __real__ x;
- y = __kernel_casinhf (y, 1);
+ y = M_SUF (__kernel_casinh) (y, 1);
__real__ res = __imag__ y;
__imag__ res = __real__ y;
@@ -51,6 +51,9 @@ __cacosf (__complex__ float x)
return res;
}
-#ifndef __cacosf
-weak_alias (__cacosf, cacosf)
+
+declare_mgen_alias (__cacos, cacos);
+
+#if M_LIBM_NEED_COMPAT (carg)
+declare_mgen_libm_compat (__cacos, cacos)
#endif
diff --git a/math/s_cacosh.c b/math/s_cacosh_template.c
index 20bf2158b8..e44da39a10 100644
--- a/math/s_cacosh.c
+++ b/math/s_cacosh_template.c
@@ -1,4 +1,4 @@
-/* Return arc hyperbole cosine for double value.
+/* Return arc hyperbolic cosine for a complex type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,10 +22,10 @@
#include <math_private.h>
-__complex__ double
-__cacosh (__complex__ double x)
+CFLOAT
+M_DECL_FUNC (__cacosh) (CFLOAT x)
{
- __complex__ double res;
+ CFLOAT res;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
@@ -33,45 +33,46 @@ __cacosh (__complex__ double x)
{
if (icls == FP_INFINITE)
{
- __real__ res = HUGE_VAL;
+ __real__ res = M_HUGE_VAL;
if (rcls == FP_NAN)
- __imag__ res = __nan ("");
+ __imag__ res = M_NAN;
else
- __imag__ res = __copysign ((rcls == FP_INFINITE
- ? (__real__ x < 0.0
- ? M_PI - M_PI_4 : M_PI_4)
- : M_PI_2), __imag__ x);
+ __imag__ res = M_COPYSIGN ((rcls == FP_INFINITE
+ ? (__real__ x < 0
+ ? M_MLIT (M_PI) - M_MLIT (M_PI_4)
+ : M_MLIT (M_PI_4))
+ : M_MLIT (M_PI_2)), __imag__ x);
}
else if (rcls == FP_INFINITE)
{
- __real__ res = HUGE_VAL;
+ __real__ res = M_HUGE_VAL;
if (icls >= FP_ZERO)
- __imag__ res = __copysign (signbit (__real__ x) ? M_PI : 0.0,
- __imag__ x);
+ __imag__ res = M_COPYSIGN (signbit (__real__ x)
+ ? M_MLIT (M_PI) : 0, __imag__ x);
else
- __imag__ res = __nan ("");
+ __imag__ res = M_NAN;
}
else
{
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
}
}
else if (rcls == FP_ZERO && icls == FP_ZERO)
{
- __real__ res = 0.0;
- __imag__ res = __copysign (M_PI_2, __imag__ x);
+ __real__ res = 0;
+ __imag__ res = M_COPYSIGN (M_MLIT (M_PI_2), __imag__ x);
}
else
{
- __complex__ double y;
+ CFLOAT y;
__real__ y = -__imag__ x;
__imag__ y = __real__ x;
- y = __kernel_casinh (y, 1);
+ y = M_SUF (__kernel_casinh) (y, 1);
if (signbit (__imag__ x))
{
@@ -87,8 +88,9 @@ __cacosh (__complex__ double x)
return res;
}
-weak_alias (__cacosh, cacosh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cacosh, __cacoshl)
-weak_alias (__cacosh, cacoshl)
+
+declare_mgen_alias (__cacosh, cacosh)
+
+#if M_LIBM_NEED_COMPAT (cacosh)
+declare_mgen_libm_compat (__cacosh, cacosh)
#endif
diff --git a/math/s_cacoshf.c b/math/s_cacoshf.c
deleted file mode 100644
index f1a1369705..0000000000
--- a/math/s_cacoshf.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Return arc hyperbole cosine for float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-#include <math_private.h>
-
-__complex__ float
-__cacoshf (__complex__ float x)
-{
- __complex__ float res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = HUGE_VALF;
-
- if (rcls == FP_NAN)
- __imag__ res = __nanf ("");
- else
- __imag__ res = __copysignf ((rcls == FP_INFINITE
- ? (__real__ x < 0.0
- ? M_PI - M_PI_4 : M_PI_4)
- : M_PI_2), __imag__ x);
- }
- else if (rcls == FP_INFINITE)
- {
- __real__ res = HUGE_VALF;
-
- if (icls >= FP_ZERO)
- __imag__ res = __copysignf (signbit (__real__ x) ? M_PI : 0.0,
- __imag__ x);
- else
- __imag__ res = __nanf ("");
- }
- else
- {
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
- }
- }
- else if (rcls == FP_ZERO && icls == FP_ZERO)
- {
- __real__ res = 0.0;
- __imag__ res = __copysignf (M_PI_2, __imag__ x);
- }
- else
- {
- __complex__ float y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- y = __kernel_casinhf (y, 1);
-
- if (signbit (__imag__ x))
- {
- __real__ res = __real__ y;
- __imag__ res = -__imag__ y;
- }
- else
- {
- __real__ res = -__real__ y;
- __imag__ res = __imag__ y;
- }
- }
-
- return res;
-}
-#ifndef __cacoshf
-weak_alias (__cacoshf, cacoshf)
-#endif
diff --git a/math/s_cacoshl.c b/math/s_cacoshl.c
deleted file mode 100644
index c512c2ad71..0000000000
--- a/math/s_cacoshl.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Return arc hyperbole cosine for long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-
-
-__complex__ long double
-__cacoshl (__complex__ long double x)
-{
- __complex__ long double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = HUGE_VALL;
-
- if (rcls == FP_NAN)
- __imag__ res = __nanl ("");
- else
- __imag__ res = __copysignl ((rcls == FP_INFINITE
- ? (__real__ x < 0.0
- ? M_PIl - M_PI_4l : M_PI_4l)
- : M_PI_2l), __imag__ x);
- }
- else if (rcls == FP_INFINITE)
- {
- __real__ res = HUGE_VALL;
-
- if (icls >= FP_ZERO)
- __imag__ res = __copysignl (signbit (__real__ x) ? M_PIl : 0.0,
- __imag__ x);
- else
- __imag__ res = __nanl ("");
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
- }
- }
- else if (rcls == FP_ZERO && icls == FP_ZERO)
- {
- __real__ res = 0.0;
- __imag__ res = __copysignl (M_PI_2l, __imag__ x);
- }
- else
- {
- __complex__ long double y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- y = __kernel_casinhl (y, 1);
-
- if (signbit (__imag__ x))
- {
- __real__ res = __real__ y;
- __imag__ res = -__imag__ y;
- }
- else
- {
- __real__ res = -__real__ y;
- __imag__ res = __imag__ y;
- }
- }
-
- return res;
-}
-weak_alias (__cacoshl, cacoshl)
diff --git a/math/s_cacosl.c b/math/s_cacosl.c
deleted file mode 100644
index 33858873e0..0000000000
--- a/math/s_cacosl.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Return cosine of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-__complex__ long double
-__cacosl (__complex__ long double x)
-{
- __complex__ long double y;
- __complex__ long double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE
- || (rcls == FP_ZERO && icls == FP_ZERO))
- {
- y = __casinl (x);
-
- __real__ res = M_PI_2l - __real__ y;
- if (__real__ res == 0.0L)
- __real__ res = 0.0L;
- __imag__ res = -__imag__ y;
- }
- else
- {
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- y = __kernel_casinhl (y, 1);
-
- __real__ res = __imag__ y;
- __imag__ res = __real__ y;
- }
-
- return res;
-}
-weak_alias (__cacosl, cacosl)
diff --git a/math/s_canonicalize_template.c b/math/s_canonicalize_template.c
new file mode 100644
index 0000000000..fa06f5c083
--- /dev/null
+++ b/math/s_canonicalize_template.c
@@ -0,0 +1,37 @@
+/* Canonicalize floating-point representation.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+int
+M_DECL_FUNC (__canonicalize) (FLOAT *cx, const FLOAT *x)
+{
+ FLOAT val = *x;
+ /* For all binary formats supported by glibc, iscanonical only fails
+ if the representation is not a valid representation of the type,
+ so the only work to do is for signaling NaNs. */
+ if (!iscanonical (val))
+ return 1;
+ if (issignaling (val))
+ *cx = val + val;
+ else
+ *cx = val;
+ return 0;
+}
+
+declare_mgen_alias (__canonicalize, canonicalize)
diff --git a/math/s_casin.c b/math/s_casin.c
deleted file mode 100644
index a37933b597..0000000000
--- a/math/s_casin.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Return arc sine of complex double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-
-
-__complex__ double
-__casin (__complex__ double x)
-{
- __complex__ double res;
-
- if (isnan (__real__ x) || isnan (__imag__ x))
- {
- if (__real__ x == 0.0)
- {
- res = x;
- }
- else if (isinf (__real__ x) || isinf (__imag__ x))
- {
- __real__ res = __nan ("");
- __imag__ res = __copysign (HUGE_VAL, __imag__ x);
- }
- else
- {
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
- }
- }
- else
- {
- __complex__ double y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- y = __casinh (y);
-
- __real__ res = __imag__ y;
- __imag__ res = -__real__ y;
- }
-
- return res;
-}
-weak_alias (__casin, casin)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__casin, __casinl)
-weak_alias (__casin, casinl)
-#endif
diff --git a/math/s_casinf.c b/math/s_casin_template.c
index ccb5766678..5b1e979a16 100644
--- a/math/s_casinf.c
+++ b/math/s_casin_template.c
@@ -1,4 +1,4 @@
-/* Return arc sine of complex float value.
+/* Return arc sine of a complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,36 +22,36 @@
#include <math_private.h>
-__complex__ float
-__casinf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__casin) (CFLOAT x)
{
- __complex__ float res;
+ CFLOAT res;
if (isnan (__real__ x) || isnan (__imag__ x))
{
- if (__real__ x == 0.0)
+ if (__real__ x == 0)
{
res = x;
}
else if (isinf (__real__ x) || isinf (__imag__ x))
{
- __real__ res = __nanf ("");
- __imag__ res = __copysignf (HUGE_VALF, __imag__ x);
+ __real__ res = M_NAN;
+ __imag__ res = M_COPYSIGN (M_HUGE_VAL, __imag__ x);
}
else
{
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
}
}
else
{
- __complex__ float y;
+ CFLOAT y;
__real__ y = -__imag__ x;
__imag__ y = __real__ x;
- y = __casinhf (y);
+ y = M_SUF (__casinh) (y);
__real__ res = __imag__ y;
__imag__ res = -__real__ y;
@@ -59,6 +59,9 @@ __casinf (__complex__ float x)
return res;
}
-#ifndef __casinf
-weak_alias (__casinf, casinf)
+
+declare_mgen_alias (__casin, casin)
+
+#if M_LIBM_NEED_COMPAT (casin)
+declare_mgen_libm_compat (__casin, casin)
#endif
diff --git a/math/s_casinh.c b/math/s_casinh_template.c
index 32cbc13991..fd29e63276 100644
--- a/math/s_casinh.c
+++ b/math/s_casinh_template.c
@@ -1,4 +1,4 @@
-/* Return arc hyperbole sine for double value.
+/* Return arc hyperbolic sine for a complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,10 +21,10 @@
#include <math.h>
#include <math_private.h>
-__complex__ double
-__casinh (__complex__ double x)
+CFLOAT
+M_DECL_FUNC (__casinh) (CFLOAT x)
{
- __complex__ double res;
+ CFLOAT res;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
@@ -32,12 +32,13 @@ __casinh (__complex__ double x)
{
if (icls == FP_INFINITE)
{
- __real__ res = __copysign (HUGE_VAL, __real__ x);
+ __real__ res = M_COPYSIGN (M_HUGE_VAL, __real__ x);
if (rcls == FP_NAN)
- __imag__ res = __nan ("");
+ __imag__ res = M_NAN;
else
- __imag__ res = __copysign (rcls >= FP_ZERO ? M_PI_2 : M_PI_4,
+ __imag__ res = M_COPYSIGN ((rcls >= FP_ZERO
+ ? M_MLIT (M_PI_2) : M_MLIT (M_PI_4)),
__imag__ x);
}
else if (rcls <= FP_INFINITE)
@@ -45,14 +46,14 @@ __casinh (__complex__ double x)
__real__ res = __real__ x;
if ((rcls == FP_INFINITE && icls >= FP_ZERO)
|| (rcls == FP_NAN && icls == FP_ZERO))
- __imag__ res = __copysign (0.0, __imag__ x);
+ __imag__ res = M_COPYSIGN (0, __imag__ x);
else
- __imag__ res = __nan ("");
+ __imag__ res = M_NAN;
}
else
{
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
}
}
else if (rcls == FP_ZERO && icls == FP_ZERO)
@@ -61,13 +62,14 @@ __casinh (__complex__ double x)
}
else
{
- res = __kernel_casinh (x, 0);
+ res = M_SUF (__kernel_casinh) (x, 0);
}
return res;
}
-weak_alias (__casinh, casinh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__casinh, __casinhl)
-weak_alias (__casinh, casinhl)
+
+declare_mgen_alias (__casinh, casinh)
+
+#if M_LIBM_NEED_COMPAT (casinh)
+declare_mgen_libm_compat (__casinh, casinh)
#endif
diff --git a/math/s_casinhf.c b/math/s_casinhf.c
deleted file mode 100644
index 8d08b4bfcf..0000000000
--- a/math/s_casinhf.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Return arc hyperbole sine for float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-
-__complex__ float
-__casinhf (__complex__ float x)
-{
- __complex__ float res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = __copysignf (HUGE_VALF, __real__ x);
-
- if (rcls == FP_NAN)
- __imag__ res = __nanf ("");
- else
- __imag__ res = __copysignf (rcls >= FP_ZERO ? M_PI_2 : M_PI_4,
- __imag__ x);
- }
- else if (rcls <= FP_INFINITE)
- {
- __real__ res = __real__ x;
- if ((rcls == FP_INFINITE && icls >= FP_ZERO)
- || (rcls == FP_NAN && icls == FP_ZERO))
- __imag__ res = __copysignf (0.0, __imag__ x);
- else
- __imag__ res = __nanf ("");
- }
- else
- {
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
- }
- }
- else if (rcls == FP_ZERO && icls == FP_ZERO)
- {
- res = x;
- }
- else
- {
- res = __kernel_casinhf (x, 0);
- }
-
- return res;
-}
-#ifndef __casinhf
-weak_alias (__casinhf, casinhf)
-#endif
diff --git a/math/s_casinhl.c b/math/s_casinhl.c
deleted file mode 100644
index 81d888ef6b..0000000000
--- a/math/s_casinhl.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Return arc hyperbole sine for long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-
-__complex__ long double
-__casinhl (__complex__ long double x)
-{
- __complex__ long double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = __copysignl (HUGE_VALL, __real__ x);
-
- if (rcls == FP_NAN)
- __imag__ res = __nanl ("");
- else
- __imag__ res = __copysignl (rcls >= FP_ZERO ? M_PI_2l : M_PI_4l,
- __imag__ x);
- }
- else if (rcls <= FP_INFINITE)
- {
- __real__ res = __real__ x;
- if ((rcls == FP_INFINITE && icls >= FP_ZERO)
- || (rcls == FP_NAN && icls == FP_ZERO))
- __imag__ res = __copysignl (0.0, __imag__ x);
- else
- __imag__ res = __nanl ("");
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
- }
- }
- else if (rcls == FP_ZERO && icls == FP_ZERO)
- {
- res = x;
- }
- else
- {
- res = __kernel_casinhl (x, 0);
- }
-
- return res;
-}
-weak_alias (__casinhl, casinhl)
diff --git a/math/s_casinl.c b/math/s_casinl.c
deleted file mode 100644
index 95f25bb355..0000000000
--- a/math/s_casinl.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Return arc sine of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-
-
-__complex__ long double
-__casinl (__complex__ long double x)
-{
- __complex__ long double res;
-
- if (isnan (__real__ x) || isnan (__imag__ x))
- {
- if (__real__ x == 0.0)
- {
- res = x;
- }
- else if (isinf (__real__ x) || isinf (__imag__ x))
- {
- __real__ res = __nanl ("");
- __imag__ res = __copysignl (HUGE_VALL, __imag__ x);
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
- }
- }
- else
- {
- __complex__ long double y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- y = __casinhl (y);
-
- __real__ res = __imag__ y;
- __imag__ res = -__real__ y;
- }
-
- return res;
-}
-weak_alias (__casinl, casinl)
diff --git a/math/s_catan.c b/math/s_catan.c
deleted file mode 100644
index 5ab4c0d635..0000000000
--- a/math/s_catan.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Return arc tangent of complex double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__catan (__complex__ double x)
-{
- __complex__ double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (rcls == FP_INFINITE)
- {
- __real__ res = __copysign (M_PI_2, __real__ x);
- __imag__ res = __copysign (0.0, __imag__ x);
- }
- else if (icls == FP_INFINITE)
- {
- if (rcls >= FP_ZERO)
- __real__ res = __copysign (M_PI_2, __real__ x);
- else
- __real__ res = __nan ("");
- __imag__ res = __copysign (0.0, __imag__ x);
- }
- else if (icls == FP_ZERO || icls == FP_INFINITE)
- {
- __real__ res = __nan ("");
- __imag__ res = __copysign (0.0, __imag__ x);
- }
- else
- {
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- res = x;
- }
- else
- {
- if (fabs (__real__ x) >= 16.0 / DBL_EPSILON
- || fabs (__imag__ x) >= 16.0 / DBL_EPSILON)
- {
- __real__ res = __copysign (M_PI_2, __real__ x);
- if (fabs (__real__ x) <= 1.0)
- __imag__ res = 1.0 / __imag__ x;
- else if (fabs (__imag__ x) <= 1.0)
- __imag__ res = __imag__ x / __real__ x / __real__ x;
- else
- {
- double h = __ieee754_hypot (__real__ x / 2.0, __imag__ x / 2.0);
- __imag__ res = __imag__ x / h / h / 4.0;
- }
- }
- else
- {
- double den, absx, absy;
-
- absx = fabs (__real__ x);
- absy = fabs (__imag__ x);
- if (absx < absy)
- {
- double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absy < DBL_EPSILON / 2.0)
- {
- den = (1.0 - absx) * (1.0 + absx);
- if (den == -0.0)
- den = 0.0;
- }
- else if (absx >= 1.0)
- den = (1.0 - absx) * (1.0 + absx) - absy * absy;
- else if (absx >= 0.75 || absy >= 0.5)
- den = -__x2y2m1 (absx, absy);
- else
- den = (1.0 - absx) * (1.0 + absx) - absy * absy;
-
- __real__ res = 0.5 * __ieee754_atan2 (2.0 * __real__ x, den);
-
- if (fabs (__imag__ x) == 1.0
- && fabs (__real__ x) < DBL_EPSILON * DBL_EPSILON)
- __imag__ res = (__copysign (0.5, __imag__ x)
- * (M_LN2 - __ieee754_log (fabs (__real__ x))));
- else
- {
- double r2 = 0.0, num, f;
-
- if (fabs (__real__ x) >= DBL_EPSILON * DBL_EPSILON)
- r2 = __real__ x * __real__ x;
-
- num = __imag__ x + 1.0;
- num = r2 + num * num;
-
- den = __imag__ x - 1.0;
- den = r2 + den * den;
-
- f = num / den;
- if (f < 0.5)
- __imag__ res = 0.25 * __ieee754_log (f);
- else
- {
- num = 4.0 * __imag__ x;
- __imag__ res = 0.25 * __log1p (num / den);
- }
- }
- }
-
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__catan, catan)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__catan, __catanl)
-weak_alias (__catan, catanl)
-#endif
diff --git a/math/s_catan_template.c b/math/s_catan_template.c
new file mode 100644
index 0000000000..d8db96d46b
--- /dev/null
+++ b/math/s_catan_template.c
@@ -0,0 +1,145 @@
+/* Return arc tangent of complex float type.
+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <complex.h>
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+CFLOAT
+M_DECL_FUNC (__catan) (CFLOAT x)
+{
+ CFLOAT res;
+ int rcls = fpclassify (__real__ x);
+ int icls = fpclassify (__imag__ x);
+
+ if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
+ {
+ if (rcls == FP_INFINITE)
+ {
+ __real__ res = M_COPYSIGN (M_MLIT (M_PI_2), __real__ x);
+ __imag__ res = M_COPYSIGN (0, __imag__ x);
+ }
+ else if (icls == FP_INFINITE)
+ {
+ if (rcls >= FP_ZERO)
+ __real__ res = M_COPYSIGN (M_MLIT (M_PI_2), __real__ x);
+ else
+ __real__ res = M_NAN;
+ __imag__ res = M_COPYSIGN (0, __imag__ x);
+ }
+ else if (icls == FP_ZERO || icls == FP_INFINITE)
+ {
+ __real__ res = M_NAN;
+ __imag__ res = M_COPYSIGN (0, __imag__ x);
+ }
+ else
+ {
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
+ }
+ }
+ else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
+ {
+ res = x;
+ }
+ else
+ {
+ if (M_FABS (__real__ x) >= 16 / M_EPSILON
+ || M_FABS (__imag__ x) >= 16 / M_EPSILON)
+ {
+ __real__ res = M_COPYSIGN (M_MLIT (M_PI_2), __real__ x);
+ if (M_FABS (__real__ x) <= 1)
+ __imag__ res = 1 / __imag__ x;
+ else if (M_FABS (__imag__ x) <= 1)
+ __imag__ res = __imag__ x / __real__ x / __real__ x;
+ else
+ {
+ FLOAT h = M_HYPOT (__real__ x / 2, __imag__ x / 2);
+ __imag__ res = __imag__ x / h / h / 4;
+ }
+ }
+ else
+ {
+ FLOAT den, absx, absy;
+
+ absx = M_FABS (__real__ x);
+ absy = M_FABS (__imag__ x);
+ if (absx < absy)
+ {
+ FLOAT t = absx;
+ absx = absy;
+ absy = t;
+ }
+
+ if (absy < M_EPSILON / 2)
+ {
+ den = (1 - absx) * (1 + absx);
+ if (den == 0)
+ den = 0;
+ }
+ else if (absx >= 1)
+ den = (1 - absx) * (1 + absx) - absy * absy;
+ else if (absx >= M_LIT (0.75) || absy >= M_LIT (0.5))
+ den = -M_SUF (__x2y2m1) (absx, absy);
+ else
+ den = (1 - absx) * (1 + absx) - absy * absy;
+
+ __real__ res = M_LIT (0.5) * M_ATAN2 (2 * __real__ x, den);
+
+ if (M_FABS (__imag__ x) == 1
+ && M_FABS (__real__ x) < M_EPSILON * M_EPSILON)
+ __imag__ res = (M_COPYSIGN (M_LIT (0.5), __imag__ x)
+ * ((FLOAT) M_MLIT (M_LN2)
+ - M_LOG (M_FABS (__real__ x))));
+ else
+ {
+ FLOAT r2 = 0, num, f;
+
+ if (M_FABS (__real__ x) >= M_EPSILON * M_EPSILON)
+ r2 = __real__ x * __real__ x;
+
+ num = __imag__ x + 1;
+ num = r2 + num * num;
+
+ den = __imag__ x - 1;
+ den = r2 + den * den;
+
+ f = num / den;
+ if (f < M_LIT (0.5))
+ __imag__ res = M_LIT (0.25) * M_LOG (f);
+ else
+ {
+ num = 4 * __imag__ x;
+ __imag__ res = M_LIT (0.25) * M_LOG1P (num / den);
+ }
+ }
+ }
+
+ math_check_force_underflow_complex (res);
+ }
+
+ return res;
+}
+
+declare_mgen_alias (__catan, catan)
+
+#if M_LIBM_NEED_COMPAT (catan)
+declare_mgen_libm_compat (__catan, catan)
+#endif
diff --git a/math/s_catanf.c b/math/s_catanf.c
deleted file mode 100644
index 63e6b6e703..0000000000
--- a/math/s_catanf.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Return arc tangent of complex float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ float
-__catanf (__complex__ float x)
-{
- __complex__ float res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (rcls == FP_INFINITE)
- {
- __real__ res = __copysignf (M_PI_2, __real__ x);
- __imag__ res = __copysignf (0.0, __imag__ x);
- }
- else if (icls == FP_INFINITE)
- {
- if (rcls >= FP_ZERO)
- __real__ res = __copysignf (M_PI_2, __real__ x);
- else
- __real__ res = __nanf ("");
- __imag__ res = __copysignf (0.0, __imag__ x);
- }
- else if (icls == FP_ZERO || icls == FP_INFINITE)
- {
- __real__ res = __nanf ("");
- __imag__ res = __copysignf (0.0, __imag__ x);
- }
- else
- {
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- res = x;
- }
- else
- {
- if (fabsf (__real__ x) >= 16.0f / FLT_EPSILON
- || fabsf (__imag__ x) >= 16.0f / FLT_EPSILON)
- {
- __real__ res = __copysignf ((float) M_PI_2, __real__ x);
- if (fabsf (__real__ x) <= 1.0f)
- __imag__ res = 1.0f / __imag__ x;
- else if (fabsf (__imag__ x) <= 1.0f)
- __imag__ res = __imag__ x / __real__ x / __real__ x;
- else
- {
- float h = __ieee754_hypotf (__real__ x / 2.0f,
- __imag__ x / 2.0f);
- __imag__ res = __imag__ x / h / h / 4.0f;
- }
- }
- else
- {
- float den, absx, absy;
-
- absx = fabsf (__real__ x);
- absy = fabsf (__imag__ x);
- if (absx < absy)
- {
- float t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absy < FLT_EPSILON / 2.0f)
- {
- den = (1.0f - absx) * (1.0f + absx);
- if (den == -0.0f)
- den = 0.0f;
- }
- else if (absx >= 1.0f)
- den = (1.0f - absx) * (1.0f + absx) - absy * absy;
- else if (absx >= 0.75f || absy >= 0.5f)
- den = -__x2y2m1f (absx, absy);
- else
- den = (1.0f - absx) * (1.0f + absx) - absy * absy;
-
- __real__ res = 0.5f * __ieee754_atan2f (2.0f * __real__ x, den);
-
- if (fabsf (__imag__ x) == 1.0f
- && fabsf (__real__ x) < FLT_EPSILON * FLT_EPSILON)
- __imag__ res = (__copysignf (0.5f, __imag__ x)
- * ((float) M_LN2
- - __ieee754_logf (fabsf (__real__ x))));
- else
- {
- float r2 = 0.0f, num, f;
-
- if (fabsf (__real__ x) >= FLT_EPSILON * FLT_EPSILON)
- r2 = __real__ x * __real__ x;
-
- num = __imag__ x + 1.0f;
- num = r2 + num * num;
-
- den = __imag__ x - 1.0f;
- den = r2 + den * den;
-
- f = num / den;
- if (f < 0.5f)
- __imag__ res = 0.25f * __ieee754_logf (f);
- else
- {
- num = 4.0f * __imag__ x;
- __imag__ res = 0.25f * __log1pf (num / den);
- }
- }
- }
-
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-#ifndef __catanf
-weak_alias (__catanf, catanf)
-#endif
diff --git a/math/s_catanh.c b/math/s_catanh.c
deleted file mode 100644
index 11ea06246e..0000000000
--- a/math/s_catanh.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Return arc hyperbole tangent for double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__catanh (__complex__ double x)
-{
- __complex__ double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = __copysign (0.0, __real__ x);
- __imag__ res = __copysign (M_PI_2, __imag__ x);
- }
- else if (rcls == FP_INFINITE || rcls == FP_ZERO)
- {
- __real__ res = __copysign (0.0, __real__ x);
- if (icls >= FP_ZERO)
- __imag__ res = __copysign (M_PI_2, __imag__ x);
- else
- __imag__ res = __nan ("");
- }
- else
- {
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- res = x;
- }
- else
- {
- if (fabs (__real__ x) >= 16.0 / DBL_EPSILON
- || fabs (__imag__ x) >= 16.0 / DBL_EPSILON)
- {
- __imag__ res = __copysign (M_PI_2, __imag__ x);
- if (fabs (__imag__ x) <= 1.0)
- __real__ res = 1.0 / __real__ x;
- else if (fabs (__real__ x) <= 1.0)
- __real__ res = __real__ x / __imag__ x / __imag__ x;
- else
- {
- double h = __ieee754_hypot (__real__ x / 2.0, __imag__ x / 2.0);
- __real__ res = __real__ x / h / h / 4.0;
- }
- }
- else
- {
- if (fabs (__real__ x) == 1.0
- && fabs (__imag__ x) < DBL_EPSILON * DBL_EPSILON)
- __real__ res = (__copysign (0.5, __real__ x)
- * (M_LN2 - __ieee754_log (fabs (__imag__ x))));
- else
- {
- double i2 = 0.0;
- if (fabs (__imag__ x) >= DBL_EPSILON * DBL_EPSILON)
- i2 = __imag__ x * __imag__ x;
-
- double num = 1.0 + __real__ x;
- num = i2 + num * num;
-
- double den = 1.0 - __real__ x;
- den = i2 + den * den;
-
- double f = num / den;
- if (f < 0.5)
- __real__ res = 0.25 * __ieee754_log (f);
- else
- {
- num = 4.0 * __real__ x;
- __real__ res = 0.25 * __log1p (num / den);
- }
- }
-
- double absx, absy, den;
-
- absx = fabs (__real__ x);
- absy = fabs (__imag__ x);
- if (absx < absy)
- {
- double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absy < DBL_EPSILON / 2.0)
- {
- den = (1.0 - absx) * (1.0 + absx);
- if (den == -0.0)
- den = 0.0;
- }
- else if (absx >= 1.0)
- den = (1.0 - absx) * (1.0 + absx) - absy * absy;
- else if (absx >= 0.75 || absy >= 0.5)
- den = -__x2y2m1 (absx, absy);
- else
- den = (1.0 - absx) * (1.0 + absx) - absy * absy;
-
- __imag__ res = 0.5 * __ieee754_atan2 (2.0 * __imag__ x, den);
- }
-
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__catanh, catanh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__catanh, __catanhl)
-weak_alias (__catanh, catanhl)
-#endif
diff --git a/math/s_catanh_template.c b/math/s_catanh_template.c
new file mode 100644
index 0000000000..0669c4c1f8
--- /dev/null
+++ b/math/s_catanh_template.c
@@ -0,0 +1,139 @@
+/* Return arc hyperbolic tangent for a complex float type.
+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <complex.h>
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+CFLOAT
+M_DECL_FUNC (__catanh) (CFLOAT x)
+{
+ CFLOAT res;
+ int rcls = fpclassify (__real__ x);
+ int icls = fpclassify (__imag__ x);
+
+ if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
+ {
+ if (icls == FP_INFINITE)
+ {
+ __real__ res = M_COPYSIGN (0, __real__ x);
+ __imag__ res = M_COPYSIGN (M_MLIT (M_PI_2), __imag__ x);
+ }
+ else if (rcls == FP_INFINITE || rcls == FP_ZERO)
+ {
+ __real__ res = M_COPYSIGN (0, __real__ x);
+ if (icls >= FP_ZERO)
+ __imag__ res = M_COPYSIGN (M_MLIT (M_PI_2), __imag__ x);
+ else
+ __imag__ res = M_NAN;
+ }
+ else
+ {
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
+ }
+ }
+ else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
+ {
+ res = x;
+ }
+ else
+ {
+ if (M_FABS (__real__ x) >= 16 / M_EPSILON
+ || M_FABS (__imag__ x) >= 16 / M_EPSILON)
+ {
+ __imag__ res = M_COPYSIGN (M_MLIT (M_PI_2), __imag__ x);
+ if (M_FABS (__imag__ x) <= 1)
+ __real__ res = 1 / __real__ x;
+ else if (M_FABS (__real__ x) <= 1)
+ __real__ res = __real__ x / __imag__ x / __imag__ x;
+ else
+ {
+ FLOAT h = M_HYPOT (__real__ x / 2, __imag__ x / 2);
+ __real__ res = __real__ x / h / h / 4;
+ }
+ }
+ else
+ {
+ if (M_FABS (__real__ x) == 1
+ && M_FABS (__imag__ x) < M_EPSILON * M_EPSILON)
+ __real__ res = (M_COPYSIGN (M_LIT (0.5), __real__ x)
+ * ((FLOAT) M_MLIT (M_LN2)
+ - M_LOG (M_FABS (__imag__ x))));
+ else
+ {
+ FLOAT i2 = 0;
+ if (M_FABS (__imag__ x) >= M_EPSILON * M_EPSILON)
+ i2 = __imag__ x * __imag__ x;
+
+ FLOAT num = 1 + __real__ x;
+ num = i2 + num * num;
+
+ FLOAT den = 1 - __real__ x;
+ den = i2 + den * den;
+
+ FLOAT f = num / den;
+ if (f < M_LIT (0.5))
+ __real__ res = M_LIT (0.25) * M_LOG (f);
+ else
+ {
+ num = 4 * __real__ x;
+ __real__ res = M_LIT (0.25) * M_LOG1P (num / den);
+ }
+ }
+
+ FLOAT absx, absy, den;
+
+ absx = M_FABS (__real__ x);
+ absy = M_FABS (__imag__ x);
+ if (absx < absy)
+ {
+ FLOAT t = absx;
+ absx = absy;
+ absy = t;
+ }
+
+ if (absy < M_EPSILON / 2)
+ {
+ den = (1 - absx) * (1 + absx);
+ if (den == 0)
+ den = 0;
+ }
+ else if (absx >= 1)
+ den = (1 - absx) * (1 + absx) - absy * absy;
+ else if (absx >= M_LIT (0.75) || absy >= M_LIT (0.5))
+ den = -M_SUF (__x2y2m1) (absx, absy);
+ else
+ den = (1 - absx) * (1 + absx) - absy * absy;
+
+ __imag__ res = M_LIT (0.5) * M_ATAN2 (2 * __imag__ x, den);
+ }
+
+ math_check_force_underflow_complex (res);
+ }
+
+ return res;
+}
+
+declare_mgen_alias (__catanh, catanh)
+
+#if M_LIBM_NEED_COMPAT (catanh)
+declare_mgen_libm_compat (__catanh, catanh)
+#endif
diff --git a/math/s_catanhf.c b/math/s_catanhf.c
deleted file mode 100644
index fe43a518fb..0000000000
--- a/math/s_catanhf.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Return arc hyperbole tangent for float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ float
-__catanhf (__complex__ float x)
-{
- __complex__ float res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = __copysignf (0.0, __real__ x);
- __imag__ res = __copysignf (M_PI_2, __imag__ x);
- }
- else if (rcls == FP_INFINITE || rcls == FP_ZERO)
- {
- __real__ res = __copysignf (0.0, __real__ x);
- if (icls >= FP_ZERO)
- __imag__ res = __copysignf (M_PI_2, __imag__ x);
- else
- __imag__ res = __nanf ("");
- }
- else
- {
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- res = x;
- }
- else
- {
- if (fabsf (__real__ x) >= 16.0f / FLT_EPSILON
- || fabsf (__imag__ x) >= 16.0f / FLT_EPSILON)
- {
- __imag__ res = __copysignf ((float) M_PI_2, __imag__ x);
- if (fabsf (__imag__ x) <= 1.0f)
- __real__ res = 1.0f / __real__ x;
- else if (fabsf (__real__ x) <= 1.0f)
- __real__ res = __real__ x / __imag__ x / __imag__ x;
- else
- {
- float h = __ieee754_hypotf (__real__ x / 2.0f,
- __imag__ x / 2.0f);
- __real__ res = __real__ x / h / h / 4.0f;
- }
- }
- else
- {
- if (fabsf (__real__ x) == 1.0f
- && fabsf (__imag__ x) < FLT_EPSILON * FLT_EPSILON)
- __real__ res = (__copysignf (0.5f, __real__ x)
- * ((float) M_LN2
- - __ieee754_logf (fabsf (__imag__ x))));
- else
- {
- float i2 = 0.0f;
- if (fabsf (__imag__ x) >= FLT_EPSILON * FLT_EPSILON)
- i2 = __imag__ x * __imag__ x;
-
- float num = 1.0f + __real__ x;
- num = i2 + num * num;
-
- float den = 1.0f - __real__ x;
- den = i2 + den * den;
-
- float f = num / den;
- if (f < 0.5f)
- __real__ res = 0.25f * __ieee754_logf (f);
- else
- {
- num = 4.0f * __real__ x;
- __real__ res = 0.25f * __log1pf (num / den);
- }
- }
-
- float absx, absy, den;
-
- absx = fabsf (__real__ x);
- absy = fabsf (__imag__ x);
- if (absx < absy)
- {
- float t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absy < FLT_EPSILON / 2.0f)
- {
- den = (1.0f - absx) * (1.0f + absx);
- if (den == -0.0f)
- den = 0.0f;
- }
- else if (absx >= 1.0f)
- den = (1.0f - absx) * (1.0f + absx) - absy * absy;
- else if (absx >= 0.75f || absy >= 0.5f)
- den = -__x2y2m1f (absx, absy);
- else
- den = (1.0f - absx) * (1.0f + absx) - absy * absy;
-
- __imag__ res = 0.5f * __ieee754_atan2f (2.0f * __imag__ x, den);
- }
-
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-#ifndef __catanhf
-weak_alias (__catanhf, catanhf)
-#endif
diff --git a/math/s_catanhl.c b/math/s_catanhl.c
deleted file mode 100644
index 4c8e8711ab..0000000000
--- a/math/s_catanhl.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Return arc hyperbole tangent for long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* To avoid spurious overflows, use this definition to treat IBM long
- double as approximating an IEEE-style format. */
-#if LDBL_MANT_DIG == 106
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 0x1p-106L
-#endif
-
-__complex__ long double
-__catanhl (__complex__ long double x)
-{
- __complex__ long double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = __copysignl (0.0, __real__ x);
- __imag__ res = __copysignl (M_PI_2l, __imag__ x);
- }
- else if (rcls == FP_INFINITE || rcls == FP_ZERO)
- {
- __real__ res = __copysignl (0.0, __real__ x);
- if (icls >= FP_ZERO)
- __imag__ res = __copysignl (M_PI_2l, __imag__ x);
- else
- __imag__ res = __nanl ("");
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- res = x;
- }
- else
- {
- if (fabsl (__real__ x) >= 16.0L / LDBL_EPSILON
- || fabsl (__imag__ x) >= 16.0L / LDBL_EPSILON)
- {
- __imag__ res = __copysignl (M_PI_2l, __imag__ x);
- if (fabsl (__imag__ x) <= 1.0L)
- __real__ res = 1.0L / __real__ x;
- else if (fabsl (__real__ x) <= 1.0L)
- __real__ res = __real__ x / __imag__ x / __imag__ x;
- else
- {
- long double h = __ieee754_hypotl (__real__ x / 2.0L,
- __imag__ x / 2.0L);
- __real__ res = __real__ x / h / h / 4.0L;
- }
- }
- else
- {
- if (fabsl (__real__ x) == 1.0L
- && fabsl (__imag__ x) < LDBL_EPSILON * LDBL_EPSILON)
- __real__ res = (__copysignl (0.5L, __real__ x)
- * (M_LN2l - __ieee754_logl (fabsl (__imag__ x))));
- else
- {
- long double i2 = 0.0;
- if (fabsl (__imag__ x) >= LDBL_EPSILON * LDBL_EPSILON)
- i2 = __imag__ x * __imag__ x;
-
- long double num = 1.0L + __real__ x;
- num = i2 + num * num;
-
- long double den = 1.0L - __real__ x;
- den = i2 + den * den;
-
- long double f = num / den;
- if (f < 0.5L)
- __real__ res = 0.25L * __ieee754_logl (f);
- else
- {
- num = 4.0L * __real__ x;
- __real__ res = 0.25L * __log1pl (num / den);
- }
- }
-
- long double absx, absy, den;
-
- absx = fabsl (__real__ x);
- absy = fabsl (__imag__ x);
- if (absx < absy)
- {
- long double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absy < LDBL_EPSILON / 2.0L)
- {
- den = (1.0L - absx) * (1.0L + absx);
- if (den == -0.0L)
- den = 0.0L;
- }
- else if (absx >= 1.0L)
- den = (1.0L - absx) * (1.0L + absx) - absy * absy;
- else if (absx >= 0.75L || absy >= 0.5L)
- den = -__x2y2m1l (absx, absy);
- else
- den = (1.0L - absx) * (1.0L + absx) - absy * absy;
-
- __imag__ res = 0.5L * __ieee754_atan2l (2.0L * __imag__ x, den);
- }
-
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__catanhl, catanhl)
diff --git a/math/s_catanl.c b/math/s_catanl.c
deleted file mode 100644
index 4425002599..0000000000
--- a/math/s_catanl.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Return arc tangent of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* To avoid spurious overflows, use this definition to treat IBM long
- double as approximating an IEEE-style format. */
-#if LDBL_MANT_DIG == 106
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 0x1p-106L
-#endif
-
-__complex__ long double
-__catanl (__complex__ long double x)
-{
- __complex__ long double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (rcls == FP_INFINITE)
- {
- __real__ res = __copysignl (M_PI_2l, __real__ x);
- __imag__ res = __copysignl (0.0, __imag__ x);
- }
- else if (icls == FP_INFINITE)
- {
- if (rcls >= FP_ZERO)
- __real__ res = __copysignl (M_PI_2l, __real__ x);
- else
- __real__ res = __nanl ("");
- __imag__ res = __copysignl (0.0, __imag__ x);
- }
- else if (icls == FP_ZERO || icls == FP_INFINITE)
- {
- __real__ res = __nanl ("");
- __imag__ res = __copysignl (0.0, __imag__ x);
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- res = x;
- }
- else
- {
- if (fabsl (__real__ x) >= 16.0L / LDBL_EPSILON
- || fabsl (__imag__ x) >= 16.0L / LDBL_EPSILON)
- {
- __real__ res = __copysignl (M_PI_2l, __real__ x);
- if (fabsl (__real__ x) <= 1.0L)
- __imag__ res = 1.0L / __imag__ x;
- else if (fabsl (__imag__ x) <= 1.0L)
- __imag__ res = __imag__ x / __real__ x / __real__ x;
- else
- {
- long double h = __ieee754_hypotl (__real__ x / 2.0L,
- __imag__ x / 2.0L);
- __imag__ res = __imag__ x / h / h / 4.0L;
- }
- }
- else
- {
- long double den, absx, absy;
-
- absx = fabsl (__real__ x);
- absy = fabsl (__imag__ x);
- if (absx < absy)
- {
- long double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absy < LDBL_EPSILON / 2.0L)
- {
- den = (1.0L - absx) * (1.0L + absx);
- if (den == -0.0L)
- den = 0.0L;
- }
- else if (absx >= 1.0L)
- den = (1.0L - absx) * (1.0L + absx) - absy * absy;
- else if (absx >= 0.75L || absy >= 0.5L)
- den = -__x2y2m1l (absx, absy);
- else
- den = (1.0L - absx) * (1.0L + absx) - absy * absy;
-
- __real__ res = 0.5L * __ieee754_atan2l (2.0L * __real__ x, den);
-
- if (fabsl (__imag__ x) == 1.0L
- && fabsl (__real__ x) < LDBL_EPSILON * LDBL_EPSILON)
- __imag__ res = (__copysignl (0.5L, __imag__ x)
- * (M_LN2l - __ieee754_logl (fabsl (__real__ x))));
- else
- {
- long double r2 = 0.0L, num, f;
-
- if (fabsl (__real__ x) >= LDBL_EPSILON * LDBL_EPSILON)
- r2 = __real__ x * __real__ x;
-
- num = __imag__ x + 1.0L;
- num = r2 + num * num;
-
- den = __imag__ x - 1.0L;
- den = r2 + den * den;
-
- f = num / den;
- if (f < 0.5L)
- __imag__ res = 0.25L * __ieee754_logl (f);
- else
- {
- num = 4.0L * __imag__ x;
- __imag__ res = 0.25L * __log1pl (num / den);
- }
- }
- }
-
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__catanl, catanl)
diff --git a/math/s_ccos.c b/math/s_ccos.c
deleted file mode 100644
index e484551aee..0000000000
--- a/math/s_ccos.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Return cosine of complex double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-
-
-__complex__ double
-__ccos (__complex__ double x)
-{
- __complex__ double y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- return __ccosh (y);
-}
-weak_alias (__ccos, ccos)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ccos, __ccosl)
-weak_alias (__ccos, ccosl)
-#endif
diff --git a/math/s_ccosf.c b/math/s_ccos_template.c
index c7da3fe9ed..becaa2d27c 100644
--- a/math/s_ccosf.c
+++ b/math/s_ccos_template.c
@@ -1,4 +1,4 @@
-/* Return cosine of complex float value.
+/* Return cosine of complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,17 +22,19 @@
#include <math.h>
#include <math_private.h>
-
-__complex__ float
-__ccosf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__ccos) (CFLOAT x)
{
- __complex__ float y;
+ CFLOAT y;
__real__ y = -__imag__ x;
__imag__ y = __real__ x;
- return __ccoshf (y);
+ return M_SUF (__ccosh) (y);
}
-#ifndef __ccosf
-weak_alias (__ccosf, ccosf)
+
+declare_mgen_alias (__ccos, ccos);
+
+#if M_LIBM_NEED_COMPAT (carg)
+declare_mgen_libm_compat (__ccos, ccos)
#endif
diff --git a/math/s_ccosh.c b/math/s_ccosh.c
deleted file mode 100644
index 4c2f3008a3..0000000000
--- a/math/s_ccosh.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Complex cosine hyperbole function for double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__ccosh (__complex__ double x)
-{
- __complex__ double retval;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
- double sinix, cosix;
-
- if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
- {
- __sincos (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (fabs (__real__ x) > t)
- {
- double exp_t = __ieee754_exp (t);
- double rx = fabs (__real__ x);
- if (signbit (__real__ x))
- sinix = -sinix;
- rx -= t;
- sinix *= exp_t / 2.0;
- cosix *= exp_t / 2.0;
- if (rx > t)
- {
- rx -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- if (rx > t)
- {
- /* Overflow (original real part of x > 3t). */
- __real__ retval = DBL_MAX * cosix;
- __imag__ retval = DBL_MAX * sinix;
- }
- else
- {
- double exp_val = __ieee754_exp (rx);
- __real__ retval = exp_val * cosix;
- __imag__ retval = exp_val * sinix;
- }
- }
- else
- {
- __real__ retval = __ieee754_cosh (__real__ x) * cosix;
- __imag__ retval = __ieee754_sinh (__real__ x) * sinix;
- }
-
- math_check_force_underflow_complex (retval);
- }
- else
- {
- __imag__ retval = __real__ x == 0.0 ? 0.0 : __nan ("");
- __real__ retval = __nan ("") + __nan ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else if (rcls == FP_INFINITE)
- {
- /* Real part is infinite. */
- if (__glibc_likely (icls > FP_ZERO))
- {
- /* Imaginary part is finite. */
- double sinix, cosix;
-
- if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
- {
- __sincos (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysign (HUGE_VAL, cosix);
- __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 ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- __real__ retval = __nan ("");
- __imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nan ("");
- }
-
- return retval;
-}
-weak_alias (__ccosh, ccosh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ccosh, __ccoshl)
-weak_alias (__ccosh, ccoshl)
-#endif
diff --git a/math/s_ccoshf.c b/math/s_ccosh_template.c
index d572b76193..5240724392 100644
--- a/math/s_ccoshf.c
+++ b/math/s_ccosh_template.c
@@ -1,4 +1,4 @@
-/* Complex cosine hyperbole function for float.
+/* Complex cosine hyperbolic function for float types.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,10 +23,10 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__ccoshf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__ccosh) (CFLOAT x)
{
- __complex__ float retval;
+ CFLOAT retval;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
@@ -36,28 +36,28 @@ __ccoshf (__complex__ float x)
if (__glibc_likely (icls >= FP_ZERO))
{
/* Imaginary part is finite. */
- const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
- float sinix, cosix;
+ const int t = (int) ((M_MAX_EXP - 1) * M_MLIT (M_LN2));
+ FLOAT sinix, cosix;
- if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
{
- __sincosf (__imag__ x, &sinix, &cosix);
+ M_SINCOS (__imag__ x, &sinix, &cosix);
}
else
{
sinix = __imag__ x;
- cosix = 1.0f;
+ cosix = 1;
}
- if (fabsf (__real__ x) > t)
+ if (M_FABS (__real__ x) > t)
{
- float exp_t = __ieee754_expf (t);
- float rx = fabsf (__real__ x);
+ FLOAT exp_t = M_EXP (t);
+ FLOAT rx = M_FABS (__real__ x);
if (signbit (__real__ x))
sinix = -sinix;
rx -= t;
- sinix *= exp_t / 2.0f;
- cosix *= exp_t / 2.0f;
+ sinix *= exp_t / 2;
+ cosix *= exp_t / 2;
if (rx > t)
{
rx -= t;
@@ -67,31 +67,28 @@ __ccoshf (__complex__ float x)
if (rx > t)
{
/* Overflow (original real part of x > 3t). */
- __real__ retval = FLT_MAX * cosix;
- __imag__ retval = FLT_MAX * sinix;
+ __real__ retval = M_MAX * cosix;
+ __imag__ retval = M_MAX * sinix;
}
else
{
- float exp_val = __ieee754_expf (rx);
+ FLOAT exp_val = M_EXP (rx);
__real__ retval = exp_val * cosix;
__imag__ retval = exp_val * sinix;
}
}
else
{
- __real__ retval = __ieee754_coshf (__real__ x) * cosix;
- __imag__ retval = __ieee754_sinhf (__real__ x) * sinix;
+ __real__ retval = M_COSH (__real__ x) * cosix;
+ __imag__ retval = M_SINH (__real__ x) * sinix;
}
math_check_force_underflow_complex (retval);
}
else
{
- __imag__ retval = __real__ x == 0.0 ? 0.0 : __nanf ("");
- __real__ retval = __nanf ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
+ __imag__ retval = __real__ x == 0 ? 0 : M_NAN;
+ __real__ retval = __imag__ x - __imag__ x;
}
}
else if (rcls == FP_INFINITE)
@@ -100,46 +97,45 @@ __ccoshf (__complex__ float x)
if (__glibc_likely (icls > FP_ZERO))
{
/* Imaginary part is finite. */
- float sinix, cosix;
+ FLOAT sinix, cosix;
- if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
{
- __sincosf (__imag__ x, &sinix, &cosix);
+ M_SINCOS (__imag__ x, &sinix, &cosix);
}
else
{
sinix = __imag__ x;
- cosix = 1.0f;
+ cosix = 1;
}
- __real__ retval = __copysignf (HUGE_VALF, cosix);
- __imag__ retval = (__copysignf (HUGE_VALF, sinix)
- * __copysignf (1.0, __real__ x));
+ __real__ retval = M_COPYSIGN (M_HUGE_VAL, cosix);
+ __imag__ retval = (M_COPYSIGN (M_HUGE_VAL, sinix)
+ * M_COPYSIGN (1, __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);
+ __real__ retval = M_HUGE_VAL;
+ __imag__ retval = __imag__ x * M_COPYSIGN (1, __real__ x);
}
else
{
- /* The addition raises the invalid exception. */
- __real__ retval = HUGE_VALF;
- __imag__ retval = __nanf ("") + __nanf ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
+ __real__ retval = M_HUGE_VAL;
+ __imag__ retval = __imag__ x - __imag__ x;
}
}
else
{
- __real__ retval = __nanf ("");
- __imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nanf ("");
+ __real__ retval = M_NAN;
+ __imag__ retval = __imag__ x == 0 ? __imag__ x : M_NAN;
}
return retval;
}
-#ifndef __ccoshf
-weak_alias (__ccoshf, ccoshf)
+
+declare_mgen_alias (__ccosh, ccosh);
+
+#if M_LIBM_NEED_COMPAT (carg)
+declare_mgen_libm_compat (__ccosh, ccosh)
#endif
diff --git a/math/s_ccoshl.c b/math/s_ccoshl.c
deleted file mode 100644
index d38f0aaff6..0000000000
--- a/math/s_ccoshl.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Complex cosine hyperbole function for long double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ long double
-__ccoshl (__complex__ long double x)
-{
- __complex__ long double retval;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
- long double sinix, cosix;
-
- if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
- {
- __sincosl (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (fabsl (__real__ x) > t)
- {
- long double exp_t = __ieee754_expl (t);
- long double rx = fabsl (__real__ x);
- if (signbit (__real__ x))
- sinix = -sinix;
- rx -= t;
- sinix *= exp_t / 2.0L;
- cosix *= exp_t / 2.0L;
- if (rx > t)
- {
- rx -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- if (rx > t)
- {
- /* Overflow (original real part of x > 3t). */
- __real__ retval = LDBL_MAX * cosix;
- __imag__ retval = LDBL_MAX * sinix;
- }
- else
- {
- long double exp_val = __ieee754_expl (rx);
- __real__ retval = exp_val * cosix;
- __imag__ retval = exp_val * sinix;
- }
- }
- else
- {
- __real__ retval = __ieee754_coshl (__real__ x) * cosix;
- __imag__ retval = __ieee754_sinhl (__real__ x) * sinix;
- }
-
- math_check_force_underflow_complex (retval);
- }
- else
- {
- __imag__ retval = __real__ x == 0.0 ? 0.0 : __nanl ("");
- __real__ retval = __nanl ("") + __nanl ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else if (rcls == FP_INFINITE)
- {
- /* Real part is infinite. */
- if (__glibc_likely (icls > FP_ZERO))
- {
- /* Imaginary part is finite. */
- long double sinix, cosix;
-
- if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
- {
- __sincosl (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysignl (HUGE_VALL, cosix);
- __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 ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- __real__ retval = __nanl ("");
- __imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nanl ("");
- }
-
- return retval;
-}
-weak_alias (__ccoshl, ccoshl)
diff --git a/math/s_cexp.c b/math/s_cexp.c
deleted file mode 100644
index 3a476bde3c..0000000000
--- a/math/s_cexp.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Return value of complex exponential function for double complex value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__cexp (__complex__ double x)
-{
- __complex__ double retval;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
- double sinix, cosix;
-
- if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
- {
- __sincos (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (__real__ x > t)
- {
- double exp_t = __ieee754_exp (t);
- __real__ x -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- if (__real__ x > t)
- {
- __real__ x -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- }
- if (__real__ x > t)
- {
- /* Overflow (original real part of x > 3t). */
- __real__ retval = DBL_MAX * cosix;
- __imag__ retval = DBL_MAX * sinix;
- }
- else
- {
- double exp_val = __ieee754_exp (__real__ x);
- __real__ retval = exp_val * cosix;
- __imag__ retval = exp_val * sinix;
- }
- math_check_force_underflow_complex (retval);
- }
- else
- {
- /* If the imaginary part is +-inf or NaN and the real part
- is not +-inf the result is NaN + iNaN. */
- __real__ retval = __nan ("");
- __imag__ retval = __nan ("");
-
- feraiseexcept (FE_INVALID);
- }
- }
- else if (__glibc_likely (rcls == FP_INFINITE))
- {
- /* Real part is infinite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- double value = signbit (__real__ x) ? 0.0 : HUGE_VAL;
-
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = value;
- __imag__ retval = __imag__ x;
- }
- else
- {
- double sinix, cosix;
-
- if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
- {
- __sincos (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysign (value, cosix);
- __imag__ retval = __copysign (value, sinix);
- }
- }
- else if (signbit (__real__ x) == 0)
- {
- __real__ retval = HUGE_VAL;
- __imag__ retval = __nan ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- else
- {
- __real__ retval = 0.0;
- __imag__ retval = __copysign (0.0, __imag__ x);
- }
- }
- else
- {
- /* If the real part is NaN the result is NaN + iNaN unless the
- imaginary part is zero. */
- __real__ retval = __nan ("");
- if (icls == FP_ZERO)
- __imag__ retval = __imag__ x;
- else
- {
- __imag__ retval = __nan ("");
-
- if (rcls != FP_NAN || icls != FP_NAN)
- feraiseexcept (FE_INVALID);
- }
- }
-
- return retval;
-}
-weak_alias (__cexp, cexp)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cexp, __cexpl)
-weak_alias (__cexp, cexpl)
-#endif
diff --git a/math/s_cexpf.c b/math/s_cexp_template.c
index 001fec2492..dd46d96a32 100644
--- a/math/s_cexpf.c
+++ b/math/s_cexp_template.c
@@ -1,4 +1,4 @@
-/* Return value of complex exponential function for float complex value.
+/* Return value of complex exponential function for a float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,10 +23,10 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__cexpf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__cexp) (CFLOAT x)
{
- __complex__ float retval;
+ CFLOAT retval;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
@@ -36,22 +36,22 @@ __cexpf (__complex__ float x)
if (__glibc_likely (icls >= FP_ZERO))
{
/* Imaginary part is finite. */
- const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
- float sinix, cosix;
+ const int t = (int) ((M_MAX_EXP - 1) * M_MLIT (M_LN2));
+ FLOAT sinix, cosix;
- if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
{
- __sincosf (__imag__ x, &sinix, &cosix);
+ M_SINCOS (__imag__ x, &sinix, &cosix);
}
else
{
sinix = __imag__ x;
- cosix = 1.0f;
+ cosix = 1;
}
if (__real__ x > t)
{
- float exp_t = __ieee754_expf (t);
+ FLOAT exp_t = M_EXP (t);
__real__ x -= t;
sinix *= exp_t;
cosix *= exp_t;
@@ -65,12 +65,12 @@ __cexpf (__complex__ float x)
if (__real__ x > t)
{
/* Overflow (original real part of x > 3t). */
- __real__ retval = FLT_MAX * cosix;
- __imag__ retval = FLT_MAX * sinix;
+ __real__ retval = M_MAX * cosix;
+ __imag__ retval = M_MAX * sinix;
}
else
{
- float exp_val = __ieee754_expf (__real__ x);
+ FLOAT exp_val = M_EXP (__real__ x);
__real__ retval = exp_val * cosix;
__imag__ retval = exp_val * sinix;
}
@@ -80,8 +80,8 @@ __cexpf (__complex__ float x)
{
/* If the imaginary part is +-inf or NaN and the real part
is not +-inf the result is NaN + iNaN. */
- __real__ retval = __nanf ("");
- __imag__ retval = __nanf ("");
+ __real__ retval = M_NAN;
+ __imag__ retval = M_NAN;
feraiseexcept (FE_INVALID);
}
@@ -92,7 +92,7 @@ __cexpf (__complex__ float x)
if (__glibc_likely (icls >= FP_ZERO))
{
/* Imaginary part is finite. */
- float value = signbit (__real__ x) ? 0.0 : HUGE_VALF;
+ FLOAT value = signbit (__real__ x) ? 0 : M_HUGE_VAL;
if (icls == FP_ZERO)
{
@@ -102,46 +102,43 @@ __cexpf (__complex__ float x)
}
else
{
- float sinix, cosix;
+ FLOAT sinix, cosix;
- if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
{
- __sincosf (__imag__ x, &sinix, &cosix);
+ M_SINCOS (__imag__ x, &sinix, &cosix);
}
else
{
sinix = __imag__ x;
- cosix = 1.0f;
+ cosix = 1;
}
- __real__ retval = __copysignf (value, cosix);
- __imag__ retval = __copysignf (value, sinix);
+ __real__ retval = M_COPYSIGN (value, cosix);
+ __imag__ retval = M_COPYSIGN (value, sinix);
}
}
else if (signbit (__real__ x) == 0)
{
- __real__ retval = HUGE_VALF;
- __imag__ retval = __nanf ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
+ __real__ retval = M_HUGE_VAL;
+ __imag__ retval = __imag__ x - __imag__ x;
}
else
{
- __real__ retval = 0.0;
- __imag__ retval = __copysignf (0.0, __imag__ x);
+ __real__ retval = 0;
+ __imag__ retval = M_COPYSIGN (0, __imag__ x);
}
}
else
{
/* If the real part is NaN the result is NaN + iNaN unless the
imaginary part is zero. */
- __real__ retval = __nanf ("");
+ __real__ retval = M_NAN;
if (icls == FP_ZERO)
__imag__ retval = __imag__ x;
else
{
- __imag__ retval = __nanf ("");
+ __imag__ retval = M_NAN;
if (rcls != FP_NAN || icls != FP_NAN)
feraiseexcept (FE_INVALID);
@@ -150,6 +147,8 @@ __cexpf (__complex__ float x)
return retval;
}
-#ifndef __cexpf
-weak_alias (__cexpf, cexpf)
+declare_mgen_alias (__cexp, cexp)
+
+#if M_LIBM_NEED_COMPAT (cexp)
+declare_mgen_libm_compat (__cexp, cexp)
#endif
diff --git a/math/s_cexpl.c b/math/s_cexpl.c
deleted file mode 100644
index 9ab566c0c1..0000000000
--- a/math/s_cexpl.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Return value of complex exponential function for long double complex value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ long double
-__cexpl (__complex__ long double x)
-{
- __complex__ long double retval;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
- long double sinix, cosix;
-
- if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
- {
- __sincosl (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (__real__ x > t)
- {
- long double exp_t = __ieee754_expl (t);
- __real__ x -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- if (__real__ x > t)
- {
- __real__ x -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- }
- if (__real__ x > t)
- {
- /* Overflow (original real part of x > 3t). */
- __real__ retval = LDBL_MAX * cosix;
- __imag__ retval = LDBL_MAX * sinix;
- }
- else
- {
- long double exp_val = __ieee754_expl (__real__ x);
- __real__ retval = exp_val * cosix;
- __imag__ retval = exp_val * sinix;
- }
- math_check_force_underflow_complex (retval);
- }
- else
- {
- /* If the imaginary part is +-inf or NaN and the real part
- is not +-inf the result is NaN + iNaN. */
- __real__ retval = __nanl ("");
- __imag__ retval = __nanl ("");
-
- feraiseexcept (FE_INVALID);
- }
- }
- else if (__glibc_likely (rcls == FP_INFINITE))
- {
- /* Real part is infinite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- long double value = signbit (__real__ x) ? 0.0 : HUGE_VALL;
-
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = value;
- __imag__ retval = __imag__ x;
- }
- else
- {
- long double sinix, cosix;
-
- if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
- {
- __sincosl (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysignl (value, cosix);
- __imag__ retval = __copysignl (value, sinix);
- }
- }
- else if (signbit (__real__ x) == 0)
- {
- __real__ retval = HUGE_VALL;
- __imag__ retval = __nanl ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- else
- {
- __real__ retval = 0.0;
- __imag__ retval = __copysignl (0.0, __imag__ x);
- }
- }
- else
- {
- /* If the real part is NaN the result is NaN + iNaN unless the
- imaginary part is zero. */
- __real__ retval = __nanl ("");
- if (icls == FP_ZERO)
- __imag__ retval = __imag__ x;
- else
- {
- __imag__ retval = __nanl ("");
-
- if (rcls != FP_NAN || icls != FP_NAN)
- feraiseexcept (FE_INVALID);
- }
- }
-
- return retval;
-}
-weak_alias (__cexpl, cexpl)
diff --git a/math/s_clog.c b/math/s_clog.c
deleted file mode 100644
index b546030313..0000000000
--- a/math/s_clog.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Compute complex natural logarithm.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__clog (__complex__ double x)
-{
- __complex__ double result;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- /* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
- __imag__ result = __copysign (__imag__ result, __imag__ x);
- /* Yes, the following line raises an exception. */
- __real__ result = -1.0 / fabs (__real__ x);
- }
- else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
- {
- /* Neither real nor imaginary part is NaN. */
- double absx = fabs (__real__ x), absy = fabs (__imag__ x);
- int scale = 0;
-
- if (absx < absy)
- {
- double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absx > DBL_MAX / 2.0)
- {
- scale = -1;
- absx = __scalbn (absx, scale);
- absy = (absy >= DBL_MIN * 2.0 ? __scalbn (absy, scale) : 0.0);
- }
- else if (absx < DBL_MIN && absy < DBL_MIN)
- {
- scale = DBL_MANT_DIG;
- absx = __scalbn (absx, scale);
- absy = __scalbn (absy, scale);
- }
-
- if (absx == 1.0 && scale == 0)
- {
- __real__ result = __log1p (absy * absy) / 2.0;
- math_check_force_underflow_nonneg (__real__ result);
- }
- else if (absx > 1.0 && absx < 2.0 && absy < 1.0 && scale == 0)
- {
- double d2m1 = (absx - 1.0) * (absx + 1.0);
- if (absy >= DBL_EPSILON)
- d2m1 += absy * absy;
- __real__ result = __log1p (d2m1) / 2.0;
- }
- else if (absx < 1.0
- && absx >= 0.5
- && absy < DBL_EPSILON / 2.0
- && scale == 0)
- {
- double d2m1 = (absx - 1.0) * (absx + 1.0);
- __real__ result = __log1p (d2m1) / 2.0;
- }
- else if (absx < 1.0
- && absx >= 0.5
- && scale == 0
- && absx * absx + absy * absy >= 0.5)
- {
- double d2m1 = __x2y2m1 (absx, absy);
- __real__ result = __log1p (d2m1) / 2.0;
- }
- else
- {
- double d = __ieee754_hypot (absx, absy);
- __real__ result = __ieee754_log (d) - scale * M_LN2;
- }
-
- __imag__ result = __ieee754_atan2 (__imag__ x, __real__ x);
- }
- else
- {
- __imag__ result = __nan ("");
- if (rcls == FP_INFINITE || icls == FP_INFINITE)
- /* Real or imaginary part is infinite. */
- __real__ result = HUGE_VAL;
- else
- __real__ result = __nan ("");
- }
-
- return result;
-}
-weak_alias (__clog, clog)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__clog, __clogl)
-weak_alias (__clog, clogl)
-#endif
diff --git a/math/s_clog10.c b/math/s_clog10.c
deleted file mode 100644
index 8d9245bac6..0000000000
--- a/math/s_clog10.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Compute complex base 10 logarithm.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* log_10 (2). */
-#define M_LOG10_2 0.3010299956639811952137388947244930267682
-
-/* pi * log10 (e). */
-#define M_PI_LOG10E 1.364376353841841347485783625431355770210
-
-__complex__ double
-__clog10 (__complex__ double x)
-{
- __complex__ double result;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- /* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI_LOG10E : 0.0;
- __imag__ result = __copysign (__imag__ result, __imag__ x);
- /* Yes, the following line raises an exception. */
- __real__ result = -1.0 / fabs (__real__ x);
- }
- else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
- {
- /* Neither real nor imaginary part is NaN. */
- double absx = fabs (__real__ x), absy = fabs (__imag__ x);
- int scale = 0;
-
- if (absx < absy)
- {
- double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absx > DBL_MAX / 2.0)
- {
- scale = -1;
- absx = __scalbn (absx, scale);
- absy = (absy >= DBL_MIN * 2.0 ? __scalbn (absy, scale) : 0.0);
- }
- else if (absx < DBL_MIN && absy < DBL_MIN)
- {
- scale = DBL_MANT_DIG;
- absx = __scalbn (absx, scale);
- absy = __scalbn (absy, scale);
- }
-
- if (absx == 1.0 && scale == 0)
- {
- __real__ result = __log1p (absy * absy) * (M_LOG10E / 2.0);
- math_check_force_underflow_nonneg (__real__ result);
- }
- else if (absx > 1.0 && absx < 2.0 && absy < 1.0 && scale == 0)
- {
- double d2m1 = (absx - 1.0) * (absx + 1.0);
- if (absy >= DBL_EPSILON)
- d2m1 += absy * absy;
- __real__ result = __log1p (d2m1) * (M_LOG10E / 2.0);
- }
- else if (absx < 1.0
- && absx >= 0.5
- && absy < DBL_EPSILON / 2.0
- && scale == 0)
- {
- double d2m1 = (absx - 1.0) * (absx + 1.0);
- __real__ result = __log1p (d2m1) * (M_LOG10E / 2.0);
- }
- else if (absx < 1.0
- && absx >= 0.5
- && scale == 0
- && absx * absx + absy * absy >= 0.5)
- {
- double d2m1 = __x2y2m1 (absx, absy);
- __real__ result = __log1p (d2m1) * (M_LOG10E / 2.0);
- }
- else
- {
- double d = __ieee754_hypot (absx, absy);
- __real__ result = __ieee754_log10 (d) - scale * M_LOG10_2;
- }
-
- __imag__ result = M_LOG10E * __ieee754_atan2 (__imag__ x, __real__ x);
- }
- else
- {
- __imag__ result = __nan ("");
- if (rcls == FP_INFINITE || icls == FP_INFINITE)
- /* Real or imaginary part is infinite. */
- __real__ result = HUGE_VAL;
- else
- __real__ result = __nan ("");
- }
-
- return result;
-}
-weak_alias (__clog10, clog10)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__clog10, __clog10l)
-weak_alias (__clog10, clog10l)
-#endif
diff --git a/math/s_clog10_template.c b/math/s_clog10_template.c
new file mode 100644
index 0000000000..82624e38be
--- /dev/null
+++ b/math/s_clog10_template.c
@@ -0,0 +1,128 @@
+/* Compute complex base 10 logarithm.
+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <complex.h>
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+/* log_10 (2). */
+#define LOG10_2 M_LIT (0.3010299956639811952137388947244930267682)
+
+/* pi * log10 (e). */
+#define PI_LOG10E M_LIT (1.364376353841841347485783625431355770210)
+
+CFLOAT
+M_DECL_FUNC (__clog10) (CFLOAT x)
+{
+ CFLOAT result;
+ int rcls = fpclassify (__real__ x);
+ int icls = fpclassify (__imag__ x);
+
+ if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
+ {
+ /* Real and imaginary part are 0.0. */
+ __imag__ result = signbit (__real__ x) ? PI_LOG10E : 0;
+ __imag__ result = M_COPYSIGN (__imag__ result, __imag__ x);
+ /* Yes, the following line raises an exception. */
+ __real__ result = -1 / M_FABS (__real__ x);
+ }
+ else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
+ {
+ /* Neither real nor imaginary part is NaN. */
+ FLOAT absx = M_FABS (__real__ x), absy = M_FABS (__imag__ x);
+ int scale = 0;
+
+ if (absx < absy)
+ {
+ FLOAT t = absx;
+ absx = absy;
+ absy = t;
+ }
+
+ if (absx > M_MAX / 2)
+ {
+ scale = -1;
+ absx = M_SCALBN (absx, scale);
+ absy = (absy >= M_MIN * 2 ? M_SCALBN (absy, scale) : 0);
+ }
+ else if (absx < M_MIN && absy < M_MIN)
+ {
+ scale = M_MANT_DIG;
+ absx = M_SCALBN (absx, scale);
+ absy = M_SCALBN (absy, scale);
+ }
+
+ if (absx == 1 && scale == 0)
+ {
+ __real__ result = (M_LOG1P (absy * absy)
+ * ((FLOAT) M_MLIT (M_LOG10E) / 2));
+ math_check_force_underflow_nonneg (__real__ result);
+ }
+ else if (absx > 1 && absx < 2 && absy < 1 && scale == 0)
+ {
+ FLOAT d2m1 = (absx - 1) * (absx + 1);
+ if (absy >= M_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = M_LOG1P (d2m1) * ((FLOAT) M_MLIT (M_LOG10E) / 2);
+ }
+ else if (absx < 1
+ && absx >= M_LIT (0.5)
+ && absy < M_EPSILON / 2
+ && scale == 0)
+ {
+ FLOAT d2m1 = (absx - 1) * (absx + 1);
+ __real__ result = M_LOG1P (d2m1) * ((FLOAT) M_MLIT (M_LOG10E) / 2);
+ }
+ else if (absx < 1
+ && absx >= M_LIT (0.5)
+ && scale == 0
+ && absx * absx + absy * absy >= M_LIT (0.5))
+ {
+ FLOAT d2m1 = M_SUF (__x2y2m1) (absx, absy);
+ __real__ result = M_LOG1P (d2m1) * ((FLOAT) M_MLIT (M_LOG10E) / 2);
+ }
+ else
+ {
+ FLOAT d = M_HYPOT (absx, absy);
+ __real__ result = M_SUF (__ieee754_log10) (d) - scale * LOG10_2;
+ }
+
+ __imag__ result = M_MLIT (M_LOG10E) * M_ATAN2 (__imag__ x, __real__ x);
+ }
+ else
+ {
+ __imag__ result = M_NAN;
+ if (rcls == FP_INFINITE || icls == FP_INFINITE)
+ /* Real or imaginary part is infinite. */
+ __real__ result = M_HUGE_VAL;
+ else
+ __real__ result = M_NAN;
+ }
+
+ return result;
+}
+
+declare_mgen_alias (__clog10, clog10)
+
+#if M_LIBM_NEED_COMPAT (clog10)
+/* __clog10 is also a public symbol. */
+declare_mgen_libm_compat (__clog10, __clog10)
+declare_mgen_libm_compat (clog10, clog10)
+#endif
diff --git a/math/s_clog10f.c b/math/s_clog10f.c
deleted file mode 100644
index 485625e2bb..0000000000
--- a/math/s_clog10f.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Compute complex base 10 logarithm.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* log_10 (2). */
-#define M_LOG10_2f 0.3010299956639811952137388947244930267682f
-
-/* pi * log10 (e). */
-#define M_PI_LOG10Ef 1.364376353841841347485783625431355770210f
-
-__complex__ float
-__clog10f (__complex__ float x)
-{
- __complex__ float result;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- /* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI_LOG10Ef : 0.0;
- __imag__ result = __copysignf (__imag__ result, __imag__ x);
- /* Yes, the following line raises an exception. */
- __real__ result = -1.0 / fabsf (__real__ x);
- }
- else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
- {
- /* Neither real nor imaginary part is NaN. */
- float absx = fabsf (__real__ x), absy = fabsf (__imag__ x);
- int scale = 0;
-
- if (absx < absy)
- {
- float t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absx > FLT_MAX / 2.0f)
- {
- scale = -1;
- absx = __scalbnf (absx, scale);
- absy = (absy >= FLT_MIN * 2.0f ? __scalbnf (absy, scale) : 0.0f);
- }
- else if (absx < FLT_MIN && absy < FLT_MIN)
- {
- scale = FLT_MANT_DIG;
- absx = __scalbnf (absx, scale);
- absy = __scalbnf (absy, scale);
- }
-
- if (absx == 1.0f && scale == 0)
- {
- __real__ result = __log1pf (absy * absy) * ((float) M_LOG10E / 2.0f);
- math_check_force_underflow_nonneg (__real__ result);
- }
- else if (absx > 1.0f && absx < 2.0f && absy < 1.0f && scale == 0)
- {
- float d2m1 = (absx - 1.0f) * (absx + 1.0f);
- if (absy >= FLT_EPSILON)
- d2m1 += absy * absy;
- __real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
- }
- else if (absx < 1.0f
- && absx >= 0.5f
- && absy < FLT_EPSILON / 2.0f
- && scale == 0)
- {
- float d2m1 = (absx - 1.0f) * (absx + 1.0f);
- __real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
- }
- else if (absx < 1.0f
- && absx >= 0.5f
- && scale == 0
- && absx * absx + absy * absy >= 0.5f)
- {
- float d2m1 = __x2y2m1f (absx, absy);
- __real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
- }
- else
- {
- float d = __ieee754_hypotf (absx, absy);
- __real__ result = __ieee754_log10f (d) - scale * M_LOG10_2f;
- }
-
- __imag__ result = M_LOG10E * __ieee754_atan2f (__imag__ x, __real__ x);
- }
- else
- {
- __imag__ result = __nanf ("");
- if (rcls == FP_INFINITE || icls == FP_INFINITE)
- /* Real or imaginary part is infinite. */
- __real__ result = HUGE_VALF;
- else
- __real__ result = __nanf ("");
- }
-
- return result;
-}
-#ifndef __clog10f
-weak_alias (__clog10f, clog10f)
-#endif
diff --git a/math/s_clog10l.c b/math/s_clog10l.c
deleted file mode 100644
index da40477a80..0000000000
--- a/math/s_clog10l.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Compute complex base 10 logarithm.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* To avoid spurious underflows, use this definition to treat IBM long
- double as approximating an IEEE-style format. */
-#if LDBL_MANT_DIG == 106
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 0x1p-106L
-#endif
-
-/* log_10 (2). */
-#define M_LOG10_2l 0.3010299956639811952137388947244930267682L
-
-/* pi * log10 (e). */
-#define M_PI_LOG10El 1.364376353841841347485783625431355770210L
-
-__complex__ long double
-__clog10l (__complex__ long double x)
-{
- __complex__ long double result;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- /* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI_LOG10El : 0.0;
- __imag__ result = __copysignl (__imag__ result, __imag__ x);
- /* Yes, the following line raises an exception. */
- __real__ result = -1.0 / fabsl (__real__ x);
- }
- else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
- {
- /* Neither real nor imaginary part is NaN. */
- long double absx = fabsl (__real__ x), absy = fabsl (__imag__ x);
- int scale = 0;
-
- if (absx < absy)
- {
- long double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absx > LDBL_MAX / 2.0L)
- {
- scale = -1;
- absx = __scalbnl (absx, scale);
- absy = (absy >= LDBL_MIN * 2.0L ? __scalbnl (absy, scale) : 0.0L);
- }
- else if (absx < LDBL_MIN && absy < LDBL_MIN)
- {
- scale = LDBL_MANT_DIG;
- absx = __scalbnl (absx, scale);
- absy = __scalbnl (absy, scale);
- }
-
- if (absx == 1.0L && scale == 0)
- {
- __real__ result = __log1pl (absy * absy) * (M_LOG10El / 2.0L);
- math_check_force_underflow_nonneg (__real__ result);
- }
- else if (absx > 1.0L && absx < 2.0L && absy < 1.0L && scale == 0)
- {
- long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
- if (absy >= LDBL_EPSILON)
- d2m1 += absy * absy;
- __real__ result = __log1pl (d2m1) * (M_LOG10El / 2.0L);
- }
- else if (absx < 1.0L
- && absx >= 0.5L
- && absy < LDBL_EPSILON / 2.0L
- && scale == 0)
- {
- long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
- __real__ result = __log1pl (d2m1) * (M_LOG10El / 2.0L);
- }
- else if (absx < 1.0L
- && absx >= 0.5L
- && scale == 0
- && absx * absx + absy * absy >= 0.5L)
- {
- long double d2m1 = __x2y2m1l (absx, absy);
- __real__ result = __log1pl (d2m1) * (M_LOG10El / 2.0L);
- }
- else
- {
- long double d = __ieee754_hypotl (absx, absy);
- __real__ result = __ieee754_log10l (d) - scale * M_LOG10_2l;
- }
-
- __imag__ result = M_LOG10El * __ieee754_atan2l (__imag__ x, __real__ x);
- }
- else
- {
- __imag__ result = __nanl ("");
- if (rcls == FP_INFINITE || icls == FP_INFINITE)
- /* Real or imaginary part is infinite. */
- __real__ result = HUGE_VALL;
- else
- __real__ result = __nanl ("");
- }
-
- return result;
-}
-weak_alias (__clog10l, clog10l)
diff --git a/math/s_clogf.c b/math/s_clog_template.c
index cc565398e6..047ac03cd9 100644
--- a/math/s_clogf.c
+++ b/math/s_clog_template.c
@@ -22,95 +22,98 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__clogf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__clog) (CFLOAT x)
{
- __complex__ float result;
+ CFLOAT result;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
{
/* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
- __imag__ result = __copysignf (__imag__ result, __imag__ x);
+ __imag__ result = signbit (__real__ x) ? (FLOAT) M_MLIT (M_PI) : 0;
+ __imag__ result = M_COPYSIGN (__imag__ result, __imag__ x);
/* Yes, the following line raises an exception. */
- __real__ result = -1.0 / fabsf (__real__ x);
+ __real__ result = -1 / M_FABS (__real__ x);
}
else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
{
/* Neither real nor imaginary part is NaN. */
- float absx = fabsf (__real__ x), absy = fabsf (__imag__ x);
+ FLOAT absx = M_FABS (__real__ x), absy = M_FABS (__imag__ x);
int scale = 0;
if (absx < absy)
{
- float t = absx;
+ FLOAT t = absx;
absx = absy;
absy = t;
}
- if (absx > FLT_MAX / 2.0f)
+ if (absx > M_MAX / 2)
{
scale = -1;
- absx = __scalbnf (absx, scale);
- absy = (absy >= FLT_MIN * 2.0f ? __scalbnf (absy, scale) : 0.0f);
+ absx = M_SCALBN (absx, scale);
+ absy = (absy >= M_MIN * 2 ? M_SCALBN (absy, scale) : 0);
}
- else if (absx < FLT_MIN && absy < FLT_MIN)
+ else if (absx < M_MIN && absy < M_MIN)
{
- scale = FLT_MANT_DIG;
- absx = __scalbnf (absx, scale);
- absy = __scalbnf (absy, scale);
+ scale = M_MANT_DIG;
+ absx = M_SCALBN (absx, scale);
+ absy = M_SCALBN (absy, scale);
}
- if (absx == 1.0f && scale == 0)
+ if (absx == 1 && scale == 0)
{
- __real__ result = __log1pf (absy * absy) / 2.0f;
+ __real__ result = M_LOG1P (absy * absy) / 2;
math_check_force_underflow_nonneg (__real__ result);
}
- else if (absx > 1.0f && absx < 2.0f && absy < 1.0f && scale == 0)
+ else if (absx > 1 && absx < 2 && absy < 1 && scale == 0)
{
- float d2m1 = (absx - 1.0f) * (absx + 1.0f);
- if (absy >= FLT_EPSILON)
+ FLOAT d2m1 = (absx - 1) * (absx + 1);
+ if (absy >= M_EPSILON)
d2m1 += absy * absy;
- __real__ result = __log1pf (d2m1) / 2.0f;
+ __real__ result = M_LOG1P (d2m1) / 2;
}
- else if (absx < 1.0f
- && absx >= 0.5f
- && absy < FLT_EPSILON / 2.0f
+ else if (absx < 1
+ && absx >= M_LIT (0.5)
+ && absy < M_EPSILON / 2
&& scale == 0)
{
- float d2m1 = (absx - 1.0f) * (absx + 1.0f);
- __real__ result = __log1pf (d2m1) / 2.0f;
+ FLOAT d2m1 = (absx - 1) * (absx + 1);
+ __real__ result = M_LOG1P (d2m1) / 2;
}
- else if (absx < 1.0f
- && absx >= 0.5f
+ else if (absx < 1
+ && absx >= M_LIT (0.5)
&& scale == 0
- && absx * absx + absy * absy >= 0.5f)
+ && absx * absx + absy * absy >= M_LIT (0.5))
{
- float d2m1 = __x2y2m1f (absx, absy);
- __real__ result = __log1pf (d2m1) / 2.0f;
+ FLOAT d2m1 = M_SUF (__x2y2m1) (absx, absy);
+ __real__ result = M_LOG1P (d2m1) / 2;
}
else
{
- float d = __ieee754_hypotf (absx, absy);
- __real__ result = __ieee754_logf (d) - scale * (float) M_LN2;
+ FLOAT d = M_HYPOT (absx, absy);
+ __real__ result = M_LOG (d) - scale * (FLOAT) M_MLIT (M_LN2);
}
- __imag__ result = __ieee754_atan2f (__imag__ x, __real__ x);
+ __imag__ result = M_ATAN2 (__imag__ x, __real__ x);
}
else
{
- __imag__ result = __nanf ("");
+ __imag__ result = M_NAN;
if (rcls == FP_INFINITE || icls == FP_INFINITE)
/* Real or imaginary part is infinite. */
- __real__ result = HUGE_VALF;
+ __real__ result = M_HUGE_VAL;
else
- __real__ result = __nanf ("");
+ __real__ result = M_NAN;
}
return result;
}
-#ifndef __clogf
-weak_alias (__clogf, clogf)
+
+declare_mgen_alias (__clog, clog)
+
+#if M_LIBM_NEED_COMPAT (clog)
+declare_mgen_libm_compat (__clog, clog)
#endif
diff --git a/math/s_clogl.c b/math/s_clogl.c
deleted file mode 100644
index 6db59b722f..0000000000
--- a/math/s_clogl.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Compute complex natural logarithm.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* To avoid spurious underflows, use this definition to treat IBM long
- double as approximating an IEEE-style format. */
-#if LDBL_MANT_DIG == 106
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 0x1p-106L
-#endif
-
-__complex__ long double
-__clogl (__complex__ long double x)
-{
- __complex__ long double result;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO))
- {
- /* Real and imaginary part are 0.0. */
- __imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
- __imag__ result = __copysignl (__imag__ result, __imag__ x);
- /* Yes, the following line raises an exception. */
- __real__ result = -1.0 / fabsl (__real__ x);
- }
- else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN))
- {
- /* Neither real nor imaginary part is NaN. */
- long double absx = fabsl (__real__ x), absy = fabsl (__imag__ x);
- int scale = 0;
-
- if (absx < absy)
- {
- long double t = absx;
- absx = absy;
- absy = t;
- }
-
- if (absx > LDBL_MAX / 2.0L)
- {
- scale = -1;
- absx = __scalbnl (absx, scale);
- absy = (absy >= LDBL_MIN * 2.0L ? __scalbnl (absy, scale) : 0.0L);
- }
- else if (absx < LDBL_MIN && absy < LDBL_MIN)
- {
- scale = LDBL_MANT_DIG;
- absx = __scalbnl (absx, scale);
- absy = __scalbnl (absy, scale);
- }
-
- if (absx == 1.0L && scale == 0)
- {
- __real__ result = __log1pl (absy * absy) / 2.0L;
- math_check_force_underflow_nonneg (__real__ result);
- }
- else if (absx > 1.0L && absx < 2.0L && absy < 1.0L && scale == 0)
- {
- long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
- if (absy >= LDBL_EPSILON)
- d2m1 += absy * absy;
- __real__ result = __log1pl (d2m1) / 2.0L;
- }
- else if (absx < 1.0L
- && absx >= 0.5L
- && absy < LDBL_EPSILON / 2.0L
- && scale == 0)
- {
- long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
- __real__ result = __log1pl (d2m1) / 2.0L;
- }
- else if (absx < 1.0L
- && absx >= 0.5L
- && scale == 0
- && absx * absx + absy * absy >= 0.5L)
- {
- long double d2m1 = __x2y2m1l (absx, absy);
- __real__ result = __log1pl (d2m1) / 2.0L;
- }
- else
- {
- long double d = __ieee754_hypotl (absx, absy);
- __real__ result = __ieee754_logl (d) - scale * M_LN2l;
- }
-
- __imag__ result = __ieee754_atan2l (__imag__ x, __real__ x);
- }
- else
- {
- __imag__ result = __nanl ("");
- if (rcls == FP_INFINITE || icls == FP_INFINITE)
- /* Real or imaginary part is infinite. */
- __real__ result = HUGE_VALL;
- else
- __real__ result = __nanl ("");
- }
-
- return result;
-}
-weak_alias (__clogl, clogl)
diff --git a/math/s_cpowf.c b/math/s_cpow_template.c
index 2b0b5b26c5..12dfc92c23 100644
--- a/math/s_cpowf.c
+++ b/math/s_cpow_template.c
@@ -1,4 +1,4 @@
-/* Complex power of float values.
+/* Complex power of float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,12 +20,14 @@
#include <complex.h>
#include <math.h>
-
-__complex__ float
-__cpowf (__complex__ float x, __complex__ float c)
+CFLOAT
+M_DECL_FUNC (__cpow) (CFLOAT x, CFLOAT c)
{
- return __cexpf (c * __clogf (x));
+ return M_SUF (__cexp) (c * M_SUF (__clog) (x));
}
-#ifndef __cpowf
-weak_alias (__cpowf, cpowf)
+
+declare_mgen_alias (__cpow, cpow)
+
+#if M_LIBM_NEED_COMPAT (cpow)
+declare_mgen_libm_compat (__cpow, cpow)
#endif
diff --git a/math/s_cpowl.c b/math/s_cpowl.c
deleted file mode 100644
index 963e03a45c..0000000000
--- a/math/s_cpowl.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Complex power of long double values.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-
-
-__complex__ long double
-__cpowl (__complex__ long double x, __complex__ long double c)
-{
- return __cexpl (c * __clogl (x));
-}
-weak_alias (__cpowl, cpowl)
diff --git a/math/s_cprojf.c b/math/s_cproj_template.c
index 8a0d873fdc..e274e4cef5 100644
--- a/math/s_cprojf.c
+++ b/math/s_cproj_template.c
@@ -1,4 +1,4 @@
-/* Compute projection of complex float value to Riemann sphere.
+/* Compute projection of complex float type value to Riemann sphere.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,21 +22,24 @@
#include <math_private.h>
-__complex__ float
-__cprojf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__cproj) (CFLOAT x)
{
if (isinf (__real__ x) || isinf (__imag__ x))
{
- __complex__ float res;
+ CFLOAT res;
__real__ res = INFINITY;
- __imag__ res = __copysignf (0.0, __imag__ x);
+ __imag__ res = M_COPYSIGN (0, __imag__ x);
return res;
}
return x;
}
-#ifndef __cprojf
-weak_alias (__cprojf, cprojf)
+
+declare_mgen_alias (__cproj, cproj)
+
+#if M_LIBM_NEED_COMPAT (cproj)
+declare_mgen_libm_compat (__cproj, cproj)
#endif
diff --git a/math/s_cprojl.c b/math/s_cprojl.c
deleted file mode 100644
index 213b73331a..0000000000
--- a/math/s_cprojl.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Compute projection of complex long double value to Riemann sphere.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-
-
-__complex__ long double
-__cprojl (__complex__ long double x)
-{
- if (isinf (__real__ x) || isinf (__imag__ x))
- {
- __complex__ long double res;
-
- __real__ res = INFINITY;
- __imag__ res = __copysignl (0.0, __imag__ x);
-
- return res;
- }
-
- return x;
-}
-weak_alias (__cprojl, cprojl)
diff --git a/math/s_csin.c b/math/s_csin.c
deleted file mode 100644
index e071aa650e..0000000000
--- a/math/s_csin.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* Complex sine function for double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__csin (__complex__ double x)
-{
- __complex__ double retval;
- int negate = signbit (__real__ x);
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- __real__ x = fabs (__real__ x);
-
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
- double sinix, cosix;
-
- if (__glibc_likely (__real__ x > DBL_MIN))
- {
- __sincos (__real__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __real__ x;
- cosix = 1.0;
- }
-
- if (negate)
- sinix = -sinix;
-
- if (fabs (__imag__ x) > t)
- {
- double exp_t = __ieee754_exp (t);
- double ix = fabs (__imag__ x);
- if (signbit (__imag__ x))
- cosix = -cosix;
- ix -= t;
- sinix *= exp_t / 2.0;
- cosix *= exp_t / 2.0;
- if (ix > t)
- {
- ix -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- if (ix > t)
- {
- /* Overflow (original imaginary part of x > 3t). */
- __real__ retval = DBL_MAX * sinix;
- __imag__ retval = DBL_MAX * cosix;
- }
- else
- {
- double exp_val = __ieee754_exp (ix);
- __real__ retval = exp_val * sinix;
- __imag__ retval = exp_val * cosix;
- }
- }
- else
- {
- __real__ retval = __ieee754_cosh (__imag__ x) * sinix;
- __imag__ retval = __ieee754_sinh (__imag__ x) * cosix;
- }
-
- math_check_force_underflow_complex (retval);
- }
- else
- {
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = __nan ("");
- __imag__ retval = __imag__ x;
-
- if (rcls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- else
- {
- __real__ retval = __nan ("");
- __imag__ retval = __nan ("");
-
- feraiseexcept (FE_INVALID);
- }
- }
- }
- else if (icls == FP_INFINITE)
- {
- /* Imaginary part is infinite. */
- if (rcls == FP_ZERO)
- {
- /* Real part is 0.0. */
- __real__ retval = __copysign (0.0, negate ? -1.0 : 1.0);
- __imag__ retval = __imag__ x;
- }
- else if (rcls > FP_ZERO)
- {
- /* Real part is finite. */
- double sinix, cosix;
-
- if (__glibc_likely (__real__ x > DBL_MIN))
- {
- __sincos (__real__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __real__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysign (HUGE_VAL, sinix);
- __imag__ retval = __copysign (HUGE_VAL, cosix);
-
- if (negate)
- __real__ retval = -__real__ retval;
- if (signbit (__imag__ x))
- __imag__ retval = -__imag__ retval;
- }
- else
- {
- /* The addition raises the invalid exception. */
- __real__ retval = __nan ("");
- __imag__ retval = HUGE_VAL;
-
- if (rcls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- if (rcls == FP_ZERO)
- __real__ retval = __copysign (0.0, negate ? -1.0 : 1.0);
- else
- __real__ retval = __nan ("");
- __imag__ retval = __nan ("");
- }
-
- return retval;
-}
-weak_alias (__csin, csin)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__csin, __csinl)
-weak_alias (__csin, csinl)
-#endif
diff --git a/math/s_csinf.c b/math/s_csin_template.c
index 1256abcb85..2fe0b157cb 100644
--- a/math/s_csinf.c
+++ b/math/s_csin_template.c
@@ -1,4 +1,4 @@
-/* Complex sine function for float.
+/* Complex sine function for float types.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,15 +23,15 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__csinf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__csin) (CFLOAT x)
{
- __complex__ float retval;
+ CFLOAT retval;
int negate = signbit (__real__ x);
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- __real__ x = fabsf (__real__ x);
+ __real__ x = M_FABS (__real__ x);
if (__glibc_likely (icls >= FP_ZERO))
{
@@ -39,31 +39,31 @@ __csinf (__complex__ float x)
if (__glibc_likely (rcls >= FP_ZERO))
{
/* Real part is finite. */
- const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
- float sinix, cosix;
+ const int t = (int) ((M_MAX_EXP - 1) * M_MLIT (M_LN2));
+ FLOAT sinix, cosix;
- if (__glibc_likely (__real__ x > FLT_MIN))
+ if (__glibc_likely (__real__ x > M_MIN))
{
- __sincosf (__real__ x, &sinix, &cosix);
+ M_SINCOS (__real__ x, &sinix, &cosix);
}
else
{
sinix = __real__ x;
- cosix = 1.0f;
+ cosix = 1;
}
if (negate)
sinix = -sinix;
- if (fabsf (__imag__ x) > t)
+ if (M_FABS (__imag__ x) > t)
{
- float exp_t = __ieee754_expf (t);
- float ix = fabsf (__imag__ x);
+ FLOAT exp_t = M_EXP (t);
+ FLOAT ix = M_FABS (__imag__ x);
if (signbit (__imag__ x))
cosix = -cosix;
ix -= t;
- sinix *= exp_t / 2.0f;
- cosix *= exp_t / 2.0f;
+ sinix *= exp_t / 2;
+ cosix *= exp_t / 2;
if (ix > t)
{
ix -= t;
@@ -73,20 +73,20 @@ __csinf (__complex__ float x)
if (ix > t)
{
/* Overflow (original imaginary part of x > 3t). */
- __real__ retval = FLT_MAX * sinix;
- __imag__ retval = FLT_MAX * cosix;
+ __real__ retval = M_MAX * sinix;
+ __imag__ retval = M_MAX * cosix;
}
else
{
- float exp_val = __ieee754_expf (ix);
+ FLOAT exp_val = M_EXP (ix);
__real__ retval = exp_val * sinix;
__imag__ retval = exp_val * cosix;
}
}
else
{
- __real__ retval = __ieee754_coshf (__imag__ x) * sinix;
- __imag__ retval = __ieee754_sinhf (__imag__ x) * cosix;
+ __real__ retval = M_COSH (__imag__ x) * sinix;
+ __imag__ retval = M_SINH (__imag__ x) * cosix;
}
math_check_force_underflow_complex (retval);
@@ -96,16 +96,13 @@ __csinf (__complex__ float x)
if (icls == FP_ZERO)
{
/* Imaginary part is 0.0. */
- __real__ retval = __nanf ("");
+ __real__ retval = __real__ x - __real__ x;
__imag__ retval = __imag__ x;
-
- if (rcls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
}
else
{
- __real__ retval = __nanf ("");
- __imag__ retval = __nanf ("");
+ __real__ retval = M_NAN;
+ __imag__ retval = M_NAN;
feraiseexcept (FE_INVALID);
}
@@ -117,26 +114,26 @@ __csinf (__complex__ float x)
if (rcls == FP_ZERO)
{
/* Real part is 0.0. */
- __real__ retval = __copysignf (0.0, negate ? -1.0 : 1.0);
+ __real__ retval = M_COPYSIGN (0, negate ? -1 : 1);
__imag__ retval = __imag__ x;
}
else if (rcls > FP_ZERO)
{
/* Real part is finite. */
- float sinix, cosix;
+ FLOAT sinix, cosix;
- if (__glibc_likely (__real__ x > FLT_MIN))
+ if (__glibc_likely (__real__ x > M_MIN))
{
- __sincosf (__real__ x, &sinix, &cosix);
+ M_SINCOS (__real__ x, &sinix, &cosix);
}
else
{
sinix = __real__ x;
- cosix = 1.0f;
+ cosix = 1;
}
- __real__ retval = __copysignf (HUGE_VALF, sinix);
- __imag__ retval = __copysignf (HUGE_VALF, cosix);
+ __real__ retval = M_COPYSIGN (M_HUGE_VAL, sinix);
+ __imag__ retval = M_COPYSIGN (M_HUGE_VAL, cosix);
if (negate)
__real__ retval = -__real__ retval;
@@ -145,25 +142,24 @@ __csinf (__complex__ float x)
}
else
{
- /* The addition raises the invalid exception. */
- __real__ retval = __nanf ("");
- __imag__ retval = HUGE_VALF;
-
- if (rcls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
+ __real__ retval = __real__ x - __real__ x;
+ __imag__ retval = M_HUGE_VAL;
}
}
else
{
if (rcls == FP_ZERO)
- __real__ retval = __copysignf (0.0, negate ? -1.0 : 1.0);
+ __real__ retval = M_COPYSIGN (0, negate ? -1 : 1);
else
- __real__ retval = __nanf ("");
- __imag__ retval = __nanf ("");
+ __real__ retval = M_NAN;
+ __imag__ retval = M_NAN;
}
return retval;
}
-#ifndef __csinf
-weak_alias (__csinf, csinf)
+
+declare_mgen_alias (__csin, csin)
+
+#if M_LIBM_NEED_COMPAT (csin)
+declare_mgen_libm_compat (__csin, csin)
#endif
diff --git a/math/s_csinh.c b/math/s_csinh.c
deleted file mode 100644
index 5fb60ed0cb..0000000000
--- a/math/s_csinh.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* Complex sine hyperbole function for double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__csinh (__complex__ double x)
-{
- __complex__ double retval;
- int negate = signbit (__real__ x);
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- __real__ x = fabs (__real__ x);
-
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2);
- double sinix, cosix;
-
- if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
- {
- __sincos (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (negate)
- cosix = -cosix;
-
- if (fabs (__real__ x) > t)
- {
- double exp_t = __ieee754_exp (t);
- double rx = fabs (__real__ x);
- if (signbit (__real__ x))
- cosix = -cosix;
- rx -= t;
- sinix *= exp_t / 2.0;
- cosix *= exp_t / 2.0;
- if (rx > t)
- {
- rx -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- if (rx > t)
- {
- /* Overflow (original real part of x > 3t). */
- __real__ retval = DBL_MAX * cosix;
- __imag__ retval = DBL_MAX * sinix;
- }
- else
- {
- double exp_val = __ieee754_exp (rx);
- __real__ retval = exp_val * cosix;
- __imag__ retval = exp_val * sinix;
- }
- }
- else
- {
- __real__ retval = __ieee754_sinh (__real__ x) * cosix;
- __imag__ retval = __ieee754_cosh (__real__ x) * sinix;
- }
-
- math_check_force_underflow_complex (retval);
- }
- else
- {
- if (rcls == FP_ZERO)
- {
- /* Real part is 0.0. */
- __real__ retval = __copysign (0.0, negate ? -1.0 : 1.0);
- __imag__ retval = __nan ("") + __nan ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- else
- {
- __real__ retval = __nan ("");
- __imag__ retval = __nan ("");
-
- feraiseexcept (FE_INVALID);
- }
- }
- }
- else if (rcls == FP_INFINITE)
- {
- /* Real part is infinite. */
- if (__glibc_likely (icls > FP_ZERO))
- {
- /* Imaginary part is finite. */
- double sinix, cosix;
-
- if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
- {
- __sincos (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysign (HUGE_VAL, cosix);
- __imag__ retval = __copysign (HUGE_VAL, sinix);
-
- 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 ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- __real__ retval = __nan ("");
- __imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nan ("");
- }
-
- return retval;
-}
-weak_alias (__csinh, csinh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__csinh, __csinhl)
-weak_alias (__csinh, csinhl)
-#endif
diff --git a/math/s_csinhf.c b/math/s_csinh_template.c
index 36b42ca465..e5fd4d5857 100644
--- a/math/s_csinhf.c
+++ b/math/s_csinh_template.c
@@ -1,4 +1,4 @@
-/* Complex sine hyperbole function for float.
+/* Complex sine hyperbole function for float types.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,15 +23,15 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__csinhf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__csinh) (CFLOAT x)
{
- __complex__ float retval;
+ CFLOAT retval;
int negate = signbit (__real__ x);
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
- __real__ x = fabsf (__real__ x);
+ __real__ x = M_FABS (__real__ x);
if (__glibc_likely (rcls >= FP_ZERO))
{
@@ -39,31 +39,31 @@ __csinhf (__complex__ float x)
if (__glibc_likely (icls >= FP_ZERO))
{
/* Imaginary part is finite. */
- const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2);
- float sinix, cosix;
+ const int t = (int) ((M_MAX_EXP - 1) * M_MLIT (M_LN2));
+ FLOAT sinix, cosix;
- if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
{
- __sincosf (__imag__ x, &sinix, &cosix);
+ M_SINCOS (__imag__ x, &sinix, &cosix);
}
else
{
sinix = __imag__ x;
- cosix = 1.0f;
+ cosix = 1;
}
if (negate)
cosix = -cosix;
- if (fabsf (__real__ x) > t)
+ if (M_FABS (__real__ x) > t)
{
- float exp_t = __ieee754_expf (t);
- float rx = fabsf (__real__ x);
+ FLOAT exp_t = M_EXP (t);
+ FLOAT rx = M_FABS (__real__ x);
if (signbit (__real__ x))
cosix = -cosix;
rx -= t;
- sinix *= exp_t / 2.0f;
- cosix *= exp_t / 2.0f;
+ sinix *= exp_t / 2;
+ cosix *= exp_t / 2;
if (rx > t)
{
rx -= t;
@@ -73,20 +73,20 @@ __csinhf (__complex__ float x)
if (rx > t)
{
/* Overflow (original real part of x > 3t). */
- __real__ retval = FLT_MAX * cosix;
- __imag__ retval = FLT_MAX * sinix;
+ __real__ retval = M_MAX * cosix;
+ __imag__ retval = M_MAX * sinix;
}
else
{
- float exp_val = __ieee754_expf (rx);
+ FLOAT exp_val = M_EXP (rx);
__real__ retval = exp_val * cosix;
__imag__ retval = exp_val * sinix;
}
}
else
{
- __real__ retval = __ieee754_sinhf (__real__ x) * cosix;
- __imag__ retval = __ieee754_coshf (__real__ x) * sinix;
+ __real__ retval = M_SINH (__real__ x) * cosix;
+ __imag__ retval = M_COSH (__real__ x) * sinix;
}
math_check_force_underflow_complex (retval);
@@ -96,16 +96,13 @@ __csinhf (__complex__ float x)
if (rcls == FP_ZERO)
{
/* Real part is 0.0. */
- __real__ retval = __copysignf (0.0, negate ? -1.0 : 1.0);
- __imag__ retval = __nanf ("") + __nanf ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
+ __real__ retval = M_COPYSIGN (0, negate ? -1 : 1);
+ __imag__ retval = __imag__ x - __imag__ x;
}
else
{
- __real__ retval = __nanf ("");
- __imag__ retval = __nanf ("");
+ __real__ retval = M_NAN;
+ __imag__ retval = M_NAN;
feraiseexcept (FE_INVALID);
}
@@ -117,20 +114,20 @@ __csinhf (__complex__ float x)
if (__glibc_likely (icls > FP_ZERO))
{
/* Imaginary part is finite. */
- float sinix, cosix;
+ FLOAT sinix, cosix;
- if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
{
- __sincosf (__imag__ x, &sinix, &cosix);
+ M_SINCOS (__imag__ x, &sinix, &cosix);
}
else
{
sinix = __imag__ x;
- cosix = 1.0f;
+ cosix = 1;
}
- __real__ retval = __copysignf (HUGE_VALF, cosix);
- __imag__ retval = __copysignf (HUGE_VALF, sinix);
+ __real__ retval = M_COPYSIGN (M_HUGE_VAL, cosix);
+ __imag__ retval = M_COPYSIGN (M_HUGE_VAL, sinix);
if (negate)
__real__ retval = -__real__ retval;
@@ -138,27 +135,26 @@ __csinhf (__complex__ float x)
else if (icls == FP_ZERO)
{
/* Imaginary part is 0.0. */
- __real__ retval = negate ? -HUGE_VALF : HUGE_VALF;
+ __real__ retval = negate ? -M_HUGE_VAL : M_HUGE_VAL;
__imag__ retval = __imag__ x;
}
else
{
- /* The addition raises the invalid exception. */
- __real__ retval = HUGE_VALF;
- __imag__ retval = __nanf ("") + __nanf ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
+ __real__ retval = M_HUGE_VAL;
+ __imag__ retval = __imag__ x - __imag__ x;
}
}
else
{
- __real__ retval = __nanf ("");
- __imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nanf ("");
+ __real__ retval = M_NAN;
+ __imag__ retval = __imag__ x == 0 ? __imag__ x : M_NAN;
}
return retval;
}
-#ifndef __csinhf
-weak_alias (__csinhf, csinhf)
+
+declare_mgen_alias (__csinh, csinh)
+
+#if M_LIBM_NEED_COMPAT (csinh)
+declare_mgen_libm_compat (__csinh, csinh)
#endif
diff --git a/math/s_csinhl.c b/math/s_csinhl.c
deleted file mode 100644
index c231d7b06f..0000000000
--- a/math/s_csinhl.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Complex sine hyperbole function for long double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ long double
-__csinhl (__complex__ long double x)
-{
- __complex__ long double retval;
- int negate = signbit (__real__ x);
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- __real__ x = fabsl (__real__ x);
-
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
- long double sinix, cosix;
-
- if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
- {
- __sincosl (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (negate)
- cosix = -cosix;
-
- if (fabsl (__real__ x) > t)
- {
- long double exp_t = __ieee754_expl (t);
- long double rx = fabsl (__real__ x);
- if (signbit (__real__ x))
- cosix = -cosix;
- rx -= t;
- sinix *= exp_t / 2.0L;
- cosix *= exp_t / 2.0L;
- if (rx > t)
- {
- rx -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- if (rx > t)
- {
- /* Overflow (original real part of x > 3t). */
- __real__ retval = LDBL_MAX * cosix;
- __imag__ retval = LDBL_MAX * sinix;
- }
- else
- {
- long double exp_val = __ieee754_expl (rx);
- __real__ retval = exp_val * cosix;
- __imag__ retval = exp_val * sinix;
- }
- }
- else
- {
- __real__ retval = __ieee754_sinhl (__real__ x) * cosix;
- __imag__ retval = __ieee754_coshl (__real__ x) * sinix;
- }
-
- math_check_force_underflow_complex (retval);
- }
- else
- {
- if (rcls == FP_ZERO)
- {
- /* Real part is 0.0. */
- __real__ retval = __copysignl (0.0, negate ? -1.0 : 1.0);
- __imag__ retval = __nanl ("") + __nanl ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- else
- {
- __real__ retval = __nanl ("");
- __imag__ retval = __nanl ("");
-
- feraiseexcept (FE_INVALID);
- }
- }
- }
- else if (rcls == FP_INFINITE)
- {
- /* Real part is infinite. */
- if (__glibc_likely (icls > FP_ZERO))
- {
- /* Imaginary part is finite. */
- long double sinix, cosix;
-
- if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
- {
- __sincosl (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysignl (HUGE_VALL, cosix);
- __imag__ retval = __copysignl (HUGE_VALL, sinix);
-
- 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. */
- __real__ retval = HUGE_VALL;
- __imag__ retval = __nanl ("") + __nanl ("");
-
- if (icls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- __real__ retval = __nanl ("");
- __imag__ retval = __imag__ x == 0.0 ? __imag__ x : __nanl ("");
- }
-
- return retval;
-}
-weak_alias (__csinhl, csinhl)
diff --git a/math/s_csinl.c b/math/s_csinl.c
deleted file mode 100644
index 9742a31723..0000000000
--- a/math/s_csinl.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Complex sine function for long double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ long double
-__csinl (__complex__ long double x)
-{
- __complex__ long double retval;
- int negate = signbit (__real__ x);
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- __real__ x = fabsl (__real__ x);
-
- if (__glibc_likely (icls >= FP_ZERO))
- {
- /* Imaginary part is finite. */
- if (__glibc_likely (rcls >= FP_ZERO))
- {
- /* Real part is finite. */
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l);
- long double sinix, cosix;
-
- if (__glibc_likely (__real__ x > LDBL_MIN))
- {
- __sincosl (__real__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __real__ x;
- cosix = 1.0;
- }
-
- if (negate)
- sinix = -sinix;
-
- if (fabsl (__imag__ x) > t)
- {
- long double exp_t = __ieee754_expl (t);
- long double ix = fabsl (__imag__ x);
- if (signbit (__imag__ x))
- cosix = -cosix;
- ix -= t;
- sinix *= exp_t / 2.0L;
- cosix *= exp_t / 2.0L;
- if (ix > t)
- {
- ix -= t;
- sinix *= exp_t;
- cosix *= exp_t;
- }
- if (ix > t)
- {
- /* Overflow (original imaginary part of x > 3t). */
- __real__ retval = LDBL_MAX * sinix;
- __imag__ retval = LDBL_MAX * cosix;
- }
- else
- {
- long double exp_val = __ieee754_expl (ix);
- __real__ retval = exp_val * sinix;
- __imag__ retval = exp_val * cosix;
- }
- }
- else
- {
- __real__ retval = __ieee754_coshl (__imag__ x) * sinix;
- __imag__ retval = __ieee754_sinhl (__imag__ x) * cosix;
- }
-
- math_check_force_underflow_complex (retval);
- }
- else
- {
- if (icls == FP_ZERO)
- {
- /* Imaginary part is 0.0. */
- __real__ retval = __nanl ("");
- __imag__ retval = __imag__ x;
-
- if (rcls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- else
- {
- __real__ retval = __nanl ("");
- __imag__ retval = __nanl ("");
-
- feraiseexcept (FE_INVALID);
- }
- }
- }
- else if (icls == FP_INFINITE)
- {
- /* Imaginary part is infinite. */
- if (rcls == FP_ZERO)
- {
- /* Real part is 0.0. */
- __real__ retval = __copysignl (0.0, negate ? -1.0 : 1.0);
- __imag__ retval = __imag__ x;
- }
- else if (rcls > FP_ZERO)
- {
- /* Real part is finite. */
- long double sinix, cosix;
-
- if (__glibc_likely (__real__ x > LDBL_MIN))
- {
- __sincosl (__real__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __real__ x;
- cosix = 1.0;
- }
-
- __real__ retval = __copysignl (HUGE_VALL, sinix);
- __imag__ retval = __copysignl (HUGE_VALL, cosix);
-
- if (negate)
- __real__ retval = -__real__ retval;
- if (signbit (__imag__ x))
- __imag__ retval = -__imag__ retval;
- }
- else
- {
- /* The addition raises the invalid exception. */
- __real__ retval = __nanl ("");
- __imag__ retval = HUGE_VALL;
-
- if (rcls == FP_INFINITE)
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- if (rcls == FP_ZERO)
- __real__ retval = __copysignl (0.0, negate ? -1.0 : 1.0);
- else
- __real__ retval = __nanl ("");
- __imag__ retval = __nanl ("");
- }
-
- return retval;
-}
-weak_alias (__csinl, csinl)
diff --git a/math/s_csqrt.c b/math/s_csqrt.c
deleted file mode 100644
index 1f073e7f17..0000000000
--- a/math/s_csqrt.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/* Complex square root of double value.
- Copyright (C) 1997-2016 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.
-
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__csqrt (__complex__ double x)
-{
- __complex__ double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = HUGE_VAL;
- __imag__ res = __imag__ x;
- }
- else if (rcls == FP_INFINITE)
- {
- if (__real__ x < 0.0)
- {
- __real__ res = icls == FP_NAN ? __nan ("") : 0;
- __imag__ res = __copysign (HUGE_VAL, __imag__ x);
- }
- else
- {
- __real__ res = __real__ x;
- __imag__ res = (icls == FP_NAN
- ? __nan ("") : __copysign (0.0, __imag__ x));
- }
- }
- else
- {
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
- }
- }
- else
- {
- if (__glibc_unlikely (icls == FP_ZERO))
- {
- if (__real__ x < 0.0)
- {
- __real__ res = 0.0;
- __imag__ res = __copysign (__ieee754_sqrt (-__real__ x),
- __imag__ x);
- }
- else
- {
- __real__ res = fabs (__ieee754_sqrt (__real__ x));
- __imag__ res = __copysign (0.0, __imag__ x);
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO))
- {
- double r;
- if (fabs (__imag__ x) >= 2.0 * DBL_MIN)
- r = __ieee754_sqrt (0.5 * fabs (__imag__ x));
- else
- r = 0.5 * __ieee754_sqrt (2.0 * fabs (__imag__ x));
-
- __real__ res = r;
- __imag__ res = __copysign (r, __imag__ x);
- }
- else
- {
- double d, r, s;
- int scale = 0;
-
- if (fabs (__real__ x) > DBL_MAX / 4.0)
- {
- scale = 1;
- __real__ x = __scalbn (__real__ x, -2 * scale);
- __imag__ x = __scalbn (__imag__ x, -2 * scale);
- }
- else if (fabs (__imag__ x) > DBL_MAX / 4.0)
- {
- scale = 1;
- if (fabs (__real__ x) >= 4.0 * DBL_MIN)
- __real__ x = __scalbn (__real__ x, -2 * scale);
- else
- __real__ x = 0.0;
- __imag__ x = __scalbn (__imag__ x, -2 * scale);
- }
- else if (fabs (__real__ x) < 2.0 * DBL_MIN
- && fabs (__imag__ x) < 2.0 * DBL_MIN)
- {
- scale = -((DBL_MANT_DIG + 1) / 2);
- __real__ x = __scalbn (__real__ x, -2 * scale);
- __imag__ x = __scalbn (__imag__ x, -2 * scale);
- }
-
- d = __ieee754_hypot (__real__ x, __imag__ x);
- /* Use the identity 2 Re res Im res = Im x
- to avoid cancellation error in d +/- Re x. */
- if (__real__ x > 0)
- {
- r = __ieee754_sqrt (0.5 * (d + __real__ x));
- if (scale == 1 && fabs (__imag__ x) < 1.0)
- {
- /* Avoid possible intermediate underflow. */
- s = __imag__ x / r;
- r = __scalbn (r, scale);
- scale = 0;
- }
- else
- s = 0.5 * (__imag__ x / r);
- }
- else
- {
- s = __ieee754_sqrt (0.5 * (d - __real__ x));
- if (scale == 1 && fabs (__imag__ x) < 1.0)
- {
- /* Avoid possible intermediate underflow. */
- r = fabs (__imag__ x / s);
- s = __scalbn (s, scale);
- scale = 0;
- }
- else
- r = fabs (0.5 * (__imag__ x / s));
- }
-
- if (scale)
- {
- r = __scalbn (r, scale);
- s = __scalbn (s, scale);
- }
-
- math_check_force_underflow (r);
- math_check_force_underflow (s);
-
- __real__ res = r;
- __imag__ res = __copysign (s, __imag__ x);
- }
- }
-
- return res;
-}
-weak_alias (__csqrt, csqrt)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__csqrt, __csqrtl)
-weak_alias (__csqrt, csqrtl)
-#endif
diff --git a/math/s_csqrtf.c b/math/s_csqrt_template.c
index b30af06e08..22af083af7 100644
--- a/math/s_csqrtf.c
+++ b/math/s_csqrt_template.c
@@ -1,4 +1,4 @@
-/* Complex square root of float value.
+/* Complex square root of a float type.
Copyright (C) 1997-2016 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>.
@@ -23,10 +23,10 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__csqrtf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__csqrt) (CFLOAT x)
{
- __complex__ float res;
+ CFLOAT res;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
@@ -34,130 +34,131 @@ __csqrtf (__complex__ float x)
{
if (icls == FP_INFINITE)
{
- __real__ res = HUGE_VALF;
+ __real__ res = M_HUGE_VAL;
__imag__ res = __imag__ x;
}
else if (rcls == FP_INFINITE)
{
- if (__real__ x < 0.0)
+ if (__real__ x < 0)
{
- __real__ res = icls == FP_NAN ? __nanf ("") : 0;
- __imag__ res = __copysignf (HUGE_VALF, __imag__ x);
+ __real__ res = icls == FP_NAN ? M_NAN : 0;
+ __imag__ res = M_COPYSIGN (M_HUGE_VAL, __imag__ x);
}
else
{
__real__ res = __real__ x;
__imag__ res = (icls == FP_NAN
- ? __nanf ("") : __copysignf (0.0, __imag__ x));
+ ? M_NAN : M_COPYSIGN (0, __imag__ x));
}
}
else
{
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
}
}
else
{
if (__glibc_unlikely (icls == FP_ZERO))
{
- if (__real__ x < 0.0)
+ if (__real__ x < 0)
{
- __real__ res = 0.0;
- __imag__ res = __copysignf (__ieee754_sqrtf (-__real__ x),
- __imag__ x);
+ __real__ res = 0;
+ __imag__ res = M_COPYSIGN (M_SQRT (-__real__ x), __imag__ x);
}
else
{
- __real__ res = fabsf (__ieee754_sqrtf (__real__ x));
- __imag__ res = __copysignf (0.0, __imag__ x);
+ __real__ res = M_FABS (M_SQRT (__real__ x));
+ __imag__ res = M_COPYSIGN (0, __imag__ x);
}
}
else if (__glibc_unlikely (rcls == FP_ZERO))
{
- float r;
- if (fabsf (__imag__ x) >= 2.0f * FLT_MIN)
- r = __ieee754_sqrtf (0.5f * fabsf (__imag__ x));
+ FLOAT r;
+ if (M_FABS (__imag__ x) >= 2 * M_MIN)
+ r = M_SQRT (M_LIT (0.5) * M_FABS (__imag__ x));
else
- r = 0.5f * __ieee754_sqrtf (2.0f * fabsf (__imag__ x));
+ r = M_LIT (0.5) * M_SQRT (2 * M_FABS (__imag__ x));
__real__ res = r;
- __imag__ res = __copysignf (r, __imag__ x);
+ __imag__ res = M_COPYSIGN (r, __imag__ x);
}
else
{
- float d, r, s;
+ FLOAT d, r, s;
int scale = 0;
- if (fabsf (__real__ x) > FLT_MAX / 4.0f)
+ if (M_FABS (__real__ x) > M_MAX / 4)
{
scale = 1;
- __real__ x = __scalbnf (__real__ x, -2 * scale);
- __imag__ x = __scalbnf (__imag__ x, -2 * scale);
+ __real__ x = M_SCALBN (__real__ x, -2 * scale);
+ __imag__ x = M_SCALBN (__imag__ x, -2 * scale);
}
- else if (fabsf (__imag__ x) > FLT_MAX / 4.0f)
+ else if (M_FABS (__imag__ x) > M_MAX / 4)
{
scale = 1;
- if (fabsf (__real__ x) >= 4.0f * FLT_MIN)
- __real__ x = __scalbnf (__real__ x, -2 * scale);
+ if (M_FABS (__real__ x) >= 4 * M_MIN)
+ __real__ x = M_SCALBN (__real__ x, -2 * scale);
else
- __real__ x = 0.0f;
- __imag__ x = __scalbnf (__imag__ x, -2 * scale);
+ __real__ x = 0;
+ __imag__ x = M_SCALBN (__imag__ x, -2 * scale);
}
- else if (fabsf (__real__ x) < 2.0f * FLT_MIN
- && fabsf (__imag__ x) < 2.0f * FLT_MIN)
+ else if (M_FABS (__real__ x) < 2 * M_MIN
+ && M_FABS (__imag__ x) < 2 * M_MIN)
{
- scale = -((FLT_MANT_DIG + 1) / 2);
- __real__ x = __scalbnf (__real__ x, -2 * scale);
- __imag__ x = __scalbnf (__imag__ x, -2 * scale);
+ scale = -((M_MANT_DIG + 1) / 2);
+ __real__ x = M_SCALBN (__real__ x, -2 * scale);
+ __imag__ x = M_SCALBN (__imag__ x, -2 * scale);
}
- d = __ieee754_hypotf (__real__ x, __imag__ x);
+ d = M_HYPOT (__real__ x, __imag__ x);
/* Use the identity 2 Re res Im res = Im x
to avoid cancellation error in d +/- Re x. */
if (__real__ x > 0)
{
- r = __ieee754_sqrtf (0.5f * (d + __real__ x));
- if (scale == 1 && fabsf (__imag__ x) < 1.0f)
+ r = M_SQRT (M_LIT (0.5) * (d + __real__ x));
+ if (scale == 1 && M_FABS (__imag__ x) < 1)
{
/* Avoid possible intermediate underflow. */
s = __imag__ x / r;
- r = __scalbnf (r, scale);
+ r = M_SCALBN (r, scale);
scale = 0;
}
else
- s = 0.5f * (__imag__ x / r);
+ s = M_LIT (0.5) * (__imag__ x / r);
}
else
{
- s = __ieee754_sqrtf (0.5f * (d - __real__ x));
- if (scale == 1 && fabsf (__imag__ x) < 1.0f)
+ s = M_SQRT (M_LIT (0.5) * (d - __real__ x));
+ if (scale == 1 && M_FABS (__imag__ x) < 1)
{
/* Avoid possible intermediate underflow. */
- r = fabsf (__imag__ x / s);
- s = __scalbnf (s, scale);
+ r = M_FABS (__imag__ x / s);
+ s = M_SCALBN (s, scale);
scale = 0;
}
else
- r = fabsf (0.5f * (__imag__ x / s));
+ r = M_FABS (M_LIT (0.5) * (__imag__ x / s));
}
if (scale)
{
- r = __scalbnf (r, scale);
- s = __scalbnf (s, scale);
+ r = M_SCALBN (r, scale);
+ s = M_SCALBN (s, scale);
}
math_check_force_underflow (r);
math_check_force_underflow (s);
__real__ res = r;
- __imag__ res = __copysignf (s, __imag__ x);
+ __imag__ res = M_COPYSIGN (s, __imag__ x);
}
}
return res;
}
-#ifndef __csqrtf
-weak_alias (__csqrtf, csqrtf)
+declare_mgen_alias (__csqrt, csqrt)
+
+#if M_LIBM_NEED_COMPAT (csqrt)
+declare_mgen_libm_compat (__csqrt, csqrt)
#endif
diff --git a/math/s_csqrtl.c b/math/s_csqrtl.c
deleted file mode 100644
index b0b52a565c..0000000000
--- a/math/s_csqrtl.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Complex square root of long double value.
- Copyright (C) 1997-2016 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.
-
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ long double
-__csqrtl (__complex__ long double x)
-{
- __complex__ long double res;
- int rcls = fpclassify (__real__ x);
- int icls = fpclassify (__imag__ x);
-
- if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE))
- {
- if (icls == FP_INFINITE)
- {
- __real__ res = HUGE_VALL;
- __imag__ res = __imag__ x;
- }
- else if (rcls == FP_INFINITE)
- {
- if (__real__ x < 0.0)
- {
- __real__ res = icls == FP_NAN ? __nanl ("") : 0;
- __imag__ res = __copysignl (HUGE_VALL, __imag__ x);
- }
- else
- {
- __real__ res = __real__ x;
- __imag__ res = (icls == FP_NAN
- ? __nanl ("") : __copysignl (0.0, __imag__ x));
- }
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
- }
- }
- else
- {
- if (__glibc_unlikely (icls == FP_ZERO))
- {
- if (__real__ x < 0.0)
- {
- __real__ res = 0.0;
- __imag__ res = __copysignl (__ieee754_sqrtl (-__real__ x),
- __imag__ x);
- }
- else
- {
- __real__ res = fabsl (__ieee754_sqrtl (__real__ x));
- __imag__ res = __copysignl (0.0, __imag__ x);
- }
- }
- else if (__glibc_unlikely (rcls == FP_ZERO))
- {
- long double r;
- if (fabsl (__imag__ x) >= 2.0L * LDBL_MIN)
- r = __ieee754_sqrtl (0.5L * fabsl (__imag__ x));
- else
- r = 0.5L * __ieee754_sqrtl (2.0L * fabsl (__imag__ x));
-
- __real__ res = r;
- __imag__ res = __copysignl (r, __imag__ x);
- }
- else
- {
- long double d, r, s;
- int scale = 0;
-
- if (fabsl (__real__ x) > LDBL_MAX / 4.0L)
- {
- scale = 1;
- __real__ x = __scalbnl (__real__ x, -2 * scale);
- __imag__ x = __scalbnl (__imag__ x, -2 * scale);
- }
- else if (fabsl (__imag__ x) > LDBL_MAX / 4.0L)
- {
- scale = 1;
- if (fabsl (__real__ x) >= 4.0L * LDBL_MIN)
- __real__ x = __scalbnl (__real__ x, -2 * scale);
- else
- __real__ x = 0.0L;
- __imag__ x = __scalbnl (__imag__ x, -2 * scale);
- }
- else if (fabsl (__real__ x) < 2.0L * LDBL_MIN
- && fabsl (__imag__ x) < 2.0L * LDBL_MIN)
- {
- scale = -((LDBL_MANT_DIG + 1) / 2);
- __real__ x = __scalbnl (__real__ x, -2 * scale);
- __imag__ x = __scalbnl (__imag__ x, -2 * scale);
- }
-
- d = __ieee754_hypotl (__real__ x, __imag__ x);
- /* Use the identity 2 Re res Im res = Im x
- to avoid cancellation error in d +/- Re x. */
- if (__real__ x > 0)
- {
- r = __ieee754_sqrtl (0.5L * (d + __real__ x));
- if (scale == 1 && fabsl (__imag__ x) < 1.0L)
- {
- /* Avoid possible intermediate underflow. */
- s = __imag__ x / r;
- r = __scalbnl (r, scale);
- scale = 0;
- }
- else
- s = 0.5L * (__imag__ x / r);
- }
- else
- {
- s = __ieee754_sqrtl (0.5L * (d - __real__ x));
- if (scale == 1 && fabsl (__imag__ x) < 1.0L)
- {
- /* Avoid possible intermediate underflow. */
- r = fabsl (__imag__ x / s);
- s = __scalbnl (s, scale);
- scale = 0;
- }
- else
- r = fabsl (0.5L * (__imag__ x / s));
- }
-
- if (scale)
- {
- r = __scalbnl (r, scale);
- s = __scalbnl (s, scale);
- }
-
- math_check_force_underflow (r);
- math_check_force_underflow (s);
-
- __real__ res = r;
- __imag__ res = __copysignl (s, __imag__ x);
- }
- }
-
- return res;
-}
-weak_alias (__csqrtl, csqrtl)
diff --git a/math/s_ctan.c b/math/s_ctan.c
deleted file mode 100644
index 8e8bf2ee2b..0000000000
--- a/math/s_ctan.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Complex tangent function for double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__ctan (__complex__ double x)
-{
- __complex__ double res;
-
- if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
- {
- if (isinf (__imag__ x))
- {
- if (isfinite (__real__ x) && fabs (__real__ x) > 1.0)
- {
- double sinrx, cosrx;
- __sincos (__real__ x, &sinrx, &cosrx);
- __real__ res = __copysign (0.0, sinrx * cosrx);
- }
- else
- __real__ res = __copysign (0.0, __real__ x);
- __imag__ res = __copysign (1.0, __imag__ x);
- }
- else if (__real__ x == 0.0)
- {
- res = x;
- }
- else
- {
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
-
- if (isinf (__real__ x))
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- double sinrx, cosrx;
- double den;
- const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2 / 2);
-
- /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
- = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
-
- if (__glibc_likely (fabs (__real__ x) > DBL_MIN))
- {
- __sincos (__real__ x, &sinrx, &cosrx);
- }
- else
- {
- sinrx = __real__ x;
- cosrx = 1.0;
- }
-
- if (fabs (__imag__ x) > t)
- {
- /* Avoid intermediate overflow when the real part of the
- result may be subnormal. Ignoring negligible terms, the
- imaginary part is +/- 1, the real part is
- sin(x)*cos(x)/sinh(y)^2 = 4*sin(x)*cos(x)/exp(2y). */
- double exp_2t = __ieee754_exp (2 * t);
-
- __imag__ res = __copysign (1.0, __imag__ x);
- __real__ res = 4 * sinrx * cosrx;
- __imag__ x = fabs (__imag__ x);
- __imag__ x -= t;
- __real__ res /= exp_2t;
- if (__imag__ x > t)
- {
- /* Underflow (original imaginary part of x has absolute
- value > 2t). */
- __real__ res /= exp_2t;
- }
- else
- __real__ res /= __ieee754_exp (2 * __imag__ x);
- }
- else
- {
- double sinhix, coshix;
- if (fabs (__imag__ x) > DBL_MIN)
- {
- sinhix = __ieee754_sinh (__imag__ x);
- coshix = __ieee754_cosh (__imag__ x);
- }
- else
- {
- sinhix = __imag__ x;
- coshix = 1.0;
- }
-
- if (fabs (sinhix) > fabs (cosrx) * DBL_EPSILON)
- den = cosrx * cosrx + sinhix * sinhix;
- else
- den = cosrx * cosrx;
- __real__ res = sinrx * cosrx / den;
- __imag__ res = sinhix * coshix / den;
- }
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__ctan, ctan)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ctan, __ctanl)
-weak_alias (__ctan, ctanl)
-#endif
diff --git a/math/s_ctanf.c b/math/s_ctan_template.c
index 0db2c90310..96efa47465 100644
--- a/math/s_ctanf.c
+++ b/math/s_ctan_template.c
@@ -1,4 +1,4 @@
-/* Complex tangent function for float.
+/* Complex tangent function for a complex float type.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,33 +23,33 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__ctanf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__ctan) (CFLOAT x)
{
- __complex__ float res;
+ CFLOAT res;
if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
{
if (isinf (__imag__ x))
{
- if (isfinite (__real__ x) && fabsf (__real__ x) > 1.0f)
+ if (isfinite (__real__ x) && M_FABS (__real__ x) > 1)
{
- float sinrx, cosrx;
- __sincosf (__real__ x, &sinrx, &cosrx);
- __real__ res = __copysignf (0.0f, sinrx * cosrx);
+ FLOAT sinrx, cosrx;
+ M_SINCOS (__real__ x, &sinrx, &cosrx);
+ __real__ res = M_COPYSIGN (0, sinrx * cosrx);
}
else
- __real__ res = __copysignf (0.0, __real__ x);
- __imag__ res = __copysignf (1.0, __imag__ x);
+ __real__ res = M_COPYSIGN (0, __real__ x);
+ __imag__ res = M_COPYSIGN (1, __imag__ x);
}
- else if (__real__ x == 0.0)
+ else if (__real__ x == 0)
{
res = x;
}
else
{
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
if (isinf (__real__ x))
feraiseexcept (FE_INVALID);
@@ -57,34 +57,34 @@ __ctanf (__complex__ float x)
}
else
{
- float sinrx, cosrx;
- float den;
- const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2 / 2);
+ FLOAT sinrx, cosrx;
+ FLOAT den;
+ const int t = (int) ((M_MAX_EXP - 1) * M_MLIT (M_LN2) / 2);
/* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
= (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
- if (__glibc_likely (fabsf (__real__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__real__ x) > M_MIN))
{
- __sincosf (__real__ x, &sinrx, &cosrx);
+ M_SINCOS (__real__ x, &sinrx, &cosrx);
}
else
{
sinrx = __real__ x;
- cosrx = 1.0f;
+ cosrx = 1;
}
- if (fabsf (__imag__ x) > t)
+ if (M_FABS (__imag__ x) > t)
{
/* Avoid intermediate overflow when the real part of the
result may be subnormal. Ignoring negligible terms, the
imaginary part is +/- 1, the real part is
sin(x)*cos(x)/sinh(y)^2 = 4*sin(x)*cos(x)/exp(2y). */
- float exp_2t = __ieee754_expf (2 * t);
+ FLOAT exp_2t = M_EXP (2 * t);
- __imag__ res = __copysignf (1.0, __imag__ x);
+ __imag__ res = M_COPYSIGN (1, __imag__ x);
__real__ res = 4 * sinrx * cosrx;
- __imag__ x = fabsf (__imag__ x);
+ __imag__ x = M_FABS (__imag__ x);
__imag__ x -= t;
__real__ res /= exp_2t;
if (__imag__ x > t)
@@ -94,23 +94,23 @@ __ctanf (__complex__ float x)
__real__ res /= exp_2t;
}
else
- __real__ res /= __ieee754_expf (2 * __imag__ x);
+ __real__ res /= M_EXP (2 * __imag__ x);
}
else
{
- float sinhix, coshix;
- if (fabsf (__imag__ x) > FLT_MIN)
+ FLOAT sinhix, coshix;
+ if (M_FABS (__imag__ x) > M_MIN)
{
- sinhix = __ieee754_sinhf (__imag__ x);
- coshix = __ieee754_coshf (__imag__ x);
+ sinhix = M_SINH (__imag__ x);
+ coshix = M_COSH (__imag__ x);
}
else
{
sinhix = __imag__ x;
- coshix = 1.0f;
+ coshix = 1;
}
- if (fabsf (sinhix) > fabsf (cosrx) * FLT_EPSILON)
+ if (M_FABS (sinhix) > M_FABS (cosrx) * M_EPSILON)
den = cosrx * cosrx + sinhix * sinhix;
else
den = cosrx * cosrx;
@@ -122,6 +122,9 @@ __ctanf (__complex__ float x)
return res;
}
-#ifndef __ctanf
-weak_alias (__ctanf, ctanf)
+
+declare_mgen_alias (__ctan, ctan)
+
+#if M_LIBM_NEED_COMPAT (ctan)
+declare_mgen_libm_compat (__ctan, ctan)
#endif
diff --git a/math/s_ctanh.c b/math/s_ctanh.c
deleted file mode 100644
index 2d18875c70..0000000000
--- a/math/s_ctanh.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Complex hyperbole tangent for double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-__complex__ double
-__ctanh (__complex__ double x)
-{
- __complex__ double res;
-
- if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
- {
- if (isinf (__real__ x))
- {
- __real__ res = __copysign (1.0, __real__ x);
- if (isfinite (__imag__ x) && fabs (__imag__ x) > 1.0)
- {
- double sinix, cosix;
- __sincos (__imag__ x, &sinix, &cosix);
- __imag__ res = __copysign (0.0, sinix * cosix);
- }
- else
- __imag__ res = __copysign (0.0, __imag__ x);
- }
- else if (__imag__ x == 0.0)
- {
- res = x;
- }
- else
- {
- __real__ res = __nan ("");
- __imag__ res = __nan ("");
-
- if (isinf (__imag__ x))
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- double sinix, cosix;
- double den;
- const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2 / 2);
-
- /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
- = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */
-
- if (__glibc_likely (fabs (__imag__ x) > DBL_MIN))
- {
- __sincos (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (fabs (__real__ x) > t)
- {
- /* Avoid intermediate overflow when the imaginary part of
- the result may be subnormal. Ignoring negligible terms,
- the real part is +/- 1, the imaginary part is
- sin(y)*cos(y)/sinh(x)^2 = 4*sin(y)*cos(y)/exp(2x). */
- double exp_2t = __ieee754_exp (2 * t);
-
- __real__ res = __copysign (1.0, __real__ x);
- __imag__ res = 4 * sinix * cosix;
- __real__ x = fabs (__real__ x);
- __real__ x -= t;
- __imag__ res /= exp_2t;
- if (__real__ x > t)
- {
- /* Underflow (original real part of x has absolute value
- > 2t). */
- __imag__ res /= exp_2t;
- }
- else
- __imag__ res /= __ieee754_exp (2 * __real__ x);
- }
- else
- {
- double sinhrx, coshrx;
- if (fabs (__real__ x) > DBL_MIN)
- {
- sinhrx = __ieee754_sinh (__real__ x);
- coshrx = __ieee754_cosh (__real__ x);
- }
- else
- {
- sinhrx = __real__ x;
- coshrx = 1.0;
- }
-
- if (fabs (sinhrx) > fabs (cosix) * DBL_EPSILON)
- den = sinhrx * sinhrx + cosix * cosix;
- else
- den = cosix * cosix;
- __real__ res = sinhrx * coshrx / den;
- __imag__ res = sinix * cosix / den;
- }
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__ctanh, ctanh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ctanh, __ctanhl)
-weak_alias (__ctanh, ctanhl)
-#endif
diff --git a/math/s_ctanhf.c b/math/s_ctanh_template.c
index ffe95f635e..a7b7ebc3e2 100644
--- a/math/s_ctanhf.c
+++ b/math/s_ctanh_template.c
@@ -1,4 +1,4 @@
-/* Complex hyperbole tangent for float.
+/* Complex hyperbolic tangent for float types.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,33 +23,33 @@
#include <math_private.h>
#include <float.h>
-__complex__ float
-__ctanhf (__complex__ float x)
+CFLOAT
+M_DECL_FUNC (__ctanh) (CFLOAT x)
{
- __complex__ float res;
+ CFLOAT res;
if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
{
if (isinf (__real__ x))
{
- __real__ res = __copysignf (1.0, __real__ x);
- if (isfinite (__imag__ x) && fabsf (__imag__ x) > 1.0f)
+ __real__ res = M_COPYSIGN (1, __real__ x);
+ if (isfinite (__imag__ x) && M_FABS (__imag__ x) > 1)
{
- float sinix, cosix;
- __sincosf (__imag__ x, &sinix, &cosix);
- __imag__ res = __copysignf (0.0f, sinix * cosix);
+ FLOAT sinix, cosix;
+ M_SINCOS (__imag__ x, &sinix, &cosix);
+ __imag__ res = M_COPYSIGN (0, sinix * cosix);
}
else
- __imag__ res = __copysignf (0.0, __imag__ x);
+ __imag__ res = M_COPYSIGN (0, __imag__ x);
}
- else if (__imag__ x == 0.0)
+ else if (__imag__ x == 0)
{
res = x;
}
else
{
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
+ __real__ res = M_NAN;
+ __imag__ res = M_NAN;
if (isinf (__imag__ x))
feraiseexcept (FE_INVALID);
@@ -57,34 +57,34 @@ __ctanhf (__complex__ float x)
}
else
{
- float sinix, cosix;
- float den;
- const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2 / 2);
+ FLOAT sinix, cosix;
+ FLOAT den;
+ const int t = (int) ((M_MAX_EXP - 1) * M_MLIT (M_LN2) / 2);
/* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
= (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */
- if (__glibc_likely (fabsf (__imag__ x) > FLT_MIN))
+ if (__glibc_likely (M_FABS (__imag__ x) > M_MIN))
{
- __sincosf (__imag__ x, &sinix, &cosix);
+ M_SINCOS (__imag__ x, &sinix, &cosix);
}
else
{
sinix = __imag__ x;
- cosix = 1.0f;
+ cosix = 1;
}
- if (fabsf (__real__ x) > t)
+ if (M_FABS (__real__ x) > t)
{
/* Avoid intermediate overflow when the imaginary part of
the result may be subnormal. Ignoring negligible terms,
the real part is +/- 1, the imaginary part is
sin(y)*cos(y)/sinh(x)^2 = 4*sin(y)*cos(y)/exp(2x). */
- float exp_2t = __ieee754_expf (2 * t);
+ FLOAT exp_2t = M_EXP (2 * t);
- __real__ res = __copysignf (1.0, __real__ x);
+ __real__ res = M_COPYSIGN (1, __real__ x);
__imag__ res = 4 * sinix * cosix;
- __real__ x = fabsf (__real__ x);
+ __real__ x = M_FABS (__real__ x);
__real__ x -= t;
__imag__ res /= exp_2t;
if (__real__ x > t)
@@ -94,23 +94,23 @@ __ctanhf (__complex__ float x)
__imag__ res /= exp_2t;
}
else
- __imag__ res /= __ieee754_expf (2 * __real__ x);
+ __imag__ res /= M_EXP (2 * __real__ x);
}
else
{
- float sinhrx, coshrx;
- if (fabsf (__real__ x) > FLT_MIN)
+ FLOAT sinhrx, coshrx;
+ if (M_FABS (__real__ x) > M_MIN)
{
- sinhrx = __ieee754_sinhf (__real__ x);
- coshrx = __ieee754_coshf (__real__ x);
+ sinhrx = M_SINH (__real__ x);
+ coshrx = M_COSH (__real__ x);
}
else
{
sinhrx = __real__ x;
- coshrx = 1.0f;
+ coshrx = 1;
}
- if (fabsf (sinhrx) > fabsf (cosix) * FLT_EPSILON)
+ if (M_FABS (sinhrx) > M_FABS (cosix) * M_EPSILON)
den = sinhrx * sinhrx + cosix * cosix;
else
den = cosix * cosix;
@@ -122,6 +122,9 @@ __ctanhf (__complex__ float x)
return res;
}
-#ifndef __ctanhf
-weak_alias (__ctanhf, ctanhf)
+
+declare_mgen_alias (__ctanh, ctanh)
+
+#if M_LIBM_NEED_COMPAT (ctanh)
+declare_mgen_libm_compat (__ctanh, ctanh)
#endif
diff --git a/math/s_ctanhl.c b/math/s_ctanhl.c
deleted file mode 100644
index 3404d0687e..0000000000
--- a/math/s_ctanhl.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Complex hyperbole tangent for long double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* To avoid spurious underflows, use this definition to treat IBM long
- double as approximating an IEEE-style format. */
-#if LDBL_MANT_DIG == 106
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 0x1p-106L
-#endif
-
-__complex__ long double
-__ctanhl (__complex__ long double x)
-{
- __complex__ long double res;
-
- if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
- {
- if (isinf (__real__ x))
- {
- __real__ res = __copysignl (1.0, __real__ x);
- if (isfinite (__imag__ x) && fabsl (__imag__ x) > 1.0L)
- {
- long double sinix, cosix;
- __sincosl (__imag__ x, &sinix, &cosix);
- __imag__ res = __copysignl (0.0L, sinix * cosix);
- }
- else
- __imag__ res = __copysignl (0.0, __imag__ x);
- }
- else if (__imag__ x == 0.0)
- {
- res = x;
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
-
- if (isinf (__imag__ x))
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- long double sinix, cosix;
- long double den;
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l / 2);
-
- /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
- = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */
-
- if (__glibc_likely (fabsl (__imag__ x) > LDBL_MIN))
- {
- __sincosl (__imag__ x, &sinix, &cosix);
- }
- else
- {
- sinix = __imag__ x;
- cosix = 1.0;
- }
-
- if (fabsl (__real__ x) > t)
- {
- /* Avoid intermediate overflow when the imaginary part of
- the result may be subnormal. Ignoring negligible terms,
- the real part is +/- 1, the imaginary part is
- sin(y)*cos(y)/sinh(x)^2 = 4*sin(y)*cos(y)/exp(2x). */
- long double exp_2t = __ieee754_expl (2 * t);
-
- __real__ res = __copysignl (1.0, __real__ x);
- __imag__ res = 4 * sinix * cosix;
- __real__ x = fabsl (__real__ x);
- __real__ x -= t;
- __imag__ res /= exp_2t;
- if (__real__ x > t)
- {
- /* Underflow (original real part of x has absolute value
- > 2t). */
- __imag__ res /= exp_2t;
- }
- else
- __imag__ res /= __ieee754_expl (2 * __real__ x);
- }
- else
- {
- long double sinhrx, coshrx;
- if (fabsl (__real__ x) > LDBL_MIN)
- {
- sinhrx = __ieee754_sinhl (__real__ x);
- coshrx = __ieee754_coshl (__real__ x);
- }
- else
- {
- sinhrx = __real__ x;
- coshrx = 1.0L;
- }
-
- if (fabsl (sinhrx) > fabsl (cosix) * LDBL_EPSILON)
- den = sinhrx * sinhrx + cosix * cosix;
- else
- den = cosix * cosix;
- __real__ res = sinhrx * coshrx / den;
- __imag__ res = sinix * cosix / den;
- }
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__ctanhl, ctanhl)
diff --git a/math/s_ctanl.c b/math/s_ctanl.c
deleted file mode 100644
index d6be22d015..0000000000
--- a/math/s_ctanl.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Complex tangent function for long double.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <complex.h>
-#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
-#include <float.h>
-
-/* To avoid spurious underflows, use this definition to treat IBM long
- double as approximating an IEEE-style format. */
-#if LDBL_MANT_DIG == 106
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 0x1p-106L
-#endif
-
-__complex__ long double
-__ctanl (__complex__ long double x)
-{
- __complex__ long double res;
-
- if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x)))
- {
- if (isinf (__imag__ x))
- {
- if (isfinite (__real__ x) && fabsl (__real__ x) > 1.0L)
- {
- long double sinrx, cosrx;
- __sincosl (__real__ x, &sinrx, &cosrx);
- __real__ res = __copysignl (0.0L, sinrx * cosrx);
- }
- else
- __real__ res = __copysignl (0.0, __real__ x);
- __imag__ res = __copysignl (1.0, __imag__ x);
- }
- else if (__real__ x == 0.0)
- {
- res = x;
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
-
- if (isinf (__real__ x))
- feraiseexcept (FE_INVALID);
- }
- }
- else
- {
- long double sinrx, cosrx;
- long double den;
- const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l / 2);
-
- /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
- = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
-
- if (__glibc_likely (fabsl (__real__ x) > LDBL_MIN))
- {
- __sincosl (__real__ x, &sinrx, &cosrx);
- }
- else
- {
- sinrx = __real__ x;
- cosrx = 1.0;
- }
-
- if (fabsl (__imag__ x) > t)
- {
- /* Avoid intermediate overflow when the real part of the
- result may be subnormal. Ignoring negligible terms, the
- imaginary part is +/- 1, the real part is
- sin(x)*cos(x)/sinh(y)^2 = 4*sin(x)*cos(x)/exp(2y). */
- long double exp_2t = __ieee754_expl (2 * t);
-
- __imag__ res = __copysignl (1.0, __imag__ x);
- __real__ res = 4 * sinrx * cosrx;
- __imag__ x = fabsl (__imag__ x);
- __imag__ x -= t;
- __real__ res /= exp_2t;
- if (__imag__ x > t)
- {
- /* Underflow (original imaginary part of x has absolute
- value > 2t). */
- __real__ res /= exp_2t;
- }
- else
- __real__ res /= __ieee754_expl (2 * __imag__ x);
- }
- else
- {
- long double sinhix, coshix;
- if (fabsl (__imag__ x) > LDBL_MIN)
- {
- sinhix = __ieee754_sinhl (__imag__ x);
- coshix = __ieee754_coshl (__imag__ x);
- }
- else
- {
- sinhix = __imag__ x;
- coshix = 1.0L;
- }
-
- if (fabsl (sinhix) > fabsl (cosrx) * LDBL_EPSILON)
- den = cosrx * cosrx + sinhix * sinhix;
- else
- den = cosrx * cosrx;
- __real__ res = sinrx * cosrx / den;
- __imag__ res = sinhix * coshix / den;
- }
- math_check_force_underflow_complex (res);
- }
-
- return res;
-}
-weak_alias (__ctanl, ctanl)
diff --git a/math/s_fdimf.c b/math/s_fdim_template.c
index e457f9d3b9..d3e73790af 100644
--- a/math/s_fdimf.c
+++ b/math/s_fdim_template.c
@@ -21,18 +21,20 @@
#include <math.h>
#include <math_private.h>
-float
-__fdimf (float x, float y)
+FLOAT
+M_DECL_FUNC (__fdim) (FLOAT x, FLOAT y)
{
if (islessequal (x, y))
- return 0.0f;
+ return 0;
- float r = math_narrow_eval (x - y);
+ FLOAT r = math_narrow_eval (x - y);
if (isinf (r) && !isinf (x) && !isinf (y))
__set_errno (ERANGE);
return r;
}
-#ifndef __fdimf
-weak_alias (__fdimf, fdimf)
+declare_mgen_alias (__fdim, fdim);
+
+#if M_LIBM_NEED_COMPAT (fdim)
+declare_mgen_libm_compat (__fdim, fdim)
#endif
diff --git a/math/s_fdiml.c b/math/s_fdiml.c
deleted file mode 100644
index 4a1f6722c6..0000000000
--- a/math/s_fdiml.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Return positive difference between arguments.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <math.h>
-
-long double
-__fdiml (long double x, long double y)
-{
- if (islessequal (x, y))
- return 0.0f;
-
- long double r = x - y;
- if (isinf (r) && !isinf (x) && !isinf (y))
- __set_errno (ERANGE);
-
- return r;
-}
-weak_alias (__fdiml, fdiml)
diff --git a/math/s_fmax.c b/math/s_fmax_template.c
index 9a8efce87f..dea53d45f0 100644
--- a/math/s_fmax.c
+++ b/math/s_fmax_template.c
@@ -19,14 +19,14 @@
#include <math.h>
-
-double
-__fmax (double x, double y)
+FLOAT
+M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y)
{
return (isgreaterequal (x, y) || isnan (y)) ? x : y;
}
-weak_alias (__fmax, fmax)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fmax, __fmaxl)
-weak_alias (__fmax, fmaxl)
+
+declare_mgen_alias (__fmax, fmax);
+
+#if M_LIBM_NEED_COMPAT (fmax)
+declare_mgen_libm_compat (__fmax, fmax)
#endif
diff --git a/math/s_fmaxl.c b/math/s_fmaxl.c
deleted file mode 100644
index 3b2273548a..0000000000
--- a/math/s_fmaxl.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Return maximum numeric value of X and Y.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-
-
-long double
-__fmaxl (long double x, long double y)
-{
- return (isgreaterequal (x, y) || isnan (y)) ? x : y;
-}
-weak_alias (__fmaxl, fmaxl)
diff --git a/math/s_fmin.c b/math/s_fmin_template.c
index d22b916b45..b70989ac74 100644
--- a/math/s_fmin.c
+++ b/math/s_fmin_template.c
@@ -20,13 +20,13 @@
#include <math.h>
-double
-__fmin (double x, double y)
+FLOAT
+M_DECL_FUNC (__fmin) (FLOAT x, FLOAT y)
{
return (islessequal (x, y) || isnan (y)) ? x : y;
}
-weak_alias (__fmin, fmin)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fmin, __fminl)
-weak_alias (__fmin, fminl)
+declare_mgen_alias (__fmin, fmin);
+
+#if M_LIBM_NEED_COMPAT (fmin)
+declare_mgen_libm_compat (__fmin, fmin)
#endif
diff --git a/math/s_iscanonicall.c b/math/s_iscanonicall.c
new file mode 100644
index 0000000000..b5fd996ffe
--- /dev/null
+++ b/math/s_iscanonicall.c
@@ -0,0 +1 @@
+/* Not needed by default. */
diff --git a/math/s_fdim.c b/math/s_iseqsig_template.c
index 1786521c17..5969206708 100644
--- a/math/s_fdim.c
+++ b/math/s_iseqsig_template.c
@@ -1,7 +1,6 @@
-/* Return positive difference between arguments.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Test whether X == Y.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,25 +17,27 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <fenv.h>
#include <math.h>
#include <math_private.h>
+#include <stdbool.h>
+#include <fix-fp-int-compare-invalid.h>
-double
-__fdim (double x, double y)
+int
+M_DECL_FUNC (__iseqsig) (FLOAT x, FLOAT y)
{
- if (islessequal (x, y))
- return 0.0;
-
- double r = math_narrow_eval (x - y);
- if (isinf (r) && !isinf (x) && !isinf (y))
- __set_errno (ERANGE);
-
- return r;
+ /* Comparing <= and >= is sufficient to determine both whether X and
+ Y are equal, and whether they are unordered, while raising the
+ "invalid" exception if they are unordered. */
+ bool cmp1 = x <= y;
+ bool cmp2 = x >= y;
+ if (cmp1 && cmp2)
+ return 1;
+ else if (!cmp1 && !cmp2)
+ {
+ if (FIX_COMPARE_INVALID)
+ feraiseexcept (FE_INVALID);
+ __set_errno (EDOM);
+ }
+ return 0;
}
-#ifndef __fdim
-weak_alias (__fdim, fdim)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__fdim, __fdiml)
-weak_alias (__fdim, fdiml)
-# endif
-#endif
diff --git a/math/s_ldexp.c b/math/s_ldexp_template.c
index ee53695d71..42a83334c3 100644
--- a/math/s_ldexp.c
+++ b/math/s_ldexp_template.c
@@ -18,17 +18,15 @@ static char rcsid[] = "$NetBSD: s_ldexp.c,v 1.6 1995/05/10 20:47:40 jtc Exp $";
#include <math_private.h>
#include <errno.h>
-double __ldexp(double value, int exp)
+FLOAT
+M_SUF (__ldexp) (FLOAT value, int exp)
{
- if(!isfinite(value)||value==0.0) return value + value;
- value = __scalbn(value,exp);
- if(!isfinite(value)||value==0.0) __set_errno (ERANGE);
+ if(!isfinite(value)||value==0) return value + value;
+ value = M_SCALBN(value,exp);
+ if(!isfinite(value)||value==0) __set_errno (ERANGE);
return value;
}
-weak_alias (__ldexp, ldexp)
-weak_alias (__ldexp, scalbn)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ldexp, __ldexpl)
-weak_alias (__ldexp, ldexpl)
-weak_alias (__ldexp, scalbnl)
-#endif
+
+declare_mgen_alias_2 (__ldexp, ldexp, scalbn);
+
+/* Note, versioning issues are punted to ldbl-opt in this case. */
diff --git a/math/s_ldexpf.c b/math/s_ldexpf.c
deleted file mode 100644
index b83062fe35..0000000000
--- a/math/s_ldexpf.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* s_ldexpf.c -- float version of s_ldexp.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: s_ldexpf.c,v 1.3 1995/05/10 20:47:42 jtc Exp $";
-#endif
-
-#include <math.h>
-#include <math_private.h>
-#include <errno.h>
-
-float __ldexpf(float value, int exp)
-{
- if(!isfinite(value)||value==(float)0.0) return value + value;
- value = __scalbnf(value,exp);
- if(!isfinite(value)||value==(float)0.0) __set_errno (ERANGE);
- return value;
-}
-weak_alias (__ldexpf, ldexpf)
-weak_alias (__ldexpf, scalbnf)
diff --git a/math/s_ldexpl.c b/math/s_ldexpl.c
deleted file mode 100644
index 52fb093171..0000000000
--- a/math/s_ldexpl.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* s_ldexpl.c -- long double version of s_ldexp.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
-
-#include <math.h>
-#include <math_private.h>
-#include <errno.h>
-
-long double __ldexpl(long double value, int exp)
-{
- if(!isfinite(value)||value==0.0) return value + value;
- value = __scalbnl(value,exp);
- if(!isfinite(value)||value==0.0) __set_errno (ERANGE);
- return value;
-}
-weak_alias (__ldexpl, ldexpl)
-weak_alias (__ldexpl, scalbnl)
diff --git a/math/s_nan.c b/math/s_nan_template.c
index d9af7752ce..cf47a2f07f 100644
--- a/math/s_nan.c
+++ b/math/s_nan_template.c
@@ -24,14 +24,14 @@
#include <ieee754.h>
-#undef __nan
-double
-__nan (const char *tagp)
+FLOAT
+M_DECL_FUNC (__nan) (const char *tagp)
{
- return __strtod_nan (tagp, NULL, 0);
+ return M_STRTO_NAN (tagp, NULL, 0);
}
-weak_alias (__nan, nan)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nan, __nanl)
-weak_alias (__nan, nanl)
+
+declare_mgen_alias (__nan, nan)
+
+#if M_LIBM_NEED_COMPAT (nan)
+declare_mgen_libm_compat (__nan, nan)
#endif
diff --git a/math/s_nanf.c b/math/s_nanf.c
deleted file mode 100644
index 0dd6778f67..0000000000
--- a/math/s_nanf.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Return quiet nan.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ieee754.h>
-
-
-#undef __nanf
-float
-__nanf (const char *tagp)
-{
- return __strtof_nan (tagp, NULL, 0);
-}
-weak_alias (__nanf, nanf)
diff --git a/math/s_nextdownf.c b/math/s_nextdown_template.c
index c0d4585b7f..f286dfdaac 100644
--- a/math/s_nextdownf.c
+++ b/math/s_nextdown_template.c
@@ -20,10 +20,10 @@
#include <math_private.h>
/* Return the greatest floating-point number less than X. */
-float
-__nextdownf (float x)
+FLOAT
+M_DECL_FUNC (__nextdown) (FLOAT x)
{
- return -__nextupf (-x);
+ return -M_SUF (__nextup) (-x);
}
-weak_alias (__nextdownf, nextdownf)
+declare_mgen_alias (__nextdown, nextdown);
diff --git a/math/test-double.h b/math/test-double.h
index b9e8cd840c..e172b8fb4d 100644
--- a/math/test-double.h
+++ b/math/test-double.h
@@ -27,3 +27,4 @@
#define TYPE_STR "double"
#define LITM(x) x
#define FTOSTR snprintf
+#define snan_value_MACRO SNAN
diff --git a/math/test-femode-traps.c b/math/test-femode-traps.c
new file mode 100644
index 0000000000..dd22765831
--- /dev/null
+++ b/math/test-femode-traps.c
@@ -0,0 +1,149 @@
+/* Test femode_t functions: test handling of exception traps.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <stdio.h>
+#include <math-tests.h>
+
+static int
+test_ee (int exc1, int exc2)
+{
+ int result = 0;
+ printf ("testing %x %x\n", (unsigned int) exc1, (unsigned int) exc2);
+
+ fedisableexcept (FE_ALL_EXCEPT);
+ int ret = feenableexcept (exc1);
+ if (ret == -1)
+ {
+ if (EXCEPTION_ENABLE_SUPPORTED (exc1))
+ {
+ puts ("first feenableexcept failed unexpectedly");
+ result = 1;
+ }
+ else
+ puts ("first feenableexcept failed, cannot test");
+ return result;
+ }
+ femode_t saved;
+ ret = fegetmode (&saved);
+ if (ret != 0)
+ {
+ puts ("fegetmode failed");
+ result = 1;
+ return result;
+ }
+ fedisableexcept (FE_ALL_EXCEPT);
+ ret = feenableexcept (exc2);
+ if (ret == -1)
+ {
+ if (EXCEPTION_ENABLE_SUPPORTED (exc2))
+ {
+ puts ("second feenableexcept failed unexpectedly");
+ result = 1;
+ }
+ else
+ puts ("second feenableexcept failed, cannot test");
+ return result;
+ }
+ ret = fesetmode (&saved);
+ if (ret != 0)
+ {
+ puts ("fesetmode failed");
+ result = 1;
+ return result;
+ }
+ /* Verify that the set of enabled traps was restored. */
+ ret = fegetexcept ();
+ if (ret != exc1)
+ {
+ printf ("restored enabled traps %x not %x\n", (unsigned int) ret,
+ (unsigned int) exc1);
+ result = 1;
+ }
+ /* Likewise, with default modes. */
+ ret = fesetmode (FE_DFL_MODE);
+ if (ret != 0)
+ {
+ puts ("fesetmode (FE_DFL_MODE) failed");
+ result = 1;
+ return result;
+ }
+ ret = fegetexcept ();
+ if (ret != 0)
+ {
+ printf ("FE_DFL_MODE enabled traps %x not 0\n", (unsigned int) ret);
+ result = 1;
+ }
+
+ return result;
+}
+
+static int
+test_e (int exc1)
+{
+ int result = 0;
+
+ result |= test_ee (exc1, 0);
+ result |= test_ee (exc1, FE_ALL_EXCEPT);
+#ifdef FE_DIVBYZERO
+ result |= test_ee (exc1, FE_DIVBYZERO);
+#endif
+#ifdef FE_INEXACT
+ result |= test_ee (exc1, FE_INEXACT);
+#endif
+#ifdef FE_INVALID
+ result |= test_ee (exc1, FE_INVALID);
+#endif
+#ifdef FE_OVERFLOW
+ result |= test_ee (exc1, FE_OVERFLOW);
+#endif
+#ifdef FE_UNDERFLOW
+ result |= test_ee (exc1, FE_UNDERFLOW);
+#endif
+
+ return result;
+}
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ result |= test_e (0);
+ result |= test_e (FE_ALL_EXCEPT);
+#ifdef FE_DIVBYZERO
+ result |= test_e (FE_DIVBYZERO);
+#endif
+#ifdef FE_INEXACT
+ result |= test_e (FE_INEXACT);
+#endif
+#ifdef FE_INVALID
+ result |= test_e (FE_INVALID);
+#endif
+#ifdef FE_OVERFLOW
+ result |= test_e (FE_OVERFLOW);
+#endif
+#ifdef FE_UNDERFLOW
+ result |= test_e (FE_UNDERFLOW);
+#endif
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-femode.c b/math/test-femode.c
new file mode 100644
index 0000000000..1e80f32225
--- /dev/null
+++ b/math/test-femode.c
@@ -0,0 +1,231 @@
+/* Test femode_t functions.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <stdio.h>
+#include <math-tests.h>
+
+static int
+test_mmee (int mode1, int mode2, int exc1, int exc2)
+{
+ int result = 0;
+ printf ("testing %x %x %x %x\n", (unsigned int) mode1, (unsigned int) mode2,
+ (unsigned int) exc1, (unsigned int) exc2);
+
+ feclearexcept (FE_ALL_EXCEPT);
+ int ret = fesetround (mode1);
+ if (ret != 0)
+ {
+ if (ROUNDING_TESTS (float, mode1))
+ {
+ puts ("first fesetround failed unexpectedly");
+ result = 1;
+ }
+ else
+ puts ("first fesetround failed, cannot test");
+ return result;
+ }
+ ret = fesetexcept (exc1);
+ if (ret != 0)
+ {
+ if (EXCEPTION_TESTS (float) || exc1 == 0)
+ {
+ puts ("first fesetexcept failed unexpectedly");
+ result = 1;
+ }
+ else
+ puts ("first fesetexcept failed, cannot test");
+ return result;
+ }
+ femode_t saved;
+ ret = fegetmode (&saved);
+ if (ret != 0)
+ {
+ puts ("fegetmode failed");
+ result = 1;
+ return result;
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+ ret = fesetround (mode2);
+ if (ret != 0)
+ {
+ if (ROUNDING_TESTS (float, mode2))
+ {
+ puts ("second fesetround failed unexpectedly");
+ result = 1;
+ }
+ else
+ puts ("second fesetround failed, cannot test");
+ return result;
+ }
+ ret = fesetexcept (exc2);
+ if (ret != 0)
+ {
+ if (EXCEPTION_TESTS (float) || exc2 == 0)
+ {
+ puts ("second fesetexcept failed unexpectedly");
+ result = 1;
+ }
+ else
+ puts ("second fesetexcept failed, cannot test");
+ return result;
+ }
+ ret = fesetmode (&saved);
+ if (ret != 0)
+ {
+ puts ("fesetmode failed");
+ result = 1;
+ return result;
+ }
+ /* Verify that the rounding mode was restored but the exception
+ flags remain unchanged. */
+ ret = fegetround ();
+ if (ret != mode1)
+ {
+ printf ("restored rounding mode %x not %x\n", (unsigned int) ret,
+ (unsigned int) mode1);
+ result = 1;
+ }
+ ret = fetestexcept (FE_ALL_EXCEPT);
+ if (ret != exc2)
+ {
+ printf ("exceptions %x not %x\n", (unsigned int) ret,
+ (unsigned int) exc2);
+ result = 1;
+ }
+ /* Likewise, with default modes. */
+ ret = fesetmode (FE_DFL_MODE);
+ if (ret != 0)
+ {
+ puts ("fesetmode (FE_DFL_MODE) failed");
+ result = 1;
+ return result;
+ }
+ ret = fegetround ();
+ if (ret != FE_TONEAREST)
+ {
+ printf ("FE_DFL_MODE rounding mode %x not %x\n", (unsigned int) ret,
+ (unsigned int) FE_TONEAREST);
+ result = 1;
+ }
+ ret = fetestexcept (FE_ALL_EXCEPT);
+ if (ret != exc2)
+ {
+ printf ("FE_DFL_MODE exceptions %x not %x\n", (unsigned int) ret,
+ (unsigned int) exc2);
+ result = 1;
+ }
+ return result;
+}
+
+static int
+test_mme (int mode1, int mode2, int exc1)
+{
+ int result = 0;
+
+ result |= test_mmee (mode1, mode2, exc1, 0);
+ result |= test_mmee (mode1, mode2, exc1, FE_ALL_EXCEPT);
+#ifdef FE_DIVBYZERO
+ result |= test_mmee (mode1, mode2, exc1, FE_DIVBYZERO);
+#endif
+#ifdef FE_INEXACT
+ result |= test_mmee (mode1, mode2, exc1, FE_INEXACT);
+#endif
+#ifdef FE_INVALID
+ result |= test_mmee (mode1, mode2, exc1, FE_INVALID);
+#endif
+#ifdef FE_OVERFLOW
+ result |= test_mmee (mode1, mode2, exc1, FE_OVERFLOW);
+#endif
+#ifdef FE_UNDERFLOW
+ result |= test_mmee (mode1, mode2, exc1, FE_UNDERFLOW);
+#endif
+
+ return result;
+}
+
+static int
+test_mm (int mode1, int mode2)
+{
+ int result = 0;
+
+ result |= test_mme (mode1, mode2, 0);
+ result |= test_mme (mode1, mode2, FE_ALL_EXCEPT);
+#ifdef FE_DIVBYZERO
+ result |= test_mme (mode1, mode2, FE_DIVBYZERO);
+#endif
+#ifdef FE_INEXACT
+ result |= test_mme (mode1, mode2, FE_INEXACT);
+#endif
+#ifdef FE_INVALID
+ result |= test_mme (mode1, mode2, FE_INVALID);
+#endif
+#ifdef FE_OVERFLOW
+ result |= test_mme (mode1, mode2, FE_OVERFLOW);
+#endif
+#ifdef FE_UNDERFLOW
+ result |= test_mme (mode1, mode2, FE_UNDERFLOW);
+#endif
+
+ return result;
+}
+
+static int
+test_m (int mode1)
+{
+ int result = 0;
+
+#ifdef FE_DOWNWARD
+ result |= test_mm (mode1, FE_DOWNWARD);
+#endif
+#ifdef FE_TONEAREST
+ result |= test_mm (mode1, FE_TONEAREST);
+#endif
+#ifdef FE_TOWARDZERO
+ result |= test_mm (mode1, FE_TOWARDZERO);
+#endif
+#ifdef FE_UPWARD
+ result |= test_mm (mode1, FE_UPWARD);
+#endif
+
+ return result;
+}
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+#ifdef FE_DOWNWARD
+ result |= test_m (FE_DOWNWARD);
+#endif
+#ifdef FE_TONEAREST
+ result |= test_m (FE_TONEAREST);
+#endif
+#ifdef FE_TOWARDZERO
+ result |= test_m (FE_TOWARDZERO);
+#endif
+#ifdef FE_UPWARD
+ result |= test_m (FE_UPWARD);
+#endif
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-fesetexcept-traps.c b/math/test-fesetexcept-traps.c
new file mode 100644
index 0000000000..c40b5bc2b8
--- /dev/null
+++ b/math/test-fesetexcept-traps.c
@@ -0,0 +1,68 @@
+/* Test fesetexcept: exception traps enabled.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <stdio.h>
+#include <math-tests.h>
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ fedisableexcept (FE_ALL_EXCEPT);
+ int ret = feenableexcept (FE_ALL_EXCEPT);
+ if (!EXCEPTION_ENABLE_SUPPORTED (FE_ALL_EXCEPT) && (ret == -1))
+ {
+ puts ("feenableexcept (FE_ALL_EXCEPT) not supported, cannot test");
+ return 77;
+ }
+ else if (ret != 0)
+ {
+ puts ("feenableexcept (FE_ALL_EXCEPT) failed");
+ result = 1;
+ return result;
+ }
+
+ if (EXCEPTION_SET_FORCES_TRAP)
+ {
+ puts ("setting exceptions traps, cannot test on this architecture");
+ return 77;
+ }
+ /* Verify fesetexcept does not cause exception traps. */
+ ret = fesetexcept (FE_ALL_EXCEPT);
+ if (ret == 0)
+ puts ("fesetexcept (FE_ALL_EXCEPT) succeeded");
+ else
+ {
+ puts ("fesetexcept (FE_ALL_EXCEPT) failed");
+ if (EXCEPTION_TESTS (float))
+ {
+ puts ("failure of fesetexcept was unexpected");
+ result = 1;
+ }
+ else
+ puts ("failure of fesetexcept OK");
+ }
+ feclearexcept (FE_ALL_EXCEPT);
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-fesetexcept.c b/math/test-fesetexcept.c
new file mode 100644
index 0000000000..912a9a6bad
--- /dev/null
+++ b/math/test-fesetexcept.c
@@ -0,0 +1,129 @@
+/* Test fesetexcept.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <stdio.h>
+#include <math-tests.h>
+
+static int
+test_fesetexcept (int exc, const char *exc_name)
+{
+ int result = 0;
+
+ printf ("Testing %s\n", exc_name);
+ feclearexcept (FE_ALL_EXCEPT);
+ int ret = fesetexcept (exc);
+ if (ret == 0)
+ printf ("fesetexcept (%s) succeeded\n", exc_name);
+ else
+ {
+ printf ("fesetexcept (%s) failed\n", exc_name);
+ if (exc == 0 || EXCEPTION_TESTS (float))
+ {
+ puts ("failure of fesetexcept was unexpected");
+ result = 1;
+ }
+ else
+ puts ("failure of fesetexcept OK, skipping further tests");
+ return result;
+ }
+ ret = fetestexcept (FE_ALL_EXCEPT);
+ if (ret != exc)
+ {
+ printf ("raised exceptions %x, expected %x\n",
+ (unsigned int) ret, (unsigned int) exc);
+ result = 1;
+ }
+
+ ret = feraiseexcept (FE_ALL_EXCEPT);
+ if (ret != 0)
+ {
+ if (exc == 0 && !EXCEPTION_TESTS (float))
+ {
+ puts ("feraiseexcept (FE_ALL_EXCEPT) failed, skipping further tests");
+ return result;
+ }
+ puts ("feraiseexcept (FE_ALL_EXCEPT) unexpectedly failed");
+ result = 1;
+ }
+ ret = fesetexcept (exc);
+ if (ret != 0)
+ {
+ puts ("fesetexcept (second test) unexpectedly failed");
+ result = 1;
+ }
+ ret = fetestexcept (FE_ALL_EXCEPT);
+ if (ret != FE_ALL_EXCEPT)
+ {
+ printf ("raised exceptions (second test) %x, expected %x\n",
+ (unsigned int) ret, (unsigned int) FE_ALL_EXCEPT);
+ result = 1;
+ }
+
+ feclearexcept (FE_ALL_EXCEPT);
+ ret = feraiseexcept (FE_ALL_EXCEPT & ~exc);
+ if (ret != 0)
+ {
+ puts ("feraiseexcept (third test) unexpectedly failed");
+ result = 1;
+ }
+ ret = fesetexcept (exc);
+ if (ret != 0)
+ {
+ puts ("fesetexcept (third test) unexpectedly failed");
+ result = 1;
+ }
+ ret = fetestexcept (FE_ALL_EXCEPT);
+ if (ret != FE_ALL_EXCEPT)
+ {
+ printf ("raised exceptions (third test) %x, expected %x\n",
+ (unsigned int) ret, (unsigned int) FE_ALL_EXCEPT);
+ result = 1;
+ }
+
+ return result;
+}
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ result |= test_fesetexcept (0, "0");
+ result |= test_fesetexcept (FE_ALL_EXCEPT, "FE_ALL_EXCEPT");
+#ifdef FE_DIVBYZERO
+ result |= test_fesetexcept (FE_DIVBYZERO, "FE_DIVBYZERO");
+#endif
+#ifdef FE_INEXACT
+ result |= test_fesetexcept (FE_INEXACT, "FE_INEXACT");
+#endif
+#ifdef FE_INVALID
+ result |= test_fesetexcept (FE_INVALID, "FE_INVALID");
+#endif
+#ifdef FE_OVERFLOW
+ result |= test_fesetexcept (FE_OVERFLOW, "FE_OVERFLOW");
+#endif
+#ifdef FE_UNDERFLOW
+ result |= test_fesetexcept (FE_UNDERFLOW, "FE_UNDERFLOW");
+#endif
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-fetestexceptflag.c b/math/test-fetestexceptflag.c
new file mode 100644
index 0000000000..8122f261f2
--- /dev/null
+++ b/math/test-fetestexceptflag.c
@@ -0,0 +1,130 @@
+/* Test fetestexceptflag.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <stdio.h>
+#include <math-tests.h>
+
+static int
+test_one (int exc_test, int exc_set, int exc_save)
+{
+ int result = 0;
+
+ printf ("Individual test: %x %x %x\n", (unsigned int) exc_test,
+ (unsigned int) exc_set, (unsigned int) exc_save);
+
+ feclearexcept (FE_ALL_EXCEPT);
+ int ret = fesetexcept (exc_set);
+ if (ret != 0)
+ {
+ puts ("fesetexcept failed");
+ if (exc_set == 0 || EXCEPTION_TESTS (float))
+ {
+ puts ("failure of fesetexcept was unexpected");
+ result = 1;
+ }
+ else
+ puts ("failure of fesetexcept OK, skipping further tests");
+ return result;
+ }
+ fexcept_t saved;
+ ret = fegetexceptflag (&saved, exc_save);
+ if (ret == 0)
+ puts ("fegetexceptflag succeeded");
+ else
+ {
+ puts ("fegetexceptflag failed");
+ result = 1;
+ return result;
+ }
+ ret = fetestexceptflag (&saved, exc_test);
+ if (ret == (exc_set & exc_test))
+ puts ("fetestexceptflag result correct");
+ else
+ {
+ printf ("fetestexceptflag returned %x, expected %x\n", ret,
+ exc_set & exc_test);
+ result = 1;
+ }
+ if (exc_save == FE_ALL_EXCEPT)
+ {
+ /* Also test fetestexceptflag testing all exceptions but
+ possibly with only some set. */
+ ret = fetestexceptflag (&saved, FE_ALL_EXCEPT);
+ if (ret == exc_set)
+ puts ("fetestexceptflag (FE_ALL_EXCEPT) result correct");
+ else
+ {
+ printf ("fetestexceptflag (FE_ALL_EXCEPT) returned %x, expected %x\n",
+ ret, exc_set);
+ result = 1;
+ }
+ }
+ return result;
+}
+
+static int
+test_fetestexceptflag (int exc, const char *exc_name)
+{
+ int result = 0;
+
+ printf ("Testing %s\n", exc_name);
+
+ /* Test each case of: whether this exception is set or clear;
+ whether other exceptions are set or clear; whether the whole
+ state is saved or just the state for this exception. */
+ result |= test_one (exc, 0, exc);
+ result |= test_one (exc, 0, FE_ALL_EXCEPT);
+ result |= test_one (exc, exc, exc);
+ result |= test_one (exc, exc, FE_ALL_EXCEPT);
+ result |= test_one (exc, FE_ALL_EXCEPT & ~exc, exc);
+ result |= test_one (exc, FE_ALL_EXCEPT & ~exc, FE_ALL_EXCEPT);
+ result |= test_one (exc, FE_ALL_EXCEPT, exc);
+ result |= test_one (exc, FE_ALL_EXCEPT, FE_ALL_EXCEPT);
+
+ return result;
+}
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ result |= test_fetestexceptflag (0, "0");
+ result |= test_fetestexceptflag (FE_ALL_EXCEPT, "FE_ALL_EXCEPT");
+#ifdef FE_DIVBYZERO
+ result |= test_fetestexceptflag (FE_DIVBYZERO, "FE_DIVBYZERO");
+#endif
+#ifdef FE_INEXACT
+ result |= test_fetestexceptflag (FE_INEXACT, "FE_INEXACT");
+#endif
+#ifdef FE_INVALID
+ result |= test_fetestexceptflag (FE_INVALID, "FE_INVALID");
+#endif
+#ifdef FE_OVERFLOW
+ result |= test_fetestexceptflag (FE_OVERFLOW, "FE_OVERFLOW");
+#endif
+#ifdef FE_UNDERFLOW
+ result |= test_fetestexceptflag (FE_UNDERFLOW, "FE_UNDERFLOW");
+#endif
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-float.h b/math/test-float.h
index e783c094c9..ea096c8aaa 100644
--- a/math/test-float.h
+++ b/math/test-float.h
@@ -28,3 +28,4 @@
/* Use the double variants of macro constants. */
#define LITM(x) x
#define FTOSTR snprintf
+#define snan_value_MACRO SNANF
diff --git a/math/test-iseqsig-excess-precision.c b/math/test-iseqsig-excess-precision.c
new file mode 100644
index 0000000000..01dea1c0a1
--- /dev/null
+++ b/math/test-iseqsig-excess-precision.c
@@ -0,0 +1,80 @@
+/* Test iseqsig with excess precision.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ if (FLT_EVAL_METHOD == 1 || FLT_EVAL_METHOD == 2 || FLT_EVAL_METHOD > 32)
+ {
+ /* Excess precision for float. */
+ if (iseqsig (1.0f, 1.0f + (float) DBL_EPSILON))
+ {
+ puts ("iseqsig removes excess precision float -> double");
+ result = 1;
+ }
+ else
+ puts ("iseqsig preserves excess precision float -> double");
+ if (iseqsig (__builtin_inff (), FLT_MAX * FLT_MAX))
+ {
+ puts ("iseqsig removes excess range float -> double");
+ result = 1;
+ }
+ else
+ puts ("iseqsig preserves excess range float -> double");
+ }
+
+ if (FLT_EVAL_METHOD == 2 || FLT_EVAL_METHOD > 64)
+ {
+ /* Excess precision for float and double. */
+ if (iseqsig (1.0f, 1.0f + (float) LDBL_EPSILON))
+ {
+ puts ("iseqsig removes excess precision float -> long double");
+ result = 1;
+ }
+ else
+ puts ("iseqsig preserves excess precision float -> long double");
+ if (iseqsig (1.0, 1.0 + (double) LDBL_EPSILON))
+ {
+ puts ("iseqsig removes excess precision double -> long double");
+ result = 1;
+ }
+ else
+ puts ("iseqsig preserves excess precision double -> long double");
+ if (LDBL_MAX_EXP >= 2 * DBL_MAX_EXP)
+ {
+ if (iseqsig (__builtin_inf (), DBL_MAX * DBL_MAX))
+ {
+ puts ("iseqsig removes excess range double -> long double");
+ result = 1;
+ }
+ else
+ puts ("iseqsig preserves excess range double -> long double");
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-iszero-excess-precision.c b/math/test-iszero-excess-precision.c
new file mode 100644
index 0000000000..52abc5aae4
--- /dev/null
+++ b/math/test-iszero-excess-precision.c
@@ -0,0 +1,49 @@
+/* Test iszero with excess precision.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+
+#define TEST(TYPE, TRUE_MIN) \
+ do \
+ { \
+ if (iszero (TRUE_MIN / 2)) \
+ puts ("iszero removes excess precision for " #TYPE); \
+ else \
+ { \
+ puts ("iszero fails to remove excess precision for " #TYPE); \
+ result = 1; \
+ } \
+ } \
+ while (0)
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ TEST (float, FLT_TRUE_MIN);
+ TEST (double, DBL_TRUE_MIN);
+ TEST (long double, LDBL_TRUE_MIN);
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-ldouble.h b/math/test-ldouble.h
index b877711758..62c9eb8859 100644
--- a/math/test-ldouble.h
+++ b/math/test-ldouble.h
@@ -27,3 +27,4 @@
#define LIT(x) (x ## L)
#define LITM(x) x ## l
#define FTOSTR snprintf
+#define snan_value_MACRO SNANL
diff --git a/math/test-math-iszero.cc b/math/test-math-iszero.cc
new file mode 100644
index 0000000000..5de251aaa5
--- /dev/null
+++ b/math/test-math-iszero.cc
@@ -0,0 +1,87 @@
+/* Test for the C++ implementation of iszero.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE 1
+#include <math.h>
+#include <stdio.h>
+
+#include <limits>
+
+static bool errors;
+
+static void
+check (int actual, int expected, const char *actual_expr, int line)
+{
+ if (actual != expected)
+ {
+ errors = true;
+ printf ("%s:%d: error: %s\n", __FILE__, line, actual_expr);
+ printf ("%s:%d: expected: %d\n", __FILE__, line, expected);
+ printf ("%s:%d: actual: %d\n", __FILE__, line, actual);
+ }
+}
+
+#define CHECK(actual, expected) \
+ check ((actual), (expected), #actual, __LINE__)
+
+template <class T>
+static void
+check_type ()
+{
+ typedef std::numeric_limits<T> limits;
+ CHECK (iszero (T{}), 1);
+ CHECK (iszero (T{0}), 1);
+ CHECK (iszero (T{-0.0}), 1);
+ CHECK (iszero (T{1}), 0);
+ CHECK (iszero (T{-1}), 0);
+ CHECK (iszero (limits::min ()), 0);
+ CHECK (iszero (-limits::min ()), 0);
+ CHECK (iszero (limits::max ()), 0);
+ CHECK (iszero (-limits::max ()), 0);
+ if (limits::has_infinity)
+ {
+ CHECK (iszero (limits::infinity ()), 0);
+ CHECK (iszero (-limits::infinity ()), 0);
+ }
+ CHECK (iszero (limits::epsilon ()), 0);
+ CHECK (iszero (-limits::epsilon ()), 0);
+ if (limits::has_quiet_NaN)
+ CHECK (iszero (limits::quiet_NaN ()), 0);
+ if (limits::has_signaling_NaN)
+ CHECK (iszero (limits::signaling_NaN ()), 0);
+ if (limits::has_signaling_NaN)
+ CHECK (iszero (limits::signaling_NaN ()), 0);
+ CHECK (iszero (limits::denorm_min ()),
+ std::numeric_limits<T>::has_denorm == std::denorm_absent);
+ CHECK (iszero (-limits::denorm_min ()),
+ std::numeric_limits<T>::has_denorm == std::denorm_absent);
+}
+
+static int
+do_test (void)
+{
+ check_type<float> ();
+ check_type<double> ();
+#ifndef NO_LONG_DOUBLE
+ check_type<long double> ();
+#endif
+ return errors;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/math/test-nan-overflow.c b/math/test-nan-overflow.c
index 40aae2ed14..745a044b96 100644
--- a/math/test-nan-overflow.c
+++ b/math/test-nan-overflow.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/resource.h>
+#include <stdlib.h>
#define STACK_LIM 1048576
#define STRING_SIZE (2 * STACK_LIM)
diff --git a/math/test-tgmath.c b/math/test-tgmath.c
index 70ab42881a..a919c64aab 100644
--- a/math/test-tgmath.c
+++ b/math/test-tgmath.c
@@ -50,7 +50,7 @@ int count_cdouble;
int count_cfloat;
int count_cldouble;
-#define NCALLS 119
+#define NCALLS 125
#define NCALLS_INT 4
#define NCCALLS 47
@@ -285,6 +285,8 @@ F(compile_test) (void)
b = fmax (fmax (a, x), fmax (c, b));
a = fmin (fmin (x, a), fmin (c, b));
b = fma (sin (a), sin (x), sin (c));
+ a = totalorder (totalorder (x, b), totalorder (c, x));
+ b = totalordermag (totalordermag (x, a), totalordermag (c, x));
#ifdef TEST_INT
a = atan2 (i, b);
@@ -381,6 +383,8 @@ F(compile_test) (void)
a = fmax (y, y);
a = fmin (y, y);
a = fma (y, y, y);
+ a = totalorder (y, y);
+ a = totalordermag (y, y);
#ifdef TEST_INT
a = atan2 (i, y);
@@ -874,6 +878,22 @@ TYPE
return x + y + z;
}
+int
+(F(totalorder)) (TYPE x, TYPE y)
+{
+ ++count;
+ P ();
+ return x + y;
+}
+
+int
+(F(totalordermag)) (TYPE x, TYPE y)
+{
+ ++count;
+ P ();
+ return x + y;
+}
+
complex TYPE
(F(cacos)) (complex TYPE x)
{
diff --git a/math/test-tgmath2.c b/math/test-tgmath2.c
index b376fd6a4e..5919159792 100644
--- a/math/test-tgmath2.c
+++ b/math/test-tgmath2.c
@@ -89,12 +89,6 @@ enum
int count;
int counts[Tlast][C_last];
-int
-test (const int Vint4, const long long int Vllong4)
-{
- int result = 0;
- int quo = 0;
-
#define FAIL(str) \
do \
{ \
@@ -138,6 +132,11 @@ test (const int Vint4, const long long int Vllong4)
while (0)
#define TEST(expr, type, fn) TEST2(expr, type, type, fn)
+int
+test_cos (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
TEST (cos (vfloat1), float, cos);
TEST (cos (vdouble1), double, cos);
TEST (cos (vldouble1), ldouble, cos);
@@ -155,6 +154,14 @@ test (const int Vint4, const long long int Vllong4)
TEST (cos (Vcdouble1), cdouble, cos);
TEST (cos (Vcldouble1), cldouble, cos);
+ return result;
+}
+
+int
+test_fabs (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
TEST (fabs (vfloat1), float, fabs);
TEST (fabs (vdouble1), double, fabs);
TEST (fabs (vldouble1), ldouble, fabs);
@@ -180,6 +187,13 @@ test (const int Vint4, const long long int Vllong4)
TEST (fabs (Vcdouble1), double, cabs);
TEST (fabs (Vcldouble1), ldouble, cabs);
+ return result;
+}
+
+int
+test_conj (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
TEST (conj (vfloat1), cfloat, conj);
TEST (conj (vdouble1), cdouble, conj);
TEST (conj (vldouble1), cldouble, conj);
@@ -197,6 +211,14 @@ test (const int Vint4, const long long int Vllong4)
TEST (conj (Vcdouble1), cdouble, conj);
TEST (conj (Vcldouble1), cldouble, conj);
+ return result;
+}
+
+int
+test_expm1 (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
TEST (expm1 (vfloat1), float, expm1);
TEST (expm1 (vdouble1), double, expm1);
TEST (expm1 (vldouble1), ldouble, expm1);
@@ -208,6 +230,13 @@ test (const int Vint4, const long long int Vllong4)
TEST (expm1 (Vint1), double, expm1);
TEST (expm1 (Vllong1), double, expm1);
+ return result;
+}
+
+int
+test_lrint (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
TEST2 (lrint (vfloat1), float, long int, lrint);
TEST2 (lrint (vdouble1), double, long int, lrint);
TEST2 (lrint (vldouble1), ldouble, long int, lrint);
@@ -219,6 +248,14 @@ test (const int Vint4, const long long int Vllong4)
TEST2 (lrint (Vint1), double, long int, lrint);
TEST2 (lrint (Vllong1), double, long int, lrint);
+ return result;
+}
+
+int
+test_ldexp (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
TEST (ldexp (vfloat1, 6), float, ldexp);
TEST (ldexp (vdouble1, 6), double, ldexp);
TEST (ldexp (vldouble1, 6), ldouble, ldexp);
@@ -230,6 +267,9 @@ test (const int Vint4, const long long int Vllong4)
TEST (ldexp (Vint1, 6), double, ldexp);
TEST (ldexp (Vllong1, 6), double, ldexp);
+ return result;
+}
+
#define FIRST(x, y) (y, x)
#define SECOND(x, y) (x, y)
#define NON_LDBL_TEST(fn, argm, arg, type, fnt) \
@@ -307,25 +347,82 @@ test (const int Vint4, const long long int Vllong4)
NON_LDBL_CTEST (fn, FIRST, Vcdouble2, cdouble, fnt); \
NON_LDBL_CTEST (fn, SECOND, Vcdouble2, cdouble, fnt);
+int
+test_atan2 (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
BINARY_TEST (atan2, atan2);
+ return result;
+}
+
+int
+test_remquo (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+ int quo = 0;
+
#define my_remquo(x, y) remquo (x, y, &quo)
BINARY_TEST (my_remquo, remquo);
#undef my_remquo
+ return result;
+}
+
+int
+test_pow (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
BINARY_CTEST (pow, pow);
- /* Testing all arguments of fma would be just too expensive,
- so test just some. */
+ return result;
+}
+
+/* Testing all arguments of fma would be just too expensive,
+ so test just some. */
+
+int
+test_fma_1 (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
#define my_fma(x, y) fma (x, y, vfloat3)
BINARY_TEST (my_fma, fma);
#undef my_fma
+
+ return result;
+}
+
+int
+test_fma_2 (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
#define my_fma(x, y) fma (x, vfloat3, y)
BINARY_TEST (my_fma, fma);
#undef my_fma
+
+ return result;
+}
+
+int
+test_fma_3 (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
+
#define my_fma(x, y) fma (Vfloat3, x, y)
BINARY_TEST (my_fma, fma);
#undef my_fma
+
+ return result;
+}
+
+int
+test_fma_4 (const int Vint4, const long long int Vllong4)
+{
+ int result = 0;
TEST (fma (vdouble1, Vdouble2, vllong3), double, fma);
TEST (fma (vint1, Vint2, vint3), double, fma);
TEST (fma (Vldouble1, vldouble2, Vldouble3), ldouble, fma);
@@ -337,7 +434,23 @@ test (const int Vint4, const long long int Vllong4)
static int
do_test (void)
{
- return test (vint1, vllong1);
+ int result;
+
+ result = test_cos (vint1, vllong1);
+ result |= test_fabs (vint1, vllong1);
+ result |= test_conj (vint1, vllong1);
+ result |= test_expm1 (vint1, vllong1);
+ result |= test_lrint (vint1, vllong1);
+ result |= test_ldexp (vint1, vllong1);
+ result |= test_atan2 (vint1, vllong1);
+ result |= test_remquo (vint1, vllong1);
+ result |= test_pow (vint1, vllong1);
+ result |= test_fma_1 (vint1, vllong1);
+ result |= test_fma_2 (vint1, vllong1);
+ result |= test_fma_3 (vint1, vllong1);
+ result |= test_fma_4 (vint1, vllong1);
+
+ return result;
}
/* Now generate the three functions. */
diff --git a/math/tgmath.h b/math/tgmath.h
index de1eb985fe..0d51ae60be 100644
--- a/math/tgmath.h
+++ b/math/tgmath.h
@@ -437,6 +437,16 @@
#define fma(Val1, Val2, Val3) \
__TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma)
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Total order operation. */
+# define totalorder(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, \
+ totalorder)
+
+/* Total order operation on absolute values. */
+# define totalordermag(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, \
+ totalordermag)
+#endif
+
/* Absolute value, conjugates, and projection. */
diff --git a/misc/getauxval.c b/misc/getauxval.c
index 61113766da..27f4be9d8b 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -23,7 +23,9 @@
unsigned long int
__getauxval (unsigned long int type)
{
+#ifdef HAVE_AUX_VECTOR
ElfW(auxv_t) *p;
+#endif
if (type == AT_HWCAP)
return GLRO(dl_hwcap);
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 6e9b8403d7..50e00e6711 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -153,21 +153,27 @@
# define __errordecl(name, msg) extern void name (void)
#endif
-/* Support for flexible arrays. */
-#if __GNUC_PREREQ (2,97)
-/* GCC 2.97 supports C99 flexible array members. */
+/* Support for flexible arrays.
+ Headers that should use flexible arrays only if they're "real"
+ (e.g. only if they won't affect sizeof()) should test
+ #if __glibc_c99_flexarr_available. */
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __flexarr []
+# define __glibc_c99_flexarr_available 1
+#elif __GNUC_PREREQ (2,97)
+/* GCC 2.97 supports C99 flexible array members as an extension,
+ even when in C89 mode or compiling C++ (any version). */
# define __flexarr []
+# define __glibc_c99_flexarr_available 1
+#elif defined __GNUC__
+/* Pre-2.97 GCC did not support C99 flexible arrays but did have
+ an equivalent extension with slightly different notation. */
+# define __flexarr [0]
+# define __glibc_c99_flexarr_available 1
#else
-# ifdef __GNUC__
-# define __flexarr [0]
-# else
-# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-# define __flexarr []
-# else
/* Some other non-C99 compiler. Approximate with [1]. */
-# define __flexarr [1]
-# endif
-# endif
+# define __flexarr [1]
+# define __glibc_c99_flexarr_available 0
#endif
@@ -466,4 +472,14 @@
# endif
#endif
+/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
+ intended for use in preprocessor macros. */
+#if __GNUC_PREREQ (4,8)
+# define __glibc_macro_warning1(message) _Pragma (#message)
+# define __glibc_macro_warning(message) \
+ __glibc_macro_warning1 (GCC warning message)
+#else
+# define __glibc_macro_warning(msg)
+#endif
+
#endif /* sys/cdefs.h */
diff --git a/misc/sys/select.h b/misc/sys/select.h
index 52dd94fe01..2e4de407d7 100644
--- a/misc/sys/select.h
+++ b/misc/sys/select.h
@@ -38,13 +38,11 @@ typedef __sigset_t sigset_t;
#endif
/* Get definition of timer specification structures. */
-#define __need_time_t
+#include <bits/types/time_t.h>
+#include <bits/types/struct_timeval.h>
#ifdef __USE_XOPEN2K
-# define __need_timespec
+# include <bits/types/struct_timespec.h>
#endif
-#include <time.h>
-#define __need_timeval
-#include <bits/time.h>
#ifndef __suseconds_t_defined
typedef __suseconds_t suseconds_t;
diff --git a/misc/tsearch.c b/misc/tsearch.c
index ffb89ec0f8..c07e606708 100644
--- a/misc/tsearch.c
+++ b/misc/tsearch.c
@@ -83,19 +83,70 @@
In this case, A has been rotated left. This preserves the ordering of the
binary tree. */
+#include <assert.h>
+#include <stdalign.h>
+#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <search.h>
+/* Assume malloc returns naturally aligned (alignof (max_align_t))
+ pointers so we can use the low bits to store some extra info. This
+ works for the left/right node pointers since they are not user
+ visible and always allocated by malloc. The user provides the key
+ pointer and so that can point anywhere and doesn't have to be
+ aligned. */
+#define USE_MALLOC_LOW_BIT 1
+
+#ifndef USE_MALLOC_LOW_BIT
+typedef struct node_t
+{
+ /* Callers expect this to be the first element in the structure - do not
+ move! */
+ const void *key;
+ struct node_t *left_node;
+ struct node_t *right_node;
+ unsigned int is_red:1;
+} *node;
+
+#define RED(N) (N)->is_red
+#define SETRED(N) (N)->is_red = 1
+#define SETBLACK(N) (N)->is_red = 0
+#define SETNODEPTR(NP,P) (*NP) = (P)
+#define LEFT(N) (N)->left_node
+#define LEFTPTR(N) (&(N)->left_node)
+#define SETLEFT(N,L) (N)->left_node = (L)
+#define RIGHT(N) (N)->right_node
+#define RIGHTPTR(N) (&(N)->right_node)
+#define SETRIGHT(N,R) (N)->right_node = (R)
+#define DEREFNODEPTR(NP) (*(NP))
+
+#else /* USE_MALLOC_LOW_BIT */
+
typedef struct node_t
{
/* Callers expect this to be the first element in the structure - do not
move! */
const void *key;
- struct node_t *left;
- struct node_t *right;
- unsigned int red:1;
+ uintptr_t left_node; /* Includes whether the node is red in low-bit. */
+ uintptr_t right_node;
} *node;
+
+#define RED(N) (node)((N)->left_node & ((uintptr_t) 0x1))
+#define SETRED(N) (N)->left_node |= ((uintptr_t) 0x1)
+#define SETBLACK(N) (N)->left_node &= ~((uintptr_t) 0x1)
+#define SETNODEPTR(NP,P) (*NP) = (node)((((uintptr_t)(*NP)) \
+ & (uintptr_t) 0x1) | (uintptr_t)(P))
+#define LEFT(N) (node)((N)->left_node & ~((uintptr_t) 0x1))
+#define LEFTPTR(N) (node *)(&(N)->left_node)
+#define SETLEFT(N,L) (N)->left_node = (((N)->left_node & (uintptr_t) 0x1) \
+ | (uintptr_t)(L))
+#define RIGHT(N) (node)((N)->right_node)
+#define RIGHTPTR(N) (node *)(&(N)->right_node)
+#define SETRIGHT(N,R) (N)->right_node = (uintptr_t)(R)
+#define DEREFNODEPTR(NP) (node)((uintptr_t)(*(NP)) & ~((uintptr_t) 0x1))
+
+#endif /* USE_MALLOC_LOW_BIT */
typedef const struct node_t *const_node;
#undef DEBUGGING
@@ -104,8 +155,6 @@ typedef const struct node_t *const_node;
/* Routines to check tree invariants. */
-#include <assert.h>
-
#define CHECK_TREE(a) check_tree(a)
static void
@@ -117,12 +166,14 @@ check_tree_recurse (node p, int d_sofar, int d_total)
return;
}
- check_tree_recurse (p->left, d_sofar + (p->left && !p->left->red), d_total);
- check_tree_recurse (p->right, d_sofar + (p->right && !p->right->red), d_total);
- if (p->left)
- assert (!(p->left->red && p->red));
- if (p->right)
- assert (!(p->right->red && p->red));
+ check_tree_recurse (LEFT(p), d_sofar + (LEFT(p) && !RED(LEFT(p))),
+ d_total);
+ check_tree_recurse (RIGHT(p), d_sofar + (RIGHT(p) && !RED(RIGHT(p))),
+ d_total);
+ if (LEFT(p))
+ assert (!(RED(LEFT(p)) && RED(p)));
+ if (RIGHT(p))
+ assert (!(RED(RIGHT(p)) && RED(p)));
}
static void
@@ -132,13 +183,12 @@ check_tree (node root)
node p;
if (root == NULL)
return;
- root->red = 0;
- for(p = root->left; p; p = p->left)
- cnt += !p->red;
+ SETBLACK(root);
+ for(p = LEFT(root); p; p = LEFT(p))
+ cnt += !RED(p);
check_tree_recurse (root, 0, cnt);
}
-
#else
#define CHECK_TREE(a)
@@ -155,28 +205,31 @@ static void
maybe_split_for_insert (node *rootp, node *parentp, node *gparentp,
int p_r, int gp_r, int mode)
{
- node root = *rootp;
+ node root = DEREFNODEPTR(rootp);
node *rp, *lp;
- rp = &(*rootp)->right;
- lp = &(*rootp)->left;
+ node rpn, lpn;
+ rp = RIGHTPTR(root);
+ rpn = RIGHT(root);
+ lp = LEFTPTR(root);
+ lpn = LEFT(root);
/* See if we have to split this node (both successors red). */
if (mode == 1
- || ((*rp) != NULL && (*lp) != NULL && (*rp)->red && (*lp)->red))
+ || ((rpn) != NULL && (lpn) != NULL && RED(rpn) && RED(lpn)))
{
/* This node becomes red, its successors black. */
- root->red = 1;
- if (*rp)
- (*rp)->red = 0;
- if (*lp)
- (*lp)->red = 0;
+ SETRED(root);
+ if (rpn)
+ SETBLACK(rpn);
+ if (lpn)
+ SETBLACK(lpn);
/* If the parent of this node is also red, we have to do
rotations. */
- if (parentp != NULL && (*parentp)->red)
+ if (parentp != NULL && RED(DEREFNODEPTR(parentp)))
{
- node gp = *gparentp;
- node p = *parentp;
+ node gp = DEREFNODEPTR(gparentp);
+ node p = DEREFNODEPTR(parentp);
/* There are two main cases:
1. The edge types (left or right) of the two red edges differ.
2. Both red edges are of the same type.
@@ -186,45 +239,45 @@ maybe_split_for_insert (node *rootp, node *parentp, node *gparentp,
{
/* Put the child at the top of the tree, with its parent
and grandparent as successors. */
- p->red = 1;
- gp->red = 1;
- root->red = 0;
+ SETRED(p);
+ SETRED(gp);
+ SETBLACK(root);
if (p_r < 0)
{
/* Child is left of parent. */
- p->left = *rp;
- *rp = p;
- gp->right = *lp;
- *lp = gp;
+ SETLEFT(p,rpn);
+ SETNODEPTR(rp,p);
+ SETRIGHT(gp,lpn);
+ SETNODEPTR(lp,gp);
}
else
{
/* Child is right of parent. */
- p->right = *lp;
- *lp = p;
- gp->left = *rp;
- *rp = gp;
+ SETRIGHT(p,lpn);
+ SETNODEPTR(lp,p);
+ SETLEFT(gp,rpn);
+ SETNODEPTR(rp,gp);
}
- *gparentp = root;
+ SETNODEPTR(gparentp,root);
}
else
{
- *gparentp = *parentp;
+ SETNODEPTR(gparentp,p);
/* Parent becomes the top of the tree, grandparent and
child are its successors. */
- p->red = 0;
- gp->red = 1;
+ SETBLACK(p);
+ SETRED(gp);
if (p_r < 0)
{
/* Left edges. */
- gp->left = p->right;
- p->right = gp;
+ SETLEFT(gp,RIGHT(p));
+ SETRIGHT(p,gp);
}
else
{
/* Right edges. */
- gp->right = p->left;
- p->left = gp;
+ SETRIGHT(gp,LEFT(p));
+ SETLEFT(p,gp);
}
}
}
@@ -237,25 +290,30 @@ maybe_split_for_insert (node *rootp, node *parentp, node *gparentp,
void *
__tsearch (const void *key, void **vrootp, __compar_fn_t compar)
{
- node q;
+ node q, root;
node *parentp = NULL, *gparentp = NULL;
node *rootp = (node *) vrootp;
node *nextp;
int r = 0, p_r = 0, gp_r = 0; /* No they might not, Mr Compiler. */
+#ifdef USE_MALLOC_LOW_BIT
+ static_assert (alignof (max_align_t) > 1, "malloc must return aligned ptrs");
+#endif
+
if (rootp == NULL)
return NULL;
/* This saves some additional tests below. */
- if (*rootp != NULL)
- (*rootp)->red = 0;
+ root = DEREFNODEPTR(rootp);
+ if (root != NULL)
+ SETBLACK(root);
- CHECK_TREE (*rootp);
+ CHECK_TREE (root);
nextp = rootp;
- while (*nextp != NULL)
+ while (DEREFNODEPTR(nextp) != NULL)
{
- node root = *rootp;
+ root = DEREFNODEPTR(rootp);
r = (*compar) (key, root->key);
if (r == 0)
return root;
@@ -265,8 +323,8 @@ __tsearch (const void *key, void **vrootp, __compar_fn_t compar)
That doesn't matter, because the values they contain are never
used again in that case. */
- nextp = r < 0 ? &root->left : &root->right;
- if (*nextp == NULL)
+ nextp = r < 0 ? LEFTPTR(root) : RIGHTPTR(root);
+ if (DEREFNODEPTR(nextp) == NULL)
break;
gparentp = parentp;
@@ -280,10 +338,20 @@ __tsearch (const void *key, void **vrootp, __compar_fn_t compar)
q = (struct node_t *) malloc (sizeof (struct node_t));
if (q != NULL)
{
- *nextp = q; /* link new node to old */
+ /* Make sure the malloc implementation returns naturally aligned
+ memory blocks when expected. Or at least even pointers, so we
+ can use the low bit as red/black flag. Even though we have a
+ static_assert to make sure alignof (max_align_t) > 1 there could
+ be an interposed malloc implementation that might cause havoc by
+ not obeying the malloc contract. */
+#ifdef USE_MALLOC_LOW_BIT
+ assert (((uintptr_t) q & (uintptr_t) 0x1) == 0);
+#endif
+ SETNODEPTR(nextp,q); /* link new node to old */
q->key = key; /* initialize new node */
- q->red = 1;
- q->left = q->right = NULL;
+ SETRED(q);
+ SETLEFT(q,NULL);
+ SETRIGHT(q,NULL);
if (nextp != rootp)
/* There may be two red edges in a row now, which we must avoid by
@@ -303,23 +371,25 @@ weak_alias (__tsearch, tsearch)
void *
__tfind (const void *key, void *const *vrootp, __compar_fn_t compar)
{
+ node root;
node *rootp = (node *) vrootp;
if (rootp == NULL)
return NULL;
- CHECK_TREE (*rootp);
+ root = DEREFNODEPTR(rootp);
+ CHECK_TREE (root);
- while (*rootp != NULL)
+ while (DEREFNODEPTR(rootp) != NULL)
{
- node root = *rootp;
+ root = DEREFNODEPTR(rootp);
int r;
r = (*compar) (key, root->key);
if (r == 0)
return root;
- rootp = r < 0 ? &root->left : &root->right;
+ rootp = r < 0 ? LEFTPTR(root) : RIGHTPTR(root);
}
return NULL;
}
@@ -346,13 +416,14 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
if (rootp == NULL)
return NULL;
- p = *rootp;
+ p = DEREFNODEPTR(rootp);
if (p == NULL)
return NULL;
CHECK_TREE (p);
- while ((cmp = (*compar) (key, (*rootp)->key)) != 0)
+ root = DEREFNODEPTR(rootp);
+ while ((cmp = (*compar) (key, root->key)) != 0)
{
if (sp == stacksize)
{
@@ -363,11 +434,18 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
}
nodestack[sp++] = rootp;
- p = *rootp;
- rootp = ((cmp < 0)
- ? &(*rootp)->left
- : &(*rootp)->right);
- if (*rootp == NULL)
+ p = DEREFNODEPTR(rootp);
+ if (cmp < 0)
+ {
+ rootp = LEFTPTR(p);
+ root = LEFT(p);
+ }
+ else
+ {
+ rootp = RIGHTPTR(p);
+ root = RIGHT(p);
+ }
+ if (root == NULL)
return NULL;
}
@@ -380,16 +458,17 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
it with its successor and unchain the successor. If there is no
successor, we really unchain the node to be deleted. */
- root = *rootp;
+ root = DEREFNODEPTR(rootp);
- r = root->right;
- q = root->left;
+ r = RIGHT(root);
+ q = LEFT(root);
if (q == NULL || r == NULL)
unchained = root;
else
{
- node *parent = rootp, *up = &root->right;
+ node *parentp = rootp, *up = RIGHTPTR(root);
+ node upn;
for (;;)
{
if (sp == stacksize)
@@ -399,34 +478,35 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
newstack = alloca (sizeof (node *) * stacksize);
nodestack = memcpy (newstack, nodestack, sp * sizeof (node *));
}
- nodestack[sp++] = parent;
- parent = up;
- if ((*up)->left == NULL)
+ nodestack[sp++] = parentp;
+ parentp = up;
+ upn = DEREFNODEPTR(up);
+ if (LEFT(upn) == NULL)
break;
- up = &(*up)->left;
+ up = LEFTPTR(upn);
}
- unchained = *up;
+ unchained = DEREFNODEPTR(up);
}
/* We know that either the left or right successor of UNCHAINED is NULL.
R becomes the other one, it is chained into the parent of UNCHAINED. */
- r = unchained->left;
+ r = LEFT(unchained);
if (r == NULL)
- r = unchained->right;
+ r = RIGHT(unchained);
if (sp == 0)
- *rootp = r;
+ SETNODEPTR(rootp,r);
else
{
- q = *nodestack[sp-1];
- if (unchained == q->right)
- q->right = r;
+ q = DEREFNODEPTR(nodestack[sp-1]);
+ if (unchained == RIGHT(q))
+ SETRIGHT(q,r);
else
- q->left = r;
+ SETLEFT(q,r);
}
if (unchained != root)
root->key = unchained->key;
- if (!unchained->red)
+ if (!RED(unchained))
{
/* Now we lost a black edge, which means that the number of black
edges on every path is no longer constant. We must balance the
@@ -435,17 +515,17 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
in the first iteration. */
/* NULL nodes are considered black throughout - this is necessary for
correctness. */
- while (sp > 0 && (r == NULL || !r->red))
+ while (sp > 0 && (r == NULL || !RED(r)))
{
node *pp = nodestack[sp - 1];
- p = *pp;
+ p = DEREFNODEPTR(pp);
/* Two symmetric cases. */
- if (r == p->left)
+ if (r == LEFT(p))
{
/* Q is R's brother, P is R's parent. The subtree with root
R has one black edge less than the subtree with root Q. */
- q = p->right;
- if (q->red)
+ q = RIGHT(p);
+ if (RED(q))
{
/* If Q is red, we know that P is black. We rotate P left
so that Q becomes the top node in the tree, with P below
@@ -454,21 +534,21 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
leaf in the tree, but we will be able to recognize one
of the following situations, which all require that Q
is black. */
- q->red = 0;
- p->red = 1;
+ SETBLACK(q);
+ SETRED(p);
/* Left rotate p. */
- p->right = q->left;
- q->left = p;
- *pp = q;
+ SETRIGHT(p,LEFT(q));
+ SETLEFT(q,p);
+ SETNODEPTR(pp,q);
/* Make sure pp is right if the case below tries to use
it. */
- nodestack[sp++] = pp = &q->left;
- q = p->right;
+ nodestack[sp++] = pp = LEFTPTR(q);
+ q = RIGHT(p);
}
/* We know that Q can't be NULL here. We also know that Q is
black. */
- if ((q->left == NULL || !q->left->red)
- && (q->right == NULL || !q->right->red))
+ if ((LEFT(q) == NULL || !RED(LEFT(q)))
+ && (RIGHT(q) == NULL || !RED(RIGHT(q))))
{
/* Q has two black successors. We can simply color Q red.
The whole subtree with root P is now missing one black
@@ -478,7 +558,7 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
valid and also makes the black edge count come out
right. If P is black, we are at least one step closer
to the root and we'll try again the next iteration. */
- q->red = 1;
+ SETRED(q);
r = p;
}
else
@@ -486,7 +566,7 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
/* Q is black, one of Q's successors is red. We can
repair the tree with one operation and will exit the
loop afterwards. */
- if (q->right == NULL || !q->right->red)
+ if (RIGHT(q) == NULL || !RED(RIGHT(q)))
{
/* The left one is red. We perform the same action as
in maybe_split_for_insert where two red edges are
@@ -498,14 +578,17 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
P becomes black, and Q2 gets the color that P had.
This changes the black edge count only for node R and
its successors. */
- node q2 = q->left;
- q2->red = p->red;
- p->right = q2->left;
- q->left = q2->right;
- q2->right = q;
- q2->left = p;
- *pp = q2;
- p->red = 0;
+ node q2 = LEFT(q);
+ if (RED(p))
+ SETRED(q2);
+ else
+ SETBLACK(q2);
+ SETRIGHT(p,LEFT(q2));
+ SETLEFT(q,RIGHT(q2));
+ SETRIGHT(q2,q);
+ SETLEFT(q2,p);
+ SETNODEPTR(pp,q2);
+ SETBLACK(p);
}
else
{
@@ -513,15 +596,18 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
and Q gets the color that P had. Q's right successor
also becomes black. This changes the black edge
count only for node R and its successors. */
- q->red = p->red;
- p->red = 0;
+ if (RED(p))
+ SETRED(q);
+ else
+ SETBLACK(q);
+ SETBLACK(p);
- q->right->red = 0;
+ SETBLACK(RIGHT(q));
/* left rotate p */
- p->right = q->left;
- q->left = p;
- *pp = q;
+ SETRIGHT(p,LEFT(q));
+ SETLEFT(q,p);
+ SETNODEPTR(pp,q);
}
/* We're done. */
@@ -532,44 +618,50 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
else
{
/* Comments: see above. */
- q = p->left;
- if (q->red)
+ q = LEFT(p);
+ if (RED(q))
{
- q->red = 0;
- p->red = 1;
- p->left = q->right;
- q->right = p;
- *pp = q;
- nodestack[sp++] = pp = &q->right;
- q = p->left;
+ SETBLACK(q);
+ SETRED(p);
+ SETLEFT(p,RIGHT(q));
+ SETRIGHT(q,p);
+ SETNODEPTR(pp,q);
+ nodestack[sp++] = pp = RIGHTPTR(q);
+ q = LEFT(p);
}
- if ((q->right == NULL || !q->right->red)
- && (q->left == NULL || !q->left->red))
+ if ((RIGHT(q) == NULL || !RED(RIGHT(q)))
+ && (LEFT(q) == NULL || !RED(LEFT(q))))
{
- q->red = 1;
+ SETRED(q);
r = p;
}
else
{
- if (q->left == NULL || !q->left->red)
+ if (LEFT(q) == NULL || !RED(LEFT(q)))
{
- node q2 = q->right;
- q2->red = p->red;
- p->left = q2->right;
- q->right = q2->left;
- q2->left = q;
- q2->right = p;
- *pp = q2;
- p->red = 0;
+ node q2 = RIGHT(q);
+ if (RED(p))
+ SETRED(q2);
+ else
+ SETBLACK(q2);
+ SETLEFT(p,RIGHT(q2));
+ SETRIGHT(q,LEFT(q2));
+ SETLEFT(q2,q);
+ SETRIGHT(q2,p);
+ SETNODEPTR(pp,q2);
+ SETBLACK(p);
}
else
{
- q->red = p->red;
- p->red = 0;
- q->left->red = 0;
- p->left = q->right;
- q->right = p;
- *pp = q;
+ if (RED(p))
+ SETRED(q);
+ else
+ SETBLACK(q);
+ SETBLACK(p);
+ SETBLACK(LEFT(q));
+ SETLEFT(p,RIGHT(q));
+ SETRIGHT(q,p);
+ SETNODEPTR(pp,q);
}
sp = 1;
r = NULL;
@@ -578,7 +670,7 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
--sp;
}
if (r != NULL)
- r->red = 0;
+ SETBLACK(r);
}
free (unchained);
@@ -597,16 +689,16 @@ trecurse (const void *vroot, __action_fn_t action, int level)
{
const_node root = (const_node) vroot;
- if (root->left == NULL && root->right == NULL)
+ if (LEFT(root) == NULL && RIGHT(root) == NULL)
(*action) (root, leaf, level);
else
{
(*action) (root, preorder, level);
- if (root->left != NULL)
- trecurse (root->left, action, level + 1);
+ if (LEFT(root) != NULL)
+ trecurse (LEFT(root), action, level + 1);
(*action) (root, postorder, level);
- if (root->right != NULL)
- trecurse (root->right, action, level + 1);
+ if (RIGHT(root) != NULL)
+ trecurse (RIGHT(root), action, level + 1);
(*action) (root, endorder, level);
}
}
@@ -620,7 +712,7 @@ __twalk (const void *vroot, __action_fn_t action)
{
const_node root = (const_node) vroot;
- CHECK_TREE (root);
+ CHECK_TREE ((node) root);
if (root != NULL && action != NULL)
trecurse (root, action, 0);
@@ -636,10 +728,10 @@ static void
internal_function
tdestroy_recurse (node root, __free_fn_t freefct)
{
- if (root->left != NULL)
- tdestroy_recurse (root->left, freefct);
- if (root->right != NULL)
- tdestroy_recurse (root->right, freefct);
+ if (LEFT(root) != NULL)
+ tdestroy_recurse (LEFT(root), freefct);
+ if (RIGHT(root) != NULL)
+ tdestroy_recurse (RIGHT(root), freefct);
(*freefct) ((void *) root->key);
/* Free the node itself. */
free (root);
diff --git a/nis/rpcsvc/nislib.h b/nis/rpcsvc/nislib.h
index 21a8e4873d..1a7c3c54c1 100644
--- a/nis/rpcsvc/nislib.h
+++ b/nis/rpcsvc/nislib.h
@@ -19,7 +19,7 @@
#ifndef __RPCSVC_NISLIB_H__
#define __RPCSVC_NISLIB_H__
-#include <features.h>
+#include <rpcsvc/nis.h>
__BEGIN_DECLS
diff --git a/nptl/Makefile b/nptl/Makefile
index 2ddcd2b4e4..11588fe996 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -33,6 +33,18 @@ routines = alloca_cutoff forward libc-lowlevellock libc-cancellation \
register-atfork unregister-atfork
shared-only-routines = forward
+# We need to provide certain routines for compatibility with existing
+# binaries.
+pthread-compat-wrappers = \
+ write read close fcntl accept \
+ connect recv recvfrom send \
+ sendto fsync lseek lseek64 \
+ msync nanosleep open open64 pause \
+ pread pread64 pwrite pwrite64 \
+ tcdrain wait waitpid msgrcv msgsnd \
+ sigwait sigsuspend \
+ recvmsg sendmsg
+
libpthread-routines = nptl-init vars events version pt-interp \
pthread_create pthread_exit pthread_detach \
pthread_join pthread_tryjoin pthread_timedjoin \
@@ -108,14 +120,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
lowlevellock lowlevelrobustlock \
lll_timedlock_wait lll_timedwait_tid \
pt-fork pt-vfork \
- ptw-write ptw-read ptw-close ptw-fcntl ptw-accept \
- ptw-connect ptw-recv ptw-recvfrom ptw-send \
- ptw-sendto ptw-fsync ptw-lseek ptw-llseek \
- ptw-msync ptw-nanosleep ptw-open ptw-open64 ptw-pause \
- ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
- ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
- ptw-sigwait ptw-sigsuspend \
- ptw-recvmsg ptw-sendmsg \
+ $(pthread-compat-wrappers) \
pt-raise pt-system \
flockfile ftrylockfile funlockfile \
sigaction \
@@ -241,7 +246,7 @@ tests = tst-typesizes \
tst-key1 tst-key2 tst-key3 tst-key4 \
tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \
tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 tst-sem14 \
- tst-sem15 \
+ tst-sem15 tst-sem16 \
tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 tst-barrier5 \
tst-align tst-align3 \
tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \
@@ -268,7 +273,7 @@ tests = tst-typesizes \
tst-flock1 tst-flock2 \
tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
tst-signal6 tst-signal7 \
- tst-exec1 tst-exec2 tst-exec3 tst-exec4 \
+ tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \
tst-exit1 tst-exit2 tst-exit3 \
tst-stdio1 tst-stdio2 \
tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 60b34dc6fc..3016a2ed5c 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -1207,9 +1207,12 @@ init_one_static_tls (struct pthread *curp, struct link_map *map)
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
# endif
- /* We cannot delay the initialization of the Static TLS area, since
- it can be accessed with LE or IE, but since the DTV is only used
- by GD and LD, we can delay its update to avoid a race. */
+ /* Fill in the DTV slot so that a later LD/GD access will find it. */
+ dtv_t *dtv = GET_DTV (TLS_TPADJ (curp));
+ dtv[map->l_tls_modid].pointer.to_free = NULL;
+ dtv[map->l_tls_modid].pointer.val = dest;
+
+ /* Initialize the memory. */
memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),
'\0', map->l_tls_blocksize - map->l_tls_initimage_size);
}
diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c
index a1cc286685..a19cd59548 100644
--- a/nptl/pt-longjmp.c
+++ b/nptl/pt-longjmp.c
@@ -32,24 +32,12 @@
# if HAVE_IFUNC
-static __typeof (longjmp) *
-__attribute__ ((used))
-longjmp_resolve (void)
-{
- return &__libc_longjmp;
-}
+# undef INIT_ARCH
+# define INIT_ARCH()
+# define DEFINE_LONGJMP(name) libc_ifunc (name, &__libc_longjmp)
-# ifdef HAVE_ASM_SET_DIRECTIVE
-# define DEFINE_LONGJMP(name) \
- asm (".set " #name ", longjmp_resolve\n" \
- ".globl " #name "\n" \
- ".type " #name ", %gnu_indirect_function");
-# else
-# define DEFINE_LONGJMP(name) \
- asm (#name " = longjmp_resolve\n" \
- ".globl " #name "\n" \
- ".type " #name ", %gnu_indirect_function");
-# endif
+extern __typeof(longjmp) longjmp_ifunc;
+extern __typeof(siglongjmp) siglongjmp_ifunc;
# else /* !HAVE_IFUNC */
@@ -66,7 +54,7 @@ longjmp_compat (jmp_buf env, int val)
DEFINE_LONGJMP (longjmp_ifunc)
compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0);
-DEFINE_LONGJMP (siglongjmp_ifunc)
+strong_alias (longjmp_ifunc, siglongjmp_ifunc)
compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0);
#endif
diff --git a/nptl/pt-system.c b/nptl/pt-system.c
index 56f2a8901f..cc415daa3d 100644
--- a/nptl/pt-system.c
+++ b/nptl/pt-system.c
@@ -32,21 +32,10 @@
# if HAVE_IFUNC
-static __typeof (system) *
-__attribute__ ((used))
-system_resolve (void)
-{
- return &__libc_system;
-}
-
-asm (".globl system_ifunc\n"
- ".type system_ifunc, %gnu_indirect_function");
-
-# ifdef HAVE_ASM_SET_DIRECTIVE
-asm (".set system_ifunc, system_resolve");
-# else
-asm ("system_ifunc = system_resolve");
-# endif
+extern __typeof(system) system_ifunc;
+# undef INIT_ARCH
+# define INIT_ARCH()
+libc_ifunc (system_ifunc, &__libc_system)
# else /* !HAVE_IFUNC */
diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c
index 8f4be0c4b3..563e3ec12f 100644
--- a/nptl/pt-vfork.c
+++ b/nptl/pt-vfork.c
@@ -46,32 +46,20 @@
extern __typeof (vfork) __libc_vfork; /* Defined in libc. */
-static __typeof (vfork) *
-__attribute__ ((used))
-vfork_resolve (void)
-{
- return &__libc_vfork;
-}
+# undef INIT_ARCH
+# define INIT_ARCH()
+# define DEFINE_VFORK(name) libc_ifunc (name, &__libc_vfork)
-# ifdef HAVE_ASM_SET_DIRECTIVE
-# define DEFINE_VFORK(name) \
- asm (".set " #name ", vfork_resolve\n" \
- ".globl " #name "\n" \
- ".type " #name ", %gnu_indirect_function");
-# else
-# define DEFINE_VFORK(name) \
- asm (#name " = vfork_resolve\n" \
- ".globl " #name "\n" \
- ".type " #name ", %gnu_indirect_function");
-# endif
#endif
#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20)
+extern __typeof(vfork) vfork_ifunc;
DEFINE_VFORK (vfork_ifunc)
compat_symbol (libpthread, vfork_ifunc, vfork, GLIBC_2_0);
#endif
#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
+extern __typeof(vfork) __vfork_ifunc;
DEFINE_VFORK (__vfork_ifunc)
compat_symbol (libpthread, __vfork_ifunc, __vfork, GLIBC_2_1_2);
#endif
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 4edc74b1ef..6e0dd09f4f 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -491,6 +491,7 @@ extern int __pthread_setcanceltype (int type, int *oldtype);
extern int __pthread_enable_asynccancel (void) attribute_hidden;
extern void __pthread_disable_asynccancel (int oldtype)
internal_function attribute_hidden;
+extern void __pthread_testcancel (void);
#if IS_IN (libpthread)
hidden_proto (__pthread_mutex_init)
@@ -505,6 +506,7 @@ hidden_proto (__pthread_getspecific)
hidden_proto (__pthread_setspecific)
hidden_proto (__pthread_once)
hidden_proto (__pthread_setcancelstate)
+hidden_proto (__pthread_testcancel)
#endif
extern int __pthread_cond_broadcast_2_0 (pthread_cond_2_0_t *cond);
diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c
index a6cadd491d..112f748a6b 100644
--- a/nptl/pthread_rwlock_unlock.c
+++ b/nptl/pthread_rwlock_unlock.c
@@ -35,6 +35,10 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
LIBC_PROBE (rwlock_unlock, 1, rwlock);
+ /* Trying to elide an unlocked lock may crash the process. This
+ is expected and is compatible with POSIX.1-2008: "results are
+ undefined if the read-write lock rwlock is not held by the
+ calling thread". */
if (ELIDE_UNLOCK (rwlock->__data.__writer == 0
&& rwlock->__data.__nr_readers == 0))
return 0;
diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c
index 51be09fc5b..fdef69967b 100644
--- a/nptl/pthread_testcancel.c
+++ b/nptl/pthread_testcancel.c
@@ -21,7 +21,9 @@
void
-pthread_testcancel (void)
+__pthread_testcancel (void)
{
CANCELLATION_P (THREAD_SELF);
}
+strong_alias (__pthread_testcancel, pthread_testcancel)
+hidden_def (__pthread_testcancel)
diff --git a/nptl/sem_init.c b/nptl/sem_init.c
index be0f27dbdf..9380a2176a 100644
--- a/nptl/sem_init.c
+++ b/nptl/sem_init.c
@@ -49,6 +49,8 @@ __new_sem_init (sem_t *sem, int pshared, unsigned int value)
isem->data = value;
#else
isem->value = value << SEM_VALUE_SHIFT;
+ /* pad is used as a mutex on pre-v9 sparc and ignored otherwise. */
+ isem->pad = 0;
isem->nwaiters = 0;
#endif
diff --git a/nptl/sem_open.c b/nptl/sem_open.c
index 911b1f30a9..d10828637a 100644
--- a/nptl/sem_open.c
+++ b/nptl/sem_open.c
@@ -31,7 +31,7 @@
#include "semaphoreP.h"
#include <shm-directory.h>
#include <futex-internal.h>
-
+#include <libc-lock.h>
/* Comparison function for search of existing mapping. */
int
@@ -153,6 +153,13 @@ sem_open (const char *name, int oflag, ...)
/* Create the name of the final file in local variable SHM_NAME. */
SHM_GET_NAME (EINVAL, SEM_FAILED, SEM_SHM_PREFIX);
+ /* Disable asynchronous cancellation. */
+#ifdef __libc_ptf_call
+ int state;
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state), 0);
+#endif
+
/* If the semaphore object has to exist simply open it. */
if ((oflag & O_CREAT) == 0 || (oflag & O_EXCL) == 0)
{
@@ -193,7 +200,8 @@ sem_open (const char *name, int oflag, ...)
if (value > SEM_VALUE_MAX)
{
__set_errno (EINVAL);
- return SEM_FAILED;
+ result = SEM_FAILED;
+ goto out;
}
/* Create the initial file content. */
@@ -207,6 +215,8 @@ sem_open (const char *name, int oflag, ...)
sem.newsem.data = value;
#else
sem.newsem.value = value << SEM_VALUE_SHIFT;
+ /* pad is used as a mutex on pre-v9 sparc and ignored otherwise. */
+ sem.newsem.pad = 0;
sem.newsem.nwaiters = 0;
#endif
/* This always is a shared semaphore. */
@@ -231,7 +241,10 @@ sem_open (const char *name, int oflag, ...)
mode cannot later be set since then we cannot apply the
file create mask. */
if (__mktemp (tmpfname) == NULL)
- return SEM_FAILED;
+ {
+ result = SEM_FAILED;
+ goto out;
+ }
/* Open the file. Make sure we do not overwrite anything. */
fd = __libc_open (tmpfname, O_RDWR | O_CREAT | O_EXCL, mode);
@@ -245,7 +258,8 @@ sem_open (const char *name, int oflag, ...)
__set_errno (EAGAIN);
}
- return SEM_FAILED;
+ result = SEM_FAILED;
+ goto out;
}
/* We got a file. */
@@ -306,5 +320,10 @@ sem_open (const char *name, int oflag, ...)
errno = save;
}
+out:
+#ifdef __libc_ptf_call
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+#endif
+
return result;
}
diff --git a/nptl/sem_timedwait.c b/nptl/sem_timedwait.c
index 1aab25a7cf..a02e1785b7 100644
--- a/nptl/sem_timedwait.c
+++ b/nptl/sem_timedwait.c
@@ -30,6 +30,9 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime)
return -1;
}
+ /* Check sem_wait.c for a more detailed explanation why it is required. */
+ __pthread_testcancel ();
+
if (__new_sem_wait_fast ((struct new_sem *) sem, 0) == 0)
return 0;
else
diff --git a/nptl/sem_wait.c b/nptl/sem_wait.c
index 84b523a768..b242c08d2e 100644
--- a/nptl/sem_wait.c
+++ b/nptl/sem_wait.c
@@ -23,6 +23,19 @@
int
__new_sem_wait (sem_t *sem)
{
+ /* We need to check whether we need to act upon a cancellation request here
+ because POSIX specifies that cancellation points "shall occur" in
+ sem_wait and sem_timedwait, which also means that they need to check
+ this regardless whether they block or not (unlike "may occur"
+ functions). See the POSIX Rationale for this requirement: Section
+ "Thread Cancellation Overview" [1] and austin group issue #1076 [2]
+ for thoughs on why this may be a suboptimal design.
+
+ [1] http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html
+ [2] http://austingroupbugs.net/view.php?id=1076 for thoughts on why this
+ */
+ __pthread_testcancel ();
+
if (__new_sem_wait_fast ((struct new_sem *) sem, 0) == 0)
return 0;
else
diff --git a/nptl/tst-basic1.c b/nptl/tst-basic1.c
index 8ea4523074..72c6234e0b 100644
--- a/nptl/tst-basic1.c
+++ b/nptl/tst-basic1.c
@@ -22,6 +22,11 @@
#include <sys/types.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static pid_t pid;
static void *
@@ -29,7 +34,7 @@ tf (void *a)
{
if (getpid () != pid)
{
- write (2, "pid mismatch\n", 13);
+ write_message ("pid mismatch\n");
_exit (1);
}
@@ -49,7 +54,7 @@ do_test (void)
for (i = 0; i < N; ++i)
if (pthread_create (&t[i], NULL, tf, (void *) (long int) (i + 1)) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
else
@@ -66,7 +71,7 @@ do_test (void)
}
else if (r != (void *) (long int) (i + 1))
{
- write (2, "result wrong\n", 13);
+ write_message ("result wrong\n");
_exit (1);
}
else
@@ -75,7 +80,3 @@ do_test (void)
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-cancel12.c b/nptl/tst-cancel12.c
index ac8f5a0559..a720ccfaf0 100644
--- a/nptl/tst-cancel12.c
+++ b/nptl/tst-cancel12.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Test sem_wait cancellation for uncontended case.
+ Copyright (C) 2003-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -39,8 +40,6 @@ cleanup (void *arg)
puts ("second call to cleanup");
exit (1);
}
-
- printf ("cleanup call #%d\n", ncall);
}
@@ -52,17 +51,15 @@ tf (void *arg)
int e = pthread_barrier_wait (&bar);
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("tf: 1st barrier_wait failed");
+ puts ("error: tf: 1st barrier_wait failed");
exit (1);
}
- /* This call should block and be cancelable. */
+ /* This call should be cancelable. */
sem_wait (&sem);
pthread_cleanup_pop (0);
- puts ("sem_wait returned");
-
return NULL;
}
@@ -74,47 +71,47 @@ do_test (void)
if (pthread_barrier_init (&bar, NULL, 2) != 0)
{
- puts ("barrier_init failed");
+ puts ("error: barrier_init failed");
exit (1);
}
+ /* A value higher than 0 will check for uncontended pthread cancellation,
+ where the sem_wait operation will return immediatelly. */
if (sem_init (&sem, 0, 1) != 0)
{
- puts ("sem_init failed");
+ puts ("error: sem_init failed");
exit (1);
}
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- puts ("create failed");
+ puts ("error: create failed");
exit (1);
}
- /* Check whether cancellation is honored even before sem_wait does
- anything. */
if (pthread_cancel (th) != 0)
{
- puts ("1st cancel failed");
+ puts ("error: pthread_cancel failed");
exit (1);
}
int e = pthread_barrier_wait (&bar);
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("1st barrier_wait failed");
+ puts ("error: 1st barrier_wait failed");
exit (1);
}
void *r;
if (pthread_join (th, &r) != 0)
{
- puts ("join failed");
+ puts ("error: pthread_join failed");
exit (1);
}
if (r != PTHREAD_CANCELED)
{
- puts ("thread not canceled");
+ puts ("error: thread not canceled");
exit (1);
}
diff --git a/nptl/tst-cancel13.c b/nptl/tst-cancel13.c
index c84780ded3..ee39b963ad 100644
--- a/nptl/tst-cancel13.c
+++ b/nptl/tst-cancel13.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Test sem_wait cancellation for contended case.
+ Copyright (C) 2003-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -39,8 +40,6 @@ cleanup (void *arg)
puts ("second call to cleanup");
exit (1);
}
-
- printf ("cleanup call #%d\n", ncall);
}
@@ -52,7 +51,7 @@ tf (void *arg)
int e = pthread_barrier_wait (&bar);
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("tf: 1st barrier_wait failed");
+ puts ("error: tf: 1st barrier_wait failed");
exit (1);
}
@@ -61,8 +60,6 @@ tf (void *arg)
pthread_cleanup_pop (0);
- puts ("sem_wait returned");
-
return NULL;
}
@@ -74,26 +71,28 @@ do_test (void)
if (pthread_barrier_init (&bar, NULL, 2) != 0)
{
- puts ("barrier_init failed");
+ puts ("error: barrier_init failed");
exit (1);
}
+ /* A value equal to 0 will check for contended pthread cancellation,
+ where the sem_wait operation will block. */
if (sem_init (&sem, 0, 0) != 0)
{
- puts ("sem_init failed");
+ puts ("error: sem_init failed");
exit (1);
}
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- puts ("create failed");
+ puts ("error: create failed");
exit (1);
}
int e = pthread_barrier_wait (&bar);
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("1st barrier_wait failed");
+ puts ("error: 1st barrier_wait failed");
exit (1);
}
@@ -103,14 +102,14 @@ do_test (void)
/* Check whether cancellation is honored when waiting in sem_wait. */
if (pthread_cancel (th) != 0)
{
- puts ("1st cancel failed");
+ puts ("error: 1st cancel failed");
exit (1);
}
void *r;
if (pthread_join (th, &r) != 0)
{
- puts ("join failed");
+ puts ("error: join failed");
exit (1);
}
diff --git a/nptl/tst-cancel14.c b/nptl/tst-cancel14.c
index 3810d2b289..b6fcbb774d 100644
--- a/nptl/tst-cancel14.c
+++ b/nptl/tst-cancel14.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Test sem_timedwait cancellation for uncontended case.
+ Copyright (C) 2003-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -40,8 +41,6 @@ cleanup (void *arg)
puts ("second call to cleanup");
exit (1);
}
-
- printf ("cleanup call #%d\n", ncall);
}
@@ -53,7 +52,7 @@ tf (void *arg)
int e = pthread_barrier_wait (&bar);
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("tf: 1st barrier_wait failed");
+ puts ("error: tf: 1st barrier_wait failed");
exit (1);
}
@@ -71,8 +70,6 @@ tf (void *arg)
pthread_cleanup_pop (0);
- puts ("sem_timedwait returned");
-
return NULL;
}
@@ -84,19 +81,19 @@ do_test (void)
if (pthread_barrier_init (&bar, NULL, 2) != 0)
{
- puts ("barrier_init failed");
+ puts ("error: barrier_init failed");
exit (1);
}
if (sem_init (&sem, 0, 1) != 0)
{
- puts ("sem_init failed");
+ puts ("error: sem_init failed");
exit (1);
}
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- puts ("create failed");
+ puts ("error: create failed");
exit (1);
}
@@ -104,7 +101,7 @@ do_test (void)
anything. */
if (pthread_cancel (th) != 0)
{
- puts ("1st cancel failed");
+ puts ("error: 1st cancel failed");
exit (1);
}
diff --git a/nptl/tst-cancel15.c b/nptl/tst-cancel15.c
index f413839ec2..c8db3e42b2 100644
--- a/nptl/tst-cancel15.c
+++ b/nptl/tst-cancel15.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Test sem_timedwait cancellation for contended case.
+ Copyright (C) 2003-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -40,8 +41,6 @@ cleanup (void *arg)
puts ("second call to cleanup");
exit (1);
}
-
- printf ("cleanup call #%d\n", ncall);
}
@@ -55,7 +54,7 @@ tf (void *arg)
e = pthread_barrier_wait (&bar);
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("tf: 1st barrier_wait failed");
+ puts ("error: tf: 1st barrier_wait failed");
exit (1);
}
@@ -74,8 +73,6 @@ tf (void *arg)
pthread_cleanup_pop (0);
- printf ("sem_timedwait returned, e = %d, errno = %d\n", e, errno);
-
return NULL;
}
@@ -87,26 +84,26 @@ do_test (void)
if (pthread_barrier_init (&bar, NULL, 2) != 0)
{
- puts ("barrier_init failed");
+ puts ("error: barrier_init failed");
exit (1);
}
if (sem_init (&sem, 0, 0) != 0)
{
- puts ("sem_init failed");
+ puts ("error: sem_init failed");
exit (1);
}
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- puts ("create failed");
+ puts ("error: create failed");
exit (1);
}
int e = pthread_barrier_wait (&bar);
if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
{
- puts ("1st barrier_wait failed");
+ puts ("error: 1st barrier_wait failed");
exit (1);
}
@@ -116,20 +113,20 @@ do_test (void)
/* Check whether cancellation is honored when waiting in sem_timedwait. */
if (pthread_cancel (th) != 0)
{
- puts ("1st cancel failed");
+ puts ("error: 1st cancel failed");
exit (1);
}
void *r;
if (pthread_join (th, &r) != 0)
{
- puts ("join failed");
+ puts ("error: join failed");
exit (1);
}
if (r != PTHREAD_CANCELED)
{
- puts ("thread not canceled");
+ puts ("error: thread not canceled");
exit (1);
}
diff --git a/nptl/tst-cleanup1.c b/nptl/tst-cleanup1.c
index 82a568b072..ef02ef6e4e 100644
--- a/nptl/tst-cleanup1.c
+++ b/nptl/tst-cleanup1.c
@@ -22,6 +22,11 @@
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int global;
@@ -67,7 +72,7 @@ do_test (void)
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
@@ -93,7 +98,3 @@ do_test (void)
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-cleanup3.c b/nptl/tst-cleanup3.c
index 3c34a1e0de..c4f51e35d0 100644
--- a/nptl/tst-cleanup3.c
+++ b/nptl/tst-cleanup3.c
@@ -22,6 +22,11 @@
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int global;
@@ -65,7 +70,7 @@ do_test (void)
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
@@ -91,7 +96,3 @@ do_test (void)
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-cond3.c b/nptl/tst-cond3.c
index ff904e4378..546564fad0 100644
--- a/nptl/tst-cond3.c
+++ b/nptl/tst-cond3.c
@@ -22,6 +22,10 @@
#include <string.h>
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
/* Note that this test requires more than the standard. It is
required that there are no spurious wakeups if only more readers
@@ -50,7 +54,8 @@ tf (void *arg)
}
/* This call should never return. */
- pthread_cond_wait (&cond, &mut);
+ xpthread_cond_wait (&cond, &mut);
+ puts ("error: pthread_cond_wait in tf returned");
/* We should never get here. */
exit (1);
@@ -96,17 +101,11 @@ do_test (void)
}
}
- /* Set an alarm for 1 second. The wrapper will expect this. */
- alarm (1);
+ delayed_exit (1);
/* This call should never return. */
- pthread_cond_wait (&cond, &mut);
+ xpthread_cond_wait (&cond, &mut);
- puts ("cond_wait returned");
+ puts ("error: pthread_cond_wait in do_test returned");
return 1;
}
-
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-eintr1.c b/nptl/tst-eintr1.c
index 11cd876a74..0946894fbe 100644
--- a/nptl/tst-eintr1.c
+++ b/nptl/tst-eintr1.c
@@ -23,6 +23,11 @@
#include <stdlib.h>
#include <string.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
#include "eintr.c"
@@ -92,13 +97,8 @@ do_test (void)
}
}
+ delayed_exit (3);
+ /* This call must never return. */
(void) tf1 (NULL);
- /* NOTREACHED */
-
- return 0;
+ return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 3
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-eintr2.c b/nptl/tst-eintr2.c
index 7f50f4bcf4..0ef6d30474 100644
--- a/nptl/tst-eintr2.c
+++ b/nptl/tst-eintr2.c
@@ -24,6 +24,11 @@
#include <string.h>
#include <sys/time.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
#include "eintr.c"
@@ -103,6 +108,7 @@ do_test (void)
exit (1);
}
+ delayed_exit (3);
/* This call must never return. */
e = pthread_mutex_lock (&m1);
printf ("main: mutex_lock returned: %s\n",
@@ -110,8 +116,3 @@ do_test (void)
return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 3
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-eintr3.c b/nptl/tst-eintr3.c
index d2c32b970a..f6b2ccf681 100644
--- a/nptl/tst-eintr3.c
+++ b/nptl/tst-eintr3.c
@@ -23,6 +23,11 @@
#include <stdlib.h>
#include <string.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
#include "eintr.c"
@@ -56,16 +61,9 @@ do_test (void)
exit (1);
}
+ delayed_exit (1);
/* This call must never return. */
- e = pthread_join (th, NULL);
-
- if (e == EINTR)
- puts ("pthread_join returned with EINTR");
-
- return 0;
+ xpthread_join (th);
+ puts ("error: pthread_join returned");
+ return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 1
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-eintr4.c b/nptl/tst-eintr4.c
index 25fae34560..f6d068f334 100644
--- a/nptl/tst-eintr4.c
+++ b/nptl/tst-eintr4.c
@@ -23,6 +23,11 @@
#include <stdlib.h>
#include <string.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
#include "eintr.c"
@@ -40,16 +45,9 @@ do_test (void)
exit (1);
}
+ delayed_exit (1);
/* This call must never return. */
- int e = pthread_barrier_wait (&b);
-
- if (e == EINTR)
- puts ("pthread_join returned with EINTR");
-
- return 0;
+ xpthread_barrier_wait (&b);
+ puts ("error: pthread_barrier_wait returned");
+ return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 1
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-eintr5.c b/nptl/tst-eintr5.c
index be6731c798..81f900e8b9 100644
--- a/nptl/tst-eintr5.c
+++ b/nptl/tst-eintr5.c
@@ -24,6 +24,11 @@
#include <string.h>
#include <sys/time.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
#include "eintr.c"
@@ -66,15 +71,9 @@ do_test (void)
exit (1);
}
+ delayed_exit (3);
/* This call must never return. */
- e = pthread_cond_wait (&c, &m);
- printf ("main: cond_wait returned: %s\n",
- strerror_r (e, buf, sizeof (buf)));
-
- return 0;
+ xpthread_cond_wait (&c, &m);
+ puts ("error: pthread_cond_wait returned");
+ return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TIMEOUT 3
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-exec5.c b/nptl/tst-exec5.c
new file mode 100644
index 0000000000..a2e7e947e8
--- /dev/null
+++ b/nptl/tst-exec5.c
@@ -0,0 +1,176 @@
+/* Check if posix_spawn does not act as a cancellation entrypoint.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <paths.h>
+#include <pthread.h>
+#include <signal.h>
+#include <spawn.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
+
+static pthread_barrier_t b;
+
+static pid_t pid;
+static int pipefd[2];
+
+static void *
+tf (void *arg)
+{
+ xpthread_barrier_wait (&b);
+
+ posix_spawn_file_actions_t a;
+ if (posix_spawn_file_actions_init (&a) != 0)
+ {
+ puts ("error: spawn_file_actions_init failed");
+ exit (1);
+ }
+
+ if (posix_spawn_file_actions_adddup2 (&a, pipefd[1], STDOUT_FILENO) != 0)
+ {
+ puts ("error: spawn_file_actions_adddup2 failed");
+ exit (1);
+ }
+
+ if (posix_spawn_file_actions_addclose (&a, pipefd[0]) != 0)
+ {
+ puts ("error: spawn_file_actions_addclose");
+ exit (1);
+ }
+
+ char *argv[] = { (char *) _PATH_BSHELL, (char *) "-c", (char *) "echo $$",
+ NULL };
+ if (posix_spawn (&pid, _PATH_BSHELL, &a, NULL, argv, NULL) != 0)
+ {
+ puts ("error: spawn failed");
+ exit (1);
+ }
+
+ return NULL;
+}
+
+
+static int
+do_test (void)
+{
+ /* The test basically pipe a 'echo $$' created by a thread with a
+ cancellation pending. It then checks if the thread is not cancelled,
+ the process is created and if the output is the expected one. */
+
+ if (pipe (pipefd) != 0)
+ {
+ puts ("error: pipe failed");
+ exit (1);
+ }
+
+ /* Not interested in knowing when the pipe is closed. */
+ if (sigignore (SIGPIPE) != 0)
+ {
+ puts ("error: sigignore failed");
+ exit (1);
+ }
+
+ /* To synchronize with the thread. */
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("error: pthread_barrier_init failed");
+ exit (1);
+ }
+
+ pthread_t th = xpthread_create (NULL, &tf, NULL);
+
+ if (pthread_cancel (th) != 0)
+ {
+ puts ("error: pthread_cancel failed");
+ return 1;
+ }
+
+ xpthread_barrier_wait (&b);
+
+ if (xpthread_join (th) == PTHREAD_CANCELED)
+ {
+ puts ("error: thread cancelled");
+ exit (1);
+ }
+
+ close (pipefd[1]);
+
+ /* The global 'pid' should be set by thread posix_spawn calling. Check
+ below if it was executed correctly and with expected output. */
+
+ char buf[64];
+ ssize_t n;
+ bool seen_pid = false;
+ while (TEMP_FAILURE_RETRY ((n = read (pipefd[0], buf, sizeof (buf)))) > 0)
+ {
+ /* We only expect to read the PID. */
+ char *endp;
+ long int rpid = strtol (buf, &endp, 10);
+
+ if (*endp != '\n')
+ {
+ printf ("error: didn't parse whole line: \"%s\"\n", buf);
+ exit (1);
+ }
+ if (endp == buf)
+ {
+ puts ("error: read empty line");
+ exit (1);
+ }
+
+ if (rpid != pid)
+ {
+ printf ("error: found \"%s\", expected PID %ld\n", buf,
+ (long int) pid);
+ exit (1);
+ }
+
+ if (seen_pid)
+ {
+ puts ("error: found more than one PID line");
+ exit (1);
+ }
+
+ seen_pid = true;
+ }
+
+ close (pipefd[0]);
+
+ int status;
+ int err = waitpid (pid, &status, 0);
+ if (err != pid)
+ {
+ puts ("errnor: waitpid failed");
+ exit (1);
+ }
+
+ if (!seen_pid)
+ {
+ puts ("error: didn't get PID");
+ exit (1);
+ }
+
+ return 0;
+}
diff --git a/nptl/tst-exit2.c b/nptl/tst-exit2.c
index 3f5ff27b0f..0b7a2caf6a 100644
--- a/nptl/tst-exit2.c
+++ b/nptl/tst-exit2.c
@@ -4,6 +4,10 @@
#include <string.h>
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
static void *
tf (void *arg)
@@ -28,13 +32,11 @@ do_test (void)
return 1;
}
+ delayed_exit (1);
+
/* Terminate only this thread. */
pthread_exit (NULL);
/* NOTREACHED */
return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-exit3.c b/nptl/tst-exit3.c
index da92c82c0e..9481ed9b42 100644
--- a/nptl/tst-exit3.c
+++ b/nptl/tst-exit3.c
@@ -5,6 +5,10 @@
#include <string.h>
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
static pthread_barrier_t b;
@@ -69,13 +73,11 @@ do_test (void)
exit (1);
}
+ delayed_exit (3);
+
/* Terminate only this thread. */
pthread_exit (NULL);
/* NOTREACHED */
return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-key1.c b/nptl/tst-key1.c
index 0ed17873bb..ac53729906 100644
--- a/nptl/tst-key1.c
+++ b/nptl/tst-key1.c
@@ -23,6 +23,11 @@
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
int
do_test (void)
{
@@ -38,7 +43,7 @@ do_test (void)
for (i = 0; i < max; ++i)
if (pthread_key_create (&keys[i], NULL) != 0)
{
- write (2, "key_create failed\n", 18);
+ write_message ("key_create failed\n");
_exit (1);
}
else
@@ -82,7 +87,3 @@ do_test (void)
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-key2.c b/nptl/tst-key2.c
index 3142c86d38..4e6a9c206d 100644
--- a/nptl/tst-key2.c
+++ b/nptl/tst-key2.c
@@ -23,6 +23,11 @@
#define N 2
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int cnt0;
static void
f0 (void *p)
@@ -53,7 +58,7 @@ tf (void *arg)
if (pthread_setspecific (*key, (void *) -1l) != 0)
{
- write (2, "setspecific failed\n", 19);
+ write_message ("setspecific failed\n");
_exit (1);
}
@@ -70,45 +75,41 @@ do_test (void)
for (i = 0; i < N; ++i)
if (pthread_key_create (&keys[i], fcts[i]) != 0)
{
- write (2, "key_create failed\n", 18);
+ write_message ("key_create failed\n");
_exit (1);
}
pthread_t th;
if (pthread_create (&th, NULL, tf, &keys[1]) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
if (pthread_join (th, NULL) != 0)
{
- write (2, "join failed\n", 12);
+ write_message ("join failed\n");
_exit (1);
}
if (cnt0 != 0)
{
- write (2, "cnt0 != 0\n", 10);
+ write_message ("cnt0 != 0\n");
_exit (1);
}
if (cnt1 != 1)
{
- write (2, "cnt1 != 1\n", 10);
+ write_message ("cnt1 != 1\n");
_exit (1);
}
for (i = 0; i < N; ++i)
if (pthread_key_delete (keys[i]) != 0)
{
- write (2, "key_delete failed\n", 18);
+ write_message ("key_delete failed\n");
_exit (1);
}
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-key3.c b/nptl/tst-key3.c
index a2985691df..33d811d3dc 100644
--- a/nptl/tst-key3.c
+++ b/nptl/tst-key3.c
@@ -23,6 +23,11 @@
#define N 2
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int cnt0;
static void
f0 (void *p)
@@ -56,7 +61,7 @@ tf (void *arg)
if (pthread_setspecific (*key, (void *) -1l) != 0)
{
- write (2, "setspecific failed\n", 19);
+ write_message ("setspecific failed\n");
_exit (1);
}
@@ -80,20 +85,20 @@ do_test (void)
for (i = 0; i < N; ++i)
if (pthread_key_create (&keys[i], fcts[i]) != 0)
{
- write (2, "key_create failed\n", 18);
+ write_message ("key_create failed\n");
_exit (1);
}
if (pthread_barrier_init (&b, NULL, 2) != 0)
{
- write (2, "barrier_init failed\n", 20);
+ write_message ("barrier_init failed\n");
_exit (1);
}
pthread_t th;
if (pthread_create (&th, NULL, tf, &keys[1]) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
@@ -101,20 +106,20 @@ do_test (void)
if (pthread_cancel (th) != 0)
{
- write (2, "cancel failed\n", 14);
+ write_message ("cancel failed\n");
_exit (1);
}
void *status;
if (pthread_join (th, &status) != 0)
{
- write (2, "join failed\n", 12);
+ write_message ("join failed\n");
_exit (1);
}
if (status != PTHREAD_CANCELED)
{
- write (2, "thread not canceled\n", 20);
+ write_message ("thread not canceled\n");
_exit (1);
}
@@ -124,32 +129,28 @@ do_test (void)
have run and therefore these tests succeed. */
if (cnt0 != 0)
{
- write (2, "cnt0 != 0\n", 10);
+ write_message ("cnt0 != 0\n");
_exit (1);
}
if (cnt1 != 1)
{
- write (2, "cnt1 != 1\n", 10);
+ write_message ("cnt1 != 1\n");
_exit (1);
}
for (i = 0; i < N; ++i)
if (pthread_key_delete (keys[i]) != 0)
{
- write (2, "key_delete failed\n", 18);
+ write_message ("key_delete failed\n");
_exit (1);
}
if (pthread_barrier_destroy (&b) != 0)
{
- write (2, "barrier_destroy failed\n", 23);
+ write_message ("barrier_destroy failed\n");
_exit (1);
}
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-kill3.c b/nptl/tst-kill3.c
index 308cc5a24d..86f3c6c6a2 100644
--- a/nptl/tst-kill3.c
+++ b/nptl/tst-kill3.c
@@ -25,6 +25,12 @@
#include <sys/time.h>
+static int do_test (void);
+
+#define TIMEOUT 5
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static pthread_cond_t c = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
static pthread_barrier_t b;
@@ -33,7 +39,7 @@ static pthread_barrier_t b;
static void
handler (int sig)
{
- write (1, "handler called\n", 15);
+ write_message ("handler called\n");
_exit (1);
}
@@ -151,8 +157,3 @@ do_test (void)
return 0;
}
-
-
-#define TIMEOUT 5
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-kill6.c b/nptl/tst-kill6.c
index 80a0771808..2a9add27ad 100644
--- a/nptl/tst-kill6.c
+++ b/nptl/tst-kill6.c
@@ -25,6 +25,11 @@
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static pthread_t receiver;
static sem_t sem;
static pthread_barrier_t b;
@@ -34,19 +39,19 @@ handler (int sig)
{
if (sig != SIGUSR1)
{
- write (STDOUT_FILENO, "wrong signal\n", 13);
+ write_message ("wrong signal\n");
_exit (1);
}
if (pthread_self () != receiver)
{
- write (STDOUT_FILENO, "not the intended receiver\n", 26);
+ write_message ("not the intended receiver\n");
_exit (1);
}
if (sem_post (&sem) != 0)
{
- write (STDOUT_FILENO, "sem_post failed\n", 16);
+ write_message ("sem_post failed\n");
_exit (1);
}
}
@@ -155,7 +160,3 @@ do_test (void)
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-mutex6.c b/nptl/tst-mutex6.c
index 1940687fee..3e989d8f55 100644
--- a/nptl/tst-mutex6.c
+++ b/nptl/tst-mutex6.c
@@ -23,6 +23,11 @@
#include <errno.h>
#include <stdbool.h>
+#ifndef TEST_FUNCTION
+static int do_test (void);
+# define TEST_FUNCTION do_test ()
+#endif
+#include "../test-skeleton.c"
#ifndef ATTR
pthread_mutexattr_t *attr;
@@ -62,18 +67,10 @@ do_test (void)
return 1;
}
- /* Set an alarm for 1 second. The wrapper will expect this. */
- alarm (1);
-
+ delayed_exit (1);
/* This call should never return. */
- pthread_mutex_lock (&m);
+ xpthread_mutex_lock (&m);
puts ("2nd mutex_lock returned");
return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#ifndef TEST_FUNCTION
-# define TEST_FUNCTION do_test ()
-#endif
-#include "../test-skeleton.c"
diff --git a/nptl/tst-once5.cc b/nptl/tst-once5.cc
index 978d8271bd..513ac53f6f 100644
--- a/nptl/tst-once5.cc
+++ b/nptl/tst-once5.cc
@@ -75,5 +75,7 @@ do_test (void)
return result;
}
+// The test currently hangs and is XFAILed. Reduce the timeout.
+#define TIMEOUT 1
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
diff --git a/nptl/tst-rwlock5.c b/nptl/tst-rwlock5.c
index b6c5d8a247..20fb471823 100644
--- a/nptl/tst-rwlock5.c
+++ b/nptl/tst-rwlock5.c
@@ -22,6 +22,10 @@
#include <stdlib.h>
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
static pthread_rwlock_t r;
@@ -65,22 +69,16 @@ do_test (void)
return 1;
}
- /* Set an alarm for 1 second. The wrapper will expect this. */
- alarm (1);
-
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
puts ("create failed");
return 1;
}
+ delayed_exit (1);
/* This call should never return. */
- pthread_mutex_lock (&m);
+ xpthread_mutex_lock (&m);
puts ("2nd mutex_lock returned");
return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-sem16.c b/nptl/tst-sem16.c
new file mode 100644
index 0000000000..70067540d3
--- /dev/null
+++ b/nptl/tst-sem16.c
@@ -0,0 +1,130 @@
+/* Test for sem_open cancellation handling: BZ #15765.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <sys/mman.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+
+static sem_t sem; /* Use to sync with thread start. */
+static const char pipe_name[] = "/glibc-tst-sem16";
+
+static void
+remove_sem (int status, void *arg)
+{
+ sem_unlink (arg);
+}
+
+static void *
+tf (void *arg)
+{
+ pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, 0);
+
+ if (sem_wait (&sem) != 0)
+ {
+ printf ("error: sem_wait failed: %m");
+ exit (1);
+ }
+
+ if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, 0) != 0)
+ {
+ printf ("error: pthread_setcancelstate failed: %m");
+ exit (1);
+ }
+
+ /* Neither sem_unlink or sem_open should act on thread cancellation. */
+ sem_unlink (pipe_name);
+ on_exit (remove_sem, (void *) pipe_name);
+
+ sem_t *s = sem_open (pipe_name, O_CREAT, 0600, 1);
+ if (s == SEM_FAILED)
+ {
+ int exit_code;
+ if (errno == ENOSYS || errno == EACCES)
+ exit_code = 77;
+ else
+ exit_code = 1;
+ exit (exit_code);
+ }
+
+ if (pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, 0) != 0)
+ {
+ printf ("error: pthread_setcancelstate failed: %m");
+ exit (1);
+ }
+
+ if (sem_close (s) != 0)
+ {
+ printf ("error: sem_close failed: %m");
+ exit (1);
+ }
+
+ return NULL;
+}
+
+static int
+do_test (void)
+{
+ pthread_t td;
+
+ if (sem_init (&sem, 0, 0))
+ {
+ printf ("error: sem_init failed: %m\n");
+ exit (1);
+ }
+
+ if (pthread_create (&td, NULL, tf, NULL) != 0)
+ {
+ printf ("error: pthread_create failed: %m\n");
+ exit (1);
+ }
+
+ if (pthread_cancel (td) != 0)
+ {
+ printf ("error: pthread_cancel failed: %m\n");
+ exit (1);
+ }
+
+ if (sem_post (&sem) != 0)
+ {
+ printf ("error: sem_post failed: %m\n");
+ exit (1);
+ }
+
+ void *r;
+ if (pthread_join (td, &r) != 0)
+ {
+ printf ("error: pthread_join failed: %m\n");
+ exit (1);
+ }
+
+ if (r == PTHREAD_CANCELED)
+ {
+ puts ("error: pthread_join returned PTHREAD_CANCELED");
+ exit (1);
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
diff --git a/nptl/tst-sem2.c b/nptl/tst-sem2.c
index 301dde7948..1f609fcf88 100644
--- a/nptl/tst-sem2.c
+++ b/nptl/tst-sem2.c
@@ -17,11 +17,16 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
static int
do_test (void)
@@ -34,8 +39,7 @@ do_test (void)
return 1;
}
- /* Set an alarm for 1 second. The wrapper will expect this. */
- alarm (1);
+ delayed_exit (1);
if (TEMP_FAILURE_RETRY (sem_wait (&s)) == -1)
{
@@ -47,7 +51,3 @@ do_test (void)
puts ("wait succeeded");
return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-spin3.c b/nptl/tst-spin3.c
index 8964ecca8b..6cb6f9d48c 100644
--- a/nptl/tst-spin3.c
+++ b/nptl/tst-spin3.c
@@ -21,6 +21,10 @@
#include <stdio.h>
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
static int
do_test (void)
@@ -39,16 +43,11 @@ do_test (void)
return 1;
}
- /* Set an alarm for 1 second. The wrapper will expect this. */
- alarm (1);
+ delayed_exit (1);
/* This call should never return. */
- pthread_spin_lock (&s);
+ xpthread_spin_lock (&s);
puts ("2nd spin_lock returned");
return 1;
}
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-stdio1.c b/nptl/tst-stdio1.c
index 2d44c16a77..7432261dc3 100644
--- a/nptl/tst-stdio1.c
+++ b/nptl/tst-stdio1.c
@@ -21,6 +21,10 @@
#include <stdio.h>
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
static void *tf (void *a)
{
@@ -39,18 +43,14 @@ do_test (void)
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
- pthread_join (th, NULL);
+ delayed_exit (1);
+ xpthread_join (th);
puts ("join returned");
- return 0;
+ return 1;
}
-
-
-#define EXPECTED_SIGNAL SIGALRM
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-stdio2.c b/nptl/tst-stdio2.c
index 6168d273e4..e0148c9f3c 100644
--- a/nptl/tst-stdio2.c
+++ b/nptl/tst-stdio2.c
@@ -23,6 +23,11 @@
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static void *tf (void *a)
{
puts ("start tf");
@@ -55,7 +60,7 @@ do_test (void)
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
@@ -75,7 +80,3 @@ do_test (void)
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-tls2.c b/nptl/tst-tls2.c
index eb6d8a336b..054ab80172 100644
--- a/nptl/tst-tls2.c
+++ b/nptl/tst-tls2.c
@@ -29,13 +29,18 @@
static pthread_t th[N];
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
#define CB(n) \
static void \
cb##n (void) \
{ \
if (th[n] != pthread_self ()) \
{ \
- write (STDOUT_FILENO, "wrong callback\n", 15); \
+ write_message ("wrong callback\n"); \
_exit (1); \
} \
}
@@ -67,7 +72,7 @@ handler (int sig)
{
if (sig != THE_SIG)
{
- write (STDOUT_FILENO, "wrong signal\n", 13);
+ write_message ("wrong signal\n");
_exit (1);
}
@@ -75,7 +80,7 @@ handler (int sig)
if (sem_post (&s) != 0)
{
- write (STDOUT_FILENO, "sem_post failed\n", 16);
+ write_message ("sem_post failed\n");
_exit (1);
}
}
@@ -199,7 +204,3 @@ do_test (void)
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-tls3-malloc.c b/nptl/tst-tls3-malloc.c
index 5eab3cdbb4..719ab28cf0 100644
--- a/nptl/tst-tls3-malloc.c
+++ b/nptl/tst-tls3-malloc.c
@@ -17,160 +17,15 @@
<http://www.gnu.org/licenses/>. */
/* Reuse the test. */
+#define STACK_SIZE_MB 5
#include "tst-tls3.c"
-#include <sys/mman.h>
-
-/* Interpose a minimal malloc implementation. This implementation
- deliberately interposes just a restricted set of symbols, to detect
- if the TLS code bypasses the interposed malloc. */
-
-/* Lock to guard malloc internals. */
-static pthread_mutex_t malloc_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/* Information about an allocation chunk. */
-struct malloc_chunk
-{
- /* Start of the allocation. */
- void *start;
- /* Size of the allocation. */
- size_t size;
-};
-
-enum { malloc_chunk_count = 1000 };
-static struct malloc_chunk chunks[malloc_chunk_count];
-
-/* Lock the malloc lock. */
-static void
-xlock (void)
-{
- int ret = pthread_mutex_lock (&malloc_lock);
- if (ret != 0)
- {
- errno = ret;
- printf ("error: pthread_mutex_lock: %m\n");
- _exit (1);
- }
-}
-
-/* Unlock the malloc lock. */
-static void
-xunlock (void)
-{
- int ret = pthread_mutex_unlock (&malloc_lock);
- if (ret != 0)
- {
- errno = ret;
- printf ("error: pthread_mutex_unlock: %m\n");
- _exit (1);
- }
-}
+/* Increase the thread stack size to 10 MiB, so that some thread
+ stacks are actually freed. (The stack cache size is currently
+ hard-wired to 40 MiB in allocatestack.c.) */
+static long stack_size_in_mb = 10;
-/* Internal malloc without locking and registration. */
-static void *
-malloc_internal (size_t size)
-{
- void *result = mmap (NULL, size, PROT_READ | PROT_WRITE,
- MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
- if (result == MAP_FAILED)
- {
- printf ("error: mmap: %m\n");
- _exit (1);
- }
- return result;
-}
-
-void *
-malloc (size_t size)
-{
- if (size == 0)
- size = 1;
- xlock ();
- void *result = malloc_internal (size);
- for (int i = 0; i < malloc_chunk_count; ++i)
- if (chunks[i].start == NULL)
- {
- chunks[i].start = result;
- chunks[i].size = size;
- xunlock ();
- return result;
- }
- xunlock ();
- printf ("error: no place to store chunk pointer\n");
- _exit (1);
-}
-
-void *
-calloc (size_t a, size_t b)
-{
- if (b != 0 && a > SIZE_MAX / b)
- return NULL;
- /* malloc uses mmap, which provides zeroed memory. */
- return malloc (a * b);
-}
-
-static void
-xunmap (void *ptr, size_t size)
-{
- int ret = munmap (ptr, size);
- if (ret < 0)
- {
- printf ("error: munmap (%p, %zu) failed: %m\n", ptr, size);
- _exit (1);
- }
-}
-
-void
-free (void *ptr)
-{
- if (ptr == NULL)
- return;
-
- xlock ();
- for (int i = 0; i < malloc_chunk_count; ++i)
- if (chunks[i].start == ptr)
- {
- xunmap (ptr, chunks[i].size);
- chunks[i] = (struct malloc_chunk) {};
- xunlock ();
- return;
- }
- xunlock ();
- printf ("error: tried to free non-allocated pointer %p\n", ptr);
- _exit (1);
-}
+#include <sys/mman.h>
-void *
-realloc (void *old, size_t size)
-{
- if (old != NULL)
- {
- xlock ();
- for (int i = 0; i < malloc_chunk_count; ++i)
- if (chunks[i].start == old)
- {
- size_t old_size = chunks[i].size;
- void *result;
- if (old_size < size)
- {
- result = malloc_internal (size);
- /* Reuse the slot for the new allocation. */
- memcpy (result, old, old_size);
- xunmap (old, old_size);
- chunks[i].start = result;
- chunks[i].size = size;
- }
- else
- /* Old size is not smaller, so reuse the old
- allocation. */
- result = old;
- xunlock ();
- return result;
- }
- xunlock ();
- printf ("error: tried to realloc non-allocated pointer %p\n", old);
- _exit (1);
- }
- else
- return malloc (size);
-}
+#define INTERPOSE_THREADS 1
+#include "../malloc/tst-interpose-aux.c"
diff --git a/nptl/tst-tls3.c b/nptl/tst-tls3.c
index 982c1fdd4c..4b96974398 100644
--- a/nptl/tst-tls3.c
+++ b/nptl/tst-tls3.c
@@ -29,18 +29,29 @@
#define THE_SIG SIGUSR1
+/* The stack size can be overriden. With a sufficiently large stack
+ size, thread stacks for terminated threads are freed, but this does
+ not happen with the default size of 1 MiB. */
+enum { default_stack_size_in_mb = 1 };
+static long stack_size_in_mb;
#define N 10
static pthread_t th[N];
+static int do_test (void);
+
+#define TIMEOUT 5
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
#define CB(n) \
static void \
cb##n (void) \
{ \
if (th[n] != pthread_self ()) \
{ \
- write (STDOUT_FILENO, "wrong callback\n", 15); \
+ write_message ("wrong callback\n"); \
_exit (1); \
} \
}
@@ -72,6 +83,9 @@ int nsigs;
int
do_test (void)
{
+ if (stack_size_in_mb == 0)
+ stack_size_in_mb = default_stack_size_in_mb;
+
if ((uintptr_t) pthread_self () & (TCB_ALIGNMENT - 1))
{
puts ("initial thread's struct pthread not aligned enough");
@@ -127,7 +141,7 @@ do_test (void)
exit (1);
}
- if (pthread_attr_setstacksize (&a, 1 * 1024 * 1024) != 0)
+ if (pthread_attr_setstacksize (&a, stack_size_in_mb * 1024 * 1024) != 0)
{
puts ("attr_setstacksize failed");
return 1;
@@ -199,8 +213,3 @@ do_test (void)
return 0;
}
-
-
-#define TIMEOUT 5
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl_db/thread_db.h b/nptl_db/thread_db.h
index abb95df3fb..540c318872 100644
--- a/nptl_db/thread_db.h
+++ b/nptl_db/thread_db.h
@@ -108,7 +108,7 @@ struct link_map;
#define TD_EVENTSIZE 2
#define BT_UISHIFT 5 /* log base 2 of BT_NBIPUI, to extract word index */
-#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per uint */
+#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per unsigned int */
#define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index */
/* Bitmask of enabled events. */
diff --git a/nptl_db/thread_dbP.h b/nptl_db/thread_dbP.h
index 39c3061786..f448547cd3 100644
--- a/nptl_db/thread_dbP.h
+++ b/nptl_db/thread_dbP.h
@@ -30,6 +30,7 @@
#include "../nptl/pthreadP.h" /* This is for *_BITMASK only. */
#include <list.h>
#include <gnu/lib-names.h>
+#include <libc-internal.h>
/* Indeces for the symbol names. */
enum
@@ -160,10 +161,19 @@ extern ps_err_e td_mod_lookup (struct ps_prochandle *ps, const char *modname,
SYM_##type##_FIELD_##field, \
(psaddr_t) 0 + (idx), (ptr), &(var))
+/* With GCC 5.3 when compiling with -Os the compiler emits a warning
+ that slot may be used uninitialized. This is never the case since
+ the dynamic loader initializes the slotinfo list and
+ dtv_slotinfo_list will point slot at the first entry. Therefore
+ when DB_GET_FIELD_ADDRESS is called with a slot for ptr, the slot is
+ always initialized. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
#define DB_GET_FIELD_ADDRESS(var, ta, ptr, type, field, idx) \
((var) = (ptr), _td_locate_field ((ta), (ta)->ta_field_##type##_##field, \
SYM_##type##_FIELD_##field, \
(psaddr_t) 0 + (idx), &(var)))
+DIAG_POP_NEEDS_COMMENT;
extern td_err_e _td_locate_field (td_thragent_t *ta,
db_desc_t desc, int descriptor_name,
diff --git a/nscd/aicache.c b/nscd/aicache.c
index a2e6cf8475..32c8f57b41 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -101,8 +101,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
nip = hosts_database;
/* Initialize configurations. */
- if (__glibc_unlikely (!_res_hconf.initialized))
- _res_hconf_init ();
+ _res_hconf_init ();
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index 93af2538ec..18d3ad68cc 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -274,8 +274,7 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
}
#endif /* need _res */
#ifdef NEED__RES_HCONF
- if (!_res_hconf.initialized)
- _res_hconf_init ();
+ _res_hconf_init ();
#endif /* need _res_hconf */
void *tmp_ptr = fct.l;
diff --git a/posix/Makefile b/posix/Makefile
index 3a7719e8c2..c493f317a2 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -90,11 +90,12 @@ tests := tstgetopt testfnm runtests runptests \
bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35 \
tst-pathconf tst-getaddrinfo4 tst-rxspencer-no-utf8 \
tst-fnmatch3 bug-regex36 tst-getaddrinfo5 \
- tst-posix_spawn-fd
+ tst-posix_spawn-fd \
+ tst-posix_fadvise tst-posix_fadvise64
xtests := bug-ga2
ifeq (yes,$(build-shared))
test-srcs := globtest
-tests += wordexp-test tst-exec tst-spawn tst-spawn2
+tests += wordexp-test tst-exec tst-spawn tst-spawn2 tst-spawn3
endif
tests-static = tst-exec-static tst-spawn-static
tests += $(tests-static)
diff --git a/posix/glob.c b/posix/glob.c
index ea4b0b61eb..e357195a72 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -312,6 +312,28 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
also makes all the code that uses gl_offs simpler. */
pglob->gl_offs = 0;
+ if (!(flags & GLOB_APPEND))
+ {
+ pglob->gl_pathc = 0;
+ if (!(flags & GLOB_DOOFFS))
+ pglob->gl_pathv = NULL;
+ else
+ {
+ size_t i;
+
+ if (pglob->gl_offs >= ~((size_t) 0) / sizeof (char *))
+ return GLOB_NOSPACE;
+
+ pglob->gl_pathv = (char **) malloc ((pglob->gl_offs + 1)
+ * sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ return GLOB_NOSPACE;
+
+ for (i = 0; i <= pglob->gl_offs; ++i)
+ pglob->gl_pathv[i] = NULL;
+ }
+ }
+
if (flags & GLOB_BRACE)
{
const char *begin;
@@ -359,14 +381,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
{
onealt = (char *) malloc (pattern_len);
if (onealt == NULL)
- {
- if (!(flags & GLOB_APPEND))
- {
- pglob->gl_pathc = 0;
- pglob->gl_pathv = NULL;
- }
- return GLOB_NOSPACE;
- }
+ return GLOB_NOSPACE;
}
/* We know the prefix for all sub-patterns. */
@@ -383,7 +398,8 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
if (__glibc_unlikely (!alloca_onealt))
#endif
free (onealt);
- return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
+ flags &= ~GLOB_BRACE;
+ goto no_brace;
}
/* Now find the end of the whole brace expression. */
@@ -404,14 +420,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
points past the final }. We will accumulate result names from
recursive runs for each brace alternative in the buffer using
GLOB_APPEND. */
-
- if (!(flags & GLOB_APPEND))
- {
- /* This call is to set a new vector, so clear out the
- vector so we can append to it. */
- pglob->gl_pathc = 0;
- pglob->gl_pathv = NULL;
- }
firstc = pglob->gl_pathc;
p = begin + 1;
@@ -463,28 +471,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
}
}
- if (!(flags & GLOB_APPEND))
- {
- pglob->gl_pathc = 0;
- if (!(flags & GLOB_DOOFFS))
- pglob->gl_pathv = NULL;
- else
- {
- size_t i;
-
- if (pglob->gl_offs >= ~((size_t) 0) / sizeof (char *))
- return GLOB_NOSPACE;
-
- pglob->gl_pathv = (char **) malloc ((pglob->gl_offs + 1)
- * sizeof (char *));
- if (pglob->gl_pathv == NULL)
- return GLOB_NOSPACE;
-
- for (i = 0; i <= pglob->gl_offs; ++i)
- pglob->gl_pathv[i] = NULL;
- }
- }
-
+ no_brace:
oldcount = pglob->gl_pathc + pglob->gl_offs;
/* Find the filename. */
diff --git a/posix/glob.h b/posix/glob.h
index e4548f6f75..ae70fa7516 100644
--- a/posix/glob.h
+++ b/posix/glob.h
@@ -25,7 +25,7 @@ __BEGIN_DECLS
/* We need `size_t' for the following definitions. */
#ifndef __size_t
typedef __SIZE_TYPE__ __size_t;
-# if defined __USE_XOPEN || __USE_XOPEN2K8
+# if defined __USE_XOPEN || defined __USE_XOPEN2K8
typedef __SIZE_TYPE__ size_t;
# endif
#else
diff --git a/posix/globtest.sh b/posix/globtest.sh
index 73fe11bd76..e280f7d2b3 100755
--- a/posix/globtest.sh
+++ b/posix/globtest.sh
@@ -794,6 +794,22 @@ if test $failed -ne 0; then
result=1
fi
+# Test GLOB_BRACE and GLIB_DOOFFS with malloc checking
+failed=0
+${test_wrapper_env} \
+MALLOC_PERTURB_=65 \
+${test_via_rtld_prefix} \
+${common_objpfx}posix/globtest -b -o "$testdir" "file{1,2}" > $testout || failed=1
+cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
+`abc'
+`file1'
+`file2'
+EOF
+if test $failed -ne 0; then
+ echo "GLOB_BRACE+GLOB_DOOFFS test failed" >> $logfile
+ result=1
+fi
+
if test $result -eq 0; then
chmod 777 $testdir/noread
rm -fr $testdir $testout
diff --git a/posix/sched.h b/posix/sched.h
index 253c963053..5b431c64bf 100644
--- a/posix/sched.h
+++ b/posix/sched.h
@@ -25,13 +25,14 @@
#include <bits/types.h>
#define __need_size_t
+#define __need_NULL
#include <stddef.h>
-#ifdef __USE_XOPEN2K
-# define __need_time_t
-# define __need_timespec
+#include <bits/types/time_t.h>
+#include <bits/types/struct_timespec.h>
+#ifndef __USE_XOPEN2K
+# include <time.h>
#endif
-#include <time.h>
#ifndef __pid_t_defined
typedef __pid_t pid_t;
diff --git a/posix/sys/times.h b/posix/sys/times.h
index a877d1490d..c7308d2617 100644
--- a/posix/sys/times.h
+++ b/posix/sys/times.h
@@ -24,9 +24,7 @@
#include <features.h>
-#define __need_clock_t
-#include <time.h>
-
+#include <bits/types/clock_t.h>
__BEGIN_DECLS
diff --git a/posix/sys/types.h b/posix/sys/types.h
index 83dadcdd05..386f3e5703 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -124,12 +124,11 @@ typedef __key_t key_t;
#endif
#if defined __USE_XOPEN || defined __USE_XOPEN2K8
-# define __need_clock_t
+# include <bits/types/clock_t.h>
#endif
-#define __need_time_t
-#define __need_timer_t
-#define __need_clockid_t
-#include <time.h>
+#include <bits/types/clockid_t.h>
+#include <bits/types/time_t.h>
+#include <bits/types/timer_t.h>
#ifdef __USE_XOPEN
# ifndef __useconds_t_defined
diff --git a/posix/tst-posix_fadvise-common.c b/posix/tst-posix_fadvise-common.c
new file mode 100644
index 0000000000..bb04c6116f
--- /dev/null
+++ b/posix/tst-posix_fadvise-common.c
@@ -0,0 +1,103 @@
+/* Common posix_fadvise tests definitions.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+static void do_prepare (void);
+#define PREPARE(argc, argv) do_prepare ()
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+
+#include <test-skeleton.c>
+
+static char *temp_filename;
+static int temp_fd;
+static char fifoname[] = "/tmp/tst-posix_fadvise-fifo-XXXXXX";
+static int fifofd;
+
+static void
+do_prepare (void)
+{
+ temp_fd = create_temp_file ("tst-posix_fadvise.", &temp_filename);
+ if (temp_fd == -1)
+ FAIL_EXIT1 ("cannot create temporary file: %m");
+
+ if (mktemp (fifoname) == NULL)
+ FAIL_EXIT1 ("cannot generate temp file name: %m");
+ add_temp_file (fifoname);
+
+ if (mkfifo (fifoname, S_IWUSR | S_IRUSR) != 0)
+ FAIL_EXIT1 ("cannot create fifo: %m");
+
+ fifofd = open (fifoname, O_RDONLY | O_NONBLOCK);
+ if (fifofd == -1)
+ FAIL_EXIT1 ("cannot open fifo: %m");
+}
+
+/* Effectivelly testing posix_fadvise is hard because side effects are not
+ observed without checking either performance or any kernel specific
+ supplied information. Also, the syscall is meant to be an advisory,
+ so the kernel is free to use this information in any way it deems fit,
+ including ignoring it.
+
+ This test check for some invalid returned operation to check argument
+ passing and if implementation follows POSIX error definition. */
+static int
+do_test_common (void)
+{
+ /* Add some data to file and ensure it is written to disk. */
+#define BLK_SIZE 2048
+ char buffer[BLK_SIZE] = { 0xcd };
+ ssize_t ret;
+
+ if ((ret = write (temp_fd, buffer, BLK_SIZE)) != BLK_SIZE)
+ FAIL_EXIT1 ("write returned %zd different than expected %d",
+ ret, BLK_SIZE);
+
+ if (fsync (temp_fd) != 0)
+ FAIL_EXIT1 ("fsync failed");
+
+ /* Test passing an invalid fd. */
+ if (posix_fadvise (-1, 0, 0, POSIX_FADV_NORMAL) != EBADF)
+ FAIL_EXIT1 ("posix_fadvise with invalid fd did not return EBADF");
+
+ /* Test passing an invalid operation. */
+ if (posix_fadvise (temp_fd, 0, 0, -1) != EINVAL)
+ FAIL_EXIT1 ("posix_fadvise with invalid advise did not return EINVAL");
+
+ /* Test passing a FIFO fd. */
+ if (posix_fadvise (fifofd, 0, 0, POSIX_FADV_NORMAL) != ESPIPE)
+ FAIL_EXIT1 ("posix_advise with PIPE fd did not return ESPIPE");
+
+ /* Default fadvise on all file starting at initial position. */
+ if (posix_fadvise (temp_fd, 0, 0, POSIX_FADV_NORMAL) != 0)
+ FAIL_EXIT1 ("default posix_fadvise failed");
+
+ if (posix_fadvise (temp_fd, 0, 2 * BLK_SIZE, POSIX_FADV_NORMAL) != 0)
+ FAIL_EXIT1 ("posix_fadvise failed (offset = 0, len = %d) failed",
+ BLK_SIZE);
+
+ if (posix_fadvise (temp_fd, 2 * BLK_SIZE, 0, POSIX_FADV_NORMAL) != 0)
+ FAIL_EXIT1 ("posix_fadvise failed (offset = %d, len = 0) failed",
+ BLK_SIZE);
+
+ return 0;
+}
diff --git a/posix/tst-posix_fadvise.c b/posix/tst-posix_fadvise.c
new file mode 100644
index 0000000000..6ee0936284
--- /dev/null
+++ b/posix/tst-posix_fadvise.c
@@ -0,0 +1,25 @@
+/* Basic posix_fadvise tests.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "tst-posix_fadvise-common.c"
+
+static int
+do_test (void)
+{
+ return do_test_common ();
+}
diff --git a/posix/tst-posix_fadvise64.c b/posix/tst-posix_fadvise64.c
new file mode 100644
index 0000000000..391aa7911f
--- /dev/null
+++ b/posix/tst-posix_fadvise64.c
@@ -0,0 +1,46 @@
+/* Basic posix_fadvise64 tests.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define _FILE_OFFSET_BITS 64
+#include "tst-posix_fadvise-common.c"
+
+static int
+do_test (void)
+{
+ int ret = do_test_common ();
+ if (ret == 1)
+ return 1;
+
+ /* Test passing a negative length. The compat fadvise64 might use
+ off64_t for size argument passing, so using -1 for len without
+ _FILE_OFFSET_BITS might not trigger the length issue. */
+ if (posix_fadvise (temp_fd, 0, -1, POSIX_FADV_NORMAL) != EINVAL)
+ FAIL_EXIT1 ("posix_fadvise with negative length did not return EINVAL");
+
+ /* Check with some offset values larger than 32-bits. */
+ off_t offset = UINT32_MAX + 2048LL;
+ if (posix_fadvise (temp_fd, 0, offset, POSIX_FADV_NORMAL) != 0)
+ FAIL_EXIT1 ("posix_fadvise failed (offset = 0, len = %zd) failed",
+ (ssize_t)offset);
+
+ if (posix_fadvise (temp_fd, offset, 0, POSIX_FADV_NORMAL) != 0)
+ FAIL_EXIT1 ("posix_fadvise failed (offset = %zd, len = 0) failed",
+ (ssize_t)offset);
+
+ return 0;
+}
diff --git a/posix/tst-spawn3.c b/posix/tst-spawn3.c
new file mode 100644
index 0000000000..7d5ffc6cac
--- /dev/null
+++ b/posix/tst-spawn3.c
@@ -0,0 +1,189 @@
+/* Check posix_spawn add file actions.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <spawn.h>
+#include <error.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
+
+static int
+do_test (void)
+{
+ /* The test checks if posix_spawn open file action close the file descriptor
+ before opening a new one in case the input file descriptor is already
+ opened. It does by exhausting all file descriptors on the process before
+ issue posix_spawn. It then issues a posix_spawn for '/bin/sh echo $$'
+ and add two rules:
+
+ 1. Redirect stdout to a temporary filepath
+ 2. Redirect stderr to stdout
+
+ If the implementation does not close the file 1. will fail with
+ EMFILE. */
+
+ struct rlimit rl;
+ int max_fd = 24;
+
+ /* Set maximum number of file descriptor to a low value to avoid open
+ too many files in environments where RLIMIT_NOFILE is large and to
+ limit the array size to track the opened file descriptors. */
+
+ if (getrlimit (RLIMIT_NOFILE, &rl) == -1)
+ {
+ printf ("error: getrlimit RLIMIT_NOFILE failed");
+ exit (EXIT_FAILURE);
+ }
+
+ max_fd = (rl.rlim_cur < max_fd ? rl.rlim_cur : max_fd);
+ rl.rlim_cur = max_fd;
+
+ if (setrlimit (RLIMIT_NOFILE, &rl) == 1)
+ {
+ printf ("error: setrlimit RLIMIT_NOFILE to %u failed", max_fd);
+ exit (EXIT_FAILURE);
+ }
+
+ /* Exhauste the file descriptor limit with temporary files. */
+ int files[max_fd];
+ int nfiles = 0;
+ for (;;)
+ {
+ int fd = create_temp_file ("tst-spawn3.", NULL);
+ if (fd == -1)
+ {
+ if (errno != EMFILE)
+ {
+ printf ("error: create_temp_file returned -1 with "
+ "errno != EMFILE\n");
+ exit (EXIT_FAILURE);
+ }
+ break;
+ }
+ files[nfiles++] = fd;
+ }
+
+ posix_spawn_file_actions_t a;
+ if (posix_spawn_file_actions_init (&a) != 0)
+ {
+ puts ("error: spawn_file_actions_init failed");
+ exit (EXIT_FAILURE);
+ }
+
+ /* Executes a /bin/sh echo $$ 2>&1 > /tmp/tst-spawn3.pid . */
+ const char pidfile[] = "/tmp/tst-spawn3.pid";
+ if (posix_spawn_file_actions_addopen (&a, STDOUT_FILENO, pidfile, O_WRONLY |
+ O_CREAT | O_TRUNC, 0644) != 0)
+ {
+ puts ("error: spawn_file_actions_addopen failed");
+ exit (EXIT_FAILURE);
+ }
+
+ if (posix_spawn_file_actions_adddup2 (&a, STDOUT_FILENO, STDERR_FILENO) != 0)
+ {
+ puts ("error: spawn_file_actions_addclose");
+ exit (EXIT_FAILURE);
+ }
+
+ /* Since execve (called by posix_spawn) might require to open files to
+ actually execute the shell script, setup to close the temporary file
+ descriptors. */
+ for (int i=0; i<nfiles; i++)
+ {
+ if (posix_spawn_file_actions_addclose (&a, files[i]))
+ {
+ printf ("error: posix_spawn_file_actions_addclose failed");
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ char *spawn_argv[] = { (char *) _PATH_BSHELL, (char *) "-c",
+ (char *) "echo $$", NULL };
+ pid_t pid;
+ if (posix_spawn (&pid, _PATH_BSHELL, &a, NULL, spawn_argv, NULL) != 0)
+ {
+ puts ("error: posix_spawn failed");
+ exit (EXIT_FAILURE);
+ }
+
+ int status;
+ int err = waitpid (pid, &status, 0);
+ if (err != pid)
+ {
+ puts ("error: waitpid failed");
+ exit (EXIT_FAILURE);
+ }
+
+ /* Close the temporary files descriptor so it can check posix_spawn
+ output. */
+ for (int i=0; i<nfiles; i++)
+ {
+ if (close (files[i]))
+ {
+ printf ("error: close failed\n");
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ int pidfd = open (pidfile, O_RDONLY);
+ if (pidfd == -1)
+ {
+ printf ("error: open pidfile failed\n");
+ exit (EXIT_FAILURE);
+ }
+
+ char buf[64];
+ ssize_t n;
+ if ((n = read (pidfd, buf, sizeof (buf))) < 0)
+ {
+ printf ("error: read pidfile failed\n");
+ exit (EXIT_FAILURE);
+ }
+
+ unlink (pidfile);
+
+ /* We only expect to read the PID. */
+ char *endp;
+ long int rpid = strtol (buf, &endp, 10);
+ if (*endp != '\n')
+ {
+ printf ("error: didn't parse whole line: \"%s\"\n", buf);
+ exit (EXIT_FAILURE);
+ }
+ if (endp == buf)
+ {
+ puts ("error: read empty line");
+ exit (EXIT_FAILURE);
+ }
+
+ if (rpid != pid)
+ {
+ printf ("error: found \"%s\", expected PID %ld\n", buf, (long int) pid);
+ exit (EXIT_FAILURE);
+ }
+
+ return 0;
+}
diff --git a/resolv/Makefile b/resolv/Makefile
index 8be41d3ae1..be203683f7 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -46,7 +46,7 @@ libresolv-routines := gethnamaddr res_comp res_debug \
res_data res_mkquery res_query res_send \
inet_net_ntop inet_net_pton inet_neta base64 \
ns_parse ns_name ns_netint ns_ttl ns_print \
- ns_samedomain ns_date
+ ns_samedomain ns_date compat-hooks
libanl-routines := gai_cancel gai_error gai_misc gai_notify gai_suspend \
getaddrinfo_a
@@ -93,9 +93,6 @@ CPPFLAGS += -Dgethostbyname=res_gethostbyname \
CFLAGS-libresolv += $(stack-protector)
CFLAGS-res_hconf.c = -fexceptions
-# The BIND code elicits some harmless warnings.
-+cflags += -Wno-write-strings
-
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
diff --git a/resolv/arpa/nameser.h b/resolv/arpa/nameser.h
index 04f884441b..80d5cdf951 100644
--- a/resolv/arpa/nameser.h
+++ b/resolv/arpa/nameser.h
@@ -45,30 +45,13 @@
* SOFTWARE.
*/
-/*
- * $BINDId: nameser.h,v 8.37 2000/03/30 21:16:49 vixie Exp $
- */
-
#ifndef _ARPA_NAMESER_H_
#define _ARPA_NAMESER_H_
-/*! \file */
-
-#define BIND_4_COMPAT
-
#include <sys/param.h>
#include <sys/types.h>
-#include <sys/cdefs.h>
+#include <stdint.h>
-/*%
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your libbind.a
- * contains a new enough lib/nameser/ to support the feature you need.
- */
-
-#define __NAMESER 19991006 /*%< New interface version stamp. */
/*
* Define constants based on RFC 883, RFC 1034, RFC 1035
*/
@@ -80,9 +63,9 @@
#define NS_HFIXEDSZ 12 /*%< #/bytes of fixed data in header */
#define NS_QFIXEDSZ 4 /*%< #/bytes of fixed data in query */
#define NS_RRFIXEDSZ 10 /*%< #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /*%< #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /*%< #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /*%< #/bytes of data in a u_int8_t */
+#define NS_INT32SZ 4 /*%< #/bytes of data in a uint32_t */
+#define NS_INT16SZ 2 /*%< #/bytes of data in a uint16_t */
+#define NS_INT8SZ 1 /*%< #/bytes of data in a uint8_t */
#define NS_INADDRSZ 4 /*%< IPv4 T_A */
#define NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */
#define NS_CMPRSFLGS 0xc0 /*%< Flag bits indicating name compression. */
@@ -108,12 +91,12 @@ typedef enum __ns_sect {
* leading _'s on the member names. Use the accessor functions, not the _'s.
*/
typedef struct __ns_msg {
- const u_char *_msg, *_eom;
- u_int16_t _id, _flags, _counts[ns_s_max];
- const u_char *_sections[ns_s_max];
- ns_sect _sect;
- int _rrnum;
- const u_char *_msg_ptr;
+ const unsigned char *_msg, *_eom;
+ uint16_t _id, _flags, _counts[ns_s_max];
+ const unsigned char *_sections[ns_s_max];
+ ns_sect _sect;
+ int _rrnum;
+ const unsigned char *_msg_ptr;
} ns_msg;
/* Private data structure - do not use from outside library. */
@@ -132,12 +115,12 @@ extern const struct _ns_flagdata _ns_flagdata[];
* This is a parsed record. It is caller allocated and has no dynamic data.
*/
typedef struct __ns_rr {
- char name[NS_MAXDNAME];
- u_int16_t type;
- u_int16_t rr_class;
- u_int32_t ttl;
- u_int16_t rdlength;
- const u_char * rdata;
+ char name[NS_MAXDNAME];
+ uint16_t type;
+ uint16_t rr_class;
+ uint32_t ttl;
+ uint16_t rdlength;
+ const unsigned char * rdata;
} ns_rr;
/* Accessor macros - this is part of the public interface. */
@@ -300,17 +283,6 @@ typedef enum __ns_type {
ns_t_max = 65536
} ns_type;
-/* Exclusively a QTYPE? (not also an RTYPE) */
-#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
- (t) == ns_t_mailb || (t) == ns_t_maila)
-/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
-#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
-/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
-#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
-#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
-#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
- (t) == ns_t_zxfr)
-
/*%
* Values for class field
*/
@@ -326,15 +298,7 @@ typedef enum __ns_class {
ns_c_max = 65536
} ns_class;
-/* DNSSEC constants. */
-
-typedef enum __ns_key_types {
- ns_kt_rsa = 1, /*%< key type RSA/MD5 */
- ns_kt_dh = 2, /*%< Diffie Hellman */
- ns_kt_dsa = 3, /*%< Digital Signature Standard (MANDATORY) */
- ns_kt_private = 254 /*%< Private key type starts with OID */
-} ns_key_types;
-
+/* Certificate type values in CERT resource records. */
typedef enum __ns_cert_types {
cert_t_pkix = 1, /*%< PKIX (X.509v3) */
cert_t_spki = 2, /*%< SPKI */
@@ -343,82 +307,6 @@ typedef enum __ns_cert_types {
cert_t_oid = 254 /*%< OID private type */
} ns_cert_types;
-/* Flags field of the KEY RR rdata. */
-#define NS_KEY_TYPEMASK 0xC000 /*%< Mask for "type" bits */
-#define NS_KEY_TYPE_AUTH_CONF 0x0000 /*%< Key usable for both */
-#define NS_KEY_TYPE_CONF_ONLY 0x8000 /*%< Key usable for confidentiality */
-#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /*%< Key usable for authentication */
-#define NS_KEY_TYPE_NO_KEY 0xC000 /*%< No key usable for either; no key */
-/* The type bits can also be interpreted independently, as single bits: */
-#define NS_KEY_NO_AUTH 0x8000 /*%< Key unusable for authentication */
-#define NS_KEY_NO_CONF 0x4000 /*%< Key unusable for confidentiality */
-#define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */
-#define NS_KEY_EXTENDED_FLAGS 0x1000 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED4 0x0800 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED5 0x0400 /*%< reserved - must be zero */
-#define NS_KEY_NAME_TYPE 0x0300 /*%< these bits determine the type */
-#define NS_KEY_NAME_USER 0x0000 /*%< key is assoc. with user */
-#define NS_KEY_NAME_ENTITY 0x0200 /*%< key is assoc. with entity eg host */
-#define NS_KEY_NAME_ZONE 0x0100 /*%< key is zone key */
-#define NS_KEY_NAME_RESERVED 0x0300 /*%< reserved meaning */
-#define NS_KEY_RESERVED8 0x0080 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED9 0x0040 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED10 0x0020 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED11 0x0010 /*%< reserved - must be zero */
-#define NS_KEY_SIGNATORYMASK 0x000F /*%< key can sign RR's of same name */
-#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
- NS_KEY_RESERVED4 | \
- NS_KEY_RESERVED5 | \
- NS_KEY_RESERVED8 | \
- NS_KEY_RESERVED9 | \
- NS_KEY_RESERVED10 | \
- NS_KEY_RESERVED11 )
-#define NS_KEY_RESERVED_BITMASK2 0xFFFF /*%< no bits defined here */
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define NS_ALG_MD5RSA 1 /*%< MD5 with RSA */
-#define NS_ALG_DH 2 /*%< Diffie Hellman KEY */
-#define NS_ALG_DSA 3 /*%< DSA KEY */
-#define NS_ALG_DSS NS_ALG_DSA
-#define NS_ALG_EXPIRE_ONLY 253 /*%< No alg, no security */
-#define NS_ALG_PRIVATE_OID 254 /*%< Key begins with OID giving alg */
-/* Protocol values */
-/* value 0 is reserved */
-#define NS_KEY_PROT_TLS 1
-#define NS_KEY_PROT_EMAIL 2
-#define NS_KEY_PROT_DNSSEC 3
-#define NS_KEY_PROT_IPSEC 4
-#define NS_KEY_PROT_ANY 255
-
-/* Signatures */
-#define NS_MD5RSA_MIN_BITS 512 /*%< Size of a mod or exp in bits */
-#define NS_MD5RSA_MAX_BITS 4096
- /* Total of binary mod and exp */
-#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
- /* Max length of text sig block */
-#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
-#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
-#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
-
-#define NS_DSA_SIG_SIZE 41
-#define NS_DSA_MIN_SIZE 213
-#define NS_DSA_MAX_BYTES 405
-
-/* Offsets into SIG record rdata to find various values */
-#define NS_SIG_TYPE 0 /*%< Type flags */
-#define NS_SIG_ALG 2 /*%< Algorithm */
-#define NS_SIG_LABELS 3 /*%< How many labels in name */
-#define NS_SIG_OTTL 4 /*%< Original TTL */
-#define NS_SIG_EXPIR 8 /*%< Expiration time */
-#define NS_SIG_SIGNED 12 /*%< Signature time */
-#define NS_SIG_FOOT 16 /*%< Key footprint */
-#define NS_SIG_SIGNER 18 /*%< Domain name of who signed it */
-/* How RR types are represented as bit-flags in NXT records */
-#define NS_NXT_BITS 8
-#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_MAX 127
-
/*%
* EDNS0 extended flags and option codes, host order.
*/
@@ -429,34 +317,34 @@ typedef enum __ns_cert_types {
* Inline versions of get/put short/long. Pointer is advanced.
*/
#define NS_GET16(s, cp) do { \
- const u_char *t_cp = (const u_char *)(cp); \
- (s) = ((u_int16_t)t_cp[0] << 8) \
- | ((u_int16_t)t_cp[1]) \
+ const unsigned char *t_cp = (const unsigned char *)(cp); \
+ (s) = ((uint16_t)t_cp[0] << 8) \
+ | ((uint16_t)t_cp[1]) \
; \
(cp) += NS_INT16SZ; \
} while (0)
#define NS_GET32(l, cp) do { \
- const u_char *t_cp = (const u_char *)(cp); \
- (l) = ((u_int32_t)t_cp[0] << 24) \
- | ((u_int32_t)t_cp[1] << 16) \
- | ((u_int32_t)t_cp[2] << 8) \
- | ((u_int32_t)t_cp[3]) \
+ const unsigned char *t_cp = (const unsigned char *)(cp); \
+ (l) = ((uint32_t)t_cp[0] << 24) \
+ | ((uint32_t)t_cp[1] << 16) \
+ | ((uint32_t)t_cp[2] << 8) \
+ | ((uint32_t)t_cp[3]) \
; \
(cp) += NS_INT32SZ; \
} while (0)
#define NS_PUT16(s, cp) do { \
- u_int16_t t_s = (u_int16_t)(s); \
- u_char *t_cp = (u_char *)(cp); \
+ uint16_t t_s = (uint16_t)(s); \
+ unsigned char *t_cp = (unsigned char *)(cp); \
*t_cp++ = t_s >> 8; \
*t_cp = t_s; \
(cp) += NS_INT16SZ; \
} while (0)
#define NS_PUT32(l, cp) do { \
- u_int32_t t_l = (u_int32_t)(l); \
- u_char *t_cp = (u_char *)(cp); \
+ uint32_t t_l = (uint32_t)(l); \
+ unsigned char *t_cp = (unsigned char *)(cp); \
*t_cp++ = t_l >> 24; \
*t_cp++ = t_l >> 16; \
*t_cp++ = t_l >> 8; \
@@ -466,66 +354,53 @@ typedef enum __ns_cert_types {
__BEGIN_DECLS
int ns_msg_getflag (ns_msg, int) __THROW;
-u_int ns_get16 (const u_char *) __THROW;
-u_long ns_get32 (const u_char *) __THROW;
-void ns_put16 (u_int, u_char *) __THROW;
-void ns_put32 (u_long, u_char *) __THROW;
-int ns_initparse (const u_char *, int, ns_msg *) __THROW;
-int ns_skiprr (const u_char *, const u_char *, ns_sect, int)
- __THROW;
+unsigned int ns_get16 (const unsigned char *) __THROW;
+unsigned long ns_get32 (const unsigned char *) __THROW;
+void ns_put16 (unsigned int, unsigned char *) __THROW;
+void ns_put32 (unsigned long, unsigned char *) __THROW;
+int ns_initparse (const unsigned char *, int, ns_msg *) __THROW;
+int ns_skiprr (const unsigned char *, const unsigned char *,
+ ns_sect, int) __THROW;
int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
int ns_sprintrr (const ns_msg *, const ns_rr *,
const char *, const char *, char *, size_t)
__THROW;
-int ns_sprintrrf (const u_char *, size_t, const char *,
- ns_class, ns_type, u_long, const u_char *,
- size_t, const char *, const char *,
- char *, size_t) __THROW;
-int ns_format_ttl (u_long, char *, size_t) __THROW;
-int ns_parse_ttl (const char *, u_long *) __THROW;
-u_int32_t ns_datetosecs (const char *, int *) __THROW;
-int ns_name_ntol (const u_char *, u_char *, size_t) __THROW;
-int ns_name_ntop (const u_char *, char *, size_t) __THROW;
-int ns_name_pton (const char *, u_char *, size_t) __THROW;
-int ns_name_unpack (const u_char *, const u_char *,
- const u_char *, u_char *, size_t) __THROW;
-int ns_name_pack (const u_char *, u_char *, int,
- const u_char **, const u_char **) __THROW;
-int ns_name_uncompress (const u_char *, const u_char *,
- const u_char *, char *, size_t) __THROW;
-int ns_name_compress (const char *, u_char *, size_t,
- const u_char **, const u_char **) __THROW;
-int ns_name_skip (const u_char **, const u_char *) __THROW;
-void ns_name_rollback (const u_char *, const u_char **,
- const u_char **) __THROW;
-int ns_sign (u_char *, int *, int, int, void *,
- const u_char *, int, u_char *, int *, time_t) __THROW;
-int ns_sign2 (u_char *, int *, int, int, void *,
- const u_char *, int, u_char *, int *, time_t,
- u_char **, u_char **) __THROW;
-int ns_sign_tcp (u_char *, int *, int, int,
- ns_tcp_tsig_state *, int) __THROW;
-int ns_sign_tcp2 (u_char *, int *, int, int,
- ns_tcp_tsig_state *, int,
- u_char **, u_char **) __THROW;
-int ns_sign_tcp_init (void *, const u_char *, int,
- ns_tcp_tsig_state *) __THROW;
-u_char *ns_find_tsig (u_char *, u_char *) __THROW;
-int ns_verify (u_char *, int *, void *, const u_char *, int,
- u_char *, int *, time_t *, int) __THROW;
-int ns_verify_tcp (u_char *, int *, ns_tcp_tsig_state *, int)
+int ns_sprintrrf (const unsigned char *, size_t, const char *,
+ ns_class, ns_type, unsigned long,
+ const unsigned char *, size_t, const char *,
+ const char *, char *, size_t) __THROW;
+int ns_format_ttl (unsigned long, char *, size_t) __THROW;
+int ns_parse_ttl (const char *, unsigned long *) __THROW;
+uint32_t ns_datetosecs (const char *, int *) __THROW;
+int ns_name_ntol (const unsigned char *, unsigned char *, size_t)
+ __THROW;
+int ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+int ns_name_pton (const char *, unsigned char *, size_t) __THROW;
+int ns_name_unpack (const unsigned char *, const unsigned char *,
+ const unsigned char *, unsigned char *, size_t)
+ __THROW;
+int ns_name_pack (const unsigned char *, unsigned char *, int,
+ const unsigned char **, const unsigned char **)
+ __THROW;
+int ns_name_uncompress (const unsigned char *,
+ const unsigned char *,
+ const unsigned char *,
+ char *, size_t) __THROW;
+int ns_name_compress (const char *, unsigned char *, size_t,
+ const unsigned char **,
+ const unsigned char **) __THROW;
+int ns_name_skip (const unsigned char **, const unsigned char *)
__THROW;
-int ns_verify_tcp_init (void *, const u_char *, int,
- ns_tcp_tsig_state *) __THROW;
+void ns_name_rollback (const unsigned char *,
+ const unsigned char **,
+ const unsigned char **) __THROW;
int ns_samedomain (const char *, const char *) __THROW;
int ns_subdomain (const char *, const char *) __THROW;
int ns_makecanon (const char *, char *, size_t) __THROW;
int ns_samename (const char *, const char *) __THROW;
__END_DECLS
-#ifdef BIND_4_COMPAT
#include <arpa/nameser_compat.h>
-#endif
#endif /* !_ARPA_NAMESER_H_ */
/*! \file */
diff --git a/resolv/arpa/nameser_compat.h b/resolv/arpa/nameser_compat.h
index d59c9e41b3..6a2f029892 100644
--- a/resolv/arpa/nameser_compat.h
+++ b/resolv/arpa/nameser_compat.h
@@ -26,16 +26,9 @@
* SUCH DAMAGE.
*/
-/*%
- * from nameser.h 8.1 (Berkeley) 6/2/93
- * $BINDId: nameser_compat.h,v 8.11 1999/01/02 08:00:58 vixie Exp $
- */
-
#ifndef _ARPA_NAMESER_COMPAT_
#define _ARPA_NAMESER_COMPAT_
-#define __BIND 19950621 /*%< (DEAD) interface version stamp. */
-
#include <endian.h>
/*%
@@ -47,7 +40,7 @@
typedef struct {
unsigned id :16; /*%< query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
/* fields in third byte */
unsigned qr: 1; /*%< response flag */
unsigned opcode: 4; /*%< purpose of message */
@@ -61,7 +54,7 @@ typedef struct {
unsigned cd: 1; /*%< checking disabled by resolver */
unsigned rcode :4; /*%< response code */
#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __PDP_ENDIAN
/* fields in third byte */
unsigned rd :1; /*%< recursion desired */
unsigned tc :1; /*%< truncated message */
diff --git a/resolv/compat-hooks.c b/resolv/compat-hooks.c
new file mode 100644
index 0000000000..5e38260e9e
--- /dev/null
+++ b/resolv/compat-hooks.c
@@ -0,0 +1,56 @@
+/* Compatibility functions for obsolete libresolv hooks.
+ Copyright (C) 1999-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/*
+ * Copyright (c) 1995-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include <resolv.h>
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_25)
+
+void
+attribute_compat_text_section
+res_send_setqhook(void *hook) {
+ _res.__glibc_unused_qhook = hook;
+}
+compat_symbol (libresolv, res_send_setqhook, res_send_setqhook, GLIBC_2_0);
+
+void
+attribute_compat_text_section
+res_send_setrhook(void *hook) {
+ _res.__glibc_unused_rhook = hook;
+}
+compat_symbol (libresolv, res_send_setrhook, res_send_setrhook, GLIBC_2_0);
+
+#endif
diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index 9ad2c3010a..1b81ca840e 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -642,12 +642,6 @@ gethostbyaddr (const void *addr, socklen_t len, int af)
n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, 1024,
&buf.ptr, NULL, NULL, NULL, NULL);
- if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0) {
- strcpy(qp, "ip6.int");
- n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf,
- buf.buf != orig_buf ? MAXPACKET : 1024,
- &buf.ptr, NULL, NULL, NULL, NULL);
- }
if (n < 0) {
if (buf.buf != orig_buf)
free (buf.buf);
diff --git a/resolv/herror.c b/resolv/herror.c
index e285224fea..b3df236bc9 100644
--- a/resolv/herror.c
+++ b/resolv/herror.c
@@ -80,14 +80,14 @@ herror(const char *s) {
v->iov_base = (/*noconst*/ char *)s;
v->iov_len = strlen(s);
v++;
- v->iov_base = ": ";
+ v->iov_base = (char *) ": ";
v->iov_len = 2;
v++;
}
v->iov_base = (char *)hstrerror(h_errno);
v->iov_len = strlen(v->iov_base);
v++;
- v->iov_base = "\n";
+ v->iov_base = (char *) "\n";
v->iov_len = 1;
writev_not_cancel_no_status(STDERR_FILENO, iov, (v - iov) + 1);
}
diff --git a/resolv/netdb.h b/resolv/netdb.h
index 3aba530932..9a409c0445 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -35,8 +35,7 @@
#ifdef __USE_GNU
# define __need_sigevent_t
# include <bits/siginfo.h>
-# define __need_timespec
-# include <time.h>
+# include <bits/types/struct_timespec.h>
#endif
#include <bits/netdb.h>
diff --git a/resolv/ns_name.c b/resolv/ns_name.c
index 65e7fc8079..0d76fe53a6 100644
--- a/resolv/ns_name.c
+++ b/resolv/ns_name.c
@@ -29,32 +29,10 @@
# define SPRINTF(x) ((size_t)sprintf x)
-#define NS_TYPE_ELT 0x40 /*%< EDNS0 extended label type */
-#define DNS_LABELTYPE_BITSTRING 0x41
-
/* Data. */
static const char digits[] = "0123456789";
-static const char digitvalue[256] = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*16*/
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*32*/
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*48*/
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /*64*/
- -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*80*/
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*96*/
- -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*112*/
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*128*/
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*256*/
-};
-
/* Forward. */
static int special(int);
@@ -62,12 +40,7 @@ static int printable(int);
static int dn_find(const u_char *, const u_char *,
const u_char * const *,
const u_char * const *);
-static int encode_bitstring(const char **, const char *,
- unsigned char **, unsigned char **,
- unsigned const char *);
static int labellen(const u_char *);
-static int decode_bitstring(const unsigned char **,
- char *, const char *);
/* Public. */
@@ -115,22 +88,6 @@ ns_name_ntop(const u_char *src, char *dst, size_t dstsiz)
__set_errno (EMSGSIZE);
return (-1);
}
- if ((n & NS_CMPRSFLGS) == NS_TYPE_ELT) {
- int m;
-
- if (n != DNS_LABELTYPE_BITSTRING) {
- /* XXX: labellen should reject this case */
- __set_errno (EINVAL);
- return(-1);
- }
- if ((m = decode_bitstring(&cp, dn, eom)) < 0)
- {
- __set_errno (EMSGSIZE);
- return(-1);
- }
- dn += m;
- continue;
- }
for ((void)NULL; l > 0; l--) {
c = *cp++;
if (special(c)) {
@@ -192,7 +149,7 @@ int
ns_name_pton(const char *src, u_char *dst, size_t dstsiz)
{
u_char *label, *bp, *eom;
- int c, n, escaped, e = 0;
+ int c, n, escaped;
char *cp;
escaped = 0;
@@ -202,28 +159,7 @@ ns_name_pton(const char *src, u_char *dst, size_t dstsiz)
while ((c = *src++) != 0) {
if (escaped) {
- if (c == '[') { /*%< start a bit string label */
- if ((cp = strchr(src, ']')) == NULL) {
- __set_errno (EINVAL);
- return(-1);
- }
- if ((e = encode_bitstring(&src, cp + 2,
- &label, &bp, eom))
- != 0) {
- __set_errno (e);
- return(-1);
- }
- escaped = 0;
- label = bp++;
- if ((c = *src++) == 0)
- goto done;
- else if (c != '.') {
- __set_errno (EINVAL);
- return(-1);
- }
- continue;
- }
- else if ((cp = strchr(digits, c)) != NULL) {
+ if ((cp = strchr(digits, c)) != NULL) {
n = (cp - digits) * 100;
if ((c = *src++) == 0 ||
(cp = strchr(digits, c)) == NULL) {
@@ -291,7 +227,6 @@ ns_name_pton(const char *src, u_char *dst, size_t dstsiz)
__set_errno (EMSGSIZE);
return (-1);
}
- done:
if (label >= eom) {
__set_errno (EMSGSIZE);
return (-1);
@@ -394,7 +329,6 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
/* Check for indirection. */
switch (n & NS_CMPRSFLGS) {
case 0:
- case NS_TYPE_ELT:
/* Limit checks. */
if ((l = labellen(srcp - 1)) < 0) {
__set_errno (EMSGSIZE);
@@ -639,7 +573,6 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom)
{
const u_char *cp;
u_int n;
- int l;
cp = *ptrptr;
while (cp < eom && (n = *cp++) != 0) {
@@ -648,13 +581,6 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom)
case 0: /*%< normal case, n == len */
cp += n;
continue;
- case NS_TYPE_ELT: /*%< EDNS0 extended label */
- if ((l = labellen(cp - 1)) < 0) {
- __set_errno (EMSGSIZE);
- return(-1);
- }
- cp += l;
- continue;
case NS_CMPRSFLGS: /*%< indirection */
cp++;
break;
@@ -791,180 +717,14 @@ dn_find(const u_char *domain, const u_char *msg,
return (-1);
}
+/* Return the length of the encoded label starting at LP, or -1 for
+ compression references and extended label types. */
static int
-decode_bitstring(const unsigned char **cpp, char *dn, const char *eom)
+labellen (const unsigned char *lp)
{
- const unsigned char *cp = *cpp;
- char *beg = dn, tc;
- int b, blen, plen, i;
-
- if ((blen = (*cp & 0xff)) == 0)
- blen = 256;
- plen = (blen + 3) / 4;
- plen += sizeof("\\[x/]") + (blen > 99 ? 3 : (blen > 9) ? 2 : 1);
- if (dn + plen >= eom)
- return(-1);
-
- cp++;
- i = SPRINTF((dn, "\\[x"));
- if (i < 0)
- return (-1);
- dn += i;
- for (b = blen; b > 7; b -= 8, cp++) {
- i = SPRINTF((dn, "%02x", *cp & 0xff));
- if (i < 0)
- return (-1);
- dn += i;
- }
- if (b > 4) {
- tc = *cp++;
- i = SPRINTF((dn, "%02x", tc & (0xff << (8 - b))));
- if (i < 0)
- return (-1);
- dn += i;
- } else if (b > 0) {
- tc = *cp++;
- i = SPRINTF((dn, "%1x",
- ((tc >> 4) & 0x0f) & (0x0f << (4 - b))));
- if (i < 0)
- return (-1);
- dn += i;
- }
- i = SPRINTF((dn, "/%d]", blen));
- if (i < 0)
- return (-1);
- dn += i;
-
- *cpp = cp;
- return(dn - beg);
-}
-
-static int
-encode_bitstring(const char **bp, const char *end, unsigned char **labelp,
- unsigned char ** dst, unsigned const char *eom)
-{
- int afterslash = 0;
- const char *cp = *bp;
- unsigned char *tp;
- char c;
- const char *beg_blen;
- char *end_blen = NULL;
- int value = 0, count = 0, tbcount = 0, blen = 0;
-
- beg_blen = end_blen = NULL;
-
- /* a bitstring must contain at least 2 characters */
- if (end - cp < 2)
- return(EINVAL);
-
- /* XXX: currently, only hex strings are supported */
- if (*cp++ != 'x')
- return(EINVAL);
- if (!isxdigit((*cp) & 0xff)) /*%< reject '\[x/BLEN]' */
- return(EINVAL);
-
- for (tp = *dst + 1; cp < end && tp < eom; cp++) {
- switch((c = *cp)) {
- case ']': /*%< end of the bitstring */
- if (afterslash) {
- if (beg_blen == NULL)
- return(EINVAL);
- blen = (int)strtol(beg_blen, &end_blen, 10);
- if (*end_blen != ']')
- return(EINVAL);
- }
- if (count)
- *tp++ = ((value << 4) & 0xff);
- cp++; /*%< skip ']' */
- goto done;
- case '/':
- afterslash = 1;
- break;
- default:
- if (afterslash) {
- if (!isdigit(c&0xff))
- return(EINVAL);
- if (beg_blen == NULL) {
-
- if (c == '0') {
- /* blen never begings with 0 */
- return(EINVAL);
- }
- beg_blen = cp;
- }
- } else {
- if (!isxdigit(c&0xff))
- return(EINVAL);
- value <<= 4;
- value += digitvalue[(int)c];
- count += 4;
- tbcount += 4;
- if (tbcount > 256)
- return(EINVAL);
- if (count == 8) {
- *tp++ = value;
- count = 0;
- }
- }
- break;
- }
- }
- done:
- if (cp >= end || tp >= eom)
- return(EMSGSIZE);
-
- /*
- * bit length validation:
- * If a <length> is present, the number of digits in the <bit-data>
- * MUST be just sufficient to contain the number of bits specified
- * by the <length>. If there are insignificant bits in a final
- * hexadecimal or octal digit, they MUST be zero.
- * RFC2673, Section 3.2.
- */
- if (blen > 0) {
- int traillen;
-
- if (((blen + 3) & ~3) != tbcount)
- return(EINVAL);
- traillen = tbcount - blen; /*%< between 0 and 3 */
- if (((value << (8 - traillen)) & 0xff) != 0)
- return(EINVAL);
- }
- else
- blen = tbcount;
- if (blen == 256)
- blen = 0;
-
- /* encode the type and the significant bit fields */
- **labelp = DNS_LABELTYPE_BITSTRING;
- **dst = blen;
-
- *bp = cp;
- *dst = tp;
-
- return(0);
-}
-
-static int
-labellen(const u_char *lp)
-{
- int bitlen;
- u_char l = *lp;
-
- if ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
- /* should be avoided by the caller */
- return(-1);
- }
-
- if ((l & NS_CMPRSFLGS) == NS_TYPE_ELT) {
- if (l == DNS_LABELTYPE_BITSTRING) {
- if ((bitlen = *(lp + 1)) == 0)
- bitlen = 256;
- return((bitlen + 7 ) / 8 + 1);
- }
- return(-1); /*%< unknwon ELT */
- }
- return(l);
+ if (*lp <= 63)
+ return *lp;
+ return -1;
}
/*! \file */
diff --git a/resolv/ns_print.c b/resolv/ns_print.c
index 7a0e7d5e71..f55680c311 100644
--- a/resolv/ns_print.c
+++ b/resolv/ns_print.c
@@ -47,8 +47,6 @@ static int addstr(const char *src, size_t len,
static int addtab(size_t len, size_t target, int spaced,
char **buf, size_t *buflen);
-static u_int16_t dst_s_dns_key_id(const u_char *, const int);
-
/* Macros. */
#define T(x) \
@@ -436,124 +434,6 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
break;
}
- case ns_t_key: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int keyflags, protocol, algorithm, key_id;
- const char *leader;
- int n;
-
- if (rdlen < 0U + NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
- goto formerr;
-
- /* Key flags, Protocol, Algorithm. */
- key_id = dst_s_dns_key_id(rdata, edata-rdata);
- keyflags = ns_get16(rdata); rdata += NS_INT16SZ;
- protocol = *rdata++;
- algorithm = *rdata++;
- len = SPRINTF((tmp, "0x%04x %u %u",
- keyflags, protocol, algorithm));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Public key data. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len < 0)
- goto formerr;
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
- n = SPRINTF((tmp, " ; key_tag= %u", key_id));
- T(addstr(tmp, n, &buf, &buflen));
-
- break;
- }
-
- case ns_t_sig: {
- char base64_key[NS_MD5RSA_MAX_BASE64];
- u_int type, algorithm, labels, footprint;
- const char *leader;
- u_long t;
- int n;
-
- if (rdlen < 22U)
- goto formerr;
-
- /* Type covered, Algorithm, Label count, Original TTL. */
- type = ns_get16(rdata); rdata += NS_INT16SZ;
- algorithm = *rdata++;
- labels = *rdata++;
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s %d %d %lu ",
- p_type(type), algorithm, labels, t));
- T(addstr(tmp, len, &buf, &buflen));
- if (labels > (u_int)dn_count_labels(name))
- goto formerr;
-
- /* Signature expiry. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Time signed. */
- t = ns_get32(rdata); rdata += NS_INT32SZ;
- len = SPRINTF((tmp, "%s ", p_secstodate(t)));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signature Footprint. */
- footprint = ns_get16(rdata); rdata += NS_INT16SZ;
- len = SPRINTF((tmp, "%u ", footprint));
- T(addstr(tmp, len, &buf, &buflen));
-
- /* Signer's name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Signature. */
- len = b64_ntop(rdata, edata - rdata,
- base64_key, sizeof base64_key);
- if (len > 15) {
- T(addstr(" (", 2, &buf, &buflen));
- leader = "\n\t\t";
- spaced = 0;
- } else
- leader = " ";
- if (len < 0)
- goto formerr;
- for (n = 0; n < len; n += 48) {
- T(addstr(leader, strlen(leader), &buf, &buflen));
- T(addstr(base64_key + n, MIN(len - n, 48),
- &buf, &buflen));
- }
- if (len > 15)
- T(addstr(" )", 2, &buf, &buflen));
- break;
- }
-
- case ns_t_nxt: {
- int n, c;
-
- /* Next domain name. */
- T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
-
- /* Type bit map. */
- n = edata - rdata;
- for (c = 0; c < n*8; c++)
- if (NS_NXT_BIT_ISSET(c, rdata)) {
- len = SPRINTF((tmp, " %s", p_type(c)));
- T(addstr(tmp, len, &buf, &buflen));
- }
- break;
- }
-
case ns_t_cert: {
u_int c_type, key_tag, alg;
int n;
@@ -887,81 +767,3 @@ addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) {
}
return (spaced);
}
-
-/* DST algorithm codes */
-#define KEY_RSA 1
-#define KEY_HMAC_MD5 157
-
-/*%
- * calculates a checksum used in dst for an id.
- * takes an array of bytes and a length.
- * returns a 16 bit checksum.
- */
-static u_int16_t
-dst_s_id_calc(const u_char *key, const int keysize)
-{
- u_int32_t ac;
- const u_char *kp = key;
- int size = keysize;
-
- if (!key || (keysize <= 0))
- return (0xffffU);
-
- for (ac = 0; size > 1; size -= 2, kp += 2)
- ac += ((*kp) << 8) + *(kp + 1);
-
- if (size > 0)
- ac += ((*kp) << 8);
- ac += (ac >> 16) & 0xffff;
-
- return (ac & 0xffff);
-}
-
-/*%
- * dst_s_get_int16
- * This routine extracts a 16 bit integer from a two byte character
- * string. The character string is assumed to be in network byte
- * order and may be unaligned. The number returned is in host order.
- * Parameter
- * buf A two byte character string.
- * Return
- * The converted integer value.
- */
-
-static u_int16_t
-dst_s_get_int16(const u_char *buf)
-{
- u_int16_t a = 0;
- a = ((u_int16_t)(buf[0] << 8)) | ((u_int16_t)(buf[1]));
- return (a);
-}
-
-/*%
- * dst_s_dns_key_id() Function to calculate DNSSEC footprint from KEY record
- * rdata
- * Input:
- * dns_key_rdata: the raw data in wire format
- * rdata_len: the size of the input data
- * Output:
- * the key footprint/id calculated from the key data
- */
-static u_int16_t
-dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len)
-{
- if (!dns_key_rdata)
- return 0;
-
- /* compute id */
- if (dns_key_rdata[3] == KEY_RSA) /*%< Algorithm RSA */
- return dst_s_get_int16((const u_char *)
- &dns_key_rdata[rdata_len - 3]);
- else if (dns_key_rdata[3] == KEY_HMAC_MD5)
- /* compatibility */
- return 0;
- else
- /* compute a checksum on the key part of the key rr */
- return dst_s_id_calc(dns_key_rdata, rdata_len);
-}
-
-
-/*! \file */
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 5f9e35701b..c1333b816b 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -464,19 +464,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
(uaddr[2] & 0xff), (uaddr[1] & 0xff), (uaddr[0] & 0xff));
break;
case AF_INET6:
- /* Only lookup with the byte string format if the user wants it. */
- if (__glibc_unlikely (_res.options & RES_USEBSTRING))
- {
- qp = stpcpy (qbuf, "\\[x");
- for (n = 0; n < IN6ADDRSZ; ++n)
- qp += sprintf (qp, "%02hhx", uaddr[n]);
- strcpy (qp, "].ip6.arpa");
- n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR,
- host_buffer.buf->buf, 1024, &host_buffer.ptr,
- NULL, NULL, NULL, NULL);
- if (n >= 0)
- goto got_it_already;
- }
qp = qbuf;
for (n = IN6ADDRSZ - 1; n >= 0; n--)
{
@@ -495,14 +482,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
1024, &host_buffer.ptr, NULL, NULL, NULL, NULL);
- if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0)
- {
- strcpy (qp, "ip6.int");
- n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf,
- host_buffer.buf != orig_host_buffer
- ? MAXPACKET : 1024, &host_buffer.ptr,
- NULL, NULL, NULL, NULL);
- }
if (n < 0)
{
*h_errnop = h_errno;
@@ -512,7 +491,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
}
- got_it_already:
status = getanswer_r (host_buffer.buf, n, qbuf, T_PTR, result, buffer, buflen,
errnop, h_errnop, 0 /* XXX */, ttlp, NULL);
if (host_buffer.buf != orig_host_buffer)
diff --git a/resolv/res_comp.c b/resolv/res_comp.c
index d2be5e4560..ffb2ed5914 100644
--- a/resolv/res_comp.c
+++ b/resolv/res_comp.c
@@ -228,7 +228,6 @@ res_dnok(const char *dn) {
}
libresolv_hidden_def (res_dnok)
-#ifdef BIND_4_COMPAT
/*
* This module must export the following externally-visible symbols:
* ___putlong
@@ -243,7 +242,6 @@ void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
libresolv_hidden_def (__putshort)
u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
-#endif /*BIND_4_COMPAT*/
#include <shlib-compat.h>
diff --git a/resolv/res_data.c b/resolv/res_data.c
index f44c517062..569ff4c0ea 100644
--- a/resolv/res_data.c
+++ b/resolv/res_data.c
@@ -104,16 +104,6 @@ res_query(const char *name, /* domain name */
return (res_nquery(&_res, name, class, type, answer, anslen));
}
-void
-res_send_setqhook(res_send_qhook hook) {
- _res.qhook = hook;
-}
-
-void
-res_send_setrhook(res_send_rhook hook) {
- _res.rhook = hook;
-}
-
int
res_isourserver(const struct sockaddr_in *inp) {
return (res_ourserver_p(&_res, (const struct sockaddr_in6 *) inp));
diff --git a/resolv/res_debug.c b/resolv/res_debug.c
index bd95590ccc..a0383d47cb 100644
--- a/resolv/res_debug.c
+++ b/resolv/res_debug.c
@@ -342,13 +342,13 @@ p_fqname(const u_char *cp, const u_char *msg, FILE *file) {
extern const struct res_sym __p_class_syms[];
libresolv_hidden_proto (__p_class_syms)
const struct res_sym __p_class_syms[] = {
- {C_IN, "IN"},
- {C_CHAOS, "CHAOS"},
- {C_HS, "HS"},
- {C_HS, "HESIOD"},
- {C_ANY, "ANY"},
- {C_NONE, "NONE"},
- {C_IN, (char *)0}
+ {C_IN, (char *) "IN"},
+ {C_CHAOS, (char *) "CHAOS"},
+ {C_HS, (char *) "HS"},
+ {C_HS, (char *) "HESIOD"},
+ {C_ANY, (char *) "ANY"},
+ {C_NONE, (char *) "NONE"},
+ {C_IN, NULL, NULL}
};
libresolv_hidden_data_def (__p_class_syms)
@@ -356,37 +356,19 @@ libresolv_hidden_data_def (__p_class_syms)
* Names of message sections.
*/
const struct res_sym __p_default_section_syms[] attribute_hidden = {
- {ns_s_qd, "QUERY"},
- {ns_s_an, "ANSWER"},
- {ns_s_ns, "AUTHORITY"},
- {ns_s_ar, "ADDITIONAL"},
- {0, (char *)0}
+ {ns_s_qd, (char *) "QUERY"},
+ {ns_s_an, (char *) "ANSWER"},
+ {ns_s_ns, (char *) "AUTHORITY"},
+ {ns_s_ar, (char *) "ADDITIONAL"},
+ {0, NULL, NULL}
};
const struct res_sym __p_update_section_syms[] attribute_hidden = {
- {S_ZONE, "ZONE"},
- {S_PREREQ, "PREREQUISITE"},
- {S_UPDATE, "UPDATE"},
- {S_ADDT, "ADDITIONAL"},
- {0, (char *)0}
-};
-
-const struct res_sym __p_key_syms[] attribute_hidden = {
- {NS_ALG_MD5RSA, "RSA", "RSA KEY with MD5 hash"},
- {NS_ALG_DH, "DH", "Diffie Hellman"},
- {NS_ALG_DSA, "DSA", "Digital Signature Algorithm"},
- {NS_ALG_EXPIRE_ONLY, "EXPIREONLY", "No algorithm"},
- {NS_ALG_PRIVATE_OID, "PRIVATE", "Algorithm obtained from OID"},
- {0, NULL, NULL}
-};
-
-const struct res_sym __p_cert_syms[] attribute_hidden = {
- {cert_t_pkix, "PKIX", "PKIX (X.509v3) Certificate"},
- {cert_t_spki, "SPKI", "SPKI certificate"},
- {cert_t_pgp, "PGP", "PGP certificate"},
- {cert_t_url, "URL", "URL Private"},
- {cert_t_oid, "OID", "OID Private"},
- {0, NULL, NULL}
+ {S_ZONE, (char *) "ZONE"},
+ {S_PREREQ, (char *) "PREREQUISITE"},
+ {S_UPDATE, (char *) "UPDATE"},
+ {S_ADDT, (char *) "ADDITIONAL"},
+ {0, NULL, NULL}
};
/*
@@ -397,52 +379,53 @@ const struct res_sym __p_cert_syms[] attribute_hidden = {
extern const struct res_sym __p_type_syms[];
libresolv_hidden_proto (__p_type_syms)
const struct res_sym __p_type_syms[] = {
- {ns_t_a, "A", "address"},
- {ns_t_ns, "NS", "name server"},
- {ns_t_md, "MD", "mail destination (deprecated)"},
- {ns_t_mf, "MF", "mail forwarder (deprecated)"},
- {ns_t_cname, "CNAME", "canonical name"},
- {ns_t_soa, "SOA", "start of authority"},
- {ns_t_mb, "MB", "mailbox"},
- {ns_t_mg, "MG", "mail group member"},
- {ns_t_mr, "MR", "mail rename"},
- {ns_t_null, "NULL", "null"},
- {ns_t_wks, "WKS", "well-known service (deprecated)"},
- {ns_t_ptr, "PTR", "domain name pointer"},
- {ns_t_hinfo, "HINFO", "host information"},
- {ns_t_minfo, "MINFO", "mailbox information"},
- {ns_t_mx, "MX", "mail exchanger"},
- {ns_t_txt, "TXT", "text"},
- {ns_t_rp, "RP", "responsible person"},
- {ns_t_afsdb, "AFSDB", "DCE or AFS server"},
- {ns_t_x25, "X25", "X25 address"},
- {ns_t_isdn, "ISDN", "ISDN address"},
- {ns_t_rt, "RT", "router"},
- {ns_t_nsap, "NSAP", "nsap address"},
- {ns_t_nsap_ptr, "NSAP_PTR", "domain name pointer"},
- {ns_t_sig, "SIG", "signature"},
- {ns_t_key, "KEY", "key"},
- {ns_t_px, "PX", "mapping information"},
- {ns_t_gpos, "GPOS", "geographical position (withdrawn)"},
- {ns_t_aaaa, "AAAA", "IPv6 address"},
- {ns_t_loc, "LOC", "location"},
- {ns_t_nxt, "NXT", "next valid name (unimplemented)"},
- {ns_t_eid, "EID", "endpoint identifier (unimplemented)"},
- {ns_t_nimloc, "NIMLOC", "NIMROD locator (unimplemented)"},
- {ns_t_srv, "SRV", "server selection"},
- {ns_t_atma, "ATMA", "ATM address (unimplemented)"},
- {ns_t_dname, "DNAME", "Non-terminal DNAME (for IPv6)"},
- {ns_t_tsig, "TSIG", "transaction signature"},
- {ns_t_ixfr, "IXFR", "incremental zone transfer"},
- {ns_t_axfr, "AXFR", "zone transfer"},
- {ns_t_zxfr, "ZXFR", "compressed zone transfer"},
- {ns_t_mailb, "MAILB", "mailbox-related data (deprecated)"},
- {ns_t_maila, "MAILA", "mail agent (deprecated)"},
- {ns_t_naptr, "NAPTR", "URN Naming Authority"},
- {ns_t_kx, "KX", "Key Exchange"},
- {ns_t_cert, "CERT", "Certificate"},
- {ns_t_any, "ANY", "\"any\""},
- {0, NULL, NULL}
+ {ns_t_a, (char *) "A", (char *) "address"},
+ {ns_t_ns, (char *) "NS", (char *) "name server"},
+ {ns_t_md, (char *) "MD", (char *) "mail destination (deprecated)"},
+ {ns_t_mf, (char *) "MF", (char *) "mail forwarder (deprecated)"},
+ {ns_t_cname, (char *) "CNAME", (char *) "canonical name"},
+ {ns_t_soa, (char *) "SOA", (char *) "start of authority"},
+ {ns_t_mb, (char *) "MB", (char *) "mailbox"},
+ {ns_t_mg, (char *) "MG", (char *) "mail group member"},
+ {ns_t_mr, (char *) "MR", (char *) "mail rename"},
+ {ns_t_null, (char *) "NULL", (char *) "null"},
+ {ns_t_wks, (char *) "WKS", (char *) "well-known service (deprecated)"},
+ {ns_t_ptr, (char *) "PTR", (char *) "domain name pointer"},
+ {ns_t_hinfo, (char *) "HINFO", (char *) "host information"},
+ {ns_t_minfo, (char *) "MINFO", (char *) "mailbox information"},
+ {ns_t_mx, (char *) "MX", (char *) "mail exchanger"},
+ {ns_t_txt, (char *) "TXT", (char *) "text"},
+ {ns_t_rp, (char *) "RP", (char *) "responsible person"},
+ {ns_t_afsdb, (char *) "AFSDB", (char *) "DCE or AFS server"},
+ {ns_t_x25, (char *) "X25", (char *) "X25 address"},
+ {ns_t_isdn, (char *) "ISDN", (char *) "ISDN address"},
+ {ns_t_rt, (char *) "RT", (char *) "router"},
+ {ns_t_nsap, (char *) "NSAP", (char *) "nsap address"},
+ {ns_t_nsap_ptr, (char *) "NSAP_PTR", (char *) "domain name pointer"},
+ {ns_t_sig, (char *) "SIG", (char *) "signature"},
+ {ns_t_key, (char *) "KEY", (char *) "key"},
+ {ns_t_px, (char *) "PX", (char *) "mapping information"},
+ {ns_t_gpos, (char *) "GPOS",
+ (char *) "geographical position (withdrawn)"},
+ {ns_t_aaaa, (char *) "AAAA", (char *) "IPv6 address"},
+ {ns_t_loc, (char *) "LOC", (char *) "location"},
+ {ns_t_nxt, (char *) "NXT", (char *) "next valid name (unimplemented)"},
+ {ns_t_eid, (char *) "EID", (char *) "endpoint identifier (unimplemented)"},
+ {ns_t_nimloc, (char *) "NIMLOC", (char *) "NIMROD locator (unimplemented)"},
+ {ns_t_srv, (char *) "SRV", (char *) "server selection"},
+ {ns_t_atma, (char *) "ATMA", (char *) "ATM address (unimplemented)"},
+ {ns_t_dname, (char *) "DNAME", (char *) "Non-terminal DNAME (for IPv6)"},
+ {ns_t_tsig, (char *) "TSIG", (char *) "transaction signature"},
+ {ns_t_ixfr, (char *) "IXFR", (char *) "incremental zone transfer"},
+ {ns_t_axfr, (char *) "AXFR", (char *) "zone transfer"},
+ {ns_t_zxfr, (char *) "ZXFR", (char *) "compressed zone transfer"},
+ {ns_t_mailb, (char *) "MAILB", (char *) "mailbox-related data (deprecated)"},
+ {ns_t_maila, (char *) "MAILA", (char *) "mail agent (deprecated)"},
+ {ns_t_naptr, (char *) "NAPTR", (char *) "URN Naming Authority"},
+ {ns_t_kx, (char *) "KX", (char *) "Key Exchange"},
+ {ns_t_cert, (char *) "CERT", (char *) "Certificate"},
+ {ns_t_any, (char *) "ANY", (char *) "\"any\""},
+ {0, NULL, NULL}
};
libresolv_hidden_data_def (__p_type_syms)
@@ -450,22 +433,22 @@ libresolv_hidden_data_def (__p_type_syms)
* Names of DNS rcodes.
*/
const struct res_sym __p_rcode_syms[] attribute_hidden = {
- {ns_r_noerror, "NOERROR", "no error"},
- {ns_r_formerr, "FORMERR", "format error"},
- {ns_r_servfail, "SERVFAIL", "server failed"},
- {ns_r_nxdomain, "NXDOMAIN", "no such domain name"},
- {ns_r_notimpl, "NOTIMP", "not implemented"},
- {ns_r_refused, "REFUSED", "refused"},
- {ns_r_yxdomain, "YXDOMAIN", "domain name exists"},
- {ns_r_yxrrset, "YXRRSET", "rrset exists"},
- {ns_r_nxrrset, "NXRRSET", "rrset doesn't exist"},
- {ns_r_notauth, "NOTAUTH", "not authoritative"},
- {ns_r_notzone, "NOTZONE", "Not in zone"},
- {ns_r_max, "", ""},
- {ns_r_badsig, "BADSIG", "bad signature"},
- {ns_r_badkey, "BADKEY", "bad key"},
- {ns_r_badtime, "BADTIME", "bad time"},
- {0, NULL, NULL}
+ {ns_r_noerror, (char *) "NOERROR", (char *) "no error"},
+ {ns_r_formerr, (char *) "FORMERR", (char *) "format error"},
+ {ns_r_servfail, (char *) "SERVFAIL", (char *) "server failed"},
+ {ns_r_nxdomain, (char *) "NXDOMAIN", (char *) "no such domain name"},
+ {ns_r_notimpl, (char *) "NOTIMP", (char *) "not implemented"},
+ {ns_r_refused, (char *) "REFUSED", (char *) "refused"},
+ {ns_r_yxdomain, (char *) "YXDOMAIN", (char *) "domain name exists"},
+ {ns_r_yxrrset, (char *) "YXRRSET", (char *) "rrset exists"},
+ {ns_r_nxrrset, (char *) "NXRRSET", (char *) "rrset doesn't exist"},
+ {ns_r_notauth, (char *) "NOTAUTH", (char *) "not authoritative"},
+ {ns_r_notzone, (char *) "NOTZONE", (char *) "Not in zone"},
+ {ns_r_max, (char *) "", (char *) ""},
+ {ns_r_badsig, (char *) "BADSIG", (char *) "bad signature"},
+ {ns_r_badkey, (char *) "BADKEY", (char *) "bad key"},
+ {ns_r_badtime, (char *) "BADTIME", (char *) "bad time"},
+ {0, NULL, NULL}
};
int
@@ -564,9 +547,7 @@ p_option(u_long option) {
switch (option) {
case RES_INIT: return "init";
case RES_DEBUG: return "debug";
- case RES_AAONLY: return "aaonly(unimpl)";
case RES_USEVC: return "use-vc";
- case RES_PRIMARY: return "primry(unimpl)";
case RES_IGNTC: return "igntc";
case RES_RECURSE: return "recurs";
case RES_DEFNAMES: return "defnam";
@@ -577,11 +558,7 @@ p_option(u_long option) {
case RES_NOALIASES: return "noaliases";
case RES_USE_INET6: return "inet6";
case RES_ROTATE: return "rotate";
- case RES_NOCHECKNAME: return "no-check-names(unimpl)";
- case RES_KEEPTSIG: return "keeptsig(unimpl)";
case RES_BLAST: return "blast";
- case RES_USEBSTRING: return "ip6-bytestring";
- case RES_NOIP6DOTINT: return "no-ip6-dotint";
case RES_USE_EDNS0: return "edns0";
case RES_SNGLKUP: return "single-request";
case RES_SNGLKUPREOP: return "single-request-reopen";
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index 5cd128916d..093c26837f 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -348,7 +348,8 @@ do_init (void)
arg_trimdomain_list (ENV_TRIM_OVERR, 1, envval);
}
- _res_hconf.initialized = 1;
+ /* See comments on the declaration of _res_hconf. */
+ atomic_store_release (&_res_hconf.initialized, 1);
}
diff --git a/resolv/res_hconf.h b/resolv/res_hconf.h
index b97734df9e..a3d23f3e58 100644
--- a/resolv/res_hconf.h
+++ b/resolv/res_hconf.h
@@ -25,6 +25,15 @@
struct hconf
{
+ /* We keep the INITIALIZED member only for backwards compatibility. New
+ code should just call _res_hconf_init unconditionally. For this field
+ to be used safely, users must ensure that either (1) a call to
+ _res_hconf_init happens-before any load from INITIALIZED, or (2) an
+ assignment of zero to INITIALIZED happens-before any load from it, and
+ these loads use acquire MO if the intent is to skip calling
+ _res_hconf_init if the load returns a nonzero value. Such acquire MO
+ loads will then synchronize with the release MO store to INITIALIZED
+ in do_init in res_hconf.c; see pthread_once for more detail. */
int initialized;
int unused1;
int unused2[4];
diff --git a/resolv/res_init.c b/resolv/res_init.c
index cea4c8a3cc..b29c0d4ee5 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -81,6 +81,7 @@
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <inet/net-internal.h>
#include <not-cancel.h>
@@ -143,8 +144,8 @@ __res_vinit(res_state statp, int preinit) {
statp->pfcode = 0;
statp->_vcsock = -1;
statp->_flags = 0;
- statp->qhook = NULL;
- statp->rhook = NULL;
+ statp->__glibc_unused_qhook = NULL;
+ statp->__glibc_unused_rhook = NULL;
statp->_u._ext.nscount = 0;
for (n = 0; n < MAXNS; n++)
statp->_u._ext.nsaddrs[n] = NULL;
@@ -283,26 +284,12 @@ __res_vinit(res_state statp, int preinit) {
sa6->sin6_flowinfo = 0;
sa6->sin6_addr = a6;
- if (__glibc_likely (el == NULL))
- sa6->sin6_scope_id = 0;
- else {
- int try_numericscope = 1;
- if (IN6_IS_ADDR_LINKLOCAL (&a6)
- || IN6_IS_ADDR_MC_LINKLOCAL (&a6)) {
- sa6->sin6_scope_id
- = __if_nametoindex (el + 1);
- if (sa6->sin6_scope_id != 0)
- try_numericscope = 0;
- }
-
- if (try_numericscope) {
- char *end;
- sa6->sin6_scope_id
- = (uint32_t) strtoul (el + 1, &end,
- 10);
- if (*end != '\0')
- sa6->sin6_scope_id = 0;
- }
+ sa6->sin6_scope_id = 0;
+ if (__glibc_likely (el != NULL)) {
+ /* Ignore errors, for backwards
+ compatibility. */
+ (void) __inet6_scopeid_pton
+ (&a6, el + 1, &sa6->sin6_scope_id);
}
statp->nsaddr_list[nserv].sin_family = 0;
@@ -451,11 +438,7 @@ res_setoptions(res_state statp, const char *options, const char *source) {
} options[] = {
#define STRnLEN(str) str, sizeof (str) - 1
{ STRnLEN ("inet6"), 0, RES_USE_INET6 },
- { STRnLEN ("ip6-bytestring"), 0, RES_USEBSTRING },
- { STRnLEN ("no-ip6-dotint"), 0, RES_NOIP6DOTINT },
- { STRnLEN ("ip6-dotint"), 1, ~RES_NOIP6DOTINT },
{ STRnLEN ("rotate"), 0, RES_ROTATE },
- { STRnLEN ("no-check-names"), 0, RES_NOCHECKNAME },
{ STRnLEN ("edns0"), 0, RES_USE_EDNS0 },
{ STRnLEN ("single-request-reopen"), 0, RES_SNGLKUPREOP },
{ STRnLEN ("single-request"), 0, RES_SNGLKUP },
@@ -542,7 +525,6 @@ res_nclose(res_state statp)
}
libc_hidden_def (__res_nclose)
-#ifdef _LIBC_REENTRANT
/* This is called when a thread is exiting to free resources held in _res. */
static void __attribute__ ((section ("__libc_thread_freeres_fn")))
res_thread_freeres (void)
@@ -558,4 +540,3 @@ res_thread_freeres (void)
}
text_set_element (__libc_thread_subfreeres, res_thread_freeres);
text_set_element (__libc_subfreeres, res_thread_freeres);
-#endif
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 869294fb95..e96d5d409d 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -364,22 +364,6 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
return (-1);
}
-#ifdef USE_HOOKS
- if (__glibc_unlikely (statp->qhook || statp->rhook)) {
- if (anssiz < MAXPACKET && ansp) {
- /* Always allocate MAXPACKET, callers expect
- this specific size. */
- u_char *buf = malloc (MAXPACKET);
- if (buf == NULL)
- return (-1);
- memcpy (buf, ans, HFIXEDSZ);
- *ansp = buf;
- ans = buf;
- anssiz = MAXPACKET;
- }
- }
-#endif
-
DprintQ((statp->options & RES_DEBUG) || (statp->pfcode & RES_PRF_QUERY),
(stdout, ";; res_send()\n"), buf, buflen);
v_circuit = ((statp->options & RES_USEVC)
@@ -468,47 +452,10 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
{
#ifdef DEBUG
char tmpbuf[40];
-#endif
-#if defined USE_HOOKS || defined DEBUG
struct sockaddr *nsap = get_nsaddr (statp, ns);
#endif
same_ns:
-#ifdef USE_HOOKS
- if (__glibc_unlikely (statp->qhook != NULL)) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- struct sockaddr_in *nsap4;
- nsap4 = (struct sockaddr_in *) nsap;
- act = (*statp->qhook)(&nsap4, &buf, &buflen,
- ans, anssiz, &resplen);
- nsap = (struct sockaddr_in6 *) nsap4;
- switch (act) {
- case res_goahead:
- done = 1;
- break;
- case res_nextns:
- __res_iclose(statp, false);
- goto next_ns;
- case res_done:
- return (resplen);
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
- }
-#endif
-
Dprint(statp->options & RES_DEBUG,
(stdout, ";; Querying server (# %d) address = %s\n",
ns + 1, inet_ntop(nsap->sa_family,
@@ -571,38 +518,6 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
(statp->options & RES_STAYOPEN) == 0) {
__res_iclose(statp, false);
}
-#ifdef USE_HOOKS
- if (__glibc_unlikely (statp->rhook)) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*statp->rhook)((struct sockaddr_in *)
- nsap, buf, buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- case res_done:
- done = 1;
- break;
- case res_nextns:
- __res_iclose(statp, false);
- goto next_ns;
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
-
- }
-#endif
return (resplen);
next_ns: ;
} /*foreach ns*/
@@ -1015,7 +930,16 @@ reopen (res_state statp, int *terrno, int ns)
* error message is received. We can thus detect
* the absence of a nameserver without timing out.
*/
+ /* With GCC 5.3 when compiling with -Os the compiler
+ emits a warning that slen may be used uninitialized,
+ but that is never true. Both slen and
+ EXT(statp).nssocks[ns] are initialized together or
+ the function return -1 before control flow reaches
+ the call to connect with slen. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
if (connect(EXT(statp).nssocks[ns], nsap, slen) < 0) {
+ DIAG_POP_NEEDS_COMMENT;
Aerror(statp, stderr, "connect(dg)", errno, nsap);
__res_iclose(statp, false);
return (0);
diff --git a/resolv/resolv.h b/resolv/resolv.h
index f55e7ceaba..1062903699 100644
--- a/resolv/resolv.h
+++ b/resolv/resolv.h
@@ -68,23 +68,6 @@
#ifndef __res_state_defined
# define __res_state_defined
-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
- res_sendhookact;
-
-typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *__ns,
- const u_char **__query,
- int *__querylen,
- u_char *__ans,
- int __anssiz,
- int *__resplen);
-
-typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *__ns,
- const u_char *__query,
- int __querylen,
- u_char *__ans,
- int __anssiz,
- int *__resplen);
-
/*
* Global defines and variables for resolver stub.
*/
@@ -104,39 +87,39 @@ typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *__ns,
struct __res_state {
int retrans; /* retransmition time interval */
int retry; /* number of times to retransmit */
- u_long options; /* option flags - see below. */
+ unsigned long options; /* option flags - see below. */
int nscount; /* number of name servers */
struct sockaddr_in
nsaddr_list[MAXNS]; /* address of name server */
# define nsaddr nsaddr_list[0] /* for backward compatibility */
- u_short id; /* current message id */
+ unsigned short id; /* current message id */
/* 2 byte hole here. */
char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
char defdname[256]; /* default domain (deprecated) */
- u_long pfcode; /* RES_PRF_ flags - see below. */
+ unsigned long pfcode; /* RES_PRF_ flags - see below. */
unsigned ndots:4; /* threshold for initial abs. query */
unsigned nsort:4; /* number of elements in sort_list[] */
unsigned ipv6_unavail:1; /* connecting to IPv6 server failed */
unsigned unused:23;
struct {
struct in_addr addr;
- u_int32_t mask;
+ uint32_t mask;
} sort_list[MAXRESOLVSORT];
/* 4 byte hole here on 64-bit architectures. */
- res_send_qhook qhook; /* query hook */
- res_send_rhook rhook; /* response hook */
+ void * __glibc_unused_qhook;
+ void * __glibc_unused_rhook;
int res_h_errno; /* last one set for this context */
int _vcsock; /* PRIVATE: for res_send VC i/o */
- u_int _flags; /* PRIVATE: see below */
+ unsigned int _flags; /* PRIVATE: see below */
/* 4 byte hole here on 64-bit architectures. */
union {
char pad[52]; /* On an i386 this means 512b total. */
struct {
- u_int16_t nscount;
- u_int16_t nsmap[MAXNS];
+ uint16_t nscount;
+ uint16_t nsmap[MAXNS];
int nssocks[MAXNS];
- u_int16_t nscount6;
- u_int16_t nsinit;
+ uint16_t nscount6;
+ uint16_t nsinit;
struct sockaddr_in6 *nsaddrs[MAXNS];
#ifdef _LIBC
unsigned long long int initstamp
@@ -194,9 +177,11 @@ struct res_sym {
*/
#define RES_INIT 0x00000001 /* address initialized */
#define RES_DEBUG 0x00000002 /* print debug messages */
-#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
+#define RES_AAONLY \
+ __glibc_macro_warning ("RES_AAONLY is deprecated") 0x00000004
#define RES_USEVC 0x00000008 /* use virtual circuit */
-#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
+#define RES_PRIMARY \
+ __glibc_macro_warning ("RES_PRIMARY is deprecated") 0x00000010
#define RES_IGNTC 0x00000020 /* ignore trucation errors */
#define RES_RECURSE 0x00000040 /* recursion desired */
#define RES_DEFNAMES 0x00000080 /* use default domain name */
@@ -207,13 +192,11 @@ struct res_sym {
#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
#define RES_ROTATE 0x00004000 /* rotate ns list after each query */
-#define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity (!IMPL) */
-#define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
+#define RES_NOCHECKNAME \
+ __glibc_macro_warning ("RES_NOCHECKNAME is deprecated") 0x00008000
+#define RES_KEEPTSIG \
+ __glibc_macro_warning ("RES_KEEPTSIG is deprecated") 0x00010000
#define RES_BLAST 0x00020000 /* blast all recursive servers */
-#define RES_USEBSTRING 0x00040000 /* IPv6 reverse lookup with byte
- strings */
-#define RES_NOIP6DOTINT 0x00080000 /* Do not use .ip6.int in IPv6
- reverse lookup */
#define RES_USE_EDNS0 0x00100000 /* Use EDNS0. */
#define RES_SNGLKUP 0x00200000 /* one outstanding request at a time */
#define RES_SNGLKUPREOP 0x00400000 /* -"-, but open new socket for each
@@ -222,7 +205,7 @@ struct res_sym {
#define RES_NOTLDQUERY 0x01000000 /* Do not look up unqualified name
as a TLD. */
-#define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
+#define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH)
/*
* Resolver "pfcode" values. Used by dig.
@@ -264,20 +247,24 @@ __END_DECLS
#define res_send __res_send
__BEGIN_DECLS
-void fp_nquery (const u_char *, int, FILE *) __THROW;
-void fp_query (const u_char *, FILE *) __THROW;
+void fp_nquery (const unsigned char *, int, FILE *) __THROW;
+void fp_query (const unsigned char *, FILE *) __THROW;
const char * hostalias (const char *) __THROW;
-void p_query (const u_char *) __THROW;
+void p_query (const unsigned char *) __THROW;
void res_close (void) __THROW;
int res_init (void) __THROW;
int res_isourserver (const struct sockaddr_in *) __THROW;
-int res_mkquery (int, const char *, int, int, const u_char *,
- int, const u_char *, u_char *, int) __THROW;
-int res_query (const char *, int, int, u_char *, int) __THROW;
+int res_mkquery (int, const char *, int, int,
+ const unsigned char *, int, const unsigned char *,
+ unsigned char *, int) __THROW;
+int res_query (const char *, int, int, unsigned char *, int)
+ __THROW;
int res_querydomain (const char *, const char *, int, int,
- u_char *, int) __THROW;
-int res_search (const char *, int, int, u_char *, int) __THROW;
-int res_send (const u_char *, int, u_char *, int) __THROW;
+ unsigned char *, int) __THROW;
+int res_search (const char *, int, int, unsigned char *, int)
+ __THROW;
+int res_send (const unsigned char *, int, unsigned char *, int)
+ __THROW;
__END_DECLS
#define b64_ntop __b64_ntop
@@ -330,56 +317,65 @@ int res_dnok (const char *) __THROW;
int sym_ston (const struct res_sym *, const char *, int *) __THROW;
const char * sym_ntos (const struct res_sym *, int, int *) __THROW;
const char * sym_ntop (const struct res_sym *, int, int *) __THROW;
-int b64_ntop (u_char const *, size_t, char *, size_t) __THROW;
-int b64_pton (char const *, u_char *, size_t) __THROW;
-int loc_aton (const char *__ascii, u_char *__binary) __THROW;
-const char * loc_ntoa (const u_char *__binary, char *__ascii) __THROW;
-int dn_skipname (const u_char *, const u_char *) __THROW;
-void putlong (u_int32_t, u_char *) __THROW;
-void putshort (u_int16_t, u_char *) __THROW;
+int b64_ntop (const unsigned char *, size_t, char *, size_t)
+ __THROW;
+int b64_pton (char const *, unsigned char *, size_t) __THROW;
+int loc_aton (const char *__ascii, unsigned char *__binary) __THROW;
+const char * loc_ntoa (const unsigned char *__binary, char *__ascii) __THROW;
+int dn_skipname (const unsigned char *, const unsigned char *)
+ __THROW;
+void putlong (uint32_t, unsigned char *) __THROW;
+void putshort (uint16_t, unsigned char *) __THROW;
const char * p_class (int) __THROW;
-const char * p_time (u_int32_t) __THROW;
+const char * p_time (uint32_t) __THROW;
const char * p_type (int) __THROW;
const char * p_rcode (int) __THROW;
-const u_char * p_cdnname (const u_char *, const u_char *, int, FILE *)
- __THROW;
-const u_char * p_cdname (const u_char *, const u_char *, FILE *) __THROW;
-const u_char * p_fqnname (const u_char *__cp, const u_char *__msg,
- int, char *, int) __THROW;
-const u_char * p_fqname (const u_char *, const u_char *, FILE *) __THROW;
-const char * p_option (u_long __option) __THROW;
-char * p_secstodate (u_long) __THROW;
+const unsigned char * p_cdnname (const unsigned char *,
+ const unsigned char *, int, FILE *) __THROW;
+const unsigned char * p_cdname (const unsigned char *, const unsigned char *,
+ FILE *) __THROW;
+const unsigned char * p_fqnname (const unsigned char *__cp,
+ const unsigned char *__msg,
+ int, char *, int) __THROW;
+const unsigned char * p_fqname (const unsigned char *,
+ const unsigned char *, FILE *) __THROW;
+const char * p_option (unsigned long __option) __THROW;
+char * p_secstodate (unsigned long) __THROW;
int dn_count_labels (const char *) __THROW;
-int dn_comp (const char *, u_char *, int, u_char **, u_char **)
- __THROW;
-int dn_expand (const u_char *, const u_char *, const u_char *,
- char *, int) __THROW;
-u_int res_randomid (void) __THROW;
+int dn_comp (const char *, unsigned char *, int, unsigned char **,
+ unsigned char **) __THROW;
+int dn_expand (const unsigned char *, const unsigned char *,
+ const unsigned char *, char *, int) __THROW;
+unsigned int res_randomid (void) __THROW;
int res_nameinquery (const char *, int, int,
- const u_char *, const u_char *) __THROW;
-int res_queriesmatch (const u_char *, const u_char *,
- const u_char *, const u_char *) __THROW;
+ const unsigned char *,
+ const unsigned char *) __THROW;
+int res_queriesmatch (const unsigned char *,
+ const unsigned char *,
+ const unsigned char *,
+ const unsigned char *) __THROW;
const char * p_section (int __section, int __opcode) __THROW;
/* Things involving a resolver context. */
int res_ninit (res_state) __THROW;
int res_nisourserver (const res_state,
const struct sockaddr_in *) __THROW;
void fp_resstat (const res_state, FILE *) __THROW;
-void res_npquery (const res_state, const u_char *, int, FILE *)
- __THROW;
+void res_npquery (const res_state, const unsigned char *, int,
+ FILE *) __THROW;
const char * res_hostalias (const res_state, const char *, char *, size_t)
__THROW;
-int res_nquery (res_state, const char *, int, int, u_char *, int)
- __THROW;
-int res_nsearch (res_state, const char *, int, int, u_char *, int)
- __THROW;
+int res_nquery (res_state, const char *, int, int,
+ unsigned char *, int) __THROW;
+int res_nsearch (res_state, const char *, int, int,
+ unsigned char *, int) __THROW;
int res_nquerydomain (res_state, const char *, const char *, int,
- int, u_char *, int) __THROW;
+ int, unsigned char *, int) __THROW;
int res_nmkquery (res_state, int, const char *, int, int,
- const u_char *, int, const u_char *, u_char *,
- int) __THROW;
-int res_nsend (res_state, const u_char *, int, u_char *, int)
+ const unsigned char *, int,
+ const unsigned char *, unsigned char *, int)
__THROW;
+int res_nsend (res_state, const unsigned char *, int,
+ unsigned char *, int) __THROW;
void res_nclose (res_state) __THROW;
__END_DECLS
#endif
diff --git a/rt/Makefile b/rt/Makefile
index cfa68379c5..7593b11652 100644
--- a/rt/Makefile
+++ b/rt/Makefile
@@ -53,7 +53,7 @@ tests := tst-shm tst-clock tst-clock_nanosleep tst-timer tst-timer2 \
tst-timer3 tst-timer4 tst-timer5 \
tst-cpuclock1 tst-cpuclock2 \
tst-cputimer1 tst-cputimer2 tst-cputimer3 \
- tst-clock2
+ tst-clock2 tst-shm-cancel
extra-libs := librt
extra-libs-others := $(extra-libs)
diff --git a/rt/aio.h b/rt/aio.h
index 8cb6a5ea85..bc70082df5 100644
--- a/rt/aio.h
+++ b/rt/aio.h
@@ -26,8 +26,7 @@
#include <sys/types.h>
#define __need_sigevent_t
#include <bits/siginfo.h>
-#define __need_timespec
-#include <time.h>
+#include <bits/types/struct_timespec.h>
__BEGIN_DECLS
diff --git a/rt/clock-compat.c b/rt/clock-compat.c
index dc69e4a161..b47781cb2e 100644
--- a/rt/clock-compat.c
+++ b/rt/clock-compat.c
@@ -28,13 +28,9 @@
#include <time.h>
#if HAVE_IFUNC
-# define COMPAT_REDIRECT(name, proto, arglist) \
- __typeof (name) *name##_ifunc (void) asm (#name); \
- __typeof (name) *name##_ifunc (void) \
- { \
- return &__##name; \
- } \
- asm (".type " #name ", %gnu_indirect_function");
+# undef INIT_ARCH
+# define INIT_ARCH()
+# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name)
#else
# define COMPAT_REDIRECT(name, proto, arglist) \
int \
@@ -45,21 +41,21 @@
#endif
COMPAT_REDIRECT (clock_getres,
- (clockid_t clock_id, struct timespec *res),
- (clock_id, res))
+ (clockid_t clock_id, struct timespec *res),
+ (clock_id, res))
COMPAT_REDIRECT (clock_gettime,
- (clockid_t clock_id, struct timespec *tp),
- (clock_id, tp))
+ (clockid_t clock_id, struct timespec *tp),
+ (clock_id, tp))
COMPAT_REDIRECT (clock_settime,
- (clockid_t clock_id, const struct timespec *tp),
- (clock_id, tp))
+ (clockid_t clock_id, const struct timespec *tp),
+ (clock_id, tp))
COMPAT_REDIRECT (clock_getcpuclockid,
- (pid_t pid, clockid_t *clock_id),
- (pid, clock_id))
+ (pid_t pid, clockid_t *clock_id),
+ (pid, clock_id))
COMPAT_REDIRECT (clock_nanosleep,
- (clockid_t clock_id, int flags,
- const struct timespec *req,
- struct timespec *rem),
- (clock_id, flags, req, rem))
+ (clockid_t clock_id, int flags,
+ const struct timespec *req,
+ struct timespec *rem),
+ (clock_id, flags, req, rem))
#endif
diff --git a/rt/mqueue.h b/rt/mqueue.h
index 9700cdc93f..db6022f0f1 100644
--- a/rt/mqueue.h
+++ b/rt/mqueue.h
@@ -23,8 +23,7 @@
#include <fcntl.h>
#define __need_sigevent_t
#include <bits/siginfo.h>
-#define __need_timespec
-#include <time.h>
+#include <bits/types/struct_timespec.h>
/* Get the definition of mqd_t and struct mq_attr. */
#include <bits/mqueue.h>
diff --git a/rt/tst-shm-cancel.c b/rt/tst-shm-cancel.c
new file mode 100644
index 0000000000..43d9ee540d
--- /dev/null
+++ b/rt/tst-shm-cancel.c
@@ -0,0 +1,130 @@
+/* Test for shm_open cancellation handling: BZ #18243.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <sys/mman.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+
+static sem_t sem; /* Use to sync with thread start. */
+static const char shm_name[] = "/glibc-shm_open-cancel";
+
+static void
+remove_shm (int status, void *arg)
+{
+ shm_unlink (shm_name);
+}
+
+static void *
+tf (void *arg)
+{
+ pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, 0);
+
+ if (sem_wait (&sem) != 0)
+ {
+ printf ("error: sem_wait failed: %m");
+ exit (1);
+ }
+
+ if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, 0) != 0)
+ {
+ printf ("error: pthread_setcancelstate failed: %m");
+ exit (1);
+ }
+
+ /* Neither sem_unlink or sem_open should act on thread cancellation. */
+ shm_unlink (shm_name);
+ on_exit (remove_shm, NULL);
+
+ int fd = shm_open (shm_name, O_CREAT, 0600);
+ if (fd == -1)
+ {
+ int exit_code;
+ if (errno == ENOSYS || errno == EACCES)
+ exit_code = 77;
+ else
+ exit_code = 1;
+ exit (exit_code);
+ }
+
+ if (pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, 0) != 0)
+ {
+ printf ("error: pthread_setcancelstate failed: %m");
+ exit (1);
+ }
+
+ if (close (fd) != 0)
+ {
+ printf ("error: pthread_setcancelstate failed: %m");
+ exit (1);
+ }
+
+ return NULL;
+}
+
+static int
+do_test (void)
+{
+ pthread_t td;
+
+ if (sem_init (&sem, 0, 0))
+ {
+ printf ("error: sem_init failed: %m\n");
+ exit (1);
+ }
+
+ if (pthread_create (&td, NULL, tf, NULL) != 0)
+ {
+ printf ("error: pthread_create failed: %m\n");
+ exit (1);
+ }
+
+ if (pthread_cancel (td) != 0)
+ {
+ printf ("error: pthread_cancel failed: %m\n");
+ exit (1);
+ }
+
+ if (sem_post (&sem) != 0)
+ {
+ printf ("error: sem_post failed: %m\n");
+ exit (1);
+ }
+
+ void *r;
+ if (pthread_join (td, &r) != 0)
+ {
+ printf ("error: pthread_join failed: %m\n");
+ exit (1);
+ }
+
+ if (r == PTHREAD_CANCELED)
+ {
+ puts ("error: pthread_join returned PTHREAD_CANCELED");
+ exit (1);
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include <test-skeleton.c>
diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
new file mode 100644
index 0000000000..a245fe6be2
--- /dev/null
+++ b/scripts/check-installed-headers.sh
@@ -0,0 +1,174 @@
+#! /bin/sh
+# Copyright (C) 2016 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, see
+# <http://www.gnu.org/licenses/>.
+
+# Check installed headers for cleanliness. For each header, confirm
+# that it's possible to compile a file that includes that header and
+# does nothing else, in several different compilation modes. Also,
+# scan the header for a set of obsolete typedefs that should no longer
+# appear.
+
+# These compilation switches assume GCC or compatible, which is probably
+# fine since we also assume that when _building_ glibc.
+c_modes="-std=c89 -std=gnu89 -std=c11 -std=gnu11"
+cxx_modes="-std=c++98 -std=gnu++98 -std=c++11 -std=gnu++11"
+
+# An exhaustive test of feature selection macros would take far too long.
+# These are probably the most commonly used three.
+lib_modes="-D_DEFAULT_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=700"
+
+# sys/types.h+bits/types.h have to define the obsolete types.
+# rpc(svc)/* have the obsolete types too deeply embedded in their API
+# to remove.
+skip_obsolete_type_check='*/sys/types.h|*/bits/types.h|*/rpc/*|*/rpcsvc/*'
+obsolete_type_re=\
+'\<((__)?(quad_t|u(short|int|long|_(char|short|int([0-9]+_t)?|long|quad_t))))\>'
+
+if [ $# -lt 3 ]; then
+ echo "usage: $0 c|c++ \"compile command\" header header header..." >&2
+ exit 2
+fi
+case "$1" in
+ (c)
+ lang_modes="$c_modes"
+ cih_test_c=$(mktemp ${TMPDIR-/tmp}/cih_test_XXXXXX.c)
+ already="$skip_obsolete_type_check"
+ ;;
+ (c++)
+ lang_modes="$cxx_modes"
+ cih_test_c=$(mktemp ${TMPDIR-/tmp}/cih_test_XXXXXX.cc)
+ # The obsolete-type check can be skipped for C++; it is
+ # sufficient to do it for C.
+ already="*"
+ ;;
+ (*)
+ echo "usage: $0 c|c++ \"compile command\" header header header..." >&2
+ exit 2;;
+esac
+shift
+cc_cmd="$1"
+shift
+trap "rm -f '$cih_test_c'" 0
+
+failed=0
+is_x86_64=unknown
+is_x32=unknown
+for header in "$@"; do
+ # Skip various headers for which this test gets a false failure.
+ case "$header" in
+ # bits/* are not meant to be included directly and usually #error
+ # out if you try it.
+ # regexp.h is a stub containing only an #error.
+ # Sun RPC's .x files are traditionally installed in
+ # $prefix/include/rpcsvc, but they are not C header files.
+ (bits/* | regexp.h | rpcsvc/*.x)
+ continue;;
+
+ # All extant versions of sys/elf.h contain nothing more than an
+ # exhortation (either a #warning or an #error) to use sys/procfs.h
+ # instead, plus an inclusion of that header.
+ (sys/elf.h)
+ continue;;
+
+ # sys/sysctl.h is unsupported for x32.
+ (sys/sysctl.h)
+ case "$is_x32" in
+ (yes) continue;;
+ (no) ;;
+ (unknown)
+ cat >"$cih_test_c" <<EOF
+#if defined __x86_64__ && defined __ILP32__
+# error "is x32"
+#endif
+EOF
+ if $cc_cmd -fsyntax-only "$cih_test_c" > /dev/null 2>&1
+ then
+ is_x32=no
+ else
+ is_x32=yes
+ continue
+ fi
+ ;;
+ esac
+ ;;
+
+ # sys/vm86.h is "unsupported on x86-64" and errors out on that target.
+ (sys/vm86.h)
+ case "$is_x86_64" in
+ (yes) continue;;
+ (no) ;;
+ (unknown)
+ cat >"$cih_test_c" <<EOF
+#if defined __x86_64__ && __x86_64__
+#error "is x86-64"
+#endif
+EOF
+ if $cc_cmd -fsyntax-only "$cih_test_c" > /dev/null 2>&1
+ then
+ is_x86_64=no
+ else
+ is_x86_64=yes
+ continue
+ fi
+ ;;
+ esac
+ esac
+
+ echo :: "$header"
+ for lang_mode in "" $lang_modes; do
+ for lib_mode in "" $lib_modes; do
+ echo :::: $lang_mode $lib_mode
+ if [ -z "$lib_mode" ]; then
+ expanded_lib_mode='/* default library mode */'
+ else
+ expanded_lib_mode=$(echo : $lib_mode | \
+ sed 's/^: -D/#define /; s/=/ /')
+ fi
+ cat >"$cih_test_c" <<EOF
+/* These macros may have been defined on the command line. They are
+ inappropriate for this test. */
+#undef _LIBC
+#undef _GNU_SOURCE
+#undef _REENTRANT
+/* The library mode is selected here rather than on the command line to
+ ensure that this selection wins. */
+$expanded_lib_mode
+#include <$header>
+int avoid_empty_translation_unit;
+EOF
+ if $cc_cmd -fsyntax-only $lang_mode "$cih_test_c" 2>&1
+ then
+ includes=$($cc_cmd -fsyntax-only -H $lang_mode \
+ "$cih_test_c" 2>&1 | sed -ne 's/^[.][.]* //p')
+ for h in $includes; do
+ # Don't repeat work.
+ eval 'case "$h" in ('"$already"') continue;; esac'
+
+ if grep -qE "$obsolete_type_re" "$h"; then
+ echo "*** Obsolete types detected:"
+ grep -HE "$obsolete_type_re" "$h"
+ failed=1
+ fi
+ already="$already|$h"
+ done
+ else
+ failed=1
+ fi
+ done
+ done
+done
+exit $failed
diff --git a/scripts/check-local-headers.sh b/scripts/check-local-headers.sh
index 4cae4db572..0a967bb5ce 100755
--- a/scripts/check-local-headers.sh
+++ b/scripts/check-local-headers.sh
@@ -33,7 +33,7 @@ exec ${AWK} -v includedir="$includedir" '
BEGIN {
status = 0
exclude = "^" includedir \
- "/(.*-.*-.*/|.*-.*/|)(asm[-/]|arch|linux/|selinux/|mach/|device/|hurd/(((hurd|ioctl)_types|paths)\\.h|ioctls\\.defs|ihash\\.h)|cthreads\\.h|gd|nss3/|c\\+\\+/|sys/(capability|sdt(|-config))\\.h|libaudit\\.h)"
+ "/(.*-.*-.*/|.*-.*/|)(asm[-/]|arch|linux/|selinux/|mach/|mach_debug/|device/|hurd/(((hurd|ioctl)_types|paths)\\.h|ioctls\\.defs|ihash\\.h)|cthreads\\.h|gd|nss3/|c\\+\\+/|sys/(capability|sdt(|-config))\\.h|libaudit\\.h)"
}
/^[^ ]/ && $1 ~ /.*:/ { obj = $1 }
{
diff --git a/scripts/sysd-rules.awk b/scripts/sysd-rules.awk
index 69af400e58..c82e8fd607 100644
--- a/scripts/sysd-rules.awk
+++ b/scripts/sysd-rules.awk
@@ -50,6 +50,10 @@ BEGIN {
split(pattern, td, ":");
target_pattern = td[1];
dep_pattern = td[2];
+ # rtld objects are always PIC.
+ if (target_pattern ~ /^rtld/ && o != ".os") {
+ continue;
+ }
if (target_pattern == "%") {
command_suffix = "";
} else {
diff --git a/signal/signal.h b/signal/signal.h
index 47e995a51c..2825386b97 100644
--- a/signal/signal.h
+++ b/signal/signal.h
@@ -71,8 +71,7 @@ typedef __uid_t uid_t;
#ifdef __USE_POSIX199309
/* We need `struct timespec' later on. */
-# define __need_timespec
-# include <time.h>
+# include <bits/types/struct_timespec.h>
#endif
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
diff --git a/socket/Makefile b/socket/Makefile
index 92450e8522..6be5ec78f7 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -23,7 +23,8 @@ subdir := socket
include ../Makeconfig
headers := sys/socket.h sys/un.h bits/sockaddr.h bits/socket.h \
- bits/socket2.h sys/socketvar.h net/if.h
+ bits/socket2.h bits/types/struct_osockaddr.h \
+ sys/socketvar.h net/if.h
routines := accept bind connect getpeername getsockname getsockopt \
listen recv recvfrom recvmsg send sendmsg sendto \
diff --git a/socket/bits/types/struct_osockaddr.h b/socket/bits/types/struct_osockaddr.h
new file mode 100644
index 0000000000..e0bf59d383
--- /dev/null
+++ b/socket/bits/types/struct_osockaddr.h
@@ -0,0 +1,12 @@
+#ifndef __osockaddr_defined
+#define __osockaddr_defined 1
+
+/* This is the 4.3 BSD `struct sockaddr' format, which is used as wire
+ format in the grotty old 4.3 `talk' protocol. */
+struct osockaddr
+{
+ unsigned short int sa_family;
+ unsigned char sa_data[14];
+};
+
+#endif
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index c9f0f5080d..5be1b91a93 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -38,13 +38,7 @@ __BEGIN_DECLS
#include <bits/socket.h>
#ifdef __USE_MISC
-/* This is the 4.3 BSD `struct sockaddr' format, which is used as wire
- format in the grotty old 4.3 `talk' protocol. */
-struct osockaddr
- {
- unsigned short int sa_family;
- unsigned char sa_data[14];
- };
+# include <bits/types/struct_osockaddr.h>
#endif
/* The following constants should be used for the second parameter of
diff --git a/soft-fp/extended.h b/soft-fp/extended.h
index de53448341..7b19e835f7 100644
--- a/soft-fp/extended.h
+++ b/soft-fp/extended.h
@@ -104,6 +104,7 @@ union _FP_UNION_E
X##_f[3] = 0; \
X##_f[0] = FP_UNPACK_RAW_E_flo.bits.frac0; \
X##_f[1] = FP_UNPACK_RAW_E_flo.bits.frac1; \
+ X##_f[1] &= ~_FP_IMPLBIT_E; \
X##_e = FP_UNPACK_RAW_E_flo.bits.exp; \
X##_s = FP_UNPACK_RAW_E_flo.bits.sign; \
} \
@@ -119,6 +120,7 @@ union _FP_UNION_E
X##_f[3] = 0; \
X##_f[0] = FP_UNPACK_RAW_EP_flo->bits.frac0; \
X##_f[1] = FP_UNPACK_RAW_EP_flo->bits.frac1; \
+ X##_f[1] &= ~_FP_IMPLBIT_E; \
X##_e = FP_UNPACK_RAW_EP_flo->bits.exp; \
X##_s = FP_UNPACK_RAW_EP_flo->bits.sign; \
} \
@@ -332,6 +334,7 @@ union _FP_UNION_E
FP_UNPACK_RAW_E_flo.flt = (val); \
\
X##_f0 = FP_UNPACK_RAW_E_flo.bits.frac; \
+ X##_f0 &= ~_FP_IMPLBIT_E; \
X##_f1 = 0; \
X##_e = FP_UNPACK_RAW_E_flo.bits.exp; \
X##_s = FP_UNPACK_RAW_E_flo.bits.sign; \
@@ -345,6 +348,7 @@ union _FP_UNION_E
= (union _FP_UNION_E *) (val); \
\
X##_f0 = FP_UNPACK_RAW_EP_flo->bits.frac; \
+ X##_f0 &= ~_FP_IMPLBIT_E; \
X##_f1 = 0; \
X##_e = FP_UNPACK_RAW_EP_flo->bits.exp; \
X##_s = FP_UNPACK_RAW_EP_flo->bits.sign; \
diff --git a/soft-fp/extendhftf2.c b/soft-fp/extendhftf2.c
new file mode 100644
index 0000000000..6ff6438e6d
--- /dev/null
+++ b/soft-fp/extendhftf2.c
@@ -0,0 +1,53 @@
+/* Software floating-point emulation.
+ Return an IEEE half converted to IEEE quad
+ Copyright (C) 1997-2016 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 into
+ combinations with other programs, and to distribute those
+ combinations 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 a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FP_NO_EXACT_UNDERFLOW
+#include "soft-fp.h"
+#include "half.h"
+#include "quad.h"
+
+TFtype
+__extendhftf2 (HFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_H (A);
+ FP_DECL_Q (R);
+ TFtype r;
+
+ FP_INIT_EXCEPTIONS;
+ FP_UNPACK_RAW_H (A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_EXTEND (Q, H, 4, 1, R, A);
+#else
+ FP_EXTEND (Q, H, 2, 1, R, A);
+#endif
+ FP_PACK_RAW_Q (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/soft-fp/fixhfti.c b/soft-fp/fixhfti.c
new file mode 100644
index 0000000000..3610f4cc31
--- /dev/null
+++ b/soft-fp/fixhfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE half to 128bit signed integer
+ Copyright (C) 2007-2016 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 into
+ combinations with other programs, and to distribute those
+ combinations 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 a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "half.h"
+
+TItype
+__fixhfti (HFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_H (A);
+ UTItype r;
+
+ FP_INIT_EXCEPTIONS;
+ FP_UNPACK_RAW_H (A, a);
+ FP_TO_INT_H (r, A, TI_BITS, 1);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/soft-fp/fixunshfti.c b/soft-fp/fixunshfti.c
new file mode 100644
index 0000000000..30edbfe5d8
--- /dev/null
+++ b/soft-fp/fixunshfti.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert IEEE half to 128bit unsigned integer
+ Copyright (C) 2007-2016 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 into
+ combinations with other programs, and to distribute those
+ combinations 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 a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "half.h"
+
+UTItype
+__fixunshfti (HFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_H (A);
+ UTItype r;
+
+ FP_INIT_EXCEPTIONS;
+ FP_UNPACK_RAW_H (A, a);
+ FP_TO_INT_H (r, A, TI_BITS, 0);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/soft-fp/floattihf.c b/soft-fp/floattihf.c
new file mode 100644
index 0000000000..74ac83a739
--- /dev/null
+++ b/soft-fp/floattihf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit signed integer to IEEE half
+ Copyright (C) 2007-2016 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 into
+ combinations with other programs, and to distribute those
+ combinations 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 a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "half.h"
+
+HFtype
+__floattihf (TItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_H (A);
+ HFtype a;
+
+ FP_INIT_ROUNDMODE;
+ FP_FROM_INT_H (A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_H (a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/soft-fp/floatuntihf.c b/soft-fp/floatuntihf.c
new file mode 100644
index 0000000000..90e77c2c00
--- /dev/null
+++ b/soft-fp/floatuntihf.c
@@ -0,0 +1,45 @@
+/* Software floating-point emulation.
+ Convert a 128bit unsigned integer to IEEE half.
+ Copyright (C) 2007-2016 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 into
+ combinations with other programs, and to distribute those
+ combinations 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 a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "half.h"
+
+HFtype
+__floatuntihf (UTItype i)
+{
+ FP_DECL_EX;
+ FP_DECL_H (A);
+ HFtype a;
+
+ FP_INIT_ROUNDMODE;
+ FP_FROM_INT_H (A, i, TI_BITS, UTItype);
+ FP_PACK_RAW_H (a, A);
+ FP_HANDLE_EXCEPTIONS;
+
+ return a;
+}
diff --git a/soft-fp/half.h b/soft-fp/half.h
new file mode 100644
index 0000000000..ba75297838
--- /dev/null
+++ b/soft-fp/half.h
@@ -0,0 +1,170 @@
+/* Software floating-point emulation.
+ Definitions for IEEE Half Precision.
+ Copyright (C) 1997-2016 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 into
+ combinations with other programs, and to distribute those
+ combinations 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 a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef SOFT_FP_HALF_H
+#define SOFT_FP_HALF_H 1
+
+#if _FP_W_TYPE_SIZE < 32
+# error "Here's a nickel kid. Go buy yourself a real computer."
+#endif
+
+#define _FP_FRACTBITS_H (_FP_W_TYPE_SIZE)
+
+#define _FP_FRACTBITS_DW_H (_FP_W_TYPE_SIZE)
+
+#define _FP_FRACBITS_H 11
+#define _FP_FRACXBITS_H (_FP_FRACTBITS_H - _FP_FRACBITS_H)
+#define _FP_WFRACBITS_H (_FP_WORKBITS + _FP_FRACBITS_H)
+#define _FP_WFRACXBITS_H (_FP_FRACTBITS_H - _FP_WFRACBITS_H)
+#define _FP_EXPBITS_H 5
+#define _FP_EXPBIAS_H 15
+#define _FP_EXPMAX_H 31
+
+#define _FP_QNANBIT_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-2))
+#define _FP_QNANBIT_SH_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-2+_FP_WORKBITS))
+#define _FP_IMPLBIT_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-1))
+#define _FP_IMPLBIT_SH_H ((_FP_W_TYPE) 1 << (_FP_FRACBITS_H-1+_FP_WORKBITS))
+#define _FP_OVERFLOW_H ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_H))
+
+#define _FP_WFRACBITS_DW_H (2 * _FP_WFRACBITS_H)
+#define _FP_WFRACXBITS_DW_H (_FP_FRACTBITS_DW_H - _FP_WFRACBITS_DW_H)
+#define _FP_HIGHBIT_DW_H \
+ ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_H - 1) % _FP_W_TYPE_SIZE)
+
+/* The implementation of _FP_MUL_MEAT_H and _FP_DIV_MEAT_H should be
+ chosen by the target machine. */
+
+typedef float HFtype __attribute__ ((mode (HF)));
+
+union _FP_UNION_H
+{
+ HFtype flt;
+ struct _FP_STRUCT_LAYOUT
+ {
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned sign : 1;
+ unsigned exp : _FP_EXPBITS_H;
+ unsigned frac : _FP_FRACBITS_H - (_FP_IMPLBIT_H != 0);
+#else
+ unsigned frac : _FP_FRACBITS_H - (_FP_IMPLBIT_H != 0);
+ unsigned exp : _FP_EXPBITS_H;
+ unsigned sign : 1;
+#endif
+ } bits __attribute__ ((packed));
+};
+
+#define FP_DECL_H(X) _FP_DECL (1, X)
+#define FP_UNPACK_RAW_H(X, val) _FP_UNPACK_RAW_1 (H, X, (val))
+#define FP_UNPACK_RAW_HP(X, val) _FP_UNPACK_RAW_1_P (H, X, (val))
+#define FP_PACK_RAW_H(val, X) _FP_PACK_RAW_1 (H, (val), X)
+#define FP_PACK_RAW_HP(val, X) \
+ do \
+ { \
+ if (!FP_INHIBIT_RESULTS) \
+ _FP_PACK_RAW_1_P (H, (val), X); \
+ } \
+ while (0)
+
+#define FP_UNPACK_H(X, val) \
+ do \
+ { \
+ _FP_UNPACK_RAW_1 (H, X, (val)); \
+ _FP_UNPACK_CANONICAL (H, 1, X); \
+ } \
+ while (0)
+
+#define FP_UNPACK_HP(X, val) \
+ do \
+ { \
+ _FP_UNPACK_RAW_1_P (H, X, (val)); \
+ _FP_UNPACK_CANONICAL (H, 1, X); \
+ } \
+ while (0)
+
+#define FP_UNPACK_SEMIRAW_H(X, val) \
+ do \
+ { \
+ _FP_UNPACK_RAW_1 (H, X, (val)); \
+ _FP_UNPACK_SEMIRAW (H, 1, X); \
+ } \
+ while (0)
+
+#define FP_UNPACK_SEMIRAW_HP(X, val) \
+ do \
+ { \
+ _FP_UNPACK_RAW_1_P (H, X, (val)); \
+ _FP_UNPACK_SEMIRAW (H, 1, X); \
+ } \
+ while (0)
+
+#define FP_PACK_H(val, X) \
+ do \
+ { \
+ _FP_PACK_CANONICAL (H, 1, X); \
+ _FP_PACK_RAW_1 (H, (val), X); \
+ } \
+ while (0)
+
+#define FP_PACK_HP(val, X) \
+ do \
+ { \
+ _FP_PACK_CANONICAL (H, 1, X); \
+ if (!FP_INHIBIT_RESULTS) \
+ _FP_PACK_RAW_1_P (H, (val), X); \
+ } \
+ while (0)
+
+#define FP_PACK_SEMIRAW_H(val, X) \
+ do \
+ { \
+ _FP_PACK_SEMIRAW (H, 1, X); \
+ _FP_PACK_RAW_1 (H, (val), X); \
+ } \
+ while (0)
+
+#define FP_PACK_SEMIRAW_HP(val, X) \
+ do \
+ { \
+ _FP_PACK_SEMIRAW (H, 1, X); \
+ if (!FP_INHIBIT_RESULTS) \
+ _FP_PACK_RAW_1_P (H, (val), X); \
+ } \
+ while (0)
+
+#define FP_TO_INT_H(r, X, rsz, rsg) _FP_TO_INT (H, 1, (r), X, (rsz), (rsg))
+#define FP_TO_INT_ROUND_H(r, X, rsz, rsg) \
+ _FP_TO_INT_ROUND (H, 1, (r), X, (rsz), (rsg))
+#define FP_FROM_INT_H(X, r, rs, rt) _FP_FROM_INT (H, 1, X, (r), (rs), rt)
+
+/* HFmode arithmetic is not implemented. */
+
+#define _FP_FRAC_HIGH_H(X) _FP_FRAC_HIGH_1 (X)
+#define _FP_FRAC_HIGH_RAW_H(X) _FP_FRAC_HIGH_1 (X)
+#define _FP_FRAC_HIGH_DW_H(X) _FP_FRAC_HIGH_1 (X)
+
+#endif /* !SOFT_FP_HALF_H */
diff --git a/soft-fp/trunctfhf2.c b/soft-fp/trunctfhf2.c
new file mode 100644
index 0000000000..0500b14185
--- /dev/null
+++ b/soft-fp/trunctfhf2.c
@@ -0,0 +1,52 @@
+/* Software floating-point emulation.
+ Truncate IEEE quad into IEEE half.
+ Copyright (C) 1997-2015 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 into
+ combinations with other programs, and to distribute those
+ combinations 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 a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "half.h"
+#include "quad.h"
+
+HFtype
+__trunctfhf2 (TFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (A);
+ FP_DECL_H (R);
+ HFtype r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (A, a);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (H, Q, 1, 4, R, A);
+#else
+ FP_TRUNC (H, Q, 1, 2, R, A);
+#endif
+ FP_PACK_SEMIRAW_H (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
diff --git a/stdio-common/tst-printf.c b/stdio-common/tst-printf.c
index 2896b18ecd..ffe7ac7753 100644
--- a/stdio-common/tst-printf.c
+++ b/stdio-common/tst-printf.c
@@ -32,6 +32,11 @@
The compiler warnings are not useful here. */
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
+#if __GNUC_PREREQ (7, 0)
+/* Compiler warnings about format lengths should also be ignored. */
+DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-length");
+#endif
+
static void rfg1 (void);
static void rfg2 (void);
static void rfg3 (void);
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 6e428e9044..13ab47a4c2 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1082,7 +1082,7 @@ static const uint8_t jump_table[] =
LABEL (form_wcharacter): \
{ \
/* Wide character. */ \
- char buf[MB_CUR_MAX]; \
+ char buf[MB_LEN_MAX]; \
mbstate_t mbstate; \
size_t len; \
\
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index 8cd59557a6..7caa96fbe2 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -133,6 +133,8 @@
# define WINT_T int
#endif
+#include "printf-parse.h" /* Use read_int. */
+
#define encode_error() do { \
errval = 4; \
__set_errno (EILSEQ); \
@@ -488,9 +490,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
/* Check for a positional parameter specification. */
if (ISDIGIT ((UCHAR_T) *f))
{
- argpos = (UCHAR_T) *f++ - L_('0');
- while (ISDIGIT ((UCHAR_T) *f))
- argpos = argpos * 10 + ((UCHAR_T) *f++ - L_('0'));
+ argpos = read_int ((const UCHAR_T **) &f);
if (*f == L_('$'))
++f;
else
@@ -525,11 +525,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
/* Find the maximum field width. */
width = 0;
- while (ISDIGIT ((UCHAR_T) *f))
- {
- width *= 10;
- width += (UCHAR_T) *f++ - L_('0');
- }
+ if (ISDIGIT ((UCHAR_T) *f))
+ width = read_int ((const UCHAR_T **) &f);
got_width:
if (width == 0)
width = -1;
@@ -757,7 +754,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
size_t n;
if (!(flags & SUPPRESS) && (flags & POSIX_MALLOC)
- && str + MB_CUR_MAX >= *strptr + strsize)
+ && *strptr + strsize - str <= MB_LEN_MAX)
{
/* We have to enlarge the buffer if the `m' flag
was given. */
@@ -769,7 +766,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
{
/* Can't allocate that much. Last-ditch effort. */
newstr = (char *) realloc (*strptr,
- strleng + MB_CUR_MAX);
+ strleng + MB_LEN_MAX);
if (newstr == NULL)
{
/* c can't have `a' flag, only `m'. */
@@ -780,7 +777,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
{
*strptr = newstr;
str = newstr + strleng;
- strsize = strleng + MB_CUR_MAX;
+ strsize = strleng + MB_LEN_MAX;
}
}
else
@@ -1048,7 +1045,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
size_t n;
if (!(flags & SUPPRESS) && (flags & MALLOC)
- && str + MB_CUR_MAX >= *strptr + strsize)
+ && *strptr + strsize - str <= MB_LEN_MAX)
{
/* We have to enlarge the buffer if the `a' or `m'
flag was given. */
@@ -1061,7 +1058,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
/* Can't allocate that much. Last-ditch
effort. */
newstr = (char *) realloc (*strptr,
- strleng + MB_CUR_MAX);
+ strleng + MB_LEN_MAX);
if (newstr == NULL)
{
if (flags & POSIX_MALLOC)
@@ -1081,7 +1078,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
{
*strptr = newstr;
str = newstr + strleng;
- strsize = strleng + MB_CUR_MAX;
+ strsize = strleng + MB_LEN_MAX;
}
}
else
@@ -1097,7 +1094,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (__glibc_unlikely (n == (size_t) -1))
encode_error ();
- assert (n <= MB_CUR_MAX);
+ assert (n <= MB_LEN_MAX);
str += n;
}
#else
@@ -2675,7 +2672,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
/* Possibly correct character, just not enough
input. */
++cnt;
- assert (cnt < MB_CUR_MAX);
+ assert (cnt < MB_LEN_MAX);
continue;
}
cnt = 0;
@@ -2827,7 +2824,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (!(flags & SUPPRESS))
{
if ((flags & MALLOC)
- && str + MB_CUR_MAX >= *strptr + strsize)
+ && *strptr + strsize - str <= MB_LEN_MAX)
{
/* Enlarge the buffer. */
size_t strleng = str - *strptr;
@@ -2839,7 +2836,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
/* Can't allocate that much. Last-ditch
effort. */
newstr = (char *) realloc (*strptr,
- strleng + MB_CUR_MAX);
+ strleng + MB_LEN_MAX);
if (newstr == NULL)
{
if (flags & POSIX_MALLOC)
@@ -2859,7 +2856,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
{
*strptr = newstr;
str = newstr + strleng;
- strsize = strleng + MB_CUR_MAX;
+ strsize = strleng + MB_LEN_MAX;
}
}
else
@@ -2875,7 +2872,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (__glibc_unlikely (n == (size_t) -1))
encode_error ();
- assert (n <= MB_CUR_MAX);
+ assert (n <= MB_LEN_MAX);
str += n;
}
while (--width > 0 && inchar () != WEOF);
diff --git a/stdlib/Makefile b/stdlib/Makefile
index fc6f23dcaf..3cce9d98d4 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -46,6 +46,7 @@ routines := \
drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r \
srand48_r seed48_r lcong48_r \
drand48-iter \
+ strfromf strfromd strfroml \
strtol strtoul strtoll strtoull \
strtol_l strtoul_l strtoll_l strtoull_l \
strtof strtod strtold \
@@ -77,7 +78,8 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
tst-tininess tst-strtod-underflow tst-tls-atexit \
tst-setcontext3 tst-tls-atexit-nodelete \
tst-strtol-locale tst-strtod-nan-locale tst-strfmon_l \
- tst-quick_exit tst-thread-quick_exit
+ tst-quick_exit tst-thread-quick_exit tst-width \
+ tst-width-stdint tst-strfrom tst-strfrom-locale
tests-static := tst-secure-getenv
ifeq ($(have-cxx-thread_local),yes)
CFLAGS-tst-quick_exit.o = -std=c++11
@@ -121,6 +123,12 @@ CFLAGS-fmtmsg.c = -fexceptions
CFLAGS-strfmon.c = $(libio-mtsafe)
CFLAGS-strfmon_l.c = $(libio-mtsafe)
+# The strfrom class of functions call __printf_fp in order to convert the
+# floating-point value to characters. This requires the value of IO_MTSAFE_IO.
+CFLAGS-strfromd.c = $(libio-mtsafe)
+CFLAGS-strfromf.c = $(libio-mtsafe)
+CFLAGS-strfroml.c = $(libio-mtsafe)
+
CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
CFLAGS-tst-qsort.c = $(stack-align-test-flags)
CFLAGS-tst-makecontext.c += -funwind-tables
@@ -150,6 +158,8 @@ $(objpfx)tst-strtod5.out: $(gen-locales)
$(objpfx)tst-strtol-locale.out: $(gen-locales)
$(objpfx)tst-strtod-nan-locale.out: $(gen-locales)
$(objpfx)tst-strfmon_l.out: $(gen-locales)
+$(objpfx)tst-strfrom.out: $(gen-locales)
+$(objpfx)tst-strfrom-locale.out: $(gen-locales)
endif
# Testdir has to be named stdlib and needs to be writable
diff --git a/stdlib/Versions b/stdlib/Versions
index 9c06b43986..54416b7ea6 100644
--- a/stdlib/Versions
+++ b/stdlib/Versions
@@ -112,6 +112,10 @@ libc {
GLIBC_2.24 {
quick_exit;
}
+ GLIBC_2.25 {
+ # s*
+ strfromd; strfromf; strfroml;
+ }
GLIBC_PRIVATE {
# functions which have an additional interface since they are
# are cancelable.
diff --git a/stdlib/bits/stdlib-ldbl.h b/stdlib/bits/stdlib-ldbl.h
index acff499165..52fdc492d4 100644
--- a/stdlib/bits/stdlib-ldbl.h
+++ b/stdlib/bits/stdlib-ldbl.h
@@ -30,6 +30,10 @@ __END_NAMESPACE_C99
__LDBL_REDIR1_DECL (strtold_l, strtod_l)
#endif
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+__LDBL_REDIR1_DECL (strfroml, strfromd)
+#endif
+
#ifdef __USE_MISC
__LDBL_REDIR1_DECL (qecvt, ecvt)
__LDBL_REDIR1_DECL (qfcvt, fcvt)
diff --git a/stdlib/bug-strtod.c b/stdlib/bug-strtod.c
index c8b56aa7e1..ac5193e4ed 100644
--- a/stdlib/bug-strtod.c
+++ b/stdlib/bug-strtod.c
@@ -23,7 +23,7 @@
#include "tst-strtod.h"
-#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF) \
+#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
static int \
test_strto ## FSUF (void) \
{ \
@@ -45,8 +45,8 @@ test_strto ## FSUF (void) \
{ \
char fstr[FSTRLENMAX]; \
char fcntstr[FSTRLENMAX]; \
- FTOSTR (fstr, sizeof (fstr), "%" FTOSTRM "g", f); \
- FTOSTR (fcntstr, sizeof (fstr), "%" FTOSTRM "g", (FTYPE) cnt); \
+ FTOSTR (fstr, sizeof (fstr), "%g", f); \
+ FTOSTR (fcntstr, sizeof (fstr), "%g", (FTYPE) cnt); \
printf ("strto" #FSUF "(\"%s\") " \
"failed for cnt == %d (%s instead of %s)\n", \
buf, cnt, fstr, fcntstr); \
diff --git a/stdlib/bug-strtod2.c b/stdlib/bug-strtod2.c
index cd13e9aa5b..6128f2dd56 100644
--- a/stdlib/bug-strtod2.c
+++ b/stdlib/bug-strtod2.c
@@ -12,7 +12,7 @@ static const char *tests[] =
};
#define ntests (sizeof (tests) / sizeof (tests[0]))
-#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF) \
+#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
static int \
test_strto ## FSUF (void) \
{ \
diff --git a/stdlib/gen-tst-strtod-round.c b/stdlib/gen-tst-strtod-round.c
index 1c2823f5be..85279090ee 100644
--- a/stdlib/gen-tst-strtod-round.c
+++ b/stdlib/gen-tst-strtod-round.c
@@ -50,12 +50,12 @@ string_to_fp (mpfr_t f, const char *s, mpfr_rnd_t rnd)
mpfr_init2 (f2, 100000);
int r0 = mpfr_strtofr (f2, s, NULL, 0, rnd);
int r = mpfr_set (f, f2, rnd);
- mpfr_subnormalize (f, r, rnd);
+ r |= mpfr_subnormalize (f, r, rnd);
mpfr_clear (f2);
return r0 | r;
#else
int r = mpfr_strtofr (f, s, NULL, 0, rnd);
- mpfr_subnormalize (f, r, rnd);
+ r |= mpfr_subnormalize (f, r, rnd);
return r;
#endif
}
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index f0dc951acf..48f9a9500e 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -21,7 +21,8 @@
#ifndef _STDLIB_H
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
/* Get size_t, wchar_t and NULL from <stddef.h>. */
#define __need_size_t
@@ -178,6 +179,21 @@ extern unsigned long long int strtoull (const char *__restrict __nptr,
__END_NAMESPACE_C99
#endif /* ISO C99 or use MISC. */
+/* Convert a floating-point number to a string. */
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+extern int strfromd (char *__dest, size_t __size, const char *__format,
+ double __f)
+ __THROW __nonnull ((3));
+
+extern int strfromf (char *__dest, size_t __size, const char *__format,
+ float __f)
+ __THROW __nonnull ((3));
+
+extern int strfroml (char *__dest, size_t __size, const char *__format,
+ long double __f)
+ __THROW __nonnull ((3));
+#endif
+
#ifdef __USE_GNU
/* The concept of one static locale per category is not very well
diff --git a/stdlib/strfrom-skeleton.c b/stdlib/strfrom-skeleton.c
new file mode 100644
index 0000000000..8fd1beb7aa
--- /dev/null
+++ b/stdlib/strfrom-skeleton.c
@@ -0,0 +1,149 @@
+/* Convert a floating-point number to string.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Generic implementation for strfrom functions. The implementation is generic
+ for several floating-point types (e.g.: float, double), so that each
+ function, such as strfromf and strfroml, share the same code, thus avoiding
+ code duplication. */
+
+#include <ctype.h>
+#include "../libio/libioP.h"
+#include "../libio/strfile.h"
+#include <printf.h>
+#include <string.h>
+#include <locale/localeinfo.h>
+
+#define UCHAR_T char
+#define L_(Str) Str
+#define ISDIGIT(Ch) isdigit (Ch)
+#include "stdio-common/printf-parse.h"
+
+int
+STRFROM (char *dest, size_t size, const char *format, FLOAT f)
+{
+ _IO_strnfile sfile;
+#ifdef _IO_MTSAFE_IO
+ sfile.f._sbf._f._lock = NULL;
+#endif
+
+ int done;
+
+ /* Single-precision values need to be stored in a double type, because
+ __printf_fp_l and __printf_fphex do not accept the float type. */
+ union {
+ double flt;
+ FLOAT value;
+ } fpnum;
+ const void *fpptr;
+ fpptr = &fpnum;
+
+ /* Variables to control the output format. */
+ int precision = -1; /* printf_fp and printf_fphex treat this internally. */
+ int specifier;
+ struct printf_info info;
+
+ /* Single-precision values need to be converted into double-precision,
+ because __printf_fp and __printf_fphex only accept double and long double
+ as the floating-point argument. */
+ if (__builtin_types_compatible_p (FLOAT, float))
+ fpnum.flt = f;
+ else
+ fpnum.value = f;
+
+ /* Check if the first character in the format string is indeed the '%'
+ character. Otherwise, abort. */
+ if (*format == '%')
+ format++;
+ else
+ abort ();
+
+ /* The optional precision specification always starts with a '.'. If such
+ character is present, read the precision. */
+ if (*format == '.')
+ {
+ format++;
+
+ /* Parse the precision. */
+ if (ISDIGIT (*format))
+ precision = read_int (&format);
+ /* If only the period is specified, the precision is taken as zero, as
+ described in ISO/IEC 9899:2011, section 7.21.6.1, 4th paragraph, 3rd
+ item. */
+ else
+ precision = 0;
+ }
+
+ /* Now there is only the conversion specifier to be read. */
+ switch (*format)
+ {
+ case 'a':
+ case 'A':
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'F':
+ case 'g':
+ case 'G':
+ specifier = *format;
+ break;
+ default:
+ abort ();
+ }
+
+ /* The following code to prepare the virtual file has been adapted from the
+ function _IO_vsnprintf from libio. */
+
+ if (size == 0)
+ {
+ /* When size is zero, nothing is written and dest may be a null pointer.
+ This is specified for snprintf in ISO/IEC 9899:2011, Section 7.21.6.5,
+ in the second paragraph. Thus, if size is zero, prepare to use the
+ overflow buffer right from the start. */
+ dest = sfile.overflow_buf;
+ size = sizeof (sfile.overflow_buf);
+ }
+
+ /* Prepare the virtual string file. */
+ _IO_no_init (&sfile.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
+ _IO_JUMPS (&sfile.f._sbf) = &_IO_strn_jumps;
+ _IO_str_init_static_internal (&sfile.f, dest, size - 1, dest);
+
+ /* Prepare the format specification for printf_fp. */
+ memset (&info, '\0', sizeof (info));
+
+ /* The functions strfromd and strfromf pass a floating-point number with
+ double precision to printf_fp, whereas strfroml passes a floating-point
+ number with long double precision. The following line informs printf_fp
+ which type of floating-point number is being passed. */
+ info.is_long_double = __builtin_types_compatible_p (FLOAT, long double);
+
+ /* Set info according to the format string. */
+ info.prec = precision;
+ info.spec = specifier;
+
+ if (info.spec != 'a' && info.spec != 'A')
+ done = __printf_fp_l (&sfile.f._sbf._f, _NL_CURRENT_LOCALE, &info, &fpptr);
+ else
+ done = __printf_fphex (&sfile.f._sbf._f, &info, &fpptr);
+
+ /* Terminate the string. */
+ if (sfile.f._sbf._f._IO_buf_base != sfile.overflow_buf)
+ *sfile.f._sbf._f._IO_write_ptr = '\0';
+
+ return done;
+}
diff --git a/stdlib/strfromd.c b/stdlib/strfromd.c
new file mode 100644
index 0000000000..45a5790a1f
--- /dev/null
+++ b/stdlib/strfromd.c
@@ -0,0 +1,22 @@
+/* Definitions for strfromd. Implementation in stdlib/strfrom-skeleton.c.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FLOAT double
+#define STRFROM strfromd
+
+#include "strfrom-skeleton.c"
diff --git a/stdlib/strfromf.c b/stdlib/strfromf.c
new file mode 100644
index 0000000000..f0b085844c
--- /dev/null
+++ b/stdlib/strfromf.c
@@ -0,0 +1,22 @@
+/* Definitions for strfromf. Implementation in stdlib/strfrom-skeleton.c.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FLOAT float
+#define STRFROM strfromf
+
+#include "strfrom-skeleton.c"
diff --git a/stdlib/strfroml.c b/stdlib/strfroml.c
new file mode 100644
index 0000000000..8d5d15b0b9
--- /dev/null
+++ b/stdlib/strfroml.c
@@ -0,0 +1,22 @@
+/* Definitions for strfroml. Implementation in stdlib/strfrom-skeleton.c.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FLOAT long double
+#define STRFROM strfroml
+
+#include "strfrom-skeleton.c"
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 3d66eac706..a6c226ee9f 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -294,11 +294,14 @@ round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
if (exponent > MAX_EXP)
goto overflow;
+ bool half_bit = (round_limb & (((mp_limb_t) 1) << round_bit)) != 0;
+ bool more_bits_nonzero
+ = (more_bits
+ || (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0);
if (round_away (negative,
(retval[0] & 1) != 0,
- (round_limb & (((mp_limb_t) 1) << round_bit)) != 0,
- (more_bits
- || (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0),
+ half_bit,
+ more_bits_nonzero,
mode))
{
mp_limb_t cy = __mpn_add_1 (retval, retval, RETURN_LIMB_SIZE, 1);
@@ -325,6 +328,11 @@ round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
overflow:
return overflow_value (negative);
+ if (half_bit || more_bits_nonzero)
+ {
+ FLOAT force_inexact = (FLOAT) 1 + MIN_VALUE;
+ math_force_eval (force_inexact);
+ }
return MPN2FLOAT (retval, exponent, negative);
}
diff --git a/stdlib/tst-strfrom-locale.c b/stdlib/tst-strfrom-locale.c
new file mode 100644
index 0000000000..08d374f7fd
--- /dev/null
+++ b/stdlib/tst-strfrom-locale.c
@@ -0,0 +1,91 @@
+/* Tests for strfromf, strfromd, strfroml functions.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "tst-strfrom.h"
+
+static const struct test tests[] = {
+ TEST ("12,345000", "%f", 50, 9, 12.345),
+ TEST ("9,999", "%.3f", 50, 5, 9.999),
+ TEST ("0,125000", "%f", 50, 8, .125),
+ TEST ("0,000000", "%f", 50, 8, .0),
+ TEST ("0", "%g", 50, 1, .0),
+ TEST ("9,900000", "%f", 50, 8, 9.9),
+ TEST ("9,1", "%.5f", 4, 7, 9.123456),
+ TEST ("9,91235", "%g", 50, 7, 9.91234567812345678),
+ TEST ("79,8765", "%G", 50, 7, 79.8765432111),
+ TEST ("79,9", "%.3g", 50, 4, 79.8765432111),
+ TEST ("1,000000e+38", "%e", 50, 12, 1e+38),
+ TEST ("1,000000e+38", "%e", 50, 12, 1e38),
+ TEST ("-1,000000e-37", "%e", 50, 13, -1e-37),
+ TEST ("1,000000e-37", "%e", 50, 12, 0.00000001e-29),
+ TEST ("1,000000e-37", "%e", 50, 12, 1.000000e-37),
+ TEST ("5,900000e-16", "%e", 50, 12, 5.9e-16),
+ TEST ("1,234500e+20", "%e", 50, 12, 12.345e19),
+ TEST ("1,000000e+05", "%e", 50, 12, 1e5),
+ TEST ("-NAN", "%G", 50, 4, -NAN_),
+ TEST ("-inf", "%g", 50, 4, -INF),
+ TEST ("inf", "%g", 50, 3, INF)
+};
+/* Tests with buffer size small. */
+static const struct test stest[] = {
+ TEST ("1234", "%g", 5, 7, 12345.345),
+ TEST ("0,12", "%f", 5, 8, .125),
+ TEST ("9,99", "%.3f", 5, 5, 9.999),
+ TEST ("100", "%g", 5, 3, 1e2)
+};
+/* Hexadecimal tests. */
+static const struct htests htest[] = {
+ HTEST ("%a", { "0x1,ffp+6", "0x3,fep+5", "0x7,fcp+4", "0xf,f8p+3" },
+ 0x1.ffp+6),
+ HTEST ("%a", { "0x1,88p+4", "0x3,1p+3", "0x6,2p+2", "0xc,4p+1" },
+ 0x1.88p+4),
+ HTEST ("%A", { "-0X1,88P+5", "-0X3,1P+4", "-0X6,2P+3", "-0XC,4P+2" },
+ -0x1.88p+5),
+ HTEST ("%a", { "0x1,44p+10", "0x2,88p+9", "0x5,1p+8", "0xa,2p+7" },
+ 0x1.44p+10),
+ HTEST ("%a", { "0x1p-10", "0x2p-11", "0x4p-12", "0x8p-13" },
+ 0x0.0040p+0),
+ HTEST ("%a", { "0x1,4p+3", "0x2,8p+2", "0x5p+1", "0xap+0" },
+ 10.0)
+};
+
+GEN_TEST_STRTOD_FOREACH (TEST_STRFROM)
+
+static int
+test_locale (const char *locale)
+{
+ printf ("Testing in locale: %s\n", locale);
+ if (setlocale (LC_ALL, locale) == NULL)
+ {
+ printf ("Cannot set locale %s\n", locale);
+ }
+ return STRTOD_TEST_FOREACH (test_);
+}
+
+static int
+do_test (void)
+{
+ int result = 0;
+ result += test_locale ("de_DE.UTF-8");
+ result += test_locale ("tr_TR.ISO-8859-9");
+ result += test_locale ("tr_TR.UTF-8");
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdlib/tst-strfrom.c b/stdlib/tst-strfrom.c
new file mode 100644
index 0000000000..3c990be60b
--- /dev/null
+++ b/stdlib/tst-strfrom.c
@@ -0,0 +1,91 @@
+/* Tests for strfromf, strfromd, strfroml functions.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "tst-strfrom.h"
+
+static const struct test tests[] = {
+ TEST ("12.345000", "%f", 50, 9, 12.345),
+ TEST ("9.999", "%.3f", 50, 5, 9.999),
+ TEST ("0.125000", "%f", 50, 8, .125),
+ TEST ("0.000000", "%f", 50, 8, .0),
+ TEST ("0", "%g", 50, 1, .0),
+ TEST ("9.900000", "%f", 50, 8, 9.9),
+ TEST ("9.1", "%.5f", 4, 7, 9.123456),
+ TEST ("9.91235", "%g", 50, 7, 9.91234567812345678),
+ TEST ("79.8765", "%G", 50, 7, 79.8765432111),
+ TEST ("79.9", "%.3g", 50, 4, 79.8765432111),
+ TEST ("1.000000e+38", "%e", 50, 12, 1e+38),
+ TEST ("1.000000e+38", "%e", 50, 12, 1e38),
+ TEST ("-1.000000e-37", "%e", 50, 13, -1e-37),
+ TEST ("1.000000e-37", "%e", 50, 12, 0.00000001e-29),
+ TEST ("1.000000e-37", "%e", 50, 12, 1.000000e-37),
+ TEST ("5.900000e-16", "%e", 50, 12, 5.9e-16),
+ TEST ("1.234500e+20", "%e", 50, 12, 12.345e19),
+ TEST ("1.000000e+05", "%e", 50, 12, 1e5),
+ TEST ("-NAN", "%G", 50, 4, -NAN_),
+ TEST ("-inf", "%g", 50, 4, -INF),
+ TEST ("inf", "%g", 50, 3, INF)
+};
+/* Tests with buffer size small. */
+static const struct test stest[] = {
+ TEST ("1234", "%g", 5, 7, 12345.345),
+ TEST ("0.12", "%f", 5, 8, .125),
+ TEST ("9.99", "%.3f", 5, 5, 9.999),
+ TEST ("100", "%g", 5, 3, 1e2)
+};
+/* Hexadecimal tests. */
+static const struct htests htest[] = {
+ HTEST ("%a", { "0x1.ffp+6", "0x3.fep+5", "0x7.fcp+4", "0xf.f8p+3" },
+ 0x1.ffp+6),
+ HTEST ("%a", { "0x1.88p+4", "0x3.1p+3", "0x6.2p+2", "0xc.4p+1" },
+ 0x1.88p+4),
+ HTEST ("%A", { "-0X1.88P+5", "-0X3.1P+4", "-0X6.2P+3", "-0XC.4P+2" },
+ -0x1.88p+5),
+ HTEST ("%a", { "0x1.44p+10", "0x2.88p+9", "0x5.1p+8", "0xa.2p+7" },
+ 0x1.44p+10),
+ HTEST ("%a", { "0x1p-10", "0x2p-11", "0x4p-12", "0x8p-13" },
+ 0x0.0040p+0),
+ HTEST ("%a", { "0x1.4p+3", "0x2.8p+2", "0x5p+1", "0xap+0" },
+ 10.0)
+};
+
+GEN_TEST_STRTOD_FOREACH (TEST_STRFROM)
+
+static int
+test_locale (const char *locale)
+{
+ printf ("Testing in locale: %s\n", locale);
+ if (setlocale (LC_ALL, locale) == NULL)
+ {
+ printf ("Cannot set locale %s\n", locale);
+ }
+ return STRTOD_TEST_FOREACH (test_);
+}
+
+static int
+do_test (void)
+{
+ int result = 0;
+ result += test_locale ("C");
+ result += test_locale ("en_US.ISO-8859-1");
+ result += test_locale ("en_US.UTF-8");
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdlib/tst-strfrom.h b/stdlib/tst-strfrom.h
new file mode 100644
index 0000000000..31a6492936
--- /dev/null
+++ b/stdlib/tst-strfrom.h
@@ -0,0 +1,120 @@
+/* Tests for strfromf, strfromd, strfroml functions.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <float.h>
+#include <math.h>
+#include <locale.h>
+
+#include "tst-strtod.h"
+
+#define _CONCAT(a, b) a ## b
+#define CONCAT(a, b) _CONCAT (a, b)
+
+/* Generator to create an FTYPE member variabled named FSUF
+ * used to populate struct member variables. */
+#define FTYPE_MEMBER(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
+ FTYPE FSUF;
+
+#define STRUCT_FOREACH_FLOAT_FTYPE GEN_TEST_STRTOD_FOREACH (FTYPE_MEMBER)
+
+#define ENTRY(FSUF, FTYPE, FTOSTR, LSUF, CSUF, ...) \
+ CONCAT (__VA_ARGS__, CSUF),
+/* This is hacky way around the seemingly unavoidable macro
+ * expansion of the INFINITY or HUGE_VAL like macros in the
+ * above. It is assumed the compiler will implicitly convert
+ * the infinity correctly. */
+#define INF INFINITY + 0.0
+#define NAN_ NAN + 0.0
+
+struct test_input
+{
+ STRUCT_FOREACH_FLOAT_FTYPE
+};
+struct test {
+ const char *s;
+ const char *fmt;
+ int size;
+ int rc;
+ struct test_input t;
+};
+#define TEST(s, fmt, size, rc, val) \
+ { \
+ s, fmt, size, rc, { GEN_TEST_STRTOD_FOREACH (ENTRY, val) } \
+ }
+/* Hexadecimal tests. */
+struct htests
+{
+ const char *fmt;
+ const char *exp[4];
+ struct test_input t;
+};
+#define HTEST(fmt, exp1, exp2, exp3, exp4, val) \
+ { \
+ fmt, exp1, exp2, exp3, exp4, { GEN_TEST_STRTOD_FOREACH (ENTRY, val) } \
+ }
+
+#define TEST_STRFROM(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
+static int \
+test_ ## FSUF (void) \
+{ \
+ char buf[50], sbuf[5]; \
+ int status = 0; \
+ int i, rc = 0, rc1 = 0; \
+ for (i = 0; i < sizeof (stest) / sizeof (stest[0]); i++) \
+ { \
+ rc = FTOSTR (sbuf, stest[i].size, stest[i].fmt, stest[i].t.FSUF); \
+ rc1 = (strcmp (sbuf, stest[i].s) != 0) || (rc != stest[i].rc); \
+ if (rc1) \
+ { \
+ printf (#FTOSTR ": got %s (%d), expected %s (%d)\n", \
+ sbuf, rc, stest[i].s, stest[i].rc); \
+ status++; \
+ } \
+ } \
+ for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) \
+ { \
+ rc = FTOSTR (buf, tests[i].size, tests[i].fmt, tests[i].t.FSUF); \
+ rc1 = (strcmp (buf, tests[i].s) != 0) || (rc != tests[i].rc); \
+ if (rc1) \
+ { \
+ printf (#FTOSTR ": got %s (%d), expected %s (%d)\n", \
+ buf, rc, tests[i].s, tests[i].rc); \
+ status++; \
+ } \
+ } \
+ for (i = 0; i < sizeof (htest) / sizeof (htest[0]); i++) \
+ { \
+ rc = FTOSTR (buf, 50, htest[i].fmt, htest[i].t.FSUF); \
+ if (strcmp (buf, htest[i].exp[0]) == 0 || \
+ strcmp (buf, htest[i].exp[1]) == 0 || \
+ strcmp (buf, htest[i].exp[2]) == 0 || \
+ strcmp (buf, htest[i].exp[3]) == 0) \
+ continue; \
+ else \
+ { \
+ printf (#FTOSTR ": got %s (%d), expected %s or %s or %s " \
+ "or %s\n", buf, rc, htest[i].exp[0], htest[i].exp[1], \
+ htest[i].exp[2], htest[i].exp[3]); \
+ status++; \
+ } \
+ } \
+ return status; \
+}
diff --git a/stdlib/tst-strtod-round-data.h b/stdlib/tst-strtod-round-data.h
index 1fd3aa87e1..fc09bc9117 100644
--- a/stdlib/tst-strtod-round-data.h
+++ b/stdlib/tst-strtod-round-data.h
@@ -809,7 +809,7 @@ static const struct test tests[] = {
TEST ("0.0000000000000000000000000000000000000000000021019476964872"
"256063855943749348741969203929128147736576356024258346866240"
"28790902229957282543182373046875",
- true,
+ false,
0x8p-152,
0x1p-148,
0x8p-152,
@@ -3454,7 +3454,7 @@ static const struct test tests[] = {
0xcp-152),
TEST ("2.1019476964872256063855943749348741969203929128147736576356"
"02425834686624028790902229957282543182373046875e-45",
- true,
+ false,
0x8p-152,
0x1p-148,
0x8p-152,
@@ -3550,7 +3550,7 @@ static const struct test tests[] = {
-0xb.fffffffffffffffffffffffffff8p-152),
TEST ("-2.101947696487225606385594374934874196920392912814773657635"
"602425834686624028790902229957282543182373046875e-45",
- true,
+ false,
-0x1p-148,
-0x1p-148,
-0x8p-152,
@@ -3646,7 +3646,7 @@ static const struct test tests[] = {
0x1.4p-148),
TEST ("3.5032461608120426773093239582247903282006548546912894293926"
"70709724477706714651503716595470905303955078125e-45",
- true,
+ false,
0x1p-148,
0x1p-148,
0x1p-148,
@@ -3742,7 +3742,7 @@ static const struct test tests[] = {
-0x1.3fffffffffffffffffffffffffffp-148),
TEST ("-3.503246160812042677309323958224790328200654854691289429392"
"670709724477706714651503716595470905303955078125e-45",
- true,
+ false,
-0x1.8p-148,
-0x1p-148,
-0x1p-148,
@@ -3865,7 +3865,7 @@ static const struct test tests[] = {
0x0p+0,
0x0p+0,
0x8p-152,
- true,
+ false,
0x4p-1076,
0x8p-1076,
0x4p-1076,
@@ -3880,7 +3880,7 @@ static const struct test tests[] = {
0x6p-1076,
0x6p-1076,
0x6p-1076,
- true,
+ false,
0x4p-1076,
0x8p-1076,
0x4p-1076,
@@ -3994,7 +3994,7 @@ static const struct test tests[] = {
-0x0p+0,
-0x0p+0,
-0x0p+0,
- true,
+ false,
-0x8p-1076,
-0x8p-1076,
-0x4p-1076,
@@ -4009,7 +4009,7 @@ static const struct test tests[] = {
-0x6p-1076,
-0x6p-1076,
-0x6p-1076,
- true,
+ false,
-0x8p-1076,
-0x8p-1076,
-0x4p-1076,
@@ -4486,7 +4486,7 @@ static const struct test tests[] = {
0x0p+0,
0x0p+0,
0x4p-1076,
- true,
+ false,
0x8p-16448,
0x1p-16444,
0x8p-16448,
@@ -5152,7 +5152,7 @@ static const struct test tests[] = {
-0x0p+0,
-0x0p+0,
-0x0p+0,
- true,
+ false,
-0x1p-16444,
-0x1p-16444,
-0x8p-16448,
@@ -5818,7 +5818,7 @@ static const struct test tests[] = {
0x0p+0,
0x0p+0,
0x4p-1076,
- true,
+ false,
0x8p-16448,
0x1p-16444,
0x8p-16448,
@@ -6484,7 +6484,7 @@ static const struct test tests[] = {
-0x0p+0,
-0x0p+0,
-0x0p+0,
- true,
+ false,
-0x1p-16444,
-0x1p-16444,
-0x8p-16448,
diff --git a/stdlib/tst-strtod-round-skeleton.c b/stdlib/tst-strtod-round-skeleton.c
new file mode 100644
index 0000000000..89e09870ca
--- /dev/null
+++ b/stdlib/tst-strtod-round-skeleton.c
@@ -0,0 +1,252 @@
+/* Test for correct rounding of results of strtod and related
+ functions.
+ Copyright (C) 2012-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Defining _LIBC_TEST ensures long double math functions are
+ declared in the headers. */
+#define _LIBC_TEST 1
+#include <fenv.h>
+#include <float.h>
+#include <math.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math-tests.h>
+
+#include "tst-strtod.h"
+
+/* Non-standard macros expected to be externally defined:
+
+ L_(str): Pastes the appropriate modifier to a string literal str.
+
+ FNPFX: Expands to the correct prefix for the strtod equivalent
+ of type CHAR. (e.g str or wcs).
+
+ CHAR: Expands to the string type being tested (e.g wchar_t or char).
+
+ STRM: Expands to a string literal suitable for printing CHAR* via
+ printf (e.g "%s" or "%ls"). */
+
+#define _CONCAT(a, b) a ## b
+#define CONCAT(a, b) _CONCAT (a, b)
+
+#define STRTO(x) CONCAT (CONCAT (FNPFX, to), x)
+
+#if LDBL_MANT_DIG == 106 && LDBL_MAX_EXP == 1024
+/* This is a stupid hack for IBM long double. This test ignores
+ inexact values for long double due to the limitations of the
+ format. This ensures rounding tests are ignored. */
+# undef ROUNDING_TESTS_long_double
+# define ROUNDING_TESTS_long_double(x) 0
+#endif
+
+/* Generator to create an FTYPE member variabled named FSUF
+ used to populate struct member variables. */
+#define FTYPE_MEMBER(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
+ FTYPE FSUF;
+
+/* Likewise, but each member is of type bool. */
+#define BOOL_MEMBER(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
+ bool FSUF;
+
+#define STRUCT_FOREACH_FLOAT_FTYPE GEN_TEST_STRTOD_FOREACH (FTYPE_MEMBER)
+#define STRUCT_FOREACH_FLOAT_BOOL GEN_TEST_STRTOD_FOREACH (BOOL_MEMBER)
+
+/* Define the long double choose (CHOOSE_ld) macro
+ to select the appropriate generated long double
+ value from the generated test data. */
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+/* This is for the long double == double format. */
+# define CHOOSE_ld(f,d,...) d
+#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16381
+/* This is for the Intel extended float format. */
+# define CHOOSE_ld(f,d,ld64i,...) ld64i
+#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16382
+/* This is for the Motorola extended float format. */
+# define CHOOSE_ld(f,d,ld64i,ld64m,...) ld64m
+#elif LDBL_MANT_DIG == 106 && LDBL_MAX_EXP == 1024
+/* This is for the IBM extended double format. */
+# define CHOOSE_ld(f,d,ld64i,ld64m,ld106,...) ld106
+#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384
+/* This is for the IEEE binary128 format. */
+# define CHOOSE_ld(f,d,ld64i,ld64m,ld106,ld113,...) ld113
+#else
+# error "unknown long double format"
+#endif
+
+/* Add type specific choosing macros below. */
+#define CHOOSE_f(f,...) f
+#define CHOOSE_d(f,d,...) d
+/* long double is special, and handled above. */
+
+/* Selector for expected result field of a given type. */
+#define _ENTRY(FSUF, FTYPE, FTOSTR, LSUF, CSUF, ...) \
+ CONCAT (CHOOSE_ ## FSUF (__VA_ARGS__), LSUF),
+#define ENTRY(...) \
+ GEN_TEST_STRTOD_FOREACH (_ENTRY, __VA_ARGS__)
+
+/* Selector for boolean exact tag of expected results. */
+#define _XNTRY(FSUF, FTYPE, FTOSTR, LSUF, CSUF, ...) \
+ CHOOSE_ ## FSUF (__VA_ARGS__),
+#define XNTRY(...) \
+ GEN_TEST_STRTOD_FOREACH (_XNTRY, __VA_ARGS__)
+
+/* This is hacky way around the seemingly unavoidable macro
+ expansion of the INFINITY or HUGE_VAL like macros in the
+ above. It is assumed the compiler will implicitly convert
+ the infinity correctly. */
+#define INF INFINITY + 0.0
+
+/* This macro is used in conjunction with the output from the
+ gen-tst-strtod-round utility to select the appropriately
+ rounded long double value for a given format. */
+#define TEST(s, \
+ fx, fd, fn, fz, fu, \
+ dx, dd, dn, dz, du, \
+ ld64ix, ld64id, ld64in, ld64iz, ld64iu, \
+ ld64mx, ld64md, ld64mn, ld64mz, ld64mu, \
+ ld106x, ld106d, ld106n, ld106z, ld106u, \
+ ld113x, ld113d, ld113n, ld113z, ld113u) \
+ { \
+ L_ (s), \
+ { XNTRY (fx, dx, ld64ix, ld64mx, ld106x, ld113x) }, \
+ { \
+ { ENTRY (fn, dn, ld64in, ld64mn, ld106n, ld113n) }, \
+ { ENTRY (fd, dd, ld64id, ld64md, ld106d, ld113d) }, \
+ { ENTRY (fz, dz, ld64iz, ld64mz, ld106z, ld113z) }, \
+ { ENTRY (fu, du, ld64iu, ld64mu, ld106u, ld113u) } \
+ } \
+ }
+
+struct test_exactness
+ {
+ STRUCT_FOREACH_FLOAT_BOOL
+ };
+
+struct test_results
+ {
+ STRUCT_FOREACH_FLOAT_FTYPE
+ };
+
+struct test {
+ const CHAR *s;
+ struct test_exactness exact;
+ struct test_results r[4];
+};
+
+/* Include the generated test data. */
+#include "tst-strtod-round-data.h"
+
+#define STRX(x) #x
+#define STR(x) STRX (x)
+#define FNPFXS STR (FNPFX)
+
+#ifndef FE_INEXACT
+# define FE_INEXACT 0
+#endif
+
+#define GEN_ONE_TEST(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
+{ \
+ feclearexcept (FE_INEXACT); \
+ FTYPE f = STRTO (FSUF) (s, NULL); \
+ if (f != expected->FSUF \
+ || (copysign ## CSUF) (1.0 ## LSUF, f) \
+ != (copysign ## CSUF) (1.0 ## LSUF, expected->FSUF)) \
+ { \
+ char efstr[FSTRLENMAX]; \
+ char fstr[FSTRLENMAX]; \
+ FTOSTR (efstr, FSTRLENMAX, "%a", expected->FSUF); \
+ FTOSTR (fstr, FSTRLENMAX, "%a", f); \
+ printf (FNPFXS "to" #FSUF " (" STRM ") returned %s not " \
+ "%s (%s)\n", s, fstr, efstr, mode_name); \
+ if (ROUNDING_TESTS (FTYPE, rnd_mode) || exact->FSUF) \
+ result = 1; \
+ else \
+ printf ("ignoring this inexact result\n"); \
+ } \
+ else if (FE_INEXACT != 0) \
+ { \
+ bool inexact_raised = fetestexcept (FE_INEXACT) != 0; \
+ if (inexact_raised != !exact->FSUF) \
+ { \
+ printf (FNPFXS "to" #FSUF " (" STRM ") inexact %d " \
+ "not %d\n", s, inexact_raised, !exact->FSUF); \
+ if (EXCEPTION_TESTS (FTYPE)) \
+ result = 1; \
+ else \
+ printf ("ignoring this exception error\n"); \
+ } \
+ } \
+}
+
+static int
+test_in_one_mode (const CHAR *s, const struct test_results *expected,
+ const struct test_exactness *exact, const char *mode_name,
+ int rnd_mode)
+{
+ int result = 0;
+ GEN_TEST_STRTOD_FOREACH (GEN_ONE_TEST)
+ return result;
+}
+
+static const struct fetestmodes
+ {
+ const char *mode_name;
+ int rnd_mode;
+ int rnd_i; /* Corresponding index into r array of struct test. */
+ } modes[] = {
+ { "default rounding mode", FE_TONEAREST, 0 },
+#ifdef FE_DOWNWARD
+ { "FE_DOWNWARD", FE_DOWNWARD, 1 },
+#endif
+#ifdef FE_TOWARDZERO
+ { "FE_TOWARDZERO", FE_TOWARDZERO, 2 },
+#endif
+#ifdef FE_UPWARD
+ { "FE_UPWARD", FE_UPWARD, 3 },
+#endif
+ {}
+};
+
+static int
+do_test (void)
+{
+ int save_round_mode __attribute__ ((unused)) = fegetround ();
+ int result = 0;
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ result |= test_in_one_mode (tests[i].s, &tests[i].r[modes[0].rnd_i],
+ &tests[i].exact, modes[0].mode_name,
+ modes[0].rnd_mode);
+ for (const struct fetestmodes *m = &modes[1]; m->mode_name != NULL; m++)
+ {
+ if (!fesetround (m->rnd_mode))
+ {
+ result |= test_in_one_mode (tests[i].s, &tests[i].r[m->rnd_i],
+ &tests[i].exact, m->mode_name,
+ m->rnd_mode);
+ fesetround (save_round_mode);
+ }
+ }
+ }
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdlib/tst-strtod-round.c b/stdlib/tst-strtod-round.c
index 509f96ac9e..ae5d6f8478 100644
--- a/stdlib/tst-strtod-round.c
+++ b/stdlib/tst-strtod-round.c
@@ -1,6 +1,5 @@
-/* Test for correct rounding of results of strtod and related
- functions.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* char shim for tst-strtod-round-skeleton.c.
+ Copyright (C) 2016 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,200 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* Defining _LIBC_TEST ensures long double math functions are
- declared in the headers. */
-#define _LIBC_TEST 1
-#include <fenv.h>
-#include <float.h>
-#include <math.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math-tests.h>
+#define L_(str) str
+#define FNPFX str
+#define CHAR char
+#define STRM "%s"
-#include "tst-strtod.h"
-
-#define _CONCAT(a, b) a ## b
-#define CONCAT(a, b) _CONCAT (a, b)
-
-#if LDBL_MANT_DIG == 106 && LDBL_MAX_EXP == 1024
-/* This is a stupid hack for IBM long double. This test ignores
- inexact values for long double due to the limitations of the
- format. This ensures rounding tests are ignored. */
-# undef ROUNDING_TESTS_long_double
-# define ROUNDING_TESTS_long_double(x) 0
-#endif
-
-/* Generator to create an FTYPE member variabled named FSUF
- used to populate struct member variables. */
-#define FTYPE_MEMBER(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF) \
- FTYPE FSUF;
-
-/* Likewise, but each member is of type bool. */
-#define BOOL_MEMBER(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF) \
- bool FSUF;
-
-#define STRUCT_FOREACH_FLOAT_FTYPE GEN_TEST_STRTOD_FOREACH (FTYPE_MEMBER)
-#define STRUCT_FOREACH_FLOAT_BOOL GEN_TEST_STRTOD_FOREACH (BOOL_MEMBER)
-
-/* Define the long double choose (CHOOSE_ld) macro
- to select the appropriate generated long double
- value from the generated test data. */
-#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
-/* This is for the long double == double format. */
-# define CHOOSE_ld(f,d,...) d
-#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16381
-/* This is for the Intel extended float format. */
-# define CHOOSE_ld(f,d,ld64i,...) ld64i
-#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && LDBL_MIN_EXP == -16382
-/* This is for the Motorola extended float format. */
-# define CHOOSE_ld(f,d,ld64i,ld64m,...) ld64m
-#elif LDBL_MANT_DIG == 106 && LDBL_MAX_EXP == 1024
-/* This is for the IBM extended double format. */
-# define CHOOSE_ld(f,d,ld64i,ld64m,ld106,...) ld106
-#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384
-/* This is for the IEEE binary128 format. */
-# define CHOOSE_ld(f,d,ld64i,ld64m,ld106,ld113,...) ld113
-#else
-# error "unknown long double format"
-#endif
-
-/* Add type specific choosing macros below. */
-#define CHOOSE_f(f,...) f
-#define CHOOSE_d(f,d,...) d
-/* long double is special, and handled above. */
-
-/* Selector for expected result field of a given type. */
-#define _ENTRY(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF, ...) \
- CONCAT (CHOOSE_ ## FSUF (__VA_ARGS__), LSUF),
-#define ENTRY(...) \
- GEN_TEST_STRTOD_FOREACH (_ENTRY, __VA_ARGS__)
-
-/* Selector for boolean exact tag of expected results. */
-#define _XNTRY(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF, ...) \
- CHOOSE_ ## FSUF (__VA_ARGS__),
-#define XNTRY(...) \
- GEN_TEST_STRTOD_FOREACH (_XNTRY, __VA_ARGS__)
-
-/* This is hacky way around the seemingly unavoidable macro
- expansion of the INFINITY or HUGE_VAL like macros in the
- above. It is assumed the compiler will implicitly convert
- the infinity correctly. */
-#define INF INFINITY + 0.0
-
-/* This macro is used in conjunction with the output from the
- gen-tst-strtod-round utility to select the appropriately
- rounded long double value for a given format. */
-#define TEST(s, \
- fx, fd, fn, fz, fu, \
- dx, dd, dn, dz, du, \
- ld64ix, ld64id, ld64in, ld64iz, ld64iu, \
- ld64mx, ld64md, ld64mn, ld64mz, ld64mu, \
- ld106x, ld106d, ld106n, ld106z, ld106u, \
- ld113x, ld113d, ld113n, ld113z, ld113u) \
- { \
- s, \
- { XNTRY (fx, dx, ld64ix, ld64mx, ld106x, ld113x) }, \
- { \
- { ENTRY (fn, dn, ld64in, ld64mn, ld106n, ld113n) }, \
- { ENTRY (fd, dd, ld64id, ld64md, ld106d, ld113d) }, \
- { ENTRY (fz, dz, ld64iz, ld64mz, ld106z, ld113z) }, \
- { ENTRY (fu, du, ld64iu, ld64mu, ld106u, ld113u) } \
- } \
- }
-
-struct test_exactness
- {
- STRUCT_FOREACH_FLOAT_BOOL
- };
-
-struct test_results
- {
- STRUCT_FOREACH_FLOAT_FTYPE
- };
-
-struct test {
- const char *s;
- struct test_exactness exact;
- struct test_results r[4];
-};
-
-/* Include the generated test data. */
-#include "tst-strtod-round-data.h"
-
-#define GEN_ONE_TEST(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF) \
-{ \
- FTYPE f = strto ## FSUF (s, NULL); \
- if (f != expected->FSUF \
- || (copysign ## CSUF) (1.0 ## LSUF, f) \
- != (copysign ## CSUF) (1.0 ## LSUF, expected->FSUF)) \
- { \
- char efstr[FSTRLENMAX]; \
- char fstr[FSTRLENMAX]; \
- FTOSTR (efstr, FSTRLENMAX, "%" FTOSTRM "a", expected->FSUF); \
- FTOSTR (fstr, FSTRLENMAX, "%" FTOSTRM "a", f); \
- printf ("strto" #FSUF " (%s) returned %s not %s" \
- " (%s)\n", s, fstr, efstr, mode_name); \
- if (ROUNDING_TESTS (FTYPE, rnd_mode) || exact->FSUF) \
- result = 1; \
- else \
- printf ("ignoring this inexact result\n"); \
- } \
-}
-
-static int
-test_in_one_mode (const char *s, const struct test_results *expected,
- const struct test_exactness *exact, const char *mode_name,
- int rnd_mode)
-{
- int result = 0;
- GEN_TEST_STRTOD_FOREACH (GEN_ONE_TEST)
- return result;
-}
-
-static const struct fetestmodes
- {
- const char *mode_name;
- int rnd_mode;
- int rnd_i; /* Corresponding index into r array of struct test. */
- } modes[] = {
- { "default rounding mode", FE_TONEAREST, 0 },
-#ifdef FE_DOWNWARD
- { "FE_DOWNWARD", FE_DOWNWARD, 1 },
-#endif
-#ifdef FE_TOWARDZERO
- { "FE_TOWARDZERO", FE_TOWARDZERO, 2 },
-#endif
-#ifdef FE_UPWARD
- { "FE_UPWARD", FE_UPWARD, 3 },
-#endif
- {}
-};
-
-static int
-do_test (void)
-{
- int save_round_mode __attribute__ ((unused)) = fegetround ();
- int result = 0;
- for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
- {
- result |= test_in_one_mode (tests[i].s, &tests[i].r[modes[0].rnd_i],
- &tests[i].exact, modes[0].mode_name,
- modes[0].rnd_mode);
- for (const struct fetestmodes *m = &modes[1]; m->mode_name != NULL; m++)
- {
- if (!fesetround (m->rnd_mode))
- {
- result |= test_in_one_mode (tests[i].s, &tests[i].r[m->rnd_i],
- &tests[i].exact, m->mode_name,
- m->rnd_mode);
- fesetround (save_round_mode);
- }
- }
- }
- return result;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <tst-strtod-round-skeleton.c>
diff --git a/stdlib/tst-strtod.h b/stdlib/tst-strtod.h
index 607cf393aa..b8e9cd4a34 100644
--- a/stdlib/tst-strtod.h
+++ b/stdlib/tst-strtod.h
@@ -23,14 +23,13 @@
/* Splat n variants of the same test for the various strtod functions. */
#define GEN_TEST_STRTOD_FOREACH(mfunc, ...) \
- mfunc ( f, float, snprintf, "", f, f, ##__VA_ARGS__) \
- mfunc ( d, double, snprintf, "", , , ##__VA_ARGS__) \
- mfunc ( ld, long double, snprintf, "L", L, l, ##__VA_ARGS__)
+ mfunc ( f, float, strfromf, f, f, ##__VA_ARGS__) \
+ mfunc ( d, double, strfromd, , , ##__VA_ARGS__) \
+ mfunc ( ld, long double, strfroml, L, l, ##__VA_ARGS__)
/* The arguments to the generated macros are:
FSUF - Function suffix
FTYPE - float type
FTOSTR - float to string func
- FTOSTRM - Optional modifier for FTOSTR format
LSUF - Literal suffix
CSUF - C standardish suffix for many of the math functions
*/
diff --git a/stdlib/tst-strtod6.c b/stdlib/tst-strtod6.c
index 6b3bb8404e..9bfbdc2b38 100644
--- a/stdlib/tst-strtod6.c
+++ b/stdlib/tst-strtod6.c
@@ -5,7 +5,7 @@
#include "tst-strtod.h"
-#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, FTOSTRM, LSUF, CSUF) \
+#define TEST_STRTOD(FSUF, FTYPE, FTOSTR, LSUF, CSUF) \
static int \
test_strto ## FSUF (const char str[]) \
{ \
diff --git a/stdlib/tst-width-stdint.c b/stdlib/tst-width-stdint.c
new file mode 100644
index 0000000000..29b8b931a3
--- /dev/null
+++ b/stdlib/tst-width-stdint.c
@@ -0,0 +1,185 @@
+/* Test integer width macros in <stdint.h>.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <signal.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <wchar.h>
+
+#define CHECK_WIDTH(TYPE, MAX, WIDTH) \
+ do \
+ { \
+ if ((MAX >> ((TYPE) -1 < 0 ? (WIDTH - 2) : (WIDTH - 1))) != 1) \
+ { \
+ puts ("bad width of " #TYPE); \
+ result = 1; \
+ } \
+ else \
+ puts ("width of " #TYPE " OK"); \
+ } \
+ while (0)
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+#ifndef INT8_WIDTH
+# error "missing INT8_WIDTH"
+#endif
+ CHECK_WIDTH (int8_t, INT8_MAX, INT8_WIDTH);
+#ifndef INT16_WIDTH
+# error "missing INT16_WIDTH"
+#endif
+ CHECK_WIDTH (int16_t, INT16_MAX, INT16_WIDTH);
+#ifndef INT32_WIDTH
+# error "missing INT32_WIDTH"
+#endif
+ CHECK_WIDTH (int32_t, INT32_MAX, INT32_WIDTH);
+#ifndef INT64_WIDTH
+# error "missing INT64_WIDTH"
+#endif
+ CHECK_WIDTH (int64_t, INT64_MAX, INT64_WIDTH);
+#ifndef UINT8_WIDTH
+# error "missing UINT8_WIDTH"
+#endif
+ CHECK_WIDTH (uint8_t, UINT8_MAX, UINT8_WIDTH);
+#ifndef UINT16_WIDTH
+# error "missing UINT16_WIDTH"
+#endif
+ CHECK_WIDTH (uint16_t, UINT16_MAX, UINT16_WIDTH);
+#ifndef UINT32_WIDTH
+# error "missing UINT32_WIDTH"
+#endif
+ CHECK_WIDTH (uint32_t, UINT32_MAX, UINT32_WIDTH);
+#ifndef UINT64_WIDTH
+# error "missing UINT64_WIDTH"
+#endif
+ CHECK_WIDTH (uint64_t, UINT64_MAX, UINT64_WIDTH);
+
+#ifndef INT_LEAST8_WIDTH
+# error "missing INT_LEAST8_WIDTH"
+#endif
+ CHECK_WIDTH (int_least8_t, INT_LEAST8_MAX, INT_LEAST8_WIDTH);
+#ifndef INT_LEAST16_WIDTH
+# error "missing INT_LEAST16_WIDTH"
+#endif
+ CHECK_WIDTH (int_least16_t, INT_LEAST16_MAX, INT_LEAST16_WIDTH);
+#ifndef INT_LEAST32_WIDTH
+# error "missing INT_LEAST32_WIDTH"
+#endif
+ CHECK_WIDTH (int_least32_t, INT_LEAST32_MAX, INT_LEAST32_WIDTH);
+#ifndef INT_LEAST64_WIDTH
+# error "missing INT_LEAST64_WIDTH"
+#endif
+ CHECK_WIDTH (int_least64_t, INT_LEAST64_MAX, INT_LEAST64_WIDTH);
+#ifndef UINT_LEAST8_WIDTH
+# error "missing UINT_LEAST8_WIDTH"
+#endif
+ CHECK_WIDTH (uint_least8_t, UINT_LEAST8_MAX, UINT_LEAST8_WIDTH);
+#ifndef UINT_LEAST16_WIDTH
+# error "missing UINT_LEAST16_WIDTH"
+#endif
+ CHECK_WIDTH (uint_least16_t, UINT_LEAST16_MAX, UINT_LEAST16_WIDTH);
+#ifndef UINT_LEAST32_WIDTH
+# error "missing UINT_LEAST32_WIDTH"
+#endif
+ CHECK_WIDTH (uint_least32_t, UINT_LEAST32_MAX, UINT_LEAST32_WIDTH);
+#ifndef UINT_LEAST64_WIDTH
+# error "missing UINT_LEAST64_WIDTH"
+#endif
+ CHECK_WIDTH (uint_least64_t, UINT_LEAST64_MAX, UINT_LEAST64_WIDTH);
+
+#ifndef INT_FAST8_WIDTH
+# error "missing INT_FAST8_WIDTH"
+#endif
+ CHECK_WIDTH (int_fast8_t, INT_FAST8_MAX, INT_FAST8_WIDTH);
+#ifndef INT_FAST16_WIDTH
+# error "missing INT_FAST16_WIDTH"
+#endif
+ CHECK_WIDTH (int_fast16_t, INT_FAST16_MAX, INT_FAST16_WIDTH);
+#ifndef INT_FAST32_WIDTH
+# error "missing INT_FAST32_WIDTH"
+#endif
+ CHECK_WIDTH (int_fast32_t, INT_FAST32_MAX, INT_FAST32_WIDTH);
+#ifndef INT_FAST64_WIDTH
+# error "missing INT_FAST64_WIDTH"
+#endif
+ CHECK_WIDTH (int_fast64_t, INT_FAST64_MAX, INT_FAST64_WIDTH);
+#ifndef UINT_FAST8_WIDTH
+# error "missing UINT_FAST8_WIDTH"
+#endif
+ CHECK_WIDTH (uint_fast8_t, UINT_FAST8_MAX, UINT_FAST8_WIDTH);
+#ifndef UINT_FAST16_WIDTH
+# error "missing UINT_FAST16_WIDTH"
+#endif
+ CHECK_WIDTH (uint_fast16_t, UINT_FAST16_MAX, UINT_FAST16_WIDTH);
+#ifndef UINT_FAST32_WIDTH
+# error "missing UINT_FAST32_WIDTH"
+#endif
+ CHECK_WIDTH (uint_fast32_t, UINT_FAST32_MAX, UINT_FAST32_WIDTH);
+#ifndef UINT_FAST64_WIDTH
+# error "missing UINT_FAST64_WIDTH"
+#endif
+ CHECK_WIDTH (uint_fast64_t, UINT_FAST64_MAX, UINT_FAST64_WIDTH);
+
+#ifndef INTPTR_WIDTH
+# error "missing INTPTR_WIDTH"
+#endif
+ CHECK_WIDTH (intptr_t, INTPTR_MAX, INTPTR_WIDTH);
+#ifndef UINTPTR_WIDTH
+# error "missing UINTPTR_WIDTH"
+#endif
+ CHECK_WIDTH (uintptr_t, UINTPTR_MAX, UINTPTR_WIDTH);
+
+#ifndef INTMAX_WIDTH
+# error "missing INTMAX_WIDTH"
+#endif
+ CHECK_WIDTH (intmax_t, INTMAX_MAX, INTMAX_WIDTH);
+#ifndef UINTMAX_WIDTH
+# error "missing UINTMAX_WIDTH"
+#endif
+ CHECK_WIDTH (uintmax_t, UINTMAX_MAX, UINTMAX_WIDTH);
+
+#ifndef PTRDIFF_WIDTH
+# error "missing PTRDIFF_WIDTH"
+#endif
+ CHECK_WIDTH (ptrdiff_t, PTRDIFF_MAX, PTRDIFF_WIDTH);
+#ifndef SIG_ATOMIC_WIDTH
+# error "missing SIG_ATOMIC_WIDTH"
+#endif
+ CHECK_WIDTH (sig_atomic_t, SIG_ATOMIC_MAX, SIG_ATOMIC_WIDTH);
+#ifndef SIZE_WIDTH
+# error "missing SIZE_WIDTH"
+#endif
+ CHECK_WIDTH (size_t, SIZE_MAX, SIZE_WIDTH);
+#ifndef WCHAR_WIDTH
+# error "missing WCHAR_WIDTH"
+#endif
+ CHECK_WIDTH (wchar_t, WCHAR_MAX, WCHAR_WIDTH);
+#ifndef WINT_WIDTH
+# error "missing WINT_WIDTH"
+#endif
+ CHECK_WIDTH (wint_t, WINT_MAX, WINT_WIDTH);
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdlib/tst-width.c b/stdlib/tst-width.c
new file mode 100644
index 0000000000..4972c8d762
--- /dev/null
+++ b/stdlib/tst-width.c
@@ -0,0 +1,87 @@
+/* Test integer width macros.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <limits.h>
+#include <stdio.h>
+
+#define CHECK_WIDTH(TYPE, MAX, WIDTH) \
+ do \
+ { \
+ if ((MAX >> ((TYPE) -1 < 0 ? (WIDTH - 2) : (WIDTH - 1))) != 1) \
+ { \
+ puts ("bad width of " #TYPE); \
+ result = 1; \
+ } \
+ else \
+ puts ("width of " #TYPE " OK"); \
+ } \
+ while (0)
+
+static int
+do_test (void)
+{
+ int result = 0;
+#ifndef CHAR_WIDTH
+# error "missing CHAR_WIDTH"
+#endif
+ CHECK_WIDTH (char, CHAR_MAX, CHAR_WIDTH);
+#ifndef SCHAR_WIDTH
+# error "missing SCHAR_WIDTH"
+#endif
+ CHECK_WIDTH (signed char, SCHAR_MAX, SCHAR_WIDTH);
+#ifndef UCHAR_WIDTH
+# error "missing UCHAR_WIDTH"
+#endif
+ CHECK_WIDTH (unsigned char, UCHAR_MAX, UCHAR_WIDTH);
+#ifndef SHRT_WIDTH
+# error "missing SHRT_WIDTH"
+#endif
+ CHECK_WIDTH (signed short, SHRT_MAX, SHRT_WIDTH);
+#ifndef USHRT_WIDTH
+# error "missing USHRT_WIDTH"
+#endif
+ CHECK_WIDTH (unsigned short, USHRT_MAX, USHRT_WIDTH);
+#ifndef INT_WIDTH
+# error "missing INT_WIDTH"
+#endif
+ CHECK_WIDTH (signed int, INT_MAX, INT_WIDTH);
+#ifndef UINT_WIDTH
+# error "missing UINT_WIDTH"
+#endif
+ CHECK_WIDTH (unsigned int, UINT_MAX, UINT_WIDTH);
+#ifndef LONG_WIDTH
+# error "missing LONG_WIDTH"
+#endif
+ CHECK_WIDTH (signed long, LONG_MAX, LONG_WIDTH);
+#ifndef ULONG_WIDTH
+# error "missing ULONG_WIDTH"
+#endif
+ CHECK_WIDTH (unsigned long, ULONG_MAX, ULONG_WIDTH);
+#ifndef LLONG_WIDTH
+# error "missing LLONG_WIDTH"
+#endif
+ CHECK_WIDTH (signed long long, LLONG_MAX, LLONG_WIDTH);
+#ifndef ULLONG_WIDTH
+# error "missing ULLONG_WIDTH"
+#endif
+ CHECK_WIDTH (unsigned long long, ULLONG_MAX, ULLONG_WIDTH);
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/string/Makefile b/string/Makefile
index 9c87419ad9..69d3f802fb 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -54,7 +54,7 @@ tests := tester inl-tester noinl-tester testcopy test-ffs \
tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \
bug-strtok1 $(addprefix test-,$(strop-tests)) \
bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \
- tst-strtok_r bug-strcoll2
+ tst-strtok_r bug-strcoll2 tst-cmp
xtests = tst-strcoll-overflow
diff --git a/string/bits/string3.h b/string/bits/string3.h
index dd8db68aa2..8f13b65fa6 100644
--- a/string/bits/string3.h
+++ b/string/bits/string3.h
@@ -126,7 +126,7 @@ __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
}
-// XXX We have no corresponding builtin yet.
+/* XXX We have no corresponding builtin yet. */
extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
size_t __destlen) __THROW;
extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
diff --git a/string/strcoll_l.c b/string/strcoll_l.c
index 4d1e3ab15e..5605dbfa8a 100644
--- a/string/strcoll_l.c
+++ b/string/strcoll_l.c
@@ -24,6 +24,7 @@
#include <stdint.h>
#include <string.h>
#include <sys/param.h>
+#include <libc-internal.h>
#ifndef STRING_TYPE
# define STRING_TYPE char
@@ -170,7 +171,19 @@ get_next_seq (coll_seq *seq, int nrules, const unsigned char *rulesets,
}
}
+ /* With GCC 5.3 when compiling with -Os the compiler complains
+ that idx, taken from seq->idx (seq1 or seq2 from STRCOLL) may
+ be used uninitialized. In general this can't possibly be true
+ since seq1.idx and seq2.idx are initialized to zero in the
+ outer function. Only one case where seq->idx is restored from
+ seq->save_idx might result in an uninitialized idx value, but
+ it is guarded by a sequence of checks against backw_stop which
+ ensures that seq->save_idx was saved to first and contains a
+ valid value. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
len = weights[idx++];
+ DIAG_POP_NEEDS_COMMENT;
/* Skip over indices of previous levels. */
for (int i = 0; i < pass; i++)
{
diff --git a/string/tst-cmp.c b/string/tst-cmp.c
new file mode 100644
index 0000000000..a358477007
--- /dev/null
+++ b/string/tst-cmp.c
@@ -0,0 +1,212 @@
+/* Alignment/padding coverage test for string comparison.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This performs test comparisons with various (mis)alignments and
+ characters in the padding. It is partly a regression test for bug
+ 20327. */
+
+#include <limits.h>
+#include <malloc.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int
+signum (int val)
+{
+ if (val < 0)
+ return -1;
+ if (val > 0)
+ return 1;
+ else
+ return 0;
+}
+
+static size_t
+max_size_t (size_t left, size_t right)
+{
+ if (left > right)
+ return left;
+ else
+ return right;
+}
+
+/* Wrappers for strncmp and strncasecmp which determine the maximum
+ string length in some, either based on the input string length, or
+ using fixed constants. */
+
+static int
+strncmp_no_terminator (const char *left, const char *right)
+{
+ size_t left_len = strlen (left);
+ size_t right_len = strlen (right);
+ return strncmp (left, right, max_size_t (left_len, right_len));
+}
+
+static int
+strncasecmp_no_terminator (const char *left, const char *right)
+{
+ size_t left_len = strlen (left);
+ size_t right_len = strlen (right);
+ return strncasecmp (left, right, max_size_t (left_len, right_len));
+}
+
+static int
+strncmp_terminator (const char *left, const char *right)
+{
+ size_t left_len = strlen (left);
+ size_t right_len = strlen (right);
+ return strncmp (left, right, max_size_t (left_len, right_len));
+}
+
+static int
+strncasecmp_terminator (const char *left, const char *right)
+{
+ size_t left_len = strlen (left);
+ size_t right_len = strlen (right);
+ return strncasecmp (left, right, max_size_t (left_len, right_len));
+}
+
+static int
+strncmp_64 (const char *left, const char *right)
+{
+ return strncmp (left, right, 64);
+}
+
+static int
+strncasecmp_64 (const char *left, const char *right)
+{
+ return strncasecmp (left, right, 64);
+}
+
+static int
+strncmp_max (const char *left, const char *right)
+{
+ return strncmp (left, right, SIZE_MAX);
+}
+
+static int
+strncasecmp_max (const char *left, const char *right)
+{
+ return strncasecmp (left, right, SIZE_MAX);
+}
+
+static int
+do_test (void)
+{
+ enum {
+ max_align = 64,
+ max_string_length = 33
+ };
+ size_t blob_size = max_align + max_string_length + 1;
+ char *left = memalign (max_align, blob_size);
+ char *right = memalign (max_align, blob_size);
+ if (left == NULL || right == NULL)
+ {
+ printf ("error: out of memory\n");
+ return 1;
+ }
+
+ const struct
+ {
+ const char *name;
+ int (*implementation) (const char *, const char *);
+ } functions[] =
+ {
+ { "strcmp", strcmp },
+ { "strcasecmp", strcasecmp },
+ { "strncmp (without NUL)", strncmp_no_terminator},
+ { "strncasecmp (without NUL)", strncasecmp_no_terminator},
+ { "strncmp (with NUL)", strncmp_terminator},
+ { "strncasecmp (with NUL)", strncasecmp_terminator},
+ { "strncmp (length 64)", strncmp_64},
+ { "strncasecmp (length 64)", strncasecmp_64},
+ { "strncmp (length SIZE_MAX)", strncmp_max},
+ { "strncasecmp (length SIZE_MAX)", strncasecmp_max},
+ { NULL, NULL }
+ };
+ const char *const strings[] =
+ {
+ "",
+ "0",
+ "01",
+ "01234567",
+ "0123456789abcde",
+ "0123456789abcdef",
+ "0123456789abcdefg",
+ "1",
+ "10",
+ "123456789abcdef",
+ "123456789abcdefg",
+ "23456789abcdef",
+ "23456789abcdefg",
+ "abcdefghijklmnopqrstuvwxyzABCDEF",
+ NULL
+ };
+ const unsigned char pads[] =
+ { 0, 1, 32, 64, 128, '0', '1', 'e', 'f', 'g', 127, 192, 255 };
+
+ bool errors = false;
+ for (int left_idx = 0; strings[left_idx] != NULL; ++left_idx)
+ for (int left_align = 0; left_align < max_align; ++left_align)
+ for (unsigned pad_left = 0; pad_left < sizeof (pads); ++pad_left)
+ {
+ memset (left, pads[pad_left], blob_size);
+ strcpy (left + left_align, strings[left_idx]);
+
+ for (int right_idx = 0; strings[right_idx] != NULL; ++right_idx)
+ for (unsigned pad_right = 0; pad_right < sizeof (pads);
+ ++pad_right)
+ for (int right_align = 0; right_align < max_align;
+ ++right_align)
+ {
+ memset (right, pads[pad_right], blob_size);
+ strcpy (right + right_align, strings[right_idx]);
+
+ for (int func = 0; functions[func].name != NULL; ++func)
+ {
+ int expected = left_idx - right_idx;
+ int actual = functions[func].implementation
+ (left + left_align, right + right_align);
+ if (signum (actual) != signum (expected))
+ {
+ printf ("error: mismatch for %s: %d\n"
+ " left: \"%s\"\n"
+ " right: \"%s\"\n"
+ " pad_left = %u, pad_right = %u,\n"
+ " left_align = %d, right_align = %d\n",
+ functions[func].name, actual,
+ strings[left_idx], strings[right_idx],
+ pad_left, pad_right,
+ left_align, right_align);
+ errors = true;
+ }
+ }
+ }
+ }
+ free (right);
+ free (left);
+ return errors;
+}
+
+/* The nested loops need a long time to complete on slower
+ machines. */
+#define TIMEOUT 300
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sunrpc/rpc/rpc_des.h b/sunrpc/rpc/rpc_des.h
index 4b3c426c62..2091f52414 100644
--- a/sunrpc/rpc/rpc_des.h
+++ b/sunrpc/rpc/rpc_des.h
@@ -53,15 +53,15 @@ enum desmode
*/
struct desparams
{
- u_char des_key[8]; /* key (with low bit parity) */
+ unsigned char des_key[8]; /* key (with low bit parity) */
enum desdir des_dir; /* direction */
enum desmode des_mode; /* mode */
- u_char des_ivec[8]; /* input vector */
+ unsigned char des_ivec[8]; /* input vector */
unsigned des_len; /* number of bytes to crypt */
union
{
- u_char UDES_data[DES_QUICKLEN];
- u_char *UDES_buf;
+ unsigned char UDES_data[DES_QUICKLEN];
+ unsigned char *UDES_buf;
}
UDES;
#define des_data UDES.UDES_data /* direct data here if quick */
diff --git a/sysdeps/aarch64/bits/fenv.h b/sysdeps/aarch64/bits/fenv.h
index aced0d33b2..9df57a1bbf 100644
--- a/sysdeps/aarch64/bits/fenv.h
+++ b/sysdeps/aarch64/bits/fenv.h
@@ -72,3 +72,11 @@ fenv_t;
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/math/s_fminf.c b/sysdeps/aarch64/bits/wordsize.h
index 968373ac5e..eadbb48266 100644
--- a/math/s_fminf.c
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -1,7 +1,7 @@
-/* Return minimum numeric value of X and Y.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Determine the wordsize from the preprocessor defines.
+
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,12 +17,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
-
+#ifdef __LP64__
+# define __WORDSIZE 64
+#else
+# define __WORDSIZE 32
+# define __WORDSIZE32_SIZE_ULONG 1
+# define __WORDSIZE32_PTRDIFF_LONG 1
+#endif
-float
-__fminf (float x, float y)
-{
- return (islessequal (x, y) || isnan (y)) ? x : y;
-}
-weak_alias (__fminf, fminf)
+#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/aarch64/fpu/fegetmode.c b/sysdeps/aarch64/fpu/fegetmode.c
new file mode 100644
index 0000000000..7e76acf05d
--- /dev/null
+++ b/sysdeps/aarch64/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. AArch64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c b/sysdeps/aarch64/fpu/fesetexcept.c
index d76a2ffdff..52210bbec2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
+++ b/sysdeps/aarch64/fpu/fesetexcept.c
@@ -1,5 +1,5 @@
-/* Selective file content synch'ing.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Set given exception flags. AArch64 version.
+ Copyright (C) 2016 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,15 +16,19 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
+#include <fenv.h>
+#include <fpu_control.h>
int
-sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+fesetexcept (int excepts)
{
- return SYSCALL_CANCEL (sync_file_range2, fd, flags, from, to);
+ fpu_fpsr_t fpsr;
+ fpu_fpsr_t fpsr_new;
+
+ _FPU_GETFPSR (fpsr);
+ fpsr_new = fpsr | (excepts & FE_ALL_EXCEPT);
+ if (fpsr != fpsr_new)
+ _FPU_SETFPSR (fpsr_new);
+
+ return 0;
}
diff --git a/sysdeps/aarch64/fpu/fesetmode.c b/sysdeps/aarch64/fpu/fesetmode.c
new file mode 100644
index 0000000000..d1b653ee07
--- /dev/null
+++ b/sysdeps/aarch64/fpu/fesetmode.c
@@ -0,0 +1,34 @@
+/* Install given floating-point control modes. AArch64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t fpcr, fpcr_new;
+ _FPU_GETCW (fpcr);
+ if (modep == FE_DFL_MODE)
+ fpcr_new = (fpcr & _FPU_RESERVED) | _FPU_DEFAULT;
+ else
+ fpcr_new = *modep;
+ if (fpcr != fpcr_new)
+ _FPU_SETCW (fpcr_new);
+ return 0;
+}
diff --git a/sysdeps/aarch64/fpu/s_fmax.c b/sysdeps/aarch64/fpu/s_fmax.c
index bc41ec44f6..c90de34e90 100644
--- a/sysdeps/aarch64/fpu/s_fmax.c
+++ b/sysdeps/aarch64/fpu/s_fmax.c
@@ -18,4 +18,4 @@
#define FUNC fmax
#define INSN "fmaxnm"
-#include <s_fmin.c>
+#include <fpu/s_fmin.c>
diff --git a/sysdeps/aarch64/fpu/s_fmaxf.c b/sysdeps/aarch64/fpu/s_fmaxf.c
index 6a234bbeaf..fe9d4f35ba 100644
--- a/sysdeps/aarch64/fpu/s_fmaxf.c
+++ b/sysdeps/aarch64/fpu/s_fmaxf.c
@@ -20,4 +20,4 @@
#define INSN "fmaxnm"
#define TYPE float
#define REGS "s"
-#include <s_fmin.c>
+#include <fpu/s_fmin.c>
diff --git a/sysdeps/aarch64/fpu/s_fminf.c b/sysdeps/aarch64/fpu/s_fminf.c
index 78609575bb..97c9839595 100644
--- a/sysdeps/aarch64/fpu/s_fminf.c
+++ b/sysdeps/aarch64/fpu/s_fminf.c
@@ -19,4 +19,4 @@
#define FUNC fminf
#define TYPE float
#define REGS "s"
-#include <s_fmin.c>
+#include <fpu/s_fmin.c>
diff --git a/sysdeps/aarch64/libm-test-ulps-name b/sysdeps/aarch64/libm-test-ulps-name
new file mode 100644
index 0000000000..1f66c5cda0
--- /dev/null
+++ b/sysdeps/aarch64/libm-test-ulps-name
@@ -0,0 +1 @@
+AArch64
diff --git a/sysdeps/aarch64/memchr.S b/sysdeps/aarch64/memchr.S
new file mode 100644
index 0000000000..2f643dda70
--- /dev/null
+++ b/sysdeps/aarch64/memchr.S
@@ -0,0 +1,157 @@
+/* memchr - find a character in a memory zone
+
+ Copyright (C) 2015 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+/* Assumptions:
+ *
+ * ARMv8-a, AArch64
+ * Neon Available.
+ */
+
+/* Arguments and results. */
+#define srcin x0
+#define chrin w1
+#define cntin x2
+
+#define result x0
+
+#define src x3
+#define tmp x4
+#define wtmp2 w5
+#define synd x6
+#define soff x9
+#define cntrem x10
+
+#define vrepchr v0
+#define vdata1 v1
+#define vdata2 v2
+#define vhas_chr1 v3
+#define vhas_chr2 v4
+#define vrepmask v5
+#define vend v6
+
+/*
+ * Core algorithm:
+ *
+ * For each 32-byte chunk we calculate a 64-bit syndrome value, with two bits
+ * per byte. For each tuple, bit 0 is set if the relevant byte matched the
+ * requested character and bit 1 is not used (faster than using a 32bit
+ * syndrome). Since the bits in the syndrome reflect exactly the order in which
+ * things occur in the original string, counting trailing zeros allows to
+ * identify exactly which byte has matched.
+ */
+
+ENTRY (__memchr)
+ /* Do not dereference srcin if no bytes to compare. */
+ cbz cntin, L(zero_length)
+ /*
+ * Magic constant 0x40100401 allows us to identify which lane matches
+ * the requested byte.
+ */
+ mov wtmp2, #0x0401
+ movk wtmp2, #0x4010, lsl #16
+ dup vrepchr.16b, chrin
+ /* Work with aligned 32-byte chunks */
+ bic src, srcin, #31
+ dup vrepmask.4s, wtmp2
+ ands soff, srcin, #31
+ and cntrem, cntin, #31
+ b.eq L(loop)
+
+ /*
+ * Input string is not 32-byte aligned. We calculate the syndrome
+ * value for the aligned 32 bytes block containing the first bytes
+ * and mask the irrelevant part.
+ */
+
+ ld1 {vdata1.16b, vdata2.16b}, [src], #32
+ sub tmp, soff, #32
+ adds cntin, cntin, tmp
+ cmeq vhas_chr1.16b, vdata1.16b, vrepchr.16b
+ cmeq vhas_chr2.16b, vdata2.16b, vrepchr.16b
+ and vhas_chr1.16b, vhas_chr1.16b, vrepmask.16b
+ and vhas_chr2.16b, vhas_chr2.16b, vrepmask.16b
+ addp vend.16b, vhas_chr1.16b, vhas_chr2.16b /* 256->128 */
+ addp vend.16b, vend.16b, vend.16b /* 128->64 */
+ mov synd, vend.2d[0]
+ /* Clear the soff*2 lower bits */
+ lsl tmp, soff, #1
+ lsr synd, synd, tmp
+ lsl synd, synd, tmp
+ /* The first block can also be the last */
+ b.ls L(masklast)
+ /* Have we found something already? */
+ cbnz synd, L(tail)
+
+L(loop):
+ ld1 {vdata1.16b, vdata2.16b}, [src], #32
+ subs cntin, cntin, #32
+ cmeq vhas_chr1.16b, vdata1.16b, vrepchr.16b
+ cmeq vhas_chr2.16b, vdata2.16b, vrepchr.16b
+ /* If we're out of data we finish regardless of the result */
+ b.ls L(end)
+ /* Use a fast check for the termination condition */
+ orr vend.16b, vhas_chr1.16b, vhas_chr2.16b
+ addp vend.2d, vend.2d, vend.2d
+ mov synd, vend.2d[0]
+ /* We're not out of data, loop if we haven't found the character */
+ cbz synd, L(loop)
+
+L(end):
+ /* Termination condition found, let's calculate the syndrome value */
+ and vhas_chr1.16b, vhas_chr1.16b, vrepmask.16b
+ and vhas_chr2.16b, vhas_chr2.16b, vrepmask.16b
+ addp vend.16b, vhas_chr1.16b, vhas_chr2.16b /* 256->128 */
+ addp vend.16b, vend.16b, vend.16b /* 128->64 */
+ mov synd, vend.2d[0]
+ /* Only do the clear for the last possible block */
+ b.hi L(tail)
+
+L(masklast):
+ /* Clear the (32 - ((cntrem + soff) % 32)) * 2 upper bits */
+ add tmp, cntrem, soff
+ and tmp, tmp, #31
+ sub tmp, tmp, #32
+ neg tmp, tmp, lsl #1
+ lsl synd, synd, tmp
+ lsr synd, synd, tmp
+
+L(tail):
+ /* Count the trailing zeros using bit reversing */
+ rbit synd, synd
+ /* Compensate the last post-increment */
+ sub src, src, #32
+ /* Check that we have found a character */
+ cmp synd, #0
+ /* And count the leading zeros */
+ clz synd, synd
+ /* Compute the potential result */
+ add result, src, synd, lsr #1
+ /* Select result or NULL */
+ csel result, xzr, result, eq
+ ret
+
+L(zero_length):
+ mov result, #0
+ ret
+END (__memchr)
+weak_alias (__memchr, memchr)
+libc_hidden_builtin_def (memchr)
diff --git a/sysdeps/aarch64/nptl/bits/pthreadtypes.h b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
index 13984a718d..c376e64dd7 100644
--- a/sysdeps/aarch64/nptl/bits/pthreadtypes.h
+++ b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
@@ -65,6 +65,8 @@ typedef union
unsigned int __count;
int __owner;
unsigned int __nusers;
+ /* KIND must stay at this position in the structure to maintain
+ binary compatibility with static initializers. */
int __kind;
int __spins;
__pthread_list_t __list;
diff --git a/sysdeps/alpha/fpu/bits/fenv.h b/sysdeps/alpha/fpu/bits/fenv.h
index b7da4a0eae..0688898ce7 100644
--- a/sysdeps/alpha/fpu/bits/fenv.h
+++ b/sysdeps/alpha/fpu/bits/fenv.h
@@ -131,3 +131,11 @@ typedef unsigned long int fenv_t;
/* The system calls to talk to the kernel's FP code. */
extern unsigned long int __ieee_get_fp_control (void) __THROW;
extern void __ieee_set_fp_control (unsigned long int __value) __THROW;
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned long int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) 0x8800000000000000UL)
+#endif
diff --git a/sysdeps/alpha/fpu/fegetmode.c b/sysdeps/alpha/fpu/fegetmode.c
new file mode 100644
index 0000000000..f3a6edee96
--- /dev/null
+++ b/sysdeps/alpha/fpu/fegetmode.c
@@ -0,0 +1,33 @@
+/* Store current floating-point control modes. Alpha version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ unsigned long int fpcr;
+ unsigned long int swcr;
+
+ /* As in fegetenv. */
+ swcr = __ieee_get_fp_control ();
+ __asm__ __volatile__ ("mf_fpcr %0" : "=f" (fpcr));
+ *modep = ((fpcr & FPCR_ROUND_MASK) | (swcr & SWCR_ALL_MASK));
+
+ return 0;
+}
diff --git a/sysdeps/alpha/fpu/feholdexcpt.c b/sysdeps/alpha/fpu/feholdexcpt.c
index 019d30b5a2..36bb0514b5 100644
--- a/sysdeps/alpha/fpu/feholdexcpt.c
+++ b/sysdeps/alpha/fpu/feholdexcpt.c
@@ -23,7 +23,7 @@ int
__feholdexcept (fenv_t *envp)
{
/* Save the current state. */
- fegetenv(envp);
+ __fegetenv(envp);
/* Clear all exception status bits and exception enable bits. */
__ieee_set_fp_control(*envp & SWCR_MAP_MASK);
diff --git a/sysdeps/alpha/fpu/fesetexcept.c b/sysdeps/alpha/fpu/fesetexcept.c
new file mode 100644
index 0000000000..5d6904f030
--- /dev/null
+++ b/sysdeps/alpha/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. Alpha version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fesetexcept (int excepts)
+{
+ unsigned long int tmp;
+
+ tmp = __ieee_get_fp_control ();
+ tmp |= excepts & SWCR_STATUS_MASK;
+ __ieee_set_fp_control (tmp);
+
+ return 0;
+}
diff --git a/sysdeps/alpha/fpu/fesetmode.c b/sysdeps/alpha/fpu/fesetmode.c
new file mode 100644
index 0000000000..d4662e16ef
--- /dev/null
+++ b/sysdeps/alpha/fpu/fesetmode.c
@@ -0,0 +1,44 @@
+/* Install given floating-point control modes. Alpha version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+ unsigned long int fpcr;
+ unsigned long int swcr;
+ femode_t mode;
+
+ /* As in fesetenv. */
+ if ((long int) modep >= 0)
+ mode = *modep;
+ else
+ mode = (unsigned long int) modep;
+
+ __asm__ __volatile__ ("excb; mf_fpcr %0" : "=f" (fpcr));
+ fpcr = (fpcr & ~FPCR_ROUND_MASK) | (mode & FPCR_ROUND_MASK);
+ __asm__ __volatile__ ("mt_fpcr %0" : : "f" (fpcr));
+
+ swcr = __ieee_get_fp_control ();
+ swcr = ((mode & SWCR_ALL_MASK & ~SWCR_STATUS_MASK)
+ | (swcr & SWCR_STATUS_MASK));
+ __ieee_set_fp_control (swcr);
+
+ return 0;
+}
diff --git a/sysdeps/alpha/fpu/libm-test-ulps-name b/sysdeps/alpha/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..5219734094
--- /dev/null
+++ b/sysdeps/alpha/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+Alpha
diff --git a/sysdeps/alpha/fpu/s_cacosf.c b/sysdeps/alpha/fpu/s_cacosf.c
index 25e21bb43f..d98ff9c8aa 100644
--- a/sysdeps/alpha/fpu/s_cacosf.c
+++ b/sysdeps/alpha/fpu/s_cacosf.c
@@ -24,11 +24,18 @@
#undef __cacosf
#undef cacosf
-#define __cacosf internal_cacosf
static _Complex float internal_cacosf (_Complex float x);
-#include <math/s_cacosf.c>
+#define M_DECL_FUNC(f) internal_cacosf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cacos_template.c>
+
#include "cfloat-compat.h"
#undef __cacosf
diff --git a/sysdeps/alpha/fpu/s_cacoshf.c b/sysdeps/alpha/fpu/s_cacoshf.c
index 43b6542ce6..06b422f50a 100644
--- a/sysdeps/alpha/fpu/s_cacoshf.c
+++ b/sysdeps/alpha/fpu/s_cacoshf.c
@@ -24,11 +24,17 @@
#undef __cacoshf
#undef cacoshf
-#define __cacoshf internal_cacoshf
static _Complex float internal_cacoshf (_Complex float x);
-#include <math/s_cacoshf.c>
+#define M_DECL_FUNC(f) internal_cacoshf
+#include <math-type-macros-float.h>
+
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cacosh_template.c>
#include "cfloat-compat.h"
#undef __cacoshf
diff --git a/sysdeps/alpha/fpu/s_casinf.c b/sysdeps/alpha/fpu/s_casinf.c
index f85f524c48..08d0a6d167 100644
--- a/sysdeps/alpha/fpu/s_casinf.c
+++ b/sysdeps/alpha/fpu/s_casinf.c
@@ -24,14 +24,18 @@
#undef __casinf
#undef casinf
-#define __casinf internal_casinf
static _Complex float internal_casinf (_Complex float x);
-#include <math/s_casinf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_casinf
+#include <math-type-macros-float.h>
-#undef __casinf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_casin_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_casinf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_casinhf.c b/sysdeps/alpha/fpu/s_casinhf.c
index 720294ea00..11faf9a0ab 100644
--- a/sysdeps/alpha/fpu/s_casinhf.c
+++ b/sysdeps/alpha/fpu/s_casinhf.c
@@ -24,14 +24,18 @@
#undef __casinhf
#undef casinhf
-#define __casinhf internal_casinhf
static _Complex float internal_casinhf (_Complex float x);
-#include <math/s_casinhf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_casinhf
+#include <math-type-macros-float.h>
-#undef __casinhf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_casinh_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_casinhf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_catanf.c b/sysdeps/alpha/fpu/s_catanf.c
index 76c1718dff..ee2443d4a4 100644
--- a/sysdeps/alpha/fpu/s_catanf.c
+++ b/sysdeps/alpha/fpu/s_catanf.c
@@ -24,14 +24,18 @@
#undef __catanf
#undef catanf
-#define __catanf internal_catanf
static _Complex float internal_catanf (_Complex float x);
-#include <math/s_catanf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_catanf
+#include <math-type-macros-float.h>
-#undef __catanf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_catan_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_catanf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_catanhf.c b/sysdeps/alpha/fpu/s_catanhf.c
index 18148ddafb..d9f2d2157f 100644
--- a/sysdeps/alpha/fpu/s_catanhf.c
+++ b/sysdeps/alpha/fpu/s_catanhf.c
@@ -24,14 +24,18 @@
#undef __catanhf
#undef catanhf
-#define __catanhf internal_catanhf
static _Complex float internal_catanhf (_Complex float x);
-#include <math/s_catanhf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_catanhf
+#include <math-type-macros-float.h>
-#undef __catanhf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_catanh_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_catanhf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_ccosf.c b/sysdeps/alpha/fpu/s_ccosf.c
index 886be62edf..2e7d4a2f75 100644
--- a/sysdeps/alpha/fpu/s_ccosf.c
+++ b/sysdeps/alpha/fpu/s_ccosf.c
@@ -24,14 +24,18 @@
#undef __ccosf
#undef ccosf
-#define __ccosf internal_ccosf
static _Complex float internal_ccosf (_Complex float x);
-#include <math/s_ccosf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_ccosf
+#include <math-type-macros-float.h>
-#undef __ccosf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ccos_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_ccosf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_ccoshf.c b/sysdeps/alpha/fpu/s_ccoshf.c
index 16f49de6d4..e5de040e52 100644
--- a/sysdeps/alpha/fpu/s_ccoshf.c
+++ b/sysdeps/alpha/fpu/s_ccoshf.c
@@ -24,14 +24,18 @@
#undef __ccoshf
#undef ccoshf
-#define __ccoshf internal_ccoshf
static _Complex float internal_ccoshf (_Complex float x);
-#include <math/s_ccoshf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_ccoshf
+#include <math-type-macros-float.h>
-#undef __ccoshf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ccosh_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_ccoshf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_cexpf.c b/sysdeps/alpha/fpu/s_cexpf.c
index 2ae519c687..d5b53eb5f6 100644
--- a/sysdeps/alpha/fpu/s_cexpf.c
+++ b/sysdeps/alpha/fpu/s_cexpf.c
@@ -24,14 +24,18 @@
#undef __cexpf
#undef cexpf
-#define __cexpf internal_cexpf
static _Complex float internal_cexpf (_Complex float x);
-#include <math/s_cexpf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_cexpf
+#include <math-type-macros-float.h>
-#undef __cexpf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cexp_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_cexpf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_clog10f.c b/sysdeps/alpha/fpu/s_clog10f.c
index 1ab0730e0e..c46f28819c 100644
--- a/sysdeps/alpha/fpu/s_clog10f.c
+++ b/sysdeps/alpha/fpu/s_clog10f.c
@@ -24,14 +24,18 @@
#undef __clog10f
#undef clog10f
-#define __clog10f internal_clog10f
static _Complex float internal_clog10f (_Complex float x);
-#include <math/s_clog10f.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_clog10f
+#include <math-type-macros-float.h>
-#undef __clog10f
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_clog10_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_clog10f (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_clogf.c b/sysdeps/alpha/fpu/s_clogf.c
index 185948f650..492a305c03 100644
--- a/sysdeps/alpha/fpu/s_clogf.c
+++ b/sysdeps/alpha/fpu/s_clogf.c
@@ -24,14 +24,18 @@
#undef __clogf
#undef clogf
-#define __clogf internal_clogf
static _Complex float internal_clogf (_Complex float x);
-#include <math/s_clogf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_clogf
+#include <math-type-macros-float.h>
-#undef __clogf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_clog_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_clogf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_cpowf.c b/sysdeps/alpha/fpu/s_cpowf.c
index 686c3971f9..4235fe2993 100644
--- a/sysdeps/alpha/fpu/s_cpowf.c
+++ b/sysdeps/alpha/fpu/s_cpowf.c
@@ -24,14 +24,18 @@
#undef __cpowf
#undef cpowf
-#define __cpowf internal_cpowf
static _Complex float internal_cpowf (_Complex float x, _Complex float c);
-#include <math/s_cpowf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_cpowf
+#include <math-type-macros-float.h>
-#undef __cpowf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cpow_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_cpowf (c1_cfloat_decl (x), c1_cfloat_decl (c))
diff --git a/sysdeps/alpha/fpu/s_cprojf.c b/sysdeps/alpha/fpu/s_cprojf.c
index 30a24a8910..3c4e9e918c 100644
--- a/sysdeps/alpha/fpu/s_cprojf.c
+++ b/sysdeps/alpha/fpu/s_cprojf.c
@@ -24,14 +24,18 @@
#undef __cprojf
#undef cprojf
-#define __cprojf internal_cprojf
static _Complex float internal_cprojf (_Complex float x);
-#include <math/s_cprojf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_cprojf
+#include <math-type-macros-float.h>
-#undef __cprojf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_cproj_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_cprojf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_csinf.c b/sysdeps/alpha/fpu/s_csinf.c
index abe2d3ab45..fc49244c10 100644
--- a/sysdeps/alpha/fpu/s_csinf.c
+++ b/sysdeps/alpha/fpu/s_csinf.c
@@ -24,14 +24,18 @@
#undef __csinf
#undef csinf
-#define __csinf internal_csinf
static _Complex float internal_csinf (_Complex float x);
-#include <math/s_csinf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_csinf
+#include <math-type-macros-float.h>
-#undef __csinf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_csin_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_csinf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_csinhf.c b/sysdeps/alpha/fpu/s_csinhf.c
index a6d470a438..6263cd04f0 100644
--- a/sysdeps/alpha/fpu/s_csinhf.c
+++ b/sysdeps/alpha/fpu/s_csinhf.c
@@ -24,14 +24,18 @@
#undef __csinhf
#undef csinhf
-#define __csinhf internal_csinhf
static _Complex float internal_csinhf (_Complex float x);
-#include <math/s_csinhf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_csinhf
+#include <math-type-macros-float.h>
-#undef __csinhf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_csinh_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_csinhf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_csqrtf.c b/sysdeps/alpha/fpu/s_csqrtf.c
index c7a18d75d7..d2f32b9ff0 100644
--- a/sysdeps/alpha/fpu/s_csqrtf.c
+++ b/sysdeps/alpha/fpu/s_csqrtf.c
@@ -24,14 +24,18 @@
#undef __csqrtf
#undef csqrtf
-#define __csqrtf internal_csqrtf
static _Complex float internal_csqrtf (_Complex float x);
-#include <math/s_csqrtf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_csqrtf
+#include <math-type-macros-float.h>
-#undef __csqrtf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_csqrt_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_csqrtf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_ctanf.c b/sysdeps/alpha/fpu/s_ctanf.c
index ee02f31c28..cd5dd910f3 100644
--- a/sysdeps/alpha/fpu/s_ctanf.c
+++ b/sysdeps/alpha/fpu/s_ctanf.c
@@ -24,14 +24,18 @@
#undef __ctanf
#undef ctanf
-#define __ctanf internal_ctanf
static _Complex float internal_ctanf (_Complex float x);
-#include <math/s_ctanf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_ctanf
+#include <math-type-macros-float.h>
-#undef __ctanf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ctan_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_ctanf (c1_cfloat_decl (x))
diff --git a/sysdeps/alpha/fpu/s_ctanhf.c b/sysdeps/alpha/fpu/s_ctanhf.c
index cb99279de6..359f053489 100644
--- a/sysdeps/alpha/fpu/s_ctanhf.c
+++ b/sysdeps/alpha/fpu/s_ctanhf.c
@@ -24,14 +24,18 @@
#undef __ctanhf
#undef ctanhf
-#define __ctanhf internal_ctanhf
static _Complex float internal_ctanhf (_Complex float x);
-#include <math/s_ctanhf.c>
-#include "cfloat-compat.h"
+#define M_DECL_FUNC(f) internal_ctanhf
+#include <math-type-macros-float.h>
-#undef __ctanhf
+/* Disable any aliasing from base template. */
+#undef declare_mgen_alias
+#define declare_mgen_alias(__to, __from)
+
+#include <math/s_ctanh_template.c>
+#include "cfloat-compat.h"
c1_cfloat_rettype
__c1_ctanhf (c1_cfloat_decl (x))
diff --git a/sysdeps/arm/bits/fenv.h b/sysdeps/arm/bits/fenv.h
index 8e89fc1819..c82fecb48f 100644
--- a/sysdeps/arm/bits/fenv.h
+++ b/sysdeps/arm/bits/fenv.h
@@ -80,3 +80,11 @@ fenv_t;
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/arm/e_sqrt.c b/sysdeps/arm/e_sqrt.c
new file mode 100644
index 0000000000..8ba85ed260
--- /dev/null
+++ b/sysdeps/arm/e_sqrt.c
@@ -0,0 +1,45 @@
+/* Compute square root for double. ARM version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifdef __SOFTFP__
+
+/* Use architecture-indendent sqrt implementation. */
+# include <sysdeps/ieee754/dbl-64/e_sqrt.c>
+
+#else
+
+/* Use VFP square root instruction. */
+# include <math.h>
+# include <sysdep.h>
+
+double
+__ieee754_sqrt (double x)
+{
+ double ret;
+# if __ARM_ARCH >= 6
+ asm ("vsqrt.f64 %P0, %P1" : "=w" (ret) : "w" (x));
+# else
+ /* As in GCC, for VFP9 Erratum 760019 avoid overwriting the
+ input. */
+ asm ("vsqrt.f64 %P0, %P1" : "=&w" (ret) : "w" (x));
+# endif
+ return ret;
+}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
+
+#endif
diff --git a/sysdeps/arm/e_sqrtf.c b/sysdeps/arm/e_sqrtf.c
new file mode 100644
index 0000000000..282f7c3cfb
--- /dev/null
+++ b/sysdeps/arm/e_sqrtf.c
@@ -0,0 +1,45 @@
+/* Compute square root for float. ARM version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifdef __SOFTFP__
+
+/* Use architecture-indendent sqrtf implementation. */
+# include <sysdeps/ieee754/flt-32/e_sqrtf.c>
+
+#else
+
+/* Use VFP square root instruction. */
+# include <math.h>
+# include <sysdep.h>
+
+float
+__ieee754_sqrtf (float x)
+{
+ float ret;
+# if __ARM_ARCH >= 6
+ asm ("vsqrt.f32 %0, %1" : "=t" (ret) : "t" (x));
+# else
+ /* As in GCC, for VFP9 Erratum 760019 avoid overwriting the
+ input. */
+ asm ("vsqrt.f32 %0, %1" : "=&t" (ret) : "t" (x));
+# endif
+ return ret;
+}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+
+#endif
diff --git a/sysdeps/arm/fegetmode.c b/sysdeps/arm/fegetmode.c
new file mode 100644
index 0000000000..1307f5390c
--- /dev/null
+++ b/sysdeps/arm/fegetmode.c
@@ -0,0 +1,29 @@
+/* Store current floating-point control modes. ARM version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <arm-features.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ if (ARM_HAVE_VFP)
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/sysdeps/arm/fesetexcept.c b/sysdeps/arm/fesetexcept.c
new file mode 100644
index 0000000000..96a79aef77
--- /dev/null
+++ b/sysdeps/arm/fesetexcept.c
@@ -0,0 +1,38 @@
+/* Set given exception flags. ARM version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <arm-features.h>
+
+int
+fesetexcept (int excepts)
+{
+ fpu_control_t fpscr, new_fpscr;
+
+ /* Fail if a VFP unit isn't present unless nothing needs to be done. */
+ if (!ARM_HAVE_VFP)
+ return (excepts != 0);
+
+ _FPU_GETCW (fpscr);
+ new_fpscr = fpscr | (excepts & FE_ALL_EXCEPT);
+ if (new_fpscr != fpscr)
+ _FPU_SETCW (new_fpscr);
+
+ return 0;
+}
diff --git a/sysdeps/arm/fesetmode.c b/sysdeps/arm/fesetmode.c
new file mode 100644
index 0000000000..e96c845841
--- /dev/null
+++ b/sysdeps/arm/fesetmode.c
@@ -0,0 +1,45 @@
+/* Install given floating-point control modes. ARM version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <arm-features.h>
+
+/* NZCV flags, QC bit, IDC bit and bits for IEEE exception status. */
+#define FPU_STATUS_BITS 0xf800009f
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t fpscr, new_fpscr;
+
+ if (!ARM_HAVE_VFP)
+ /* Nothing to do. */
+ return 0;
+
+ _FPU_GETCW (fpscr);
+ if (modep == FE_DFL_MODE)
+ new_fpscr = (fpscr & (_FPU_RESERVED | FPU_STATUS_BITS)) | _FPU_DEFAULT;
+ else
+ new_fpscr = (fpscr & FPU_STATUS_BITS) | (*modep & ~FPU_STATUS_BITS);
+
+ if (((new_fpscr ^ fpscr) & ~_FPU_MASK_NZCV) != 0)
+ _FPU_SETCW (new_fpscr);
+
+ return 0;
+}
diff --git a/sysdeps/arm/libm-test-ulps-name b/sysdeps/arm/libm-test-ulps-name
new file mode 100644
index 0000000000..74f9acfffa
--- /dev/null
+++ b/sysdeps/arm/libm-test-ulps-name
@@ -0,0 +1 @@
+ARM
diff --git a/sysdeps/arm/nacl/include/bits/setjmp.h b/sysdeps/arm/nacl/include/bits/setjmp.h
index 6b6a235871..e1fe5059a3 100644
--- a/sysdeps/arm/nacl/include/bits/setjmp.h
+++ b/sysdeps/arm/nacl/include/bits/setjmp.h
@@ -24,6 +24,8 @@
# include <sysdeps/arm/bits/setjmp.h>
#endif
+# ifndef _ISOMAC
+
/* Register list for a ldm/stm instruction to load/store
the general registers from a __jmp_buf.
@@ -35,4 +37,5 @@
/* Index of __jmp_buf where the sp register resides. */
#define __JMP_BUF_SP 0
+# endif /* _ISOMAC */
#endif /* include/bits/setjmp.h */
diff --git a/sysdeps/arm/nacl/libc.abilist b/sysdeps/arm/nacl/libc.abilist
index 4d3b0b9fe3..807e43d935 100644
--- a/sysdeps/arm/nacl/libc.abilist
+++ b/sysdeps/arm/nacl/libc.abilist
@@ -1846,3 +1846,6 @@ GLIBC_2.25 GLIBC_2.25 A
GLIBC_2.25 gnu_dev_major F
GLIBC_2.25 gnu_dev_makedev F
GLIBC_2.25 gnu_dev_minor F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/arm/nptl/bits/pthreadtypes.h b/sysdeps/arm/nptl/bits/pthreadtypes.h
index afb5392c8f..645207bf41 100644
--- a/sysdeps/arm/nptl/bits/pthreadtypes.h
+++ b/sysdeps/arm/nptl/bits/pthreadtypes.h
@@ -64,7 +64,7 @@ typedef union
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
unsigned int __nusers;
__extension__ union
diff --git a/sysdeps/arm/sys/ucontext.h b/sysdeps/arm/sys/ucontext.h
index 744cb538cf..28bf860100 100644
--- a/sysdeps/arm/sys/ucontext.h
+++ b/sysdeps/arm/sys/ucontext.h
@@ -23,6 +23,12 @@
#include <features.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+
typedef int greg_t;
/* Number of general registers. */
diff --git a/sysdeps/generic/fix-fp-int-compare-invalid.h b/sysdeps/generic/fix-fp-int-compare-invalid.h
new file mode 100644
index 0000000000..42e3d1241b
--- /dev/null
+++ b/sysdeps/generic/fix-fp-int-compare-invalid.h
@@ -0,0 +1,27 @@
+/* Fix for missing "invalid" exceptions from floating-point
+ comparisons. Generic version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H 1
+
+/* Define this macro to 1 to work around ordered comparison operators
+ in C failing to raise the "invalid" exception for NaN operands. */
+#define FIX_COMPARE_INVALID 0
+
+#endif /* fix-fp-int-compare-invalid.h */
diff --git a/sysdeps/generic/libm-test-ulps-name b/sysdeps/generic/libm-test-ulps-name
new file mode 100644
index 0000000000..8470d61195
--- /dev/null
+++ b/sysdeps/generic/libm-test-ulps-name
@@ -0,0 +1 @@
+Generic
diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h
index 974dda403a..52f4eaee4e 100644
--- a/sysdeps/generic/math-tests.h
+++ b/sysdeps/generic/math-tests.h
@@ -41,6 +41,14 @@
# define SNAN_TESTS_TYPE_CAST 1
#endif
+/* Indicate whether operations on signaling NaNs preserve the payload
+ (if possible; it is not possible with a zero payload if the high
+ bit is set for signaling NaNs) when generating a quiet NaN, and
+ this should be tested. */
+#ifndef SNAN_TESTS_PRESERVE_PAYLOAD
+# define SNAN_TESTS_PRESERVE_PAYLOAD 1
+#endif
+
/* Indicate whether to run tests involving a given rounding mode for a
given floating-point type, given that fesetround succeeds for that
mode. All are run if fesetround succeeds unless overridden. */
diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h
new file mode 100644
index 0000000000..6d0f20635a
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-double.h
@@ -0,0 +1,50 @@
+/* Helper macros for double variants of type generic functions of libm.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_TYPE_MACROS_DOUBLE
+#define _MATH_TYPE_MACROS_DOUBLE
+
+#define M_LIT(c) c
+#define M_MLIT(c) c
+#define M_PFX DBL
+#define M_SUF(c) c
+#define FLOAT double
+#define CFLOAT _Complex double
+#define M_STRTO_NAN __strtod_nan
+
+/* Machines without a distinct long double type
+ alias long double functions to their double
+ equivalent. */
+#if defined NO_LONG_DOUBLE && !defined declare_mgen_alias
+# define declare_mgen_alias(from, to) \
+ weak_alias (from, to) \
+ strong_alias (from, from ## l) \
+ weak_alias (from, to ## l)
+#endif
+
+#if defined NO_LONG_DOUBLE && !defined declare_mgen_alias_2
+# define declare_mgen_alias_2(from, to, to2) \
+ declare_mgen_alias (from, to) \
+ weak_alias (from, to2) \
+ weak_alias (from, to2 ## l)
+#endif
+
+/* Supply the generic macros. */
+#include <math-type-macros.h>
+
+#endif
diff --git a/sysdeps/generic/math-type-macros-float.h b/sysdeps/generic/math-type-macros-float.h
new file mode 100644
index 0000000000..33f51304a1
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-float.h
@@ -0,0 +1,36 @@
+/* Helper macros for float variants of type generic functions of libm.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_TYPE_MACROS_FLOAT
+#define _MATH_TYPE_MACROS_FLOAT
+
+#define M_LIT(c) c ## f
+#define M_PFX FLT
+#define M_SUF(c) c ## f
+#define FLOAT float
+#define CFLOAT _Complex float
+#define M_STRTO_NAN __strtof_nan
+
+/* Standard/GNU macro literals do not exist for the float type. Use
+ the double macro constants. */
+#define M_MLIT(c) c
+
+/* Supply the generic macros. */
+#include <math-type-macros.h>
+
+#endif
diff --git a/sysdeps/generic/math-type-macros-ldouble.h b/sysdeps/generic/math-type-macros-ldouble.h
new file mode 100644
index 0000000000..4f959da05f
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-ldouble.h
@@ -0,0 +1,33 @@
+/* Helper macros for long double variants of type generic functions of libm.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_TYPE_MACROS_LDOUBLE
+#define _MATH_TYPE_MACROS_LDOUBLE
+
+#define M_LIT(c) c ## L
+#define M_MLIT(c) c ## l
+#define M_PFX LDBL
+#define M_SUF(c) c ## l
+#define FLOAT long double
+#define CFLOAT _Complex long double
+#define M_STRTO_NAN __strtold_nan
+
+/* Supply the generic macros. */
+#include <math-type-macros.h>
+
+#endif
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
new file mode 100644
index 0000000000..c2488ec600
--- /dev/null
+++ b/sysdeps/generic/math-type-macros.h
@@ -0,0 +1,136 @@
+/* Helper macros for type generic function implementations within libm.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_TYPE_MACROS
+#define _MATH_TYPE_MACROS
+
+/* Each type imports a header which is expected to
+ define:
+
+ M_LIT(x) - Paste the type specific suffix onto the constant x.
+ M_MLIT(x) - Paste the type specific suffix used by the macro
+ constants in math.h, i.e M_PI or M_PIl.
+ M_PFX - The prefixed used by float.h macros like FLT_MANT_DIG.
+ M_SUF(x) - Paste the the type specific suffix used by functions
+ i.e expf expl exp.
+ FLOAT - Resolves to the C typename of M_TYPE.
+ CFLOAT - Resolves to the complex typename of M_TYPE.
+ M_STRTO_NAN - Resolves to the internal libc function which
+ converts a string into the appropriate FLOAT nan
+ value.
+
+ Optionally, these headers may inject a non-standard
+ definition for the following:
+
+ declare_mgen_alias(from,to)
+ This exposes the appropriate symbol(s) for a
+ function f of type FLOAT.
+
+ declare_mgen_alias_2(from,to,to2)
+ This exposes the appropriate symbol(s) for a
+ function f of type FLOAT when it is aliased
+ to two symbols.
+
+ M_LIBM_NEED_COMPAT(func)
+ This is utilized in macro context to indicate
+ whether func should declare compat symbols.
+
+ declare_mgen_libm_compat(from,to)
+ This is used in conjunction with the above macro
+ outside of macro context to paste whatever is
+ required to generate a compat symbol. */
+
+#ifndef M_PFX
+# error "M_PFX must be defined."
+#endif
+#ifndef M_LIT
+# error "M_LIT must be defined."
+#endif
+#ifndef M_MLIT
+# error "M_MLIT must be defined."
+#endif
+#ifndef M_SUF
+# error "M_SUF must be defined."
+#endif
+#ifndef FLOAT
+# error "FLOAT must be defined."
+#endif
+#ifndef CFLOAT
+# error "CFLOAT must be defined."
+#endif
+
+#define __M_CONCAT(a,b) a ## b
+#define __M_CONCATX(a,b) __M_CONCAT(a,b)
+
+#define M_NAN M_SUF (__builtin_nan) ("")
+#define M_MAX_EXP __M_CONCATX (M_PFX, _MAX_EXP)
+#define M_MIN __M_CONCATX (M_PFX, _MIN)
+#define M_MAX __M_CONCATX (M_PFX, _MAX)
+#define M_MANT_DIG __M_CONCATX (M_PFX, _MANT_DIG)
+#define M_HUGE_VAL (M_SUF (__builtin_huge_val) ())
+
+/* Helper macros for commonly used functions. */
+#define M_COPYSIGN M_SUF (__copysign)
+#define M_FABS M_SUF (fabs)
+#define M_SINCOS M_SUF (__sincos)
+#define M_SCALBN M_SUF (__scalbn)
+#define M_LOG1P M_SUF (__log1p)
+
+#define M_ATAN2 M_SUF (__ieee754_atan2)
+#define M_COSH M_SUF (__ieee754_cosh)
+#define M_EXP M_SUF (__ieee754_exp)
+#define M_HYPOT M_SUF (__ieee754_hypot)
+#define M_LOG M_SUF (__ieee754_log)
+#define M_SINH M_SUF (__ieee754_sinh)
+#define M_SQRT M_SUF (__ieee754_sqrt)
+
+/* Needed to evaluate M_MANT_DIG below. */
+#include <float.h>
+
+/* Use a special epsilon value for IBM long double
+ to avoid spurious overflows/underflows. */
+#if M_MANT_DIG != 106
+# define M_EPSILON __M_CONCATX (M_PFX, _EPSILON)
+#else
+# define M_EPSILON M_LIT (0x1p-106)
+#endif
+
+/* Enable overloading of function name to assist reuse. */
+#ifndef M_DECL_FUNC
+# define M_DECL_FUNC(f) M_SUF (f)
+#endif
+
+/* If the type does not declare special aliasing, use the default. */
+#ifndef declare_mgen_alias
+# define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
+#endif
+
+/* Likewise, if two aliases are derived from the same symbol. */
+#ifndef declare_mgen_alias_2
+# define declare_mgen_alias_2(from, to, to2) \
+ declare_mgen_alias (from, to) \
+ declare_mgen_alias (from, to2)
+#endif
+
+/* Do not generate anything for compat symbols by default. */
+#ifndef M_LIBM_NEED_COMPAT
+# define M_LIBM_NEED_COMPAT(func) 0
+# define declare_mgen_libm_compat(from, to)
+#endif
+
+#endif /* _MATH_TYPE_MACROS */
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index cf1865dac8..28e5df0a24 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -317,8 +317,6 @@ extern long double __kernel_cosl (long double,long double);
extern long double __kernel_tanl (long double,long double,int);
extern void __kernel_sincosl (long double,long double,
long double *,long double *, int);
-extern int __kernel_rem_pio2l (long double*,long double*,int,int,
- int,const int*);
#ifndef NO_LONG_DOUBLE
/* prototypes required to compile the ldbl-96 support without warnings */
@@ -777,11 +775,4 @@ libc_feresetround_noex_ctx (struct rm_ctx *ctx)
SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_53bit, \
libc_feresetround_53bit)
-#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/sysdeps/generic/nan-high-order-bit.h b/sysdeps/generic/nan-high-order-bit.h
new file mode 100644
index 0000000000..15619153cf
--- /dev/null
+++ b/sysdeps/generic/nan-high-order-bit.h
@@ -0,0 +1,27 @@
+/* Specify NaN high-order bit conventions. Generic version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef NAN_HIGH_ORDER_BIT_H
+#define NAN_HIGH_ORDER_BIT_H 1
+
+/* Define this macro to 1 if the high-order bit of a NaN's mantissa is
+ set for signaling NaNs and clear for quiet NaNs, 0 otherwise (the
+ preferred IEEE convention). */
+#define HIGH_ORDER_BIT_IS_SET_FOR_SNAN 0
+
+#endif /* nan-high-order-bit.h */
diff --git a/sysdeps/generic/netinet/if_ether.h b/sysdeps/generic/netinet/if_ether.h
index c106a41c82..6d02536bd4 100644
--- a/sysdeps/generic/netinet/if_ether.h
+++ b/sysdeps/generic/netinet/if_ether.h
@@ -26,7 +26,7 @@
systems. */
struct ether_addr
{
- u_int8_t ether_addr_octet[ETH_ALEN];
+ uint8_t ether_addr_octet[ETH_ALEN];
} __attribute__ ((__packed__));
#endif /* netinet/if_ether.h */
diff --git a/sysdeps/generic/netinet/in_systm.h b/sysdeps/generic/netinet/in_systm.h
index 41704ee40a..7b9a92be41 100644
--- a/sysdeps/generic/netinet/in_systm.h
+++ b/sysdeps/generic/netinet/in_systm.h
@@ -19,8 +19,8 @@
#ifndef _NETINET_IN_SYSTM_H
#define _NETINET_IN_SYSTM_H 1
-#include <sys/cdefs.h>
#include <sys/types.h>
+#include <stdint.h>
__BEGIN_DECLS
@@ -31,9 +31,9 @@ __BEGIN_DECLS
* may not reflect the actual size of the native data types.
*/
-typedef u_int16_t n_short; /* short as received from the net */
-typedef u_int32_t n_long; /* long as received from the net */
-typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
+typedef uint16_t n_short; /* short as received from the net */
+typedef uint32_t n_long; /* long as received from the net */
+typedef uint32_t n_time; /* ms since 00:00 GMT, byte rev */
__END_DECLS
diff --git a/sysdeps/generic/netinet/ip.h b/sysdeps/generic/netinet/ip.h
index 557a460d71..5f16c9a2bd 100644
--- a/sysdeps/generic/netinet/ip.h
+++ b/sysdeps/generic/netinet/ip.h
@@ -27,8 +27,8 @@ __BEGIN_DECLS
struct timestamp
{
- u_int8_t len;
- u_int8_t ptr;
+ uint8_t len;
+ uint8_t ptr;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned int flags:4;
unsigned int overflow:4;
@@ -38,7 +38,7 @@ struct timestamp
#else
# error "Please fix <bits/endian.h>"
#endif
- u_int32_t data[9];
+ uint32_t data[9];
};
struct iphdr
@@ -52,15 +52,15 @@ struct iphdr
#else
# error "Please fix <bits/endian.h>"
#endif
- u_int8_t tos;
- u_int16_t tot_len;
- u_int16_t id;
- u_int16_t frag_off;
- u_int8_t ttl;
- u_int8_t protocol;
- u_int16_t check;
- u_int32_t saddr;
- u_int32_t daddr;
+ uint8_t tos;
+ uint16_t tot_len;
+ uint16_t id;
+ uint16_t frag_off;
+ uint8_t ttl;
+ uint8_t protocol;
+ uint16_t check;
+ uint32_t saddr;
+ uint32_t daddr;
/*The options start here. */
};
@@ -114,17 +114,17 @@ struct ip
unsigned int ip_v:4; /* version */
unsigned int ip_hl:4; /* header length */
#endif
- u_int8_t ip_tos; /* type of service */
- u_short ip_len; /* total length */
- u_short ip_id; /* identification */
- u_short ip_off; /* fragment offset field */
+ uint8_t ip_tos; /* type of service */
+ unsigned short ip_len; /* total length */
+ unsigned short ip_id; /* identification */
+ unsigned short ip_off; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- u_int8_t ip_ttl; /* time to live */
- u_int8_t ip_p; /* protocol */
- u_short ip_sum; /* checksum */
+ uint8_t ip_ttl; /* time to live */
+ uint8_t ip_p; /* protocol */
+ unsigned short ip_sum; /* checksum */
struct in_addr ip_src, ip_dst; /* source and dest address */
};
@@ -133,9 +133,9 @@ struct ip
*/
struct ip_timestamp
{
- u_int8_t ipt_code; /* IPOPT_TS */
- u_int8_t ipt_len; /* size of structure (variable) */
- u_int8_t ipt_ptr; /* index of current entry */
+ uint8_t ipt_code; /* IPOPT_TS */
+ uint8_t ipt_len; /* size of structure (variable) */
+ uint8_t ipt_ptr; /* index of current entry */
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned int ipt_flg:4; /* flags, see below */
unsigned int ipt_oflw:4; /* overflow counter */
@@ -144,7 +144,7 @@ struct ip_timestamp
unsigned int ipt_oflw:4; /* overflow counter */
unsigned int ipt_flg:4; /* flags, see below */
#endif
- u_int32_t data[9];
+ uint32_t data[9];
};
#endif /* __USE_MISC */
diff --git a/sysdeps/generic/netinet/tcp.h b/sysdeps/generic/netinet/tcp.h
index 0d71903309..49f1bfbc26 100644
--- a/sysdeps/generic/netinet/tcp.h
+++ b/sysdeps/generic/netinet/tcp.h
@@ -43,42 +43,42 @@ typedef unsigned int tcp_seq;
* Per RFC 793, September, 1981.
*/
struct tcphdr {
- u_short th_sport; /* source port */
- u_short th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
+ unsigned short th_sport; /* source port */
+ unsigned short th_dport; /* destination port */
+ tcp_seq th_seq; /* sequence number */
+ tcp_seq th_ack; /* acknowledgement number */
#if __BYTE_ORDER == __LITTLE_ENDIAN
- u_char th_x2:4, /* (unused) */
- th_off:4; /* data offset */
+ unsigned char th_x2:4, /* (unused) */
+ th_off:4; /* data offset */
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
- u_char th_off:4, /* data offset */
- th_x2:4; /* (unused) */
+ unsigned char th_off:4, /* data offset */
+ th_x2:4; /* (unused) */
#endif
- u_char th_flags;
+ unsigned char th_flags;
#define TH_FIN 0x01
#define TH_SYN 0x02
#define TH_RST 0x04
#define TH_PUSH 0x08
#define TH_ACK 0x10
#define TH_URG 0x20
- u_short th_win; /* window */
- u_short th_sum; /* checksum */
- u_short th_urp; /* urgent pointer */
+ unsigned short th_win; /* window */
+ unsigned short th_sum; /* checksum */
+ unsigned short th_urp; /* urgent pointer */
};
#define TCPOPT_EOL 0
#define TCPOPT_NOP 1
#define TCPOPT_MAXSEG 2
-#define TCPOLEN_MAXSEG 4
+#define TCPOLEN_MAXSEG 4
#define TCPOPT_WINDOW 3
-#define TCPOLEN_WINDOW 3
+#define TCPOLEN_WINDOW 3
#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
-#define TCPOLEN_SACK_PERMITTED 2
+#define TCPOLEN_SACK_PERMITTED 2
#define TCPOPT_SACK 5 /* Experimental */
#define TCPOPT_TIMESTAMP 8
-#define TCPOLEN_TIMESTAMP 10
-#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
+#define TCPOLEN_TIMESTAMP 10
+#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
#define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 442762728b..8e4347c623 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -22,7 +22,8 @@
#ifndef _STDINT_H
#define _STDINT_H 1
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
#include <bits/wchar.h>
#include <bits/wordsize.h>
@@ -248,8 +249,13 @@ typedef unsigned long long int uintmax_t;
# define PTRDIFF_MIN (-9223372036854775807L-1)
# define PTRDIFF_MAX (9223372036854775807L)
# else
-# define PTRDIFF_MIN (-2147483647-1)
-# define PTRDIFF_MAX (2147483647)
+# if __WORDSIZE32_PTRDIFF_LONG
+# define PTRDIFF_MIN (-2147483647L-1)
+# define PTRDIFF_MAX (2147483647L)
+# else
+# define PTRDIFF_MIN (-2147483647-1)
+# define PTRDIFF_MAX (2147483647)
+# endif
# endif
/* Limits of `sig_atomic_t'. */
@@ -260,7 +266,7 @@ typedef unsigned long long int uintmax_t;
# if __WORDSIZE == 64
# define SIZE_MAX (18446744073709551615UL)
# else
-# ifdef __WORDSIZE32_SIZE_ULONG
+# if __WORDSIZE32_SIZE_ULONG
# define SIZE_MAX (4294967295UL)
# else
# define SIZE_MAX (4294967295U)
@@ -307,4 +313,47 @@ typedef unsigned long long int uintmax_t;
# define UINTMAX_C(c) c ## ULL
# endif
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+
+# define INT8_WIDTH 8
+# define UINT8_WIDTH 8
+# define INT16_WIDTH 16
+# define UINT16_WIDTH 16
+# define INT32_WIDTH 32
+# define UINT32_WIDTH 32
+# define INT64_WIDTH 64
+# define UINT64_WIDTH 64
+
+# define INT_LEAST8_WIDTH 8
+# define UINT_LEAST8_WIDTH 8
+# define INT_LEAST16_WIDTH 16
+# define UINT_LEAST16_WIDTH 16
+# define INT_LEAST32_WIDTH 32
+# define UINT_LEAST32_WIDTH 32
+# define INT_LEAST64_WIDTH 64
+# define UINT_LEAST64_WIDTH 64
+
+# define INT_FAST8_WIDTH 8
+# define UINT_FAST8_WIDTH 8
+# define INT_FAST16_WIDTH __WORDSIZE
+# define UINT_FAST16_WIDTH __WORDSIZE
+# define INT_FAST32_WIDTH __WORDSIZE
+# define UINT_FAST32_WIDTH __WORDSIZE
+# define INT_FAST64_WIDTH 64
+# define UINT_FAST64_WIDTH 64
+
+# define INTPTR_WIDTH __WORDSIZE
+# define UINTPTR_WIDTH __WORDSIZE
+
+# define INTMAX_WIDTH 64
+# define UINTMAX_WIDTH 64
+
+# define PTRDIFF_WIDTH __WORDSIZE
+# define SIG_ATOMIC_WIDTH 32
+# define SIZE_WIDTH __WORDSIZE
+# define WCHAR_WIDTH 32
+# define WINT_WIDTH 32
+
+#endif
+
#endif /* stdint.h */
diff --git a/sysdeps/generic/sys/ucontext.h b/sysdeps/generic/sys/ucontext.h
index f08cec04cc..b5ec972a91 100644
--- a/sysdeps/generic/sys/ucontext.h
+++ b/sysdeps/generic/sys/ucontext.h
@@ -25,9 +25,11 @@
#include <features.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
typedef struct sigcontext mcontext_t;
diff --git a/sysdeps/gnu/bits/utmp.h b/sysdeps/gnu/bits/utmp.h
index 2a1ffcbf6f..bce1a7ba5f 100644
--- a/sysdeps/gnu/bits/utmp.h
+++ b/sysdeps/gnu/bits/utmp.h
@@ -35,7 +35,7 @@
previous logins. */
struct lastlog
{
-#ifdef __WORDSIZE_TIME64_COMPAT32
+#if __WORDSIZE_TIME64_COMPAT32
int32_t ll_time;
#else
__time_t ll_time;
@@ -68,7 +68,7 @@ struct utmp
/* The ut_session and ut_tv fields must be the same size when compiled
32- and 64-bit. This allows data files and shared memory to be
shared between 32- and 64-bit applications. */
-#ifdef __WORDSIZE_TIME64_COMPAT32
+#if __WORDSIZE_TIME64_COMPAT32
int32_t ut_session; /* Session ID, used for windowing. */
struct
{
diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h
index b41548b24c..a438660ae9 100644
--- a/sysdeps/gnu/bits/utmpx.h
+++ b/sysdeps/gnu/bits/utmpx.h
@@ -66,7 +66,7 @@ struct utmpx
/* The fields ut_session and ut_tv must be the same size when compiled
32- and 64-bit. This allows files and shared memory to be shared
between 32- and 64-bit applications. */
-#ifdef __WORDSIZE_TIME64_COMPAT32
+#if __WORDSIZE_TIME64_COMPAT32
__int32_t ut_session; /* Session ID, used for windowing. */
struct
{
diff --git a/sysdeps/gnu/netinet/ip_icmp.h b/sysdeps/gnu/netinet/ip_icmp.h
index 4f7c1b1b60..542e789e2a 100644
--- a/sysdeps/gnu/netinet/ip_icmp.h
+++ b/sysdeps/gnu/netinet/ip_icmp.h
@@ -18,28 +18,28 @@
#ifndef __NETINET_IP_ICMP_H
#define __NETINET_IP_ICMP_H 1
-#include <sys/cdefs.h>
#include <sys/types.h>
+#include <stdint.h>
__BEGIN_DECLS
struct icmphdr
{
- u_int8_t type; /* message type */
- u_int8_t code; /* type sub-code */
- u_int16_t checksum;
+ uint8_t type; /* message type */
+ uint8_t code; /* type sub-code */
+ uint16_t checksum;
union
{
struct
{
- u_int16_t id;
- u_int16_t sequence;
+ uint16_t id;
+ uint16_t sequence;
} echo; /* echo datagram */
- u_int32_t gateway; /* gateway address */
+ uint32_t gateway; /* gateway address */
struct
{
- u_int16_t __glibc_reserved;
- u_int16_t mtu;
+ uint16_t __glibc_reserved;
+ uint16_t mtu;
} frag; /* path mtu discovery */
} un;
};
@@ -130,38 +130,38 @@ struct icmphdr
*/
struct icmp_ra_addr
{
- u_int32_t ira_addr;
- u_int32_t ira_preference;
+ uint32_t ira_addr;
+ uint32_t ira_preference;
};
struct icmp
{
- u_int8_t icmp_type; /* type of message, see below */
- u_int8_t icmp_code; /* type sub code */
- u_int16_t icmp_cksum; /* ones complement checksum of struct */
+ uint8_t icmp_type; /* type of message, see below */
+ uint8_t icmp_code; /* type sub code */
+ uint16_t icmp_cksum; /* ones complement checksum of struct */
union
{
- u_char ih_pptr; /* ICMP_PARAMPROB */
+ unsigned char ih_pptr; /* ICMP_PARAMPROB */
struct in_addr ih_gwaddr; /* gateway address */
struct ih_idseq /* echo datagram */
{
- u_int16_t icd_id;
- u_int16_t icd_seq;
+ uint16_t icd_id;
+ uint16_t icd_seq;
} ih_idseq;
- u_int32_t ih_void;
+ uint32_t ih_void;
/* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
struct ih_pmtu
{
- u_int16_t ipm_void;
- u_int16_t ipm_nextmtu;
+ uint16_t ipm_void;
+ uint16_t ipm_nextmtu;
} ih_pmtu;
struct ih_rtradv
{
- u_int8_t irt_num_addrs;
- u_int8_t irt_wpa;
- u_int16_t irt_lifetime;
+ uint8_t irt_num_addrs;
+ uint8_t irt_wpa;
+ uint16_t irt_lifetime;
} ih_rtradv;
} icmp_hun;
#define icmp_pptr icmp_hun.ih_pptr
@@ -178,9 +178,9 @@ struct icmp
{
struct
{
- u_int32_t its_otime;
- u_int32_t its_rtime;
- u_int32_t its_ttime;
+ uint32_t its_otime;
+ uint32_t its_rtime;
+ uint32_t its_ttime;
} id_ts;
struct
{
@@ -188,8 +188,8 @@ struct icmp
/* options and then 64 bits of data */
} id_ip;
struct icmp_ra_addr id_radv;
- u_int32_t id_mask;
- u_int8_t id_data[1];
+ uint32_t id_mask;
+ uint8_t id_data[1];
} icmp_dun;
#define icmp_otime icmp_dun.id_ts.its_otime
#define icmp_rtime icmp_dun.id_ts.its_rtime
diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
index 3918bcac4f..241bdc70db 100644
--- a/sysdeps/gnu/netinet/tcp.h
+++ b/sysdeps/gnu/netinet/tcp.h
@@ -69,12 +69,14 @@
connections. */
#define TCP_SAVED_SYN 28 /* Get SYN headers recorded for
connection. */
+#define TCP_REPAIR_WINDOW 29 /* Get/set window parameters. */
#ifdef __USE_MISC
# include <sys/types.h>
# include <sys/socket.h>
+# include <stdint.h>
-typedef u_int32_t tcp_seq;
+typedef uint32_t tcp_seq;
/*
* TCP header.
* Per RFC 793, September, 1981.
@@ -85,61 +87,61 @@ struct tcphdr
{
struct
{
- u_int16_t th_sport; /* source port */
- u_int16_t th_dport; /* destination port */
+ uint16_t th_sport; /* source port */
+ uint16_t th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
# if __BYTE_ORDER == __LITTLE_ENDIAN
- u_int8_t th_x2:4; /* (unused) */
- u_int8_t th_off:4; /* data offset */
+ uint8_t th_x2:4; /* (unused) */
+ uint8_t th_off:4; /* data offset */
# endif
# if __BYTE_ORDER == __BIG_ENDIAN
- u_int8_t th_off:4; /* data offset */
- u_int8_t th_x2:4; /* (unused) */
+ uint8_t th_off:4; /* data offset */
+ uint8_t th_x2:4; /* (unused) */
# endif
- u_int8_t th_flags;
+ uint8_t th_flags;
# define TH_FIN 0x01
# define TH_SYN 0x02
# define TH_RST 0x04
# define TH_PUSH 0x08
# define TH_ACK 0x10
# define TH_URG 0x20
- u_int16_t th_win; /* window */
- u_int16_t th_sum; /* checksum */
- u_int16_t th_urp; /* urgent pointer */
+ uint16_t th_win; /* window */
+ uint16_t th_sum; /* checksum */
+ uint16_t th_urp; /* urgent pointer */
};
struct
{
- u_int16_t source;
- u_int16_t dest;
- u_int32_t seq;
- u_int32_t ack_seq;
+ uint16_t source;
+ uint16_t dest;
+ uint32_t seq;
+ uint32_t ack_seq;
# if __BYTE_ORDER == __LITTLE_ENDIAN
- u_int16_t res1:4;
- u_int16_t doff:4;
- u_int16_t fin:1;
- u_int16_t syn:1;
- u_int16_t rst:1;
- u_int16_t psh:1;
- u_int16_t ack:1;
- u_int16_t urg:1;
- u_int16_t res2:2;
+ uint16_t res1:4;
+ uint16_t doff:4;
+ uint16_t fin:1;
+ uint16_t syn:1;
+ uint16_t rst:1;
+ uint16_t psh:1;
+ uint16_t ack:1;
+ uint16_t urg:1;
+ uint16_t res2:2;
# elif __BYTE_ORDER == __BIG_ENDIAN
- u_int16_t doff:4;
- u_int16_t res1:4;
- u_int16_t res2:2;
- u_int16_t urg:1;
- u_int16_t ack:1;
- u_int16_t psh:1;
- u_int16_t rst:1;
- u_int16_t syn:1;
- u_int16_t fin:1;
+ uint16_t doff:4;
+ uint16_t res1:4;
+ uint16_t res2:2;
+ uint16_t urg:1;
+ uint16_t ack:1;
+ uint16_t psh:1;
+ uint16_t rst:1;
+ uint16_t syn:1;
+ uint16_t fin:1;
# else
# error "Adjust your <bits/endian.h> defines"
# endif
- u_int16_t window;
- u_int16_t check;
- u_int16_t urg_ptr;
+ uint16_t window;
+ uint16_t check;
+ uint16_t urg_ptr;
};
};
};
@@ -209,45 +211,45 @@ enum tcp_ca_state
struct tcp_info
{
- u_int8_t tcpi_state;
- u_int8_t tcpi_ca_state;
- u_int8_t tcpi_retransmits;
- u_int8_t tcpi_probes;
- u_int8_t tcpi_backoff;
- u_int8_t tcpi_options;
- u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
-
- u_int32_t tcpi_rto;
- u_int32_t tcpi_ato;
- u_int32_t tcpi_snd_mss;
- u_int32_t tcpi_rcv_mss;
-
- u_int32_t tcpi_unacked;
- u_int32_t tcpi_sacked;
- u_int32_t tcpi_lost;
- u_int32_t tcpi_retrans;
- u_int32_t tcpi_fackets;
+ uint8_t tcpi_state;
+ uint8_t tcpi_ca_state;
+ uint8_t tcpi_retransmits;
+ uint8_t tcpi_probes;
+ uint8_t tcpi_backoff;
+ uint8_t tcpi_options;
+ uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+ uint32_t tcpi_rto;
+ uint32_t tcpi_ato;
+ uint32_t tcpi_snd_mss;
+ uint32_t tcpi_rcv_mss;
+
+ uint32_t tcpi_unacked;
+ uint32_t tcpi_sacked;
+ uint32_t tcpi_lost;
+ uint32_t tcpi_retrans;
+ uint32_t tcpi_fackets;
/* Times. */
- u_int32_t tcpi_last_data_sent;
- u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
- u_int32_t tcpi_last_data_recv;
- u_int32_t tcpi_last_ack_recv;
+ uint32_t tcpi_last_data_sent;
+ uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
+ uint32_t tcpi_last_data_recv;
+ uint32_t tcpi_last_ack_recv;
/* Metrics. */
- u_int32_t tcpi_pmtu;
- u_int32_t tcpi_rcv_ssthresh;
- u_int32_t tcpi_rtt;
- u_int32_t tcpi_rttvar;
- u_int32_t tcpi_snd_ssthresh;
- u_int32_t tcpi_snd_cwnd;
- u_int32_t tcpi_advmss;
- u_int32_t tcpi_reordering;
-
- u_int32_t tcpi_rcv_rtt;
- u_int32_t tcpi_rcv_space;
-
- u_int32_t tcpi_total_retrans;
+ uint32_t tcpi_pmtu;
+ uint32_t tcpi_rcv_ssthresh;
+ uint32_t tcpi_rtt;
+ uint32_t tcpi_rttvar;
+ uint32_t tcpi_snd_ssthresh;
+ uint32_t tcpi_snd_cwnd;
+ uint32_t tcpi_advmss;
+ uint32_t tcpi_reordering;
+
+ uint32_t tcpi_rcv_rtt;
+ uint32_t tcpi_rcv_space;
+
+ uint32_t tcpi_total_retrans;
};
@@ -257,17 +259,17 @@ struct tcp_info
struct tcp_md5sig
{
struct sockaddr_storage tcpm_addr; /* Address associated. */
- u_int16_t __tcpm_pad1; /* Zero. */
- u_int16_t tcpm_keylen; /* Key length. */
- u_int32_t __tcpm_pad2; /* Zero. */
- u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */
+ uint16_t __tcpm_pad1; /* Zero. */
+ uint16_t tcpm_keylen; /* Key length. */
+ uint32_t __tcpm_pad2; /* Zero. */
+ uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */
};
/* For socket repair options. */
struct tcp_repair_opt
{
- u_int32_t opt_code;
- u_int32_t opt_val;
+ uint32_t opt_code;
+ uint32_t opt_val;
};
/* Queue to repair, for TCP_REPAIR_QUEUE. */
@@ -298,12 +300,22 @@ enum
struct tcp_cookie_transactions
{
- u_int16_t tcpct_flags;
- u_int8_t __tcpct_pad1;
- u_int8_t tcpct_cookie_desired;
- u_int16_t tcpct_s_data_desired;
- u_int16_t tcpct_used;
- u_int8_t tcpct_value[TCP_MSS_DEFAULT];
+ uint16_t tcpct_flags;
+ uint8_t __tcpct_pad1;
+ uint8_t tcpct_cookie_desired;
+ uint16_t tcpct_s_data_desired;
+ uint16_t tcpct_used;
+ uint8_t tcpct_value[TCP_MSS_DEFAULT];
+};
+
+/* For use with TCP_REPAIR_WINDOW. */
+struct tcp_repair_window
+{
+ uint32_t snd_wl1;
+ uint32_t snd_wnd;
+ uint32_t max_window;
+ uint32_t rcv_wnd;
+ uint32_t rcv_wup;
};
#endif /* Misc. */
diff --git a/sysdeps/gnu/netinet/udp.h b/sysdeps/gnu/netinet/udp.h
index e3d4492c8a..d5f60e499c 100644
--- a/sysdeps/gnu/netinet/udp.h
+++ b/sysdeps/gnu/netinet/udp.h
@@ -47,9 +47,8 @@
#ifndef __NETINET_UDP_H
#define __NETINET_UDP_H 1
-#include <features.h>
#include <sys/types.h>
-
+#include <stdint.h>
/* UDP header as specified by RFC 768, August 1980. */
@@ -59,17 +58,17 @@ struct udphdr
{
struct
{
- u_int16_t uh_sport; /* source port */
- u_int16_t uh_dport; /* destination port */
- u_int16_t uh_ulen; /* udp length */
- u_int16_t uh_sum; /* udp checksum */
+ uint16_t uh_sport; /* source port */
+ uint16_t uh_dport; /* destination port */
+ uint16_t uh_ulen; /* udp length */
+ uint16_t uh_sum; /* udp checksum */
};
struct
{
- u_int16_t source;
- u_int16_t dest;
- u_int16_t len;
- u_int16_t check;
+ uint16_t source;
+ uint16_t dest;
+ uint16_t len;
+ uint16_t check;
};
};
};
diff --git a/sysdeps/hppa/fpu/bits/fenv.h b/sysdeps/hppa/fpu/bits/fenv.h
index cae9daeb04..e35e3553f9 100644
--- a/sysdeps/hppa/fpu/bits/fenv.h
+++ b/sysdeps/hppa/fpu/bits/fenv.h
@@ -89,3 +89,11 @@ typedef struct
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/hppa/fpu/fegetmode.c b/sysdeps/hppa/fpu/fegetmode.c
new file mode 100644
index 0000000000..b307495365
--- /dev/null
+++ b/sysdeps/hppa/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. HPPA version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/sysdeps/hppa/fpu/fesetexcept.c b/sysdeps/hppa/fpu/fesetexcept.c
new file mode 100644
index 0000000000..f1eb2e52b6
--- /dev/null
+++ b/sysdeps/hppa/fpu/fesetexcept.c
@@ -0,0 +1,35 @@
+/* Set given exception flags. HPPA version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexcept (int excepts)
+{
+ fpu_control_t fpsr;
+ fpu_control_t fpsr_new;
+
+ _FPU_GETCW (fpsr);
+ excepts &= FE_ALL_EXCEPT;
+ fpsr_new = fpsr | (excepts << _FPU_HPPA_SHIFT_FLAGS);
+ if (fpsr != fpsr_new)
+ _FPU_SETCW (fpsr_new);
+
+ return 0;
+}
diff --git a/sysdeps/hppa/fpu/fesetmode.c b/sysdeps/hppa/fpu/fesetmode.c
new file mode 100644
index 0000000000..6416dabf66
--- /dev/null
+++ b/sysdeps/hppa/fpu/fesetmode.c
@@ -0,0 +1,36 @@
+/* Install given floating-point control modes. HPPA version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+#define FPU_CONTROL_BITS (_FPU_HPPA_MASK_RM | 0x20 | _FPU_HPPA_MASK_INT)
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t cw;
+ _FPU_GETCW (cw);
+ cw &= ~FPU_CONTROL_BITS;
+ if (modep == FE_DFL_MODE)
+ cw |= _FPU_DEFAULT;
+ else
+ cw |= *modep & FPU_CONTROL_BITS;
+ _FPU_SETCW (cw);
+ return 0;
+}
diff --git a/sysdeps/hppa/fpu/libm-test-ulps-name b/sysdeps/hppa/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..808d1bc741
--- /dev/null
+++ b/sysdeps/hppa/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+HPPA
diff --git a/sysdeps/hppa/nan-high-order-bit.h b/sysdeps/hppa/nan-high-order-bit.h
new file mode 100644
index 0000000000..a63d6a789a
--- /dev/null
+++ b/sysdeps/hppa/nan-high-order-bit.h
@@ -0,0 +1,27 @@
+/* Specify NaN high-order bit conventions. HPPA version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef NAN_HIGH_ORDER_BIT_H
+#define NAN_HIGH_ORDER_BIT_H 1
+
+/* One of the few architectures where the meaning of the
+ quiet/signaling bit is inverse to IEEE 754-2008 (as well as common
+ practice for IEEE 754-1985). */
+#define HIGH_ORDER_BIT_IS_SET_FOR_SNAN 1
+
+#endif /* nan-high-order-bit.h */
diff --git a/sysdeps/hppa/nptl/bits/pthreadtypes.h b/sysdeps/hppa/nptl/bits/pthreadtypes.h
index 540802a70c..d0c1d58439 100644
--- a/sysdeps/hppa/nptl/bits/pthreadtypes.h
+++ b/sysdeps/hppa/nptl/bits/pthreadtypes.h
@@ -71,7 +71,7 @@ typedef union
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
/* The old 4-word 16-byte aligned lock. This is initalized
to all ones by the Linuxthreads PTHREAD_MUTEX_INITIALIZER.
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 4e3968a8aa..e5ad0c513d 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -321,7 +321,23 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
0)
&& __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
&& __builtin_expect (!skip_ifunc, 1))
- value = ((Elf32_Addr (*) (void)) value) ();
+ {
+# ifndef RTLD_BOOTSTRAP
+ if (sym_map != map
+ && sym_map->l_type != lt_executable
+ && !sym_map->l_relocated)
+ {
+ const char *strtab
+ = (const char *) D_PTR (map, l_info[DT_STRTAB]);
+ _dl_fatal_printf ("\
+%s: Relink `%s' with `%s' for IFUNC symbol `%s'\n",
+ RTLD_PROGNAME, map->l_name,
+ sym_map->l_name,
+ strtab + refsym->st_name);
+ }
+# endif
+ value = ((Elf32_Addr (*) (void)) value) ();
+ }
switch (r_type)
{
diff --git a/sysdeps/i386/fpu/fegetmode.c b/sysdeps/i386/fpu/fegetmode.c
new file mode 100644
index 0000000000..06d4d84768
--- /dev/null
+++ b/sysdeps/i386/fpu/fegetmode.c
@@ -0,0 +1,32 @@
+/* Store current floating-point control modes. i386 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <unistd.h>
+#include <ldsodefs.h>
+#include <dl-procinfo.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (modep->__control_word);
+ if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ __asm__ ("stmxcsr %0" : "=m" (modep->__mxcsr));
+ return 0;
+}
diff --git a/sysdeps/i386/fpu/fesetexcept.c b/sysdeps/i386/fpu/fesetexcept.c
new file mode 100644
index 0000000000..eeb0c7f90b
--- /dev/null
+++ b/sysdeps/i386/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. i386 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fesetexcept (int excepts)
+{
+ fenv_t temp;
+
+ __asm__ ("fnstenv %0" : "=m" (*&temp));
+ temp.__status_word |= excepts & FE_ALL_EXCEPT;
+ __asm__ ("fldenv %0" : : "m" (*&temp));
+
+ return 0;
+}
diff --git a/sysdeps/i386/fpu/fesetmode.c b/sysdeps/i386/fpu/fesetmode.c
new file mode 100644
index 0000000000..cca5a1ad0c
--- /dev/null
+++ b/sysdeps/i386/fpu/fesetmode.c
@@ -0,0 +1,54 @@
+/* Install given floating-point control modes. i386 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <unistd.h>
+#include <ldsodefs.h>
+#include <dl-procinfo.h>
+
+/* All exceptions, including the x86-specific "denormal operand"
+ exception. */
+#define FE_ALL_EXCEPT_X86 (FE_ALL_EXCEPT | __FE_DENORM)
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t cw;
+ if (modep == FE_DFL_MODE)
+ cw = _FPU_DEFAULT;
+ else
+ cw = modep->__control_word;
+ _FPU_SETCW (cw);
+ if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
+ {
+ unsigned int mxcsr;
+ __asm__ ("stmxcsr %0" : "=m" (mxcsr));
+ /* Preserve SSE exception flags but restore other state in
+ MXCSR. */
+ mxcsr &= FE_ALL_EXCEPT_X86;
+ if (modep == FE_DFL_MODE)
+ /* Default MXCSR state has all bits zero except for those
+ masking exceptions. */
+ mxcsr |= FE_ALL_EXCEPT_X86 << 7;
+ else
+ mxcsr |= modep->__mxcsr & ~FE_ALL_EXCEPT_X86;
+ __asm__ ("ldmxcsr %0" : : "m" (mxcsr));
+ }
+ return 0;
+}
diff --git a/sysdeps/i386/fpu/k_rem_pio2l.c b/sysdeps/i386/fpu/k_rem_pio2l.c
deleted file mode 100644
index 1347b0468c..0000000000
--- a/sysdeps/i386/fpu/k_rem_pio2l.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/sysdeps/i386/fpu/libm-test-ulps-name b/sysdeps/i386/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..54ca0d8295
--- /dev/null
+++ b/sysdeps/i386/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+ix86
diff --git a/sysdeps/i386/i686/Makefile b/sysdeps/i386/i686/Makefile
index e3a3201c4b..311042787b 100644
--- a/sysdeps/i386/i686/Makefile
+++ b/sysdeps/i386/i686/Makefile
@@ -4,11 +4,9 @@ stack-align-test-flags += -msse
CFLAGS-.o += -Wa,-mtune=i686
CFLAGS-.os += -Wa,-mtune=i686
CFLAGS-.op += -Wa,-mtune=i686
-CFLAGS-.og += -Wa,-mtune=i686
CFLAGS-.oS += -Wa,-mtune=i686
ASFLAGS-.o += -Wa,-mtune=i686
ASFLAGS-.os += -Wa,-mtune=i686
ASFLAGS-.op += -Wa,-mtune=i686
-ASFLAGS-.og += -Wa,-mtune=i686
ASFLAGS-.oS += -Wa,-mtune=i686
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name
new file mode 100644
index 0000000000..193dd704b3
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name
@@ -0,0 +1 @@
+i686
diff --git a/sysdeps/i386/sys/ucontext.h b/sysdeps/i386/sys/ucontext.h
index d08e1a7f56..882173ba57 100644
--- a/sysdeps/i386/sys/ucontext.h
+++ b/sysdeps/i386/sys/ucontext.h
@@ -23,6 +23,12 @@
#include <features.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+
/* Type for general register. */
typedef int greg_t;
diff --git a/sysdeps/ia64/bits/fenv.h b/sysdeps/ia64/bits/fenv.h
index 9bb20de27b..5945380889 100644
--- a/sysdeps/ia64/bits/fenv.h
+++ b/sysdeps/ia64/bits/fenv.h
@@ -94,3 +94,11 @@ typedef unsigned long int fenv_t;
s0, s2, and s3. */
# define FE_NONIEEE_ENV ((const fenv_t *) 0xc009a04d0270037fUL)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned long int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) 0xc009804c0270033fUL)
+#endif
diff --git a/sysdeps/ia64/fpu/fegetmode.c b/sysdeps/ia64/fpu/fegetmode.c
new file mode 100644
index 0000000000..0ccaa8f3ac
--- /dev/null
+++ b/sysdeps/ia64/fpu/fegetmode.c
@@ -0,0 +1,26 @@
+/* Store current floating-point control modes. IA64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (*modep));
+ return 0;
+}
diff --git a/sysdeps/ia64/fpu/fesetexcept.c b/sysdeps/ia64/fpu/fesetexcept.c
new file mode 100644
index 0000000000..d6004b6cb5
--- /dev/null
+++ b/sysdeps/ia64/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. IA64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fesetexcept (int excepts)
+{
+ fenv_t fpsr;
+
+ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));
+ fpsr |= ((excepts & FE_ALL_EXCEPT) << 13);
+ __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr) : "memory");
+
+ return 0;
+}
diff --git a/sysdeps/ia64/fpu/fesetmode.c b/sysdeps/ia64/fpu/fesetmode.c
new file mode 100644
index 0000000000..11187e9c89
--- /dev/null
+++ b/sysdeps/ia64/fpu/fesetmode.c
@@ -0,0 +1,42 @@
+/* Install given floating-point control modes. IA64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+#define FPSR_STATUS 0x1f80UL
+#define FPSR_STATUS_ALL ((FPSR_STATUS << 6) | (FPSR_STATUS << 19) \
+ | (FPSR_STATUS << 32) | (FPSR_STATUS << 45))
+
+int
+fesetmode (const femode_t *modep)
+{
+ femode_t mode;
+
+ /* As in fesetenv. */
+ if (((fenv_t) modep >> 62) == 0x03)
+ mode = (femode_t) modep & 0x3fffffffffffffffUL;
+ else
+ mode = *modep;
+
+ femode_t fpsr;
+ __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));
+ fpsr = (fpsr & FPSR_STATUS_ALL) | (mode & ~FPSR_STATUS_ALL);
+ __asm__ __volatile__ ("mov.m ar.fpsr=%0;;" :: "r" (fpsr));
+
+ return 0;
+}
diff --git a/sysdeps/ia64/fpu/k_rem_pio2l.c b/sysdeps/ia64/fpu/k_rem_pio2l.c
deleted file mode 100644
index 41254ae60a..0000000000
--- a/sysdeps/ia64/fpu/k_rem_pio2l.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/ia64/fpu/libm-test-ulps-name b/sysdeps/ia64/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..54a0dfffea
--- /dev/null
+++ b/sysdeps/ia64/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+IA64
diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile
index 48f1327446..4bc1a18d0c 100644
--- a/sysdeps/ia64/nptl/Makefile
+++ b/sysdeps/ia64/nptl/Makefile
@@ -20,5 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
endif
ifeq ($(subdir),nptl)
-libpthread-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
+libpthread-routines += sysdep sigblock sigprocmask
+libpthread-shared-only-routines += sysdep sigblock sigprocmask
endif
diff --git a/sysdeps/ia64/nptl/bits/pthreadtypes.h b/sysdeps/ia64/nptl/bits/pthreadtypes.h
index f2e6dacf98..0e8388374f 100644
--- a/sysdeps/ia64/nptl/bits/pthreadtypes.h
+++ b/sysdeps/ia64/nptl/bits/pthreadtypes.h
@@ -64,7 +64,7 @@ typedef union
int __owner;
unsigned int __nusers;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
int __spins;
__pthread_list_t __list;
diff --git a/sysdeps/ieee754/dbl-64/dla.h b/sysdeps/ieee754/dbl-64/dla.h
index d21c47a68f..d64e630a52 100644
--- a/sysdeps/ieee754/dbl-64/dla.h
+++ b/sysdeps/ieee754/dbl-64/dla.h
@@ -57,6 +57,10 @@
z=(x)-(y); zz=(fabs(x)>fabs(y)) ? (((x)-(z))-(y)) : ((x)-((y)+(z)));
+#ifdef __FP_FAST_FMA
+# define DLA_FMS(x, y, z) __builtin_fma (x, y, -(z))
+#endif
+
/* Exact multiplication of two single-length floating point numbers, */
/* Veltkamp. The macro produces a double-length number (z,zz) that */
/* satisfies z+zz = x*y exactly. p,hx,tx,hy,ty are temporary */
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 663fa392c2..bd758b5979 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -466,15 +466,15 @@ checkint (double x)
return (n & 1) ? -1 : 1; /* odd or even */
if (k > 20)
{
- if (n << (k - 20))
+ if (n << (k - 20) != 0)
return 0; /* if not integer */
- return (n << (k - 21)) ? -1 : 1;
+ return (n << (k - 21) != 0) ? -1 : 1;
}
if (n)
return 0; /*if not integer */
if (k == 20)
return (m & 1) ? -1 : 1;
- if (m << (k + 12))
+ if (m << (k + 12) != 0)
return 0;
- return (m << (k + 11)) ? -1 : 1;
+ return (m << (k + 11) != 0) ? -1 : 1;
}
diff --git a/sysdeps/ieee754/dbl-64/gamma_product.c b/sysdeps/ieee754/dbl-64/gamma_product.c
index 7ae144aeb3..51407b196c 100644
--- a/sysdeps/ieee754/dbl-64/gamma_product.c
+++ b/sysdeps/ieee754/dbl-64/gamma_product.c
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_split.h>
/* Compute the product of X + X_EPS, X + X_EPS + 1, ..., X + X_EPS + N
- 1, in the form R * (1 + *EPS) where the return value R is an
diff --git a/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index e58c9e854c..d853b65a05 100644
--- a/sysdeps/ieee754/dbl-64/k_rem_pio2.c
+++ b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
@@ -132,6 +132,7 @@ static char rcsid[] = "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $
#include <math.h>
#include <math_private.h>
+#include <libc-internal.h>
static const int init_jk[] = {2,3,4,6}; /* initial value for jk */
@@ -251,8 +252,17 @@ recompute:
j |= iq[i];
if (j == 0) /* need recomputation */
{
+ /* On s390x gcc 6.1 -O3 produces the warning "array subscript is below
+ array bounds [-Werror=array-bounds]". Only __ieee754_rem_pio2l
+ calls __kernel_rem_pio2 for normal numbers and |x| > pi/4 in case
+ of ldbl-96 and |x| > 3pi/4 in case of ldbl-128[ibm].
+ Thus x can't be zero and ipio2 is not zero, too. Thus not all iq[]
+ values can't be zero. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (6.1, "-Warray-bounds");
for (k = 1; iq[jk - k] == 0; k++)
; /* k = no. of terms needed */
+ DIAG_POP_NEEDS_COMMENT;
for (i = jz + 1; i <= jz + k; i++) /* add q[jz+1] to q[jz+k] */
{
diff --git a/sysdeps/ieee754/dbl-64/lgamma_product.c b/sysdeps/ieee754/dbl-64/lgamma_product.c
index d956575bc7..fa89337ebc 100644
--- a/sysdeps/ieee754/dbl-64/lgamma_product.c
+++ b/sysdeps/ieee754/dbl-64/lgamma_product.c
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_split.h>
/* Compute the product of 1 + (T / (X + X_EPS)), 1 + (T / (X + X_EPS +
1)), ..., 1 + (T / (X + X_EPS + N - 1)), minus 1. X is such that
diff --git a/sysdeps/ieee754/dbl-64/s_getpayload.c b/sysdeps/ieee754/dbl-64/s_getpayload.c
new file mode 100644
index 0000000000..2e7f03375f
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_getpayload.c
@@ -0,0 +1,37 @@
+/* Get NaN payload. dbl-64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fix-int-fp-convert-zero.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+double
+getpayload (const double *x)
+{
+ uint32_t hx, lx;
+ EXTRACT_WORDS (hx, lx, *x);
+ hx &= 0x7ffff;
+ uint64_t ix = ((uint64_t) hx << 32) | lx;
+ if (FIX_INT_FP_CONVERT_ZERO && ix == 0)
+ return 0.0f;
+ return (double) ix;
+}
+#ifdef NO_LONG_DOUBLE
+weak_alias (getpayload, getpayloadl)
+#endif
diff --git a/sysdeps/ieee754/dbl-64/s_issignaling.c b/sysdeps/ieee754/dbl-64/s_issignaling.c
index 4b93d6ae60..0b845e244e 100644
--- a/sysdeps/ieee754/dbl-64/s_issignaling.c
+++ b/sysdeps/ieee754/dbl-64/s_issignaling.c
@@ -18,11 +18,12 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignaling (double x)
{
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
u_int32_t hxi;
GET_HIGH_WORD (hxi, x);
/* We only have to care about the high-order bit of x's significand, because
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index 7c9a07990f..96b21cfdcc 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -132,8 +132,8 @@ double __mpcos (double x, double dx, bool reduce_range);
static double slow (double x);
static double slow1 (double x);
static double slow2 (double x);
-static double sloww (double x, double dx, double orig, int n);
-static double sloww1 (double x, double dx, double orig, int m, int n);
+static double sloww (double x, double dx, double orig, bool shift_quadrant);
+static double sloww1 (double x, double dx, double orig, bool shift_quadrant);
static double sloww2 (double x, double dx, double orig, int n);
static double bsloww (double x, double dx, double orig, int n);
static double bsloww1 (double x, double dx, double orig, int n);
@@ -141,14 +141,22 @@ static double bsloww2 (double x, double dx, double orig, int n);
int __branred (double x, double *a, double *aa);
static double cslow2 (double x);
-/* Given a number partitioned into U and X such that U is an index into the
- sin/cos table, this macro computes the cosine of the number by combining
- the sin and cos of X (as computed by a variation of the Taylor series) with
- the values looked up from the sin/cos table to get the result in RES and a
- correction value in COR. */
-static double
-do_cos (mynumber u, double x, double *corp)
+/* Given a number partitioned into X and DX, this function computes the cosine
+ of the number by combining the sin and cos of X (as computed by a variation
+ of the Taylor series) with the values looked up from the sin/cos table to
+ get the result in RES and a correction value in COR. */
+static inline double
+__always_inline
+do_cos (double x, double dx, double *corp)
{
+ mynumber u;
+
+ if (x < 0)
+ dx = -dx;
+
+ u.x = big + fabs (x);
+ x = fabs (x) - (u.x - big) + dx;
+
double xx, s, sn, ssn, c, cs, ccs, res, cor;
xx = x * x;
s = x + x * xx * (sn3 + xx * sn5);
@@ -161,11 +169,20 @@ do_cos (mynumber u, double x, double *corp)
return res;
}
-/* A more precise variant of DO_COS where the number is partitioned into U, X
- and DX. EPS is the adjustment to the correction COR. */
-static double
-do_cos_slow (mynumber u, double x, double dx, double eps, double *corp)
+/* A more precise variant of DO_COS. EPS is the adjustment to the correction
+ COR. */
+static inline double
+__always_inline
+do_cos_slow (double x, double dx, double eps, double *corp)
{
+ mynumber u;
+
+ if (x <= 0)
+ dx = -dx;
+
+ u.x = big + fabs (x);
+ x = fabs (x) - (u.x - big);
+
double xx, y, x1, x2, e1, e2, res, cor;
double s, sn, ssn, c, cs, ccs;
xx = x * x;
@@ -181,22 +198,26 @@ do_cos_slow (mynumber u, double x, double dx, double eps, double *corp)
cor = cor + ((cs - y) - e1 * x1);
res = y + cor;
cor = (y - res) + cor;
- if (cor > 0)
- cor = 1.0005 * cor + eps;
- else
- cor = 1.0005 * cor - eps;
+ cor = 1.0005 * cor + __copysign (eps, cor);
*corp = cor;
return res;
}
-/* Given a number partitioned into U and X and DX such that U is an index into
- the sin/cos table, this macro computes the sine of the number by combining
- the sin and cos of X (as computed by a variation of the Taylor series) with
- the values looked up from the sin/cos table to get the result in RES and a
- correction value in COR. */
-static double
-do_sin (mynumber u, double x, double dx, double *corp)
+/* Given a number partitioned into X and DX, this function computes the sine of
+ the number by combining the sin and cos of X (as computed by a variation of
+ the Taylor series) with the values looked up from the sin/cos table to get
+ the result in RES and a correction value in COR. */
+static inline double
+__always_inline
+do_sin (double x, double dx, double *corp)
{
+ mynumber u;
+
+ if (x <= 0)
+ dx = -dx;
+ u.x = big + fabs (x);
+ x = fabs (x) - (u.x - big);
+
double xx, s, sn, ssn, c, cs, ccs, cor, res;
xx = x * x;
s = x + (dx + x * xx * (sn3 + xx * sn5));
@@ -209,11 +230,19 @@ do_sin (mynumber u, double x, double dx, double *corp)
return res;
}
-/* A more precise variant of res = do_sin where the number is partitioned into U, X
- and DX. EPS is the adjustment to the correction COR. */
-static double
-do_sin_slow (mynumber u, double x, double dx, double eps, double *corp)
+/* A more precise variant of DO_SIN. EPS is the adjustment to the correction
+ COR. */
+static inline double
+__always_inline
+do_sin_slow (double x, double dx, double eps, double *corp)
{
+ mynumber u;
+
+ if (x <= 0)
+ dx = -dx;
+ u.x = big + fabs (x);
+ x = fabs (x) - (u.x - big);
+
double xx, y, x1, x2, c1, c2, res, cor;
double s, sn, ssn, c, cs, ccs;
xx = x * x;
@@ -229,43 +258,38 @@ do_sin_slow (mynumber u, double x, double dx, double eps, double *corp)
cor = cor + ((sn - y) + c1 * x1);
res = y + cor;
cor = (y - res) + cor;
- if (cor > 0)
- cor = 1.0005 * cor + eps;
- else
- cor = 1.0005 * cor - eps;
+ cor = 1.0005 * cor + __copysign (eps, cor);
*corp = cor;
return res;
}
-/* Reduce range of X and compute sin of a + da. K is the amount by which to
- rotate the quadrants. This allows us to use the same routine to compute cos
- by simply rotating the quadrants by 1. */
+/* Reduce range of X and compute sin of a + da. When SHIFT_QUADRANT is true,
+ the routine returns the cosine of a + da by rotating the quadrant once and
+ computing the sine of the result. */
static inline double
__always_inline
-reduce_and_compute (double x, unsigned int k)
+reduce_and_compute (double x, bool shift_quadrant)
{
double retval = 0, a, da;
unsigned int n = __branred (x, &a, &da);
- k = (n + k) % 4;
+ int4 k = (n + shift_quadrant) % 4;
switch (k)
{
- case 0:
- if (a * a < 0.01588)
- retval = bsloww (a, da, x, n);
- else
- retval = bsloww1 (a, da, x, n);
- break;
- case 2:
- if (a * a < 0.01588)
- retval = bsloww (-a, -da, x, n);
- else
- retval = bsloww1 (-a, -da, x, n);
- break;
-
- case 1:
- case 3:
- retval = bsloww2 (a, da, x, n);
- break;
+ case 2:
+ a = -a;
+ da = -da;
+ /* Fall through. */
+ case 0:
+ if (a * a < 0.01588)
+ retval = bsloww (a, da, x, n);
+ else
+ retval = bsloww1 (a, da, x, n);
+ break;
+
+ case 1:
+ case 3:
+ retval = bsloww2 (a, da, x, n);
+ break;
}
return retval;
}
@@ -291,63 +315,45 @@ reduce_sincos_1 (double x, double *a, double *da)
return n;
}
-/* Compute sin (A + DA). cos can be computed by shifting the quadrant N
- clockwise. */
+/* Compute sin (A + DA). cos can be computed by passing SHIFT_QUADRANT as
+ true, which results in shifting the quadrant N clockwise. */
static double
__always_inline
-do_sincos_1 (double a, double da, double x, int4 n, int4 k)
+do_sincos_1 (double a, double da, double x, int4 n, bool shift_quadrant)
{
- double xx, retval, res, cor, y;
- mynumber u;
- int m;
+ double xx, retval, res, cor;
double eps = fabs (x) * 1.2e-30;
- int k1 = (n + k) & 3;
+ int k1 = (n + shift_quadrant) & 3;
switch (k1)
{ /* quarter of unit circle */
case 2:
a = -a;
da = -da;
+ /* Fall through. */
case 0:
xx = a * a;
if (xx < 0.01588)
{
/* Taylor series. */
res = TAYLOR_SIN (xx, a, da, cor);
- cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
- retval = (res == res + cor) ? res : sloww (a, da, x, k);
+ cor = 1.02 * cor + __copysign (eps, cor);
+ retval = (res == res + cor) ? res : sloww (a, da, x, shift_quadrant);
}
else
{
- if (a > 0)
- m = 1;
- else
- {
- m = 0;
- a = -a;
- da = -da;
- }
- u.x = big + a;
- y = a - (u.x - big);
- res = do_sin (u, y, da, &cor);
- cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
- retval = ((res == res + cor) ? ((m) ? res : -res)
- : sloww1 (a, da, x, m, k));
+ res = do_sin (a, da, &cor);
+ cor = 1.035 * cor + __copysign (eps, cor);
+ retval = ((res == res + cor) ? __copysign (res, a)
+ : sloww1 (a, da, x, shift_quadrant));
}
break;
case 1:
case 3:
- if (a < 0)
- {
- a = -a;
- da = -da;
- }
- u.x = big + a;
- y = a - (u.x - big) + da;
- res = do_cos (u, y, &cor);
- cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
- retval = ((res == res + cor) ? ((k1 & 2) ? -res : res)
+ res = do_cos (a, da, &cor);
+ cor = 1.025 * cor + __copysign (eps, cor);
+ retval = ((res == res + cor) ? ((n & 2) ? -res : res)
: sloww2 (a, da, x, n));
break;
}
@@ -381,18 +387,17 @@ reduce_sincos_2 (double x, double *a, double *da)
return n;
}
-/* Compute sin (A + DA). cos can be computed by shifting the quadrant N
- clockwise. */
+/* Compute sin (A + DA). cos can be computed by passing SHIFT_QUADRANT as
+ true, which results in shifting the quadrant N clockwise. */
static double
__always_inline
-do_sincos_2 (double a, double da, double x, int4 n, int4 k)
+do_sincos_2 (double a, double da, double x, int4 n, bool shift_quadrant)
{
double res, retval, cor, xx;
- mynumber u;
double eps = 1.0e-24;
- k = (n + k) & 3;
+ int4 k = (n + shift_quadrant) & 3;
switch (k)
{
@@ -406,45 +411,22 @@ do_sincos_2 (double a, double da, double x, int4 n, int4 k)
{
/* Taylor series. */
res = TAYLOR_SIN (xx, a, da, cor);
- cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
+ cor = 1.02 * cor + __copysign (eps, cor);
retval = (res == res + cor) ? res : bsloww (a, da, x, n);
}
else
{
- double t, db, y;
- int m;
- if (a > 0)
- {
- m = 1;
- t = a;
- db = da;
- }
- else
- {
- m = 0;
- t = -a;
- db = -da;
- }
- u.x = big + t;
- y = t - (u.x - big);
- res = do_sin (u, y, db, &cor);
- cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
- retval = ((res == res + cor) ? ((m) ? res : -res)
+ res = do_sin (a, da, &cor);
+ cor = 1.035 * cor + __copysign (eps, cor);
+ retval = ((res == res + cor) ? __copysign (res, a)
: bsloww1 (a, da, x, n));
}
break;
case 1:
case 3:
- if (a < 0)
- {
- a = -a;
- da = -da;
- }
- u.x = big + a;
- double y = a - (u.x - big) + da;
- res = do_cos (u, y, &cor);
- cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
+ res = do_cos (a, da, &cor);
+ cor = 1.025 * cor + __copysign (eps, cor);
retval = ((res == res + cor) ? ((n & 2) ? -res : res)
: bsloww2 (a, da, x, n));
break;
@@ -465,7 +447,7 @@ SECTION
#endif
__sin (double x)
{
- double xx, res, t, cor, y, s, c, sn, ssn, cs, ccs;
+ double xx, res, t, cor;
mynumber u;
int4 k, m;
double retval = 0;
@@ -495,40 +477,19 @@ __sin (double x)
/*---------------------------- 0.25<|x|< 0.855469---------------------- */
else if (k < 0x3feb6000)
{
- u.x = (m > 0) ? big + x : big - x;
- y = (m > 0) ? x - (u.x - big) : x + (u.x - big);
- xx = y * y;
- s = y + y * xx * (sn3 + xx * sn5);
- c = xx * (cs2 + xx * (cs4 + xx * cs6));
- SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
- if (m <= 0)
- {
- sn = -sn;
- ssn = -ssn;
- }
- cor = (ssn + s * ccs - sn * c) + cs * s;
- res = sn + cor;
- cor = (sn - res) + cor;
+ res = do_sin (x, 0, &cor);
retval = (res == res + 1.096 * cor) ? res : slow1 (x);
+ retval = __copysign (retval, x);
} /* else if (k < 0x3feb6000) */
/*----------------------- 0.855469 <|x|<2.426265 ----------------------*/
else if (k < 0x400368fd)
{
- y = (m > 0) ? hp0 - x : hp0 + x;
- if (y >= 0)
- {
- u.x = big + y;
- y = (y - (u.x - big)) + hp1;
- }
- else
- {
- u.x = big - y;
- y = (-hp1) - (y + (u.x - big));
- }
- res = do_cos (u, y, &cor);
- retval = (res == res + 1.020 * cor) ? ((m > 0) ? res : -res) : slow2 (x);
+ t = hp0 - fabs (x);
+ res = do_cos (t, hp1, &cor);
+ retval = (res == res + 1.020 * cor) ? res : slow2 (x);
+ retval = __copysign (retval, x);
} /* else if (k < 0x400368fd) */
#ifndef IN_SINCOS
@@ -537,7 +498,7 @@ __sin (double x)
{
double a, da;
int4 n = reduce_sincos_1 (x, &a, &da);
- retval = do_sincos_1 (a, da, x, n, 0);
+ retval = do_sincos_1 (a, da, x, n, false);
} /* else if (k < 0x419921FB ) */
/*---------------------105414350 <|x|< 281474976710656 --------------------*/
@@ -546,12 +507,12 @@ __sin (double x)
double a, da;
int4 n = reduce_sincos_2 (x, &a, &da);
- retval = do_sincos_2 (a, da, x, n, 0);
+ retval = do_sincos_2 (a, da, x, n, false);
} /* else if (k < 0x42F00000 ) */
/* -----------------281474976710656 <|x| <2^1024----------------------------*/
else if (k < 0x7ff00000)
- retval = reduce_and_compute (x, 0);
+ retval = reduce_and_compute (x, false);
/*--------------------- |x| > 2^1024 ----------------------------------*/
else
@@ -599,10 +560,7 @@ __cos (double x)
else if (k < 0x3feb6000)
{ /* 2^-27 < |x| < 0.855469 */
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- res = do_cos (u, y, &cor);
+ res = do_cos (x, 0, &cor);
retval = (res == res + 1.020 * cor) ? res : cslow2 (x);
} /* else if (k < 0x3feb6000) */
@@ -615,27 +573,15 @@ __cos (double x)
if (xx < 0.01588)
{
res = TAYLOR_SIN (xx, a, da, cor);
- cor = (cor > 0) ? 1.02 * cor + 1.0e-31 : 1.02 * cor - 1.0e-31;
- retval = (res == res + cor) ? res : sloww (a, da, x, 1);
+ cor = 1.02 * cor + __copysign (1.0e-31, cor);
+ retval = (res == res + cor) ? res : sloww (a, da, x, true);
}
else
{
- if (a > 0)
- {
- m = 1;
- }
- else
- {
- m = 0;
- a = -a;
- da = -da;
- }
- u.x = big + a;
- y = a - (u.x - big);
- res = do_sin (u, y, da, &cor);
- cor = (cor > 0) ? 1.035 * cor + 1.0e-31 : 1.035 * cor - 1.0e-31;
- retval = ((res == res + cor) ? ((m) ? res : -res)
- : sloww1 (a, da, x, m, 1));
+ res = do_sin (a, da, &cor);
+ cor = 1.035 * cor + __copysign (1.0e-31, cor);
+ retval = ((res == res + cor) ? __copysign (res, a)
+ : sloww1 (a, da, x, true));
}
} /* else if (k < 0x400368fd) */
@@ -646,7 +592,7 @@ __cos (double x)
{ /* 2.426265<|x|< 105414350 */
double a, da;
int4 n = reduce_sincos_1 (x, &a, &da);
- retval = do_sincos_1 (a, da, x, n, 1);
+ retval = do_sincos_1 (a, da, x, n, true);
} /* else if (k < 0x419921FB ) */
else if (k < 0x42F00000)
@@ -654,12 +600,12 @@ __cos (double x)
double a, da;
int4 n = reduce_sincos_2 (x, &a, &da);
- retval = do_sincos_2 (a, da, x, n, 1);
+ retval = do_sincos_2 (a, da, x, n, true);
} /* else if (k < 0x42F00000 ) */
/* 281474976710656 <|x| <2^1024 */
else if (k < 0x7ff00000)
- retval = reduce_and_compute (x, 1);
+ retval = reduce_and_compute (x, true);
else
{
@@ -677,8 +623,8 @@ __cos (double x)
/* precision and if still doesn't accurate enough by mpsin or dubsin */
/************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
slow (double x)
{
double res, cor, w[2];
@@ -688,9 +634,9 @@ slow (double x)
__dubsin (fabs (x), 0, w);
if (w[0] == w[0] + 1.000000001 * w[1])
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
+ return __copysign (__mpsin (fabs (x), 0, false), x);
}
/*******************************************************************************/
@@ -698,104 +644,83 @@ slow (double x)
/* and if result still doesn't accurate enough by mpsin or dubsin */
/*******************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
slow1 (double x)
{
- mynumber u;
- double w[2], y, cor, res;
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- res = do_sin_slow (u, y, 0, 0, &cor);
+ double w[2], cor, res;
+
+ res = do_sin_slow (x, 0, 0, &cor);
if (res == res + cor)
- return (x > 0) ? res : -res;
+ return res;
__dubsin (fabs (x), 0, w);
if (w[0] == w[0] + 1.000000005 * w[1])
- return (x > 0) ? w[0] : -w[0];
+ return w[0];
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
+ return __mpsin (fabs (x), 0, false);
}
/**************************************************************************/
/* Routine compute sin(x) for 0.855469 <|x|<2.426265 by __sincostab.tbl */
/* and if result still doesn't accurate enough by mpsin or dubsin */
/**************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
slow2 (double x)
{
- mynumber u;
- double w[2], y, y1, y2, cor, res, del;
+ double w[2], y, y1, y2, cor, res;
- y = fabs (x);
- y = hp0 - y;
- if (y >= 0)
- {
- u.x = big + y;
- y = y - (u.x - big);
- del = hp1;
- }
- else
- {
- u.x = big - y;
- y = -(y + (u.x - big));
- del = -hp1;
- }
- res = do_cos_slow (u, y, del, 0, &cor);
+ double t = hp0 - fabs (x);
+ res = do_cos_slow (t, hp1, 0, &cor);
if (res == res + cor)
- return (x > 0) ? res : -res;
+ return res;
y = fabs (x) - hp0;
y1 = y - hp1;
y2 = (y - y1) - hp1;
__docos (y1, y2, w);
if (w[0] == w[0] + 1.000000005 * w[1])
- return (x > 0) ? w[0] : -w[0];
+ return w[0];
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
+ return __mpsin (fabs (x), 0, false);
}
-/***************************************************************************/
-/* Routine compute sin(x+dx) (Double-Length number) where x is small enough*/
-/* to use Taylor series around zero and (x+dx) */
-/* in first or third quarter of unit circle.Routine receive also */
-/* (right argument) the original value of x for computing error of */
-/* result.And if result not accurate enough routine calls mpsin1 or dubsin */
-/***************************************************************************/
-
-static double
-SECTION
-sloww (double x, double dx, double orig, int k)
+/* Compute sin(x + dx) where X is small enough to use Taylor series around zero
+ and (x + dx) in the first or third quarter of the unit circle. ORIG is the
+ original value of X for computing error of the result. If the result is not
+ accurate enough, the routine calls mpsin or dubsin. SHIFT_QUADRANT rotates
+ the unit circle by 1 to compute the cosine instead of sine. */
+static inline double
+__always_inline
+sloww (double x, double dx, double orig, bool shift_quadrant)
{
double y, t, res, cor, w[2], a, da, xn;
mynumber v;
int4 n;
res = TAYLOR_SLOW (x, dx, cor);
- if (cor > 0)
- cor = 1.0005 * cor + fabs (orig) * 3.1e-30;
- else
- cor = 1.0005 * cor - fabs (orig) * 3.1e-30;
+ double eps = fabs (orig) * 3.1e-30;
+
+ cor = 1.0005 * cor + __copysign (eps, cor);
if (res == res + cor)
return res;
- (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+ a = fabs (x);
+ da = (x > 0) ? dx : -dx;
+ __dubsin (a, da, w);
+ eps = fabs (orig) * 1.1e-30;
+ cor = 1.000000001 * w[1] + __copysign (eps, w[1]);
if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
t = (orig * hpinv + toint);
xn = t - toint;
v.x = t;
y = (orig - xn * mp1) - xn * mp2;
- n = (v.i[LOW_HALF] + k) & 3;
+ n = (v.i[LOW_HALF] + shift_quadrant) & 3;
da = xn * pp3;
t = y - da;
da = (y - t) - da;
@@ -808,50 +733,44 @@ sloww (double x, double dx, double orig, int k)
a = -a;
da = -da;
}
- (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
+ x = fabs (a);
+ dx = (a > 0) ? da : -da;
+ __dubsin (x, dx, w);
+ eps = fabs (orig) * 1.1e-40;
+ cor = 1.000000001 * w[1] + __copysign (eps, w[1]);
if (w[0] == w[0] + cor)
- return (a > 0) ? w[0] : -w[0];
+ return __copysign (w[0], a);
- return k ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
+ return shift_quadrant ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
-/***************************************************************************/
-/* Routine compute sin(x+dx) (Double-Length number) where x in first or */
-/* third quarter of unit circle.Routine receive also (right argument) the */
-/* original value of x for computing error of result.And if result not */
-/* accurate enough routine calls mpsin1 or dubsin */
-/***************************************************************************/
-
-static double
-SECTION
-sloww1 (double x, double dx, double orig, int m, int k)
+/* Compute sin(x + dx) where X is in the first or third quarter of the unit
+ circle. ORIG is the original value of X for computing error of the result.
+ If the result is not accurate enough, the routine calls mpsin or dubsin.
+ SHIFT_QUADRANT rotates the unit circle by 1 to compute the cosine instead of
+ sine. */
+static inline double
+__always_inline
+sloww1 (double x, double dx, double orig, bool shift_quadrant)
{
- mynumber u;
- double w[2], y, cor, res;
+ double w[2], cor, res;
- u.x = big + x;
- y = x - (u.x - big);
- res = do_sin_slow (u, y, dx, 3.1e-30 * fabs (orig), &cor);
+ res = do_sin_slow (x, dx, 3.1e-30 * fabs (orig), &cor);
if (res == res + cor)
- return (m > 0) ? res : -res;
+ return __copysign (res, x);
- __dubsin (x, dx, w);
+ dx = (x > 0 ? dx : -dx);
+ __dubsin (fabs (x), dx, w);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+ double eps = 1.1e-30 * fabs (orig);
+ cor = 1.000000005 * w[1] + __copysign (eps, w[1]);
if (w[0] == w[0] + cor)
- return (m > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
- return (k == 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
+ return shift_quadrant ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
/***************************************************************************/
@@ -861,26 +780,22 @@ sloww1 (double x, double dx, double orig, int m, int k)
/* accurate enough routine calls mpsin1 or dubsin */
/***************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
sloww2 (double x, double dx, double orig, int n)
{
- mynumber u;
- double w[2], y, cor, res;
+ double w[2], cor, res;
- u.x = big + x;
- y = x - (u.x - big);
- res = do_cos_slow (u, y, dx, 3.1e-30 * fabs (orig), &cor);
+ res = do_cos_slow (x, dx, 3.1e-30 * fabs (orig), &cor);
if (res == res + cor)
return (n & 2) ? -res : res;
- __docos (x, dx, w);
+ dx = x > 0 ? dx : -dx;
+ __docos (fabs (x), dx, w);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+ double eps = 1.1e-30 * fabs (orig);
+ cor = 1.000000005 * w[1] + __copysign (eps, w[1]);
if (w[0] == w[0] + cor)
return (n & 2) ? -w[0] : w[0];
@@ -896,25 +811,24 @@ sloww2 (double x, double dx, double orig, int n)
/* result.And if result not accurate enough routine calls other routines */
/***************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
bsloww (double x, double dx, double orig, int n)
{
- double res, cor, w[2];
+ double res, cor, w[2], a, da;
res = TAYLOR_SLOW (x, dx, cor);
- cor = (cor > 0) ? 1.0005 * cor + 1.1e-24 : 1.0005 * cor - 1.1e-24;
+ cor = 1.0005 * cor + __copysign (1.1e-24, cor);
if (res == res + cor)
return res;
- (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + 1.1e-24;
- else
- cor = 1.000000001 * w[1] - 1.1e-24;
+ a = fabs (x);
+ da = (x > 0) ? dx : -dx;
+ __dubsin (a, da, w);
+ cor = 1.000000001 * w[1] + __copysign (1.1e-24, w[1]);
if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
@@ -926,30 +840,23 @@ bsloww (double x, double dx, double orig, int n)
/* And if result not accurate enough routine calls other routines */
/***************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
bsloww1 (double x, double dx, double orig, int n)
{
- mynumber u;
- double w[2], y, cor, res;
+ double w[2], cor, res;
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- dx = (x > 0) ? dx : -dx;
- res = do_sin_slow (u, y, dx, 1.1e-24, &cor);
+ res = do_sin_slow (x, dx, 1.1e-24, &cor);
if (res == res + cor)
return (x > 0) ? res : -res;
+ dx = (x > 0) ? dx : -dx;
__dubsin (fabs (x), dx, w);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-24;
- else
- cor = 1.000000005 * w[1] - 1.1e-24;
+ cor = 1.000000005 * w[1] + __copysign (1.1e-24, w[1]);
if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
@@ -961,27 +868,20 @@ bsloww1 (double x, double dx, double orig, int n)
/* And if result not accurate enough routine calls other routines */
/***************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
bsloww2 (double x, double dx, double orig, int n)
{
- mynumber u;
- double w[2], y, cor, res;
+ double w[2], cor, res;
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- dx = (x > 0) ? dx : -dx;
- res = do_cos_slow (u, y, dx, 1.1e-24, &cor);
+ res = do_cos_slow (x, dx, 1.1e-24, &cor);
if (res == res + cor)
return (n & 2) ? -res : res;
+ dx = (x > 0) ? dx : -dx;
__docos (fabs (x), dx, w);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-24;
- else
- cor = 1.000000005 * w[1] - 1.1e-24;
+ cor = 1.000000005 * w[1] + __copysign (1.1e-24, w[1]);
if (w[0] == w[0] + cor)
return (n & 2) ? -w[0] : w[0];
@@ -994,22 +894,17 @@ bsloww2 (double x, double dx, double orig, int n)
/* precision and if still doesn't accurate enough by mpcos or docos */
/************************************************************************/
-static double
-SECTION
+static inline double
+__always_inline
cslow2 (double x)
{
- mynumber u;
- double w[2], y, cor, res;
+ double w[2], cor, res;
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- res = do_cos_slow (u, y, 0, 0, &cor);
+ res = do_cos_slow (x, 0, 0, &cor);
if (res == res + cor)
return res;
- y = fabs (x);
- __docos (y, 0, w);
+ __docos (fabs (x), 0, w);
if (w[0] == w[0] + 1.000000005 * w[1])
return w[0];
diff --git a/sysdeps/ieee754/dbl-64/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c
index c389226b04..ca44b9008f 100644
--- a/sysdeps/ieee754/dbl-64/s_sincos.c
+++ b/sysdeps/ieee754/dbl-64/s_sincos.c
@@ -80,8 +80,8 @@ __sincos (double x, double *sinx, double *cosx)
double a, da;
int4 n = reduce_sincos_1 (x, &a, &da);
- *sinx = do_sincos_1 (a, da, x, n, 0);
- *cosx = do_sincos_1 (a, da, x, n, 1);
+ *sinx = do_sincos_1 (a, da, x, n, false);
+ *cosx = do_sincos_1 (a, da, x, n, true);
return;
}
@@ -90,8 +90,8 @@ __sincos (double x, double *sinx, double *cosx)
double a, da;
int4 n = reduce_sincos_2 (x, &a, &da);
- *sinx = do_sincos_2 (a, da, x, n, 0);
- *cosx = do_sincos_2 (a, da, x, n, 1);
+ *sinx = do_sincos_2 (a, da, x, n, false);
+ *cosx = do_sincos_2 (a, da, x, n, true);
return;
}
diff --git a/sysdeps/ieee754/dbl-64/s_totalorder.c b/sysdeps/ieee754/dbl-64/s_totalorder.c
new file mode 100644
index 0000000000..c4ec917207
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_totalorder.c
@@ -0,0 +1,54 @@
+/* Total order operation. dbl-64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalorder (double x, double y)
+{
+ int32_t hx, hy;
+ uint32_t lx, ly;
+ EXTRACT_WORDS (hx, lx, x);
+ EXTRACT_WORDS (hy, ly, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ uint32_t uhx = hx & 0x7fffffff, uhy = hy & 0x7fffffff;
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((uhx > 0x7ff00000 || (uhx == 0x7ff00000 && lx != 0))
+ && (uhy > 0x7ff00000 || (uhy == 0x7ff00000 && ly != 0)))
+ {
+ hx ^= 0x00080000;
+ hy ^= 0x00080000;
+ }
+#endif
+ uint32_t hx_sign = hx >> 31;
+ uint32_t hy_sign = hy >> 31;
+ hx ^= hx_sign >> 1;
+ lx ^= hx_sign;
+ hy ^= hy_sign >> 1;
+ ly ^= hy_sign;
+ return hx < hy || (hx == hy && lx <= ly);
+}
+#ifdef NO_LONG_DOUBLE
+weak_alias (totalorder, totalorderl)
+#endif
diff --git a/sysdeps/ieee754/dbl-64/s_totalordermag.c b/sysdeps/ieee754/dbl-64/s_totalordermag.c
new file mode 100644
index 0000000000..3850c33235
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_totalordermag.c
@@ -0,0 +1,49 @@
+/* Total order operation on absolute values. dbl-64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalordermag (double x, double y)
+{
+ uint32_t hx, hy;
+ uint32_t lx, ly;
+ EXTRACT_WORDS (hx, lx, x);
+ EXTRACT_WORDS (hy, ly, y);
+ hx &= 0x7fffffff;
+ hy &= 0x7fffffff;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((hx > 0x7ff00000 || (hx == 0x7ff00000 && lx != 0))
+ && (hy > 0x7ff00000 || (hy == 0x7ff00000 && ly != 0)))
+ {
+ hx ^= 0x00080000;
+ hy ^= 0x00080000;
+ }
+#endif
+ return hx < hy || (hx == hy && lx <= ly);
+}
+#ifdef NO_LONG_DOUBLE
+weak_alias (totalordermag, totalordermagl)
+#endif
diff --git a/math/s_nextdownl.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c
index e7607f5ad0..c1cf56e0cc 100644
--- a/math/s_nextdownl.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c
@@ -1,4 +1,4 @@
-/* Return the greatest floating-point number less than X.
+/* Get NaN payload. dbl-64/wordsize-64 version.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -18,12 +18,16 @@
#include <math.h>
#include <math_private.h>
+#include <stdint.h>
-/* Return the greatest floating-point number less than X. */
-long double
-__nextdownl (long double x)
+double
+getpayload (const double *x)
{
- return -__nextupl (-x);
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, *x);
+ ix &= 0x7ffffffffffffULL;
+ return (double) ix;
}
-
-weak_alias (__nextdownl, nextdownl)
+#ifdef NO_LONG_DOUBLE
+weak_alias (getpayload, getpayloadl)
+#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
index c22e608c6e..18d1acd0c9 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignaling (double x)
{
u_int64_t xi;
EXTRACT_WORDS64 (xi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
used to designate infinity. */
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c
new file mode 100644
index 0000000000..dd5587ba21
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c
@@ -0,0 +1,50 @@
+/* Total order operation. dbl-64/wordsize-64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalorder (double x, double y)
+{
+ int64_t ix, iy;
+ EXTRACT_WORDS64 (ix, x);
+ EXTRACT_WORDS64 (iy, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((ix & 0x7fffffffffffffffULL) > 0x7ff0000000000000ULL
+ && (iy & 0x7fffffffffffffffULL) > 0x7ff0000000000000ULL)
+ {
+ ix ^= 0x0008000000000000ULL;
+ iy ^= 0x0008000000000000ULL;
+ }
+#endif
+ uint64_t ix_sign = ix >> 63;
+ uint64_t iy_sign = iy >> 63;
+ ix ^= ix_sign >> 1;
+ iy ^= iy_sign >> 1;
+ return ix <= iy;
+}
+#ifdef NO_LONG_DOUBLE
+weak_alias (totalorder, totalorderl)
+#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c
new file mode 100644
index 0000000000..999a9196f3
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c
@@ -0,0 +1,47 @@
+/* Total order operation on absolute values. dbl-64/wordsize-64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalordermag (double x, double y)
+{
+ uint64_t ix, iy;
+ EXTRACT_WORDS64 (ix, x);
+ EXTRACT_WORDS64 (iy, y);
+ ix &= 0x7fffffffffffffffULL;
+ iy &= 0x7fffffffffffffffULL;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if (ix > 0x7ff0000000000000ULL && iy > 0x7ff0000000000000ULL)
+ {
+ ix ^= 0x0008000000000000ULL;
+ iy ^= 0x0008000000000000ULL;
+ }
+#endif
+ return ix <= iy;
+}
+#ifdef NO_LONG_DOUBLE
+weak_alias (totalordermag, totalordermagl)
+#endif
diff --git a/sysdeps/ieee754/dbl-64/x2y2m1.c b/sysdeps/ieee754/dbl-64/x2y2m1.c
index 96078888a7..75052159e1 100644
--- a/sysdeps/ieee754/dbl-64/x2y2m1.c
+++ b/sysdeps/ieee754/dbl-64/x2y2m1.c
@@ -18,7 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_split.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -33,36 +33,6 @@ add_split (double *hi, double *lo, double x, double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
diff --git a/sysdeps/ieee754/flt-32/k_rem_pio2f.c b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
index 392afdbb6c..52ffb09f0e 100644
--- a/sysdeps/ieee754/flt-32/k_rem_pio2f.c
+++ b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
@@ -19,6 +19,7 @@ static char rcsid[] = "$NetBSD: k_rem_pio2f.c,v 1.4 1995/05/10 20:46:28 jtc Exp
#include <math.h>
#include <math_private.h>
+#include <libc-internal.h>
/* In the float version, the input parameter x contains 8 bit
integers, not 24 bit integers. 113 bit precision is not supported. */
@@ -122,7 +123,16 @@ recompute:
j = 0;
for (i=jz-1;i>=jk;i--) j |= iq[i];
if(j==0) { /* need recomputation */
+ /* On s390x gcc 6.1 -O3 produces the warning "array subscript is
+ below array bounds [-Werror=array-bounds]". Only
+ __ieee754_rem_pio2f calls __kernel_rem_pio2f for normal
+ numbers and |x| ~> 2^7*(pi/2). Thus x can't be zero and
+ ipio2 is not zero, too. Thus not all iq[] values can't be
+ zero. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (6.1, "-Warray-bounds");
for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */
+ DIAG_POP_NEEDS_COMMENT;
for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */
f[jx+i] = (float) ipio2[jv+i];
diff --git a/math/s_nextdown.c b/sysdeps/ieee754/flt-32/s_getpayloadf.c
index 06fd1c9b12..fcc9e32716 100644
--- a/math/s_nextdown.c
+++ b/sysdeps/ieee754/flt-32/s_getpayloadf.c
@@ -1,4 +1,4 @@
-/* Return the greatest floating-point number less than X.
+/* Get NaN payload. flt-32 version.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,18 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <fix-int-fp-convert-zero.h>
#include <math.h>
#include <math_private.h>
+#include <stdint.h>
-/* Return the greatest floating-point number less than X. */
-double
-__nextdown (double x)
+float
+getpayloadf (const float *x)
{
- return -__nextup (-x);
+ uint32_t ix;
+ GET_FLOAT_WORD (ix, *x);
+ ix &= 0x3fffff;
+ if (FIX_INT_FP_CONVERT_ZERO && ix == 0)
+ return 0.0f;
+ return (float) ix;
}
-
-weak_alias (__nextdown, nextdown)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nextdown, __nextdownl)
-weak_alias (__nextdown, nextdownl)
-#endif
diff --git a/sysdeps/ieee754/flt-32/s_issignalingf.c b/sysdeps/ieee754/flt-32/s_issignalingf.c
index 2409ff408c..965ba92536 100644
--- a/sysdeps/ieee754/flt-32/s_issignalingf.c
+++ b/sysdeps/ieee754/flt-32/s_issignalingf.c
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignalingf (float x)
{
u_int32_t xi;
GET_FLOAT_WORD (xi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
used to designate infinity. */
diff --git a/sysdeps/ieee754/flt-32/s_totalorderf.c b/sysdeps/ieee754/flt-32/s_totalorderf.c
new file mode 100644
index 0000000000..243387b11e
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_totalorderf.c
@@ -0,0 +1,46 @@
+/* Total order operation. flt-32 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalorderf (float x, float y)
+{
+ int32_t ix, iy;
+ GET_FLOAT_WORD (ix, x);
+ GET_FLOAT_WORD (iy, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((ix & 0x7fffffff) > 0x7f800000 && (iy & 0x7fffffff) > 0x7f800000)
+ {
+ ix ^= 0x00400000;
+ iy ^= 0x00400000;
+ }
+#endif
+ uint32_t ix_sign = ix >> 31;
+ uint32_t iy_sign = iy >> 31;
+ ix ^= ix_sign >> 1;
+ iy ^= iy_sign >> 1;
+ return ix <= iy;
+}
diff --git a/math/s_cproj.c b/sysdeps/ieee754/flt-32/s_totalordermagf.c
index d47f009502..be78eae780 100644
--- a/math/s_cproj.c
+++ b/sysdeps/ieee754/flt-32/s_totalordermagf.c
@@ -1,7 +1,6 @@
-/* Compute projection of complex double value to Riemann sphere.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Total order operation on absolute values. flt-32 version.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,28 +16,29 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <complex.h>
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
-
-__complex__ double
-__cproj (__complex__ double x)
+int
+totalordermagf (float x, float y)
{
- if (isinf (__real__ x) || isinf (__imag__ x))
+ uint32_t ix, iy;
+ GET_FLOAT_WORD (ix, x);
+ GET_FLOAT_WORD (iy, y);
+ ix &= 0x7fffffff;
+ iy &= 0x7fffffff;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if (ix > 0x7f800000 && iy > 0x7f800000)
{
- __complex__ double res;
-
- __real__ res = INFINITY;
- __imag__ res = __copysign (0.0, __imag__ x);
-
- return res;
+ ix ^= 0x00400000;
+ iy ^= 0x00400000;
}
-
- return x;
-}
-weak_alias (__cproj, cproj)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cproj, __cprojl)
-weak_alias (__cproj, cprojl)
#endif
+ return ix <= iy;
+}
diff --git a/sysdeps/ieee754/ldbl-128/e_acoshl.c b/sysdeps/ieee754/ldbl-128/e_acoshl.c
index 6234289e1e..7c79d437a2 100644
--- a/sysdeps/ieee754/ldbl-128/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acoshl.c
@@ -30,14 +30,14 @@
#include <math.h>
#include <math_private.h>
-static const long double
+static const _Float128
one = 1.0,
-ln2 = 0.6931471805599453094172321214581766L;
+ln2 = L(0.6931471805599453094172321214581766);
-long double
-__ieee754_acoshl(long double x)
+_Float128
+__ieee754_acoshl(_Float128 x)
{
- long double t;
+ _Float128 t;
u_int64_t lx;
int64_t hx;
GET_LDOUBLE_WORDS64(hx,lx,x);
@@ -49,13 +49,13 @@ __ieee754_acoshl(long double x)
} else
return __ieee754_logl(x)+ln2; /* acoshl(huge)=logl(2x) */
} else if(((hx-0x3fff000000000000LL)|lx)==0) {
- return 0.0L; /* acosh(1) = 0 */
+ return 0; /* acosh(1) = 0 */
} else if (hx > 0x4000000000000000LL) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_logl(2.0L*x-one/(x+__ieee754_sqrtl(t-one)));
+ return __ieee754_logl(2*x-one/(x+__ieee754_sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__sqrtl(2.0L*t+t*t));
+ return __log1pl(t+__sqrtl(2*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/sysdeps/ieee754/ldbl-128/e_acosl.c b/sysdeps/ieee754/ldbl-128/e_acosl.c
index 8c8ec93339..342ea5f47d 100644
--- a/sysdeps/ieee754/ldbl-128/e_acosl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acosl.c
@@ -57,101 +57,101 @@
#include <math.h>
#include <math_private.h>
-static const long double
- one = 1.0L,
- pio2_hi = 1.5707963267948966192313216916397514420986L,
- pio2_lo = 4.3359050650618905123985220130216759843812E-35L,
+static const _Float128
+ one = 1,
+ pio2_hi = L(1.5707963267948966192313216916397514420986),
+ pio2_lo = L(4.3359050650618905123985220130216759843812E-35),
/* acos(0.5625 + x) = acos(0.5625) + x rS(x) / sS(x)
-0.0625 <= x <= 0.0625
peak relative error 3.3e-35 */
- rS0 = 5.619049346208901520945464704848780243887E0L,
- rS1 = -4.460504162777731472539175700169871920352E1L,
- rS2 = 1.317669505315409261479577040530751477488E2L,
- rS3 = -1.626532582423661989632442410808596009227E2L,
- rS4 = 3.144806644195158614904369445440583873264E1L,
- rS5 = 9.806674443470740708765165604769099559553E1L,
- rS6 = -5.708468492052010816555762842394927806920E1L,
- rS7 = -1.396540499232262112248553357962639431922E1L,
- rS8 = 1.126243289311910363001762058295832610344E1L,
- rS9 = 4.956179821329901954211277873774472383512E-1L,
- rS10 = -3.313227657082367169241333738391762525780E-1L,
+ rS0 = L(5.619049346208901520945464704848780243887E0),
+ rS1 = L(-4.460504162777731472539175700169871920352E1),
+ rS2 = L(1.317669505315409261479577040530751477488E2),
+ rS3 = L(-1.626532582423661989632442410808596009227E2),
+ rS4 = L(3.144806644195158614904369445440583873264E1),
+ rS5 = L(9.806674443470740708765165604769099559553E1),
+ rS6 = L(-5.708468492052010816555762842394927806920E1),
+ rS7 = L(-1.396540499232262112248553357962639431922E1),
+ rS8 = L(1.126243289311910363001762058295832610344E1),
+ rS9 = L(4.956179821329901954211277873774472383512E-1),
+ rS10 = L(-3.313227657082367169241333738391762525780E-1),
- sS0 = -4.645814742084009935700221277307007679325E0L,
- sS1 = 3.879074822457694323970438316317961918430E1L,
- sS2 = -1.221986588013474694623973554726201001066E2L,
- sS3 = 1.658821150347718105012079876756201905822E2L,
- sS4 = -4.804379630977558197953176474426239748977E1L,
- sS5 = -1.004296417397316948114344573811562952793E2L,
- sS6 = 7.530281592861320234941101403870010111138E1L,
- sS7 = 1.270735595411673647119592092304357226607E1L,
- sS8 = -1.815144839646376500705105967064792930282E1L,
- sS9 = -7.821597334910963922204235247786840828217E-2L,
+ sS0 = L(-4.645814742084009935700221277307007679325E0),
+ sS1 = L(3.879074822457694323970438316317961918430E1),
+ sS2 = L(-1.221986588013474694623973554726201001066E2),
+ sS3 = L(1.658821150347718105012079876756201905822E2),
+ sS4 = L(-4.804379630977558197953176474426239748977E1),
+ sS5 = L(-1.004296417397316948114344573811562952793E2),
+ sS6 = L(7.530281592861320234941101403870010111138E1),
+ sS7 = L(1.270735595411673647119592092304357226607E1),
+ sS8 = L(-1.815144839646376500705105967064792930282E1),
+ sS9 = L(-7.821597334910963922204235247786840828217E-2),
/* 1.000000000000000000000000000000000000000E0 */
- acosr5625 = 9.7338991014954640492751132535550279812151E-1L,
- pimacosr5625 = 2.1682027434402468335351320579240000860757E0L,
+ acosr5625 = L(9.7338991014954640492751132535550279812151E-1),
+ pimacosr5625 = L(2.1682027434402468335351320579240000860757E0),
/* acos(0.4375 + x) = acos(0.4375) + x rS(x) / sS(x)
-0.0625 <= x <= 0.0625
peak relative error 2.1e-35 */
- P0 = 2.177690192235413635229046633751390484892E0L,
- P1 = -2.848698225706605746657192566166142909573E1L,
- P2 = 1.040076477655245590871244795403659880304E2L,
- P3 = -1.400087608918906358323551402881238180553E2L,
- P4 = 2.221047917671449176051896400503615543757E1L,
- P5 = 9.643714856395587663736110523917499638702E1L,
- P6 = -5.158406639829833829027457284942389079196E1L,
- P7 = -1.578651828337585944715290382181219741813E1L,
- P8 = 1.093632715903802870546857764647931045906E1L,
- P9 = 5.448925479898460003048760932274085300103E-1L,
- P10 = -3.315886001095605268470690485170092986337E-1L,
- Q0 = -1.958219113487162405143608843774587557016E0L,
- Q1 = 2.614577866876185080678907676023269360520E1L,
- Q2 = -9.990858606464150981009763389881793660938E1L,
- Q3 = 1.443958741356995763628660823395334281596E2L,
- Q4 = -3.206441012484232867657763518369723873129E1L,
- Q5 = -1.048560885341833443564920145642588991492E2L,
- Q6 = 6.745883931909770880159915641984874746358E1L,
- Q7 = 1.806809656342804436118449982647641392951E1L,
- Q8 = -1.770150690652438294290020775359580915464E1L,
- Q9 = -5.659156469628629327045433069052560211164E-1L,
+ P0 = L(2.177690192235413635229046633751390484892E0),
+ P1 = L(-2.848698225706605746657192566166142909573E1),
+ P2 = L(1.040076477655245590871244795403659880304E2),
+ P3 = L(-1.400087608918906358323551402881238180553E2),
+ P4 = L(2.221047917671449176051896400503615543757E1),
+ P5 = L(9.643714856395587663736110523917499638702E1),
+ P6 = L(-5.158406639829833829027457284942389079196E1),
+ P7 = L(-1.578651828337585944715290382181219741813E1),
+ P8 = L(1.093632715903802870546857764647931045906E1),
+ P9 = L(5.448925479898460003048760932274085300103E-1),
+ P10 = L(-3.315886001095605268470690485170092986337E-1),
+ Q0 = L(-1.958219113487162405143608843774587557016E0),
+ Q1 = L(2.614577866876185080678907676023269360520E1),
+ Q2 = L(-9.990858606464150981009763389881793660938E1),
+ Q3 = L(1.443958741356995763628660823395334281596E2),
+ Q4 = L(-3.206441012484232867657763518369723873129E1),
+ Q5 = L(-1.048560885341833443564920145642588991492E2),
+ Q6 = L(6.745883931909770880159915641984874746358E1),
+ Q7 = L(1.806809656342804436118449982647641392951E1),
+ Q8 = L(-1.770150690652438294290020775359580915464E1),
+ Q9 = L(-5.659156469628629327045433069052560211164E-1),
/* 1.000000000000000000000000000000000000000E0 */
- acosr4375 = 1.1179797320499710475919903296900511518755E0L,
- pimacosr4375 = 2.0236129215398221908706530535894517323217E0L,
+ acosr4375 = L(1.1179797320499710475919903296900511518755E0),
+ pimacosr4375 = L(2.0236129215398221908706530535894517323217E0),
/* asin(x) = x + x^3 pS(x^2) / qS(x^2)
0 <= x <= 0.5
peak relative error 1.9e-35 */
- pS0 = -8.358099012470680544198472400254596543711E2L,
- pS1 = 3.674973957689619490312782828051860366493E3L,
- pS2 = -6.730729094812979665807581609853656623219E3L,
- pS3 = 6.643843795209060298375552684423454077633E3L,
- pS4 = -3.817341990928606692235481812252049415993E3L,
- pS5 = 1.284635388402653715636722822195716476156E3L,
- pS6 = -2.410736125231549204856567737329112037867E2L,
- pS7 = 2.219191969382402856557594215833622156220E1L,
- pS8 = -7.249056260830627156600112195061001036533E-1L,
- pS9 = 1.055923570937755300061509030361395604448E-3L,
+ pS0 = L(-8.358099012470680544198472400254596543711E2),
+ pS1 = L(3.674973957689619490312782828051860366493E3),
+ pS2 = L(-6.730729094812979665807581609853656623219E3),
+ pS3 = L(6.643843795209060298375552684423454077633E3),
+ pS4 = L(-3.817341990928606692235481812252049415993E3),
+ pS5 = L(1.284635388402653715636722822195716476156E3),
+ pS6 = L(-2.410736125231549204856567737329112037867E2),
+ pS7 = L(2.219191969382402856557594215833622156220E1),
+ pS8 = L(-7.249056260830627156600112195061001036533E-1),
+ pS9 = L(1.055923570937755300061509030361395604448E-3),
- qS0 = -5.014859407482408326519083440151745519205E3L,
- qS1 = 2.430653047950480068881028451580393430537E4L,
- qS2 = -4.997904737193653607449250593976069726962E4L,
- qS3 = 5.675712336110456923807959930107347511086E4L,
- qS4 = -3.881523118339661268482937768522572588022E4L,
- qS5 = 1.634202194895541569749717032234510811216E4L,
- qS6 = -4.151452662440709301601820849901296953752E3L,
- qS7 = 5.956050864057192019085175976175695342168E2L,
- qS8 = -4.175375777334867025769346564600396877176E1L;
+ qS0 = L(-5.014859407482408326519083440151745519205E3),
+ qS1 = L(2.430653047950480068881028451580393430537E4),
+ qS2 = L(-4.997904737193653607449250593976069726962E4),
+ qS3 = L(5.675712336110456923807959930107347511086E4),
+ qS4 = L(-3.881523118339661268482937768522572588022E4),
+ qS5 = L(1.634202194895541569749717032234510811216E4),
+ qS6 = L(-4.151452662440709301601820849901296953752E3),
+ qS7 = L(5.956050864057192019085175976175695342168E2),
+ qS8 = L(-4.175375777334867025769346564600396877176E1);
/* 1.000000000000000000000000000000000000000E0 */
-long double
-__ieee754_acosl (long double x)
+_Float128
+__ieee754_acosl (_Float128 x)
{
- long double z, r, w, p, q, s, t, f2;
+ _Float128 z, r, w, p, q, s, t, f2;
int32_t ix, sign;
ieee854_long_double_shape_type u;
@@ -204,7 +204,7 @@ __ieee754_acosl (long double x)
return z;
}
/* .4375 <= |x| < .5 */
- t = u.value - 0.4375L;
+ t = u.value - L(0.4375);
p = ((((((((((P10 * t
+ P9) * t
+ P8) * t
@@ -237,7 +237,7 @@ __ieee754_acosl (long double x)
}
else if (ix < 0x3ffe4000) /* |x| < 0.625 */
{
- t = u.value - 0.5625L;
+ t = u.value - L(0.5625);
p = ((((((((((rS10 * t
+ rS9) * t
+ rS8) * t
diff --git a/sysdeps/ieee754/ldbl-128/e_asinl.c b/sysdeps/ieee754/ldbl-128/e_asinl.c
index 5a0e473ef0..1edf1c05a1 100644
--- a/sysdeps/ieee754/ldbl-128/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-128/e_asinl.c
@@ -62,77 +62,76 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
-long double sqrtl (long double);
-static const long double
- one = 1.0L,
- huge = 1.0e+4932L,
- pio2_hi = 1.5707963267948966192313216916397514420986L,
- pio2_lo = 4.3359050650618905123985220130216759843812E-35L,
- pio4_hi = 7.8539816339744830961566084581987569936977E-1L,
+static const _Float128
+ one = 1,
+ huge = L(1.0e+4932),
+ pio2_hi = L(1.5707963267948966192313216916397514420986),
+ pio2_lo = L(4.3359050650618905123985220130216759843812E-35),
+ pio4_hi = L(7.8539816339744830961566084581987569936977E-1),
/* coefficient for R(x^2) */
/* asin(x) = x + x^3 pS(x^2) / qS(x^2)
0 <= x <= 0.5
peak relative error 1.9e-35 */
- pS0 = -8.358099012470680544198472400254596543711E2L,
- pS1 = 3.674973957689619490312782828051860366493E3L,
- pS2 = -6.730729094812979665807581609853656623219E3L,
- pS3 = 6.643843795209060298375552684423454077633E3L,
- pS4 = -3.817341990928606692235481812252049415993E3L,
- pS5 = 1.284635388402653715636722822195716476156E3L,
- pS6 = -2.410736125231549204856567737329112037867E2L,
- pS7 = 2.219191969382402856557594215833622156220E1L,
- pS8 = -7.249056260830627156600112195061001036533E-1L,
- pS9 = 1.055923570937755300061509030361395604448E-3L,
+ pS0 = L(-8.358099012470680544198472400254596543711E2),
+ pS1 = L(3.674973957689619490312782828051860366493E3),
+ pS2 = L(-6.730729094812979665807581609853656623219E3),
+ pS3 = L(6.643843795209060298375552684423454077633E3),
+ pS4 = L(-3.817341990928606692235481812252049415993E3),
+ pS5 = L(1.284635388402653715636722822195716476156E3),
+ pS6 = L(-2.410736125231549204856567737329112037867E2),
+ pS7 = L(2.219191969382402856557594215833622156220E1),
+ pS8 = L(-7.249056260830627156600112195061001036533E-1),
+ pS9 = L(1.055923570937755300061509030361395604448E-3),
- qS0 = -5.014859407482408326519083440151745519205E3L,
- qS1 = 2.430653047950480068881028451580393430537E4L,
- qS2 = -4.997904737193653607449250593976069726962E4L,
- qS3 = 5.675712336110456923807959930107347511086E4L,
- qS4 = -3.881523118339661268482937768522572588022E4L,
- qS5 = 1.634202194895541569749717032234510811216E4L,
- qS6 = -4.151452662440709301601820849901296953752E3L,
- qS7 = 5.956050864057192019085175976175695342168E2L,
- qS8 = -4.175375777334867025769346564600396877176E1L,
+ qS0 = L(-5.014859407482408326519083440151745519205E3),
+ qS1 = L(2.430653047950480068881028451580393430537E4),
+ qS2 = L(-4.997904737193653607449250593976069726962E4),
+ qS3 = L(5.675712336110456923807959930107347511086E4),
+ qS4 = L(-3.881523118339661268482937768522572588022E4),
+ qS5 = L(1.634202194895541569749717032234510811216E4),
+ qS6 = L(-4.151452662440709301601820849901296953752E3),
+ qS7 = L(5.956050864057192019085175976175695342168E2),
+ qS8 = L(-4.175375777334867025769346564600396877176E1),
/* 1.000000000000000000000000000000000000000E0 */
/* asin(0.5625 + x) = asin(0.5625) + x rS(x) / sS(x)
-0.0625 <= x <= 0.0625
peak relative error 3.3e-35 */
- rS0 = -5.619049346208901520945464704848780243887E0L,
- rS1 = 4.460504162777731472539175700169871920352E1L,
- rS2 = -1.317669505315409261479577040530751477488E2L,
- rS3 = 1.626532582423661989632442410808596009227E2L,
- rS4 = -3.144806644195158614904369445440583873264E1L,
- rS5 = -9.806674443470740708765165604769099559553E1L,
- rS6 = 5.708468492052010816555762842394927806920E1L,
- rS7 = 1.396540499232262112248553357962639431922E1L,
- rS8 = -1.126243289311910363001762058295832610344E1L,
- rS9 = -4.956179821329901954211277873774472383512E-1L,
- rS10 = 3.313227657082367169241333738391762525780E-1L,
+ rS0 = L(-5.619049346208901520945464704848780243887E0),
+ rS1 = L(4.460504162777731472539175700169871920352E1),
+ rS2 = L(-1.317669505315409261479577040530751477488E2),
+ rS3 = L(1.626532582423661989632442410808596009227E2),
+ rS4 = L(-3.144806644195158614904369445440583873264E1),
+ rS5 = L(-9.806674443470740708765165604769099559553E1),
+ rS6 = L(5.708468492052010816555762842394927806920E1),
+ rS7 = L(1.396540499232262112248553357962639431922E1),
+ rS8 = L(-1.126243289311910363001762058295832610344E1),
+ rS9 = L(-4.956179821329901954211277873774472383512E-1),
+ rS10 = L(3.313227657082367169241333738391762525780E-1),
- sS0 = -4.645814742084009935700221277307007679325E0L,
- sS1 = 3.879074822457694323970438316317961918430E1L,
- sS2 = -1.221986588013474694623973554726201001066E2L,
- sS3 = 1.658821150347718105012079876756201905822E2L,
- sS4 = -4.804379630977558197953176474426239748977E1L,
- sS5 = -1.004296417397316948114344573811562952793E2L,
- sS6 = 7.530281592861320234941101403870010111138E1L,
- sS7 = 1.270735595411673647119592092304357226607E1L,
- sS8 = -1.815144839646376500705105967064792930282E1L,
- sS9 = -7.821597334910963922204235247786840828217E-2L,
+ sS0 = L(-4.645814742084009935700221277307007679325E0),
+ sS1 = L(3.879074822457694323970438316317961918430E1),
+ sS2 = L(-1.221986588013474694623973554726201001066E2),
+ sS3 = L(1.658821150347718105012079876756201905822E2),
+ sS4 = L(-4.804379630977558197953176474426239748977E1),
+ sS5 = L(-1.004296417397316948114344573811562952793E2),
+ sS6 = L(7.530281592861320234941101403870010111138E1),
+ sS7 = L(1.270735595411673647119592092304357226607E1),
+ sS8 = L(-1.815144839646376500705105967064792930282E1),
+ sS9 = L(-7.821597334910963922204235247786840828217E-2),
/* 1.000000000000000000000000000000000000000E0 */
- asinr5625 = 5.9740641664535021430381036628424864397707E-1L;
+ asinr5625 = L(5.9740641664535021430381036628424864397707E-1);
-long double
-__ieee754_asinl (long double x)
+_Float128
+__ieee754_asinl (_Float128 x)
{
- long double t, w, p, q, c, r, s;
+ _Float128 t, w, p, q, c, r, s;
int32_t ix, sign, flag;
ieee854_long_double_shape_type u;
@@ -154,7 +153,7 @@ __ieee754_asinl (long double x)
if (ix < 0x3fc60000) /* |x| < 2**-57 */
{
math_check_force_underflow (x);
- long double force_inexact = huge + x;
+ _Float128 force_inexact = huge + x;
math_force_eval (force_inexact);
return x; /* return x with inexact if x!=0 */
}
diff --git a/sysdeps/ieee754/ldbl-128/e_atan2l.c b/sysdeps/ieee754/ldbl-128/e_atan2l.c
index d31ee70dbd..faecd1a63b 100644
--- a/sysdeps/ieee754/ldbl-128/e_atan2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_atan2l.c
@@ -43,18 +43,18 @@
#include <math.h>
#include <math_private.h>
-static const long double
-tiny = 1.0e-4900L,
+static const _Float128
+tiny = L(1.0e-4900),
zero = 0.0,
-pi_o_4 = 7.85398163397448309615660845819875699e-01L, /* 3ffe921fb54442d18469898cc51701b8 */
-pi_o_2 = 1.57079632679489661923132169163975140e+00L, /* 3fff921fb54442d18469898cc51701b8 */
-pi = 3.14159265358979323846264338327950280e+00L, /* 4000921fb54442d18469898cc51701b8 */
-pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74020bbea64 */
+pi_o_4 = L(7.85398163397448309615660845819875699e-01), /* 3ffe921fb54442d18469898cc51701b8 */
+pi_o_2 = L(1.57079632679489661923132169163975140e+00), /* 3fff921fb54442d18469898cc51701b8 */
+pi = L(3.14159265358979323846264338327950280e+00), /* 4000921fb54442d18469898cc51701b8 */
+pi_lo = L(8.67181013012378102479704402604335225e-35); /* 3f8dcd129024e088a67cc74020bbea64 */
-long double
-__ieee754_atan2l(long double y, long double x)
+_Float128
+__ieee754_atan2l(_Float128 y, _Float128 x)
{
- long double z;
+ _Float128 z;
int64_t k,m,hx,hy,ix,iy;
u_int64_t lx,ly;
@@ -86,8 +86,8 @@ __ieee754_atan2l(long double y, long double x)
switch(m) {
case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */
case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
- case 2: return 3.0L*pi_o_4+tiny;/*atan(+INF,-INF)*/
- case 3: return -3.0L*pi_o_4-tiny;/*atan(-INF,-INF)*/
+ case 2: return 3*pi_o_4+tiny;/*atan(+INF,-INF)*/
+ case 3: return -3*pi_o_4-tiny;/*atan(-INF,-INF)*/
}
} else {
switch(m) {
@@ -103,8 +103,8 @@ __ieee754_atan2l(long double y, long double x)
/* 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+L(0.5)*pi_lo; /* |y/x| > 2**120 */
+ else if(hx<0&&k<-120) z=0; /* |y|/x < -2**120 */
else z=__atanl(fabsl(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
diff --git a/sysdeps/ieee754/ldbl-128/e_atanhl.c b/sysdeps/ieee754/ldbl-128/e_atanhl.c
index 7fa53ef436..3905af4dfc 100644
--- a/sysdeps/ieee754/ldbl-128/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_atanhl.c
@@ -36,14 +36,14 @@
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0L, huge = 1e4900L;
+static const _Float128 one = 1, huge = L(1e4900);
-static const long double zero = 0.0L;
+static const _Float128 zero = 0;
-long double
-__ieee754_atanhl(long double x)
+_Float128
+__ieee754_atanhl(_Float128 x)
{
- long double t;
+ _Float128 t;
u_int32_t jx, ix;
ieee854_long_double_shape_type u;
diff --git a/sysdeps/ieee754/ldbl-128/e_coshl.c b/sysdeps/ieee754/ldbl-128/e_coshl.c
index 488c318d27..70a2fe3e84 100644
--- a/sysdeps/ieee754/ldbl-128/e_coshl.c
+++ b/sysdeps/ieee754/ldbl-128/e_coshl.c
@@ -54,13 +54,13 @@
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0, half = 0.5, huge = 1.0e4900L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
+static const _Float128 one = 1.0, half = 0.5, huge = L(1.0e4900),
+ovf_thresh = L(1.1357216553474703894801348310092223067821E4);
-long double
-__ieee754_coshl (long double x)
+_Float128
+__ieee754_coshl (_Float128 x)
{
- long double t, w;
+ _Float128 t, w;
int32_t ex;
ieee854_long_double_shape_type u;
diff --git a/sysdeps/ieee754/ldbl-128/e_exp10l.c b/sysdeps/ieee754/ldbl-128/e_exp10l.c
index 987002567a..9432b18577 100644
--- a/sysdeps/ieee754/ldbl-128/e_exp10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_exp10l.c
@@ -19,15 +19,15 @@
#include <math_private.h>
#include <float.h>
-static const long double log10_high = 0x2.4d763776aaa2bp0L;
-static const long double log10_low = 0x5.ba95b58ae0b4c28a38a3fb3e7698p-60L;
+static const _Float128 log10_high = L(0x2.4d763776aaa2bp0);
+static const _Float128 log10_low = L(0x5.ba95b58ae0b4c28a38a3fb3e7698p-60);
-long double
-__ieee754_exp10l (long double arg)
+_Float128
+__ieee754_exp10l (_Float128 arg)
{
ieee854_long_double_shape_type u;
- long double arg_high, arg_low;
- long double exp_high, exp_low;
+ _Float128 arg_high, arg_low;
+ _Float128 exp_high, exp_low;
if (!isfinite (arg))
return __ieee754_expl (arg);
@@ -35,8 +35,8 @@ __ieee754_exp10l (long double arg)
return LDBL_MIN * LDBL_MIN;
else if (arg > LDBL_MAX_10_EXP + 1)
return LDBL_MAX * LDBL_MAX;
- else if (fabsl (arg) < 0x1p-116L)
- return 1.0L;
+ else if (fabsl (arg) < L(0x1p-116))
+ return 1;
u.value = arg;
u.parts64.lsw &= 0xfe00000000000000LL;
diff --git a/sysdeps/ieee754/ldbl-128/e_expl.c b/sysdeps/ieee754/ldbl-128/e_expl.c
index 7b71e644be..7924c8d35c 100644
--- a/sysdeps/ieee754/ldbl-128/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128/e_expl.c
@@ -68,54 +68,54 @@
#include <stdlib.h>
#include "t_expl.h"
-static const long double C[] = {
+static const _Float128 C[] = {
/* Smallest integer x for which e^x overflows. */
#define himark C[0]
- 11356.523406294143949491931077970765L,
+ L(11356.523406294143949491931077970765),
/* Largest integer x for which e^x underflows. */
#define lomark C[1]
--11433.4627433362978788372438434526231L,
+L(-11433.4627433362978788372438434526231),
/* 3x2^96 */
#define THREEp96 C[2]
- 59421121885698253195157962752.0L,
+ L(59421121885698253195157962752.0),
/* 3x2^103 */
#define THREEp103 C[3]
- 30423614405477505635920876929024.0L,
+ L(30423614405477505635920876929024.0),
/* 3x2^111 */
#define THREEp111 C[4]
- 7788445287802241442795744493830144.0L,
+ L(7788445287802241442795744493830144.0),
/* 1/ln(2) */
#define M_1_LN2 C[5]
- 1.44269504088896340735992468100189204L,
+ L(1.44269504088896340735992468100189204),
/* first 93 bits of ln(2) */
#define M_LN2_0 C[6]
- 0.693147180559945309417232121457981864L,
+ L(0.693147180559945309417232121457981864),
/* ln2_0 - ln(2) */
#define M_LN2_1 C[7]
--1.94704509238074995158795957333327386E-31L,
+L(-1.94704509238074995158795957333327386E-31),
/* very small number */
#define TINY C[8]
- 1.0e-4900L,
+ L(1.0e-4900),
/* 2^16383 */
#define TWO16383 C[9]
- 5.94865747678615882542879663314003565E+4931L,
+ L(5.94865747678615882542879663314003565E+4931),
/* 256 */
#define TWO8 C[10]
- 256.0L,
+ 256,
/* 32768 */
#define TWO15 C[11]
- 32768.0L,
+ 32768,
/* Chebyshev polynom coefficients for (exp(x)-1)/x */
#define P1 C[12]
@@ -124,22 +124,22 @@ static const long double C[] = {
#define P4 C[15]
#define P5 C[16]
#define P6 C[17]
- 0.5L,
- 1.66666666666666666666666666666666683E-01L,
- 4.16666666666666666666654902320001674E-02L,
- 8.33333333333333333333314659767198461E-03L,
- 1.38888888889899438565058018857254025E-03L,
- 1.98412698413981650382436541785404286E-04L,
+ L(0.5),
+ L(1.66666666666666666666666666666666683E-01),
+ L(4.16666666666666666666654902320001674E-02),
+ L(8.33333333333333333333314659767198461E-03),
+ L(1.38888888889899438565058018857254025E-03),
+ L(1.98412698413981650382436541785404286E-04),
};
-long double
-__ieee754_expl (long double x)
+_Float128
+__ieee754_expl (_Float128 x)
{
/* Check for usual case. */
if (isless (x, himark) && isgreater (x, lomark))
{
int tval1, tval2, unsafe, n_i;
- long double x22, n, t, result, xl;
+ _Float128 x22, n, t, result, xl;
union ieee854_long_double ex2_u, scale_u;
fenv_t oldenv;
@@ -185,7 +185,7 @@ __ieee754_expl (long double x)
ex2_u.ieee.exponent += n_i >> unsafe;
/* Compute scale = 2^n_1. */
- scale_u.d = 1.0L;
+ scale_u.d = 1;
scale_u.ieee.exponent += n_i - (n_i >> unsafe);
/* Approximate e^x2 - 1, using a seventh-degree polynomial,
diff --git a/sysdeps/ieee754/ldbl-128/e_fmodl.c b/sysdeps/ieee754/ldbl-128/e_fmodl.c
index 33280030f1..f27cd4f8ff 100644
--- a/sysdeps/ieee754/ldbl-128/e_fmodl.c
+++ b/sysdeps/ieee754/ldbl-128/e_fmodl.c
@@ -21,10 +21,10 @@
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0, Zero[] = {0.0, -0.0,};
+static const _Float128 one = 1.0, Zero[] = {0.0, -0.0,};
-long double
-__ieee754_fmodl (long double x, long double y)
+_Float128
+__ieee754_fmodl (_Float128 x, _Float128 y)
{
int64_t n,hx,hy,hz,ix,iy,sx,i;
u_int64_t lx,ly,lz;
diff --git a/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
index d0286e31eb..3366806e65 100644
--- a/sysdeps/ieee754/ldbl-128/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
@@ -25,22 +25,22 @@
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
approximation to gamma function. */
-static const long double gamma_coeff[] =
+static const _Float128 gamma_coeff[] =
{
- 0x1.5555555555555555555555555555p-4L,
- -0xb.60b60b60b60b60b60b60b60b60b8p-12L,
- 0x3.4034034034034034034034034034p-12L,
- -0x2.7027027027027027027027027028p-12L,
- 0x3.72a3c5631fe46ae1d4e700dca8f2p-12L,
- -0x7.daac36664f1f207daac36664f1f4p-12L,
- 0x1.a41a41a41a41a41a41a41a41a41ap-8L,
- -0x7.90a1b2c3d4e5f708192a3b4c5d7p-8L,
- 0x2.dfd2c703c0cfff430edfd2c703cp-4L,
- -0x1.6476701181f39edbdb9ce625987dp+0L,
- 0xd.672219167002d3a7a9c886459cp+0L,
- -0x9.cd9292e6660d55b3f712eb9e07c8p+4L,
- 0x8.911a740da740da740da740da741p+8L,
- -0x8.d0cc570e255bf59ff6eec24b49p+12L,
+ L(0x1.5555555555555555555555555555p-4),
+ L(-0xb.60b60b60b60b60b60b60b60b60b8p-12),
+ L(0x3.4034034034034034034034034034p-12),
+ L(-0x2.7027027027027027027027027028p-12),
+ L(0x3.72a3c5631fe46ae1d4e700dca8f2p-12),
+ L(-0x7.daac36664f1f207daac36664f1f4p-12),
+ L(0x1.a41a41a41a41a41a41a41a41a41ap-8),
+ L(-0x7.90a1b2c3d4e5f708192a3b4c5d7p-8),
+ L(0x2.dfd2c703c0cfff430edfd2c703cp-4),
+ L(-0x1.6476701181f39edbdb9ce625987dp+0),
+ L(0xd.672219167002d3a7a9c886459cp+0),
+ L(-0x9.cd9292e6660d55b3f712eb9e07c8p+4),
+ L(0x8.911a740da740da740da740da741p+8),
+ L(-0x8.d0cc570e255bf59ff6eec24b49p+12),
};
#define NCOEFF (sizeof (gamma_coeff) / sizeof (gamma_coeff[0]))
@@ -49,42 +49,42 @@ static const long double gamma_coeff[] =
2^(*EXP2_ADJ), where R is the return value and *EXP2_ADJ is set to
avoid overflow or underflow in intermediate calculations. */
-static long double
-gammal_positive (long double x, int *exp2_adj)
+static _Float128
+gammal_positive (_Float128 x, int *exp2_adj)
{
int local_signgam;
- if (x < 0.5L)
+ if (x < L(0.5))
{
*exp2_adj = 0;
return __ieee754_expl (__ieee754_lgammal_r (x + 1, &local_signgam)) / x;
}
- else if (x <= 1.5L)
+ else if (x <= L(1.5))
{
*exp2_adj = 0;
return __ieee754_expl (__ieee754_lgammal_r (x, &local_signgam));
}
- else if (x < 12.5L)
+ else if (x < L(12.5))
{
/* Adjust into the range for using exp (lgamma). */
*exp2_adj = 0;
- long double n = __ceill (x - 1.5L);
- long double x_adj = x - n;
- long double eps;
- long double prod = __gamma_productl (x_adj, 0, n, &eps);
+ _Float128 n = __ceill (x - L(1.5));
+ _Float128 x_adj = x - n;
+ _Float128 eps;
+ _Float128 prod = __gamma_productl (x_adj, 0, n, &eps);
return (__ieee754_expl (__ieee754_lgammal_r (x_adj, &local_signgam))
- * prod * (1.0L + eps));
+ * prod * (1 + eps));
}
else
{
- long double eps = 0;
- long double x_eps = 0;
- long double x_adj = x;
- long double prod = 1;
- if (x < 24.0L)
+ _Float128 eps = 0;
+ _Float128 x_eps = 0;
+ _Float128 x_adj = x;
+ _Float128 prod = 1;
+ if (x < 24)
{
/* Adjust into the range for applying Stirling's
approximation. */
- long double n = __ceill (24.0L - x);
+ _Float128 n = __ceill (24 - x);
x_adj = x + n;
x_eps = (x - (x_adj - n));
prod = __gamma_productl (x_adj - n, x_eps, n, &eps);
@@ -93,25 +93,25 @@ gammal_positive (long double x, int *exp2_adj)
Compute gamma (X_ADJ + X_EPS) using Stirling's approximation,
starting by computing pow (X_ADJ, X_ADJ) with a power of 2
factored out. */
- long double exp_adj = -eps;
- long double x_adj_int = __roundl (x_adj);
- long double x_adj_frac = x_adj - x_adj_int;
+ _Float128 exp_adj = -eps;
+ _Float128 x_adj_int = __roundl (x_adj);
+ _Float128 x_adj_frac = x_adj - x_adj_int;
int x_adj_log2;
- long double x_adj_mant = __frexpl (x_adj, &x_adj_log2);
+ _Float128 x_adj_mant = __frexpl (x_adj, &x_adj_log2);
if (x_adj_mant < M_SQRT1_2l)
{
x_adj_log2--;
- x_adj_mant *= 2.0L;
+ x_adj_mant *= 2;
}
*exp2_adj = x_adj_log2 * (int) x_adj_int;
- long double ret = (__ieee754_powl (x_adj_mant, x_adj)
- * __ieee754_exp2l (x_adj_log2 * x_adj_frac)
- * __ieee754_expl (-x_adj)
- * __ieee754_sqrtl (2 * M_PIl / x_adj)
- / prod);
+ _Float128 ret = (__ieee754_powl (x_adj_mant, x_adj)
+ * __ieee754_exp2l (x_adj_log2 * x_adj_frac)
+ * __ieee754_expl (-x_adj)
+ * __ieee754_sqrtl (2 * M_PIl / x_adj)
+ / prod);
exp_adj += x_eps * __ieee754_logl (x_adj);
- long double bsum = gamma_coeff[NCOEFF - 1];
- long double x_adj2 = x_adj * x_adj;
+ _Float128 bsum = gamma_coeff[NCOEFF - 1];
+ _Float128 x_adj2 = x_adj * x_adj;
for (size_t i = 1; i <= NCOEFF - 1; i++)
bsum = bsum / x_adj2 + gamma_coeff[NCOEFF - 1 - i];
exp_adj += bsum / x_adj;
@@ -119,12 +119,12 @@ gammal_positive (long double x, int *exp2_adj)
}
}
-long double
-__ieee754_gammal_r (long double x, int *signgamp)
+_Float128
+__ieee754_gammal_r (_Float128 x, int *signgamp)
{
int64_t hx;
u_int64_t lx;
- long double ret;
+ _Float128 ret;
GET_LDOUBLE_WORDS64 (hx, lx, x);
@@ -154,7 +154,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
return x + x;
}
- if (x >= 1756.0L)
+ if (x >= 1756)
{
/* Overflow. */
*signgamp = 0;
@@ -163,33 +163,33 @@ __ieee754_gammal_r (long double x, int *signgamp)
else
{
SET_RESTORE_ROUNDL (FE_TONEAREST);
- if (x > 0.0L)
+ if (x > 0)
{
*signgamp = 0;
int exp2_adj;
ret = gammal_positive (x, &exp2_adj);
ret = __scalbnl (ret, exp2_adj);
}
- else if (x >= -LDBL_EPSILON / 4.0L)
+ else if (x >= -LDBL_EPSILON / 4)
{
*signgamp = 0;
- ret = 1.0L / x;
+ ret = 1 / x;
}
else
{
- long double tx = __truncl (x);
- *signgamp = (tx == 2.0L * __truncl (tx / 2.0L)) ? -1 : 1;
- if (x <= -1775.0L)
+ _Float128 tx = __truncl (x);
+ *signgamp = (tx == 2 * __truncl (tx / 2)) ? -1 : 1;
+ if (x <= -1775)
/* Underflow. */
ret = LDBL_MIN * LDBL_MIN;
else
{
- long double frac = tx - x;
- if (frac > 0.5L)
- frac = 1.0L - frac;
- long double sinpix = (frac <= 0.25L
- ? __sinl (M_PIl * frac)
- : __cosl (M_PIl * (0.5L - frac)));
+ _Float128 frac = tx - x;
+ if (frac > L(0.5))
+ frac = 1 - frac;
+ _Float128 sinpix = (frac <= L(0.25)
+ ? __sinl (M_PIl * frac)
+ : __cosl (M_PIl * (L(0.5) - frac)));
int exp2_adj;
ret = M_PIl / (-x * sinpix
* gammal_positive (-x, &exp2_adj));
diff --git a/sysdeps/ieee754/ldbl-128/e_hypotl.c b/sysdeps/ieee754/ldbl-128/e_hypotl.c
index 80e5e38c72..a93f5a4c8f 100644
--- a/sysdeps/ieee754/ldbl-128/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128/e_hypotl.c
@@ -48,10 +48,10 @@
#include <math.h>
#include <math_private.h>
-long double
-__ieee754_hypotl(long double x, long double y)
+_Float128
+__ieee754_hypotl(_Float128 x, _Float128 y)
{
- long double a,b,t1,t2,y1,y2,w;
+ _Float128 a,b,t1,t2,y1,y2,w;
int64_t j,k,ha,hb;
GET_LDOUBLE_MSW64(ha,x);
@@ -127,7 +127,7 @@ __ieee754_hypotl(long double x, long double y)
}
if(k!=0) {
u_int64_t high;
- t1 = 1.0L;
+ t1 = 1;
GET_LDOUBLE_MSW64(high,t1);
SET_LDOUBLE_MSW64(t1,high+(k<<48));
w *= t1;
diff --git a/sysdeps/ieee754/ldbl-128/e_ilogbl.c b/sysdeps/ieee754/ldbl-128/e_ilogbl.c
index 0a476492d6..9effe6386a 100644
--- a/sysdeps/ieee754/ldbl-128/e_ilogbl.c
+++ b/sysdeps/ieee754/ldbl-128/e_ilogbl.c
@@ -28,7 +28,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-int __ieee754_ilogbl (long double x)
+int __ieee754_ilogbl (_Float128 x)
{
int64_t hx,lx;
int ix;
diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index ddc82143dc..d711007136 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -96,33 +96,33 @@
#include <float.h>
/* 1 / sqrt(pi) */
-static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
/* 2 / pi */
-static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
-static const long double zero = 0.0L;
+static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
+static const _Float128 zero = 0;
/* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2)
Peak relative error 3.4e-37
0 <= x <= 2 */
#define NJ0_2N 6
-static const long double J0_2N[NJ0_2N + 1] = {
- 3.133239376997663645548490085151484674892E16L,
- -5.479944965767990821079467311839107722107E14L,
- 6.290828903904724265980249871997551894090E12L,
- -3.633750176832769659849028554429106299915E10L,
- 1.207743757532429576399485415069244807022E8L,
- -2.107485999925074577174305650549367415465E5L,
- 1.562826808020631846245296572935547005859E2L,
+static const _Float128 J0_2N[NJ0_2N + 1] = {
+ L(3.133239376997663645548490085151484674892E16),
+ L(-5.479944965767990821079467311839107722107E14),
+ L(6.290828903904724265980249871997551894090E12),
+ L(-3.633750176832769659849028554429106299915E10),
+ L(1.207743757532429576399485415069244807022E8),
+ L(-2.107485999925074577174305650549367415465E5),
+ L(1.562826808020631846245296572935547005859E2),
};
#define NJ0_2D 6
-static const long double J0_2D[NJ0_2D + 1] = {
- 2.005273201278504733151033654496928968261E18L,
- 2.063038558793221244373123294054149790864E16L,
- 1.053350447931127971406896594022010524994E14L,
- 3.496556557558702583143527876385508882310E11L,
- 8.249114511878616075860654484367133976306E8L,
- 1.402965782449571800199759247964242790589E6L,
- 1.619910762853439600957801751815074787351E3L,
+static const _Float128 J0_2D[NJ0_2D + 1] = {
+ L(2.005273201278504733151033654496928968261E18),
+ L(2.063038558793221244373123294054149790864E16),
+ L(1.053350447931127971406896594022010524994E14),
+ L(3.496556557558702583143527876385508882310E11),
+ L(8.249114511878616075860654484367133976306E8),
+ L(1.402965782449571800199759247964242790589E6),
+ L(1.619910762853439600957801751815074787351E3),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -130,30 +130,30 @@ static const long double J0_2D[NJ0_2D + 1] = {
0 <= 1/x <= .0625
Peak relative error 3.3e-36 */
#define NP16_IN 9
-static const long double P16_IN[NP16_IN + 1] = {
- -1.901689868258117463979611259731176301065E-16L,
- -1.798743043824071514483008340803573980931E-13L,
- -6.481746687115262291873324132944647438959E-11L,
- -1.150651553745409037257197798528294248012E-8L,
- -1.088408467297401082271185599507222695995E-6L,
- -5.551996725183495852661022587879817546508E-5L,
- -1.477286941214245433866838787454880214736E-3L,
- -1.882877976157714592017345347609200402472E-2L,
- -9.620983176855405325086530374317855880515E-2L,
- -1.271468546258855781530458854476627766233E-1L,
+static const _Float128 P16_IN[NP16_IN + 1] = {
+ L(-1.901689868258117463979611259731176301065E-16),
+ L(-1.798743043824071514483008340803573980931E-13),
+ L(-6.481746687115262291873324132944647438959E-11),
+ L(-1.150651553745409037257197798528294248012E-8),
+ L(-1.088408467297401082271185599507222695995E-6),
+ L(-5.551996725183495852661022587879817546508E-5),
+ L(-1.477286941214245433866838787454880214736E-3),
+ L(-1.882877976157714592017345347609200402472E-2),
+ L(-9.620983176855405325086530374317855880515E-2),
+ L(-1.271468546258855781530458854476627766233E-1),
};
#define NP16_ID 9
-static const long double P16_ID[NP16_ID + 1] = {
- 2.704625590411544837659891569420764475007E-15L,
- 2.562526347676857624104306349421985403573E-12L,
- 9.259137589952741054108665570122085036246E-10L,
- 1.651044705794378365237454962653430805272E-7L,
- 1.573561544138733044977714063100859136660E-5L,
- 8.134482112334882274688298469629884804056E-4L,
- 2.219259239404080863919375103673593571689E-2L,
- 2.976990606226596289580242451096393862792E-1L,
- 1.713895630454693931742734911930937246254E0L,
- 3.231552290717904041465898249160757368855E0L,
+static const _Float128 P16_ID[NP16_ID + 1] = {
+ L(2.704625590411544837659891569420764475007E-15),
+ L(2.562526347676857624104306349421985403573E-12),
+ L(9.259137589952741054108665570122085036246E-10),
+ L(1.651044705794378365237454962653430805272E-7),
+ L(1.573561544138733044977714063100859136660E-5),
+ L(8.134482112334882274688298469629884804056E-4),
+ L(2.219259239404080863919375103673593571689E-2),
+ L(2.976990606226596289580242451096393862792E-1),
+ L(1.713895630454693931742734911930937246254E0),
+ L(3.231552290717904041465898249160757368855E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -161,32 +161,32 @@ static const long double P16_ID[NP16_ID + 1] = {
0.0625 <= 1/x <= 0.125
Peak relative error 2.4e-35 */
#define NP8_16N 10
-static const long double P8_16N[NP8_16N + 1] = {
- -2.335166846111159458466553806683579003632E-15L,
- -1.382763674252402720401020004169367089975E-12L,
- -3.192160804534716696058987967592784857907E-10L,
- -3.744199606283752333686144670572632116899E-8L,
- -2.439161236879511162078619292571922772224E-6L,
- -9.068436986859420951664151060267045346549E-5L,
- -1.905407090637058116299757292660002697359E-3L,
- -2.164456143936718388053842376884252978872E-2L,
- -1.212178415116411222341491717748696499966E-1L,
- -2.782433626588541494473277445959593334494E-1L,
- -1.670703190068873186016102289227646035035E-1L,
+static const _Float128 P8_16N[NP8_16N + 1] = {
+ L(-2.335166846111159458466553806683579003632E-15),
+ L(-1.382763674252402720401020004169367089975E-12),
+ L(-3.192160804534716696058987967592784857907E-10),
+ L(-3.744199606283752333686144670572632116899E-8),
+ L(-2.439161236879511162078619292571922772224E-6),
+ L(-9.068436986859420951664151060267045346549E-5),
+ L(-1.905407090637058116299757292660002697359E-3),
+ L(-2.164456143936718388053842376884252978872E-2),
+ L(-1.212178415116411222341491717748696499966E-1),
+ L(-2.782433626588541494473277445959593334494E-1),
+ L(-1.670703190068873186016102289227646035035E-1),
};
#define NP8_16D 10
-static const long double P8_16D[NP8_16D + 1] = {
- 3.321126181135871232648331450082662856743E-14L,
- 1.971894594837650840586859228510007703641E-11L,
- 4.571144364787008285981633719513897281690E-9L,
- 5.396419143536287457142904742849052402103E-7L,
- 3.551548222385845912370226756036899901549E-5L,
- 1.342353874566932014705609788054598013516E-3L,
- 2.899133293006771317589357444614157734385E-2L,
- 3.455374978185770197704507681491574261545E-1L,
- 2.116616964297512311314454834712634820514E0L,
- 5.850768316827915470087758636881584174432E0L,
- 5.655273858938766830855753983631132928968E0L,
+static const _Float128 P8_16D[NP8_16D + 1] = {
+ L(3.321126181135871232648331450082662856743E-14),
+ L(1.971894594837650840586859228510007703641E-11),
+ L(4.571144364787008285981633719513897281690E-9),
+ L(5.396419143536287457142904742849052402103E-7),
+ L(3.551548222385845912370226756036899901549E-5),
+ L(1.342353874566932014705609788054598013516E-3),
+ L(2.899133293006771317589357444614157734385E-2),
+ L(3.455374978185770197704507681491574261545E-1),
+ L(2.116616964297512311314454834712634820514E0),
+ L(5.850768316827915470087758636881584174432E0),
+ L(5.655273858938766830855753983631132928968E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -194,31 +194,31 @@ static const long double P8_16D[NP8_16D + 1] = {
0.125 <= 1/x <= 0.1875
Peak relative error 2.7e-35 */
#define NP5_8N 10
-static const long double P5_8N[NP5_8N + 1] = {
- -1.270478335089770355749591358934012019596E-12L,
- -4.007588712145412921057254992155810347245E-10L,
- -4.815187822989597568124520080486652009281E-8L,
- -2.867070063972764880024598300408284868021E-6L,
- -9.218742195161302204046454768106063638006E-5L,
- -1.635746821447052827526320629828043529997E-3L,
- -1.570376886640308408247709616497261011707E-2L,
- -7.656484795303305596941813361786219477807E-2L,
- -1.659371030767513274944805479908858628053E-1L,
- -1.185340550030955660015841796219919804915E-1L,
- -8.920026499909994671248893388013790366712E-3L,
+static const _Float128 P5_8N[NP5_8N + 1] = {
+ L(-1.270478335089770355749591358934012019596E-12),
+ L(-4.007588712145412921057254992155810347245E-10),
+ L(-4.815187822989597568124520080486652009281E-8),
+ L(-2.867070063972764880024598300408284868021E-6),
+ L(-9.218742195161302204046454768106063638006E-5),
+ L(-1.635746821447052827526320629828043529997E-3),
+ L(-1.570376886640308408247709616497261011707E-2),
+ L(-7.656484795303305596941813361786219477807E-2),
+ L(-1.659371030767513274944805479908858628053E-1),
+ L(-1.185340550030955660015841796219919804915E-1),
+ L(-8.920026499909994671248893388013790366712E-3),
};
#define NP5_8D 9
-static const long double P5_8D[NP5_8D + 1] = {
- 1.806902521016705225778045904631543990314E-11L,
- 5.728502760243502431663549179135868966031E-9L,
- 6.938168504826004255287618819550667978450E-7L,
- 4.183769964807453250763325026573037785902E-5L,
- 1.372660678476925468014882230851637878587E-3L,
- 2.516452105242920335873286419212708961771E-2L,
- 2.550502712902647803796267951846557316182E-1L,
- 1.365861559418983216913629123778747617072E0L,
- 3.523825618308783966723472468855042541407E0L,
- 3.656365803506136165615111349150536282434E0L,
+static const _Float128 P5_8D[NP5_8D + 1] = {
+ L(1.806902521016705225778045904631543990314E-11),
+ L(5.728502760243502431663549179135868966031E-9),
+ L(6.938168504826004255287618819550667978450E-7),
+ L(4.183769964807453250763325026573037785902E-5),
+ L(1.372660678476925468014882230851637878587E-3),
+ L(2.516452105242920335873286419212708961771E-2),
+ L(2.550502712902647803796267951846557316182E-1),
+ L(1.365861559418983216913629123778747617072E0),
+ L(3.523825618308783966723472468855042541407E0),
+ L(3.656365803506136165615111349150536282434E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -226,30 +226,30 @@ static const long double P5_8D[NP5_8D + 1] = {
Peak relative error 3.5e-35
0.1875 <= 1/x <= 0.25 */
#define NP4_5N 9
-static const long double P4_5N[NP4_5N + 1] = {
- -9.791405771694098960254468859195175708252E-10L,
- -1.917193059944531970421626610188102836352E-7L,
- -1.393597539508855262243816152893982002084E-5L,
- -4.881863490846771259880606911667479860077E-4L,
- -8.946571245022470127331892085881699269853E-3L,
- -8.707474232568097513415336886103899434251E-2L,
- -4.362042697474650737898551272505525973766E-1L,
- -1.032712171267523975431451359962375617386E0L,
- -9.630502683169895107062182070514713702346E-1L,
- -2.251804386252969656586810309252357233320E-1L,
+static const _Float128 P4_5N[NP4_5N + 1] = {
+ L(-9.791405771694098960254468859195175708252E-10),
+ L(-1.917193059944531970421626610188102836352E-7),
+ L(-1.393597539508855262243816152893982002084E-5),
+ L(-4.881863490846771259880606911667479860077E-4),
+ L(-8.946571245022470127331892085881699269853E-3),
+ L(-8.707474232568097513415336886103899434251E-2),
+ L(-4.362042697474650737898551272505525973766E-1),
+ L(-1.032712171267523975431451359962375617386E0),
+ L(-9.630502683169895107062182070514713702346E-1),
+ L(-2.251804386252969656586810309252357233320E-1),
};
#define NP4_5D 9
-static const long double P4_5D[NP4_5D + 1] = {
- 1.392555487577717669739688337895791213139E-8L,
- 2.748886559120659027172816051276451376854E-6L,
- 2.024717710644378047477189849678576659290E-4L,
- 7.244868609350416002930624752604670292469E-3L,
- 1.373631762292244371102989739300382152416E-1L,
- 1.412298581400224267910294815260613240668E0L,
- 7.742495637843445079276397723849017617210E0L,
- 2.138429269198406512028307045259503811861E1L,
- 2.651547684548423476506826951831712762610E1L,
- 1.167499382465291931571685222882909166935E1L,
+static const _Float128 P4_5D[NP4_5D + 1] = {
+ L(1.392555487577717669739688337895791213139E-8),
+ L(2.748886559120659027172816051276451376854E-6),
+ L(2.024717710644378047477189849678576659290E-4),
+ L(7.244868609350416002930624752604670292469E-3),
+ L(1.373631762292244371102989739300382152416E-1),
+ L(1.412298581400224267910294815260613240668E0),
+ L(7.742495637843445079276397723849017617210E0),
+ L(2.138429269198406512028307045259503811861E1),
+ L(2.651547684548423476506826951831712762610E1),
+ L(1.167499382465291931571685222882909166935E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -257,30 +257,30 @@ static const long double P4_5D[NP4_5D + 1] = {
Peak relative error 2.3e-36
0.25 <= 1/x <= 0.3125 */
#define NP3r2_4N 9
-static const long double P3r2_4N[NP3r2_4N + 1] = {
- -2.589155123706348361249809342508270121788E-8L,
- -3.746254369796115441118148490849195516593E-6L,
- -1.985595497390808544622893738135529701062E-4L,
- -5.008253705202932091290132760394976551426E-3L,
- -6.529469780539591572179155511840853077232E-2L,
- -4.468736064761814602927408833818990271514E-1L,
- -1.556391252586395038089729428444444823380E0L,
- -2.533135309840530224072920725976994981638E0L,
- -1.605509621731068453869408718565392869560E0L,
- -2.518966692256192789269859830255724429375E-1L,
+static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
+ L(-2.589155123706348361249809342508270121788E-8),
+ L(-3.746254369796115441118148490849195516593E-6),
+ L(-1.985595497390808544622893738135529701062E-4),
+ L(-5.008253705202932091290132760394976551426E-3),
+ L(-6.529469780539591572179155511840853077232E-2),
+ L(-4.468736064761814602927408833818990271514E-1),
+ L(-1.556391252586395038089729428444444823380E0),
+ L(-2.533135309840530224072920725976994981638E0),
+ L(-1.605509621731068453869408718565392869560E0),
+ L(-2.518966692256192789269859830255724429375E-1),
};
#define NP3r2_4D 9
-static const long double P3r2_4D[NP3r2_4D + 1] = {
- 3.682353957237979993646169732962573930237E-7L,
- 5.386741661883067824698973455566332102029E-5L,
- 2.906881154171822780345134853794241037053E-3L,
- 7.545832595801289519475806339863492074126E-2L,
- 1.029405357245594877344360389469584526654E0L,
- 7.565706120589873131187989560509757626725E0L,
- 2.951172890699569545357692207898667665796E1L,
- 5.785723537170311456298467310529815457536E1L,
- 5.095621464598267889126015412522773474467E1L,
- 1.602958484169953109437547474953308401442E1L,
+static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
+ L(3.682353957237979993646169732962573930237E-7),
+ L(5.386741661883067824698973455566332102029E-5),
+ L(2.906881154171822780345134853794241037053E-3),
+ L(7.545832595801289519475806339863492074126E-2),
+ L(1.029405357245594877344360389469584526654E0),
+ L(7.565706120589873131187989560509757626725E0),
+ L(2.951172890699569545357692207898667665796E1),
+ L(5.785723537170311456298467310529815457536E1),
+ L(5.095621464598267889126015412522773474467E1),
+ L(1.602958484169953109437547474953308401442E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -288,29 +288,29 @@ static const long double P3r2_4D[NP3r2_4D + 1] = {
Peak relative error 1.0e-35
0.3125 <= 1/x <= 0.375 */
#define NP2r7_3r2N 9
-static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
- -1.917322340814391131073820537027234322550E-7L,
- -1.966595744473227183846019639723259011906E-5L,
- -7.177081163619679403212623526632690465290E-4L,
- -1.206467373860974695661544653741899755695E-2L,
- -1.008656452188539812154551482286328107316E-1L,
- -4.216016116408810856620947307438823892707E-1L,
- -8.378631013025721741744285026537009814161E-1L,
- -6.973895635309960850033762745957946272579E-1L,
- -1.797864718878320770670740413285763554812E-1L,
- -4.098025357743657347681137871388402849581E-3L,
+static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
+ L(-1.917322340814391131073820537027234322550E-7),
+ L(-1.966595744473227183846019639723259011906E-5),
+ L(-7.177081163619679403212623526632690465290E-4),
+ L(-1.206467373860974695661544653741899755695E-2),
+ L(-1.008656452188539812154551482286328107316E-1),
+ L(-4.216016116408810856620947307438823892707E-1),
+ L(-8.378631013025721741744285026537009814161E-1),
+ L(-6.973895635309960850033762745957946272579E-1),
+ L(-1.797864718878320770670740413285763554812E-1),
+ L(-4.098025357743657347681137871388402849581E-3),
};
#define NP2r7_3r2D 8
-static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
- 2.726858489303036441686496086962545034018E-6L,
- 2.840430827557109238386808968234848081424E-4L,
- 1.063826772041781947891481054529454088832E-2L,
- 1.864775537138364773178044431045514405468E-1L,
- 1.665660052857205170440952607701728254211E0L,
- 7.723745889544331153080842168958348568395E0L,
- 1.810726427571829798856428548102077799835E1L,
- 1.986460672157794440666187503833545388527E1L,
- 8.645503204552282306364296517220055815488E0L,
+static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
+ L(2.726858489303036441686496086962545034018E-6),
+ L(2.840430827557109238386808968234848081424E-4),
+ L(1.063826772041781947891481054529454088832E-2),
+ L(1.864775537138364773178044431045514405468E-1),
+ L(1.665660052857205170440952607701728254211E0),
+ L(7.723745889544331153080842168958348568395E0),
+ L(1.810726427571829798856428548102077799835E1),
+ L(1.986460672157794440666187503833545388527E1),
+ L(8.645503204552282306364296517220055815488E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -318,29 +318,29 @@ static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
Peak relative error 1.3e-36
0.3125 <= 1/x <= 0.4375 */
#define NP2r3_2r7N 9
-static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
- -1.594642785584856746358609622003310312622E-6L,
- -1.323238196302221554194031733595194539794E-4L,
- -3.856087818696874802689922536987100372345E-3L,
- -5.113241710697777193011470733601522047399E-2L,
- -3.334229537209911914449990372942022350558E-1L,
- -1.075703518198127096179198549659283422832E0L,
- -1.634174803414062725476343124267110981807E0L,
- -1.030133247434119595616826842367268304880E0L,
- -1.989811539080358501229347481000707289391E-1L,
- -3.246859189246653459359775001466924610236E-3L,
+static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
+ L(-1.594642785584856746358609622003310312622E-6),
+ L(-1.323238196302221554194031733595194539794E-4),
+ L(-3.856087818696874802689922536987100372345E-3),
+ L(-5.113241710697777193011470733601522047399E-2),
+ L(-3.334229537209911914449990372942022350558E-1),
+ L(-1.075703518198127096179198549659283422832E0),
+ L(-1.634174803414062725476343124267110981807E0),
+ L(-1.030133247434119595616826842367268304880E0),
+ L(-1.989811539080358501229347481000707289391E-1),
+ L(-3.246859189246653459359775001466924610236E-3),
};
#define NP2r3_2r7D 8
-static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
- 2.267936634217251403663034189684284173018E-5L,
- 1.918112982168673386858072491437971732237E-3L,
- 5.771704085468423159125856786653868219522E-2L,
- 8.056124451167969333717642810661498890507E-1L,
- 5.687897967531010276788680634413789328776E0L,
- 2.072596760717695491085444438270778394421E1L,
- 3.801722099819929988585197088613160496684E1L,
- 3.254620235902912339534998592085115836829E1L,
- 1.104847772130720331801884344645060675036E1L,
+static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
+ L(2.267936634217251403663034189684284173018E-5),
+ L(1.918112982168673386858072491437971732237E-3),
+ L(5.771704085468423159125856786653868219522E-2),
+ L(8.056124451167969333717642810661498890507E-1),
+ L(5.687897967531010276788680634413789328776E0),
+ L(2.072596760717695491085444438270778394421E1),
+ L(3.801722099819929988585197088613160496684E1),
+ L(3.254620235902912339534998592085115836829E1),
+ L(1.104847772130720331801884344645060675036E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -348,28 +348,28 @@ static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
Peak relative error 1.2e-35
0.4375 <= 1/x <= 0.5 */
#define NP2_2r3N 8
-static const long double P2_2r3N[NP2_2r3N + 1] = {
- -1.001042324337684297465071506097365389123E-4L,
- -6.289034524673365824853547252689991418981E-3L,
- -1.346527918018624234373664526930736205806E-1L,
- -1.268808313614288355444506172560463315102E0L,
- -5.654126123607146048354132115649177406163E0L,
- -1.186649511267312652171775803270911971693E1L,
- -1.094032424931998612551588246779200724257E1L,
- -3.728792136814520055025256353193674625267E0L,
- -3.000348318524471807839934764596331810608E-1L,
+static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
+ L(-1.001042324337684297465071506097365389123E-4),
+ L(-6.289034524673365824853547252689991418981E-3),
+ L(-1.346527918018624234373664526930736205806E-1),
+ L(-1.268808313614288355444506172560463315102E0),
+ L(-5.654126123607146048354132115649177406163E0),
+ L(-1.186649511267312652171775803270911971693E1),
+ L(-1.094032424931998612551588246779200724257E1),
+ L(-3.728792136814520055025256353193674625267E0),
+ L(-3.000348318524471807839934764596331810608E-1),
};
#define NP2_2r3D 8
-static const long double P2_2r3D[NP2_2r3D + 1] = {
- 1.423705538269770974803901422532055612980E-3L,
- 9.171476630091439978533535167485230575894E-2L,
- 2.049776318166637248868444600215942828537E0L,
- 2.068970329743769804547326701946144899583E1L,
- 1.025103500560831035592731539565060347709E2L,
- 2.528088049697570728252145557167066708284E2L,
- 2.992160327587558573740271294804830114205E2L,
- 1.540193761146551025832707739468679973036E2L,
- 2.779516701986912132637672140709452502650E1L,
+static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
+ L(1.423705538269770974803901422532055612980E-3),
+ L(9.171476630091439978533535167485230575894E-2),
+ L(2.049776318166637248868444600215942828537E0),
+ L(2.068970329743769804547326701946144899583E1),
+ L(1.025103500560831035592731539565060347709E2),
+ L(2.528088049697570728252145557167066708284E2),
+ L(2.992160327587558573740271294804830114205E2),
+ L(1.540193761146551025832707739468679973036E2),
+ L(2.779516701986912132637672140709452502650E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -378,31 +378,31 @@ static const long double P2_2r3D[NP2_2r3D + 1] = {
Peak relative error 2.2e-35
0 <= 1/x <= .0625 */
#define NQ16_IN 10
-static const long double Q16_IN[NQ16_IN + 1] = {
- 2.343640834407975740545326632205999437469E-18L,
- 2.667978112927811452221176781536278257448E-15L,
- 1.178415018484555397390098879501969116536E-12L,
- 2.622049767502719728905924701288614016597E-10L,
- 3.196908059607618864801313380896308968673E-8L,
- 2.179466154171673958770030655199434798494E-6L,
- 8.139959091628545225221976413795645177291E-5L,
- 1.563900725721039825236927137885747138654E-3L,
- 1.355172364265825167113562519307194840307E-2L,
- 3.928058355906967977269780046844768588532E-2L,
- 1.107891967702173292405380993183694932208E-2L,
+static const _Float128 Q16_IN[NQ16_IN + 1] = {
+ L(2.343640834407975740545326632205999437469E-18),
+ L(2.667978112927811452221176781536278257448E-15),
+ L(1.178415018484555397390098879501969116536E-12),
+ L(2.622049767502719728905924701288614016597E-10),
+ L(3.196908059607618864801313380896308968673E-8),
+ L(2.179466154171673958770030655199434798494E-6),
+ L(8.139959091628545225221976413795645177291E-5),
+ L(1.563900725721039825236927137885747138654E-3),
+ L(1.355172364265825167113562519307194840307E-2),
+ L(3.928058355906967977269780046844768588532E-2),
+ L(1.107891967702173292405380993183694932208E-2),
};
#define NQ16_ID 9
-static const long double Q16_ID[NQ16_ID + 1] = {
- 3.199850952578356211091219295199301766718E-17L,
- 3.652601488020654842194486058637953363918E-14L,
- 1.620179741394865258354608590461839031281E-11L,
- 3.629359209474609630056463248923684371426E-9L,
- 4.473680923894354600193264347733477363305E-7L,
- 3.106368086644715743265603656011050476736E-5L,
- 1.198239259946770604954664925153424252622E-3L,
- 2.446041004004283102372887804475767568272E-2L,
- 2.403235525011860603014707768815113698768E-1L,
- 9.491006790682158612266270665136910927149E-1L,
+static const _Float128 Q16_ID[NQ16_ID + 1] = {
+ L(3.199850952578356211091219295199301766718E-17),
+ L(3.652601488020654842194486058637953363918E-14),
+ L(1.620179741394865258354608590461839031281E-11),
+ L(3.629359209474609630056463248923684371426E-9),
+ L(4.473680923894354600193264347733477363305E-7),
+ L(3.106368086644715743265603656011050476736E-5),
+ L(1.198239259946770604954664925153424252622E-3),
+ L(2.446041004004283102372887804475767568272E-2),
+ L(2.403235525011860603014707768815113698768E-1),
+ L(9.491006790682158612266270665136910927149E-1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -411,34 +411,34 @@ static const long double Q16_ID[NQ16_ID + 1] = {
Peak relative error 5.1e-36
0.0625 <= 1/x <= 0.125 */
#define NQ8_16N 11
-static const long double Q8_16N[NQ8_16N + 1] = {
- 1.001954266485599464105669390693597125904E-17L,
- 7.545499865295034556206475956620160007849E-15L,
- 2.267838684785673931024792538193202559922E-12L,
- 3.561909705814420373609574999542459912419E-10L,
- 3.216201422768092505214730633842924944671E-8L,
- 1.731194793857907454569364622452058554314E-6L,
- 5.576944613034537050396518509871004586039E-5L,
- 1.051787760316848982655967052985391418146E-3L,
- 1.102852974036687441600678598019883746959E-2L,
- 5.834647019292460494254225988766702933571E-2L,
- 1.290281921604364618912425380717127576529E-1L,
- 7.598886310387075708640370806458926458301E-2L,
+static const _Float128 Q8_16N[NQ8_16N + 1] = {
+ L(1.001954266485599464105669390693597125904E-17),
+ L(7.545499865295034556206475956620160007849E-15),
+ L(2.267838684785673931024792538193202559922E-12),
+ L(3.561909705814420373609574999542459912419E-10),
+ L(3.216201422768092505214730633842924944671E-8),
+ L(1.731194793857907454569364622452058554314E-6),
+ L(5.576944613034537050396518509871004586039E-5),
+ L(1.051787760316848982655967052985391418146E-3),
+ L(1.102852974036687441600678598019883746959E-2),
+ L(5.834647019292460494254225988766702933571E-2),
+ L(1.290281921604364618912425380717127576529E-1),
+ L(7.598886310387075708640370806458926458301E-2),
};
#define NQ8_16D 11
-static const long double Q8_16D[NQ8_16D + 1] = {
- 1.368001558508338469503329967729951830843E-16L,
- 1.034454121857542147020549303317348297289E-13L,
- 3.128109209247090744354764050629381674436E-11L,
- 4.957795214328501986562102573522064468671E-9L,
- 4.537872468606711261992676606899273588899E-7L,
- 2.493639207101727713192687060517509774182E-5L,
- 8.294957278145328349785532236663051405805E-4L,
- 1.646471258966713577374948205279380115839E-2L,
- 1.878910092770966718491814497982191447073E-1L,
- 1.152641605706170353727903052525652504075E0L,
- 3.383550240669773485412333679367792932235E0L,
- 3.823875252882035706910024716609908473970E0L,
+static const _Float128 Q8_16D[NQ8_16D + 1] = {
+ L(1.368001558508338469503329967729951830843E-16),
+ L(1.034454121857542147020549303317348297289E-13),
+ L(3.128109209247090744354764050629381674436E-11),
+ L(4.957795214328501986562102573522064468671E-9),
+ L(4.537872468606711261992676606899273588899E-7),
+ L(2.493639207101727713192687060517509774182E-5),
+ L(8.294957278145328349785532236663051405805E-4),
+ L(1.646471258966713577374948205279380115839E-2),
+ L(1.878910092770966718491814497982191447073E-1),
+ L(1.152641605706170353727903052525652504075E0),
+ L(3.383550240669773485412333679367792932235E0),
+ L(3.823875252882035706910024716609908473970E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -447,32 +447,32 @@ static const long double Q8_16D[NQ8_16D + 1] = {
Peak relative error 3.9e-35
0.125 <= 1/x <= 0.1875 */
#define NQ5_8N 10
-static const long double Q5_8N[NQ5_8N + 1] = {
- 1.750399094021293722243426623211733898747E-13L,
- 6.483426211748008735242909236490115050294E-11L,
- 9.279430665656575457141747875716899958373E-9L,
- 6.696634968526907231258534757736576340266E-7L,
- 2.666560823798895649685231292142838188061E-5L,
- 6.025087697259436271271562769707550594540E-4L,
- 7.652807734168613251901945778921336353485E-3L,
- 5.226269002589406461622551452343519078905E-2L,
- 1.748390159751117658969324896330142895079E-1L,
- 2.378188719097006494782174902213083589660E-1L,
- 8.383984859679804095463699702165659216831E-2L,
+static const _Float128 Q5_8N[NQ5_8N + 1] = {
+ L(1.750399094021293722243426623211733898747E-13),
+ L(6.483426211748008735242909236490115050294E-11),
+ L(9.279430665656575457141747875716899958373E-9),
+ L(6.696634968526907231258534757736576340266E-7),
+ L(2.666560823798895649685231292142838188061E-5),
+ L(6.025087697259436271271562769707550594540E-4),
+ L(7.652807734168613251901945778921336353485E-3),
+ L(5.226269002589406461622551452343519078905E-2),
+ L(1.748390159751117658969324896330142895079E-1),
+ L(2.378188719097006494782174902213083589660E-1),
+ L(8.383984859679804095463699702165659216831E-2),
};
#define NQ5_8D 10
-static const long double Q5_8D[NQ5_8D + 1] = {
- 2.389878229704327939008104855942987615715E-12L,
- 8.926142817142546018703814194987786425099E-10L,
- 1.294065862406745901206588525833274399038E-7L,
- 9.524139899457666250828752185212769682191E-6L,
- 3.908332488377770886091936221573123353489E-4L,
- 9.250427033957236609624199884089916836748E-3L,
- 1.263420066165922645975830877751588421451E-1L,
- 9.692527053860420229711317379861733180654E-1L,
- 3.937813834630430172221329298841520707954E0L,
- 7.603126427436356534498908111445191312181E0L,
- 5.670677653334105479259958485084550934305E0L,
+static const _Float128 Q5_8D[NQ5_8D + 1] = {
+ L(2.389878229704327939008104855942987615715E-12),
+ L(8.926142817142546018703814194987786425099E-10),
+ L(1.294065862406745901206588525833274399038E-7),
+ L(9.524139899457666250828752185212769682191E-6),
+ L(3.908332488377770886091936221573123353489E-4),
+ L(9.250427033957236609624199884089916836748E-3),
+ L(1.263420066165922645975830877751588421451E-1),
+ L(9.692527053860420229711317379861733180654E-1),
+ L(3.937813834630430172221329298841520707954E0),
+ L(7.603126427436356534498908111445191312181E0),
+ L(5.670677653334105479259958485084550934305E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -481,31 +481,31 @@ static const long double Q5_8D[NQ5_8D + 1] = {
Peak relative error 3.2e-35
0.1875 <= 1/x <= 0.25 */
#define NQ4_5N 10
-static const long double Q4_5N[NQ4_5N + 1] = {
- 2.233870042925895644234072357400122854086E-11L,
- 5.146223225761993222808463878999151699792E-9L,
- 4.459114531468296461688753521109797474523E-7L,
- 1.891397692931537975547242165291668056276E-5L,
- 4.279519145911541776938964806470674565504E-4L,
- 5.275239415656560634702073291768904783989E-3L,
- 3.468698403240744801278238473898432608887E-2L,
- 1.138773146337708415188856882915457888274E-1L,
- 1.622717518946443013587108598334636458955E-1L,
- 7.249040006390586123760992346453034628227E-2L,
- 1.941595365256460232175236758506411486667E-3L,
+static const _Float128 Q4_5N[NQ4_5N + 1] = {
+ L(2.233870042925895644234072357400122854086E-11),
+ L(5.146223225761993222808463878999151699792E-9),
+ L(4.459114531468296461688753521109797474523E-7),
+ L(1.891397692931537975547242165291668056276E-5),
+ L(4.279519145911541776938964806470674565504E-4),
+ L(5.275239415656560634702073291768904783989E-3),
+ L(3.468698403240744801278238473898432608887E-2),
+ L(1.138773146337708415188856882915457888274E-1),
+ L(1.622717518946443013587108598334636458955E-1),
+ L(7.249040006390586123760992346453034628227E-2),
+ L(1.941595365256460232175236758506411486667E-3),
};
#define NQ4_5D 9
-static const long double Q4_5D[NQ4_5D + 1] = {
- 3.049977232266999249626430127217988047453E-10L,
- 7.120883230531035857746096928889676144099E-8L,
- 6.301786064753734446784637919554359588859E-6L,
- 2.762010530095069598480766869426308077192E-4L,
- 6.572163250572867859316828886203406361251E-3L,
- 8.752566114841221958200215255461843397776E-2L,
- 6.487654992874805093499285311075289932664E-1L,
- 2.576550017826654579451615283022812801435E0L,
- 5.056392229924022835364779562707348096036E0L,
- 4.179770081068251464907531367859072157773E0L,
+static const _Float128 Q4_5D[NQ4_5D + 1] = {
+ L(3.049977232266999249626430127217988047453E-10),
+ L(7.120883230531035857746096928889676144099E-8),
+ L(6.301786064753734446784637919554359588859E-6),
+ L(2.762010530095069598480766869426308077192E-4),
+ L(6.572163250572867859316828886203406361251E-3),
+ L(8.752566114841221958200215255461843397776E-2),
+ L(6.487654992874805093499285311075289932664E-1),
+ L(2.576550017826654579451615283022812801435E0),
+ L(5.056392229924022835364779562707348096036E0),
+ L(4.179770081068251464907531367859072157773E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -514,31 +514,31 @@ static const long double Q4_5D[NQ4_5D + 1] = {
Peak relative error 1.4e-36
0.25 <= 1/x <= 0.3125 */
#define NQ3r2_4N 10
-static const long double Q3r2_4N[NQ3r2_4N + 1] = {
- 6.126167301024815034423262653066023684411E-10L,
- 1.043969327113173261820028225053598975128E-7L,
- 6.592927270288697027757438170153763220190E-6L,
- 2.009103660938497963095652951912071336730E-4L,
- 3.220543385492643525985862356352195896964E-3L,
- 2.774405975730545157543417650436941650990E-2L,
- 1.258114008023826384487378016636555041129E-1L,
- 2.811724258266902502344701449984698323860E-1L,
- 2.691837665193548059322831687432415014067E-1L,
- 7.949087384900985370683770525312735605034E-2L,
- 1.229509543620976530030153018986910810747E-3L,
+static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
+ L(6.126167301024815034423262653066023684411E-10),
+ L(1.043969327113173261820028225053598975128E-7),
+ L(6.592927270288697027757438170153763220190E-6),
+ L(2.009103660938497963095652951912071336730E-4),
+ L(3.220543385492643525985862356352195896964E-3),
+ L(2.774405975730545157543417650436941650990E-2),
+ L(1.258114008023826384487378016636555041129E-1),
+ L(2.811724258266902502344701449984698323860E-1),
+ L(2.691837665193548059322831687432415014067E-1),
+ L(7.949087384900985370683770525312735605034E-2),
+ L(1.229509543620976530030153018986910810747E-3),
};
#define NQ3r2_4D 9
-static const long double Q3r2_4D[NQ3r2_4D + 1] = {
- 8.364260446128475461539941389210166156568E-9L,
- 1.451301850638956578622154585560759862764E-6L,
- 9.431830010924603664244578867057141839463E-5L,
- 3.004105101667433434196388593004526182741E-3L,
- 5.148157397848271739710011717102773780221E-2L,
- 4.901089301726939576055285374953887874895E-1L,
- 2.581760991981709901216967665934142240346E0L,
- 7.257105880775059281391729708630912791847E0L,
- 1.006014717326362868007913423810737369312E1L,
- 5.879416600465399514404064187445293212470E0L,
+static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
+ L(8.364260446128475461539941389210166156568E-9),
+ L(1.451301850638956578622154585560759862764E-6),
+ L(9.431830010924603664244578867057141839463E-5),
+ L(3.004105101667433434196388593004526182741E-3),
+ L(5.148157397848271739710011717102773780221E-2),
+ L(4.901089301726939576055285374953887874895E-1),
+ L(2.581760991981709901216967665934142240346E0),
+ L(7.257105880775059281391729708630912791847E0),
+ L(1.006014717326362868007913423810737369312E1),
+ L(5.879416600465399514404064187445293212470E0),
/* 1.000000000000000000000000000000000000000E0*/
};
@@ -547,30 +547,30 @@ static const long double Q3r2_4D[NQ3r2_4D + 1] = {
Peak relative error 3.8e-36
0.3125 <= 1/x <= 0.375 */
#define NQ2r7_3r2N 9
-static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
- 7.584861620402450302063691901886141875454E-8L,
- 9.300939338814216296064659459966041794591E-6L,
- 4.112108906197521696032158235392604947895E-4L,
- 8.515168851578898791897038357239630654431E-3L,
- 8.971286321017307400142720556749573229058E-2L,
- 4.885856732902956303343015636331874194498E-1L,
- 1.334506268733103291656253500506406045846E0L,
- 1.681207956863028164179042145803851824654E0L,
- 8.165042692571721959157677701625853772271E-1L,
- 9.805848115375053300608712721986235900715E-2L,
+static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ L(7.584861620402450302063691901886141875454E-8),
+ L(9.300939338814216296064659459966041794591E-6),
+ L(4.112108906197521696032158235392604947895E-4),
+ L(8.515168851578898791897038357239630654431E-3),
+ L(8.971286321017307400142720556749573229058E-2),
+ L(4.885856732902956303343015636331874194498E-1),
+ L(1.334506268733103291656253500506406045846E0),
+ L(1.681207956863028164179042145803851824654E0),
+ L(8.165042692571721959157677701625853772271E-1),
+ L(9.805848115375053300608712721986235900715E-2),
};
#define NQ2r7_3r2D 9
-static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
- 1.035586492113036586458163971239438078160E-6L,
- 1.301999337731768381683593636500979713689E-4L,
- 5.993695702564527062553071126719088859654E-3L,
- 1.321184892887881883489141186815457808785E-1L,
- 1.528766555485015021144963194165165083312E0L,
- 9.561463309176490874525827051566494939295E0L,
- 3.203719484883967351729513662089163356911E1L,
- 5.497294687660930446641539152123568668447E1L,
- 4.391158169390578768508675452986948391118E1L,
- 1.347836630730048077907818943625789418378E1L,
+static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ L(1.035586492113036586458163971239438078160E-6),
+ L(1.301999337731768381683593636500979713689E-4),
+ L(5.993695702564527062553071126719088859654E-3),
+ L(1.321184892887881883489141186815457808785E-1),
+ L(1.528766555485015021144963194165165083312E0),
+ L(9.561463309176490874525827051566494939295E0),
+ L(3.203719484883967351729513662089163356911E1),
+ L(5.497294687660930446641539152123568668447E1),
+ L(4.391158169390578768508675452986948391118E1),
+ L(1.347836630730048077907818943625789418378E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -579,29 +579,29 @@ static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
Peak relative error 2.2e-35
0.375 <= 1/x <= 0.4375 */
#define NQ2r3_2r7N 9
-static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
- 4.455027774980750211349941766420190722088E-7L,
- 4.031998274578520170631601850866780366466E-5L,
- 1.273987274325947007856695677491340636339E-3L,
- 1.818754543377448509897226554179659122873E-2L,
- 1.266748858326568264126353051352269875352E-1L,
- 4.327578594728723821137731555139472880414E-1L,
- 6.892532471436503074928194969154192615359E-1L,
- 4.490775818438716873422163588640262036506E-1L,
- 8.649615949297322440032000346117031581572E-2L,
- 7.261345286655345047417257611469066147561E-4L,
+static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ L(4.455027774980750211349941766420190722088E-7),
+ L(4.031998274578520170631601850866780366466E-5),
+ L(1.273987274325947007856695677491340636339E-3),
+ L(1.818754543377448509897226554179659122873E-2),
+ L(1.266748858326568264126353051352269875352E-1),
+ L(4.327578594728723821137731555139472880414E-1),
+ L(6.892532471436503074928194969154192615359E-1),
+ L(4.490775818438716873422163588640262036506E-1),
+ L(8.649615949297322440032000346117031581572E-2),
+ L(7.261345286655345047417257611469066147561E-4),
};
#define NQ2r3_2r7D 8
-static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
- 6.082600739680555266312417978064954793142E-6L,
- 5.693622538165494742945717226571441747567E-4L,
- 1.901625907009092204458328768129666975975E-2L,
- 2.958689532697857335456896889409923371570E-1L,
- 2.343124711045660081603809437993368799568E0L,
- 9.665894032187458293568704885528192804376E0L,
- 2.035273104990617136065743426322454881353E1L,
- 2.044102010478792896815088858740075165531E1L,
- 8.445937177863155827844146643468706599304E0L,
+static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ L(6.082600739680555266312417978064954793142E-6),
+ L(5.693622538165494742945717226571441747567E-4),
+ L(1.901625907009092204458328768129666975975E-2),
+ L(2.958689532697857335456896889409923371570E-1),
+ L(2.343124711045660081603809437993368799568E0),
+ L(9.665894032187458293568704885528192804376E0),
+ L(2.035273104990617136065743426322454881353E1),
+ L(2.044102010478792896815088858740075165531E1),
+ L(8.445937177863155827844146643468706599304E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -610,39 +610,39 @@ static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
Peak relative error 3.1e-36
0.4375 <= 1/x <= 0.5 */
#define NQ2_2r3N 9
-static const long double Q2_2r3N[NQ2_2r3N + 1] = {
- 2.817566786579768804844367382809101929314E-6L,
- 2.122772176396691634147024348373539744935E-4L,
- 5.501378031780457828919593905395747517585E-3L,
- 6.355374424341762686099147452020466524659E-2L,
- 3.539652320122661637429658698954748337223E-1L,
- 9.571721066119617436343740541777014319695E-1L,
- 1.196258777828426399432550698612171955305E0L,
- 6.069388659458926158392384709893753793967E-1L,
- 9.026746127269713176512359976978248763621E-2L,
- 5.317668723070450235320878117210807236375E-4L,
+static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
+ L(2.817566786579768804844367382809101929314E-6),
+ L(2.122772176396691634147024348373539744935E-4),
+ L(5.501378031780457828919593905395747517585E-3),
+ L(6.355374424341762686099147452020466524659E-2),
+ L(3.539652320122661637429658698954748337223E-1),
+ L(9.571721066119617436343740541777014319695E-1),
+ L(1.196258777828426399432550698612171955305E0),
+ L(6.069388659458926158392384709893753793967E-1),
+ L(9.026746127269713176512359976978248763621E-2),
+ L(5.317668723070450235320878117210807236375E-4),
};
#define NQ2_2r3D 8
-static const long double Q2_2r3D[NQ2_2r3D + 1] = {
- 3.846924354014260866793741072933159380158E-5L,
- 3.017562820057704325510067178327449946763E-3L,
- 8.356305620686867949798885808540444210935E-2L,
- 1.068314930499906838814019619594424586273E0L,
- 6.900279623894821067017966573640732685233E0L,
- 2.307667390886377924509090271780839563141E1L,
- 3.921043465412723970791036825401273528513E1L,
- 3.167569478939719383241775717095729233436E1L,
- 1.051023841699200920276198346301543665909E1L,
+static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
+ L(3.846924354014260866793741072933159380158E-5),
+ L(3.017562820057704325510067178327449946763E-3),
+ L(8.356305620686867949798885808540444210935E-2),
+ L(1.068314930499906838814019619594424586273E0),
+ L(6.900279623894821067017966573640732685233E0),
+ L(2.307667390886377924509090271780839563141E1),
+ L(3.921043465412723970791036825401273528513E1),
+ L(3.167569478939719383241775717095729233436E1),
+ L(1.051023841699200920276198346301543665909E1),
/* 1.000000000000000000000000000000000000000E0*/
};
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -657,10 +657,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -675,31 +675,31 @@ deval (long double x, const long double *p, int n)
/* Bessel function of the first kind, order zero. */
-long double
-__ieee754_j0l (long double x)
+_Float128
+__ieee754_j0l (_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
{
if (x != x)
return x + x;
else
- return 0.0L;
+ return 0;
}
- if (x == 0.0L)
- return 1.0L;
+ if (x == 0)
+ return 1;
xx = fabsl (x);
- if (xx <= 2.0L)
+ if (xx <= 2)
{
- if (xx < 0x1p-57L)
- return 1.0L;
+ if (xx < L(0x1p-57))
+ return 1;
/* 0 <= x <= 2 */
z = xx * xx;
p = z * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
- p -= 0.25L * z;
- p += 1.0L;
+ p -= L(0.25) * z;
+ p += 1;
return p;
}
@@ -713,7 +713,7 @@ __ieee754_j0l (long double x)
__sincosl (xx, &s, &c);
ss = s - c;
cc = s + c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = -__cosl (xx + xx);
if ((s * c) < 0)
@@ -722,10 +722,10 @@ __ieee754_j0l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
+ if (xx > L(0x1p256))
return ONEOSQPI * cc / __ieee754_sqrtl (xx);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -783,9 +783,9 @@ __ieee754_j0l (long double x)
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * xinv * q;
- q = q - 0.125L * xinv;
+ q = q - L(0.125) * xinv;
z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
return z;
}
@@ -796,55 +796,55 @@ strong_alias (__ieee754_j0l, __j0l_finite)
Peak absolute error 1.7e-36 (relative where Y0 > 1)
0 <= x <= 2 */
#define NY0_2N 7
-static long double Y0_2N[NY0_2N + 1] = {
- -1.062023609591350692692296993537002558155E19L,
- 2.542000883190248639104127452714966858866E19L,
- -1.984190771278515324281415820316054696545E18L,
- 4.982586044371592942465373274440222033891E16L,
- -5.529326354780295177243773419090123407550E14L,
- 3.013431465522152289279088265336861140391E12L,
- -7.959436160727126750732203098982718347785E9L,
- 8.230845651379566339707130644134372793322E6L,
+static _Float128 Y0_2N[NY0_2N + 1] = {
+ L(-1.062023609591350692692296993537002558155E19),
+ L(2.542000883190248639104127452714966858866E19),
+ L(-1.984190771278515324281415820316054696545E18),
+ L(4.982586044371592942465373274440222033891E16),
+ L(-5.529326354780295177243773419090123407550E14),
+ L(3.013431465522152289279088265336861140391E12),
+ L(-7.959436160727126750732203098982718347785E9),
+ L(8.230845651379566339707130644134372793322E6),
};
#define NY0_2D 7
-static long double Y0_2D[NY0_2D + 1] = {
- 1.438972634353286978700329883122253752192E20L,
- 1.856409101981569254247700169486907405500E18L,
- 1.219693352678218589553725579802986255614E16L,
- 5.389428943282838648918475915779958097958E13L,
- 1.774125762108874864433872173544743051653E11L,
- 4.522104832545149534808218252434693007036E8L,
- 8.872187401232943927082914504125234454930E5L,
- 1.251945613186787532055610876304669413955E3L,
+static _Float128 Y0_2D[NY0_2D + 1] = {
+ L(1.438972634353286978700329883122253752192E20),
+ L(1.856409101981569254247700169486907405500E18),
+ L(1.219693352678218589553725579802986255614E16),
+ L(5.389428943282838648918475915779958097958E13),
+ L(1.774125762108874864433872173544743051653E11),
+ L(4.522104832545149534808218252434693007036E8),
+ L(8.872187401232943927082914504125234454930E5),
+ L(1.251945613186787532055610876304669413955E3),
/* 1.000000000000000000000000000000000000000E0 */
};
-static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
+static const _Float128 U0 = L(-7.3804295108687225274343927948483016310862e-02);
/* Bessel function of the second kind, order zero. */
-long double
- __ieee754_y0l(long double x)
+_Float128
+ __ieee754_y0l(_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
{
if (x != x)
return x + x;
else
- return 0.0L;
+ return 0;
}
- if (x <= 0.0L)
+ if (x <= 0)
{
- if (x < 0.0L)
+ if (x < 0)
return (zero / (zero * x));
return -HUGE_VALL + x;
}
xx = fabsl (x);
if (xx <= 0x1p-57)
return U0 + TWOOPI * __ieee754_logl (x);
- if (xx <= 2.0L)
+ if (xx <= 2)
{
/* 0 <= x <= 2 */
z = xx * xx;
@@ -863,7 +863,7 @@ long double
__sincosl (x, &s, &c);
ss = s - c;
cc = s + c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = -__cosl (x + x);
if ((s * c) < 0)
@@ -872,10 +872,10 @@ long double
ss = z / cc;
}
- if (xx > 0x1p256L)
+ if (xx > L(0x1p256))
return ONEOSQPI * ss / __ieee754_sqrtl (x);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -933,9 +933,9 @@ long double
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * xinv * q;
- q = q - 0.125L * xinv;
+ q = q - L(0.125) * xinv;
z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (x);
return z;
}
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index 32652049ab..9e782305d9 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -101,33 +101,33 @@
#include <float.h>
/* 1 / sqrt(pi) */
-static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
/* 2 / pi */
-static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
-static const long double zero = 0.0L;
+static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
+static const _Float128 zero = 0;
/* J1(x) = .5x + x x^2 R(x^2)
Peak relative error 1.9e-35
0 <= x <= 2 */
#define NJ0_2N 6
-static const long double J0_2N[NJ0_2N + 1] = {
- -5.943799577386942855938508697619735179660E16L,
- 1.812087021305009192259946997014044074711E15L,
- -2.761698314264509665075127515729146460895E13L,
- 2.091089497823600978949389109350658815972E11L,
- -8.546413231387036372945453565654130054307E8L,
- 1.797229225249742247475464052741320612261E6L,
- -1.559552840946694171346552770008812083969E3L
+static const _Float128 J0_2N[NJ0_2N + 1] = {
+ L(-5.943799577386942855938508697619735179660E16),
+ L(1.812087021305009192259946997014044074711E15),
+ L(-2.761698314264509665075127515729146460895E13),
+ L(2.091089497823600978949389109350658815972E11),
+ L(-8.546413231387036372945453565654130054307E8),
+ L(1.797229225249742247475464052741320612261E6),
+ L(-1.559552840946694171346552770008812083969E3)
};
#define NJ0_2D 6
-static const long double J0_2D[NJ0_2D + 1] = {
- 9.510079323819108569501613916191477479397E17L,
- 1.063193817503280529676423936545854693915E16L,
- 5.934143516050192600795972192791775226920E13L,
- 2.168000911950620999091479265214368352883E11L,
- 5.673775894803172808323058205986256928794E8L,
- 1.080329960080981204840966206372671147224E6L,
- 1.411951256636576283942477881535283304912E3L,
+static const _Float128 J0_2D[NJ0_2D + 1] = {
+ L(9.510079323819108569501613916191477479397E17),
+ L(1.063193817503280529676423936545854693915E16),
+ L(5.934143516050192600795972192791775226920E13),
+ L(2.168000911950620999091479265214368352883E11),
+ L(5.673775894803172808323058205986256928794E8),
+ L(1.080329960080981204840966206372671147224E6),
+ L(1.411951256636576283942477881535283304912E3),
/* 1.000000000000000000000000000000000000000E0L */
};
@@ -135,30 +135,30 @@ static const long double J0_2D[NJ0_2D + 1] = {
0 <= 1/x <= .0625
Peak relative error 3.6e-36 */
#define NP16_IN 9
-static const long double P16_IN[NP16_IN + 1] = {
- 5.143674369359646114999545149085139822905E-16L,
- 4.836645664124562546056389268546233577376E-13L,
- 1.730945562285804805325011561498453013673E-10L,
- 3.047976856147077889834905908605310585810E-8L,
- 2.855227609107969710407464739188141162386E-6L,
- 1.439362407936705484122143713643023998457E-4L,
- 3.774489768532936551500999699815873422073E-3L,
- 4.723962172984642566142399678920790598426E-2L,
- 2.359289678988743939925017240478818248735E-1L,
- 3.032580002220628812728954785118117124520E-1L,
+static const _Float128 P16_IN[NP16_IN + 1] = {
+ L(5.143674369359646114999545149085139822905E-16),
+ L(4.836645664124562546056389268546233577376E-13),
+ L(1.730945562285804805325011561498453013673E-10),
+ L(3.047976856147077889834905908605310585810E-8),
+ L(2.855227609107969710407464739188141162386E-6),
+ L(1.439362407936705484122143713643023998457E-4),
+ L(3.774489768532936551500999699815873422073E-3),
+ L(4.723962172984642566142399678920790598426E-2),
+ L(2.359289678988743939925017240478818248735E-1),
+ L(3.032580002220628812728954785118117124520E-1),
};
#define NP16_ID 9
-static const long double P16_ID[NP16_ID + 1] = {
- 4.389268795186898018132945193912677177553E-15L,
- 4.132671824807454334388868363256830961655E-12L,
- 1.482133328179508835835963635130894413136E-9L,
- 2.618941412861122118906353737117067376236E-7L,
- 2.467854246740858470815714426201888034270E-5L,
- 1.257192927368839847825938545925340230490E-3L,
- 3.362739031941574274949719324644120720341E-2L,
- 4.384458231338934105875343439265370178858E-1L,
- 2.412830809841095249170909628197264854651E0L,
- 4.176078204111348059102962617368214856874E0L,
+static const _Float128 P16_ID[NP16_ID + 1] = {
+ L(4.389268795186898018132945193912677177553E-15),
+ L(4.132671824807454334388868363256830961655E-12),
+ L(1.482133328179508835835963635130894413136E-9),
+ L(2.618941412861122118906353737117067376236E-7),
+ L(2.467854246740858470815714426201888034270E-5),
+ L(1.257192927368839847825938545925340230490E-3),
+ L(3.362739031941574274949719324644120720341E-2),
+ L(4.384458231338934105875343439265370178858E-1),
+ L(2.412830809841095249170909628197264854651E0),
+ L(4.176078204111348059102962617368214856874E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -166,33 +166,33 @@ static const long double P16_ID[NP16_ID + 1] = {
0.0625 <= 1/x <= 0.125
Peak relative error 1.9e-36 */
#define NP8_16N 11
-static const long double P8_16N[NP8_16N + 1] = {
- 2.984612480763362345647303274082071598135E-16L,
- 1.923651877544126103941232173085475682334E-13L,
- 4.881258879388869396043760693256024307743E-11L,
- 6.368866572475045408480898921866869811889E-9L,
- 4.684818344104910450523906967821090796737E-7L,
- 2.005177298271593587095982211091300382796E-5L,
- 4.979808067163957634120681477207147536182E-4L,
- 6.946005761642579085284689047091173581127E-3L,
- 5.074601112955765012750207555985299026204E-2L,
- 1.698599455896180893191766195194231825379E-1L,
- 1.957536905259237627737222775573623779638E-1L,
- 2.991314703282528370270179989044994319374E-2L,
+static const _Float128 P8_16N[NP8_16N + 1] = {
+ L(2.984612480763362345647303274082071598135E-16),
+ L(1.923651877544126103941232173085475682334E-13),
+ L(4.881258879388869396043760693256024307743E-11),
+ L(6.368866572475045408480898921866869811889E-9),
+ L(4.684818344104910450523906967821090796737E-7),
+ L(2.005177298271593587095982211091300382796E-5),
+ L(4.979808067163957634120681477207147536182E-4),
+ L(6.946005761642579085284689047091173581127E-3),
+ L(5.074601112955765012750207555985299026204E-2),
+ L(1.698599455896180893191766195194231825379E-1),
+ L(1.957536905259237627737222775573623779638E-1),
+ L(2.991314703282528370270179989044994319374E-2),
};
#define NP8_16D 10
-static const long double P8_16D[NP8_16D + 1] = {
- 2.546869316918069202079580939942463010937E-15L,
- 1.644650111942455804019788382157745229955E-12L,
- 4.185430770291694079925607420808011147173E-10L,
- 5.485331966975218025368698195861074143153E-8L,
- 4.062884421686912042335466327098932678905E-6L,
- 1.758139661060905948870523641319556816772E-4L,
- 4.445143889306356207566032244985607493096E-3L,
- 6.391901016293512632765621532571159071158E-2L,
- 4.933040207519900471177016015718145795434E-1L,
- 1.839144086168947712971630337250761842976E0L,
- 2.715120873995490920415616716916149586579E0L,
+static const _Float128 P8_16D[NP8_16D + 1] = {
+ L(2.546869316918069202079580939942463010937E-15),
+ L(1.644650111942455804019788382157745229955E-12),
+ L(4.185430770291694079925607420808011147173E-10),
+ L(5.485331966975218025368698195861074143153E-8),
+ L(4.062884421686912042335466327098932678905E-6),
+ L(1.758139661060905948870523641319556816772E-4),
+ L(4.445143889306356207566032244985607493096E-3),
+ L(6.391901016293512632765621532571159071158E-2),
+ L(4.933040207519900471177016015718145795434E-1),
+ L(1.839144086168947712971630337250761842976E0),
+ L(2.715120873995490920415616716916149586579E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -200,32 +200,32 @@ static const long double P8_16D[NP8_16D + 1] = {
0.125 <= 1/x <= 0.1875
Peak relative error 1.3e-36 */
#define NP5_8N 10
-static const long double P5_8N[NP5_8N + 1] = {
- 2.837678373978003452653763806968237227234E-12L,
- 9.726641165590364928442128579282742354806E-10L,
- 1.284408003604131382028112171490633956539E-7L,
- 8.524624695868291291250573339272194285008E-6L,
- 3.111516908953172249853673787748841282846E-4L,
- 6.423175156126364104172801983096596409176E-3L,
- 7.430220589989104581004416356260692450652E-2L,
- 4.608315409833682489016656279567605536619E-1L,
- 1.396870223510964882676225042258855977512E0L,
- 1.718500293904122365894630460672081526236E0L,
- 5.465927698800862172307352821870223855365E-1L
+static const _Float128 P5_8N[NP5_8N + 1] = {
+ L(2.837678373978003452653763806968237227234E-12),
+ L(9.726641165590364928442128579282742354806E-10),
+ L(1.284408003604131382028112171490633956539E-7),
+ L(8.524624695868291291250573339272194285008E-6),
+ L(3.111516908953172249853673787748841282846E-4),
+ L(6.423175156126364104172801983096596409176E-3),
+ L(7.430220589989104581004416356260692450652E-2),
+ L(4.608315409833682489016656279567605536619E-1),
+ L(1.396870223510964882676225042258855977512E0),
+ L(1.718500293904122365894630460672081526236E0),
+ L(5.465927698800862172307352821870223855365E-1)
};
#define NP5_8D 10
-static const long double P5_8D[NP5_8D + 1] = {
- 2.421485545794616609951168511612060482715E-11L,
- 8.329862750896452929030058039752327232310E-9L,
- 1.106137992233383429630592081375289010720E-6L,
- 7.405786153760681090127497796448503306939E-5L,
- 2.740364785433195322492093333127633465227E-3L,
- 5.781246470403095224872243564165254652198E-2L,
- 6.927711353039742469918754111511109983546E-1L,
- 4.558679283460430281188304515922826156690E0L,
- 1.534468499844879487013168065728837900009E1L,
- 2.313927430889218597919624843161569422745E1L,
- 1.194506341319498844336768473218382828637E1L,
+static const _Float128 P5_8D[NP5_8D + 1] = {
+ L(2.421485545794616609951168511612060482715E-11),
+ L(8.329862750896452929030058039752327232310E-9),
+ L(1.106137992233383429630592081375289010720E-6),
+ L(7.405786153760681090127497796448503306939E-5),
+ L(2.740364785433195322492093333127633465227E-3),
+ L(5.781246470403095224872243564165254652198E-2),
+ L(6.927711353039742469918754111511109983546E-1),
+ L(4.558679283460430281188304515922826156690E0),
+ L(1.534468499844879487013168065728837900009E1),
+ L(2.313927430889218597919624843161569422745E1),
+ L(1.194506341319498844336768473218382828637E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -233,31 +233,31 @@ static const long double P5_8D[NP5_8D + 1] = {
Peak relative error 1.4e-36
0.1875 <= 1/x <= 0.25 */
#define NP4_5N 10
-static const long double P4_5N[NP4_5N + 1] = {
- 1.846029078268368685834261260420933914621E-10L,
- 3.916295939611376119377869680335444207768E-8L,
- 3.122158792018920627984597530935323997312E-6L,
- 1.218073444893078303994045653603392272450E-4L,
- 2.536420827983485448140477159977981844883E-3L,
- 2.883011322006690823959367922241169171315E-2L,
- 1.755255190734902907438042414495469810830E-1L,
- 5.379317079922628599870898285488723736599E-1L,
- 7.284904050194300773890303361501726561938E-1L,
- 3.270110346613085348094396323925000362813E-1L,
- 1.804473805689725610052078464951722064757E-2L,
+static const _Float128 P4_5N[NP4_5N + 1] = {
+ L(1.846029078268368685834261260420933914621E-10),
+ L(3.916295939611376119377869680335444207768E-8),
+ L(3.122158792018920627984597530935323997312E-6),
+ L(1.218073444893078303994045653603392272450E-4),
+ L(2.536420827983485448140477159977981844883E-3),
+ L(2.883011322006690823959367922241169171315E-2),
+ L(1.755255190734902907438042414495469810830E-1),
+ L(5.379317079922628599870898285488723736599E-1),
+ L(7.284904050194300773890303361501726561938E-1),
+ L(3.270110346613085348094396323925000362813E-1),
+ L(1.804473805689725610052078464951722064757E-2),
};
#define NP4_5D 9
-static const long double P4_5D[NP4_5D + 1] = {
- 1.575278146806816970152174364308980863569E-9L,
- 3.361289173657099516191331123405675054321E-7L,
- 2.704692281550877810424745289838790693708E-5L,
- 1.070854930483999749316546199273521063543E-3L,
- 2.282373093495295842598097265627962125411E-2L,
- 2.692025460665354148328762368240343249830E-1L,
- 1.739892942593664447220951225734811133759E0L,
- 5.890727576752230385342377570386657229324E0L,
- 9.517442287057841500750256954117735128153E0L,
- 6.100616353935338240775363403030137736013E0L,
+static const _Float128 P4_5D[NP4_5D + 1] = {
+ L(1.575278146806816970152174364308980863569E-9),
+ L(3.361289173657099516191331123405675054321E-7),
+ L(2.704692281550877810424745289838790693708E-5),
+ L(1.070854930483999749316546199273521063543E-3),
+ L(2.282373093495295842598097265627962125411E-2),
+ L(2.692025460665354148328762368240343249830E-1),
+ L(1.739892942593664447220951225734811133759E0),
+ L(5.890727576752230385342377570386657229324E0),
+ L(9.517442287057841500750256954117735128153E0),
+ L(6.100616353935338240775363403030137736013E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -265,30 +265,30 @@ static const long double P4_5D[NP4_5D + 1] = {
Peak relative error 3.0e-36
0.25 <= 1/x <= 0.3125 */
#define NP3r2_4N 9
-static const long double P3r2_4N[NP3r2_4N + 1] = {
- 8.240803130988044478595580300846665863782E-8L,
- 1.179418958381961224222969866406483744580E-5L,
- 6.179787320956386624336959112503824397755E-4L,
- 1.540270833608687596420595830747166658383E-2L,
- 1.983904219491512618376375619598837355076E-1L,
- 1.341465722692038870390470651608301155565E0L,
- 4.617865326696612898792238245990854646057E0L,
- 7.435574801812346424460233180412308000587E0L,
- 4.671327027414635292514599201278557680420E0L,
- 7.299530852495776936690976966995187714739E-1L,
+static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
+ L(8.240803130988044478595580300846665863782E-8),
+ L(1.179418958381961224222969866406483744580E-5),
+ L(6.179787320956386624336959112503824397755E-4),
+ L(1.540270833608687596420595830747166658383E-2),
+ L(1.983904219491512618376375619598837355076E-1),
+ L(1.341465722692038870390470651608301155565E0),
+ L(4.617865326696612898792238245990854646057E0),
+ L(7.435574801812346424460233180412308000587E0),
+ L(4.671327027414635292514599201278557680420E0),
+ L(7.299530852495776936690976966995187714739E-1),
};
#define NP3r2_4D 9
-static const long double P3r2_4D[NP3r2_4D + 1] = {
- 7.032152009675729604487575753279187576521E-7L,
- 1.015090352324577615777511269928856742848E-4L,
- 5.394262184808448484302067955186308730620E-3L,
- 1.375291438480256110455809354836988584325E-1L,
- 1.836247144461106304788160919310404376670E0L,
- 1.314378564254376655001094503090935880349E1L,
- 4.957184590465712006934452500894672343488E1L,
- 9.287394244300647738855415178790263465398E1L,
- 7.652563275535900609085229286020552768399E1L,
- 2.147042473003074533150718117770093209096E1L,
+static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
+ L(7.032152009675729604487575753279187576521E-7),
+ L(1.015090352324577615777511269928856742848E-4),
+ L(5.394262184808448484302067955186308730620E-3),
+ L(1.375291438480256110455809354836988584325E-1),
+ L(1.836247144461106304788160919310404376670E0),
+ L(1.314378564254376655001094503090935880349E1),
+ L(4.957184590465712006934452500894672343488E1),
+ L(9.287394244300647738855415178790263465398E1),
+ L(7.652563275535900609085229286020552768399E1),
+ L(2.147042473003074533150718117770093209096E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -296,29 +296,29 @@ static const long double P3r2_4D[NP3r2_4D + 1] = {
Peak relative error 1.0e-35
0.3125 <= 1/x <= 0.375 */
#define NP2r7_3r2N 9
-static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
- 4.599033469240421554219816935160627085991E-7L,
- 4.665724440345003914596647144630893997284E-5L,
- 1.684348845667764271596142716944374892756E-3L,
- 2.802446446884455707845985913454440176223E-2L,
- 2.321937586453963310008279956042545173930E-1L,
- 9.640277413988055668692438709376437553804E-1L,
- 1.911021064710270904508663334033003246028E0L,
- 1.600811610164341450262992138893970224971E0L,
- 4.266299218652587901171386591543457861138E-1L,
- 1.316470424456061252962568223251247207325E-2L,
+static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
+ L(4.599033469240421554219816935160627085991E-7),
+ L(4.665724440345003914596647144630893997284E-5),
+ L(1.684348845667764271596142716944374892756E-3),
+ L(2.802446446884455707845985913454440176223E-2),
+ L(2.321937586453963310008279956042545173930E-1),
+ L(9.640277413988055668692438709376437553804E-1),
+ L(1.911021064710270904508663334033003246028E0),
+ L(1.600811610164341450262992138893970224971E0),
+ L(4.266299218652587901171386591543457861138E-1),
+ L(1.316470424456061252962568223251247207325E-2),
};
#define NP2r7_3r2D 8
-static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
- 3.924508608545520758883457108453520099610E-6L,
- 4.029707889408829273226495756222078039823E-4L,
- 1.484629715787703260797886463307469600219E-2L,
- 2.553136379967180865331706538897231588685E-1L,
- 2.229457223891676394409880026887106228740E0L,
- 1.005708903856384091956550845198392117318E1L,
- 2.277082659664386953166629360352385889558E1L,
- 2.384726835193630788249826630376533988245E1L,
- 9.700989749041320895890113781610939632410E0L,
+static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
+ L(3.924508608545520758883457108453520099610E-6),
+ L(4.029707889408829273226495756222078039823E-4),
+ L(1.484629715787703260797886463307469600219E-2),
+ L(2.553136379967180865331706538897231588685E-1),
+ L(2.229457223891676394409880026887106228740E0),
+ L(1.005708903856384091956550845198392117318E1),
+ L(2.277082659664386953166629360352385889558E1),
+ L(2.384726835193630788249826630376533988245E1),
+ L(9.700989749041320895890113781610939632410E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -326,29 +326,29 @@ static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
Peak relative error 1.7e-36
0.3125 <= 1/x <= 0.4375 */
#define NP2r3_2r7N 9
-static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
- 3.916766777108274628543759603786857387402E-6L,
- 3.212176636756546217390661984304645137013E-4L,
- 9.255768488524816445220126081207248947118E-3L,
- 1.214853146369078277453080641911700735354E-1L,
- 7.855163309847214136198449861311404633665E-1L,
- 2.520058073282978403655488662066019816540E0L,
- 3.825136484837545257209234285382183711466E0L,
- 2.432569427554248006229715163865569506873E0L,
- 4.877934835018231178495030117729800489743E-1L,
- 1.109902737860249670981355149101343427885E-2L,
+static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
+ L(3.916766777108274628543759603786857387402E-6),
+ L(3.212176636756546217390661984304645137013E-4),
+ L(9.255768488524816445220126081207248947118E-3),
+ L(1.214853146369078277453080641911700735354E-1),
+ L(7.855163309847214136198449861311404633665E-1),
+ L(2.520058073282978403655488662066019816540E0),
+ L(3.825136484837545257209234285382183711466E0),
+ L(2.432569427554248006229715163865569506873E0),
+ L(4.877934835018231178495030117729800489743E-1),
+ L(1.109902737860249670981355149101343427885E-2),
};
#define NP2r3_2r7D 8
-static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
- 3.342307880794065640312646341190547184461E-5L,
- 2.782182891138893201544978009012096558265E-3L,
- 8.221304931614200702142049236141249929207E-2L,
- 1.123728246291165812392918571987858010949E0L,
- 7.740482453652715577233858317133423434590E0L,
- 2.737624677567945952953322566311201919139E1L,
- 4.837181477096062403118304137851260715475E1L,
- 3.941098643468580791437772701093795299274E1L,
- 1.245821247166544627558323920382547533630E1L,
+static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
+ L(3.342307880794065640312646341190547184461E-5),
+ L(2.782182891138893201544978009012096558265E-3),
+ L(8.221304931614200702142049236141249929207E-2),
+ L(1.123728246291165812392918571987858010949E0),
+ L(7.740482453652715577233858317133423434590E0),
+ L(2.737624677567945952953322566311201919139E1),
+ L(4.837181477096062403118304137851260715475E1),
+ L(3.941098643468580791437772701093795299274E1),
+ L(1.245821247166544627558323920382547533630E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -356,28 +356,28 @@ static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
Peak relative error 1.7e-35
0.4375 <= 1/x <= 0.5 */
#define NP2_2r3N 8
-static const long double P2_2r3N[NP2_2r3N + 1] = {
- 3.397930802851248553545191160608731940751E-4L,
- 2.104020902735482418784312825637833698217E-2L,
- 4.442291771608095963935342749477836181939E-1L,
- 4.131797328716583282869183304291833754967E0L,
- 1.819920169779026500146134832455189917589E1L,
- 3.781779616522937565300309684282401791291E1L,
- 3.459605449728864218972931220783543410347E1L,
- 1.173594248397603882049066603238568316561E1L,
- 9.455702270242780642835086549285560316461E-1L,
+static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
+ L(3.397930802851248553545191160608731940751E-4),
+ L(2.104020902735482418784312825637833698217E-2),
+ L(4.442291771608095963935342749477836181939E-1),
+ L(4.131797328716583282869183304291833754967E0),
+ L(1.819920169779026500146134832455189917589E1),
+ L(3.781779616522937565300309684282401791291E1),
+ L(3.459605449728864218972931220783543410347E1),
+ L(1.173594248397603882049066603238568316561E1),
+ L(9.455702270242780642835086549285560316461E-1),
};
#define NP2_2r3D 8
-static const long double P2_2r3D[NP2_2r3D + 1] = {
- 2.899568897241432883079888249845707400614E-3L,
- 1.831107138190848460767699919531132426356E-1L,
- 3.999350044057883839080258832758908825165E0L,
- 3.929041535867957938340569419874195303712E1L,
- 1.884245613422523323068802689915538908291E2L,
- 4.461469948819229734353852978424629815929E2L,
- 5.004998753999796821224085972610636347903E2L,
- 2.386342520092608513170837883757163414100E2L,
- 3.791322528149347975999851588922424189957E1L,
+static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
+ L(2.899568897241432883079888249845707400614E-3),
+ L(1.831107138190848460767699919531132426356E-1),
+ L(3.999350044057883839080258832758908825165E0),
+ L(3.929041535867957938340569419874195303712E1),
+ L(1.884245613422523323068802689915538908291E2),
+ L(4.461469948819229734353852978424629815929E2),
+ L(5.004998753999796821224085972610636347903E2),
+ L(2.386342520092608513170837883757163414100E2),
+ L(3.791322528149347975999851588922424189957E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -386,31 +386,31 @@ static const long double P2_2r3D[NP2_2r3D + 1] = {
Peak relative error 8.0e-36
0 <= 1/x <= .0625 */
#define NQ16_IN 10
-static const long double Q16_IN[NQ16_IN + 1] = {
- -3.917420835712508001321875734030357393421E-18L,
- -4.440311387483014485304387406538069930457E-15L,
- -1.951635424076926487780929645954007139616E-12L,
- -4.318256438421012555040546775651612810513E-10L,
- -5.231244131926180765270446557146989238020E-8L,
- -3.540072702902043752460711989234732357653E-6L,
- -1.311017536555269966928228052917534882984E-4L,
- -2.495184669674631806622008769674827575088E-3L,
- -2.141868222987209028118086708697998506716E-2L,
- -6.184031415202148901863605871197272650090E-2L,
- -1.922298704033332356899546792898156493887E-2L,
+static const _Float128 Q16_IN[NQ16_IN + 1] = {
+ L(-3.917420835712508001321875734030357393421E-18),
+ L(-4.440311387483014485304387406538069930457E-15),
+ L(-1.951635424076926487780929645954007139616E-12),
+ L(-4.318256438421012555040546775651612810513E-10),
+ L(-5.231244131926180765270446557146989238020E-8),
+ L(-3.540072702902043752460711989234732357653E-6),
+ L(-1.311017536555269966928228052917534882984E-4),
+ L(-2.495184669674631806622008769674827575088E-3),
+ L(-2.141868222987209028118086708697998506716E-2),
+ L(-6.184031415202148901863605871197272650090E-2),
+ L(-1.922298704033332356899546792898156493887E-2),
};
#define NQ16_ID 9
-static const long double Q16_ID[NQ16_ID + 1] = {
- 3.820418034066293517479619763498400162314E-17L,
- 4.340702810799239909648911373329149354911E-14L,
- 1.914985356383416140706179933075303538524E-11L,
- 4.262333682610888819476498617261895474330E-9L,
- 5.213481314722233980346462747902942182792E-7L,
- 3.585741697694069399299005316809954590558E-5L,
- 1.366513429642842006385029778105539457546E-3L,
- 2.745282599850704662726337474371355160594E-2L,
- 2.637644521611867647651200098449903330074E-1L,
- 1.006953426110765984590782655598680488746E0L,
+static const _Float128 Q16_ID[NQ16_ID + 1] = {
+ L(3.820418034066293517479619763498400162314E-17),
+ L(4.340702810799239909648911373329149354911E-14),
+ L(1.914985356383416140706179933075303538524E-11),
+ L(4.262333682610888819476498617261895474330E-9),
+ L(5.213481314722233980346462747902942182792E-7),
+ L(3.585741697694069399299005316809954590558E-5),
+ L(1.366513429642842006385029778105539457546E-3),
+ L(2.745282599850704662726337474371355160594E-2),
+ L(2.637644521611867647651200098449903330074E-1),
+ L(1.006953426110765984590782655598680488746E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -419,34 +419,34 @@ static const long double Q16_ID[NQ16_ID + 1] = {
Peak relative error 1.9e-36
0.0625 <= 1/x <= 0.125 */
#define NQ8_16N 11
-static const long double Q8_16N[NQ8_16N + 1] = {
- -2.028630366670228670781362543615221542291E-17L,
- -1.519634620380959966438130374006858864624E-14L,
- -4.540596528116104986388796594639405114524E-12L,
- -7.085151756671466559280490913558388648274E-10L,
- -6.351062671323970823761883833531546885452E-8L,
- -3.390817171111032905297982523519503522491E-6L,
- -1.082340897018886970282138836861233213972E-4L,
- -2.020120801187226444822977006648252379508E-3L,
- -2.093169910981725694937457070649605557555E-2L,
- -1.092176538874275712359269481414448063393E-1L,
- -2.374790947854765809203590474789108718733E-1L,
- -1.365364204556573800719985118029601401323E-1L,
+static const _Float128 Q8_16N[NQ8_16N + 1] = {
+ L(-2.028630366670228670781362543615221542291E-17),
+ L(-1.519634620380959966438130374006858864624E-14),
+ L(-4.540596528116104986388796594639405114524E-12),
+ L(-7.085151756671466559280490913558388648274E-10),
+ L(-6.351062671323970823761883833531546885452E-8),
+ L(-3.390817171111032905297982523519503522491E-6),
+ L(-1.082340897018886970282138836861233213972E-4),
+ L(-2.020120801187226444822977006648252379508E-3),
+ L(-2.093169910981725694937457070649605557555E-2),
+ L(-1.092176538874275712359269481414448063393E-1),
+ L(-2.374790947854765809203590474789108718733E-1),
+ L(-1.365364204556573800719985118029601401323E-1),
};
#define NQ8_16D 11
-static const long double Q8_16D[NQ8_16D + 1] = {
- 1.978397614733632533581207058069628242280E-16L,
- 1.487361156806202736877009608336766720560E-13L,
- 4.468041406888412086042576067133365913456E-11L,
- 7.027822074821007443672290507210594648877E-9L,
- 6.375740580686101224127290062867976007374E-7L,
- 3.466887658320002225888644977076410421940E-5L,
- 1.138625640905289601186353909213719596986E-3L,
- 2.224470799470414663443449818235008486439E-2L,
- 2.487052928527244907490589787691478482358E-1L,
- 1.483927406564349124649083853892380899217E0L,
- 4.182773513276056975777258788903489507705E0L,
- 4.419665392573449746043880892524360870944E0L,
+static const _Float128 Q8_16D[NQ8_16D + 1] = {
+ L(1.978397614733632533581207058069628242280E-16),
+ L(1.487361156806202736877009608336766720560E-13),
+ L(4.468041406888412086042576067133365913456E-11),
+ L(7.027822074821007443672290507210594648877E-9),
+ L(6.375740580686101224127290062867976007374E-7),
+ L(3.466887658320002225888644977076410421940E-5),
+ L(1.138625640905289601186353909213719596986E-3),
+ L(2.224470799470414663443449818235008486439E-2),
+ L(2.487052928527244907490589787691478482358E-1),
+ L(1.483927406564349124649083853892380899217E0),
+ L(4.182773513276056975777258788903489507705E0),
+ L(4.419665392573449746043880892524360870944E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -455,32 +455,32 @@ static const long double Q8_16D[NQ8_16D + 1] = {
Peak relative error 1.5e-35
0.125 <= 1/x <= 0.1875 */
#define NQ5_8N 10
-static const long double Q5_8N[NQ5_8N + 1] = {
- -3.656082407740970534915918390488336879763E-13L,
- -1.344660308497244804752334556734121771023E-10L,
- -1.909765035234071738548629788698150760791E-8L,
- -1.366668038160120210269389551283666716453E-6L,
- -5.392327355984269366895210704976314135683E-5L,
- -1.206268245713024564674432357634540343884E-3L,
- -1.515456784370354374066417703736088291287E-2L,
- -1.022454301137286306933217746545237098518E-1L,
- -3.373438906472495080504907858424251082240E-1L,
- -4.510782522110845697262323973549178453405E-1L,
- -1.549000892545288676809660828213589804884E-1L,
+static const _Float128 Q5_8N[NQ5_8N + 1] = {
+ L(-3.656082407740970534915918390488336879763E-13),
+ L(-1.344660308497244804752334556734121771023E-10),
+ L(-1.909765035234071738548629788698150760791E-8),
+ L(-1.366668038160120210269389551283666716453E-6),
+ L(-5.392327355984269366895210704976314135683E-5),
+ L(-1.206268245713024564674432357634540343884E-3),
+ L(-1.515456784370354374066417703736088291287E-2),
+ L(-1.022454301137286306933217746545237098518E-1),
+ L(-3.373438906472495080504907858424251082240E-1),
+ L(-4.510782522110845697262323973549178453405E-1),
+ L(-1.549000892545288676809660828213589804884E-1),
};
#define NQ5_8D 10
-static const long double Q5_8D[NQ5_8D + 1] = {
- 3.565550843359501079050699598913828460036E-12L,
- 1.321016015556560621591847454285330528045E-9L,
- 1.897542728662346479999969679234270605975E-7L,
- 1.381720283068706710298734234287456219474E-5L,
- 5.599248147286524662305325795203422873725E-4L,
- 1.305442352653121436697064782499122164843E-2L,
- 1.750234079626943298160445750078631894985E-1L,
- 1.311420542073436520965439883806946678491E0L,
- 5.162757689856842406744504211089724926650E0L,
- 9.527760296384704425618556332087850581308E0L,
- 6.604648207463236667912921642545100248584E0L,
+static const _Float128 Q5_8D[NQ5_8D + 1] = {
+ L(3.565550843359501079050699598913828460036E-12),
+ L(1.321016015556560621591847454285330528045E-9),
+ L(1.897542728662346479999969679234270605975E-7),
+ L(1.381720283068706710298734234287456219474E-5),
+ L(5.599248147286524662305325795203422873725E-4),
+ L(1.305442352653121436697064782499122164843E-2),
+ L(1.750234079626943298160445750078631894985E-1),
+ L(1.311420542073436520965439883806946678491E0),
+ L(5.162757689856842406744504211089724926650E0),
+ L(9.527760296384704425618556332087850581308E0),
+ L(6.604648207463236667912921642545100248584E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -489,31 +489,31 @@ static const long double Q5_8D[NQ5_8D + 1] = {
Peak relative error 1.3e-35
0.1875 <= 1/x <= 0.25 */
#define NQ4_5N 10
-static const long double Q4_5N[NQ4_5N + 1] = {
- -4.079513568708891749424783046520200903755E-11L,
- -9.326548104106791766891812583019664893311E-9L,
- -8.016795121318423066292906123815687003356E-7L,
- -3.372350544043594415609295225664186750995E-5L,
- -7.566238665947967882207277686375417983917E-4L,
- -9.248861580055565402130441618521591282617E-3L,
- -6.033106131055851432267702948850231270338E-2L,
- -1.966908754799996793730369265431584303447E-1L,
- -2.791062741179964150755788226623462207560E-1L,
- -1.255478605849190549914610121863534191666E-1L,
- -4.320429862021265463213168186061696944062E-3L,
+static const _Float128 Q4_5N[NQ4_5N + 1] = {
+ L(-4.079513568708891749424783046520200903755E-11),
+ L(-9.326548104106791766891812583019664893311E-9),
+ L(-8.016795121318423066292906123815687003356E-7),
+ L(-3.372350544043594415609295225664186750995E-5),
+ L(-7.566238665947967882207277686375417983917E-4),
+ L(-9.248861580055565402130441618521591282617E-3),
+ L(-6.033106131055851432267702948850231270338E-2),
+ L(-1.966908754799996793730369265431584303447E-1),
+ L(-2.791062741179964150755788226623462207560E-1),
+ L(-1.255478605849190549914610121863534191666E-1),
+ L(-4.320429862021265463213168186061696944062E-3),
};
#define NQ4_5D 9
-static const long double Q4_5D[NQ4_5D + 1] = {
- 3.978497042580921479003851216297330701056E-10L,
- 9.203304163828145809278568906420772246666E-8L,
- 8.059685467088175644915010485174545743798E-6L,
- 3.490187375993956409171098277561669167446E-4L,
- 8.189109654456872150100501732073810028829E-3L,
- 1.072572867311023640958725265762483033769E-1L,
- 7.790606862409960053675717185714576937994E-1L,
- 3.016049768232011196434185423512777656328E0L,
- 5.722963851442769787733717162314477949360E0L,
- 4.510527838428473279647251350931380867663E0L,
+static const _Float128 Q4_5D[NQ4_5D + 1] = {
+ L(3.978497042580921479003851216297330701056E-10),
+ L(9.203304163828145809278568906420772246666E-8),
+ L(8.059685467088175644915010485174545743798E-6),
+ L(3.490187375993956409171098277561669167446E-4),
+ L(8.189109654456872150100501732073810028829E-3),
+ L(1.072572867311023640958725265762483033769E-1),
+ L(7.790606862409960053675717185714576937994E-1),
+ L(3.016049768232011196434185423512777656328E0),
+ L(5.722963851442769787733717162314477949360E0),
+ L(4.510527838428473279647251350931380867663E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -522,30 +522,30 @@ static const long double Q4_5D[NQ4_5D + 1] = {
Peak relative error 2.1e-35
0.25 <= 1/x <= 0.3125 */
#define NQ3r2_4N 9
-static const long double Q3r2_4N[NQ3r2_4N + 1] = {
- -1.087480809271383885936921889040388133627E-8L,
- -1.690067828697463740906962973479310170932E-6L,
- -9.608064416995105532790745641974762550982E-5L,
- -2.594198839156517191858208513873961837410E-3L,
- -3.610954144421543968160459863048062977822E-2L,
- -2.629866798251843212210482269563961685666E-1L,
- -9.709186825881775885917984975685752956660E-1L,
- -1.667521829918185121727268867619982417317E0L,
- -1.109255082925540057138766105229900943501E0L,
- -1.812932453006641348145049323713469043328E-1L,
+static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
+ L(-1.087480809271383885936921889040388133627E-8),
+ L(-1.690067828697463740906962973479310170932E-6),
+ L(-9.608064416995105532790745641974762550982E-5),
+ L(-2.594198839156517191858208513873961837410E-3),
+ L(-3.610954144421543968160459863048062977822E-2),
+ L(-2.629866798251843212210482269563961685666E-1),
+ L(-9.709186825881775885917984975685752956660E-1),
+ L(-1.667521829918185121727268867619982417317E0),
+ L(-1.109255082925540057138766105229900943501E0),
+ L(-1.812932453006641348145049323713469043328E-1),
};
#define NQ3r2_4D 9
-static const long double Q3r2_4D[NQ3r2_4D + 1] = {
- 1.060552717496912381388763753841473407026E-7L,
- 1.676928002024920520786883649102388708024E-5L,
- 9.803481712245420839301400601140812255737E-4L,
- 2.765559874262309494758505158089249012930E-2L,
- 4.117921827792571791298862613287549140706E-1L,
- 3.323769515244751267093378361930279161413E0L,
- 1.436602494405814164724810151689705353670E1L,
- 3.163087869617098638064881410646782408297E1L,
- 3.198181264977021649489103980298349589419E1L,
- 1.203649258862068431199471076202897823272E1L,
+static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
+ L(1.060552717496912381388763753841473407026E-7),
+ L(1.676928002024920520786883649102388708024E-5),
+ L(9.803481712245420839301400601140812255737E-4),
+ L(2.765559874262309494758505158089249012930E-2),
+ L(4.117921827792571791298862613287549140706E-1),
+ L(3.323769515244751267093378361930279161413E0),
+ L(1.436602494405814164724810151689705353670E1),
+ L(3.163087869617098638064881410646782408297E1),
+ L(3.198181264977021649489103980298349589419E1),
+ L(1.203649258862068431199471076202897823272E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -554,30 +554,30 @@ static const long double Q3r2_4D[NQ3r2_4D + 1] = {
Peak relative error 1.6e-36
0.3125 <= 1/x <= 0.375 */
#define NQ2r7_3r2N 9
-static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
- -1.723405393982209853244278760171643219530E-7L,
- -2.090508758514655456365709712333460087442E-5L,
- -9.140104013370974823232873472192719263019E-4L,
- -1.871349499990714843332742160292474780128E-2L,
- -1.948930738119938669637865956162512983416E-1L,
- -1.048764684978978127908439526343174139788E0L,
- -2.827714929925679500237476105843643064698E0L,
- -3.508761569156476114276988181329773987314E0L,
- -1.669332202790211090973255098624488308989E0L,
- -1.930796319299022954013840684651016077770E-1L,
+static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ L(-1.723405393982209853244278760171643219530E-7),
+ L(-2.090508758514655456365709712333460087442E-5),
+ L(-9.140104013370974823232873472192719263019E-4),
+ L(-1.871349499990714843332742160292474780128E-2),
+ L(-1.948930738119938669637865956162512983416E-1),
+ L(-1.048764684978978127908439526343174139788E0),
+ L(-2.827714929925679500237476105843643064698E0),
+ L(-3.508761569156476114276988181329773987314E0),
+ L(-1.669332202790211090973255098624488308989E0),
+ L(-1.930796319299022954013840684651016077770E-1),
};
#define NQ2r7_3r2D 9
-static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
- 1.680730662300831976234547482334347983474E-6L,
- 2.084241442440551016475972218719621841120E-4L,
- 9.445316642108367479043541702688736295579E-3L,
- 2.044637889456631896650179477133252184672E-1L,
- 2.316091982244297350829522534435350078205E0L,
- 1.412031891783015085196708811890448488865E1L,
- 4.583830154673223384837091077279595496149E1L,
- 7.549520609270909439885998474045974122261E1L,
- 5.697605832808113367197494052388203310638E1L,
- 1.601496240876192444526383314589371686234E1L,
+static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ L(1.680730662300831976234547482334347983474E-6),
+ L(2.084241442440551016475972218719621841120E-4),
+ L(9.445316642108367479043541702688736295579E-3),
+ L(2.044637889456631896650179477133252184672E-1),
+ L(2.316091982244297350829522534435350078205E0),
+ L(1.412031891783015085196708811890448488865E1),
+ L(4.583830154673223384837091077279595496149E1),
+ L(7.549520609270909439885998474045974122261E1),
+ L(5.697605832808113367197494052388203310638E1),
+ L(1.601496240876192444526383314589371686234E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -586,29 +586,29 @@ static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
Peak relative error 9.5e-36
0.375 <= 1/x <= 0.4375 */
#define NQ2r3_2r7N 9
-static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
- -8.603042076329122085722385914954878953775E-7L,
- -7.701746260451647874214968882605186675720E-5L,
- -2.407932004380727587382493696877569654271E-3L,
- -3.403434217607634279028110636919987224188E-2L,
- -2.348707332185238159192422084985713102877E-1L,
- -7.957498841538254916147095255700637463207E-1L,
- -1.258469078442635106431098063707934348577E0L,
- -8.162415474676345812459353639449971369890E-1L,
- -1.581783890269379690141513949609572806898E-1L,
- -1.890595651683552228232308756569450822905E-3L,
+static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ L(-8.603042076329122085722385914954878953775E-7),
+ L(-7.701746260451647874214968882605186675720E-5),
+ L(-2.407932004380727587382493696877569654271E-3),
+ L(-3.403434217607634279028110636919987224188E-2),
+ L(-2.348707332185238159192422084985713102877E-1),
+ L(-7.957498841538254916147095255700637463207E-1),
+ L(-1.258469078442635106431098063707934348577E0),
+ L(-8.162415474676345812459353639449971369890E-1),
+ L(-1.581783890269379690141513949609572806898E-1),
+ L(-1.890595651683552228232308756569450822905E-3),
};
#define NQ2r3_2r7D 8
-static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
- 8.390017524798316921170710533381568175665E-6L,
- 7.738148683730826286477254659973968763659E-4L,
- 2.541480810958665794368759558791634341779E-2L,
- 3.878879789711276799058486068562386244873E-1L,
- 3.003783779325811292142957336802456109333E0L,
- 1.206480374773322029883039064575464497400E1L,
- 2.458414064785315978408974662900438351782E1L,
- 2.367237826273668567199042088835448715228E1L,
- 9.231451197519171090875569102116321676763E0L,
+static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ L(8.390017524798316921170710533381568175665E-6),
+ L(7.738148683730826286477254659973968763659E-4),
+ L(2.541480810958665794368759558791634341779E-2),
+ L(3.878879789711276799058486068562386244873E-1),
+ L(3.003783779325811292142957336802456109333E0),
+ L(1.206480374773322029883039064575464497400E1),
+ L(2.458414064785315978408974662900438351782E1),
+ L(2.367237826273668567199042088835448715228E1),
+ L(9.231451197519171090875569102116321676763E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -617,39 +617,39 @@ static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
Peak relative error 1.4e-36
0.4375 <= 1/x <= 0.5 */
#define NQ2_2r3N 9
-static const long double Q2_2r3N[NQ2_2r3N + 1] = {
- -5.552507516089087822166822364590806076174E-6L,
- -4.135067659799500521040944087433752970297E-4L,
- -1.059928728869218962607068840646564457980E-2L,
- -1.212070036005832342565792241385459023801E-1L,
- -6.688350110633603958684302153362735625156E-1L,
- -1.793587878197360221340277951304429821582E0L,
- -2.225407682237197485644647380483725045326E0L,
- -1.123402135458940189438898496348239744403E0L,
- -1.679187241566347077204805190763597299805E-1L,
- -1.458550613639093752909985189067233504148E-3L,
+static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
+ L(-5.552507516089087822166822364590806076174E-6),
+ L(-4.135067659799500521040944087433752970297E-4),
+ L(-1.059928728869218962607068840646564457980E-2),
+ L(-1.212070036005832342565792241385459023801E-1),
+ L(-6.688350110633603958684302153362735625156E-1),
+ L(-1.793587878197360221340277951304429821582E0),
+ L(-2.225407682237197485644647380483725045326E0),
+ L(-1.123402135458940189438898496348239744403E0),
+ L(-1.679187241566347077204805190763597299805E-1),
+ L(-1.458550613639093752909985189067233504148E-3),
};
#define NQ2_2r3D 8
-static const long double Q2_2r3D[NQ2_2r3D + 1] = {
- 5.415024336507980465169023996403597916115E-5L,
- 4.179246497380453022046357404266022870788E-3L,
- 1.136306384261959483095442402929502368598E-1L,
- 1.422640343719842213484515445393284072830E0L,
- 8.968786703393158374728850922289204805764E0L,
- 2.914542473339246127533384118781216495934E1L,
- 4.781605421020380669870197378210457054685E1L,
- 3.693865837171883152382820584714795072937E1L,
- 1.153220502744204904763115556224395893076E1L,
+static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
+ L(5.415024336507980465169023996403597916115E-5),
+ L(4.179246497380453022046357404266022870788E-3),
+ L(1.136306384261959483095442402929502368598E-1),
+ L(1.422640343719842213484515445393284072830E0),
+ L(8.968786703393158374728850922289204805764E0),
+ L(2.914542473339246127533384118781216495934E1),
+ L(4.781605421020380669870197378210457054685E1),
+ L(3.693865837171883152382820584714795072937E1),
+ L(1.153220502744204904763115556224395893076E1),
/* 1.000000000000000000000000000000000000000E0 */
};
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -664,10 +664,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -682,35 +682,35 @@ deval (long double x, const long double *p, int n)
/* Bessel function of the first kind, order one. */
-long double
-__ieee754_j1l (long double x)
+_Float128
+__ieee754_j1l (_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
{
if (x != x)
return x + x;
else
- return 0.0L;
+ return 0;
}
- if (x == 0.0L)
+ if (x == 0)
return x;
xx = fabsl (x);
- if (xx <= 0x1p-58L)
+ if (xx <= L(0x1p-58))
{
- long double ret = x * 0.5L;
+ _Float128 ret = x * L(0.5);
math_check_force_underflow (ret);
if (ret == 0)
__set_errno (ERANGE);
return ret;
}
- if (xx <= 2.0L)
+ if (xx <= 2)
{
/* 0 <= x <= 2 */
z = xx * xx;
p = xx * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
- p += 0.5L * xx;
+ p += L(0.5) * xx;
if (x < 0)
p = -p;
return p;
@@ -725,7 +725,7 @@ __ieee754_j1l (long double x)
__sincosl (xx, &s, &c);
ss = -s - c;
cc = s - c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = __cosl (xx + xx);
if ((s * c) > 0)
@@ -734,7 +734,7 @@ __ieee754_j1l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
+ if (xx > L(0x1p256))
{
z = ONEOSQPI * cc / __ieee754_sqrtl (xx);
if (x < 0)
@@ -742,7 +742,7 @@ __ieee754_j1l (long double x)
return z;
}
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -800,9 +800,9 @@ __ieee754_j1l (long double x)
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * q;
- q = q * xinv + 0.375L * xinv;
+ q = q * xinv + L(0.375) * xinv;
z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
if (x < 0)
z = -z;
@@ -815,47 +815,47 @@ strong_alias (__ieee754_j1l, __j1l_finite)
Peak relative error 6.2e-38
0 <= x <= 2 */
#define NY0_2N 7
-static long double Y0_2N[NY0_2N + 1] = {
- -6.804415404830253804408698161694720833249E19L,
- 1.805450517967019908027153056150465849237E19L,
- -8.065747497063694098810419456383006737312E17L,
- 1.401336667383028259295830955439028236299E16L,
- -1.171654432898137585000399489686629680230E14L,
- 5.061267920943853732895341125243428129150E11L,
- -1.096677850566094204586208610960870217970E9L,
- 9.541172044989995856117187515882879304461E5L,
+static _Float128 Y0_2N[NY0_2N + 1] = {
+ L(-6.804415404830253804408698161694720833249E19),
+ L(1.805450517967019908027153056150465849237E19),
+ L(-8.065747497063694098810419456383006737312E17),
+ L(1.401336667383028259295830955439028236299E16),
+ L(-1.171654432898137585000399489686629680230E14),
+ L(5.061267920943853732895341125243428129150E11),
+ L(-1.096677850566094204586208610960870217970E9),
+ L(9.541172044989995856117187515882879304461E5),
};
#define NY0_2D 7
-static long double Y0_2D[NY0_2D + 1] = {
- 3.470629591820267059538637461549677594549E20L,
- 4.120796439009916326855848107545425217219E18L,
- 2.477653371652018249749350657387030814542E16L,
- 9.954678543353888958177169349272167762797E13L,
- 2.957927997613630118216218290262851197754E11L,
- 6.748421382188864486018861197614025972118E8L,
- 1.173453425218010888004562071020305709319E6L,
- 1.450335662961034949894009554536003377187E3L,
+static _Float128 Y0_2D[NY0_2D + 1] = {
+ L(3.470629591820267059538637461549677594549E20),
+ L(4.120796439009916326855848107545425217219E18),
+ L(2.477653371652018249749350657387030814542E16),
+ L(9.954678543353888958177169349272167762797E13),
+ L(2.957927997613630118216218290262851197754E11),
+ L(6.748421382188864486018861197614025972118E8),
+ L(1.173453425218010888004562071020305709319E6),
+ L(1.450335662961034949894009554536003377187E3),
/* 1.000000000000000000000000000000000000000E0 */
};
/* Bessel function of the second kind, order one. */
-long double
-__ieee754_y1l (long double x)
+_Float128
+__ieee754_y1l (_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
{
if (x != x)
return x + x;
else
- return 0.0L;
+ return 0;
}
- if (x <= 0.0L)
+ if (x <= 0)
{
- if (x < 0.0L)
+ if (x < 0)
return (zero / (zero * x));
return -HUGE_VALL + x;
}
@@ -867,7 +867,7 @@ __ieee754_y1l (long double x)
__set_errno (ERANGE);
return z;
}
- if (xx <= 2.0L)
+ if (xx <= 2)
{
/* 0 <= x <= 2 */
SET_RESTORE_ROUNDL (FE_TONEAREST);
@@ -887,7 +887,7 @@ __ieee754_y1l (long double x)
__sincosl (xx, &s, &c);
ss = -s - c;
cc = s - c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = __cosl (xx + xx);
if ((s * c) > 0)
@@ -896,10 +896,10 @@ __ieee754_y1l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
+ if (xx > L(0x1p256))
return ONEOSQPI * ss / __ieee754_sqrtl (xx);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -957,9 +957,9 @@ __ieee754_y1l (long double x)
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * q;
- q = q * xinv + 0.375L * xinv;
+ q = q * xinv + L(0.375) * xinv;
z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (xx);
return z;
}
diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
index 98669e6e3e..470631e600 100644
--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
@@ -61,20 +61,20 @@
#include <math.h>
#include <math_private.h>
-static const long double
- invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
- two = 2.0e0L,
- one = 1.0e0L,
- zero = 0.0L;
+static const _Float128
+ invsqrtpi = L(5.6418958354775628694807945156077258584405E-1),
+ two = 2,
+ one = 1,
+ zero = 0;
-long double
-__ieee754_jnl (int n, long double x)
+_Float128
+__ieee754_jnl (int n, _Float128 x)
{
u_int32_t se;
int32_t i, ix, sgn;
- long double a, b, temp, di, ret;
- long double z, w;
+ _Float128 a, b, temp, di, ret;
+ _Float128 z, w;
ieee854_long_double_shape_type u;
@@ -108,9 +108,9 @@ __ieee754_jnl (int n, long double x)
{
SET_RESTORE_ROUNDL (FE_TONEAREST);
- if (x == 0.0L || ix >= 0x7fff0000) /* if x is 0 or inf */
+ if (x == 0 || ix >= 0x7fff0000) /* if x is 0 or inf */
return sgn == 1 ? -zero : zero;
- else if ((long double) n <= x)
+ else if ((_Float128) n <= x)
{
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
if (ix >= 0x412D0000)
@@ -131,8 +131,8 @@ __ieee754_jnl (int n, long double x)
* 2 -s+c -c-s
* 3 s+c c-s
*/
- long double s;
- long double c;
+ _Float128 s;
+ _Float128 c;
__sincosl (x, &s, &c);
switch (n & 3)
{
@@ -158,7 +158,7 @@ __ieee754_jnl (int n, long double x)
for (i = 1; i < n; i++)
{
temp = b;
- b = b * ((long double) (i + i) / x) - a; /* avoid underflow */
+ b = b * ((_Float128) (i + i) / x) - a; /* avoid underflow */
a = temp;
}
}
@@ -178,7 +178,7 @@ __ieee754_jnl (int n, long double x)
b = temp;
for (a = one, i = 2; i <= n; i++)
{
- a *= (long double) i; /* a = n! */
+ a *= (_Float128) i; /* a = n! */
b *= temp; /* b = (x/2)^n */
}
b = b / a;
@@ -215,16 +215,16 @@ __ieee754_jnl (int n, long double x)
* When Q(k) > 1e17 good for quadruple
*/
/* determine k */
- long double t, v;
- long double q0, q1, h, tmp;
+ _Float128 t, v;
+ _Float128 q0, q1, h, tmp;
int32_t k, m;
- w = (n + n) / (long double) x;
- h = 2.0L / (long double) x;
+ w = (n + n) / (_Float128) x;
+ h = 2 / (_Float128) x;
q0 = w;
z = w + h;
- q1 = w * z - 1.0L;
+ q1 = w * z - 1;
k = 1;
- while (q1 < 1.0e17L)
+ while (q1 < L(1.0e17))
{
k += 1;
z += h;
@@ -249,9 +249,9 @@ __ieee754_jnl (int n, long double x)
v = two / x;
tmp = tmp * __ieee754_logl (fabsl (v * tmp));
- if (tmp < 1.1356523406294143949491931077970765006170e+04L)
+ if (tmp < L(1.1356523406294143949491931077970765006170e+04))
{
- for (i = n - 1, di = (long double) (i + i); i > 0; i--)
+ for (i = n - 1, di = (_Float128) (i + i); i > 0; i--)
{
temp = b;
b *= di;
@@ -262,7 +262,7 @@ __ieee754_jnl (int n, long double x)
}
else
{
- for (i = n - 1, di = (long double) (i + i); i > 0; i--)
+ for (i = n - 1, di = (_Float128) (i + i); i > 0; i--)
{
temp = b;
b *= di;
@@ -270,7 +270,7 @@ __ieee754_jnl (int n, long double x)
a = temp;
di -= two;
/* scale b to avoid spurious overflow */
- if (b > 1e100L)
+ if (b > L(1e100))
{
a /= b;
t /= b;
@@ -306,13 +306,13 @@ __ieee754_jnl (int n, long double x)
}
strong_alias (__ieee754_jnl, __jnl_finite)
-long double
-__ieee754_ynl (int n, long double x)
+_Float128
+__ieee754_ynl (int n, _Float128 x)
{
u_int32_t se;
int32_t i, ix;
int32_t sign;
- long double a, b, temp, ret;
+ _Float128 a, b, temp, ret;
ieee854_long_double_shape_type u;
u.value = x;
@@ -325,10 +325,10 @@ __ieee754_ynl (int n, long double x)
if ((u.parts32.w0 & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3)
return x + x;
}
- if (x <= 0.0L)
+ if (x <= 0)
{
- if (x == 0.0L)
- return ((n < 0 && (n & 1) != 0) ? 1.0L : -1.0L) / 0.0L;
+ if (x == 0)
+ return ((n < 0 && (n & 1) != 0) ? 1 : -1) / L(0.0);
if (se & 0x80000000)
return zero / (zero * x);
}
@@ -367,8 +367,8 @@ __ieee754_ynl (int n, long double x)
* 2 -s+c -c-s
* 3 s+c c-s
*/
- long double s;
- long double c;
+ _Float128 s;
+ _Float128 c;
__sincosl (x, &s, &c);
switch (n & 3)
{
@@ -397,7 +397,7 @@ __ieee754_ynl (int n, long double x)
for (i = 1; i < n && se != 0xffff0000; i++)
{
temp = b;
- b = ((long double) (i + i) / x) * b - a;
+ b = ((_Float128) (i + i) / x) * b - a;
u.value = b;
se = u.parts32.w0 & 0xffff0000;
a = temp;
diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index 5b513ea1df..6f55b4da6a 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -72,35 +72,35 @@
#include <math_private.h>
#include <float.h>
-static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
+static const _Float128 PIL = L(3.1415926535897932384626433832795028841972E0);
#if LDBL_MANT_DIG == 106
-static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
+static const _Float128 MAXLGM = L(0x5.d53649e2d469dbc1f01e99fd66p+1012);
#else
-static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
+static const _Float128 MAXLGM = L(1.0485738685148938358098967157129705071571E4928);
#endif
-static const long double one = 1.0L;
-static const long double huge = LDBL_MAX;
+static const _Float128 one = 1;
+static const _Float128 huge = LDBL_MAX;
/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
1/x <= 0.0741 (x >= 13.495...)
Peak relative error 1.5e-36 */
-static const long double ls2pi = 9.1893853320467274178032973640561763986140E-1L;
+static const _Float128 ls2pi = L(9.1893853320467274178032973640561763986140E-1);
#define NRASY 12
-static const long double RASY[NRASY + 1] =
+static const _Float128 RASY[NRASY + 1] =
{
- 8.333333333333333333333333333310437112111E-2L,
- -2.777777777777777777777774789556228296902E-3L,
- 7.936507936507936507795933938448586499183E-4L,
- -5.952380952380952041799269756378148574045E-4L,
- 8.417508417507928904209891117498524452523E-4L,
- -1.917526917481263997778542329739806086290E-3L,
- 6.410256381217852504446848671499409919280E-3L,
- -2.955064066900961649768101034477363301626E-2L,
- 1.796402955865634243663453415388336954675E-1L,
- -1.391522089007758553455753477688592767741E0L,
- 1.326130089598399157988112385013829305510E1L,
- -1.420412699593782497803472576479997819149E2L,
- 1.218058922427762808938869872528846787020E3L
+ L(8.333333333333333333333333333310437112111E-2),
+ L(-2.777777777777777777777774789556228296902E-3),
+ L(7.936507936507936507795933938448586499183E-4),
+ L(-5.952380952380952041799269756378148574045E-4),
+ L(8.417508417507928904209891117498524452523E-4),
+ L(-1.917526917481263997778542329739806086290E-3),
+ L(6.410256381217852504446848671499409919280E-3),
+ L(-2.955064066900961649768101034477363301626E-2),
+ L(1.796402955865634243663453415388336954675E-1),
+ L(-1.391522089007758553455753477688592767741E0),
+ L(1.326130089598399157988112385013829305510E1),
+ L(-1.420412699593782497803472576479997819149E2),
+ L(1.218058922427762808938869872528846787020E3)
};
@@ -108,30 +108,30 @@ static const long double RASY[NRASY + 1] =
-0.5 <= x <= 0.5
12.5 <= x+13 <= 13.5
Peak relative error 1.1e-36 */
-static const long double lgam13a = 1.9987213134765625E1L;
-static const long double lgam13b = 1.3608962611495173623870550785125024484248E-6L;
+static const _Float128 lgam13a = L(1.9987213134765625E1);
+static const _Float128 lgam13b = L(1.3608962611495173623870550785125024484248E-6);
#define NRN13 7
-static const long double RN13[NRN13 + 1] =
+static const _Float128 RN13[NRN13 + 1] =
{
- 8.591478354823578150238226576156275285700E11L,
- 2.347931159756482741018258864137297157668E11L,
- 2.555408396679352028680662433943000804616E10L,
- 1.408581709264464345480765758902967123937E9L,
- 4.126759849752613822953004114044451046321E7L,
- 6.133298899622688505854211579222889943778E5L,
- 3.929248056293651597987893340755876578072E3L,
- 6.850783280018706668924952057996075215223E0L
+ L(8.591478354823578150238226576156275285700E11),
+ L(2.347931159756482741018258864137297157668E11),
+ L(2.555408396679352028680662433943000804616E10),
+ L(1.408581709264464345480765758902967123937E9),
+ L(4.126759849752613822953004114044451046321E7),
+ L(6.133298899622688505854211579222889943778E5),
+ L(3.929248056293651597987893340755876578072E3),
+ L(6.850783280018706668924952057996075215223E0)
};
#define NRD13 6
-static const long double RD13[NRD13 + 1] =
+static const _Float128 RD13[NRD13 + 1] =
{
- 3.401225382297342302296607039352935541669E11L,
- 8.756765276918037910363513243563234551784E10L,
- 8.873913342866613213078554180987647243903E9L,
- 4.483797255342763263361893016049310017973E8L,
- 1.178186288833066430952276702931512870676E7L,
- 1.519928623743264797939103740132278337476E5L,
- 7.989298844938119228411117593338850892311E2L
+ L(3.401225382297342302296607039352935541669E11),
+ L(8.756765276918037910363513243563234551784E10),
+ L(8.873913342866613213078554180987647243903E9),
+ L(4.483797255342763263361893016049310017973E8),
+ L(1.178186288833066430952276702931512870676E7),
+ L(1.519928623743264797939103740132278337476E5),
+ L(7.989298844938119228411117593338850892311E2)
/* 1.0E0L */
};
@@ -140,30 +140,30 @@ static const long double RD13[NRD13 + 1] =
-0.5 <= x <= 0.5
11.5 <= x+12 <= 12.5
Peak relative error 4.1e-36 */
-static const long double lgam12a = 1.75023040771484375E1L;
-static const long double lgam12b = 3.7687254483392876529072161996717039575982E-6L;
+static const _Float128 lgam12a = L(1.75023040771484375E1);
+static const _Float128 lgam12b = L(3.7687254483392876529072161996717039575982E-6);
#define NRN12 7
-static const long double RN12[NRN12 + 1] =
+static const _Float128 RN12[NRN12 + 1] =
{
- 4.709859662695606986110997348630997559137E11L,
- 1.398713878079497115037857470168777995230E11L,
- 1.654654931821564315970930093932954900867E10L,
- 9.916279414876676861193649489207282144036E8L,
- 3.159604070526036074112008954113411389879E7L,
- 5.109099197547205212294747623977502492861E5L,
- 3.563054878276102790183396740969279826988E3L,
- 6.769610657004672719224614163196946862747E0L
+ L(4.709859662695606986110997348630997559137E11),
+ L(1.398713878079497115037857470168777995230E11),
+ L(1.654654931821564315970930093932954900867E10),
+ L(9.916279414876676861193649489207282144036E8),
+ L(3.159604070526036074112008954113411389879E7),
+ L(5.109099197547205212294747623977502492861E5),
+ L(3.563054878276102790183396740969279826988E3),
+ L(6.769610657004672719224614163196946862747E0)
};
#define NRD12 6
-static const long double RD12[NRD12 + 1] =
+static const _Float128 RD12[NRD12 + 1] =
{
- 1.928167007860968063912467318985802726613E11L,
- 5.383198282277806237247492369072266389233E10L,
- 5.915693215338294477444809323037871058363E9L,
- 3.241438287570196713148310560147925781342E8L,
- 9.236680081763754597872713592701048455890E6L,
- 1.292246897881650919242713651166596478850E5L,
- 7.366532445427159272584194816076600211171E2L
+ L(1.928167007860968063912467318985802726613E11),
+ L(5.383198282277806237247492369072266389233E10),
+ L(5.915693215338294477444809323037871058363E9),
+ L(3.241438287570196713148310560147925781342E8),
+ L(9.236680081763754597872713592701048455890E6),
+ L(1.292246897881650919242713651166596478850E5),
+ L(7.366532445427159272584194816076600211171E2)
/* 1.0E0L */
};
@@ -172,30 +172,30 @@ static const long double RD12[NRD12 + 1] =
-0.5 <= x <= 0.5
10.5 <= x+11 <= 11.5
Peak relative error 1.8e-35 */
-static const long double lgam11a = 1.5104400634765625E1L;
-static const long double lgam11b = 1.1938309890295225709329251070371882250744E-5L;
+static const _Float128 lgam11a = L(1.5104400634765625E1);
+static const _Float128 lgam11b = L(1.1938309890295225709329251070371882250744E-5);
#define NRN11 7
-static const long double RN11[NRN11 + 1] =
+static const _Float128 RN11[NRN11 + 1] =
{
- 2.446960438029415837384622675816736622795E11L,
- 7.955444974446413315803799763901729640350E10L,
- 1.030555327949159293591618473447420338444E10L,
- 6.765022131195302709153994345470493334946E8L,
- 2.361892792609204855279723576041468347494E7L,
- 4.186623629779479136428005806072176490125E5L,
- 3.202506022088912768601325534149383594049E3L,
- 6.681356101133728289358838690666225691363E0L
+ L(2.446960438029415837384622675816736622795E11),
+ L(7.955444974446413315803799763901729640350E10),
+ L(1.030555327949159293591618473447420338444E10),
+ L(6.765022131195302709153994345470493334946E8),
+ L(2.361892792609204855279723576041468347494E7),
+ L(4.186623629779479136428005806072176490125E5),
+ L(3.202506022088912768601325534149383594049E3),
+ L(6.681356101133728289358838690666225691363E0)
};
#define NRD11 6
-static const long double RD11[NRD11 + 1] =
+static const _Float128 RD11[NRD11 + 1] =
{
- 1.040483786179428590683912396379079477432E11L,
- 3.172251138489229497223696648369823779729E10L,
- 3.806961885984850433709295832245848084614E9L,
- 2.278070344022934913730015420611609620171E8L,
- 7.089478198662651683977290023829391596481E6L,
- 1.083246385105903533237139380509590158658E5L,
- 6.744420991491385145885727942219463243597E2L
+ L(1.040483786179428590683912396379079477432E11),
+ L(3.172251138489229497223696648369823779729E10),
+ L(3.806961885984850433709295832245848084614E9),
+ L(2.278070344022934913730015420611609620171E8),
+ L(7.089478198662651683977290023829391596481E6),
+ L(1.083246385105903533237139380509590158658E5),
+ L(6.744420991491385145885727942219463243597E2)
/* 1.0E0L */
};
@@ -204,31 +204,31 @@ static const long double RD11[NRD11 + 1] =
-0.5 <= x <= 0.5
9.5 <= x+10 <= 10.5
Peak relative error 5.4e-37 */
-static const long double lgam10a = 1.280181884765625E1L;
-static const long double lgam10b = 8.6324252196112077178745667061642811492557E-6L;
+static const _Float128 lgam10a = L(1.280181884765625E1);
+static const _Float128 lgam10b = L(8.6324252196112077178745667061642811492557E-6);
#define NRN10 7
-static const long double RN10[NRN10 + 1] =
+static const _Float128 RN10[NRN10 + 1] =
{
- -1.239059737177249934158597996648808363783E14L,
- -4.725899566371458992365624673357356908719E13L,
- -7.283906268647083312042059082837754850808E12L,
- -5.802855515464011422171165179767478794637E11L,
- -2.532349691157548788382820303182745897298E10L,
- -5.884260178023777312587193693477072061820E8L,
- -6.437774864512125749845840472131829114906E6L,
- -2.350975266781548931856017239843273049384E4L
+ L(-1.239059737177249934158597996648808363783E14),
+ L(-4.725899566371458992365624673357356908719E13),
+ L(-7.283906268647083312042059082837754850808E12),
+ L(-5.802855515464011422171165179767478794637E11),
+ L(-2.532349691157548788382820303182745897298E10),
+ L(-5.884260178023777312587193693477072061820E8),
+ L(-6.437774864512125749845840472131829114906E6),
+ L(-2.350975266781548931856017239843273049384E4)
};
#define NRD10 7
-static const long double RD10[NRD10 + 1] =
+static const _Float128 RD10[NRD10 + 1] =
{
- -5.502645997581822567468347817182347679552E13L,
- -1.970266640239849804162284805400136473801E13L,
- -2.819677689615038489384974042561531409392E12L,
- -2.056105863694742752589691183194061265094E11L,
- -8.053670086493258693186307810815819662078E9L,
- -1.632090155573373286153427982504851867131E8L,
- -1.483575879240631280658077826889223634921E6L,
- -4.002806669713232271615885826373550502510E3L
+ L(-5.502645997581822567468347817182347679552E13),
+ L(-1.970266640239849804162284805400136473801E13),
+ L(-2.819677689615038489384974042561531409392E12),
+ L(-2.056105863694742752589691183194061265094E11),
+ L(-8.053670086493258693186307810815819662078E9),
+ L(-1.632090155573373286153427982504851867131E8),
+ L(-1.483575879240631280658077826889223634921E6),
+ L(-4.002806669713232271615885826373550502510E3)
/* 1.0E0L */
};
@@ -237,31 +237,31 @@ static const long double RD10[NRD10 + 1] =
-0.5 <= x <= 0.5
8.5 <= x+9 <= 9.5
Peak relative error 3.6e-36 */
-static const long double lgam9a = 1.06045989990234375E1L;
-static const long double lgam9b = 3.9037218127284172274007216547549861681400E-6L;
+static const _Float128 lgam9a = L(1.06045989990234375E1);
+static const _Float128 lgam9b = L(3.9037218127284172274007216547549861681400E-6);
#define NRN9 7
-static const long double RN9[NRN9 + 1] =
+static const _Float128 RN9[NRN9 + 1] =
{
- -4.936332264202687973364500998984608306189E13L,
- -2.101372682623700967335206138517766274855E13L,
- -3.615893404644823888655732817505129444195E12L,
- -3.217104993800878891194322691860075472926E11L,
- -1.568465330337375725685439173603032921399E10L,
- -4.073317518162025744377629219101510217761E8L,
- -4.983232096406156139324846656819246974500E6L,
- -2.036280038903695980912289722995505277253E4L
+ L(-4.936332264202687973364500998984608306189E13),
+ L(-2.101372682623700967335206138517766274855E13),
+ L(-3.615893404644823888655732817505129444195E12),
+ L(-3.217104993800878891194322691860075472926E11),
+ L(-1.568465330337375725685439173603032921399E10),
+ L(-4.073317518162025744377629219101510217761E8),
+ L(-4.983232096406156139324846656819246974500E6),
+ L(-2.036280038903695980912289722995505277253E4)
};
#define NRD9 7
-static const long double RD9[NRD9 + 1] =
+static const _Float128 RD9[NRD9 + 1] =
{
- -2.306006080437656357167128541231915480393E13L,
- -9.183606842453274924895648863832233799950E12L,
- -1.461857965935942962087907301194381010380E12L,
- -1.185728254682789754150068652663124298303E11L,
- -5.166285094703468567389566085480783070037E9L,
- -1.164573656694603024184768200787835094317E8L,
- -1.177343939483908678474886454113163527909E6L,
- -3.529391059783109732159524500029157638736E3L
+ L(-2.306006080437656357167128541231915480393E13),
+ L(-9.183606842453274924895648863832233799950E12),
+ L(-1.461857965935942962087907301194381010380E12),
+ L(-1.185728254682789754150068652663124298303E11),
+ L(-5.166285094703468567389566085480783070037E9),
+ L(-1.164573656694603024184768200787835094317E8),
+ L(-1.177343939483908678474886454113163527909E6),
+ L(-3.529391059783109732159524500029157638736E3)
/* 1.0E0L */
};
@@ -270,32 +270,32 @@ static const long double RD9[NRD9 + 1] =
-0.5 <= x <= 0.5
7.5 <= x+8 <= 8.5
Peak relative error 2.4e-37 */
-static const long double lgam8a = 8.525146484375E0L;
-static const long double lgam8b = 1.4876690414300165531036347125050759667737E-5L;
+static const _Float128 lgam8a = L(8.525146484375E0);
+static const _Float128 lgam8b = L(1.4876690414300165531036347125050759667737E-5);
#define NRN8 8
-static const long double RN8[NRN8 + 1] =
+static const _Float128 RN8[NRN8 + 1] =
{
- 6.600775438203423546565361176829139703289E11L,
- 3.406361267593790705240802723914281025800E11L,
- 7.222460928505293914746983300555538432830E10L,
- 8.102984106025088123058747466840656458342E9L,
- 5.157620015986282905232150979772409345927E8L,
- 1.851445288272645829028129389609068641517E7L,
- 3.489261702223124354745894067468953756656E5L,
- 2.892095396706665774434217489775617756014E3L,
- 6.596977510622195827183948478627058738034E0L
+ L(6.600775438203423546565361176829139703289E11),
+ L(3.406361267593790705240802723914281025800E11),
+ L(7.222460928505293914746983300555538432830E10),
+ L(8.102984106025088123058747466840656458342E9),
+ L(5.157620015986282905232150979772409345927E8),
+ L(1.851445288272645829028129389609068641517E7),
+ L(3.489261702223124354745894067468953756656E5),
+ L(2.892095396706665774434217489775617756014E3),
+ L(6.596977510622195827183948478627058738034E0)
};
#define NRD8 7
-static const long double RD8[NRD8 + 1] =
+static const _Float128 RD8[NRD8 + 1] =
{
- 3.274776546520735414638114828622673016920E11L,
- 1.581811207929065544043963828487733970107E11L,
- 3.108725655667825188135393076860104546416E10L,
- 3.193055010502912617128480163681842165730E9L,
- 1.830871482669835106357529710116211541839E8L,
- 5.790862854275238129848491555068073485086E6L,
- 9.305213264307921522842678835618803553589E4L,
- 6.216974105861848386918949336819572333622E2L
+ L(3.274776546520735414638114828622673016920E11),
+ L(1.581811207929065544043963828487733970107E11),
+ L(3.108725655667825188135393076860104546416E10),
+ L(3.193055010502912617128480163681842165730E9),
+ L(1.830871482669835106357529710116211541839E8),
+ L(5.790862854275238129848491555068073485086E6),
+ L(9.305213264307921522842678835618803553589E4),
+ L(6.216974105861848386918949336819572333622E2)
/* 1.0E0L */
};
@@ -304,32 +304,32 @@ static const long double RD8[NRD8 + 1] =
-0.5 <= x <= 0.5
6.5 <= x+7 <= 7.5
Peak relative error 3.2e-36 */
-static const long double lgam7a = 6.5792388916015625E0L;
-static const long double lgam7b = 1.2320408538495060178292903945321122583007E-5L;
+static const _Float128 lgam7a = L(6.5792388916015625E0);
+static const _Float128 lgam7b = L(1.2320408538495060178292903945321122583007E-5);
#define NRN7 8
-static const long double RN7[NRN7 + 1] =
+static const _Float128 RN7[NRN7 + 1] =
{
- 2.065019306969459407636744543358209942213E11L,
- 1.226919919023736909889724951708796532847E11L,
- 2.996157990374348596472241776917953749106E10L,
- 3.873001919306801037344727168434909521030E9L,
- 2.841575255593761593270885753992732145094E8L,
- 1.176342515359431913664715324652399565551E7L,
- 2.558097039684188723597519300356028511547E5L,
- 2.448525238332609439023786244782810774702E3L,
- 6.460280377802030953041566617300902020435E0L
+ L(2.065019306969459407636744543358209942213E11),
+ L(1.226919919023736909889724951708796532847E11),
+ L(2.996157990374348596472241776917953749106E10),
+ L(3.873001919306801037344727168434909521030E9),
+ L(2.841575255593761593270885753992732145094E8),
+ L(1.176342515359431913664715324652399565551E7),
+ L(2.558097039684188723597519300356028511547E5),
+ L(2.448525238332609439023786244782810774702E3),
+ L(6.460280377802030953041566617300902020435E0)
};
#define NRD7 7
-static const long double RD7[NRD7 + 1] =
+static const _Float128 RD7[NRD7 + 1] =
{
- 1.102646614598516998880874785339049304483E11L,
- 6.099297512712715445879759589407189290040E10L,
- 1.372898136289611312713283201112060238351E10L,
- 1.615306270420293159907951633566635172343E9L,
- 1.061114435798489135996614242842561967459E8L,
- 3.845638971184305248268608902030718674691E6L,
- 7.081730675423444975703917836972720495507E4L,
- 5.423122582741398226693137276201344096370E2L
+ L(1.102646614598516998880874785339049304483E11),
+ L(6.099297512712715445879759589407189290040E10),
+ L(1.372898136289611312713283201112060238351E10),
+ L(1.615306270420293159907951633566635172343E9),
+ L(1.061114435798489135996614242842561967459E8),
+ L(3.845638971184305248268608902030718674691E6),
+ L(7.081730675423444975703917836972720495507E4),
+ L(5.423122582741398226693137276201344096370E2)
/* 1.0E0L */
};
@@ -338,33 +338,33 @@ static const long double RD7[NRD7 + 1] =
-0.5 <= x <= 0.5
5.5 <= x+6 <= 6.5
Peak relative error 6.2e-37 */
-static const long double lgam6a = 4.7874908447265625E0L;
-static const long double lgam6b = 8.9805548349424770093452324304839959231517E-7L;
+static const _Float128 lgam6a = L(4.7874908447265625E0);
+static const _Float128 lgam6b = L(8.9805548349424770093452324304839959231517E-7);
#define NRN6 8
-static const long double RN6[NRN6 + 1] =
+static const _Float128 RN6[NRN6 + 1] =
{
- -3.538412754670746879119162116819571823643E13L,
- -2.613432593406849155765698121483394257148E13L,
- -8.020670732770461579558867891923784753062E12L,
- -1.322227822931250045347591780332435433420E12L,
- -1.262809382777272476572558806855377129513E11L,
- -7.015006277027660872284922325741197022467E9L,
- -2.149320689089020841076532186783055727299E8L,
- -3.167210585700002703820077565539658995316E6L,
- -1.576834867378554185210279285358586385266E4L
+ L(-3.538412754670746879119162116819571823643E13),
+ L(-2.613432593406849155765698121483394257148E13),
+ L(-8.020670732770461579558867891923784753062E12),
+ L(-1.322227822931250045347591780332435433420E12),
+ L(-1.262809382777272476572558806855377129513E11),
+ L(-7.015006277027660872284922325741197022467E9),
+ L(-2.149320689089020841076532186783055727299E8),
+ L(-3.167210585700002703820077565539658995316E6),
+ L(-1.576834867378554185210279285358586385266E4)
};
#define NRD6 8
-static const long double RD6[NRD6 + 1] =
+static const _Float128 RD6[NRD6 + 1] =
{
- -2.073955870771283609792355579558899389085E13L,
- -1.421592856111673959642750863283919318175E13L,
- -4.012134994918353924219048850264207074949E12L,
- -6.013361045800992316498238470888523722431E11L,
- -5.145382510136622274784240527039643430628E10L,
- -2.510575820013409711678540476918249524123E9L,
- -6.564058379709759600836745035871373240904E7L,
- -7.861511116647120540275354855221373571536E5L,
- -2.821943442729620524365661338459579270561E3L
+ L(-2.073955870771283609792355579558899389085E13),
+ L(-1.421592856111673959642750863283919318175E13),
+ L(-4.012134994918353924219048850264207074949E12),
+ L(-6.013361045800992316498238470888523722431E11),
+ L(-5.145382510136622274784240527039643430628E10),
+ L(-2.510575820013409711678540476918249524123E9),
+ L(-6.564058379709759600836745035871373240904E7),
+ L(-7.861511116647120540275354855221373571536E5),
+ L(-2.821943442729620524365661338459579270561E3)
/* 1.0E0L */
};
@@ -373,34 +373,34 @@ static const long double RD6[NRD6 + 1] =
-0.5 <= x <= 0.5
4.5 <= x+5 <= 5.5
Peak relative error 3.4e-37 */
-static const long double lgam5a = 3.17803955078125E0L;
-static const long double lgam5b = 1.4279566695619646941601297055408873990961E-5L;
+static const _Float128 lgam5a = L(3.17803955078125E0);
+static const _Float128 lgam5b = L(1.4279566695619646941601297055408873990961E-5);
#define NRN5 9
-static const long double RN5[NRN5 + 1] =
+static const _Float128 RN5[NRN5 + 1] =
{
- 2.010952885441805899580403215533972172098E11L,
- 1.916132681242540921354921906708215338584E11L,
- 7.679102403710581712903937970163206882492E10L,
- 1.680514903671382470108010973615268125169E10L,
- 2.181011222911537259440775283277711588410E9L,
- 1.705361119398837808244780667539728356096E8L,
- 7.792391565652481864976147945997033946360E6L,
- 1.910741381027985291688667214472560023819E5L,
- 2.088138241893612679762260077783794329559E3L,
- 6.330318119566998299106803922739066556550E0L
+ L(2.010952885441805899580403215533972172098E11),
+ L(1.916132681242540921354921906708215338584E11),
+ L(7.679102403710581712903937970163206882492E10),
+ L(1.680514903671382470108010973615268125169E10),
+ L(2.181011222911537259440775283277711588410E9),
+ L(1.705361119398837808244780667539728356096E8),
+ L(7.792391565652481864976147945997033946360E6),
+ L(1.910741381027985291688667214472560023819E5),
+ L(2.088138241893612679762260077783794329559E3),
+ L(6.330318119566998299106803922739066556550E0)
};
#define NRD5 8
-static const long double RD5[NRD5 + 1] =
+static const _Float128 RD5[NRD5 + 1] =
{
- 1.335189758138651840605141370223112376176E11L,
- 1.174130445739492885895466097516530211283E11L,
- 4.308006619274572338118732154886328519910E10L,
- 8.547402888692578655814445003283720677468E9L,
- 9.934628078575618309542580800421370730906E8L,
- 6.847107420092173812998096295422311820672E7L,
- 2.698552646016599923609773122139463150403E6L,
- 5.526516251532464176412113632726150253215E4L,
- 4.772343321713697385780533022595450486932E2L
+ L(1.335189758138651840605141370223112376176E11),
+ L(1.174130445739492885895466097516530211283E11),
+ L(4.308006619274572338118732154886328519910E10),
+ L(8.547402888692578655814445003283720677468E9),
+ L(9.934628078575618309542580800421370730906E8),
+ L(6.847107420092173812998096295422311820672E7),
+ L(2.698552646016599923609773122139463150403E6),
+ L(5.526516251532464176412113632726150253215E4),
+ L(4.772343321713697385780533022595450486932E2)
/* 1.0E0L */
};
@@ -409,35 +409,35 @@ static const long double RD5[NRD5 + 1] =
-0.5 <= x <= 0.5
3.5 <= x+4 <= 4.5
Peak relative error 6.7e-37 */
-static const long double lgam4a = 1.791748046875E0L;
-static const long double lgam4b = 1.1422353055000812477358380702272722990692E-5L;
+static const _Float128 lgam4a = L(1.791748046875E0);
+static const _Float128 lgam4b = L(1.1422353055000812477358380702272722990692E-5);
#define NRN4 9
-static const long double RN4[NRN4 + 1] =
+static const _Float128 RN4[NRN4 + 1] =
{
- -1.026583408246155508572442242188887829208E13L,
- -1.306476685384622809290193031208776258809E13L,
- -7.051088602207062164232806511992978915508E12L,
- -2.100849457735620004967624442027793656108E12L,
- -3.767473790774546963588549871673843260569E11L,
- -4.156387497364909963498394522336575984206E10L,
- -2.764021460668011732047778992419118757746E9L,
- -1.036617204107109779944986471142938641399E8L,
- -1.895730886640349026257780896972598305443E6L,
- -1.180509051468390914200720003907727988201E4L
+ L(-1.026583408246155508572442242188887829208E13),
+ L(-1.306476685384622809290193031208776258809E13),
+ L(-7.051088602207062164232806511992978915508E12),
+ L(-2.100849457735620004967624442027793656108E12),
+ L(-3.767473790774546963588549871673843260569E11),
+ L(-4.156387497364909963498394522336575984206E10),
+ L(-2.764021460668011732047778992419118757746E9),
+ L(-1.036617204107109779944986471142938641399E8),
+ L(-1.895730886640349026257780896972598305443E6),
+ L(-1.180509051468390914200720003907727988201E4)
};
#define NRD4 9
-static const long double RD4[NRD4 + 1] =
+static const _Float128 RD4[NRD4 + 1] =
{
- -8.172669122056002077809119378047536240889E12L,
- -9.477592426087986751343695251801814226960E12L,
- -4.629448850139318158743900253637212801682E12L,
- -1.237965465892012573255370078308035272942E12L,
- -1.971624313506929845158062177061297598956E11L,
- -1.905434843346570533229942397763361493610E10L,
- -1.089409357680461419743730978512856675984E9L,
- -3.416703082301143192939774401370222822430E7L,
- -4.981791914177103793218433195857635265295E5L,
- -2.192507743896742751483055798411231453733E3L
+ L(-8.172669122056002077809119378047536240889E12),
+ L(-9.477592426087986751343695251801814226960E12),
+ L(-4.629448850139318158743900253637212801682E12),
+ L(-1.237965465892012573255370078308035272942E12),
+ L(-1.971624313506929845158062177061297598956E11),
+ L(-1.905434843346570533229942397763361493610E10),
+ L(-1.089409357680461419743730978512856675984E9),
+ L(-3.416703082301143192939774401370222822430E7),
+ L(-4.981791914177103793218433195857635265295E5),
+ L(-2.192507743896742751483055798411231453733E3)
/* 1.0E0L */
};
@@ -446,36 +446,36 @@ static const long double RD4[NRD4 + 1] =
-0.25 <= x <= 0.5
2.75 <= x+3 <= 3.5
Peak relative error 6.0e-37 */
-static const long double lgam3a = 6.93145751953125E-1L;
-static const long double lgam3b = 1.4286068203094172321214581765680755001344E-6L;
+static const _Float128 lgam3a = L(6.93145751953125E-1);
+static const _Float128 lgam3b = L(1.4286068203094172321214581765680755001344E-6);
#define NRN3 9
-static const long double RN3[NRN3 + 1] =
+static const _Float128 RN3[NRN3 + 1] =
{
- -4.813901815114776281494823863935820876670E11L,
- -8.425592975288250400493910291066881992620E11L,
- -6.228685507402467503655405482985516909157E11L,
- -2.531972054436786351403749276956707260499E11L,
- -6.170200796658926701311867484296426831687E10L,
- -9.211477458528156048231908798456365081135E9L,
- -8.251806236175037114064561038908691305583E8L,
- -4.147886355917831049939930101151160447495E7L,
- -1.010851868928346082547075956946476932162E6L,
- -8.333374463411801009783402800801201603736E3L
+ L(-4.813901815114776281494823863935820876670E11),
+ L(-8.425592975288250400493910291066881992620E11),
+ L(-6.228685507402467503655405482985516909157E11),
+ L(-2.531972054436786351403749276956707260499E11),
+ L(-6.170200796658926701311867484296426831687E10),
+ L(-9.211477458528156048231908798456365081135E9),
+ L(-8.251806236175037114064561038908691305583E8),
+ L(-4.147886355917831049939930101151160447495E7),
+ L(-1.010851868928346082547075956946476932162E6),
+ L(-8.333374463411801009783402800801201603736E3)
};
#define NRD3 9
-static const long double RD3[NRD3 + 1] =
+static const _Float128 RD3[NRD3 + 1] =
{
- -5.216713843111675050627304523368029262450E11L,
- -8.014292925418308759369583419234079164391E11L,
- -5.180106858220030014546267824392678611990E11L,
- -1.830406975497439003897734969120997840011E11L,
- -3.845274631904879621945745960119924118925E10L,
- -4.891033385370523863288908070309417710903E9L,
- -3.670172254411328640353855768698287474282E8L,
- -1.505316381525727713026364396635522516989E7L,
- -2.856327162923716881454613540575964890347E5L,
- -1.622140448015769906847567212766206894547E3L
+ L(-5.216713843111675050627304523368029262450E11),
+ L(-8.014292925418308759369583419234079164391E11),
+ L(-5.180106858220030014546267824392678611990E11),
+ L(-1.830406975497439003897734969120997840011E11),
+ L(-3.845274631904879621945745960119924118925E10),
+ L(-4.891033385370523863288908070309417710903E9),
+ L(-3.670172254411328640353855768698287474282E8),
+ L(-1.505316381525727713026364396635522516989E7),
+ L(-2.856327162923716881454613540575964890347E5),
+ L(-1.622140448015769906847567212766206894547E3)
/* 1.0E0L */
};
@@ -483,33 +483,33 @@ static const long double RD3[NRD3 + 1] =
/* log gamma(x+2.5) = log gamma(2.5) + x P(x)/Q(x)
-0.125 <= x <= 0.25
2.375 <= x+2.5 <= 2.75 */
-static const long double lgam2r5a = 2.8466796875E-1L;
-static const long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L;
+static const _Float128 lgam2r5a = L(2.8466796875E-1);
+static const _Float128 lgam2r5b = L(1.4901722919159632494669682701924320137696E-5);
#define NRN2r5 8
-static const long double RN2r5[NRN2r5 + 1] =
+static const _Float128 RN2r5[NRN2r5 + 1] =
{
- -4.676454313888335499356699817678862233205E9L,
- -9.361888347911187924389905984624216340639E9L,
- -7.695353600835685037920815799526540237703E9L,
- -3.364370100981509060441853085968900734521E9L,
- -8.449902011848163568670361316804900559863E8L,
- -1.225249050950801905108001246436783022179E8L,
- -9.732972931077110161639900388121650470926E6L,
- -3.695711763932153505623248207576425983573E5L,
- -4.717341584067827676530426007495274711306E3L
+ L(-4.676454313888335499356699817678862233205E9),
+ L(-9.361888347911187924389905984624216340639E9),
+ L(-7.695353600835685037920815799526540237703E9),
+ L(-3.364370100981509060441853085968900734521E9),
+ L(-8.449902011848163568670361316804900559863E8),
+ L(-1.225249050950801905108001246436783022179E8),
+ L(-9.732972931077110161639900388121650470926E6),
+ L(-3.695711763932153505623248207576425983573E5),
+ L(-4.717341584067827676530426007495274711306E3)
};
#define NRD2r5 8
-static const long double RD2r5[NRD2r5 + 1] =
+static const _Float128 RD2r5[NRD2r5 + 1] =
{
- -6.650657966618993679456019224416926875619E9L,
- -1.099511409330635807899718829033488771623E10L,
- -7.482546968307837168164311101447116903148E9L,
- -2.702967190056506495988922973755870557217E9L,
- -5.570008176482922704972943389590409280950E8L,
- -6.536934032192792470926310043166993233231E7L,
- -4.101991193844953082400035444146067511725E6L,
- -1.174082735875715802334430481065526664020E5L,
- -9.932840389994157592102947657277692978511E2L
+ L(-6.650657966618993679456019224416926875619E9),
+ L(-1.099511409330635807899718829033488771623E10),
+ L(-7.482546968307837168164311101447116903148E9),
+ L(-2.702967190056506495988922973755870557217E9),
+ L(-5.570008176482922704972943389590409280950E8),
+ L(-6.536934032192792470926310043166993233231E7),
+ L(-4.101991193844953082400035444146067511725E6),
+ L(-1.174082735875715802334430481065526664020E5),
+ L(-9.932840389994157592102947657277692978511E2)
/* 1.0E0L */
};
@@ -519,32 +519,32 @@ static const long double RD2r5[NRD2r5 + 1] =
1.875 <= x+2 <= 2.375
Peak relative error 4.6e-36 */
#define NRN2 9
-static const long double RN2[NRN2 + 1] =
+static const _Float128 RN2[NRN2 + 1] =
{
- -3.716661929737318153526921358113793421524E9L,
- -1.138816715030710406922819131397532331321E10L,
- -1.421017419363526524544402598734013569950E10L,
- -9.510432842542519665483662502132010331451E9L,
- -3.747528562099410197957514973274474767329E9L,
- -8.923565763363912474488712255317033616626E8L,
- -1.261396653700237624185350402781338231697E8L,
- -9.918402520255661797735331317081425749014E6L,
- -3.753996255897143855113273724233104768831E5L,
- -4.778761333044147141559311805999540765612E3L
+ L(-3.716661929737318153526921358113793421524E9),
+ L(-1.138816715030710406922819131397532331321E10),
+ L(-1.421017419363526524544402598734013569950E10),
+ L(-9.510432842542519665483662502132010331451E9),
+ L(-3.747528562099410197957514973274474767329E9),
+ L(-8.923565763363912474488712255317033616626E8),
+ L(-1.261396653700237624185350402781338231697E8),
+ L(-9.918402520255661797735331317081425749014E6),
+ L(-3.753996255897143855113273724233104768831E5),
+ L(-4.778761333044147141559311805999540765612E3)
};
#define NRD2 9
-static const long double RD2[NRD2 + 1] =
+static const _Float128 RD2[NRD2 + 1] =
{
- -8.790916836764308497770359421351673950111E9L,
- -2.023108608053212516399197678553737477486E10L,
- -1.958067901852022239294231785363504458367E10L,
- -1.035515043621003101254252481625188704529E10L,
- -3.253884432621336737640841276619272224476E9L,
- -6.186383531162456814954947669274235815544E8L,
- -6.932557847749518463038934953605969951466E7L,
- -4.240731768287359608773351626528479703758E6L,
- -1.197343995089189188078944689846348116630E5L,
- -1.004622911670588064824904487064114090920E3L
+ L(-8.790916836764308497770359421351673950111E9),
+ L(-2.023108608053212516399197678553737477486E10),
+ L(-1.958067901852022239294231785363504458367E10),
+ L(-1.035515043621003101254252481625188704529E10),
+ L(-3.253884432621336737640841276619272224476E9),
+ L(-6.186383531162456814954947669274235815544E8),
+ L(-6.932557847749518463038934953605969951466E7),
+ L(-4.240731768287359608773351626528479703758E6),
+ L(-1.197343995089189188078944689846348116630E5),
+ L(-1.004622911670588064824904487064114090920E3)
/* 1.0E0 */
};
@@ -553,33 +553,33 @@ static const long double RD2[NRD2 + 1] =
-0.125 <= x <= +0.125
1.625 <= x+1.75 <= 1.875
Peak relative error 9.2e-37 */
-static const long double lgam1r75a = -8.441162109375E-2L;
-static const long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L;
+static const _Float128 lgam1r75a = L(-8.441162109375E-2);
+static const _Float128 lgam1r75b = L(1.0500073264444042213965868602268256157604E-5);
#define NRN1r75 8
-static const long double RN1r75[NRN1r75 + 1] =
+static const _Float128 RN1r75[NRN1r75 + 1] =
{
- -5.221061693929833937710891646275798251513E7L,
- -2.052466337474314812817883030472496436993E8L,
- -2.952718275974940270675670705084125640069E8L,
- -2.132294039648116684922965964126389017840E8L,
- -8.554103077186505960591321962207519908489E7L,
- -1.940250901348870867323943119132071960050E7L,
- -2.379394147112756860769336400290402208435E6L,
- -1.384060879999526222029386539622255797389E5L,
- -2.698453601378319296159355612094598695530E3L
+ L(-5.221061693929833937710891646275798251513E7),
+ L(-2.052466337474314812817883030472496436993E8),
+ L(-2.952718275974940270675670705084125640069E8),
+ L(-2.132294039648116684922965964126389017840E8),
+ L(-8.554103077186505960591321962207519908489E7),
+ L(-1.940250901348870867323943119132071960050E7),
+ L(-2.379394147112756860769336400290402208435E6),
+ L(-1.384060879999526222029386539622255797389E5),
+ L(-2.698453601378319296159355612094598695530E3)
};
#define NRD1r75 8
-static const long double RD1r75[NRD1r75 + 1] =
+static const _Float128 RD1r75[NRD1r75 + 1] =
{
- -2.109754689501705828789976311354395393605E8L,
- -5.036651829232895725959911504899241062286E8L,
- -4.954234699418689764943486770327295098084E8L,
- -2.589558042412676610775157783898195339410E8L,
- -7.731476117252958268044969614034776883031E7L,
- -1.316721702252481296030801191240867486965E7L,
- -1.201296501404876774861190604303728810836E6L,
- -5.007966406976106636109459072523610273928E4L,
- -6.155817990560743422008969155276229018209E2L
+ L(-2.109754689501705828789976311354395393605E8),
+ L(-5.036651829232895725959911504899241062286E8),
+ L(-4.954234699418689764943486770327295098084E8),
+ L(-2.589558042412676610775157783898195339410E8),
+ L(-7.731476117252958268044969614034776883031E7),
+ L(-1.316721702252481296030801191240867486965E7),
+ L(-1.201296501404876774861190604303728810836E6),
+ L(-5.007966406976106636109459072523610273928E4),
+ L(-6.155817990560743422008969155276229018209E2)
/* 1.0E0L */
};
@@ -588,35 +588,35 @@ static const long double RD1r75[NRD1r75 + 1] =
-0.0867 <= x <= +0.1634
1.374932... <= x+x0 <= 1.625032...
Peak relative error 4.0e-36 */
-static const long double x0a = 1.4616241455078125L;
-static const long double x0b = 7.9994605498412626595423257213002588621246E-6L;
-static const long double y0a = -1.21490478515625E-1L;
-static const long double y0b = 4.1879797753919044854428223084178486438269E-6L;
+static const _Float128 x0a = L(1.4616241455078125);
+static const _Float128 x0b = L(7.9994605498412626595423257213002588621246E-6);
+static const _Float128 y0a = L(-1.21490478515625E-1);
+static const _Float128 y0b = L(4.1879797753919044854428223084178486438269E-6);
#define NRN1r5 8
-static const long double RN1r5[NRN1r5 + 1] =
+static const _Float128 RN1r5[NRN1r5 + 1] =
{
- 6.827103657233705798067415468881313128066E5L,
- 1.910041815932269464714909706705242148108E6L,
- 2.194344176925978377083808566251427771951E6L,
- 1.332921400100891472195055269688876427962E6L,
- 4.589080973377307211815655093824787123508E5L,
- 8.900334161263456942727083580232613796141E4L,
- 9.053840838306019753209127312097612455236E3L,
- 4.053367147553353374151852319743594873771E2L,
- 5.040631576303952022968949605613514584950E0L
+ L(6.827103657233705798067415468881313128066E5),
+ L(1.910041815932269464714909706705242148108E6),
+ L(2.194344176925978377083808566251427771951E6),
+ L(1.332921400100891472195055269688876427962E6),
+ L(4.589080973377307211815655093824787123508E5),
+ L(8.900334161263456942727083580232613796141E4),
+ L(9.053840838306019753209127312097612455236E3),
+ L(4.053367147553353374151852319743594873771E2),
+ L(5.040631576303952022968949605613514584950E0)
};
#define NRD1r5 8
-static const long double RD1r5[NRD1r5 + 1] =
+static const _Float128 RD1r5[NRD1r5 + 1] =
{
- 1.411036368843183477558773688484699813355E6L,
- 4.378121767236251950226362443134306184849E6L,
- 5.682322855631723455425929877581697918168E6L,
- 3.999065731556977782435009349967042222375E6L,
- 1.653651390456781293163585493620758410333E6L,
- 4.067774359067489605179546964969435858311E5L,
- 5.741463295366557346748361781768833633256E4L,
- 4.226404539738182992856094681115746692030E3L,
- 1.316980975410327975566999780608618774469E2L,
+ L(1.411036368843183477558773688484699813355E6),
+ L(4.378121767236251950226362443134306184849E6),
+ L(5.682322855631723455425929877581697918168E6),
+ L(3.999065731556977782435009349967042222375E6),
+ L(1.653651390456781293163585493620758410333E6),
+ L(4.067774359067489605179546964969435858311E5),
+ L(5.741463295366557346748361781768833633256E4),
+ L(4.226404539738182992856094681115746692030E3),
+ L(1.316980975410327975566999780608618774469E2),
/* 1.0E0L */
};
@@ -625,34 +625,34 @@ static const long double RD1r5[NRD1r5 + 1] =
-.125 <= x <= +.125
1.125 <= x+1.25 <= 1.375
Peak relative error = 4.9e-36 */
-static const long double lgam1r25a = -9.82818603515625E-2L;
-static const long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L;
+static const _Float128 lgam1r25a = L(-9.82818603515625E-2);
+static const _Float128 lgam1r25b = L(1.0023929749338536146197303364159774377296E-5);
#define NRN1r25 9
-static const long double RN1r25[NRN1r25 + 1] =
+static const _Float128 RN1r25[NRN1r25 + 1] =
{
- -9.054787275312026472896002240379580536760E4L,
- -8.685076892989927640126560802094680794471E4L,
- 2.797898965448019916967849727279076547109E5L,
- 6.175520827134342734546868356396008898299E5L,
- 5.179626599589134831538516906517372619641E5L,
- 2.253076616239043944538380039205558242161E5L,
- 5.312653119599957228630544772499197307195E4L,
- 6.434329437514083776052669599834938898255E3L,
- 3.385414416983114598582554037612347549220E2L,
- 4.907821957946273805080625052510832015792E0L
+ L(-9.054787275312026472896002240379580536760E4),
+ L(-8.685076892989927640126560802094680794471E4),
+ L(2.797898965448019916967849727279076547109E5),
+ L(6.175520827134342734546868356396008898299E5),
+ L(5.179626599589134831538516906517372619641E5),
+ L(2.253076616239043944538380039205558242161E5),
+ L(5.312653119599957228630544772499197307195E4),
+ L(6.434329437514083776052669599834938898255E3),
+ L(3.385414416983114598582554037612347549220E2),
+ L(4.907821957946273805080625052510832015792E0)
};
#define NRD1r25 8
-static const long double RD1r25[NRD1r25 + 1] =
+static const _Float128 RD1r25[NRD1r25 + 1] =
{
- 3.980939377333448005389084785896660309000E5L,
- 1.429634893085231519692365775184490465542E6L,
- 2.145438946455476062850151428438668234336E6L,
- 1.743786661358280837020848127465970357893E6L,
- 8.316364251289743923178092656080441655273E5L,
- 2.355732939106812496699621491135458324294E5L,
- 3.822267399625696880571810137601310855419E4L,
- 3.228463206479133236028576845538387620856E3L,
- 1.152133170470059555646301189220117965514E2L
+ L(3.980939377333448005389084785896660309000E5),
+ L(1.429634893085231519692365775184490465542E6),
+ L(2.145438946455476062850151428438668234336E6),
+ L(1.743786661358280837020848127465970357893E6),
+ L(8.316364251289743923178092656080441655273E5),
+ L(2.355732939106812496699621491135458324294E5),
+ L(3.822267399625696880571810137601310855419E4),
+ L(3.228463206479133236028576845538387620856E3),
+ L(1.152133170470059555646301189220117965514E2)
/* 1.0E0L */
};
@@ -662,29 +662,29 @@ static const long double RD1r25[NRD1r25 + 1] =
1.0 <= x+1 <= 1.125
Peak relative error 1.1e-35 */
#define NRN1 8
-static const long double RN1[NRN1 + 1] =
+static const _Float128 RN1[NRN1 + 1] =
{
- -9.987560186094800756471055681088744738818E3L,
- -2.506039379419574361949680225279376329742E4L,
- -1.386770737662176516403363873617457652991E4L,
- 1.439445846078103202928677244188837130744E4L,
- 2.159612048879650471489449668295139990693E4L,
- 1.047439813638144485276023138173676047079E4L,
- 2.250316398054332592560412486630769139961E3L,
- 1.958510425467720733041971651126443864041E2L,
- 4.516830313569454663374271993200291219855E0L
+ L(-9.987560186094800756471055681088744738818E3),
+ L(-2.506039379419574361949680225279376329742E4),
+ L(-1.386770737662176516403363873617457652991E4),
+ L(1.439445846078103202928677244188837130744E4),
+ L(2.159612048879650471489449668295139990693E4),
+ L(1.047439813638144485276023138173676047079E4),
+ L(2.250316398054332592560412486630769139961E3),
+ L(1.958510425467720733041971651126443864041E2),
+ L(4.516830313569454663374271993200291219855E0)
};
#define NRD1 7
-static const long double RD1[NRD1 + 1] =
+static const _Float128 RD1[NRD1 + 1] =
{
- 1.730299573175751778863269333703788214547E4L,
- 6.807080914851328611903744668028014678148E4L,
- 1.090071629101496938655806063184092302439E5L,
- 9.124354356415154289343303999616003884080E4L,
- 4.262071638655772404431164427024003253954E4L,
- 1.096981664067373953673982635805821283581E4L,
- 1.431229503796575892151252708527595787588E3L,
- 7.734110684303689320830401788262295992921E1L
+ L(1.730299573175751778863269333703788214547E4),
+ L(6.807080914851328611903744668028014678148E4),
+ L(1.090071629101496938655806063184092302439E5),
+ L(9.124354356415154289343303999616003884080E4),
+ L(4.262071638655772404431164427024003253954E4),
+ L(1.096981664067373953673982635805821283581E4),
+ L(1.431229503796575892151252708527595787588E3),
+ L(7.734110684303689320830401788262295992921E1)
/* 1.0E0 */
};
@@ -694,40 +694,40 @@ static const long double RD1[NRD1 + 1] =
0.875 <= x+1 <= 1.0
Peak relative error 7.0e-37 */
#define NRNr9 8
-static const long double RNr9[NRNr9 + 1] =
+static const _Float128 RNr9[NRNr9 + 1] =
{
- 4.441379198241760069548832023257571176884E5L,
- 1.273072988367176540909122090089580368732E6L,
- 9.732422305818501557502584486510048387724E5L,
- -5.040539994443998275271644292272870348684E5L,
- -1.208719055525609446357448132109723786736E6L,
- -7.434275365370936547146540554419058907156E5L,
- -2.075642969983377738209203358199008185741E5L,
- -2.565534860781128618589288075109372218042E4L,
- -1.032901669542994124131223797515913955938E3L,
+ L(4.441379198241760069548832023257571176884E5),
+ L(1.273072988367176540909122090089580368732E6),
+ L(9.732422305818501557502584486510048387724E5),
+ L(-5.040539994443998275271644292272870348684E5),
+ L(-1.208719055525609446357448132109723786736E6),
+ L(-7.434275365370936547146540554419058907156E5),
+ L(-2.075642969983377738209203358199008185741E5),
+ L(-2.565534860781128618589288075109372218042E4),
+ L(-1.032901669542994124131223797515913955938E3),
};
#define NRDr9 8
-static const long double RDr9[NRDr9 + 1] =
+static const _Float128 RDr9[NRDr9 + 1] =
{
- -7.694488331323118759486182246005193998007E5L,
- -3.301918855321234414232308938454112213751E6L,
- -5.856830900232338906742924836032279404702E6L,
- -5.540672519616151584486240871424021377540E6L,
- -3.006530901041386626148342989181721176919E6L,
- -9.350378280513062139466966374330795935163E5L,
- -1.566179100031063346901755685375732739511E5L,
- -1.205016539620260779274902967231510804992E4L,
- -2.724583156305709733221564484006088794284E2L
+ L(-7.694488331323118759486182246005193998007E5),
+ L(-3.301918855321234414232308938454112213751E6),
+ L(-5.856830900232338906742924836032279404702E6),
+ L(-5.540672519616151584486240871424021377540E6),
+ L(-3.006530901041386626148342989181721176919E6),
+ L(-9.350378280513062139466966374330795935163E5),
+ L(-1.566179100031063346901755685375732739511E5),
+ L(-1.205016539620260779274902967231510804992E4),
+ L(-2.724583156305709733221564484006088794284E2)
/* 1.0E0 */
};
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -742,10 +742,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -758,10 +758,10 @@ deval (long double x, const long double *p, int n)
}
-long double
-__ieee754_lgammal_r (long double x, int *signgamp)
+_Float128
+__ieee754_lgammal_r (_Float128 x, int *signgamp)
{
- long double p, q, w, z, nx;
+ _Float128 p, q, w, z, nx;
int i, nn;
*signgamp = 1;
@@ -769,31 +769,31 @@ __ieee754_lgammal_r (long double x, int *signgamp)
if (! isfinite (x))
return x * x;
- if (x == 0.0L)
+ if (x == 0)
{
if (signbit (x))
*signgamp = -1;
}
- if (x < 0.0L)
+ if (x < 0)
{
- if (x < -2.0L && x > (LDBL_MANT_DIG == 106 ? -48.0L : -50.0L))
+ if (x < -2 && x > (LDBL_MANT_DIG == 106 ? -48 : -50))
return __lgamma_negl (x, signgamp);
q = -x;
p = __floorl (q);
if (p == q)
return (one / (p - p));
- long double halfp = p * 0.5L;
+ _Float128 halfp = p * L(0.5);
if (halfp == __floorl (halfp))
*signgamp = -1;
else
*signgamp = 1;
- if (q < 0x1p-120L)
+ if (q < L(0x1p-120))
return -__logl (q);
z = q - p;
- if (z > 0.5L)
+ if (z > L(0.5))
{
- p += 1.0L;
+ p += 1;
z = p - q;
}
z = q * __sinl (PIL * z);
@@ -802,16 +802,16 @@ __ieee754_lgammal_r (long double x, int *signgamp)
return (z);
}
- if (x < 13.5L)
+ if (x < L(13.5))
{
- p = 0.0L;
- nx = __floorl (x + 0.5L);
+ p = 0;
+ nx = __floorl (x + L(0.5));
nn = nx;
switch (nn)
{
case 0:
/* log gamma (x + 1) = log(x) + log gamma(x) */
- if (x < 0x1p-120L)
+ if (x < L(0x1p-120))
return -__logl (x);
else if (x <= 0.125)
{
@@ -819,14 +819,14 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else if (x <= 0.375)
{
- z = x - 0.25L;
+ z = x - L(0.25);
p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
p += lgam1r25b;
p += lgam1r25a;
}
else if (x <= 0.625)
{
- z = x + (1.0L - x0a);
+ z = x + (1 - x0a);
z = z - x0b;
p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
p = p * z * z;
@@ -835,25 +835,25 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else if (x <= 0.875)
{
- z = x - 0.75L;
+ z = x - L(0.75);
p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
p += lgam1r75a;
}
else
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
}
p = p - __logl (x);
break;
case 1:
- if (x < 0.875L)
+ if (x < L(0.875))
{
if (x <= 0.625)
{
- z = x + (1.0L - x0a);
+ z = x + (1 - x0a);
z = z - x0b;
p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
p = p * z * z;
@@ -862,7 +862,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else if (x <= 0.875)
{
- z = x - 0.75L;
+ z = x - L(0.75);
p = z * neval (z, RN1r75, NRN1r75)
/ deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
@@ -870,26 +870,26 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
}
p = p - __logl (x);
}
- else if (x < 1.0L)
+ else if (x < 1)
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RNr9, NRNr9) / deval (z, RDr9, NRDr9);
}
- else if (x == 1.0L)
- p = 0.0L;
- else if (x <= 1.125L)
+ else if (x == 1)
+ p = 0;
+ else if (x <= L(1.125))
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RN1, NRN1) / deval (z, RD1, NRD1);
}
else if (x <= 1.375)
{
- z = x - 1.25L;
+ z = x - L(1.25);
p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
p += lgam1r25b;
p += lgam1r25a;
@@ -907,7 +907,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
break;
case 2:
- if (x < 1.625L)
+ if (x < L(1.625))
{
z = x - x0a;
z = z - x0b;
@@ -916,23 +916,23 @@ __ieee754_lgammal_r (long double x, int *signgamp)
p = p + y0b;
p = p + y0a;
}
- else if (x < 1.875L)
+ else if (x < L(1.875))
{
- z = x - 1.75L;
+ z = x - L(1.75);
p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
p += lgam1r75a;
}
- else if (x == 2.0L)
- p = 0.0L;
- else if (x < 2.375L)
+ else if (x == 2)
+ p = 0;
+ else if (x < L(2.375))
{
- z = x - 2.0L;
+ z = x - 2;
p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
}
else
{
- z = x - 2.5L;
+ z = x - L(2.5);
p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
p += lgam2r5b;
p += lgam2r5a;
@@ -942,14 +942,14 @@ __ieee754_lgammal_r (long double x, int *signgamp)
case 3:
if (x < 2.75)
{
- z = x - 2.5L;
+ z = x - L(2.5);
p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
p += lgam2r5b;
p += lgam2r5a;
}
else
{
- z = x - 3.0L;
+ z = x - 3;
p = z * neval (z, RN3, NRN3) / deval (z, RD3, NRD3);
p += lgam3b;
p += lgam3a;
@@ -957,70 +957,70 @@ __ieee754_lgammal_r (long double x, int *signgamp)
break;
case 4:
- z = x - 4.0L;
+ z = x - 4;
p = z * neval (z, RN4, NRN4) / deval (z, RD4, NRD4);
p += lgam4b;
p += lgam4a;
break;
case 5:
- z = x - 5.0L;
+ z = x - 5;
p = z * neval (z, RN5, NRN5) / deval (z, RD5, NRD5);
p += lgam5b;
p += lgam5a;
break;
case 6:
- z = x - 6.0L;
+ z = x - 6;
p = z * neval (z, RN6, NRN6) / deval (z, RD6, NRD6);
p += lgam6b;
p += lgam6a;
break;
case 7:
- z = x - 7.0L;
+ z = x - 7;
p = z * neval (z, RN7, NRN7) / deval (z, RD7, NRD7);
p += lgam7b;
p += lgam7a;
break;
case 8:
- z = x - 8.0L;
+ z = x - 8;
p = z * neval (z, RN8, NRN8) / deval (z, RD8, NRD8);
p += lgam8b;
p += lgam8a;
break;
case 9:
- z = x - 9.0L;
+ z = x - 9;
p = z * neval (z, RN9, NRN9) / deval (z, RD9, NRD9);
p += lgam9b;
p += lgam9a;
break;
case 10:
- z = x - 10.0L;
+ z = x - 10;
p = z * neval (z, RN10, NRN10) / deval (z, RD10, NRD10);
p += lgam10b;
p += lgam10a;
break;
case 11:
- z = x - 11.0L;
+ z = x - 11;
p = z * neval (z, RN11, NRN11) / deval (z, RD11, NRD11);
p += lgam11b;
p += lgam11a;
break;
case 12:
- z = x - 12.0L;
+ z = x - 12;
p = z * neval (z, RN12, NRN12) / deval (z, RD12, NRD12);
p += lgam12b;
p += lgam12a;
break;
case 13:
- z = x - 13.0L;
+ z = x - 13;
p = z * neval (z, RN13, NRN13) / deval (z, RD13, NRD13);
p += lgam13b;
p += lgam13a;
@@ -1032,14 +1032,14 @@ __ieee754_lgammal_r (long double x, int *signgamp)
if (x > MAXLGM)
return (*signgamp * huge * huge);
- if (x > 0x1p120L)
- return x * (__logl (x) - 1.0L);
+ if (x > L(0x1p120))
+ return x * (__logl (x) - 1);
q = ls2pi - x;
- q = (x - 0.5L) * __logl (x) + q;
- if (x > 1.0e18L)
+ q = (x - L(0.5)) * __logl (x) + q;
+ if (x > L(1.0e18))
return (q);
- p = 1.0L / (x * x);
+ p = 1 / (x * x);
q += neval (p, RASY, NRASY) / x;
return (q);
}
diff --git a/sysdeps/ieee754/ldbl-128/e_log10l.c b/sysdeps/ieee754/ldbl-128/e_log10l.c
index 618255f2fa..f73cd34ebb 100644
--- a/sysdeps/ieee754/ldbl-128/e_log10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log10l.c
@@ -68,36 +68,36 @@
* Theoretical peak relative error = 5.3e-37,
* relative peak error spread = 2.3e-14
*/
-static const long double P[13] =
+static const _Float128 P[13] =
{
- 1.313572404063446165910279910527789794488E4L,
- 7.771154681358524243729929227226708890930E4L,
- 2.014652742082537582487669938141683759923E5L,
- 3.007007295140399532324943111654767187848E5L,
- 2.854829159639697837788887080758954924001E5L,
- 1.797628303815655343403735250238293741397E5L,
- 7.594356839258970405033155585486712125861E4L,
- 2.128857716871515081352991964243375186031E4L,
- 3.824952356185897735160588078446136783779E3L,
- 4.114517881637811823002128927449878962058E2L,
- 2.321125933898420063925789532045674660756E1L,
- 4.998469661968096229986658302195402690910E-1L,
- 1.538612243596254322971797716843006400388E-6L
+ L(1.313572404063446165910279910527789794488E4),
+ L(7.771154681358524243729929227226708890930E4),
+ L(2.014652742082537582487669938141683759923E5),
+ L(3.007007295140399532324943111654767187848E5),
+ L(2.854829159639697837788887080758954924001E5),
+ L(1.797628303815655343403735250238293741397E5),
+ L(7.594356839258970405033155585486712125861E4),
+ L(2.128857716871515081352991964243375186031E4),
+ L(3.824952356185897735160588078446136783779E3),
+ L(4.114517881637811823002128927449878962058E2),
+ L(2.321125933898420063925789532045674660756E1),
+ L(4.998469661968096229986658302195402690910E-1),
+ L(1.538612243596254322971797716843006400388E-6)
};
-static const long double Q[12] =
+static const _Float128 Q[12] =
{
- 3.940717212190338497730839731583397586124E4L,
- 2.626900195321832660448791748036714883242E5L,
- 7.777690340007566932935753241556479363645E5L,
- 1.347518538384329112529391120390701166528E6L,
- 1.514882452993549494932585972882995548426E6L,
- 1.158019977462989115839826904108208787040E6L,
- 6.132189329546557743179177159925690841200E5L,
- 2.248234257620569139969141618556349415120E5L,
- 5.605842085972455027590989944010492125825E4L,
- 9.147150349299596453976674231612674085381E3L,
- 9.104928120962988414618126155557301584078E2L,
- 4.839208193348159620282142911143429644326E1L
+ L(3.940717212190338497730839731583397586124E4),
+ L(2.626900195321832660448791748036714883242E5),
+ L(7.777690340007566932935753241556479363645E5),
+ L(1.347518538384329112529391120390701166528E6),
+ L(1.514882452993549494932585972882995548426E6),
+ L(1.158019977462989115839826904108208787040E6),
+ L(6.132189329546557743179177159925690841200E5),
+ L(2.248234257620569139969141618556349415120E5),
+ L(5.605842085972455027590989944010492125825E4),
+ L(9.147150349299596453976674231612674085381E3),
+ L(9.104928120962988414618126155557301584078E2),
+ L(4.839208193348159620282142911143429644326E1)
/* 1.000000000000000000000000000000000000000E0L, */
};
@@ -107,44 +107,44 @@ static const long double Q[12] =
* Theoretical peak relative error = 1.1e-35,
* relative peak error spread 1.1e-9
*/
-static const long double R[6] =
+static const _Float128 R[6] =
{
- 1.418134209872192732479751274970992665513E5L,
- -8.977257995689735303686582344659576526998E4L,
- 2.048819892795278657810231591630928516206E4L,
- -2.024301798136027039250415126250455056397E3L,
- 8.057002716646055371965756206836056074715E1L,
- -8.828896441624934385266096344596648080902E-1L
+ L(1.418134209872192732479751274970992665513E5),
+ L(-8.977257995689735303686582344659576526998E4),
+ L(2.048819892795278657810231591630928516206E4),
+ L(-2.024301798136027039250415126250455056397E3),
+ L(8.057002716646055371965756206836056074715E1),
+ L(-8.828896441624934385266096344596648080902E-1)
};
-static const long double S[6] =
+static const _Float128 S[6] =
{
- 1.701761051846631278975701529965589676574E6L,
- -1.332535117259762928288745111081235577029E6L,
- 4.001557694070773974936904547424676279307E5L,
- -5.748542087379434595104154610899551484314E4L,
- 3.998526750980007367835804959888064681098E3L,
- -1.186359407982897997337150403816839480438E2L
+ L(1.701761051846631278975701529965589676574E6),
+ L(-1.332535117259762928288745111081235577029E6),
+ L(4.001557694070773974936904547424676279307E5),
+ L(-5.748542087379434595104154610899551484314E4),
+ L(3.998526750980007367835804959888064681098E3),
+ L(-1.186359407982897997337150403816839480438E2)
/* 1.000000000000000000000000000000000000000E0L, */
};
-static const long double
+static const _Float128
/* log10(2) */
-L102A = 0.3125L,
-L102B = -1.14700043360188047862611052755069732318101185E-2L,
+L102A = L(0.3125),
+L102B = L(-1.14700043360188047862611052755069732318101185E-2),
/* log10(e) */
-L10EA = 0.5L,
-L10EB = -6.570551809674817234887108108339491770560299E-2L,
+L10EA = L(0.5),
+L10EB = L(-6.570551809674817234887108108339491770560299E-2),
/* sqrt(2)/2 */
-SQRTH = 7.071067811865475244008443621048490392848359E-1L;
+SQRTH = L(7.071067811865475244008443621048490392848359E-1);
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -159,10 +159,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -176,25 +176,25 @@ deval (long double x, const long double *p, int n)
-long double
-__ieee754_log10l (long double x)
+_Float128
+__ieee754_log10l (_Float128 x)
{
- long double z;
- long double y;
+ _Float128 z;
+ _Float128 y;
int e;
int64_t hx, lx;
/* Test for domain */
GET_LDOUBLE_WORDS64 (hx, lx, x);
if (((hx & 0x7fffffffffffffffLL) | lx) == 0)
- return (-1.0L / (x - x));
+ return (-1 / (x - x));
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7fff000000000000LL)
return (x + x);
- if (x == 1.0L)
- return 0.0L;
+ if (x == 1)
+ return 0;
/* separate mantissa from exponent */
@@ -212,14 +212,14 @@ __ieee754_log10l (long double x)
if (x < SQRTH)
{ /* 2( 2x-1 )/( 2x+1 ) */
e -= 1;
- z = x - 0.5L;
- y = 0.5L * z + 0.5L;
+ z = x - L(0.5);
+ y = L(0.5) * z + L(0.5);
}
else
{ /* 2 (x-1)/(x+1) */
- z = x - 0.5L;
- z -= 0.5L;
- y = 0.5L * x + 0.5L;
+ z = x - L(0.5);
+ z -= L(0.5);
+ y = L(0.5) * x + L(0.5);
}
x = z / y;
z = x * x;
@@ -233,11 +233,11 @@ __ieee754_log10l (long double x)
if (x < SQRTH)
{
e -= 1;
- x = 2.0 * x - 1.0L; /* 2x - 1 */
+ x = 2.0 * x - 1; /* 2x - 1 */
}
else
{
- x = x - 1.0L;
+ x = x - 1;
}
z = x * x;
y = x * (z * neval (x, P, 12) / deval (x, Q, 11));
diff --git a/sysdeps/ieee754/ldbl-128/e_log2l.c b/sysdeps/ieee754/ldbl-128/e_log2l.c
index 6b1faa0523..26a8d7e6fa 100644
--- a/sysdeps/ieee754/ldbl-128/e_log2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log2l.c
@@ -67,36 +67,36 @@
* Theoretical peak relative error = 5.3e-37,
* relative peak error spread = 2.3e-14
*/
-static const long double P[13] =
+static const _Float128 P[13] =
{
- 1.313572404063446165910279910527789794488E4L,
- 7.771154681358524243729929227226708890930E4L,
- 2.014652742082537582487669938141683759923E5L,
- 3.007007295140399532324943111654767187848E5L,
- 2.854829159639697837788887080758954924001E5L,
- 1.797628303815655343403735250238293741397E5L,
- 7.594356839258970405033155585486712125861E4L,
- 2.128857716871515081352991964243375186031E4L,
- 3.824952356185897735160588078446136783779E3L,
- 4.114517881637811823002128927449878962058E2L,
- 2.321125933898420063925789532045674660756E1L,
- 4.998469661968096229986658302195402690910E-1L,
- 1.538612243596254322971797716843006400388E-6L
+ L(1.313572404063446165910279910527789794488E4),
+ L(7.771154681358524243729929227226708890930E4),
+ L(2.014652742082537582487669938141683759923E5),
+ L(3.007007295140399532324943111654767187848E5),
+ L(2.854829159639697837788887080758954924001E5),
+ L(1.797628303815655343403735250238293741397E5),
+ L(7.594356839258970405033155585486712125861E4),
+ L(2.128857716871515081352991964243375186031E4),
+ L(3.824952356185897735160588078446136783779E3),
+ L(4.114517881637811823002128927449878962058E2),
+ L(2.321125933898420063925789532045674660756E1),
+ L(4.998469661968096229986658302195402690910E-1),
+ L(1.538612243596254322971797716843006400388E-6)
};
-static const long double Q[12] =
+static const _Float128 Q[12] =
{
- 3.940717212190338497730839731583397586124E4L,
- 2.626900195321832660448791748036714883242E5L,
- 7.777690340007566932935753241556479363645E5L,
- 1.347518538384329112529391120390701166528E6L,
- 1.514882452993549494932585972882995548426E6L,
- 1.158019977462989115839826904108208787040E6L,
- 6.132189329546557743179177159925690841200E5L,
- 2.248234257620569139969141618556349415120E5L,
- 5.605842085972455027590989944010492125825E4L,
- 9.147150349299596453976674231612674085381E3L,
- 9.104928120962988414618126155557301584078E2L,
- 4.839208193348159620282142911143429644326E1L
+ L(3.940717212190338497730839731583397586124E4),
+ L(2.626900195321832660448791748036714883242E5),
+ L(7.777690340007566932935753241556479363645E5),
+ L(1.347518538384329112529391120390701166528E6),
+ L(1.514882452993549494932585972882995548426E6),
+ L(1.158019977462989115839826904108208787040E6),
+ L(6.132189329546557743179177159925690841200E5),
+ L(2.248234257620569139969141618556349415120E5),
+ L(5.605842085972455027590989944010492125825E4),
+ L(9.147150349299596453976674231612674085381E3),
+ L(9.104928120962988414618126155557301584078E2),
+ L(4.839208193348159620282142911143429644326E1)
/* 1.000000000000000000000000000000000000000E0L, */
};
@@ -106,39 +106,39 @@ static const long double Q[12] =
* Theoretical peak relative error = 1.1e-35,
* relative peak error spread 1.1e-9
*/
-static const long double R[6] =
+static const _Float128 R[6] =
{
- 1.418134209872192732479751274970992665513E5L,
- -8.977257995689735303686582344659576526998E4L,
- 2.048819892795278657810231591630928516206E4L,
- -2.024301798136027039250415126250455056397E3L,
- 8.057002716646055371965756206836056074715E1L,
- -8.828896441624934385266096344596648080902E-1L
+ L(1.418134209872192732479751274970992665513E5),
+ L(-8.977257995689735303686582344659576526998E4),
+ L(2.048819892795278657810231591630928516206E4),
+ L(-2.024301798136027039250415126250455056397E3),
+ L(8.057002716646055371965756206836056074715E1),
+ L(-8.828896441624934385266096344596648080902E-1)
};
-static const long double S[6] =
+static const _Float128 S[6] =
{
- 1.701761051846631278975701529965589676574E6L,
- -1.332535117259762928288745111081235577029E6L,
- 4.001557694070773974936904547424676279307E5L,
- -5.748542087379434595104154610899551484314E4L,
- 3.998526750980007367835804959888064681098E3L,
- -1.186359407982897997337150403816839480438E2L
+ L(1.701761051846631278975701529965589676574E6),
+ L(-1.332535117259762928288745111081235577029E6),
+ L(4.001557694070773974936904547424676279307E5),
+ L(-5.748542087379434595104154610899551484314E4),
+ L(3.998526750980007367835804959888064681098E3),
+ L(-1.186359407982897997337150403816839480438E2)
/* 1.000000000000000000000000000000000000000E0L, */
};
-static const long double
+static const _Float128
/* log2(e) - 1 */
-LOG2EA = 4.4269504088896340735992468100189213742664595E-1L,
+LOG2EA = L(4.4269504088896340735992468100189213742664595E-1),
/* sqrt(2)/2 */
-SQRTH = 7.071067811865475244008443621048490392848359E-1L;
+SQRTH = L(7.071067811865475244008443621048490392848359E-1);
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -153,10 +153,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -170,25 +170,25 @@ deval (long double x, const long double *p, int n)
-long double
-__ieee754_log2l (long double x)
+_Float128
+__ieee754_log2l (_Float128 x)
{
- long double z;
- long double y;
+ _Float128 z;
+ _Float128 y;
int e;
int64_t hx, lx;
/* Test for domain */
GET_LDOUBLE_WORDS64 (hx, lx, x);
if (((hx & 0x7fffffffffffffffLL) | lx) == 0)
- return (-1.0L / (x - x));
+ return (-1 / (x - x));
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7fff000000000000LL)
return (x + x);
- if (x == 1.0L)
- return 0.0L;
+ if (x == 1)
+ return 0;
/* separate mantissa from exponent */
@@ -206,14 +206,14 @@ __ieee754_log2l (long double x)
if (x < SQRTH)
{ /* 2( 2x-1 )/( 2x+1 ) */
e -= 1;
- z = x - 0.5L;
- y = 0.5L * z + 0.5L;
+ z = x - L(0.5);
+ y = L(0.5) * z + L(0.5);
}
else
{ /* 2 (x-1)/(x+1) */
- z = x - 0.5L;
- z -= 0.5L;
- y = 0.5L * x + 0.5L;
+ z = x - L(0.5);
+ z -= L(0.5);
+ y = L(0.5) * x + L(0.5);
}
x = z / y;
z = x * x;
@@ -227,11 +227,11 @@ __ieee754_log2l (long double x)
if (x < SQRTH)
{
e -= 1;
- x = 2.0 * x - 1.0L; /* 2x - 1 */
+ x = 2.0 * x - 1; /* 2x - 1 */
}
else
{
- x = x - 1.0L;
+ x = x - 1;
}
z = x * x;
y = x * (z * neval (x, P, 12) / deval (x, Q, 11));
diff --git a/sysdeps/ieee754/ldbl-128/e_logl.c b/sysdeps/ieee754/ldbl-128/e_logl.c
index cb43816793..78061a92bc 100644
--- a/sysdeps/ieee754/ldbl-128/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128/e_logl.c
@@ -63,129 +63,129 @@
/* log(1+x) = x - .5 x^2 + x^3 l(x)
-.0078125 <= x <= +.0078125
peak relative error 1.2e-37 */
-static const long double
-l3 = 3.333333333333333333333333333333336096926E-1L,
-l4 = -2.499999999999999999999999999486853077002E-1L,
-l5 = 1.999999999999999999999999998515277861905E-1L,
-l6 = -1.666666666666666666666798448356171665678E-1L,
-l7 = 1.428571428571428571428808945895490721564E-1L,
-l8 = -1.249999999999999987884655626377588149000E-1L,
-l9 = 1.111111111111111093947834982832456459186E-1L,
-l10 = -1.000000000000532974938900317952530453248E-1L,
-l11 = 9.090909090915566247008015301349979892689E-2L,
-l12 = -8.333333211818065121250921925397567745734E-2L,
-l13 = 7.692307559897661630807048686258659316091E-2L,
-l14 = -7.144242754190814657241902218399056829264E-2L,
-l15 = 6.668057591071739754844678883223432347481E-2L;
+static const _Float128
+l3 = L(3.333333333333333333333333333333336096926E-1),
+l4 = L(-2.499999999999999999999999999486853077002E-1),
+l5 = L(1.999999999999999999999999998515277861905E-1),
+l6 = L(-1.666666666666666666666798448356171665678E-1),
+l7 = L(1.428571428571428571428808945895490721564E-1),
+l8 = L(-1.249999999999999987884655626377588149000E-1),
+l9 = L(1.111111111111111093947834982832456459186E-1),
+l10 = L(-1.000000000000532974938900317952530453248E-1),
+l11 = L(9.090909090915566247008015301349979892689E-2),
+l12 = L(-8.333333211818065121250921925397567745734E-2),
+l13 = L(7.692307559897661630807048686258659316091E-2),
+l14 = L(-7.144242754190814657241902218399056829264E-2),
+l15 = L(6.668057591071739754844678883223432347481E-2);
/* Lookup table of ln(t) - (t-1)
t = 0.5 + (k+26)/128)
k = 0, ..., 91 */
-static const long double logtbl[92] = {
--5.5345593589352099112142921677820359632418E-2L,
--5.2108257402767124761784665198737642086148E-2L,
--4.8991686870576856279407775480686721935120E-2L,
--4.5993270766361228596215288742353061431071E-2L,
--4.3110481649613269682442058976885699556950E-2L,
--4.0340872319076331310838085093194799765520E-2L,
--3.7682072451780927439219005993827431503510E-2L,
--3.5131785416234343803903228503274262719586E-2L,
--3.2687785249045246292687241862699949178831E-2L,
--3.0347913785027239068190798397055267411813E-2L,
--2.8110077931525797884641940838507561326298E-2L,
--2.5972247078357715036426583294246819637618E-2L,
--2.3932450635346084858612873953407168217307E-2L,
--2.1988775689981395152022535153795155900240E-2L,
--2.0139364778244501615441044267387667496733E-2L,
--1.8382413762093794819267536615342902718324E-2L,
--1.6716169807550022358923589720001638093023E-2L,
--1.5138929457710992616226033183958974965355E-2L,
--1.3649036795397472900424896523305726435029E-2L,
--1.2244881690473465543308397998034325468152E-2L,
--1.0924898127200937840689817557742469105693E-2L,
--9.6875626072830301572839422532631079809328E-3L,
--8.5313926245226231463436209313499745894157E-3L,
--7.4549452072765973384933565912143044991706E-3L,
--6.4568155251217050991200599386801665681310E-3L,
--5.5356355563671005131126851708522185605193E-3L,
--4.6900728132525199028885749289712348829878E-3L,
--3.9188291218610470766469347968659624282519E-3L,
--3.2206394539524058873423550293617843896540E-3L,
--2.5942708080877805657374888909297113032132E-3L,
--2.0385211375711716729239156839929281289086E-3L,
--1.5522183228760777967376942769773768850872E-3L,
--1.1342191863606077520036253234446621373191E-3L,
--7.8340854719967065861624024730268350459991E-4L,
--4.9869831458030115699628274852562992756174E-4L,
--2.7902661731604211834685052867305795169688E-4L,
--1.2335696813916860754951146082826952093496E-4L,
--3.0677461025892873184042490943581654591817E-5L,
+static const _Float128 logtbl[92] = {
+L(-5.5345593589352099112142921677820359632418E-2),
+L(-5.2108257402767124761784665198737642086148E-2),
+L(-4.8991686870576856279407775480686721935120E-2),
+L(-4.5993270766361228596215288742353061431071E-2),
+L(-4.3110481649613269682442058976885699556950E-2),
+L(-4.0340872319076331310838085093194799765520E-2),
+L(-3.7682072451780927439219005993827431503510E-2),
+L(-3.5131785416234343803903228503274262719586E-2),
+L(-3.2687785249045246292687241862699949178831E-2),
+L(-3.0347913785027239068190798397055267411813E-2),
+L(-2.8110077931525797884641940838507561326298E-2),
+L(-2.5972247078357715036426583294246819637618E-2),
+L(-2.3932450635346084858612873953407168217307E-2),
+L(-2.1988775689981395152022535153795155900240E-2),
+L(-2.0139364778244501615441044267387667496733E-2),
+L(-1.8382413762093794819267536615342902718324E-2),
+L(-1.6716169807550022358923589720001638093023E-2),
+L(-1.5138929457710992616226033183958974965355E-2),
+L(-1.3649036795397472900424896523305726435029E-2),
+L(-1.2244881690473465543308397998034325468152E-2),
+L(-1.0924898127200937840689817557742469105693E-2),
+L(-9.6875626072830301572839422532631079809328E-3),
+L(-8.5313926245226231463436209313499745894157E-3),
+L(-7.4549452072765973384933565912143044991706E-3),
+L(-6.4568155251217050991200599386801665681310E-3),
+L(-5.5356355563671005131126851708522185605193E-3),
+L(-4.6900728132525199028885749289712348829878E-3),
+L(-3.9188291218610470766469347968659624282519E-3),
+L(-3.2206394539524058873423550293617843896540E-3),
+L(-2.5942708080877805657374888909297113032132E-3),
+L(-2.0385211375711716729239156839929281289086E-3),
+L(-1.5522183228760777967376942769773768850872E-3),
+L(-1.1342191863606077520036253234446621373191E-3),
+L(-7.8340854719967065861624024730268350459991E-4),
+L(-4.9869831458030115699628274852562992756174E-4),
+L(-2.7902661731604211834685052867305795169688E-4),
+L(-1.2335696813916860754951146082826952093496E-4),
+L(-3.0677461025892873184042490943581654591817E-5),
#define ZERO logtbl[38]
- 0.0000000000000000000000000000000000000000E0L,
--3.0359557945051052537099938863236321874198E-5L,
--1.2081346403474584914595395755316412213151E-4L,
--2.7044071846562177120083903771008342059094E-4L,
--4.7834133324631162897179240322783590830326E-4L,
--7.4363569786340080624467487620270965403695E-4L,
--1.0654639687057968333207323853366578860679E-3L,
--1.4429854811877171341298062134712230604279E-3L,
--1.8753781835651574193938679595797367137975E-3L,
--2.3618380914922506054347222273705859653658E-3L,
--2.9015787624124743013946600163375853631299E-3L,
--3.4938307889254087318399313316921940859043E-3L,
--4.1378413103128673800485306215154712148146E-3L,
--4.8328735414488877044289435125365629849599E-3L,
--5.5782063183564351739381962360253116934243E-3L,
--6.3731336597098858051938306767880719015261E-3L,
--7.2169643436165454612058905294782949315193E-3L,
--8.1090214990427641365934846191367315083867E-3L,
--9.0486422112807274112838713105168375482480E-3L,
--1.0035177140880864314674126398350812606841E-2L,
--1.1067990155502102718064936259435676477423E-2L,
--1.2146457974158024928196575103115488672416E-2L,
--1.3269969823361415906628825374158424754308E-2L,
--1.4437927104692837124388550722759686270765E-2L,
--1.5649743073340777659901053944852735064621E-2L,
--1.6904842527181702880599758489058031645317E-2L,
--1.8202661505988007336096407340750378994209E-2L,
--1.9542647000370545390701192438691126552961E-2L,
--2.0924256670080119637427928803038530924742E-2L,
--2.2346958571309108496179613803760727786257E-2L,
--2.3810230892650362330447187267648486279460E-2L,
--2.5313561699385640380910474255652501521033E-2L,
--2.6856448685790244233704909690165496625399E-2L,
--2.8438398935154170008519274953860128449036E-2L,
--3.0058928687233090922411781058956589863039E-2L,
--3.1717563112854831855692484086486099896614E-2L,
--3.3413836095418743219397234253475252001090E-2L,
--3.5147290019036555862676702093393332533702E-2L,
--3.6917475563073933027920505457688955423688E-2L,
--3.8723951502862058660874073462456610731178E-2L,
--4.0566284516358241168330505467000838017425E-2L,
--4.2444048996543693813649967076598766917965E-2L,
--4.4356826869355401653098777649745233339196E-2L,
--4.6304207416957323121106944474331029996141E-2L,
--4.8285787106164123613318093945035804818364E-2L,
--5.0301169421838218987124461766244507342648E-2L,
--5.2349964705088137924875459464622098310997E-2L,
--5.4431789996103111613753440311680967840214E-2L,
--5.6546268881465384189752786409400404404794E-2L,
--5.8693031345788023909329239565012647817664E-2L,
--6.0871713627532018185577188079210189048340E-2L,
--6.3081958078862169742820420185833800925568E-2L,
--6.5323413029406789694910800219643791556918E-2L,
--6.7595732653791419081537811574227049288168E-2L
+ L(0.0000000000000000000000000000000000000000E0),
+L(-3.0359557945051052537099938863236321874198E-5),
+L(-1.2081346403474584914595395755316412213151E-4),
+L(-2.7044071846562177120083903771008342059094E-4),
+L(-4.7834133324631162897179240322783590830326E-4),
+L(-7.4363569786340080624467487620270965403695E-4),
+L(-1.0654639687057968333207323853366578860679E-3),
+L(-1.4429854811877171341298062134712230604279E-3),
+L(-1.8753781835651574193938679595797367137975E-3),
+L(-2.3618380914922506054347222273705859653658E-3),
+L(-2.9015787624124743013946600163375853631299E-3),
+L(-3.4938307889254087318399313316921940859043E-3),
+L(-4.1378413103128673800485306215154712148146E-3),
+L(-4.8328735414488877044289435125365629849599E-3),
+L(-5.5782063183564351739381962360253116934243E-3),
+L(-6.3731336597098858051938306767880719015261E-3),
+L(-7.2169643436165454612058905294782949315193E-3),
+L(-8.1090214990427641365934846191367315083867E-3),
+L(-9.0486422112807274112838713105168375482480E-3),
+L(-1.0035177140880864314674126398350812606841E-2),
+L(-1.1067990155502102718064936259435676477423E-2),
+L(-1.2146457974158024928196575103115488672416E-2),
+L(-1.3269969823361415906628825374158424754308E-2),
+L(-1.4437927104692837124388550722759686270765E-2),
+L(-1.5649743073340777659901053944852735064621E-2),
+L(-1.6904842527181702880599758489058031645317E-2),
+L(-1.8202661505988007336096407340750378994209E-2),
+L(-1.9542647000370545390701192438691126552961E-2),
+L(-2.0924256670080119637427928803038530924742E-2),
+L(-2.2346958571309108496179613803760727786257E-2),
+L(-2.3810230892650362330447187267648486279460E-2),
+L(-2.5313561699385640380910474255652501521033E-2),
+L(-2.6856448685790244233704909690165496625399E-2),
+L(-2.8438398935154170008519274953860128449036E-2),
+L(-3.0058928687233090922411781058956589863039E-2),
+L(-3.1717563112854831855692484086486099896614E-2),
+L(-3.3413836095418743219397234253475252001090E-2),
+L(-3.5147290019036555862676702093393332533702E-2),
+L(-3.6917475563073933027920505457688955423688E-2),
+L(-3.8723951502862058660874073462456610731178E-2),
+L(-4.0566284516358241168330505467000838017425E-2),
+L(-4.2444048996543693813649967076598766917965E-2),
+L(-4.4356826869355401653098777649745233339196E-2),
+L(-4.6304207416957323121106944474331029996141E-2),
+L(-4.8285787106164123613318093945035804818364E-2),
+L(-5.0301169421838218987124461766244507342648E-2),
+L(-5.2349964705088137924875459464622098310997E-2),
+L(-5.4431789996103111613753440311680967840214E-2),
+L(-5.6546268881465384189752786409400404404794E-2),
+L(-5.8693031345788023909329239565012647817664E-2),
+L(-6.0871713627532018185577188079210189048340E-2),
+L(-6.3081958078862169742820420185833800925568E-2),
+L(-6.5323413029406789694910800219643791556918E-2),
+L(-6.7595732653791419081537811574227049288168E-2)
};
/* ln(2) = ln2a + ln2b with extended precision. */
-static const long double
- ln2a = 6.93145751953125e-1L,
- ln2b = 1.4286068203094172321214581765680755001344E-6L;
+static const _Float128
+ ln2a = L(6.93145751953125e-1),
+ ln2b = L(1.4286068203094172321214581765680755001344E-6);
-long double
-__ieee754_logl(long double x)
+_Float128
+__ieee754_logl(_Float128 x)
{
- long double z, y, w;
+ _Float128 z, y, w;
ieee854_long_double_shape_type u, t;
unsigned int m;
int k, e;
@@ -198,7 +198,7 @@ __ieee754_logl(long double x)
/* log(0) = -infinity. */
if ((k | u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
{
- return -0.5L / ZERO;
+ return L(-0.5) / ZERO;
}
/* log ( x < 0 ) = NaN */
if (m & 0x80000000)
@@ -238,13 +238,13 @@ __ieee754_logl(long double x)
t.parts32.w3 = 0;
}
/* On this interval the table is not used due to cancellation error. */
- if ((x <= 1.0078125L) && (x >= 0.9921875L))
+ if ((x <= L(1.0078125)) && (x >= L(0.9921875)))
{
- if (x == 1.0L)
- return 0.0L;
- z = x - 1.0L;
+ if (x == 1)
+ return 0;
+ z = x - 1;
k = 64;
- t.value = 1.0L;
+ t.value = 1;
e = 0;
}
else
@@ -274,7 +274,7 @@ __ieee754_logl(long double x)
y += e * ln2b; /* Base 2 exponent offset times ln(2). */
y += z;
y += logtbl[k-26]; /* log(t) - (t-1) */
- y += (t.value - 1.0L);
+ y += (t.value - 1);
y += e * ln2a;
return y;
}
diff --git a/sysdeps/ieee754/ldbl-128/e_powl.c b/sysdeps/ieee754/ldbl-128/e_powl.c
index 7f3037fb51..e6cd9751c2 100644
--- a/sysdeps/ieee754/ldbl-128/e_powl.c
+++ b/sysdeps/ieee754/ldbl-128/e_powl.c
@@ -67,89 +67,89 @@
#include <math.h>
#include <math_private.h>
-static const long double bp[] = {
- 1.0L,
- 1.5L,
+static const _Float128 bp[] = {
+ 1,
+ L(1.5),
};
/* log_2(1.5) */
-static const long double dp_h[] = {
+static const _Float128 dp_h[] = {
0.0,
- 5.8496250072115607565592654282227158546448E-1L
+ L(5.8496250072115607565592654282227158546448E-1)
};
/* Low part of log_2(1.5) */
-static const long double dp_l[] = {
+static const _Float128 dp_l[] = {
0.0,
- 1.0579781240112554492329533686862998106046E-16L
+ L(1.0579781240112554492329533686862998106046E-16)
};
-static const long double zero = 0.0L,
- one = 1.0L,
- two = 2.0L,
- two113 = 1.0384593717069655257060992658440192E34L,
- huge = 1.0e3000L,
- tiny = 1.0e-3000L;
+static const _Float128 zero = 0,
+ one = 1,
+ two = 2,
+ two113 = L(1.0384593717069655257060992658440192E34),
+ huge = L(1.0e3000),
+ tiny = L(1.0e-3000);
/* 3/2 log x = 3 z + z^3 + z^3 (z^2 R(z^2))
z = (x-1)/(x+1)
1 <= x <= 1.25
Peak relative error 2.3e-37 */
-static const long double LN[] =
+static const _Float128 LN[] =
{
- -3.0779177200290054398792536829702930623200E1L,
- 6.5135778082209159921251824580292116201640E1L,
- -4.6312921812152436921591152809994014413540E1L,
- 1.2510208195629420304615674658258363295208E1L,
- -9.9266909031921425609179910128531667336670E-1L
+ L(-3.0779177200290054398792536829702930623200E1),
+ L(6.5135778082209159921251824580292116201640E1),
+ L(-4.6312921812152436921591152809994014413540E1),
+ L(1.2510208195629420304615674658258363295208E1),
+ L(-9.9266909031921425609179910128531667336670E-1)
};
-static const long double LD[] =
+static const _Float128 LD[] =
{
- -5.129862866715009066465422805058933131960E1L,
- 1.452015077564081884387441590064272782044E2L,
- -1.524043275549860505277434040464085593165E2L,
- 7.236063513651544224319663428634139768808E1L,
- -1.494198912340228235853027849917095580053E1L
+ L(-5.129862866715009066465422805058933131960E1),
+ L(1.452015077564081884387441590064272782044E2),
+ L(-1.524043275549860505277434040464085593165E2),
+ L(7.236063513651544224319663428634139768808E1),
+ L(-1.494198912340228235853027849917095580053E1)
/* 1.0E0 */
};
/* exp(x) = 1 + x - x / (1 - 2 / (x - x^2 R(x^2)))
0 <= x <= 0.5
Peak relative error 5.7e-38 */
-static const long double PN[] =
+static const _Float128 PN[] =
{
- 5.081801691915377692446852383385968225675E8L,
- 9.360895299872484512023336636427675327355E6L,
- 4.213701282274196030811629773097579432957E4L,
- 5.201006511142748908655720086041570288182E1L,
- 9.088368420359444263703202925095675982530E-3L,
+ L(5.081801691915377692446852383385968225675E8),
+ L(9.360895299872484512023336636427675327355E6),
+ L(4.213701282274196030811629773097579432957E4),
+ L(5.201006511142748908655720086041570288182E1),
+ L(9.088368420359444263703202925095675982530E-3),
};
-static const long double PD[] =
+static const _Float128 PD[] =
{
- 3.049081015149226615468111430031590411682E9L,
- 1.069833887183886839966085436512368982758E8L,
- 8.259257717868875207333991924545445705394E5L,
- 1.872583833284143212651746812884298360922E3L,
+ L(3.049081015149226615468111430031590411682E9),
+ L(1.069833887183886839966085436512368982758E8),
+ L(8.259257717868875207333991924545445705394E5),
+ L(1.872583833284143212651746812884298360922E3),
/* 1.0E0 */
};
-static const long double
+static const _Float128
/* ln 2 */
- lg2 = 6.9314718055994530941723212145817656807550E-1L,
- lg2_h = 6.9314718055994528622676398299518041312695E-1L,
- lg2_l = 2.3190468138462996154948554638754786504121E-17L,
- ovt = 8.0085662595372944372e-0017L,
+ lg2 = L(6.9314718055994530941723212145817656807550E-1),
+ lg2_h = L(6.9314718055994528622676398299518041312695E-1),
+ lg2_l = L(2.3190468138462996154948554638754786504121E-17),
+ ovt = L(8.0085662595372944372e-0017),
/* 2/(3*log(2)) */
- cp = 9.6179669392597560490661645400126142495110E-1L,
- cp_h = 9.6179669392597555432899980587535537779331E-1L,
- cp_l = 5.0577616648125906047157785230014751039424E-17L;
+ cp = L(9.6179669392597560490661645400126142495110E-1),
+ cp_h = L(9.6179669392597555432899980587535537779331E-1),
+ cp_l = L(5.0577616648125906047157785230014751039424E-17);
-long double
-__ieee754_powl (long double x, long double y)
+_Float128
+__ieee754_powl (_Float128 x, _Float128 y)
{
- long double z, ax, z_h, z_l, p_h, p_l;
- long double y1, t1, t2, r, s, sgn, t, u, v, w;
- long double s2, s_h, s_l, t_h, t_l, ay;
+ _Float128 z, ax, z_h, z_l, p_h, p_l;
+ _Float128 y1, t1, t2, r, s, sgn, t, u, v, w;
+ _Float128 s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
u_int32_t ix, iy;
int32_t hx, hy;
@@ -171,7 +171,7 @@ __ieee754_powl (long double x, long double y)
/* 1.0**y = 1; -1.0**+-Inf = 1 */
if (x == one)
return one;
- if (x == -1.0L && iy == 0x7fff0000
+ if (x == -1 && iy == 0x7fff0000
&& (q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0)
return one;
@@ -363,7 +363,7 @@ __ieee754_powl (long double x, long double y)
z_h = cp_h * p_h; /* cp_h+cp_l = 2/(3*log2) */
z_l = cp_l * p_h + p_l * cp + dp_l[k];
/* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
- t = (long double) n;
+ t = (_Float128) n;
t1 = (((z_h + z_l) + dp_h[k]) + t);
o.value = t1;
o.parts32.w3 = 0;
@@ -411,7 +411,7 @@ __ieee754_powl (long double x, long double y)
n = 0;
if (i > 0x3ffe0000)
{ /* if |z| > 0.5, set n = [z+0.5] */
- n = __floorl (z + 0.5L);
+ n = __floorl (z + L(0.5));
t = n;
p_h -= t;
}
@@ -437,7 +437,7 @@ __ieee754_powl (long double x, long double y)
if ((j >> 16) <= 0)
{
z = __scalbnl (z, n); /* subnormal output */
- long double force_underflow = z * z;
+ _Float128 force_underflow = z * z;
math_force_eval (force_underflow);
}
else
diff --git a/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
index 101a4c9015..988d12e5b0 100644
--- a/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
@@ -183,19 +183,19 @@ static const int32_t two_over_pi[] = {
0x7b7b89, 0x483d38,
};
-static const long double c[] = {
+static const _Float128 c[] = {
/* 113 bits of pi/2 */
#define PI_2_1 c[0]
- 0x1.921fb54442d18469898cc51701b8p+0L,
+ L(0x1.921fb54442d18469898cc51701b8p+0),
/* pi/2 - PI_2_1 */
#define PI_2_1t c[1]
- 0x3.9a252049c1114cf98e804177d4c8p-116L,
+ L(0x3.9a252049c1114cf98e804177d4c8p-116),
};
-int32_t __ieee754_rem_pio2l(long double x, long double *y)
+int32_t __ieee754_rem_pio2l(_Float128 x, _Float128 *y)
{
- long double z, w, t;
+ _Float128 z, w, t;
double tx[8];
int64_t exp, n, ix, hx;
u_int64_t lx;
@@ -255,8 +255,8 @@ int32_t __ieee754_rem_pio2l(long double x, long double *y)
/* The result is now stored in 3 double values, we need to convert it into
two long double values. */
- t = (long double) tx [6] + (long double) tx [7];
- w = (long double) tx [5];
+ t = (_Float128) tx [6] + (_Float128) tx [7];
+ w = (_Float128) tx [5];
if (hx >= 0)
{
diff --git a/sysdeps/ieee754/ldbl-128/e_remainderl.c b/sysdeps/ieee754/ldbl-128/e_remainderl.c
index 88df6f54c2..c1c196ca9a 100644
--- a/sysdeps/ieee754/ldbl-128/e_remainderl.c
+++ b/sysdeps/ieee754/ldbl-128/e_remainderl.c
@@ -24,15 +24,15 @@
#include <math.h>
#include <math_private.h>
-static const long double zero = 0.0L;
+static const _Float128 zero = 0;
-long double
-__ieee754_remainderl(long double x, long double p)
+_Float128
+__ieee754_remainderl(_Float128 x, _Float128 p)
{
int64_t hx,hp;
u_int64_t sx,lx,lp;
- long double p_half;
+ _Float128 p_half;
GET_LDOUBLE_WORDS64(hx,lx,x);
GET_LDOUBLE_WORDS64(hp,lp,p);
@@ -58,7 +58,7 @@ __ieee754_remainderl(long double x, long double p)
if(x+x>=p) x -= p;
}
} else {
- p_half = 0.5L*p;
+ p_half = L(0.5)*p;
if(x>p_half) {
x-=p;
if(x>=p_half) x -= p;
diff --git a/sysdeps/ieee754/ldbl-128/e_sinhl.c b/sysdeps/ieee754/ldbl-128/e_sinhl.c
index 11974a39af..a2b30c2190 100644
--- a/sysdeps/ieee754/ldbl-128/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_sinhl.c
@@ -57,13 +57,13 @@
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0, shuge = 1.0e4931L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
+static const _Float128 one = 1.0, shuge = L(1.0e4931),
+ovf_thresh = L(1.1357216553474703894801348310092223067821E4);
-long double
-__ieee754_sinhl (long double x)
+_Float128
+__ieee754_sinhl (_Float128 x)
{
- long double t, w, h;
+ _Float128 t, w, h;
u_int32_t jx, ix;
ieee854_long_double_shape_type u;
diff --git a/sysdeps/ieee754/ldbl-128/gamma_productl.c b/sysdeps/ieee754/ldbl-128/gamma_productl.c
index 849b57d95d..c4ddf8a384 100644
--- a/sysdeps/ieee754/ldbl-128/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/gamma_productl.c
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of X + X_EPS, X + X_EPS + 1, ..., X + X_EPS + N
- 1, in the form R * (1 + *EPS) where the return value R is an
@@ -58,17 +28,17 @@ mul_split (long double *hi, long double *lo, long double x, long double y)
X is small enough that factors quadratic in it can be
neglected. */
-long double
-__gamma_productl (long double x, long double x_eps, int n, long double *eps)
+_Float128
+__gamma_productl (_Float128 x, _Float128 x_eps, int n, _Float128 *eps)
{
SET_RESTORE_ROUNDL (FE_TONEAREST);
- long double ret = x;
+ _Float128 ret = x;
*eps = x_eps / x;
for (int i = 1; i < n; i++)
{
*eps += x_eps / (x + i);
- long double lo;
- mul_split (&ret, &lo, ret, x + i);
+ _Float128 lo;
+ mul_splitl (&ret, &lo, ret, x + i);
*eps += lo / ret;
}
return ret;
diff --git a/sysdeps/ieee754/ldbl-128/k_cosl.c b/sysdeps/ieee754/ldbl-128/k_cosl.c
index 3985b1225b..c51fd54b8f 100644
--- a/sysdeps/ieee754/ldbl-128/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_cosl.c
@@ -20,9 +20,9 @@
#include <math.h>
#include <math_private.h>
-static const long double c[] = {
+static const _Float128 c[] = {
#define ONE c[0]
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
x in <0,1/256> */
@@ -31,11 +31,11 @@ static const long double c[] = {
#define SCOS3 c[3]
#define SCOS4 c[4]
#define SCOS5 c[5]
--5.00000000000000000000000000000000000E-01L, /* bffe0000000000000000000000000000 */
- 4.16666666666666666666666666556146073E-02L, /* 3ffa5555555555555555555555395023 */
--1.38888888888888888888309442601939728E-03L, /* bff56c16c16c16c16c16a566e42c0375 */
- 2.48015873015862382987049502531095061E-05L, /* 3fefa01a01a019ee02dcf7da2d6d5444 */
--2.75573112601362126593516899592158083E-07L, /* bfe927e4f5dce637cb0b54908754bde0 */
+L(-5.00000000000000000000000000000000000E-01), /* bffe0000000000000000000000000000 */
+ L(4.16666666666666666666666666556146073E-02), /* 3ffa5555555555555555555555395023 */
+L(-1.38888888888888888888309442601939728E-03), /* bff56c16c16c16c16c16a566e42c0375 */
+ L(2.48015873015862382987049502531095061E-05), /* 3fefa01a01a019ee02dcf7da2d6d5444 */
+L(-2.75573112601362126593516899592158083E-07), /* bfe927e4f5dce637cb0b54908754bde0 */
/* cos x ~ ONE + x^2 ( COS1 + COS2 * x^2 + ... + COS7 * x^12 + COS8 * x^14 )
x in <0,0.1484375> */
@@ -47,14 +47,14 @@ static const long double c[] = {
#define COS6 c[11]
#define COS7 c[12]
#define COS8 c[13]
--4.99999999999999999999999999999999759E-01L, /* bffdfffffffffffffffffffffffffffb */
- 4.16666666666666666666666666651287795E-02L, /* 3ffa5555555555555555555555516f30 */
--1.38888888888888888888888742314300284E-03L, /* bff56c16c16c16c16c16c16a463dfd0d */
- 2.48015873015873015867694002851118210E-05L, /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
--2.75573192239858811636614709689300351E-07L, /* bfe927e4fb7789f5aa8142a22044b51f */
- 2.08767569877762248667431926878073669E-09L, /* 3fe21eed8eff881d1e9262d7adff4373 */
--1.14707451049343817400420280514614892E-11L, /* bfda9397496922a9601ed3d4ca48944b */
- 4.77810092804389587579843296923533297E-14L, /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
+L(-4.99999999999999999999999999999999759E-01), /* bffdfffffffffffffffffffffffffffb */
+ L(4.16666666666666666666666666651287795E-02), /* 3ffa5555555555555555555555516f30 */
+L(-1.38888888888888888888888742314300284E-03), /* bff56c16c16c16c16c16c16a463dfd0d */
+ L(2.48015873015873015867694002851118210E-05), /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
+L(-2.75573192239858811636614709689300351E-07), /* bfe927e4fb7789f5aa8142a22044b51f */
+ L(2.08767569877762248667431926878073669E-09), /* 3fe21eed8eff881d1e9262d7adff4373 */
+L(-1.14707451049343817400420280514614892E-11), /* bfda9397496922a9601ed3d4ca48944b */
+ L(4.77810092804389587579843296923533297E-14), /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
x in <0,1/256> */
@@ -63,23 +63,23 @@ static const long double c[] = {
#define SSIN3 c[16]
#define SSIN4 c[17]
#define SSIN5 c[18]
--1.66666666666666666666666666666666659E-01L, /* bffc5555555555555555555555555555 */
- 8.33333333333333333333333333146298442E-03L, /* 3ff81111111111111111111110fe195d */
--1.98412698412698412697726277416810661E-04L, /* bff2a01a01a01a01a019e7121e080d88 */
- 2.75573192239848624174178393552189149E-06L, /* 3fec71de3a556c640c6aaa51aa02ab41 */
--2.50521016467996193495359189395805639E-08L, /* bfe5ae644ee90c47dc71839de75b2787 */
+L(-1.66666666666666666666666666666666659E-01), /* bffc5555555555555555555555555555 */
+ L(8.33333333333333333333333333146298442E-03), /* 3ff81111111111111111111110fe195d */
+L(-1.98412698412698412697726277416810661E-04), /* bff2a01a01a01a01a019e7121e080d88 */
+ L(2.75573192239848624174178393552189149E-06), /* 3fec71de3a556c640c6aaa51aa02ab41 */
+L(-2.50521016467996193495359189395805639E-08), /* bfe5ae644ee90c47dc71839de75b2787 */
};
#define SINCOSL_COS_HI 0
#define SINCOSL_COS_LO 1
#define SINCOSL_SIN_HI 2
#define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const _Float128 __sincosl_table[];
-long double
-__kernel_cosl(long double x, long double y)
+_Float128
+__kernel_cosl(_Float128 x, _Float128 y)
{
- long double h, l, z, sin_l, cos_l_m1;
+ _Float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
u_int32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
diff --git a/sysdeps/ieee754/ldbl-128/k_sincosl.c b/sysdeps/ieee754/ldbl-128/k_sincosl.c
index 404df352d3..32f064c4ef 100644
--- a/sysdeps/ieee754/ldbl-128/k_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sincosl.c
@@ -21,9 +21,9 @@
#include <math.h>
#include <math_private.h>
-static const long double c[] = {
+static const _Float128 c[] = {
#define ONE c[0]
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
x in <0,1/256> */
@@ -32,11 +32,11 @@ static const long double c[] = {
#define SCOS3 c[3]
#define SCOS4 c[4]
#define SCOS5 c[5]
--5.00000000000000000000000000000000000E-01L, /* bffe0000000000000000000000000000 */
- 4.16666666666666666666666666556146073E-02L, /* 3ffa5555555555555555555555395023 */
--1.38888888888888888888309442601939728E-03L, /* bff56c16c16c16c16c16a566e42c0375 */
- 2.48015873015862382987049502531095061E-05L, /* 3fefa01a01a019ee02dcf7da2d6d5444 */
--2.75573112601362126593516899592158083E-07L, /* bfe927e4f5dce637cb0b54908754bde0 */
+L(-5.00000000000000000000000000000000000E-01), /* bffe0000000000000000000000000000 */
+ L(4.16666666666666666666666666556146073E-02), /* 3ffa5555555555555555555555395023 */
+L(-1.38888888888888888888309442601939728E-03), /* bff56c16c16c16c16c16a566e42c0375 */
+ L(2.48015873015862382987049502531095061E-05), /* 3fefa01a01a019ee02dcf7da2d6d5444 */
+L(-2.75573112601362126593516899592158083E-07), /* bfe927e4f5dce637cb0b54908754bde0 */
/* cos x ~ ONE + x^2 ( COS1 + COS2 * x^2 + ... + COS7 * x^12 + COS8 * x^14 )
x in <0,0.1484375> */
@@ -48,14 +48,14 @@ static const long double c[] = {
#define COS6 c[11]
#define COS7 c[12]
#define COS8 c[13]
--4.99999999999999999999999999999999759E-01L, /* bffdfffffffffffffffffffffffffffb */
- 4.16666666666666666666666666651287795E-02L, /* 3ffa5555555555555555555555516f30 */
--1.38888888888888888888888742314300284E-03L, /* bff56c16c16c16c16c16c16a463dfd0d */
- 2.48015873015873015867694002851118210E-05L, /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
--2.75573192239858811636614709689300351E-07L, /* bfe927e4fb7789f5aa8142a22044b51f */
- 2.08767569877762248667431926878073669E-09L, /* 3fe21eed8eff881d1e9262d7adff4373 */
--1.14707451049343817400420280514614892E-11L, /* bfda9397496922a9601ed3d4ca48944b */
- 4.77810092804389587579843296923533297E-14L, /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
+L(-4.99999999999999999999999999999999759E-01), /* bffdfffffffffffffffffffffffffffb */
+ L(4.16666666666666666666666666651287795E-02), /* 3ffa5555555555555555555555516f30 */
+L(-1.38888888888888888888888742314300284E-03), /* bff56c16c16c16c16c16c16a463dfd0d */
+ L(2.48015873015873015867694002851118210E-05), /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
+L(-2.75573192239858811636614709689300351E-07), /* bfe927e4fb7789f5aa8142a22044b51f */
+ L(2.08767569877762248667431926878073669E-09), /* 3fe21eed8eff881d1e9262d7adff4373 */
+L(-1.14707451049343817400420280514614892E-11), /* bfda9397496922a9601ed3d4ca48944b */
+ L(4.77810092804389587579843296923533297E-14), /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
x in <0,1/256> */
@@ -64,11 +64,11 @@ static const long double c[] = {
#define SSIN3 c[16]
#define SSIN4 c[17]
#define SSIN5 c[18]
--1.66666666666666666666666666666666659E-01L, /* bffc5555555555555555555555555555 */
- 8.33333333333333333333333333146298442E-03L, /* 3ff81111111111111111111110fe195d */
--1.98412698412698412697726277416810661E-04L, /* bff2a01a01a01a01a019e7121e080d88 */
- 2.75573192239848624174178393552189149E-06L, /* 3fec71de3a556c640c6aaa51aa02ab41 */
--2.50521016467996193495359189395805639E-08L, /* bfe5ae644ee90c47dc71839de75b2787 */
+L(-1.66666666666666666666666666666666659E-01), /* bffc5555555555555555555555555555 */
+ L(8.33333333333333333333333333146298442E-03), /* 3ff81111111111111111111110fe195d */
+L(-1.98412698412698412697726277416810661E-04), /* bff2a01a01a01a01a019e7121e080d88 */
+ L(2.75573192239848624174178393552189149E-06), /* 3fec71de3a556c640c6aaa51aa02ab41 */
+L(-2.50521016467996193495359189395805639E-08), /* bfe5ae644ee90c47dc71839de75b2787 */
/* sin x ~ ONE * x + x^3 ( SIN1 + SIN2 * x^2 + ... + SIN7 * x^12 + SIN8 * x^14 )
x in <0,0.1484375> */
@@ -80,26 +80,26 @@ static const long double c[] = {
#define SIN6 c[24]
#define SIN7 c[25]
#define SIN8 c[26]
--1.66666666666666666666666666666666538e-01L, /* bffc5555555555555555555555555550 */
- 8.33333333333333333333333333307532934e-03L, /* 3ff811111111111111111111110e7340 */
--1.98412698412698412698412534478712057e-04L, /* bff2a01a01a01a01a01a019e7a626296 */
- 2.75573192239858906520896496653095890e-06L, /* 3fec71de3a556c7338fa38527474b8f5 */
--2.50521083854417116999224301266655662e-08L, /* bfe5ae64567f544e16c7de65c2ea551f */
- 1.60590438367608957516841576404938118e-10L, /* 3fde6124613a811480538a9a41957115 */
--7.64716343504264506714019494041582610e-13L, /* bfd6ae7f3d5aef30c7bc660b060ef365 */
- 2.81068754939739570236322404393398135e-15L, /* 3fce9510115aabf87aceb2022a9a9180 */
+L(-1.66666666666666666666666666666666538e-01), /* bffc5555555555555555555555555550 */
+ L(8.33333333333333333333333333307532934e-03), /* 3ff811111111111111111111110e7340 */
+L(-1.98412698412698412698412534478712057e-04), /* bff2a01a01a01a01a01a019e7a626296 */
+ L(2.75573192239858906520896496653095890e-06), /* 3fec71de3a556c7338fa38527474b8f5 */
+L(-2.50521083854417116999224301266655662e-08), /* bfe5ae64567f544e16c7de65c2ea551f */
+ L(1.60590438367608957516841576404938118e-10), /* 3fde6124613a811480538a9a41957115 */
+L(-7.64716343504264506714019494041582610e-13), /* bfd6ae7f3d5aef30c7bc660b060ef365 */
+ L(2.81068754939739570236322404393398135e-15), /* 3fce9510115aabf87aceb2022a9a9180 */
};
#define SINCOSL_COS_HI 0
#define SINCOSL_COS_LO 1
#define SINCOSL_SIN_HI 2
#define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const _Float128 __sincosl_table[];
void
-__kernel_sincosl(long double x, long double y, long double *sinx, long double *cosx, int iy)
+__kernel_sincosl(_Float128 x, _Float128 y, _Float128 *sinx, _Float128 *cosx, int iy)
{
- long double h, l, z, sin_l, cos_l_m1;
+ _Float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
u_int32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
diff --git a/sysdeps/ieee754/ldbl-128/k_sinl.c b/sysdeps/ieee754/ldbl-128/k_sinl.c
index 6290b173b4..3eaf6bca78 100644
--- a/sysdeps/ieee754/ldbl-128/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sinl.c
@@ -21,9 +21,9 @@
#include <math.h>
#include <math_private.h>
-static const long double c[] = {
+static const _Float128 c[] = {
#define ONE c[0]
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
x in <0,1/256> */
@@ -32,11 +32,11 @@ static const long double c[] = {
#define SCOS3 c[3]
#define SCOS4 c[4]
#define SCOS5 c[5]
--5.00000000000000000000000000000000000E-01L, /* bffe0000000000000000000000000000 */
- 4.16666666666666666666666666556146073E-02L, /* 3ffa5555555555555555555555395023 */
--1.38888888888888888888309442601939728E-03L, /* bff56c16c16c16c16c16a566e42c0375 */
- 2.48015873015862382987049502531095061E-05L, /* 3fefa01a01a019ee02dcf7da2d6d5444 */
--2.75573112601362126593516899592158083E-07L, /* bfe927e4f5dce637cb0b54908754bde0 */
+L(-5.00000000000000000000000000000000000E-01), /* bffe0000000000000000000000000000 */
+ L(4.16666666666666666666666666556146073E-02), /* 3ffa5555555555555555555555395023 */
+L(-1.38888888888888888888309442601939728E-03), /* bff56c16c16c16c16c16a566e42c0375 */
+ L(2.48015873015862382987049502531095061E-05), /* 3fefa01a01a019ee02dcf7da2d6d5444 */
+L(-2.75573112601362126593516899592158083E-07), /* bfe927e4f5dce637cb0b54908754bde0 */
/* sin x ~ ONE * x + x^3 ( SIN1 + SIN2 * x^2 + ... + SIN7 * x^12 + SIN8 * x^14 )
x in <0,0.1484375> */
@@ -48,14 +48,14 @@ static const long double c[] = {
#define SIN6 c[11]
#define SIN7 c[12]
#define SIN8 c[13]
--1.66666666666666666666666666666666538e-01L, /* bffc5555555555555555555555555550 */
- 8.33333333333333333333333333307532934e-03L, /* 3ff811111111111111111111110e7340 */
--1.98412698412698412698412534478712057e-04L, /* bff2a01a01a01a01a01a019e7a626296 */
- 2.75573192239858906520896496653095890e-06L, /* 3fec71de3a556c7338fa38527474b8f5 */
--2.50521083854417116999224301266655662e-08L, /* bfe5ae64567f544e16c7de65c2ea551f */
- 1.60590438367608957516841576404938118e-10L, /* 3fde6124613a811480538a9a41957115 */
--7.64716343504264506714019494041582610e-13L, /* bfd6ae7f3d5aef30c7bc660b060ef365 */
- 2.81068754939739570236322404393398135e-15L, /* 3fce9510115aabf87aceb2022a9a9180 */
+L(-1.66666666666666666666666666666666538e-01), /* bffc5555555555555555555555555550 */
+ L(8.33333333333333333333333333307532934e-03), /* 3ff811111111111111111111110e7340 */
+L(-1.98412698412698412698412534478712057e-04), /* bff2a01a01a01a01a01a019e7a626296 */
+ L(2.75573192239858906520896496653095890e-06), /* 3fec71de3a556c7338fa38527474b8f5 */
+L(-2.50521083854417116999224301266655662e-08), /* bfe5ae64567f544e16c7de65c2ea551f */
+ L(1.60590438367608957516841576404938118e-10), /* 3fde6124613a811480538a9a41957115 */
+L(-7.64716343504264506714019494041582610e-13), /* bfd6ae7f3d5aef30c7bc660b060ef365 */
+ L(2.81068754939739570236322404393398135e-15), /* 3fce9510115aabf87aceb2022a9a9180 */
/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
x in <0,1/256> */
@@ -64,23 +64,23 @@ static const long double c[] = {
#define SSIN3 c[16]
#define SSIN4 c[17]
#define SSIN5 c[18]
--1.66666666666666666666666666666666659E-01L, /* bffc5555555555555555555555555555 */
- 8.33333333333333333333333333146298442E-03L, /* 3ff81111111111111111111110fe195d */
--1.98412698412698412697726277416810661E-04L, /* bff2a01a01a01a01a019e7121e080d88 */
- 2.75573192239848624174178393552189149E-06L, /* 3fec71de3a556c640c6aaa51aa02ab41 */
--2.50521016467996193495359189395805639E-08L, /* bfe5ae644ee90c47dc71839de75b2787 */
+L(-1.66666666666666666666666666666666659E-01), /* bffc5555555555555555555555555555 */
+ L(8.33333333333333333333333333146298442E-03), /* 3ff81111111111111111111110fe195d */
+L(-1.98412698412698412697726277416810661E-04), /* bff2a01a01a01a01a019e7121e080d88 */
+ L(2.75573192239848624174178393552189149E-06), /* 3fec71de3a556c640c6aaa51aa02ab41 */
+L(-2.50521016467996193495359189395805639E-08), /* bfe5ae644ee90c47dc71839de75b2787 */
};
#define SINCOSL_COS_HI 0
#define SINCOSL_COS_LO 1
#define SINCOSL_SIN_HI 2
#define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const _Float128 __sincosl_table[];
-long double
-__kernel_sinl(long double x, long double y, int iy)
+_Float128
+__kernel_sinl(_Float128 x, _Float128 y, int iy)
{
- long double h, l, z, sin_l, cos_l_m1;
+ _Float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
u_int32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c
index cd2bbf5f99..dc9c457f6a 100644
--- a/sysdeps/ieee754/ldbl-128/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/k_tanl.c
@@ -60,33 +60,33 @@
#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
-static const long double
- one = 1.0L,
- pio4hi = 7.8539816339744830961566084581987569936977E-1L,
- pio4lo = 2.1679525325309452561992610065108379921906E-35L,
+static const _Float128
+ one = 1,
+ pio4hi = L(7.8539816339744830961566084581987569936977E-1),
+ pio4lo = L(2.1679525325309452561992610065108379921906E-35),
/* tan x = x + x^3 / 3 + x^5 T(x^2)/U(x^2)
0 <= x <= 0.6743316650390625
Peak relative error 8.0e-36 */
- TH = 3.333333333333333333333333333333333333333E-1L,
- T0 = -1.813014711743583437742363284336855889393E7L,
- T1 = 1.320767960008972224312740075083259247618E6L,
- T2 = -2.626775478255838182468651821863299023956E4L,
- T3 = 1.764573356488504935415411383687150199315E2L,
- T4 = -3.333267763822178690794678978979803526092E-1L,
+ TH = L(3.333333333333333333333333333333333333333E-1),
+ T0 = L(-1.813014711743583437742363284336855889393E7),
+ T1 = L(1.320767960008972224312740075083259247618E6),
+ T2 = L(-2.626775478255838182468651821863299023956E4),
+ T3 = L(1.764573356488504935415411383687150199315E2),
+ T4 = L(-3.333267763822178690794678978979803526092E-1),
- U0 = -1.359761033807687578306772463253710042010E8L,
- U1 = 6.494370630656893175666729313065113194784E7L,
- U2 = -4.180787672237927475505536849168729386782E6L,
- U3 = 8.031643765106170040139966622980914621521E4L,
- U4 = -5.323131271912475695157127875560667378597E2L;
+ U0 = L(-1.359761033807687578306772463253710042010E8),
+ U1 = L(6.494370630656893175666729313065113194784E7),
+ U2 = L(-4.180787672237927475505536849168729386782E6),
+ U3 = L(8.031643765106170040139966622980914621521E4),
+ U4 = L(-5.323131271912475695157127875560667378597E2);
/* 1.000000000000000000000000000000000000000E0 */
-long double
-__kernel_tanl (long double x, long double y, int iy)
+_Float128
+__kernel_tanl (_Float128 x, _Float128 y, int iy)
{
- long double z, r, v, w, s;
+ _Float128 z, r, v, w, s;
int32_t ix, sign;
ieee854_long_double_shape_type u, u1;
@@ -134,7 +134,7 @@ __kernel_tanl (long double x, long double y, int iy)
w = x + r;
if (ix >= 0x3ffe5942)
{
- v = (long double) iy;
+ v = (_Float128) iy;
w = (v - 2.0 * (x - (w * w / (w + v) - r)));
/* SIGN is set for arguments that reach this code, but not
otherwise, resulting in warnings that it may be used
diff --git a/sysdeps/ieee754/ldbl-128/lgamma_negl.c b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
index df46199b82..0969dccd45 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
@@ -20,142 +20,142 @@
#include <math.h>
#include <math_private.h>
-static const long double lgamma_zeros[][2] =
+static const _Float128 lgamma_zeros[][2] =
{
- { -0x2.74ff92c01f0d82abec9f315f1a08p+0L, 0xe.d3ccb7fb2658634a2b9f6b2ba81p-116L },
- { -0x2.bf6821437b20197995a4b4641eaep+0L, -0xb.f4b00b4829f961e428533e6ad048p-116L },
- { -0x3.24c1b793cb35efb8be699ad3d9bap+0L, -0x6.5454cb7fac60e3f16d9d7840c2ep-116L },
- { -0x3.f48e2a8f85fca170d4561291236cp+0L, -0xc.320a4887d1cb4c711828a75d5758p-116L },
- { -0x4.0a139e16656030c39f0b0de18114p+0L, 0x1.53e84029416e1242006b2b3d1cfp-112L },
- { -0x4.fdd5de9bbabf3510d0aa40769884p+0L, -0x1.01d7d78125286f78d1e501f14966p-112L },
- { -0x5.021a95fc2db6432a4c56e595394cp+0L, -0x1.ecc6af0430d4fe5746fa7233356fp-112L },
- { -0x5.ffa4bd647d0357dd4ed62cbd31ecp+0L, -0x1.f8e3f8e5deba2d67dbd70dd96ce1p-112L },
- { -0x6.005ac9625f233b607c2d96d16384p+0L, -0x1.cb86ac569340cf1e5f24df7aab7bp-112L },
- { -0x6.fff2fddae1bbff3d626b65c23fd4p+0L, 0x1.e0bfcff5c457ebcf4d3ad9674167p-112L },
- { -0x7.000cff7b7f87adf4482dcdb98784p+0L, 0x1.54d99e35a74d6407b80292df199fp-112L },
- { -0x7.fffe5fe05673c3ca9e82b522b0ccp+0L, 0x1.62d177c832e0eb42c2faffd1b145p-112L },
- { -0x8.0001a01459fc9f60cb3cec1cec88p+0L, 0x2.8998835ac7277f7bcef67c47f188p-112L },
- { -0x8.ffffd1c425e80ffc864e95749258p+0L, -0x1.e7e20210e7f81cf781b44e9d2b02p-112L },
- { -0x9.00002e3bb47d86d6d843fedc352p+0L, 0x2.14852f613a16291751d2ab751f7ep-112L },
- { -0x9.fffffb606bdfdcd062ae77a50548p+0L, 0x3.962d1490cc2e8f031c7007eaa1ap-116L },
- { -0xa.0000049f93bb9927b45d95e1544p+0L, -0x1.e03086db9146a9287bd4f2172d5ap-112L },
- { -0xa.ffffff9466e9f1b36dacd2adbd18p+0L, -0xd.05a4e458062f3f95345a4d9c9b6p-116L },
- { -0xb.0000006b9915315d965a6ffea41p+0L, 0x1.b415c6fff233e7b7fdc3a094246fp-112L },
- { -0xb.fffffff7089387387de41acc3d4p+0L, 0x3.687427c6373bd74a10306e10a28ep-112L },
- { -0xc.00000008f76c7731567c0f0250fp+0L, -0x3.87920df5675833859190eb128ef6p-112L },
- { -0xc.ffffffff4f6dcf617f97a5ffc758p+0L, 0x2.ab72d76f32eaee2d1a42ed515d3ap-116L },
- { -0xd.00000000b092309c06683dd1b9p+0L, -0x3.e3700857a15c19ac5a611de9688ap-112L },
- { -0xd.fffffffff36345ab9e184a3e09dp+0L, -0x1.176dc48e47f62d917973dd44e553p-112L },
- { -0xe.000000000c9cba545e94e75ec57p+0L, -0x1.8f753e2501e757a17cf2ecbeeb89p-112L },
- { -0xe.ffffffffff28c060c6604ef3037p+0L, -0x1.f89d37357c9e3dc17c6c6e63becap-112L },
- { -0xf.0000000000d73f9f399bd0e420f8p+0L, -0x5.e9ee31b0b890744fc0e3fbc01048p-116L },
- { -0xf.fffffffffff28c060c6621f512e8p+0L, 0xd.1b2eec9d960bd9adc5be5f5fa5p-116L },
- { -0x1.000000000000d73f9f399da1424cp+4L, 0x6.c46e0e88305d2800f0e414c506a8p-116L },
- { -0x1.0ffffffffffff3569c47e7a93e1cp+4L, -0x4.6a08a2e008a998ebabb8087efa2cp-112L },
- { -0x1.1000000000000ca963b818568887p+4L, -0x6.ca5a3a64ec15db0a95caf2c9ffb4p-112L },
- { -0x1.1fffffffffffff4bec3ce234132dp+4L, -0x8.b2b726187c841cb92cd5221e444p-116L },
- { -0x1.20000000000000b413c31dcbeca5p+4L, 0x3.c4d005344b6cd0e7231120294abcp-112L },
- { -0x1.2ffffffffffffff685b25cbf5f54p+4L, -0x5.ced932e38485f7dd296b8fa41448p-112L },
- { -0x1.30000000000000097a4da340a0acp+4L, 0x7.e484e0e0ffe38d406ebebe112f88p-112L },
- { -0x1.3fffffffffffffff86af516ff7f7p+4L, -0x6.bd67e720d57854502b7db75e1718p-112L },
- { -0x1.40000000000000007950ae900809p+4L, 0x6.bec33375cac025d9c073168c5d9p-112L },
- { -0x1.4ffffffffffffffffa391c4248c3p+4L, 0x5.c63022b62b5484ba346524db607p-112L },
- { -0x1.500000000000000005c6e3bdb73dp+4L, -0x5.c62f55ed5322b2685c5e9a51e6a8p-112L },
- { -0x1.5fffffffffffffffffbcc71a492p+4L, -0x1.eb5aeb96c74d7ad25e060528fb5p-112L },
- { -0x1.6000000000000000004338e5b6ep+4L, 0x1.eb5aec04b2f2eb663e4e3d8a018cp-112L },
- { -0x1.6ffffffffffffffffffd13c97d9dp+4L, -0x3.8fcc4d08d6fe5aa56ab04307ce7ep-112L },
- { -0x1.70000000000000000002ec368263p+4L, 0x3.8fcc4d090cee2f5d0b69a99c353cp-112L },
- { -0x1.7fffffffffffffffffffe0d30fe7p+4L, 0x7.2f577cca4b4c8cb1dc14001ac5ecp-112L },
- { -0x1.800000000000000000001f2cf019p+4L, -0x7.2f577cca4b3442e35f0040b3b9e8p-112L },
- { -0x1.8ffffffffffffffffffffec0c332p+4L, -0x2.e9a0572b1bb5b95f346a92d67a6p-112L },
- { -0x1.90000000000000000000013f3ccep+4L, 0x2.e9a0572b1bb5c371ddb3561705ap-112L },
- { -0x1.9ffffffffffffffffffffff3b8bdp+4L, -0x1.cad8d32e386fd783e97296d63dcbp-116L },
- { -0x1.a0000000000000000000000c4743p+4L, 0x1.cad8d32e386fd7c1ab8c1fe34c0ep-116L },
- { -0x1.afffffffffffffffffffffff8b95p+4L, -0x3.8f48cc5737d5979c39db806c5406p-112L },
- { -0x1.b00000000000000000000000746bp+4L, 0x3.8f48cc5737d5979c3b3a6bda06f6p-112L },
- { -0x1.bffffffffffffffffffffffffbd8p+4L, 0x6.2898d42174dcf171470d8c8c6028p-112L },
- { -0x1.c000000000000000000000000428p+4L, -0x6.2898d42174dcf171470d18ba412cp-112L },
- { -0x1.cfffffffffffffffffffffffffdbp+4L, -0x4.c0ce9794ea50a839e311320bde94p-112L },
- { -0x1.d000000000000000000000000025p+4L, 0x4.c0ce9794ea50a839e311322f7cf8p-112L },
- { -0x1.dfffffffffffffffffffffffffffp+4L, 0x3.932c5047d60e60caded4c298a174p-112L },
- { -0x1.e000000000000000000000000001p+4L, -0x3.932c5047d60e60caded4c298973ap-112L },
- { -0x1.fp+4L, 0xa.1a6973c1fade2170f7237d35fe3p-116L },
- { -0x1.fp+4L, -0xa.1a6973c1fade2170f7237d35fe08p-116L },
- { -0x2p+4L, 0x5.0d34b9e0fd6f10b87b91be9aff1p-120L },
- { -0x2p+4L, -0x5.0d34b9e0fd6f10b87b91be9aff0cp-120L },
- { -0x2.1p+4L, 0x2.73024a9ba1aa36a7059bff52e844p-124L },
- { -0x2.1p+4L, -0x2.73024a9ba1aa36a7059bff52e844p-124L },
- { -0x2.2p+4L, 0x1.2710231c0fd7a13f8a2b4af9d6b7p-128L },
- { -0x2.2p+4L, -0x1.2710231c0fd7a13f8a2b4af9d6b7p-128L },
- { -0x2.3p+4L, 0x8.6e2ce38b6c8f9419e3fad3f0312p-136L },
- { -0x2.3p+4L, -0x8.6e2ce38b6c8f9419e3fad3f0312p-136L },
- { -0x2.4p+4L, 0x3.bf30652185952560d71a254e4eb8p-140L },
- { -0x2.4p+4L, -0x3.bf30652185952560d71a254e4eb8p-140L },
- { -0x2.5p+4L, 0x1.9ec8d1c94e85af4c78b15c3d89d3p-144L },
- { -0x2.5p+4L, -0x1.9ec8d1c94e85af4c78b15c3d89d3p-144L },
- { -0x2.6p+4L, 0xa.ea565ce061d57489e9b85276274p-152L },
- { -0x2.6p+4L, -0xa.ea565ce061d57489e9b85276274p-152L },
- { -0x2.7p+4L, 0x4.7a6512692eb37804111dabad30ecp-156L },
- { -0x2.7p+4L, -0x4.7a6512692eb37804111dabad30ecp-156L },
- { -0x2.8p+4L, 0x1.ca8ed42a12ae3001a07244abad2bp-160L },
- { -0x2.8p+4L, -0x1.ca8ed42a12ae3001a07244abad2bp-160L },
- { -0x2.9p+4L, 0xb.2f30e1ce812063f12e7e8d8d96e8p-168L },
- { -0x2.9p+4L, -0xb.2f30e1ce812063f12e7e8d8d96e8p-168L },
- { -0x2.ap+4L, 0x4.42bd49d4c37a0db136489772e428p-172L },
- { -0x2.ap+4L, -0x4.42bd49d4c37a0db136489772e428p-172L },
- { -0x2.bp+4L, 0x1.95db45257e5122dcbae56def372p-176L },
- { -0x2.bp+4L, -0x1.95db45257e5122dcbae56def372p-176L },
- { -0x2.cp+4L, 0x9.3958d81ff63527ecf993f3fb6f48p-184L },
- { -0x2.cp+4L, -0x9.3958d81ff63527ecf993f3fb6f48p-184L },
- { -0x2.dp+4L, 0x3.47970e4440c8f1c058bd238c9958p-188L },
- { -0x2.dp+4L, -0x3.47970e4440c8f1c058bd238c9958p-188L },
- { -0x2.ep+4L, 0x1.240804f65951062ca46e4f25c608p-192L },
- { -0x2.ep+4L, -0x1.240804f65951062ca46e4f25c608p-192L },
- { -0x2.fp+4L, 0x6.36a382849fae6de2d15362d8a394p-200L },
- { -0x2.fp+4L, -0x6.36a382849fae6de2d15362d8a394p-200L },
- { -0x3p+4L, 0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204L },
- { -0x3p+4L, -0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204L },
- { -0x3.1p+4L, 0xa.d21786ff5842eca51fea0870919p-212L },
- { -0x3.1p+4L, -0xa.d21786ff5842eca51fea0870919p-212L },
- { -0x3.2p+4L, 0x3.766dedc259af040be140a68a6c04p-216L },
+ { L(-0x2.74ff92c01f0d82abec9f315f1a08p+0), L(0xe.d3ccb7fb2658634a2b9f6b2ba81p-116) },
+ { L(-0x2.bf6821437b20197995a4b4641eaep+0), L(-0xb.f4b00b4829f961e428533e6ad048p-116) },
+ { L(-0x3.24c1b793cb35efb8be699ad3d9bap+0), L(-0x6.5454cb7fac60e3f16d9d7840c2ep-116) },
+ { L(-0x3.f48e2a8f85fca170d4561291236cp+0), L(-0xc.320a4887d1cb4c711828a75d5758p-116) },
+ { L(-0x4.0a139e16656030c39f0b0de18114p+0), L(0x1.53e84029416e1242006b2b3d1cfp-112) },
+ { L(-0x4.fdd5de9bbabf3510d0aa40769884p+0), L(-0x1.01d7d78125286f78d1e501f14966p-112) },
+ { L(-0x5.021a95fc2db6432a4c56e595394cp+0), L(-0x1.ecc6af0430d4fe5746fa7233356fp-112) },
+ { L(-0x5.ffa4bd647d0357dd4ed62cbd31ecp+0), L(-0x1.f8e3f8e5deba2d67dbd70dd96ce1p-112) },
+ { L(-0x6.005ac9625f233b607c2d96d16384p+0), L(-0x1.cb86ac569340cf1e5f24df7aab7bp-112) },
+ { L(-0x6.fff2fddae1bbff3d626b65c23fd4p+0), L(0x1.e0bfcff5c457ebcf4d3ad9674167p-112) },
+ { L(-0x7.000cff7b7f87adf4482dcdb98784p+0), L(0x1.54d99e35a74d6407b80292df199fp-112) },
+ { L(-0x7.fffe5fe05673c3ca9e82b522b0ccp+0), L(0x1.62d177c832e0eb42c2faffd1b145p-112) },
+ { L(-0x8.0001a01459fc9f60cb3cec1cec88p+0), L(0x2.8998835ac7277f7bcef67c47f188p-112) },
+ { L(-0x8.ffffd1c425e80ffc864e95749258p+0), L(-0x1.e7e20210e7f81cf781b44e9d2b02p-112) },
+ { L(-0x9.00002e3bb47d86d6d843fedc352p+0), L(0x2.14852f613a16291751d2ab751f7ep-112) },
+ { L(-0x9.fffffb606bdfdcd062ae77a50548p+0), L(0x3.962d1490cc2e8f031c7007eaa1ap-116) },
+ { L(-0xa.0000049f93bb9927b45d95e1544p+0), L(-0x1.e03086db9146a9287bd4f2172d5ap-112) },
+ { L(-0xa.ffffff9466e9f1b36dacd2adbd18p+0), L(-0xd.05a4e458062f3f95345a4d9c9b6p-116) },
+ { L(-0xb.0000006b9915315d965a6ffea41p+0), L(0x1.b415c6fff233e7b7fdc3a094246fp-112) },
+ { L(-0xb.fffffff7089387387de41acc3d4p+0), L(0x3.687427c6373bd74a10306e10a28ep-112) },
+ { L(-0xc.00000008f76c7731567c0f0250fp+0), L(-0x3.87920df5675833859190eb128ef6p-112) },
+ { L(-0xc.ffffffff4f6dcf617f97a5ffc758p+0), L(0x2.ab72d76f32eaee2d1a42ed515d3ap-116) },
+ { L(-0xd.00000000b092309c06683dd1b9p+0), L(-0x3.e3700857a15c19ac5a611de9688ap-112) },
+ { L(-0xd.fffffffff36345ab9e184a3e09dp+0), L(-0x1.176dc48e47f62d917973dd44e553p-112) },
+ { L(-0xe.000000000c9cba545e94e75ec57p+0), L(-0x1.8f753e2501e757a17cf2ecbeeb89p-112) },
+ { L(-0xe.ffffffffff28c060c6604ef3037p+0), L(-0x1.f89d37357c9e3dc17c6c6e63becap-112) },
+ { L(-0xf.0000000000d73f9f399bd0e420f8p+0), L(-0x5.e9ee31b0b890744fc0e3fbc01048p-116) },
+ { L(-0xf.fffffffffff28c060c6621f512e8p+0), L(0xd.1b2eec9d960bd9adc5be5f5fa5p-116) },
+ { L(-0x1.000000000000d73f9f399da1424cp+4), L(0x6.c46e0e88305d2800f0e414c506a8p-116) },
+ { L(-0x1.0ffffffffffff3569c47e7a93e1cp+4), L(-0x4.6a08a2e008a998ebabb8087efa2cp-112) },
+ { L(-0x1.1000000000000ca963b818568887p+4), L(-0x6.ca5a3a64ec15db0a95caf2c9ffb4p-112) },
+ { L(-0x1.1fffffffffffff4bec3ce234132dp+4), L(-0x8.b2b726187c841cb92cd5221e444p-116) },
+ { L(-0x1.20000000000000b413c31dcbeca5p+4), L(0x3.c4d005344b6cd0e7231120294abcp-112) },
+ { L(-0x1.2ffffffffffffff685b25cbf5f54p+4), L(-0x5.ced932e38485f7dd296b8fa41448p-112) },
+ { L(-0x1.30000000000000097a4da340a0acp+4), L(0x7.e484e0e0ffe38d406ebebe112f88p-112) },
+ { L(-0x1.3fffffffffffffff86af516ff7f7p+4), L(-0x6.bd67e720d57854502b7db75e1718p-112) },
+ { L(-0x1.40000000000000007950ae900809p+4), L(0x6.bec33375cac025d9c073168c5d9p-112) },
+ { L(-0x1.4ffffffffffffffffa391c4248c3p+4), L(0x5.c63022b62b5484ba346524db607p-112) },
+ { L(-0x1.500000000000000005c6e3bdb73dp+4), L(-0x5.c62f55ed5322b2685c5e9a51e6a8p-112) },
+ { L(-0x1.5fffffffffffffffffbcc71a492p+4), L(-0x1.eb5aeb96c74d7ad25e060528fb5p-112) },
+ { L(-0x1.6000000000000000004338e5b6ep+4), L(0x1.eb5aec04b2f2eb663e4e3d8a018cp-112) },
+ { L(-0x1.6ffffffffffffffffffd13c97d9dp+4), L(-0x3.8fcc4d08d6fe5aa56ab04307ce7ep-112) },
+ { L(-0x1.70000000000000000002ec368263p+4), L(0x3.8fcc4d090cee2f5d0b69a99c353cp-112) },
+ { L(-0x1.7fffffffffffffffffffe0d30fe7p+4), L(0x7.2f577cca4b4c8cb1dc14001ac5ecp-112) },
+ { L(-0x1.800000000000000000001f2cf019p+4), L(-0x7.2f577cca4b3442e35f0040b3b9e8p-112) },
+ { L(-0x1.8ffffffffffffffffffffec0c332p+4), L(-0x2.e9a0572b1bb5b95f346a92d67a6p-112) },
+ { L(-0x1.90000000000000000000013f3ccep+4), L(0x2.e9a0572b1bb5c371ddb3561705ap-112) },
+ { L(-0x1.9ffffffffffffffffffffff3b8bdp+4), L(-0x1.cad8d32e386fd783e97296d63dcbp-116) },
+ { L(-0x1.a0000000000000000000000c4743p+4), L(0x1.cad8d32e386fd7c1ab8c1fe34c0ep-116) },
+ { L(-0x1.afffffffffffffffffffffff8b95p+4), L(-0x3.8f48cc5737d5979c39db806c5406p-112) },
+ { L(-0x1.b00000000000000000000000746bp+4), L(0x3.8f48cc5737d5979c3b3a6bda06f6p-112) },
+ { L(-0x1.bffffffffffffffffffffffffbd8p+4), L(0x6.2898d42174dcf171470d8c8c6028p-112) },
+ { L(-0x1.c000000000000000000000000428p+4), L(-0x6.2898d42174dcf171470d18ba412cp-112) },
+ { L(-0x1.cfffffffffffffffffffffffffdbp+4), L(-0x4.c0ce9794ea50a839e311320bde94p-112) },
+ { L(-0x1.d000000000000000000000000025p+4), L(0x4.c0ce9794ea50a839e311322f7cf8p-112) },
+ { L(-0x1.dfffffffffffffffffffffffffffp+4), L(0x3.932c5047d60e60caded4c298a174p-112) },
+ { L(-0x1.e000000000000000000000000001p+4), L(-0x3.932c5047d60e60caded4c298973ap-112) },
+ { L(-0x1.fp+4), L(0xa.1a6973c1fade2170f7237d35fe3p-116) },
+ { L(-0x1.fp+4), L(-0xa.1a6973c1fade2170f7237d35fe08p-116) },
+ { L(-0x2p+4), L(0x5.0d34b9e0fd6f10b87b91be9aff1p-120) },
+ { L(-0x2p+4), L(-0x5.0d34b9e0fd6f10b87b91be9aff0cp-120) },
+ { L(-0x2.1p+4), L(0x2.73024a9ba1aa36a7059bff52e844p-124) },
+ { L(-0x2.1p+4), L(-0x2.73024a9ba1aa36a7059bff52e844p-124) },
+ { L(-0x2.2p+4), L(0x1.2710231c0fd7a13f8a2b4af9d6b7p-128) },
+ { L(-0x2.2p+4), L(-0x1.2710231c0fd7a13f8a2b4af9d6b7p-128) },
+ { L(-0x2.3p+4), L(0x8.6e2ce38b6c8f9419e3fad3f0312p-136) },
+ { L(-0x2.3p+4), L(-0x8.6e2ce38b6c8f9419e3fad3f0312p-136) },
+ { L(-0x2.4p+4), L(0x3.bf30652185952560d71a254e4eb8p-140) },
+ { L(-0x2.4p+4), L(-0x3.bf30652185952560d71a254e4eb8p-140) },
+ { L(-0x2.5p+4), L(0x1.9ec8d1c94e85af4c78b15c3d89d3p-144) },
+ { L(-0x2.5p+4), L(-0x1.9ec8d1c94e85af4c78b15c3d89d3p-144) },
+ { L(-0x2.6p+4), L(0xa.ea565ce061d57489e9b85276274p-152) },
+ { L(-0x2.6p+4), L(-0xa.ea565ce061d57489e9b85276274p-152) },
+ { L(-0x2.7p+4), L(0x4.7a6512692eb37804111dabad30ecp-156) },
+ { L(-0x2.7p+4), L(-0x4.7a6512692eb37804111dabad30ecp-156) },
+ { L(-0x2.8p+4), L(0x1.ca8ed42a12ae3001a07244abad2bp-160) },
+ { L(-0x2.8p+4), L(-0x1.ca8ed42a12ae3001a07244abad2bp-160) },
+ { L(-0x2.9p+4), L(0xb.2f30e1ce812063f12e7e8d8d96e8p-168) },
+ { L(-0x2.9p+4), L(-0xb.2f30e1ce812063f12e7e8d8d96e8p-168) },
+ { L(-0x2.ap+4), L(0x4.42bd49d4c37a0db136489772e428p-172) },
+ { L(-0x2.ap+4), L(-0x4.42bd49d4c37a0db136489772e428p-172) },
+ { L(-0x2.bp+4), L(0x1.95db45257e5122dcbae56def372p-176) },
+ { L(-0x2.bp+4), L(-0x1.95db45257e5122dcbae56def372p-176) },
+ { L(-0x2.cp+4), L(0x9.3958d81ff63527ecf993f3fb6f48p-184) },
+ { L(-0x2.cp+4), L(-0x9.3958d81ff63527ecf993f3fb6f48p-184) },
+ { L(-0x2.dp+4), L(0x3.47970e4440c8f1c058bd238c9958p-188) },
+ { L(-0x2.dp+4), L(-0x3.47970e4440c8f1c058bd238c9958p-188) },
+ { L(-0x2.ep+4), L(0x1.240804f65951062ca46e4f25c608p-192) },
+ { L(-0x2.ep+4), L(-0x1.240804f65951062ca46e4f25c608p-192) },
+ { L(-0x2.fp+4), L(0x6.36a382849fae6de2d15362d8a394p-200) },
+ { L(-0x2.fp+4), L(-0x6.36a382849fae6de2d15362d8a394p-200) },
+ { L(-0x3p+4), L(0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204) },
+ { L(-0x3p+4), L(-0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204) },
+ { L(-0x3.1p+4), L(0xa.d21786ff5842eca51fea0870919p-212) },
+ { L(-0x3.1p+4), L(-0xa.d21786ff5842eca51fea0870919p-212) },
+ { L(-0x3.2p+4), L(0x3.766dedc259af040be140a68a6c04p-216) },
};
-static const long double e_hi = 0x2.b7e151628aed2a6abf7158809cf4p+0L;
-static const long double e_lo = 0xf.3c762e7160f38b4da56a784d9048p-116L;
+static const _Float128 e_hi = L(0x2.b7e151628aed2a6abf7158809cf4p+0);
+static const _Float128 e_lo = L(0xf.3c762e7160f38b4da56a784d9048p-116);
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) in Stirling's
approximation to lgamma function. */
-static const long double lgamma_coeff[] =
+static const _Float128 lgamma_coeff[] =
{
- 0x1.5555555555555555555555555555p-4L,
- -0xb.60b60b60b60b60b60b60b60b60b8p-12L,
- 0x3.4034034034034034034034034034p-12L,
- -0x2.7027027027027027027027027028p-12L,
- 0x3.72a3c5631fe46ae1d4e700dca8f2p-12L,
- -0x7.daac36664f1f207daac36664f1f4p-12L,
- 0x1.a41a41a41a41a41a41a41a41a41ap-8L,
- -0x7.90a1b2c3d4e5f708192a3b4c5d7p-8L,
- 0x2.dfd2c703c0cfff430edfd2c703cp-4L,
- -0x1.6476701181f39edbdb9ce625987dp+0L,
- 0xd.672219167002d3a7a9c886459cp+0L,
- -0x9.cd9292e6660d55b3f712eb9e07c8p+4L,
- 0x8.911a740da740da740da740da741p+8L,
- -0x8.d0cc570e255bf59ff6eec24b49p+12L,
- 0xa.8d1044d3708d1c219ee4fdc446ap+16L,
- -0xe.8844d8a169abbc406169abbc406p+20L,
- 0x1.6d29a0f6433b79890cede62433b8p+28L,
- -0x2.88a233b3c8cddaba9809357125d8p+32L,
- 0x5.0dde6f27500939a85c40939a85c4p+36L,
- -0xb.4005bde03d4642a243581714af68p+40L,
- 0x1.bc8cd6f8f1f755c78753cdb5d5c9p+48L,
- -0x4.bbebb143bb94de5a0284fa7ec424p+52L,
- 0xe.2e1337f5af0bed90b6b0a352d4fp+56L,
- -0x2.e78250162b62405ad3e4bfe61b38p+64L,
- 0xa.5f7eef9e71ac7c80326ab4cc8bfp+68L,
- -0x2.83be0395e550213369924971b21ap+76L,
- 0xa.8ebfe48da17dd999790760b0cep+80L,
+ L(0x1.5555555555555555555555555555p-4),
+ L(-0xb.60b60b60b60b60b60b60b60b60b8p-12),
+ L(0x3.4034034034034034034034034034p-12),
+ L(-0x2.7027027027027027027027027028p-12),
+ L(0x3.72a3c5631fe46ae1d4e700dca8f2p-12),
+ L(-0x7.daac36664f1f207daac36664f1f4p-12),
+ L(0x1.a41a41a41a41a41a41a41a41a41ap-8),
+ L(-0x7.90a1b2c3d4e5f708192a3b4c5d7p-8),
+ L(0x2.dfd2c703c0cfff430edfd2c703cp-4),
+ L(-0x1.6476701181f39edbdb9ce625987dp+0),
+ L(0xd.672219167002d3a7a9c886459cp+0),
+ L(-0x9.cd9292e6660d55b3f712eb9e07c8p+4),
+ L(0x8.911a740da740da740da740da741p+8),
+ L(-0x8.d0cc570e255bf59ff6eec24b49p+12),
+ L(0xa.8d1044d3708d1c219ee4fdc446ap+16),
+ L(-0xe.8844d8a169abbc406169abbc406p+20),
+ L(0x1.6d29a0f6433b79890cede62433b8p+28),
+ L(-0x2.88a233b3c8cddaba9809357125d8p+32),
+ L(0x5.0dde6f27500939a85c40939a85c4p+36),
+ L(-0xb.4005bde03d4642a243581714af68p+40),
+ L(0x1.bc8cd6f8f1f755c78753cdb5d5c9p+48),
+ L(-0x4.bbebb143bb94de5a0284fa7ec424p+52),
+ L(0xe.2e1337f5af0bed90b6b0a352d4fp+56),
+ L(-0x2.e78250162b62405ad3e4bfe61b38p+64),
+ L(0xa.5f7eef9e71ac7c80326ab4cc8bfp+68),
+ L(-0x2.83be0395e550213369924971b21ap+76),
+ L(0xa.8ebfe48da17dd999790760b0cep+80),
};
#define NCOEFF (sizeof (lgamma_coeff) / sizeof (lgamma_coeff[0]))
@@ -166,224 +166,224 @@ static const long double lgamma_coeff[] =
polynomial is expressed in terms of x-xm, where xm is the midpoint
of the interval for which the polynomial applies. */
-static const long double poly_coeff[] =
+static const _Float128 poly_coeff[] =
{
/* Interval [-2.125, -2] (polynomial degree 23). */
- -0x1.0b71c5c54d42eb6c17f30b7aa8f5p+0L,
- -0xc.73a1dc05f34951602554c6d7506p-4L,
- -0x1.ec841408528b51473e6c425ee5ffp-4L,
- -0xe.37c9da26fc3c9a3c1844c8c7f1cp-4L,
- -0x1.03cd87c519305703b021fa33f827p-4L,
- -0xe.ae9ada65e09aa7f1c75216128f58p-4L,
- 0x9.b11855a4864b5731cf85736015a8p-8L,
- -0xe.f28c133e697a95c28607c9701dep-4L,
- 0x2.6ec14a1c586a72a7cc33ee569d6ap-4L,
- -0xf.57cab973e14464a262fc24723c38p-4L,
- 0x4.5b0fc25f16e52997b2886bbae808p-4L,
- -0xf.f50e59f1a9b56e76e988dac9ccf8p-4L,
- 0x6.5f5eae15e9a93369e1d85146c6fcp-4L,
- -0x1.0d2422daac459e33e0994325ed23p+0L,
- 0x8.82000a0e7401fb1117a0e6606928p-4L,
- -0x1.1f492f178a3f1b19f58a2ca68e55p+0L,
- 0xa.cb545f949899a04c160b19389abp-4L,
- -0x1.36165a1b155ba3db3d1b77caf498p+0L,
- 0xd.44c5d5576f74302e5cf79e183eep-4L,
- -0x1.51f22e0cdd33d3d481e326c02f3ep+0L,
- 0xf.f73a349c08244ac389c007779bfp-4L,
- -0x1.73317bf626156ba716747c4ca866p+0L,
- 0x1.379c3c97b9bc71e1c1c4802dd657p+0L,
- -0x1.a72a351c54f902d483052000f5dfp+0L,
+ L(-0x1.0b71c5c54d42eb6c17f30b7aa8f5p+0),
+ L(-0xc.73a1dc05f34951602554c6d7506p-4),
+ L(-0x1.ec841408528b51473e6c425ee5ffp-4),
+ L(-0xe.37c9da26fc3c9a3c1844c8c7f1cp-4),
+ L(-0x1.03cd87c519305703b021fa33f827p-4),
+ L(-0xe.ae9ada65e09aa7f1c75216128f58p-4),
+ L(0x9.b11855a4864b5731cf85736015a8p-8),
+ L(-0xe.f28c133e697a95c28607c9701dep-4),
+ L(0x2.6ec14a1c586a72a7cc33ee569d6ap-4),
+ L(-0xf.57cab973e14464a262fc24723c38p-4),
+ L(0x4.5b0fc25f16e52997b2886bbae808p-4),
+ L(-0xf.f50e59f1a9b56e76e988dac9ccf8p-4),
+ L(0x6.5f5eae15e9a93369e1d85146c6fcp-4),
+ L(-0x1.0d2422daac459e33e0994325ed23p+0),
+ L(0x8.82000a0e7401fb1117a0e6606928p-4),
+ L(-0x1.1f492f178a3f1b19f58a2ca68e55p+0),
+ L(0xa.cb545f949899a04c160b19389abp-4),
+ L(-0x1.36165a1b155ba3db3d1b77caf498p+0),
+ L(0xd.44c5d5576f74302e5cf79e183eep-4),
+ L(-0x1.51f22e0cdd33d3d481e326c02f3ep+0),
+ L(0xf.f73a349c08244ac389c007779bfp-4),
+ L(-0x1.73317bf626156ba716747c4ca866p+0),
+ L(0x1.379c3c97b9bc71e1c1c4802dd657p+0),
+ L(-0x1.a72a351c54f902d483052000f5dfp+0),
/* Interval [-2.25, -2.125] (polynomial degree 24). */
- -0xf.2930890d7d675a80c36afb0fd5e8p-4L,
- -0xc.a5cfde054eab5c6770daeca577f8p-4L,
- 0x3.9c9e0fdebb07cdf89c61d41c9238p-4L,
- -0x1.02a5ad35605fcf4af65a6dbacb84p+0L,
- 0x9.6e9b1185bb48be9de1918e00a2e8p-4L,
- -0x1.4d8332f3cfbfa116fd611e9ce90dp+0L,
- 0x1.1c0c8cb4d9f4b1d490e1a41fae4dp+0L,
- -0x1.c9a6f5ae9130cd0299e293a42714p+0L,
- 0x1.d7e9307fd58a2ea997f29573a112p+0L,
- -0x2.921cb3473d96178ca2a11d2a8d46p+0L,
- 0x2.e8d59113b6f3409ff8db226e9988p+0L,
- -0x3.cbab931625a1ae2b26756817f264p+0L,
- 0x4.7d9f0f05d5296d18663ca003912p+0L,
- -0x5.ade9cba12a14ea485667b7135bbp+0L,
- 0x6.dc983a5da74fb48e767b7fec0a3p+0L,
- -0x8.8d9ed454ae31d9e138dd8ee0d1a8p+0L,
- 0xa.6fa099d4e7c202e0c0fd6ed8492p+0L,
- -0xc.ebc552a8090a0f0115e92d4ebbc8p+0L,
- 0xf.d695e4772c0d829b53fba9ca5568p+0L,
- -0x1.38c32ae38e5e9eb79b2a4c5570a9p+4L,
- 0x1.8035145646cfab49306d0999a51bp+4L,
- -0x1.d930adbb03dd342a4c2a8c4e1af6p+4L,
- 0x2.45c2edb1b4943ddb3686cd9c6524p+4L,
- -0x2.e818ebbfafe2f916fa21abf7756p+4L,
- 0x3.9804ce51d0fb9a430a711fd7307p+4L,
+ L(-0xf.2930890d7d675a80c36afb0fd5e8p-4),
+ L(-0xc.a5cfde054eab5c6770daeca577f8p-4),
+ L(0x3.9c9e0fdebb07cdf89c61d41c9238p-4),
+ L(-0x1.02a5ad35605fcf4af65a6dbacb84p+0),
+ L(0x9.6e9b1185bb48be9de1918e00a2e8p-4),
+ L(-0x1.4d8332f3cfbfa116fd611e9ce90dp+0),
+ L(0x1.1c0c8cb4d9f4b1d490e1a41fae4dp+0),
+ L(-0x1.c9a6f5ae9130cd0299e293a42714p+0),
+ L(0x1.d7e9307fd58a2ea997f29573a112p+0),
+ L(-0x2.921cb3473d96178ca2a11d2a8d46p+0),
+ L(0x2.e8d59113b6f3409ff8db226e9988p+0),
+ L(-0x3.cbab931625a1ae2b26756817f264p+0),
+ L(0x4.7d9f0f05d5296d18663ca003912p+0),
+ L(-0x5.ade9cba12a14ea485667b7135bbp+0),
+ L(0x6.dc983a5da74fb48e767b7fec0a3p+0),
+ L(-0x8.8d9ed454ae31d9e138dd8ee0d1a8p+0),
+ L(0xa.6fa099d4e7c202e0c0fd6ed8492p+0),
+ L(-0xc.ebc552a8090a0f0115e92d4ebbc8p+0),
+ L(0xf.d695e4772c0d829b53fba9ca5568p+0),
+ L(-0x1.38c32ae38e5e9eb79b2a4c5570a9p+4),
+ L(0x1.8035145646cfab49306d0999a51bp+4),
+ L(-0x1.d930adbb03dd342a4c2a8c4e1af6p+4),
+ L(0x2.45c2edb1b4943ddb3686cd9c6524p+4),
+ L(-0x2.e818ebbfafe2f916fa21abf7756p+4),
+ L(0x3.9804ce51d0fb9a430a711fd7307p+4),
/* Interval [-2.375, -2.25] (polynomial degree 25). */
- -0xd.7d28d505d6181218a25f31d5e45p-4L,
- -0xe.69649a3040985140cdf946829fap-4L,
- 0xb.0d74a2827d053a8d44595012484p-4L,
- -0x1.924b0922853617cac181afbc08ddp+0L,
- 0x1.d49b12bccf0a568582e2d3c410f3p+0L,
- -0x3.0898bb7d8c4093e636279c791244p+0L,
- 0x4.207a6cac711cb53868e8a5057eep+0L,
- -0x6.39ee63ea4fb1dcab0c9144bf3ddcp+0L,
- 0x8.e2e2556a797b649bf3f53bd26718p+0L,
- -0xd.0e83ac82552ef12af508589e7a8p+0L,
- 0x1.2e4525e0ce6670563c6484a82b05p+4L,
- -0x1.b8e350d6a8f2b222fa390a57c23dp+4L,
- 0x2.805cd69b919087d8a80295892c2cp+4L,
- -0x3.a42585424a1b7e64c71743ab014p+4L,
- 0x5.4b4f409f98de49f7bfb03c05f984p+4L,
- -0x7.b3c5827fbe934bc820d6832fb9fcp+4L,
- 0xb.33b7b90cc96c425526e0d0866e7p+4L,
- -0x1.04b77047ac4f59ee3775ca10df0dp+8L,
- 0x1.7b366f5e94a34f41386eac086313p+8L,
- -0x2.2797338429385c9849ca6355bfc2p+8L,
- 0x3.225273cf92a27c9aac1b35511256p+8L,
- -0x4.8f078aa48afe6cb3a4e89690f898p+8L,
- 0x6.9f311d7b6654fc1d0b5195141d04p+8L,
- -0x9.a0c297b6b4621619ca9bacc48ed8p+8L,
- 0xe.ce1f06b6f90d92138232a76e4cap+8L,
- -0x1.5b0e6806fa064daf011613e43b17p+12L,
+ L(-0xd.7d28d505d6181218a25f31d5e45p-4),
+ L(-0xe.69649a3040985140cdf946829fap-4),
+ L(0xb.0d74a2827d053a8d44595012484p-4),
+ L(-0x1.924b0922853617cac181afbc08ddp+0),
+ L(0x1.d49b12bccf0a568582e2d3c410f3p+0),
+ L(-0x3.0898bb7d8c4093e636279c791244p+0),
+ L(0x4.207a6cac711cb53868e8a5057eep+0),
+ L(-0x6.39ee63ea4fb1dcab0c9144bf3ddcp+0),
+ L(0x8.e2e2556a797b649bf3f53bd26718p+0),
+ L(-0xd.0e83ac82552ef12af508589e7a8p+0),
+ L(0x1.2e4525e0ce6670563c6484a82b05p+4),
+ L(-0x1.b8e350d6a8f2b222fa390a57c23dp+4),
+ L(0x2.805cd69b919087d8a80295892c2cp+4),
+ L(-0x3.a42585424a1b7e64c71743ab014p+4),
+ L(0x5.4b4f409f98de49f7bfb03c05f984p+4),
+ L(-0x7.b3c5827fbe934bc820d6832fb9fcp+4),
+ L(0xb.33b7b90cc96c425526e0d0866e7p+4),
+ L(-0x1.04b77047ac4f59ee3775ca10df0dp+8),
+ L(0x1.7b366f5e94a34f41386eac086313p+8),
+ L(-0x2.2797338429385c9849ca6355bfc2p+8),
+ L(0x3.225273cf92a27c9aac1b35511256p+8),
+ L(-0x4.8f078aa48afe6cb3a4e89690f898p+8),
+ L(0x6.9f311d7b6654fc1d0b5195141d04p+8),
+ L(-0x9.a0c297b6b4621619ca9bacc48ed8p+8),
+ L(0xe.ce1f06b6f90d92138232a76e4cap+8),
+ L(-0x1.5b0e6806fa064daf011613e43b17p+12),
/* Interval [-2.5, -2.375] (polynomial degree 27). */
- -0xb.74ea1bcfff94b2c01afba9daa7d8p-4L,
- -0x1.2a82bd590c37538cab143308de4dp+0L,
- 0x1.88020f828b966fec66b8649fd6fcp+0L,
- -0x3.32279f040eb694970e9db24863dcp+0L,
- 0x5.57ac82517767e68a721005853864p+0L,
- -0x9.c2aedcfe22833de43834a0a6cc4p+0L,
- 0x1.12c132f1f5577f99e1a0ed3538e1p+4L,
- -0x1.ea94e26628a3de3597f7bb55a948p+4L,
- 0x3.66b4ac4fa582f58b59f96b2f7c7p+4L,
- -0x6.0cf746a9cf4cba8c39afcc73fc84p+4L,
- 0xa.c102ef2c20d75a342197df7fedf8p+4L,
- -0x1.31ebff06e8f14626782df58db3b6p+8L,
- 0x2.1fd6f0c0e710994e059b9dbdb1fep+8L,
- -0x3.c6d76040407f447f8b5074f07706p+8L,
- 0x6.b6d18e0d8feb4c2ef5af6a40ed18p+8L,
- -0xb.efaf542c529f91e34217f24ae6a8p+8L,
- 0x1.53852d873210e7070f5d9eb2296p+12L,
- -0x2.5b977c0ddc6d540717173ac29fc8p+12L,
- 0x4.310d452ae05100eff1e02343a724p+12L,
- -0x7.73a5d8f20c4f986a7dd1912b2968p+12L,
- 0xd.3f5ea2484f3fca15eab1f4d1a218p+12L,
- -0x1.78d18aac156d1d93a2ffe7e08d3fp+16L,
- 0x2.9df49ca75e5b567f5ea3e47106cp+16L,
- -0x4.a7149af8961a08aa7c3233b5bb94p+16L,
- 0x8.3db10ffa742c707c25197d989798p+16L,
- -0xe.a26d6dd023cadd02041a049ec368p+16L,
- 0x1.c825d90514e7c57c7fa5316f947cp+20L,
- -0x3.34bb81e5a0952df8ca1abdc6684cp+20L,
+ L(-0xb.74ea1bcfff94b2c01afba9daa7d8p-4),
+ L(-0x1.2a82bd590c37538cab143308de4dp+0),
+ L(0x1.88020f828b966fec66b8649fd6fcp+0),
+ L(-0x3.32279f040eb694970e9db24863dcp+0),
+ L(0x5.57ac82517767e68a721005853864p+0),
+ L(-0x9.c2aedcfe22833de43834a0a6cc4p+0),
+ L(0x1.12c132f1f5577f99e1a0ed3538e1p+4),
+ L(-0x1.ea94e26628a3de3597f7bb55a948p+4),
+ L(0x3.66b4ac4fa582f58b59f96b2f7c7p+4),
+ L(-0x6.0cf746a9cf4cba8c39afcc73fc84p+4),
+ L(0xa.c102ef2c20d75a342197df7fedf8p+4),
+ L(-0x1.31ebff06e8f14626782df58db3b6p+8),
+ L(0x2.1fd6f0c0e710994e059b9dbdb1fep+8),
+ L(-0x3.c6d76040407f447f8b5074f07706p+8),
+ L(0x6.b6d18e0d8feb4c2ef5af6a40ed18p+8),
+ L(-0xb.efaf542c529f91e34217f24ae6a8p+8),
+ L(0x1.53852d873210e7070f5d9eb2296p+12),
+ L(-0x2.5b977c0ddc6d540717173ac29fc8p+12),
+ L(0x4.310d452ae05100eff1e02343a724p+12),
+ L(-0x7.73a5d8f20c4f986a7dd1912b2968p+12),
+ L(0xd.3f5ea2484f3fca15eab1f4d1a218p+12),
+ L(-0x1.78d18aac156d1d93a2ffe7e08d3fp+16),
+ L(0x2.9df49ca75e5b567f5ea3e47106cp+16),
+ L(-0x4.a7149af8961a08aa7c3233b5bb94p+16),
+ L(0x8.3db10ffa742c707c25197d989798p+16),
+ L(-0xe.a26d6dd023cadd02041a049ec368p+16),
+ L(0x1.c825d90514e7c57c7fa5316f947cp+20),
+ L(-0x3.34bb81e5a0952df8ca1abdc6684cp+20),
/* Interval [-2.625, -2.5] (polynomial degree 28). */
- -0x3.d10108c27ebafad533c20eac32bp-4L,
- 0x1.cd557caff7d2b2085f41dbec5106p+0L,
- 0x3.819b4856d399520dad9776ea2cacp+0L,
- 0x6.8505cbad03dc34c5e42e8b12eb78p+0L,
- 0xb.c1b2e653a9e38f82b399c94e7f08p+0L,
- 0x1.50a53a38f148138105124df65419p+4L,
- 0x2.57ae00cbe5232cbeeed34d89727ap+4L,
- 0x4.2b156301b8604db85a601544bfp+4L,
- 0x7.6989ed23ca3ca7579b3462592b5cp+4L,
- 0xd.2dd2976557939517f831f5552cc8p+4L,
- 0x1.76e1c3430eb860969bce40cd494p+8L,
- 0x2.9a77bf5488742466db3a2c7c1ec6p+8L,
- 0x4.a0d62ed7266e8eb36f725a8ebcep+8L,
- 0x8.3a6184dd3021067df2f8b91e99c8p+8L,
- 0xe.a0ade1538245bf55d39d7e436b1p+8L,
- 0x1.a01359fae8617b5826dd74428e9p+12L,
- 0x2.e3b0a32caae77251169acaca1ad4p+12L,
- 0x5.2301257c81589f62b38fb5993ee8p+12L,
- 0x9.21c9275db253d4e719b73b18cb9p+12L,
- 0x1.03c104bc96141cda3f3fa4b112bcp+16L,
- 0x1.cdc8ed65119196a08b0c78f1445p+16L,
- 0x3.34f31d2eaacf34382cdb0073572ap+16L,
- 0x5.b37628cadf12bf0000907d0ef294p+16L,
- 0xa.22d8b332c0b1e6a616f425dfe5ap+16L,
- 0x1.205b01444804c3ff922cd78b4c42p+20L,
- 0x1.fe8f0cea9d1e0ff25be2470b4318p+20L,
- 0x3.8872aebeb368399aee02b39340aep+20L,
- 0x6.ebd560d351e84e26a4381f5b293cp+20L,
- 0xc.c3644d094b0dae2fbcbf682cd428p+20L,
+ L(-0x3.d10108c27ebafad533c20eac32bp-4),
+ L(0x1.cd557caff7d2b2085f41dbec5106p+0),
+ L(0x3.819b4856d399520dad9776ea2cacp+0),
+ L(0x6.8505cbad03dc34c5e42e8b12eb78p+0),
+ L(0xb.c1b2e653a9e38f82b399c94e7f08p+0),
+ L(0x1.50a53a38f148138105124df65419p+4),
+ L(0x2.57ae00cbe5232cbeeed34d89727ap+4),
+ L(0x4.2b156301b8604db85a601544bfp+4),
+ L(0x7.6989ed23ca3ca7579b3462592b5cp+4),
+ L(0xd.2dd2976557939517f831f5552cc8p+4),
+ L(0x1.76e1c3430eb860969bce40cd494p+8),
+ L(0x2.9a77bf5488742466db3a2c7c1ec6p+8),
+ L(0x4.a0d62ed7266e8eb36f725a8ebcep+8),
+ L(0x8.3a6184dd3021067df2f8b91e99c8p+8),
+ L(0xe.a0ade1538245bf55d39d7e436b1p+8),
+ L(0x1.a01359fae8617b5826dd74428e9p+12),
+ L(0x2.e3b0a32caae77251169acaca1ad4p+12),
+ L(0x5.2301257c81589f62b38fb5993ee8p+12),
+ L(0x9.21c9275db253d4e719b73b18cb9p+12),
+ L(0x1.03c104bc96141cda3f3fa4b112bcp+16),
+ L(0x1.cdc8ed65119196a08b0c78f1445p+16),
+ L(0x3.34f31d2eaacf34382cdb0073572ap+16),
+ L(0x5.b37628cadf12bf0000907d0ef294p+16),
+ L(0xa.22d8b332c0b1e6a616f425dfe5ap+16),
+ L(0x1.205b01444804c3ff922cd78b4c42p+20),
+ L(0x1.fe8f0cea9d1e0ff25be2470b4318p+20),
+ L(0x3.8872aebeb368399aee02b39340aep+20),
+ L(0x6.ebd560d351e84e26a4381f5b293cp+20),
+ L(0xc.c3644d094b0dae2fbcbf682cd428p+20),
/* Interval [-2.75, -2.625] (polynomial degree 26). */
- -0x6.b5d252a56e8a75458a27ed1c2dd4p-4L,
- 0x1.28d60383da3ac721aed3c5794da9p+0L,
- 0x1.db6513ada8a66ea77d87d9a8827bp+0L,
- 0x2.e217118f9d348a27f7506a707e6ep+0L,
- 0x4.450112c5cbf725a0fb9802396c9p+0L,
- 0x6.4af99151eae7810a75df2a0303c4p+0L,
- 0x9.2db598b4a97a7f69aeef32aec758p+0L,
- 0xd.62bef9c22471f5ee47ea1b9c0b5p+0L,
- 0x1.379f294e412bd62328326d4222f9p+4L,
- 0x1.c5827349d8865f1e8825c37c31c6p+4L,
- 0x2.93a7e7a75b7568cc8cbe8c016c12p+4L,
- 0x3.bf9bb882afe57edb383d41879d3ap+4L,
- 0x5.73c737828cee095c43a5566731c8p+4L,
- 0x7.ee4653493a7f81e0442062b3823cp+4L,
- 0xb.891c6b83fc8b55bd973b5d962d6p+4L,
- 0x1.0c775d7de3bf9b246c0208e0207ep+8L,
- 0x1.867ee43ec4bd4f4fd56abc05110ap+8L,
- 0x2.37fe9ba6695821e9822d8c8af0a6p+8L,
- 0x3.3a2c667e37c942f182cd3223a936p+8L,
- 0x4.b1b500eb59f3f782c7ccec88754p+8L,
- 0x6.d3efd3b65b3d0d8488d30b79fa4cp+8L,
- 0x9.ee8224e65bed5ced8b75eaec609p+8L,
- 0xe.72416e510cca77d53fc615c1f3dp+8L,
- 0x1.4fb538b0a2dfe567a8904b7e0445p+12L,
- 0x1.e7f56a9266cf525a5b8cf4cb76cep+12L,
- 0x2.f0365c983f68c597ee49d099cce8p+12L,
- 0x4.53aa229e1b9f5b5e59625265951p+12L,
+ L(-0x6.b5d252a56e8a75458a27ed1c2dd4p-4),
+ L(0x1.28d60383da3ac721aed3c5794da9p+0),
+ L(0x1.db6513ada8a66ea77d87d9a8827bp+0),
+ L(0x2.e217118f9d348a27f7506a707e6ep+0),
+ L(0x4.450112c5cbf725a0fb9802396c9p+0),
+ L(0x6.4af99151eae7810a75df2a0303c4p+0),
+ L(0x9.2db598b4a97a7f69aeef32aec758p+0),
+ L(0xd.62bef9c22471f5ee47ea1b9c0b5p+0),
+ L(0x1.379f294e412bd62328326d4222f9p+4),
+ L(0x1.c5827349d8865f1e8825c37c31c6p+4),
+ L(0x2.93a7e7a75b7568cc8cbe8c016c12p+4),
+ L(0x3.bf9bb882afe57edb383d41879d3ap+4),
+ L(0x5.73c737828cee095c43a5566731c8p+4),
+ L(0x7.ee4653493a7f81e0442062b3823cp+4),
+ L(0xb.891c6b83fc8b55bd973b5d962d6p+4),
+ L(0x1.0c775d7de3bf9b246c0208e0207ep+8),
+ L(0x1.867ee43ec4bd4f4fd56abc05110ap+8),
+ L(0x2.37fe9ba6695821e9822d8c8af0a6p+8),
+ L(0x3.3a2c667e37c942f182cd3223a936p+8),
+ L(0x4.b1b500eb59f3f782c7ccec88754p+8),
+ L(0x6.d3efd3b65b3d0d8488d30b79fa4cp+8),
+ L(0x9.ee8224e65bed5ced8b75eaec609p+8),
+ L(0xe.72416e510cca77d53fc615c1f3dp+8),
+ L(0x1.4fb538b0a2dfe567a8904b7e0445p+12),
+ L(0x1.e7f56a9266cf525a5b8cf4cb76cep+12),
+ L(0x2.f0365c983f68c597ee49d099cce8p+12),
+ L(0x4.53aa229e1b9f5b5e59625265951p+12),
/* Interval [-2.875, -2.75] (polynomial degree 24). */
- -0x8.a41b1e4f36ff88dc820815607d68p-4L,
- 0xc.da87d3b69dc0f2f9c6f368b8ca1p-4L,
- 0x1.1474ad5c36158a7bea04fd2f98c6p+0L,
- 0x1.761ecb90c555df6555b7dba955b6p+0L,
- 0x1.d279bff9ae291caf6c4b4bcb3202p+0L,
- 0x2.4e5d00559a6e2b9b5d7fe1f6689cp+0L,
- 0x2.d57545a75cee8743ae2b17bc8d24p+0L,
- 0x3.8514eee3aac88b89bec2307021bap+0L,
- 0x4.5235e3b6e1891ffeb87fed9f8a24p+0L,
- 0x5.562acdb10eef3c9a773b3e27a864p+0L,
- 0x6.8ec8965c76efe03c26bff60b1194p+0L,
- 0x8.15251aca144877af32658399f9b8p+0L,
- 0x9.f08d56aba174d844138af782c0f8p+0L,
- 0xc.3dbbeda2679e8a1346ccc3f6da88p+0L,
- 0xf.0f5bfd5eacc26db308ffa0556fa8p+0L,
- 0x1.28a6ccd84476fbc713d6bab49ac9p+4L,
- 0x1.6d0a3ae2a3b1c8ff400641a3a21fp+4L,
- 0x1.c15701b28637f87acfb6a91d33b5p+4L,
- 0x2.28fbe0eccf472089b017651ca55ep+4L,
- 0x2.a8a453004f6e8ffaacd1603bc3dp+4L,
- 0x3.45ae4d9e1e7cd1a5dba0e4ec7f6cp+4L,
- 0x4.065fbfacb7fad3e473cb577a61e8p+4L,
- 0x4.f3d1473020927acac1944734a39p+4L,
- 0x6.54bb091245815a36fb74e314dd18p+4L,
- 0x7.d7f445129f7fb6c055e582d3f6ep+4L,
+ L(-0x8.a41b1e4f36ff88dc820815607d68p-4),
+ L(0xc.da87d3b69dc0f2f9c6f368b8ca1p-4),
+ L(0x1.1474ad5c36158a7bea04fd2f98c6p+0),
+ L(0x1.761ecb90c555df6555b7dba955b6p+0),
+ L(0x1.d279bff9ae291caf6c4b4bcb3202p+0),
+ L(0x2.4e5d00559a6e2b9b5d7fe1f6689cp+0),
+ L(0x2.d57545a75cee8743ae2b17bc8d24p+0),
+ L(0x3.8514eee3aac88b89bec2307021bap+0),
+ L(0x4.5235e3b6e1891ffeb87fed9f8a24p+0),
+ L(0x5.562acdb10eef3c9a773b3e27a864p+0),
+ L(0x6.8ec8965c76efe03c26bff60b1194p+0),
+ L(0x8.15251aca144877af32658399f9b8p+0),
+ L(0x9.f08d56aba174d844138af782c0f8p+0),
+ L(0xc.3dbbeda2679e8a1346ccc3f6da88p+0),
+ L(0xf.0f5bfd5eacc26db308ffa0556fa8p+0),
+ L(0x1.28a6ccd84476fbc713d6bab49ac9p+4),
+ L(0x1.6d0a3ae2a3b1c8ff400641a3a21fp+4),
+ L(0x1.c15701b28637f87acfb6a91d33b5p+4),
+ L(0x2.28fbe0eccf472089b017651ca55ep+4),
+ L(0x2.a8a453004f6e8ffaacd1603bc3dp+4),
+ L(0x3.45ae4d9e1e7cd1a5dba0e4ec7f6cp+4),
+ L(0x4.065fbfacb7fad3e473cb577a61e8p+4),
+ L(0x4.f3d1473020927acac1944734a39p+4),
+ L(0x6.54bb091245815a36fb74e314dd18p+4),
+ L(0x7.d7f445129f7fb6c055e582d3f6ep+4),
/* Interval [-3, -2.875] (polynomial degree 23). */
- -0xa.046d667e468f3e44dcae1afcc648p-4L,
- 0x9.70b88dcc006c214d8d996fdf5ccp-4L,
- 0xa.a8a39421c86d3ff24931a0929fp-4L,
- 0xd.2f4d1363f324da2b357c8b6ec94p-4L,
- 0xd.ca9aa1a3a5c00de11bf60499a97p-4L,
- 0xf.cf09c31eeb52a45dfa7ebe3778dp-4L,
- 0x1.04b133a39ed8a09691205660468bp+0L,
- 0x1.22b547a06edda944fcb12fd9b5ecp+0L,
- 0x1.2c57fce7db86a91df09602d344b3p+0L,
- 0x1.4aade4894708f84795212fe257eep+0L,
- 0x1.579c8b7b67ec4afed5b28c8bf787p+0L,
- 0x1.776820e7fc80ae5284239733078ap+0L,
- 0x1.883ab28c7301fde4ca6b8ec26ec8p+0L,
- 0x1.aa2ef6e1ae52eb42c9ee83b206e3p+0L,
- 0x1.bf4ad50f0a9a9311300cf0c51ee7p+0L,
- 0x1.e40206e0e96b1da463814dde0d09p+0L,
- 0x1.fdcbcffef3a21b29719c2bd9feb1p+0L,
- 0x2.25e2e8948939c4d42cf108fae4bep+0L,
- 0x2.44ce14d2b59c1c0e6bf2cfa81018p+0L,
- 0x2.70ee80bbd0387162be4861c43622p+0L,
- 0x2.954b64d2c2ebf3489b949c74476p+0L,
- 0x2.c616e133a811c1c9446105208656p+0L,
- 0x3.05a69dfe1a9ba1079f90fcf26bd4p+0L,
- 0x3.410d2ad16a0506de29736e6aafdap+0L,
+ L(-0xa.046d667e468f3e44dcae1afcc648p-4),
+ L(0x9.70b88dcc006c214d8d996fdf5ccp-4),
+ L(0xa.a8a39421c86d3ff24931a0929fp-4),
+ L(0xd.2f4d1363f324da2b357c8b6ec94p-4),
+ L(0xd.ca9aa1a3a5c00de11bf60499a97p-4),
+ L(0xf.cf09c31eeb52a45dfa7ebe3778dp-4),
+ L(0x1.04b133a39ed8a09691205660468bp+0),
+ L(0x1.22b547a06edda944fcb12fd9b5ecp+0),
+ L(0x1.2c57fce7db86a91df09602d344b3p+0),
+ L(0x1.4aade4894708f84795212fe257eep+0),
+ L(0x1.579c8b7b67ec4afed5b28c8bf787p+0),
+ L(0x1.776820e7fc80ae5284239733078ap+0),
+ L(0x1.883ab28c7301fde4ca6b8ec26ec8p+0),
+ L(0x1.aa2ef6e1ae52eb42c9ee83b206e3p+0),
+ L(0x1.bf4ad50f0a9a9311300cf0c51ee7p+0),
+ L(0x1.e40206e0e96b1da463814dde0d09p+0),
+ L(0x1.fdcbcffef3a21b29719c2bd9feb1p+0),
+ L(0x2.25e2e8948939c4d42cf108fae4bep+0),
+ L(0x2.44ce14d2b59c1c0e6bf2cfa81018p+0),
+ L(0x2.70ee80bbd0387162be4861c43622p+0),
+ L(0x2.954b64d2c2ebf3489b949c74476p+0),
+ L(0x2.c616e133a811c1c9446105208656p+0),
+ L(0x3.05a69dfe1a9ba1079f90fcf26bd4p+0),
+ L(0x3.410d2ad16a0506de29736e6aafdap+0),
};
static const size_t poly_deg[] =
@@ -412,30 +412,30 @@ static const size_t poly_end[] =
/* Compute sin (pi * X) for -0.25 <= X <= 0.5. */
-static long double
-lg_sinpi (long double x)
+static _Float128
+lg_sinpi (_Float128 x)
{
- if (x <= 0.25L)
+ if (x <= L(0.25))
return __sinl (M_PIl * x);
else
- return __cosl (M_PIl * (0.5L - x));
+ return __cosl (M_PIl * (L(0.5) - x));
}
/* Compute cos (pi * X) for -0.25 <= X <= 0.5. */
-static long double
-lg_cospi (long double x)
+static _Float128
+lg_cospi (_Float128 x)
{
- if (x <= 0.25L)
+ if (x <= L(0.25))
return __cosl (M_PIl * x);
else
- return __sinl (M_PIl * (0.5L - x));
+ return __sinl (M_PIl * (L(0.5) - x));
}
/* Compute cot (pi * X) for -0.25 <= X <= 0.5. */
-static long double
-lg_cotpi (long double x)
+static _Float128
+lg_cotpi (_Float128 x)
{
return lg_cospi (x) / lg_sinpi (x);
}
@@ -443,34 +443,34 @@ lg_cotpi (long double x)
/* Compute lgamma of a negative argument -50 < X < -2, setting
*SIGNGAMP accordingly. */
-long double
-__lgamma_negl (long double x, int *signgamp)
+_Float128
+__lgamma_negl (_Float128 x, int *signgamp)
{
/* Determine the half-integer region X lies in, handle exact
integers and determine the sign of the result. */
int i = __floorl (-2 * x);
if ((i & 1) == 0 && i == -2 * x)
- return 1.0L / 0.0L;
- long double xn = ((i & 1) == 0 ? -i / 2 : (-i - 1) / 2);
+ return L(1.0) / L(0.0);
+ _Float128 xn = ((i & 1) == 0 ? -i / 2 : (-i - 1) / 2);
i -= 4;
*signgamp = ((i & 2) == 0 ? -1 : 1);
SET_RESTORE_ROUNDL (FE_TONEAREST);
/* Expand around the zero X0 = X0_HI + X0_LO. */
- long double x0_hi = lgamma_zeros[i][0], x0_lo = lgamma_zeros[i][1];
- long double xdiff = x - x0_hi - x0_lo;
+ _Float128 x0_hi = lgamma_zeros[i][0], x0_lo = lgamma_zeros[i][1];
+ _Float128 xdiff = x - x0_hi - x0_lo;
/* For arguments in the range -3 to -2, use polynomial
approximations to an adjusted version of the gamma function. */
if (i < 2)
{
int j = __floorl (-8 * x) - 16;
- long double xm = (-33 - 2 * j) * 0.0625L;
- long double x_adj = x - xm;
+ _Float128 xm = (-33 - 2 * j) * L(0.0625);
+ _Float128 x_adj = x - xm;
size_t deg = poly_deg[j];
size_t end = poly_end[j];
- long double g = poly_coeff[end];
+ _Float128 g = poly_coeff[end];
for (size_t j = 1; j <= deg; j++)
g = g * x_adj + poly_coeff[end - j];
return __log1pl (g * xdiff / (x - xn));
@@ -478,9 +478,9 @@ __lgamma_negl (long double x, int *signgamp)
/* The result we want is log (sinpi (X0) / sinpi (X))
+ log (gamma (1 - X0) / gamma (1 - X)). */
- long double x_idiff = fabsl (xn - x), x0_idiff = fabsl (xn - x0_hi - x0_lo);
- long double log_sinpi_ratio;
- if (x0_idiff < x_idiff * 0.5L)
+ _Float128 x_idiff = fabsl (xn - x), x0_idiff = fabsl (xn - x0_hi - x0_lo);
+ _Float128 log_sinpi_ratio;
+ if (x0_idiff < x_idiff * L(0.5))
/* Use log not log1p to avoid inaccuracy from log1p of arguments
close to -1. */
log_sinpi_ratio = __ieee754_logl (lg_sinpi (x0_idiff)
@@ -490,29 +490,29 @@ __lgamma_negl (long double x, int *signgamp)
/* Use log1p not log to avoid inaccuracy from log of arguments
close to 1. X0DIFF2 has positive sign if X0 is further from
XN than X is from XN, negative sign otherwise. */
- long double x0diff2 = ((i & 1) == 0 ? xdiff : -xdiff) * 0.5L;
- long double sx0d2 = lg_sinpi (x0diff2);
- long double cx0d2 = lg_cospi (x0diff2);
+ _Float128 x0diff2 = ((i & 1) == 0 ? xdiff : -xdiff) * L(0.5);
+ _Float128 sx0d2 = lg_sinpi (x0diff2);
+ _Float128 cx0d2 = lg_cospi (x0diff2);
log_sinpi_ratio = __log1pl (2 * sx0d2
* (-sx0d2 + cx0d2 * lg_cotpi (x_idiff)));
}
- long double log_gamma_ratio;
- long double y0 = 1 - x0_hi;
- long double y0_eps = -x0_hi + (1 - y0) - x0_lo;
- long double y = 1 - x;
- long double y_eps = -x + (1 - y);
+ _Float128 log_gamma_ratio;
+ _Float128 y0 = 1 - x0_hi;
+ _Float128 y0_eps = -x0_hi + (1 - y0) - x0_lo;
+ _Float128 y = 1 - x;
+ _Float128 y_eps = -x + (1 - y);
/* We now wish to compute LOG_GAMMA_RATIO
= log (gamma (Y0 + Y0_EPS) / gamma (Y + Y_EPS)). XDIFF
accurately approximates the difference Y0 + Y0_EPS - Y -
Y_EPS. Use Stirling's approximation. First, we may need to
adjust into the range where Stirling's approximation is
sufficiently accurate. */
- long double log_gamma_adj = 0;
+ _Float128 log_gamma_adj = 0;
if (i < 20)
{
int n_up = (21 - i) / 2;
- long double ny0, ny0_eps, ny, ny_eps;
+ _Float128 ny0, ny0_eps, ny, ny_eps;
ny0 = y0 + n_up;
ny0_eps = y0 - (ny0 - n_up) + y0_eps;
y0 = ny0;
@@ -521,28 +521,28 @@ __lgamma_negl (long double x, int *signgamp)
ny_eps = y - (ny - n_up) + y_eps;
y = ny;
y_eps = ny_eps;
- long double prodm1 = __lgamma_productl (xdiff, y - n_up, y_eps, n_up);
+ _Float128 prodm1 = __lgamma_productl (xdiff, y - n_up, y_eps, n_up);
log_gamma_adj = -__log1pl (prodm1);
}
- long double log_gamma_high
+ _Float128 log_gamma_high
= (xdiff * __log1pl ((y0 - e_hi - e_lo + y0_eps) / e_hi)
- + (y - 0.5L + y_eps) * __log1pl (xdiff / y) + log_gamma_adj);
+ + (y - L(0.5) + y_eps) * __log1pl (xdiff / y) + log_gamma_adj);
/* Compute the sum of (B_2k / 2k(2k-1))(Y0^-(2k-1) - Y^-(2k-1)). */
- long double y0r = 1 / y0, yr = 1 / y;
- long double y0r2 = y0r * y0r, yr2 = yr * yr;
- long double rdiff = -xdiff / (y * y0);
- long double bterm[NCOEFF];
- long double dlast = rdiff, elast = rdiff * yr * (yr + y0r);
+ _Float128 y0r = 1 / y0, yr = 1 / y;
+ _Float128 y0r2 = y0r * y0r, yr2 = yr * yr;
+ _Float128 rdiff = -xdiff / (y * y0);
+ _Float128 bterm[NCOEFF];
+ _Float128 dlast = rdiff, elast = rdiff * yr * (yr + y0r);
bterm[0] = dlast * lgamma_coeff[0];
for (size_t j = 1; j < NCOEFF; j++)
{
- long double dnext = dlast * y0r2 + elast;
- long double enext = elast * yr2;
+ _Float128 dnext = dlast * y0r2 + elast;
+ _Float128 enext = elast * yr2;
bterm[j] = dnext * lgamma_coeff[j];
dlast = dnext;
elast = enext;
}
- long double log_gamma_low = 0;
+ _Float128 log_gamma_low = 0;
for (size_t j = 0; j < NCOEFF; j++)
log_gamma_low += bterm[NCOEFF - 1 - j];
log_gamma_ratio = log_gamma_high + log_gamma_low;
diff --git a/sysdeps/ieee754/ldbl-128/lgamma_productl.c b/sysdeps/ieee754/ldbl-128/lgamma_productl.c
index de67cbe665..38cc4bb12c 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_productl.c
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of 1 + (T / (X + X_EPS)), 1 + (T / (X + X_EPS +
1)), ..., 1 + (T / (X + X_EPS + N - 1)), minus 1. X is such that
@@ -56,24 +26,24 @@ mul_split (long double *hi, long double *lo, long double x, long double y)
X_EPS / X is small enough that factors quadratic in it can be
neglected. */
-long double
-__lgamma_productl (long double t, long double x, long double x_eps, int n)
+_Float128
+__lgamma_productl (_Float128 t, _Float128 x, _Float128 x_eps, int n)
{
- long double ret = 0, ret_eps = 0;
+ _Float128 ret = 0, ret_eps = 0;
for (int i = 0; i < n; i++)
{
- long double xi = x + i;
- long double quot = t / xi;
- long double mhi, mlo;
- mul_split (&mhi, &mlo, quot, xi);
- long double quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
+ _Float128 xi = x + i;
+ _Float128 quot = t / xi;
+ _Float128 mhi, mlo;
+ mul_splitl (&mhi, &mlo, quot, xi);
+ _Float128 quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
/* We want (1 + RET + RET_EPS) * (1 + QUOT + QUOT_LO) - 1. */
- long double rhi, rlo;
- mul_split (&rhi, &rlo, ret, quot);
- long double rpq = ret + quot;
- long double rpq_eps = (ret - rpq) + quot;
- long double nret = rpq + rhi;
- long double nret_eps = (rpq - nret) + rhi;
+ _Float128 rhi, rlo;
+ mul_splitl (&rhi, &rlo, ret, quot);
+ _Float128 rpq = ret + quot;
+ _Float128 rpq_eps = (ret - rpq) + quot;
+ _Float128 nret = rpq + rhi;
+ _Float128 nret_eps = (rpq - nret) + rhi;
ret_eps += (rpq_eps + nret_eps + rlo + ret_eps * quot
+ quot_lo + quot_lo * (ret + ret_eps));
ret = nret;
diff --git a/sysdeps/ieee754/ldbl-128/math_ldbl.h b/sysdeps/ieee754/ldbl-128/math_ldbl.h
index b3faa04846..c1980c9401 100644
--- a/sysdeps/ieee754/ldbl-128/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-128/math_ldbl.h
@@ -88,3 +88,11 @@ do { \
sh_u.value = (d); \
(v) = sh_u.parts64.lsw; \
} while (0)
+
+/*
+ On a platform already supporting a binary128 long double,
+ _Float128 will alias to long double. This transformation
+ makes aliasing *l functions to *f128 trivial.
+*/
+#define _Float128 long double
+#define L(x) x##L
diff --git a/sysdeps/ieee754/ldbl-128/s_asinhl.c b/sysdeps/ieee754/ldbl-128/s_asinhl.c
index 5f3b9f2c76..83efb34447 100644
--- a/sysdeps/ieee754/ldbl-128/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_asinhl.c
@@ -33,15 +33,15 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double
- one = 1.0L,
- ln2 = 6.931471805599453094172321214581765681e-1L,
- huge = 1.0e+4900L;
+static const _Float128
+ one = 1,
+ ln2 = L(6.931471805599453094172321214581765681e-1),
+ huge = L(1.0e+4900);
-long double
-__asinhl (long double x)
+_Float128
+__asinhl (_Float128 x)
{
- long double t, w;
+ _Float128 t, w;
int32_t ix, sign;
ieee854_long_double_shape_type u;
diff --git a/sysdeps/ieee754/ldbl-128/s_atanl.c b/sysdeps/ieee754/ldbl-128/s_atanl.c
index 35577a857c..6f2cd549ec 100644
--- a/sysdeps/ieee754/ldbl-128/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_atanl.c
@@ -64,91 +64,91 @@
#include <math_private.h>
/* arctan(k/8), k = 0, ..., 82 */
-static const long double atantbl[84] = {
- 0.0000000000000000000000000000000000000000E0L,
- 1.2435499454676143503135484916387102557317E-1L, /* arctan(0.125) */
- 2.4497866312686415417208248121127581091414E-1L,
- 3.5877067027057222039592006392646049977698E-1L,
- 4.6364760900080611621425623146121440202854E-1L,
- 5.5859931534356243597150821640166127034645E-1L,
- 6.4350110879328438680280922871732263804151E-1L,
- 7.1882999962162450541701415152590465395142E-1L,
- 7.8539816339744830961566084581987572104929E-1L,
- 8.4415398611317100251784414827164750652594E-1L,
- 8.9605538457134395617480071802993782702458E-1L,
- 9.4200004037946366473793717053459358607166E-1L,
- 9.8279372324732906798571061101466601449688E-1L,
- 1.0191413442663497346383429170230636487744E0L,
- 1.0516502125483736674598673120862998296302E0L,
- 1.0808390005411683108871567292171998202703E0L,
- 1.1071487177940905030170654601785370400700E0L,
- 1.1309537439791604464709335155363278047493E0L,
- 1.1525719972156675180401498626127513797495E0L,
- 1.1722738811284763866005949441337046149712E0L,
- 1.1902899496825317329277337748293183376012E0L,
- 1.2068173702852525303955115800565576303133E0L,
- 1.2220253232109896370417417439225704908830E0L,
- 1.2360594894780819419094519711090786987027E0L,
- 1.2490457723982544258299170772810901230778E0L,
- 1.2610933822524404193139408812473357720101E0L,
- 1.2722973952087173412961937498224804940684E0L,
- 1.2827408797442707473628852511364955306249E0L,
- 1.2924966677897852679030914214070816845853E0L,
- 1.3016288340091961438047858503666855921414E0L,
- 1.3101939350475556342564376891719053122733E0L,
- 1.3182420510168370498593302023271362531155E0L,
- 1.3258176636680324650592392104284756311844E0L,
- 1.3329603993374458675538498697331558093700E0L,
- 1.3397056595989995393283037525895557411039E0L,
- 1.3460851583802539310489409282517796256512E0L,
- 1.3521273809209546571891479413898128509842E0L,
- 1.3578579772154994751124898859640585287459E0L,
- 1.3633001003596939542892985278250991189943E0L,
- 1.3684746984165928776366381936948529556191E0L,
- 1.3734007669450158608612719264449611486510E0L,
- 1.3780955681325110444536609641291551522494E0L,
- 1.3825748214901258580599674177685685125566E0L,
- 1.3868528702577214543289381097042486034883E0L,
- 1.3909428270024183486427686943836432060856E0L,
- 1.3948567013423687823948122092044222644895E0L,
- 1.3986055122719575950126700816114282335732E0L,
- 1.4021993871854670105330304794336492676944E0L,
- 1.4056476493802697809521934019958079881002E0L,
- 1.4089588955564736949699075250792569287156E0L,
- 1.4121410646084952153676136718584891599630E0L,
- 1.4152014988178669079462550975833894394929E0L,
- 1.4181469983996314594038603039700989523716E0L,
- 1.4209838702219992566633046424614466661176E0L,
- 1.4237179714064941189018190466107297503086E0L,
- 1.4263547484202526397918060597281265695725E0L,
- 1.4288992721907326964184700745371983590908E0L,
- 1.4313562697035588982240194668401779312122E0L,
- 1.4337301524847089866404719096698873648610E0L,
- 1.4360250423171655234964275337155008780675E0L,
- 1.4382447944982225979614042479354815855386E0L,
- 1.4403930189057632173997301031392126865694E0L,
- 1.4424730991091018200252920599377292525125E0L,
- 1.4444882097316563655148453598508037025938E0L,
- 1.4464413322481351841999668424758804165254E0L,
- 1.4483352693775551917970437843145232637695E0L,
- 1.4501726582147939000905940595923466567576E0L,
- 1.4519559822271314199339700039142990228105E0L,
- 1.4536875822280323362423034480994649820285E0L,
- 1.4553696664279718992423082296859928222270E0L,
- 1.4570043196511885530074841089245667532358E0L,
- 1.4585935117976422128825857356750737658039E0L,
- 1.4601391056210009726721818194296893361233E0L,
- 1.4616428638860188872060496086383008594310E0L,
- 1.4631064559620759326975975316301202111560E0L,
- 1.4645314639038178118428450961503371619177E0L,
- 1.4659193880646627234129855241049975398470E0L,
- 1.4672716522843522691530527207287398276197E0L,
- 1.4685896086876430842559640450619880951144E0L,
- 1.4698745421276027686510391411132998919794E0L,
- 1.4711276743037345918528755717617308518553E0L,
- 1.4723501675822635384916444186631899205983E0L,
- 1.4735431285433308455179928682541563973416E0L, /* arctan(10.25) */
- 1.5707963267948966192313216916397514420986E0L /* pi/2 */
+static const _Float128 atantbl[84] = {
+ L(0.0000000000000000000000000000000000000000E0),
+ L(1.2435499454676143503135484916387102557317E-1), /* arctan(0.125) */
+ L(2.4497866312686415417208248121127581091414E-1),
+ L(3.5877067027057222039592006392646049977698E-1),
+ L(4.6364760900080611621425623146121440202854E-1),
+ L(5.5859931534356243597150821640166127034645E-1),
+ L(6.4350110879328438680280922871732263804151E-1),
+ L(7.1882999962162450541701415152590465395142E-1),
+ L(7.8539816339744830961566084581987572104929E-1),
+ L(8.4415398611317100251784414827164750652594E-1),
+ L(8.9605538457134395617480071802993782702458E-1),
+ L(9.4200004037946366473793717053459358607166E-1),
+ L(9.8279372324732906798571061101466601449688E-1),
+ L(1.0191413442663497346383429170230636487744E0),
+ L(1.0516502125483736674598673120862998296302E0),
+ L(1.0808390005411683108871567292171998202703E0),
+ L(1.1071487177940905030170654601785370400700E0),
+ L(1.1309537439791604464709335155363278047493E0),
+ L(1.1525719972156675180401498626127513797495E0),
+ L(1.1722738811284763866005949441337046149712E0),
+ L(1.1902899496825317329277337748293183376012E0),
+ L(1.2068173702852525303955115800565576303133E0),
+ L(1.2220253232109896370417417439225704908830E0),
+ L(1.2360594894780819419094519711090786987027E0),
+ L(1.2490457723982544258299170772810901230778E0),
+ L(1.2610933822524404193139408812473357720101E0),
+ L(1.2722973952087173412961937498224804940684E0),
+ L(1.2827408797442707473628852511364955306249E0),
+ L(1.2924966677897852679030914214070816845853E0),
+ L(1.3016288340091961438047858503666855921414E0),
+ L(1.3101939350475556342564376891719053122733E0),
+ L(1.3182420510168370498593302023271362531155E0),
+ L(1.3258176636680324650592392104284756311844E0),
+ L(1.3329603993374458675538498697331558093700E0),
+ L(1.3397056595989995393283037525895557411039E0),
+ L(1.3460851583802539310489409282517796256512E0),
+ L(1.3521273809209546571891479413898128509842E0),
+ L(1.3578579772154994751124898859640585287459E0),
+ L(1.3633001003596939542892985278250991189943E0),
+ L(1.3684746984165928776366381936948529556191E0),
+ L(1.3734007669450158608612719264449611486510E0),
+ L(1.3780955681325110444536609641291551522494E0),
+ L(1.3825748214901258580599674177685685125566E0),
+ L(1.3868528702577214543289381097042486034883E0),
+ L(1.3909428270024183486427686943836432060856E0),
+ L(1.3948567013423687823948122092044222644895E0),
+ L(1.3986055122719575950126700816114282335732E0),
+ L(1.4021993871854670105330304794336492676944E0),
+ L(1.4056476493802697809521934019958079881002E0),
+ L(1.4089588955564736949699075250792569287156E0),
+ L(1.4121410646084952153676136718584891599630E0),
+ L(1.4152014988178669079462550975833894394929E0),
+ L(1.4181469983996314594038603039700989523716E0),
+ L(1.4209838702219992566633046424614466661176E0),
+ L(1.4237179714064941189018190466107297503086E0),
+ L(1.4263547484202526397918060597281265695725E0),
+ L(1.4288992721907326964184700745371983590908E0),
+ L(1.4313562697035588982240194668401779312122E0),
+ L(1.4337301524847089866404719096698873648610E0),
+ L(1.4360250423171655234964275337155008780675E0),
+ L(1.4382447944982225979614042479354815855386E0),
+ L(1.4403930189057632173997301031392126865694E0),
+ L(1.4424730991091018200252920599377292525125E0),
+ L(1.4444882097316563655148453598508037025938E0),
+ L(1.4464413322481351841999668424758804165254E0),
+ L(1.4483352693775551917970437843145232637695E0),
+ L(1.4501726582147939000905940595923466567576E0),
+ L(1.4519559822271314199339700039142990228105E0),
+ L(1.4536875822280323362423034480994649820285E0),
+ L(1.4553696664279718992423082296859928222270E0),
+ L(1.4570043196511885530074841089245667532358E0),
+ L(1.4585935117976422128825857356750737658039E0),
+ L(1.4601391056210009726721818194296893361233E0),
+ L(1.4616428638860188872060496086383008594310E0),
+ L(1.4631064559620759326975975316301202111560E0),
+ L(1.4645314639038178118428450961503371619177E0),
+ L(1.4659193880646627234129855241049975398470E0),
+ L(1.4672716522843522691530527207287398276197E0),
+ L(1.4685896086876430842559640450619880951144E0),
+ L(1.4698745421276027686510391411132998919794E0),
+ L(1.4711276743037345918528755717617308518553E0),
+ L(1.4723501675822635384916444186631899205983E0),
+ L(1.4735431285433308455179928682541563973416E0), /* arctan(10.25) */
+ L(1.5707963267948966192313216916397514420986E0) /* pi/2 */
};
@@ -156,26 +156,26 @@ static const long double atantbl[84] = {
|t| <= 0.09375
peak relative error 5.3e-37 */
-static const long double
- p0 = -4.283708356338736809269381409828726405572E1L,
- p1 = -8.636132499244548540964557273544599863825E1L,
- p2 = -5.713554848244551350855604111031839613216E1L,
- p3 = -1.371405711877433266573835355036413750118E1L,
- p4 = -8.638214309119210906997318946650189640184E-1L,
- q0 = 1.285112506901621042780814422948906537959E2L,
- q1 = 3.361907253914337187957855834229672347089E2L,
- q2 = 3.180448303864130128268191635189365331680E2L,
- q3 = 1.307244136980865800160844625025280344686E2L,
- q4 = 2.173623741810414221251136181221172551416E1L;
+static const _Float128
+ p0 = L(-4.283708356338736809269381409828726405572E1),
+ p1 = L(-8.636132499244548540964557273544599863825E1),
+ p2 = L(-5.713554848244551350855604111031839613216E1),
+ p3 = L(-1.371405711877433266573835355036413750118E1),
+ p4 = L(-8.638214309119210906997318946650189640184E-1),
+ q0 = L(1.285112506901621042780814422948906537959E2),
+ q1 = L(3.361907253914337187957855834229672347089E2),
+ q2 = L(3.180448303864130128268191635189365331680E2),
+ q3 = L(1.307244136980865800160844625025280344686E2),
+ q4 = L(2.173623741810414221251136181221172551416E1);
/* q5 = 1.000000000000000000000000000000000000000E0 */
-static const long double huge = 1.0e4930L;
+static const _Float128 huge = L(1.0e4930);
-long double
-__atanl (long double x)
+_Float128
+__atanl (_Float128 x)
{
int k, sign;
- long double t, u, p, q;
+ _Float128 t, u, p, q;
ieee854_long_double_shape_type s;
s.value = x;
@@ -231,7 +231,7 @@ __atanl (long double x)
Roundoff to integer is asymmetrical to avoid cancellation when t < 0
(cf. fdlibm). */
k = 8.0 * x + 0.25;
- u = 0.125L * k;
+ u = L(0.125) * k;
/* Small arctan argument. */
t = (x - u) / (1.0 + x * u);
}
diff --git a/sysdeps/ieee754/ldbl-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
index c3ae96830e..eb88d29fc9 100644
--- a/sysdeps/ieee754/ldbl-128/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
@@ -57,17 +57,17 @@ Adapted for glibc October, 2001.
#include <math.h>
#include <math_private.h>
-static const long double CBRT2 = 1.259921049894873164767210607278228350570251L;
-static const long double CBRT4 = 1.587401051968199474751705639272308260391493L;
-static const long double CBRT2I = 0.7937005259840997373758528196361541301957467L;
-static const long double CBRT4I = 0.6299605249474365823836053036391141752851257L;
+static const _Float128 CBRT2 = L(1.259921049894873164767210607278228350570251);
+static const _Float128 CBRT4 = L(1.587401051968199474751705639272308260391493);
+static const _Float128 CBRT2I = L(0.7937005259840997373758528196361541301957467);
+static const _Float128 CBRT4I = L(0.6299605249474365823836053036391141752851257);
-long double
-__cbrtl (long double x)
+_Float128
+__cbrtl (_Float128 x)
{
int e, rem, sign;
- long double z;
+ _Float128 z;
if (!isfinite (x))
return x + x;
@@ -89,11 +89,11 @@ __cbrtl (long double x)
/* Approximate cube root of number between .5 and 1,
peak relative error = 1.2e-6 */
- x = ((((1.3584464340920900529734e-1L * x
- - 6.3986917220457538402318e-1L) * x
- + 1.2875551670318751538055e0L) * x
- - 1.4897083391357284957891e0L) * x
- + 1.3304961236013647092521e0L) * x + 3.7568280825958912391243e-1L;
+ x = ((((L(1.3584464340920900529734e-1) * x
+ - L(6.3986917220457538402318e-1)) * x
+ + L(1.2875551670318751538055e0)) * x
+ - L(1.4897083391357284957891e0)) * x
+ + L(1.3304961236013647092521e0)) * x + L(3.7568280825958912391243e-1);
/* exponent divided by 3 */
if (e >= 0)
@@ -123,9 +123,9 @@ __cbrtl (long double x)
x = __ldexpl (x, e);
/* Newton iteration */
- x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
- x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
- x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+ x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+ x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+ x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
if (sign < 0)
x = -x;
diff --git a/sysdeps/ieee754/ldbl-128/s_ceill.c b/sysdeps/ieee754/ldbl-128/s_ceill.c
index 6b736733c1..8034795072 100644
--- a/sysdeps/ieee754/ldbl-128/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128/s_ceill.c
@@ -27,7 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-long double __ceill(long double x)
+_Float128 __ceill(_Float128 x)
{
int64_t i0,i1,j0;
u_int64_t i,j;
diff --git a/sysdeps/ieee754/ldbl-128/s_copysignl.c b/sysdeps/ieee754/ldbl-128/s_copysignl.c
index 19b6880940..8ee85ea8f7 100644
--- a/sysdeps/ieee754/ldbl-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-128/s_copysignl.c
@@ -26,7 +26,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-long double __copysignl(long double x, long double y)
+_Float128 __copysignl(_Float128 x, _Float128 y)
{
u_int64_t hx,hy;
GET_LDOUBLE_MSW64(hx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c
index 2c3bff6e0f..ed3e77d0db 100644
--- a/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -48,9 +48,9 @@
#include <math.h>
#include <math_private.h>
-long double __cosl(long double x)
+_Float128 __cosl(_Float128 x)
{
- long double y[2],z=0.0L;
+ _Float128 y[2],z=0;
int64_t n, ix;
/* High word of x. */
diff --git a/sysdeps/ieee754/ldbl-128/s_erfl.c b/sysdeps/ieee754/ldbl-128/s_erfl.c
index dd275a7dd9..e5dfae9636 100644
--- a/sysdeps/ieee754/ldbl-128/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_erfl.c
@@ -103,10 +103,10 @@
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -121,10 +121,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -138,42 +138,42 @@ deval (long double x, const long double *p, int n)
-static const long double
-tiny = 1e-4931L,
- one = 1.0L,
- two = 2.0L,
+static const _Float128
+tiny = L(1e-4931),
+ one = 1,
+ two = 2,
/* 2/sqrt(pi) - 1 */
- efx = 1.2837916709551257389615890312154517168810E-1L;
+ efx = L(1.2837916709551257389615890312154517168810E-1);
/* erf(x) = x + x R(x^2)
0 <= x <= 7/8
Peak relative error 1.8e-35 */
#define NTN1 8
-static const long double TN1[NTN1 + 1] =
-{
- -3.858252324254637124543172907442106422373E10L,
- 9.580319248590464682316366876952214879858E10L,
- 1.302170519734879977595901236693040544854E10L,
- 2.922956950426397417800321486727032845006E9L,
- 1.764317520783319397868923218385468729799E8L,
- 1.573436014601118630105796794840834145120E7L,
- 4.028077380105721388745632295157816229289E5L,
- 1.644056806467289066852135096352853491530E4L,
- 3.390868480059991640235675479463287886081E1L
+static const _Float128 TN1[NTN1 + 1] =
+{
+ L(-3.858252324254637124543172907442106422373E10),
+ L(9.580319248590464682316366876952214879858E10),
+ L(1.302170519734879977595901236693040544854E10),
+ L(2.922956950426397417800321486727032845006E9),
+ L(1.764317520783319397868923218385468729799E8),
+ L(1.573436014601118630105796794840834145120E7),
+ L(4.028077380105721388745632295157816229289E5),
+ L(1.644056806467289066852135096352853491530E4),
+ L(3.390868480059991640235675479463287886081E1)
};
#define NTD1 8
-static const long double TD1[NTD1 + 1] =
-{
- -3.005357030696532927149885530689529032152E11L,
- -1.342602283126282827411658673839982164042E11L,
- -2.777153893355340961288511024443668743399E10L,
- -3.483826391033531996955620074072768276974E9L,
- -2.906321047071299585682722511260895227921E8L,
- -1.653347985722154162439387878512427542691E7L,
- -6.245520581562848778466500301865173123136E5L,
- -1.402124304177498828590239373389110545142E4L,
- -1.209368072473510674493129989468348633579E2L
+static const _Float128 TD1[NTD1 + 1] =
+{
+ L(-3.005357030696532927149885530689529032152E11),
+ L(-1.342602283126282827411658673839982164042E11),
+ L(-2.777153893355340961288511024443668743399E10),
+ L(-3.483826391033531996955620074072768276974E9),
+ L(-2.906321047071299585682722511260895227921E8),
+ L(-1.653347985722154162439387878512427542691E7),
+ L(-6.245520581562848778466500301865173123136E5),
+ L(-1.402124304177498828590239373389110545142E4),
+ L(-1.209368072473510674493129989468348633579E2)
/* 1.0E0 */
};
@@ -181,32 +181,32 @@ static const long double TD1[NTD1 + 1] =
/* erf(z+1) = erf_const + P(z)/Q(z)
-.125 <= z <= 0
Peak relative error 7.3e-36 */
-static const long double erf_const = 0.845062911510467529296875L;
+static const _Float128 erf_const = L(0.845062911510467529296875);
#define NTN2 8
-static const long double TN2[NTN2 + 1] =
-{
- -4.088889697077485301010486931817357000235E1L,
- 7.157046430681808553842307502826960051036E3L,
- -2.191561912574409865550015485451373731780E3L,
- 2.180174916555316874988981177654057337219E3L,
- 2.848578658049670668231333682379720943455E2L,
- 1.630362490952512836762810462174798925274E2L,
- 6.317712353961866974143739396865293596895E0L,
- 2.450441034183492434655586496522857578066E1L,
- 5.127662277706787664956025545897050896203E-1L
+static const _Float128 TN2[NTN2 + 1] =
+{
+ L(-4.088889697077485301010486931817357000235E1),
+ L(7.157046430681808553842307502826960051036E3),
+ L(-2.191561912574409865550015485451373731780E3),
+ L(2.180174916555316874988981177654057337219E3),
+ L(2.848578658049670668231333682379720943455E2),
+ L(1.630362490952512836762810462174798925274E2),
+ L(6.317712353961866974143739396865293596895E0),
+ L(2.450441034183492434655586496522857578066E1),
+ L(5.127662277706787664956025545897050896203E-1)
};
#define NTD2 8
-static const long double TD2[NTD2 + 1] =
-{
- 1.731026445926834008273768924015161048885E4L,
- 1.209682239007990370796112604286048173750E4L,
- 1.160950290217993641320602282462976163857E4L,
- 5.394294645127126577825507169061355698157E3L,
- 2.791239340533632669442158497532521776093E3L,
- 8.989365571337319032943005387378993827684E2L,
- 2.974016493766349409725385710897298069677E2L,
- 6.148192754590376378740261072533527271947E1L,
- 1.178502892490738445655468927408440847480E1L
+static const _Float128 TD2[NTD2 + 1] =
+{
+ L(1.731026445926834008273768924015161048885E4),
+ L(1.209682239007990370796112604286048173750E4),
+ L(1.160950290217993641320602282462976163857E4),
+ L(5.394294645127126577825507169061355698157E3),
+ L(2.791239340533632669442158497532521776093E3),
+ L(8.989365571337319032943005387378993827684E2),
+ L(2.974016493766349409725385710897298069677E2),
+ L(6.148192754590376378740261072533527271947E1),
+ L(1.178502892490738445655468927408440847480E1)
/* 1.0E0 */
};
@@ -215,297 +215,297 @@ static const long double TD2[NTD2 + 1] =
0 <= x < 0.125
Peak relative error 1.4e-35 */
#define NRNr13 8
-static const long double RNr13[NRNr13 + 1] =
-{
- -2.353707097641280550282633036456457014829E3L,
- 3.871159656228743599994116143079870279866E2L,
- -3.888105134258266192210485617504098426679E2L,
- -2.129998539120061668038806696199343094971E1L,
- -8.125462263594034672468446317145384108734E1L,
- 8.151549093983505810118308635926270319660E0L,
- -5.033362032729207310462422357772568553670E0L,
- -4.253956621135136090295893547735851168471E-2L,
- -8.098602878463854789780108161581050357814E-2L
+static const _Float128 RNr13[NRNr13 + 1] =
+{
+ L(-2.353707097641280550282633036456457014829E3),
+ L(3.871159656228743599994116143079870279866E2),
+ L(-3.888105134258266192210485617504098426679E2),
+ L(-2.129998539120061668038806696199343094971E1),
+ L(-8.125462263594034672468446317145384108734E1),
+ L(8.151549093983505810118308635926270319660E0),
+ L(-5.033362032729207310462422357772568553670E0),
+ L(-4.253956621135136090295893547735851168471E-2),
+ L(-8.098602878463854789780108161581050357814E-2)
};
#define NRDr13 7
-static const long double RDr13[NRDr13 + 1] =
-{
- 2.220448796306693503549505450626652881752E3L,
- 1.899133258779578688791041599040951431383E2L,
- 1.061906712284961110196427571557149268454E3L,
- 7.497086072306967965180978101974566760042E1L,
- 2.146796115662672795876463568170441327274E2L,
- 1.120156008362573736664338015952284925592E1L,
- 2.211014952075052616409845051695042741074E1L,
- 6.469655675326150785692908453094054988938E-1L
+static const _Float128 RDr13[NRDr13 + 1] =
+{
+ L(2.220448796306693503549505450626652881752E3),
+ L(1.899133258779578688791041599040951431383E2),
+ L(1.061906712284961110196427571557149268454E3),
+ L(7.497086072306967965180978101974566760042E1),
+ L(2.146796115662672795876463568170441327274E2),
+ L(1.120156008362573736664338015952284925592E1),
+ L(2.211014952075052616409845051695042741074E1),
+ L(6.469655675326150785692908453094054988938E-1)
/* 1.0E0 */
};
/* erfc(0.25) = C13a + C13b to extra precision. */
-static const long double C13a = 0.723663330078125L;
-static const long double C13b = 1.0279753638067014931732235184287934646022E-5L;
+static const _Float128 C13a = L(0.723663330078125);
+static const _Float128 C13b = L(1.0279753638067014931732235184287934646022E-5);
/* erfc(x + 0.375) = erfc(0.375) + x R(x)
0 <= x < 0.125
Peak relative error 1.2e-35 */
#define NRNr14 8
-static const long double RNr14[NRNr14 + 1] =
-{
- -2.446164016404426277577283038988918202456E3L,
- 6.718753324496563913392217011618096698140E2L,
- -4.581631138049836157425391886957389240794E2L,
- -2.382844088987092233033215402335026078208E1L,
- -7.119237852400600507927038680970936336458E1L,
- 1.313609646108420136332418282286454287146E1L,
- -6.188608702082264389155862490056401365834E0L,
- -2.787116601106678287277373011101132659279E-2L,
- -2.230395570574153963203348263549700967918E-2L
+static const _Float128 RNr14[NRNr14 + 1] =
+{
+ L(-2.446164016404426277577283038988918202456E3),
+ L(6.718753324496563913392217011618096698140E2),
+ L(-4.581631138049836157425391886957389240794E2),
+ L(-2.382844088987092233033215402335026078208E1),
+ L(-7.119237852400600507927038680970936336458E1),
+ L(1.313609646108420136332418282286454287146E1),
+ L(-6.188608702082264389155862490056401365834E0),
+ L(-2.787116601106678287277373011101132659279E-2),
+ L(-2.230395570574153963203348263549700967918E-2)
};
#define NRDr14 7
-static const long double RDr14[NRDr14 + 1] =
-{
- 2.495187439241869732696223349840963702875E3L,
- 2.503549449872925580011284635695738412162E2L,
- 1.159033560988895481698051531263861842461E3L,
- 9.493751466542304491261487998684383688622E1L,
- 2.276214929562354328261422263078480321204E2L,
- 1.367697521219069280358984081407807931847E1L,
- 2.276988395995528495055594829206582732682E1L,
- 7.647745753648996559837591812375456641163E-1L
+static const _Float128 RDr14[NRDr14 + 1] =
+{
+ L(2.495187439241869732696223349840963702875E3),
+ L(2.503549449872925580011284635695738412162E2),
+ L(1.159033560988895481698051531263861842461E3),
+ L(9.493751466542304491261487998684383688622E1),
+ L(2.276214929562354328261422263078480321204E2),
+ L(1.367697521219069280358984081407807931847E1),
+ L(2.276988395995528495055594829206582732682E1),
+ L(7.647745753648996559837591812375456641163E-1)
/* 1.0E0 */
};
/* erfc(0.375) = C14a + C14b to extra precision. */
-static const long double C14a = 0.5958709716796875L;
-static const long double C14b = 1.2118885490201676174914080878232469565953E-5L;
+static const _Float128 C14a = L(0.5958709716796875);
+static const _Float128 C14b = L(1.2118885490201676174914080878232469565953E-5);
/* erfc(x + 0.5) = erfc(0.5) + x R(x)
0 <= x < 0.125
Peak relative error 4.7e-36 */
#define NRNr15 8
-static const long double RNr15[NRNr15 + 1] =
-{
- -2.624212418011181487924855581955853461925E3L,
- 8.473828904647825181073831556439301342756E2L,
- -5.286207458628380765099405359607331669027E2L,
- -3.895781234155315729088407259045269652318E1L,
- -6.200857908065163618041240848728398496256E1L,
- 1.469324610346924001393137895116129204737E1L,
- -6.961356525370658572800674953305625578903E0L,
- 5.145724386641163809595512876629030548495E-3L,
- 1.990253655948179713415957791776180406812E-2L
+static const _Float128 RNr15[NRNr15 + 1] =
+{
+ L(-2.624212418011181487924855581955853461925E3),
+ L(8.473828904647825181073831556439301342756E2),
+ L(-5.286207458628380765099405359607331669027E2),
+ L(-3.895781234155315729088407259045269652318E1),
+ L(-6.200857908065163618041240848728398496256E1),
+ L(1.469324610346924001393137895116129204737E1),
+ L(-6.961356525370658572800674953305625578903E0),
+ L(5.145724386641163809595512876629030548495E-3),
+ L(1.990253655948179713415957791776180406812E-2)
};
#define NRDr15 7
-static const long double RDr15[NRDr15 + 1] =
-{
- 2.986190760847974943034021764693341524962E3L,
- 5.288262758961073066335410218650047725985E2L,
- 1.363649178071006978355113026427856008978E3L,
- 1.921707975649915894241864988942255320833E2L,
- 2.588651100651029023069013885900085533226E2L,
- 2.628752920321455606558942309396855629459E1L,
- 2.455649035885114308978333741080991380610E1L,
- 1.378826653595128464383127836412100939126E0L
+static const _Float128 RDr15[NRDr15 + 1] =
+{
+ L(2.986190760847974943034021764693341524962E3),
+ L(5.288262758961073066335410218650047725985E2),
+ L(1.363649178071006978355113026427856008978E3),
+ L(1.921707975649915894241864988942255320833E2),
+ L(2.588651100651029023069013885900085533226E2),
+ L(2.628752920321455606558942309396855629459E1),
+ L(2.455649035885114308978333741080991380610E1),
+ L(1.378826653595128464383127836412100939126E0)
/* 1.0E0 */
};
/* erfc(0.5) = C15a + C15b to extra precision. */
-static const long double C15a = 0.4794921875L;
-static const long double C15b = 7.9346869534623172533461080354712635484242E-6L;
+static const _Float128 C15a = L(0.4794921875);
+static const _Float128 C15b = L(7.9346869534623172533461080354712635484242E-6);
/* erfc(x + 0.625) = erfc(0.625) + x R(x)
0 <= x < 0.125
Peak relative error 5.1e-36 */
#define NRNr16 8
-static const long double RNr16[NRNr16 + 1] =
-{
- -2.347887943200680563784690094002722906820E3L,
- 8.008590660692105004780722726421020136482E2L,
- -5.257363310384119728760181252132311447963E2L,
- -4.471737717857801230450290232600243795637E1L,
- -4.849540386452573306708795324759300320304E1L,
- 1.140885264677134679275986782978655952843E1L,
- -6.731591085460269447926746876983786152300E0L,
- 1.370831653033047440345050025876085121231E-1L,
- 2.022958279982138755020825717073966576670E-2L,
+static const _Float128 RNr16[NRNr16 + 1] =
+{
+ L(-2.347887943200680563784690094002722906820E3),
+ L(8.008590660692105004780722726421020136482E2),
+ L(-5.257363310384119728760181252132311447963E2),
+ L(-4.471737717857801230450290232600243795637E1),
+ L(-4.849540386452573306708795324759300320304E1),
+ L(1.140885264677134679275986782978655952843E1),
+ L(-6.731591085460269447926746876983786152300E0),
+ L(1.370831653033047440345050025876085121231E-1),
+ L(2.022958279982138755020825717073966576670E-2),
};
#define NRDr16 7
-static const long double RDr16[NRDr16 + 1] =
-{
- 3.075166170024837215399323264868308087281E3L,
- 8.730468942160798031608053127270430036627E2L,
- 1.458472799166340479742581949088453244767E3L,
- 3.230423687568019709453130785873540386217E2L,
- 2.804009872719893612081109617983169474655E2L,
- 4.465334221323222943418085830026979293091E1L,
- 2.612723259683205928103787842214809134746E1L,
- 2.341526751185244109722204018543276124997E0L,
+static const _Float128 RDr16[NRDr16 + 1] =
+{
+ L(3.075166170024837215399323264868308087281E3),
+ L(8.730468942160798031608053127270430036627E2),
+ L(1.458472799166340479742581949088453244767E3),
+ L(3.230423687568019709453130785873540386217E2),
+ L(2.804009872719893612081109617983169474655E2),
+ L(4.465334221323222943418085830026979293091E1),
+ L(2.612723259683205928103787842214809134746E1),
+ L(2.341526751185244109722204018543276124997E0),
/* 1.0E0 */
};
/* erfc(0.625) = C16a + C16b to extra precision. */
-static const long double C16a = 0.3767547607421875L;
-static const long double C16b = 4.3570693945275513594941232097252997287766E-6L;
+static const _Float128 C16a = L(0.3767547607421875);
+static const _Float128 C16b = L(4.3570693945275513594941232097252997287766E-6);
/* erfc(x + 0.75) = erfc(0.75) + x R(x)
0 <= x < 0.125
Peak relative error 1.7e-35 */
#define NRNr17 8
-static const long double RNr17[NRNr17 + 1] =
-{
- -1.767068734220277728233364375724380366826E3L,
- 6.693746645665242832426891888805363898707E2L,
- -4.746224241837275958126060307406616817753E2L,
- -2.274160637728782675145666064841883803196E1L,
- -3.541232266140939050094370552538987982637E1L,
- 6.988950514747052676394491563585179503865E0L,
- -5.807687216836540830881352383529281215100E0L,
- 3.631915988567346438830283503729569443642E-1L,
- -1.488945487149634820537348176770282391202E-2L
+static const _Float128 RNr17[NRNr17 + 1] =
+{
+ L(-1.767068734220277728233364375724380366826E3),
+ L(6.693746645665242832426891888805363898707E2),
+ L(-4.746224241837275958126060307406616817753E2),
+ L(-2.274160637728782675145666064841883803196E1),
+ L(-3.541232266140939050094370552538987982637E1),
+ L(6.988950514747052676394491563585179503865E0),
+ L(-5.807687216836540830881352383529281215100E0),
+ L(3.631915988567346438830283503729569443642E-1),
+ L(-1.488945487149634820537348176770282391202E-2)
};
#define NRDr17 7
-static const long double RDr17[NRDr17 + 1] =
-{
- 2.748457523498150741964464942246913394647E3L,
- 1.020213390713477686776037331757871252652E3L,
- 1.388857635935432621972601695296561952738E3L,
- 3.903363681143817750895999579637315491087E2L,
- 2.784568344378139499217928969529219886578E2L,
- 5.555800830216764702779238020065345401144E1L,
- 2.646215470959050279430447295801291168941E1L,
- 2.984905282103517497081766758550112011265E0L,
+static const _Float128 RDr17[NRDr17 + 1] =
+{
+ L(2.748457523498150741964464942246913394647E3),
+ L(1.020213390713477686776037331757871252652E3),
+ L(1.388857635935432621972601695296561952738E3),
+ L(3.903363681143817750895999579637315491087E2),
+ L(2.784568344378139499217928969529219886578E2),
+ L(5.555800830216764702779238020065345401144E1),
+ L(2.646215470959050279430447295801291168941E1),
+ L(2.984905282103517497081766758550112011265E0),
/* 1.0E0 */
};
/* erfc(0.75) = C17a + C17b to extra precision. */
-static const long double C17a = 0.2888336181640625L;
-static const long double C17b = 1.0748182422368401062165408589222625794046E-5L;
+static const _Float128 C17a = L(0.2888336181640625);
+static const _Float128 C17b = L(1.0748182422368401062165408589222625794046E-5);
/* erfc(x + 0.875) = erfc(0.875) + x R(x)
0 <= x < 0.125
Peak relative error 2.2e-35 */
#define NRNr18 8
-static const long double RNr18[NRNr18 + 1] =
-{
- -1.342044899087593397419622771847219619588E3L,
- 6.127221294229172997509252330961641850598E2L,
- -4.519821356522291185621206350470820610727E2L,
- 1.223275177825128732497510264197915160235E1L,
- -2.730789571382971355625020710543532867692E1L,
- 4.045181204921538886880171727755445395862E0L,
- -4.925146477876592723401384464691452700539E0L,
- 5.933878036611279244654299924101068088582E-1L,
- -5.557645435858916025452563379795159124753E-2L
+static const _Float128 RNr18[NRNr18 + 1] =
+{
+ L(-1.342044899087593397419622771847219619588E3),
+ L(6.127221294229172997509252330961641850598E2),
+ L(-4.519821356522291185621206350470820610727E2),
+ L(1.223275177825128732497510264197915160235E1),
+ L(-2.730789571382971355625020710543532867692E1),
+ L(4.045181204921538886880171727755445395862E0),
+ L(-4.925146477876592723401384464691452700539E0),
+ L(5.933878036611279244654299924101068088582E-1),
+ L(-5.557645435858916025452563379795159124753E-2)
};
#define NRDr18 7
-static const long double RDr18[NRDr18 + 1] =
-{
- 2.557518000661700588758505116291983092951E3L,
- 1.070171433382888994954602511991940418588E3L,
- 1.344842834423493081054489613250688918709E3L,
- 4.161144478449381901208660598266288188426E2L,
- 2.763670252219855198052378138756906980422E2L,
- 5.998153487868943708236273854747564557632E1L,
- 2.657695108438628847733050476209037025318E1L,
- 3.252140524394421868923289114410336976512E0L,
+static const _Float128 RDr18[NRDr18 + 1] =
+{
+ L(2.557518000661700588758505116291983092951E3),
+ L(1.070171433382888994954602511991940418588E3),
+ L(1.344842834423493081054489613250688918709E3),
+ L(4.161144478449381901208660598266288188426E2),
+ L(2.763670252219855198052378138756906980422E2),
+ L(5.998153487868943708236273854747564557632E1),
+ L(2.657695108438628847733050476209037025318E1),
+ L(3.252140524394421868923289114410336976512E0),
/* 1.0E0 */
};
/* erfc(0.875) = C18a + C18b to extra precision. */
-static const long double C18a = 0.215911865234375L;
-static const long double C18b = 1.3073705765341685464282101150637224028267E-5L;
+static const _Float128 C18a = L(0.215911865234375);
+static const _Float128 C18b = L(1.3073705765341685464282101150637224028267E-5);
/* erfc(x + 1.0) = erfc(1.0) + x R(x)
0 <= x < 0.125
Peak relative error 1.6e-35 */
#define NRNr19 8
-static const long double RNr19[NRNr19 + 1] =
-{
- -1.139180936454157193495882956565663294826E3L,
- 6.134903129086899737514712477207945973616E2L,
- -4.628909024715329562325555164720732868263E2L,
- 4.165702387210732352564932347500364010833E1L,
- -2.286979913515229747204101330405771801610E1L,
- 1.870695256449872743066783202326943667722E0L,
- -4.177486601273105752879868187237000032364E0L,
- 7.533980372789646140112424811291782526263E-1L,
- -8.629945436917752003058064731308767664446E-2L
+static const _Float128 RNr19[NRNr19 + 1] =
+{
+ L(-1.139180936454157193495882956565663294826E3),
+ L(6.134903129086899737514712477207945973616E2),
+ L(-4.628909024715329562325555164720732868263E2),
+ L(4.165702387210732352564932347500364010833E1),
+ L(-2.286979913515229747204101330405771801610E1),
+ L(1.870695256449872743066783202326943667722E0),
+ L(-4.177486601273105752879868187237000032364E0),
+ L(7.533980372789646140112424811291782526263E-1),
+ L(-8.629945436917752003058064731308767664446E-2)
};
#define NRDr19 7
-static const long double RDr19[NRDr19 + 1] =
-{
- 2.744303447981132701432716278363418643778E3L,
- 1.266396359526187065222528050591302171471E3L,
- 1.466739461422073351497972255511919814273E3L,
- 4.868710570759693955597496520298058147162E2L,
- 2.993694301559756046478189634131722579643E2L,
- 6.868976819510254139741559102693828237440E1L,
- 2.801505816247677193480190483913753613630E1L,
- 3.604439909194350263552750347742663954481E0L,
+static const _Float128 RDr19[NRDr19 + 1] =
+{
+ L(2.744303447981132701432716278363418643778E3),
+ L(1.266396359526187065222528050591302171471E3),
+ L(1.466739461422073351497972255511919814273E3),
+ L(4.868710570759693955597496520298058147162E2),
+ L(2.993694301559756046478189634131722579643E2),
+ L(6.868976819510254139741559102693828237440E1),
+ L(2.801505816247677193480190483913753613630E1),
+ L(3.604439909194350263552750347742663954481E0),
/* 1.0E0 */
};
/* erfc(1.0) = C19a + C19b to extra precision. */
-static const long double C19a = 0.15728759765625L;
-static const long double C19b = 1.1609394035130658779364917390740703933002E-5L;
+static const _Float128 C19a = L(0.15728759765625);
+static const _Float128 C19b = L(1.1609394035130658779364917390740703933002E-5);
/* erfc(x + 1.125) = erfc(1.125) + x R(x)
0 <= x < 0.125
Peak relative error 3.6e-36 */
#define NRNr20 8
-static const long double RNr20[NRNr20 + 1] =
-{
- -9.652706916457973956366721379612508047640E2L,
- 5.577066396050932776683469951773643880634E2L,
- -4.406335508848496713572223098693575485978E2L,
- 5.202893466490242733570232680736966655434E1L,
- -1.931311847665757913322495948705563937159E1L,
- -9.364318268748287664267341457164918090611E-2L,
- -3.306390351286352764891355375882586201069E0L,
- 7.573806045289044647727613003096916516475E-1L,
- -9.611744011489092894027478899545635991213E-2L
+static const _Float128 RNr20[NRNr20 + 1] =
+{
+ L(-9.652706916457973956366721379612508047640E2),
+ L(5.577066396050932776683469951773643880634E2),
+ L(-4.406335508848496713572223098693575485978E2),
+ L(5.202893466490242733570232680736966655434E1),
+ L(-1.931311847665757913322495948705563937159E1),
+ L(-9.364318268748287664267341457164918090611E-2),
+ L(-3.306390351286352764891355375882586201069E0),
+ L(7.573806045289044647727613003096916516475E-1),
+ L(-9.611744011489092894027478899545635991213E-2)
};
#define NRDr20 7
-static const long double RDr20[NRDr20 + 1] =
-{
- 3.032829629520142564106649167182428189014E3L,
- 1.659648470721967719961167083684972196891E3L,
- 1.703545128657284619402511356932569292535E3L,
- 6.393465677731598872500200253155257708763E2L,
- 3.489131397281030947405287112726059221934E2L,
- 8.848641738570783406484348434387611713070E1L,
- 3.132269062552392974833215844236160958502E1L,
- 4.430131663290563523933419966185230513168E0L
+static const _Float128 RDr20[NRDr20 + 1] =
+{
+ L(3.032829629520142564106649167182428189014E3),
+ L(1.659648470721967719961167083684972196891E3),
+ L(1.703545128657284619402511356932569292535E3),
+ L(6.393465677731598872500200253155257708763E2),
+ L(3.489131397281030947405287112726059221934E2),
+ L(8.848641738570783406484348434387611713070E1),
+ L(3.132269062552392974833215844236160958502E1),
+ L(4.430131663290563523933419966185230513168E0)
/* 1.0E0 */
};
/* erfc(1.125) = C20a + C20b to extra precision. */
-static const long double C20a = 0.111602783203125L;
-static const long double C20b = 8.9850951672359304215530728365232161564636E-6L;
+static const _Float128 C20a = L(0.111602783203125);
+static const _Float128 C20b = L(8.9850951672359304215530728365232161564636E-6);
/* erfc(1/x) = 1/x exp (-1/x^2 - 0.5625 + R(1/x^2))
7/8 <= 1/x < 1
Peak relative error 1.4e-35 */
#define NRNr8 9
-static const long double RNr8[NRNr8 + 1] =
-{
- 3.587451489255356250759834295199296936784E1L,
- 5.406249749087340431871378009874875889602E2L,
- 2.931301290625250886238822286506381194157E3L,
- 7.359254185241795584113047248898753470923E3L,
- 9.201031849810636104112101947312492532314E3L,
- 5.749697096193191467751650366613289284777E3L,
- 1.710415234419860825710780802678697889231E3L,
- 2.150753982543378580859546706243022719599E2L,
- 8.740953582272147335100537849981160931197E0L,
- 4.876422978828717219629814794707963640913E-2L
+static const _Float128 RNr8[NRNr8 + 1] =
+{
+ L(3.587451489255356250759834295199296936784E1),
+ L(5.406249749087340431871378009874875889602E2),
+ L(2.931301290625250886238822286506381194157E3),
+ L(7.359254185241795584113047248898753470923E3),
+ L(9.201031849810636104112101947312492532314E3),
+ L(5.749697096193191467751650366613289284777E3),
+ L(1.710415234419860825710780802678697889231E3),
+ L(2.150753982543378580859546706243022719599E2),
+ L(8.740953582272147335100537849981160931197E0),
+ L(4.876422978828717219629814794707963640913E-2)
};
#define NRDr8 8
-static const long double RDr8[NRDr8 + 1] =
-{
- 6.358593134096908350929496535931630140282E1L,
- 9.900253816552450073757174323424051765523E2L,
- 5.642928777856801020545245437089490805186E3L,
- 1.524195375199570868195152698617273739609E4L,
- 2.113829644500006749947332935305800887345E4L,
- 1.526438562626465706267943737310282977138E4L,
- 5.561370922149241457131421914140039411782E3L,
- 9.394035530179705051609070428036834496942E2L,
- 6.147019596150394577984175188032707343615E1L
+static const _Float128 RDr8[NRDr8 + 1] =
+{
+ L(6.358593134096908350929496535931630140282E1),
+ L(9.900253816552450073757174323424051765523E2),
+ L(5.642928777856801020545245437089490805186E3),
+ L(1.524195375199570868195152698617273739609E4),
+ L(2.113829644500006749947332935305800887345E4),
+ L(1.526438562626465706267943737310282977138E4),
+ L(5.561370922149241457131421914140039411782E3),
+ L(9.394035530179705051609070428036834496942E2),
+ L(6.147019596150394577984175188032707343615E1)
/* 1.0E0 */
};
@@ -513,32 +513,32 @@ static const long double RDr8[NRDr8 + 1] =
0.75 <= 1/x <= 0.875
Peak relative error 2.0e-36 */
#define NRNr7 9
-static const long double RNr7[NRNr7 + 1] =
-{
- 1.686222193385987690785945787708644476545E1L,
- 1.178224543567604215602418571310612066594E3L,
- 1.764550584290149466653899886088166091093E4L,
- 1.073758321890334822002849369898232811561E5L,
- 3.132840749205943137619839114451290324371E5L,
- 4.607864939974100224615527007793867585915E5L,
- 3.389781820105852303125270837910972384510E5L,
- 1.174042187110565202875011358512564753399E5L,
- 1.660013606011167144046604892622504338313E4L,
- 6.700393957480661937695573729183733234400E2L
+static const _Float128 RNr7[NRNr7 + 1] =
+{
+ L(1.686222193385987690785945787708644476545E1),
+ L(1.178224543567604215602418571310612066594E3),
+ L(1.764550584290149466653899886088166091093E4),
+ L(1.073758321890334822002849369898232811561E5),
+ L(3.132840749205943137619839114451290324371E5),
+ L(4.607864939974100224615527007793867585915E5),
+ L(3.389781820105852303125270837910972384510E5),
+ L(1.174042187110565202875011358512564753399E5),
+ L(1.660013606011167144046604892622504338313E4),
+ L(6.700393957480661937695573729183733234400E2)
};
#define NRDr7 9
-static const long double RDr7[NRDr7 + 1] =
-{
--1.709305024718358874701575813642933561169E3L,
--3.280033887481333199580464617020514788369E4L,
--2.345284228022521885093072363418750835214E5L,
--8.086758123097763971926711729242327554917E5L,
--1.456900414510108718402423999575992450138E6L,
--1.391654264881255068392389037292702041855E6L,
--6.842360801869939983674527468509852583855E5L,
--1.597430214446573566179675395199807533371E5L,
--1.488876130609876681421645314851760773480E4L,
--3.511762950935060301403599443436465645703E2L
+static const _Float128 RDr7[NRDr7 + 1] =
+{
+L(-1.709305024718358874701575813642933561169E3),
+L(-3.280033887481333199580464617020514788369E4),
+L(-2.345284228022521885093072363418750835214E5),
+L(-8.086758123097763971926711729242327554917E5),
+L(-1.456900414510108718402423999575992450138E6),
+L(-1.391654264881255068392389037292702041855E6),
+L(-6.842360801869939983674527468509852583855E5),
+L(-1.597430214446573566179675395199807533371E5),
+L(-1.488876130609876681421645314851760773480E4),
+L(-3.511762950935060301403599443436465645703E2)
/* 1.0E0 */
};
@@ -546,32 +546,32 @@ static const long double RDr7[NRDr7 + 1] =
5/8 <= 1/x < 3/4
Peak relative error 1.9e-35 */
#define NRNr6 9
-static const long double RNr6[NRNr6 + 1] =
-{
- 1.642076876176834390623842732352935761108E0L,
- 1.207150003611117689000664385596211076662E2L,
- 2.119260779316389904742873816462800103939E3L,
- 1.562942227734663441801452930916044224174E4L,
- 5.656779189549710079988084081145693580479E4L,
- 1.052166241021481691922831746350942786299E5L,
- 9.949798524786000595621602790068349165758E4L,
- 4.491790734080265043407035220188849562856E4L,
- 8.377074098301530326270432059434791287601E3L,
- 4.506934806567986810091824791963991057083E2L
+static const _Float128 RNr6[NRNr6 + 1] =
+{
+ L(1.642076876176834390623842732352935761108E0),
+ L(1.207150003611117689000664385596211076662E2),
+ L(2.119260779316389904742873816462800103939E3),
+ L(1.562942227734663441801452930916044224174E4),
+ L(5.656779189549710079988084081145693580479E4),
+ L(1.052166241021481691922831746350942786299E5),
+ L(9.949798524786000595621602790068349165758E4),
+ L(4.491790734080265043407035220188849562856E4),
+ L(8.377074098301530326270432059434791287601E3),
+ L(4.506934806567986810091824791963991057083E2)
};
#define NRDr6 9
-static const long double RDr6[NRDr6 + 1] =
-{
--1.664557643928263091879301304019826629067E2L,
--3.800035902507656624590531122291160668452E3L,
--3.277028191591734928360050685359277076056E4L,
--1.381359471502885446400589109566587443987E5L,
--3.082204287382581873532528989283748656546E5L,
--3.691071488256738343008271448234631037095E5L,
--2.300482443038349815750714219117566715043E5L,
--6.873955300927636236692803579555752171530E4L,
--8.262158817978334142081581542749986845399E3L,
--2.517122254384430859629423488157361983661E2L
+static const _Float128 RDr6[NRDr6 + 1] =
+{
+L(-1.664557643928263091879301304019826629067E2),
+L(-3.800035902507656624590531122291160668452E3),
+L(-3.277028191591734928360050685359277076056E4),
+L(-1.381359471502885446400589109566587443987E5),
+L(-3.082204287382581873532528989283748656546E5),
+L(-3.691071488256738343008271448234631037095E5),
+L(-2.300482443038349815750714219117566715043E5),
+L(-6.873955300927636236692803579555752171530E4),
+L(-8.262158817978334142081581542749986845399E3),
+L(-2.517122254384430859629423488157361983661E2)
/* 1.00 */
};
@@ -579,33 +579,33 @@ static const long double RDr6[NRDr6 + 1] =
1/2 <= 1/x < 5/8
Peak relative error 4.6e-36 */
#define NRNr5 10
-static const long double RNr5[NRNr5 + 1] =
-{
--3.332258927455285458355550878136506961608E-3L,
--2.697100758900280402659586595884478660721E-1L,
--6.083328551139621521416618424949137195536E0L,
--6.119863528983308012970821226810162441263E1L,
--3.176535282475593173248810678636522589861E2L,
--8.933395175080560925809992467187963260693E2L,
--1.360019508488475978060917477620199499560E3L,
--1.075075579828188621541398761300910213280E3L,
--4.017346561586014822824459436695197089916E2L,
--5.857581368145266249509589726077645791341E1L,
--2.077715925587834606379119585995758954399E0L
+static const _Float128 RNr5[NRNr5 + 1] =
+{
+L(-3.332258927455285458355550878136506961608E-3),
+L(-2.697100758900280402659586595884478660721E-1),
+L(-6.083328551139621521416618424949137195536E0),
+L(-6.119863528983308012970821226810162441263E1),
+L(-3.176535282475593173248810678636522589861E2),
+L(-8.933395175080560925809992467187963260693E2),
+L(-1.360019508488475978060917477620199499560E3),
+L(-1.075075579828188621541398761300910213280E3),
+L(-4.017346561586014822824459436695197089916E2),
+L(-5.857581368145266249509589726077645791341E1),
+L(-2.077715925587834606379119585995758954399E0)
};
#define NRDr5 9
-static const long double RDr5[NRDr5 + 1] =
-{
- 3.377879570417399341550710467744693125385E-1L,
- 1.021963322742390735430008860602594456187E1L,
- 1.200847646592942095192766255154827011939E2L,
- 7.118915528142927104078182863387116942836E2L,
- 2.318159380062066469386544552429625026238E3L,
- 4.238729853534009221025582008928765281620E3L,
- 4.279114907284825886266493994833515580782E3L,
- 2.257277186663261531053293222591851737504E3L,
- 5.570475501285054293371908382916063822957E2L,
- 5.142189243856288981145786492585432443560E1L
+static const _Float128 RDr5[NRDr5 + 1] =
+{
+ L(3.377879570417399341550710467744693125385E-1),
+ L(1.021963322742390735430008860602594456187E1),
+ L(1.200847646592942095192766255154827011939E2),
+ L(7.118915528142927104078182863387116942836E2),
+ L(2.318159380062066469386544552429625026238E3),
+ L(4.238729853534009221025582008928765281620E3),
+ L(4.279114907284825886266493994833515580782E3),
+ L(2.257277186663261531053293222591851737504E3),
+ L(5.570475501285054293371908382916063822957E2),
+ L(5.142189243856288981145786492585432443560E1)
/* 1.0E0 */
};
@@ -613,34 +613,34 @@ static const long double RDr5[NRDr5 + 1] =
3/8 <= 1/x < 1/2
Peak relative error 2.0e-36 */
#define NRNr4 10
-static const long double RNr4[NRNr4 + 1] =
-{
- 3.258530712024527835089319075288494524465E-3L,
- 2.987056016877277929720231688689431056567E-1L,
- 8.738729089340199750734409156830371528862E0L,
- 1.207211160148647782396337792426311125923E2L,
- 8.997558632489032902250523945248208224445E2L,
- 3.798025197699757225978410230530640879762E3L,
- 9.113203668683080975637043118209210146846E3L,
- 1.203285891339933238608683715194034900149E4L,
- 8.100647057919140328536743641735339740855E3L,
- 2.383888249907144945837976899822927411769E3L,
- 2.127493573166454249221983582495245662319E2L
+static const _Float128 RNr4[NRNr4 + 1] =
+{
+ L(3.258530712024527835089319075288494524465E-3),
+ L(2.987056016877277929720231688689431056567E-1),
+ L(8.738729089340199750734409156830371528862E0),
+ L(1.207211160148647782396337792426311125923E2),
+ L(8.997558632489032902250523945248208224445E2),
+ L(3.798025197699757225978410230530640879762E3),
+ L(9.113203668683080975637043118209210146846E3),
+ L(1.203285891339933238608683715194034900149E4),
+ L(8.100647057919140328536743641735339740855E3),
+ L(2.383888249907144945837976899822927411769E3),
+ L(2.127493573166454249221983582495245662319E2)
};
#define NRDr4 10
-static const long double RDr4[NRDr4 + 1] =
-{
--3.303141981514540274165450687270180479586E-1L,
--1.353768629363605300707949368917687066724E1L,
--2.206127630303621521950193783894598987033E2L,
--1.861800338758066696514480386180875607204E3L,
--8.889048775872605708249140016201753255599E3L,
--2.465888106627948210478692168261494857089E4L,
--3.934642211710774494879042116768390014289E4L,
--3.455077258242252974937480623730228841003E4L,
--1.524083977439690284820586063729912653196E4L,
--2.810541887397984804237552337349093953857E3L,
--1.343929553541159933824901621702567066156E2L
+static const _Float128 RDr4[NRDr4 + 1] =
+{
+L(-3.303141981514540274165450687270180479586E-1),
+L(-1.353768629363605300707949368917687066724E1),
+L(-2.206127630303621521950193783894598987033E2),
+L(-1.861800338758066696514480386180875607204E3),
+L(-8.889048775872605708249140016201753255599E3),
+L(-2.465888106627948210478692168261494857089E4),
+L(-3.934642211710774494879042116768390014289E4),
+L(-3.455077258242252974937480623730228841003E4),
+L(-1.524083977439690284820586063729912653196E4),
+L(-2.810541887397984804237552337349093953857E3),
+L(-1.343929553541159933824901621702567066156E2)
/* 1.0E0 */
};
@@ -648,35 +648,35 @@ static const long double RDr4[NRDr4 + 1] =
1/4 <= 1/x < 3/8
Peak relative error 8.4e-37 */
#define NRNr3 11
-static const long double RNr3[NRNr3 + 1] =
-{
--1.952401126551202208698629992497306292987E-6L,
--2.130881743066372952515162564941682716125E-4L,
--8.376493958090190943737529486107282224387E-3L,
--1.650592646560987700661598877522831234791E-1L,
--1.839290818933317338111364667708678163199E0L,
--1.216278715570882422410442318517814388470E1L,
--4.818759344462360427612133632533779091386E1L,
--1.120994661297476876804405329172164436784E2L,
--1.452850765662319264191141091859300126931E2L,
--9.485207851128957108648038238656777241333E1L,
--2.563663855025796641216191848818620020073E1L,
--1.787995944187565676837847610706317833247E0L
+static const _Float128 RNr3[NRNr3 + 1] =
+{
+L(-1.952401126551202208698629992497306292987E-6),
+L(-2.130881743066372952515162564941682716125E-4),
+L(-8.376493958090190943737529486107282224387E-3),
+L(-1.650592646560987700661598877522831234791E-1),
+L(-1.839290818933317338111364667708678163199E0),
+L(-1.216278715570882422410442318517814388470E1),
+L(-4.818759344462360427612133632533779091386E1),
+L(-1.120994661297476876804405329172164436784E2),
+L(-1.452850765662319264191141091859300126931E2),
+L(-9.485207851128957108648038238656777241333E1),
+L(-2.563663855025796641216191848818620020073E1),
+L(-1.787995944187565676837847610706317833247E0)
};
#define NRDr3 10
-static const long double RDr3[NRDr3 + 1] =
-{
- 1.979130686770349481460559711878399476903E-4L,
- 1.156941716128488266238105813374635099057E-2L,
- 2.752657634309886336431266395637285974292E-1L,
- 3.482245457248318787349778336603569327521E0L,
- 2.569347069372696358578399521203959253162E1L,
- 1.142279000180457419740314694631879921561E2L,
- 3.056503977190564294341422623108332700840E2L,
- 4.780844020923794821656358157128719184422E2L,
- 4.105972727212554277496256802312730410518E2L,
- 1.724072188063746970865027817017067646246E2L,
- 2.815939183464818198705278118326590370435E1L
+static const _Float128 RDr3[NRDr3 + 1] =
+{
+ L(1.979130686770349481460559711878399476903E-4),
+ L(1.156941716128488266238105813374635099057E-2),
+ L(2.752657634309886336431266395637285974292E-1),
+ L(3.482245457248318787349778336603569327521E0),
+ L(2.569347069372696358578399521203959253162E1),
+ L(1.142279000180457419740314694631879921561E2),
+ L(3.056503977190564294341422623108332700840E2),
+ L(4.780844020923794821656358157128719184422E2),
+ L(4.105972727212554277496256802312730410518E2),
+ L(1.724072188063746970865027817017067646246E2),
+ L(2.815939183464818198705278118326590370435E1)
/* 1.0E0 */
};
@@ -684,35 +684,35 @@ static const long double RDr3[NRDr3 + 1] =
1/8 <= 1/x < 1/4
Peak relative error 1.5e-36 */
#define NRNr2 11
-static const long double RNr2[NRNr2 + 1] =
-{
--2.638914383420287212401687401284326363787E-8L,
--3.479198370260633977258201271399116766619E-6L,
--1.783985295335697686382487087502222519983E-4L,
--4.777876933122576014266349277217559356276E-3L,
--7.450634738987325004070761301045014986520E-2L,
--7.068318854874733315971973707247467326619E-1L,
--4.113919921935944795764071670806867038732E0L,
--1.440447573226906222417767283691888875082E1L,
--2.883484031530718428417168042141288943905E1L,
--2.990886974328476387277797361464279931446E1L,
--1.325283914915104866248279787536128997331E1L,
--1.572436106228070195510230310658206154374E0L
+static const _Float128 RNr2[NRNr2 + 1] =
+{
+L(-2.638914383420287212401687401284326363787E-8),
+L(-3.479198370260633977258201271399116766619E-6),
+L(-1.783985295335697686382487087502222519983E-4),
+L(-4.777876933122576014266349277217559356276E-3),
+L(-7.450634738987325004070761301045014986520E-2),
+L(-7.068318854874733315971973707247467326619E-1),
+L(-4.113919921935944795764071670806867038732E0),
+L(-1.440447573226906222417767283691888875082E1),
+L(-2.883484031530718428417168042141288943905E1),
+L(-2.990886974328476387277797361464279931446E1),
+L(-1.325283914915104866248279787536128997331E1),
+L(-1.572436106228070195510230310658206154374E0)
};
#define NRDr2 10
-static const long double RDr2[NRDr2 + 1] =
-{
- 2.675042728136731923554119302571867799673E-6L,
- 2.170997868451812708585443282998329996268E-4L,
- 7.249969752687540289422684951196241427445E-3L,
- 1.302040375859768674620410563307838448508E-1L,
- 1.380202483082910888897654537144485285549E0L,
- 8.926594113174165352623847870299170069350E0L,
- 3.521089584782616472372909095331572607185E1L,
- 8.233547427533181375185259050330809105570E1L,
- 1.072971579885803033079469639073292840135E2L,
- 6.943803113337964469736022094105143158033E1L,
- 1.775695341031607738233608307835017282662E1L
+static const _Float128 RDr2[NRDr2 + 1] =
+{
+ L(2.675042728136731923554119302571867799673E-6),
+ L(2.170997868451812708585443282998329996268E-4),
+ L(7.249969752687540289422684951196241427445E-3),
+ L(1.302040375859768674620410563307838448508E-1),
+ L(1.380202483082910888897654537144485285549E0),
+ L(8.926594113174165352623847870299170069350E0),
+ L(3.521089584782616472372909095331572607185E1),
+ L(8.233547427533181375185259050330809105570E1),
+ L(1.072971579885803033079469639073292840135E2),
+ L(6.943803113337964469736022094105143158033E1),
+ L(1.775695341031607738233608307835017282662E1)
/* 1.0E0 */
};
@@ -720,39 +720,39 @@ static const long double RDr2[NRDr2 + 1] =
1/128 <= 1/x < 1/8
Peak relative error 2.2e-36 */
#define NRNr1 9
-static const long double RNr1[NRNr1 + 1] =
-{
--4.250780883202361946697751475473042685782E-8L,
--5.375777053288612282487696975623206383019E-6L,
--2.573645949220896816208565944117382460452E-4L,
--6.199032928113542080263152610799113086319E-3L,
--8.262721198693404060380104048479916247786E-2L,
--6.242615227257324746371284637695778043982E-1L,
--2.609874739199595400225113299437099626386E0L,
--5.581967563336676737146358534602770006970E0L,
--5.124398923356022609707490956634280573882E0L,
--1.290865243944292370661544030414667556649E0L
+static const _Float128 RNr1[NRNr1 + 1] =
+{
+L(-4.250780883202361946697751475473042685782E-8),
+L(-5.375777053288612282487696975623206383019E-6),
+L(-2.573645949220896816208565944117382460452E-4),
+L(-6.199032928113542080263152610799113086319E-3),
+L(-8.262721198693404060380104048479916247786E-2),
+L(-6.242615227257324746371284637695778043982E-1),
+L(-2.609874739199595400225113299437099626386E0),
+L(-5.581967563336676737146358534602770006970E0),
+L(-5.124398923356022609707490956634280573882E0),
+L(-1.290865243944292370661544030414667556649E0)
};
#define NRDr1 8
-static const long double RDr1[NRDr1 + 1] =
-{
- 4.308976661749509034845251315983612976224E-6L,
- 3.265390126432780184125233455960049294580E-4L,
- 9.811328839187040701901866531796570418691E-3L,
- 1.511222515036021033410078631914783519649E-1L,
- 1.289264341917429958858379585970225092274E0L,
- 6.147640356182230769548007536914983522270E0L,
- 1.573966871337739784518246317003956180750E1L,
- 1.955534123435095067199574045529218238263E1L,
- 9.472613121363135472247929109615785855865E0L
+static const _Float128 RDr1[NRDr1 + 1] =
+{
+ L(4.308976661749509034845251315983612976224E-6),
+ L(3.265390126432780184125233455960049294580E-4),
+ L(9.811328839187040701901866531796570418691E-3),
+ L(1.511222515036021033410078631914783519649E-1),
+ L(1.289264341917429958858379585970225092274E0),
+ L(6.147640356182230769548007536914983522270E0),
+ L(1.573966871337739784518246317003956180750E1),
+ L(1.955534123435095067199574045529218238263E1),
+ L(9.472613121363135472247929109615785855865E0)
/* 1.0E0 */
};
-long double
-__erfl (long double x)
+_Float128
+__erfl (_Float128 x)
{
- long double a, y, z;
+ _Float128 a, y, z;
int32_t i, ix, sign;
ieee854_long_double_shape_type u;
@@ -763,7 +763,7 @@ __erfl (long double x)
if (ix >= 0x7fff0000)
{ /* erf(nan)=nan */
i = ((sign & 0xffff0000) >> 31) << 1;
- return (long double) (1 - i) + one / x; /* erf(+-inf)=+-1 */
+ return (_Float128) (1 - i) + one / x; /* erf(+-inf)=+-1 */
}
if (ix >= 0x3fff0000) /* |x| >= 1.0 */
@@ -784,7 +784,7 @@ __erfl (long double x)
if (ix < 0x00080000)
{
/* Avoid spurious underflow. */
- long double ret = 0.0625 * (16.0 * x + (16.0 * efx) * x);
+ _Float128 ret = 0.0625 * (16.0 * x + (16.0 * efx) * x);
math_check_force_underflow (ret);
return ret;
}
@@ -804,10 +804,10 @@ __erfl (long double x)
}
weak_alias (__erfl, erfl)
-long double
-__erfcl (long double x)
+_Float128
+__erfcl (_Float128 x)
{
- long double y, z, p, r;
+ _Float128 y, z, p, r;
int32_t i, ix, sign;
ieee854_long_double_shape_type u;
@@ -819,7 +819,7 @@ __erfcl (long double x)
if (ix >= 0x7fff0000)
{ /* erfc(nan)=nan */
/* erfc(+-inf)=0,2 */
- return (long double) (((u_int32_t) sign >> 31) << 1) + one / x;
+ return (_Float128) (((u_int32_t) sign >> 31) << 1) + one / x;
}
if (ix < 0x3ffd0000) /* |x| <1/4 */
@@ -835,48 +835,48 @@ __erfcl (long double x)
switch (i)
{
case 2:
- z = x - 0.25L;
+ z = x - L(0.25);
y = C13b + z * neval (z, RNr13, NRNr13) / deval (z, RDr13, NRDr13);
y += C13a;
break;
case 3:
- z = x - 0.375L;
+ z = x - L(0.375);
y = C14b + z * neval (z, RNr14, NRNr14) / deval (z, RDr14, NRDr14);
y += C14a;
break;
case 4:
- z = x - 0.5L;
+ z = x - L(0.5);
y = C15b + z * neval (z, RNr15, NRNr15) / deval (z, RDr15, NRDr15);
y += C15a;
break;
case 5:
- z = x - 0.625L;
+ z = x - L(0.625);
y = C16b + z * neval (z, RNr16, NRNr16) / deval (z, RDr16, NRDr16);
y += C16a;
break;
case 6:
- z = x - 0.75L;
+ z = x - L(0.75);
y = C17b + z * neval (z, RNr17, NRNr17) / deval (z, RDr17, NRDr17);
y += C17a;
break;
case 7:
- z = x - 0.875L;
+ z = x - L(0.875);
y = C18b + z * neval (z, RNr18, NRNr18) / deval (z, RDr18, NRDr18);
y += C18a;
break;
case 8:
- z = x - 1.0L;
+ z = x - 1;
y = C19b + z * neval (z, RNr19, NRNr19) / deval (z, RDr19, NRDr19);
y += C19a;
break;
default: /* i == 9. */
- z = x - 1.125L;
+ z = x - L(1.125);
y = C20b + z * neval (z, RNr20, NRNr20) / deval (z, RDr20, NRDr20);
y += C20a;
break;
}
if (sign & 0x80000000)
- y = 2.0L - y;
+ y = 2 - y;
return y;
}
/* 1.25 < |x| < 107 */
@@ -925,7 +925,7 @@ __erfcl (long double x)
__ieee754_expl ((z - x) * (z + x) + p);
if ((sign & 0x80000000) == 0)
{
- long double ret = r / x;
+ _Float128 ret = r / x;
if (ret == 0)
__set_errno (ERANGE);
return ret;
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index da902efafd..46d078b77b 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -62,36 +62,36 @@
-.5 ln 2 < x < .5 ln 2
Theoretical peak relative error = 8.1e-36 */
-static const long double
- P0 = 2.943520915569954073888921213330863757240E8L,
- P1 = -5.722847283900608941516165725053359168840E7L,
- P2 = 8.944630806357575461578107295909719817253E6L,
- P3 = -7.212432713558031519943281748462837065308E5L,
- P4 = 4.578962475841642634225390068461943438441E4L,
- P5 = -1.716772506388927649032068540558788106762E3L,
- P6 = 4.401308817383362136048032038528753151144E1L,
- P7 = -4.888737542888633647784737721812546636240E-1L,
- Q0 = 1.766112549341972444333352727998584753865E9L,
- Q1 = -7.848989743695296475743081255027098295771E8L,
- Q2 = 1.615869009634292424463780387327037251069E8L,
- Q3 = -2.019684072836541751428967854947019415698E7L,
- Q4 = 1.682912729190313538934190635536631941751E6L,
- Q5 = -9.615511549171441430850103489315371768998E4L,
- Q6 = 3.697714952261803935521187272204485251835E3L,
- Q7 = -8.802340681794263968892934703309274564037E1L,
+static const _Float128
+ P0 = L(2.943520915569954073888921213330863757240E8),
+ P1 = L(-5.722847283900608941516165725053359168840E7),
+ P2 = L(8.944630806357575461578107295909719817253E6),
+ P3 = L(-7.212432713558031519943281748462837065308E5),
+ P4 = L(4.578962475841642634225390068461943438441E4),
+ P5 = L(-1.716772506388927649032068540558788106762E3),
+ P6 = L(4.401308817383362136048032038528753151144E1),
+ P7 = L(-4.888737542888633647784737721812546636240E-1),
+ Q0 = L(1.766112549341972444333352727998584753865E9),
+ Q1 = L(-7.848989743695296475743081255027098295771E8),
+ Q2 = L(1.615869009634292424463780387327037251069E8),
+ Q3 = L(-2.019684072836541751428967854947019415698E7),
+ Q4 = L(1.682912729190313538934190635536631941751E6),
+ Q5 = L(-9.615511549171441430850103489315371768998E4),
+ Q6 = L(3.697714952261803935521187272204485251835E3),
+ Q7 = L(-8.802340681794263968892934703309274564037E1),
/* Q8 = 1.000000000000000000000000000000000000000E0 */
/* C1 + C2 = ln 2 */
- C1 = 6.93145751953125E-1L,
- C2 = 1.428606820309417232121458176568075500134E-6L,
+ C1 = L(6.93145751953125E-1),
+ C2 = L(1.428606820309417232121458176568075500134E-6),
/* ln 2^-114 */
- minarg = -7.9018778583833765273564461846232128760607E1L, big = 1e4932L;
+ minarg = L(-7.9018778583833765273564461846232128760607E1), big = L(1e4932);
-long double
-__expm1l (long double x)
+_Float128
+__expm1l (_Float128 x)
{
- long double px, qx, xx;
+ _Float128 px, qx, xx;
int32_t ix, sign;
ieee854_long_double_shape_type u;
int k;
@@ -110,7 +110,7 @@ __expm1l (long double x)
{
/* Infinity (which must be negative infinity). */
if (((ix & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
- return -1.0L;
+ return -1;
/* NaN. Invalid exception if signaling. */
return x + x;
}
@@ -121,12 +121,12 @@ __expm1l (long double x)
/* Minimum value. */
if (x < minarg)
- return (4.0/big - 1.0L);
+ return (4.0/big - 1);
/* Avoid internal underflow when result does not underflow, while
ensuring underflow (without returning a zero of the wrong sign)
when the result does underflow. */
- if (fabsl (x) < 0x1p-113L)
+ if (fabsl (x) < L(0x1p-113))
{
math_check_force_underflow (x);
return x;
@@ -158,7 +158,7 @@ __expm1l (long double x)
exp(x) - 1 = 2^k (qx + 1) - 1
= 2^k qx + 2^k - 1. */
- px = __ldexpl (1.0L, k);
+ px = __ldexpl (1, k);
x = px * qx + (px - 1.0);
return x;
}
diff --git a/sysdeps/ieee754/ldbl-128/s_fabsl.c b/sysdeps/ieee754/ldbl-128/s_fabsl.c
index a1bb6c5dff..0ce6f734cf 100644
--- a/sysdeps/ieee754/ldbl-128/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fabsl.c
@@ -24,7 +24,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-long double __fabsl(long double x)
+_Float128 __fabsl(_Float128 x)
{
u_int64_t hx;
GET_LDOUBLE_MSW64(hx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c
index ea8a9ba379..feb4590924 100644
--- a/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -25,7 +25,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-int __finitel(long double x)
+int __finitel(_Float128 x)
{
int64_t hx;
GET_LDOUBLE_MSW64(hx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_floorl.c b/sysdeps/ieee754/ldbl-128/s_floorl.c
index 14a0efef85..13ad0848a4 100644
--- a/sysdeps/ieee754/ldbl-128/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128/s_floorl.c
@@ -27,7 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-long double __floorl(long double x)
+_Float128 __floorl(_Float128 x)
{
int64_t i0,i1,j0;
u_int64_t i,j;
diff --git a/sysdeps/ieee754/ldbl-128/s_fmal.c b/sysdeps/ieee754/ldbl-128/s_fmal.c
index 728949c916..eb1e27e041 100644
--- a/sysdeps/ieee754/ldbl-128/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128/s_fmal.c
@@ -28,8 +28,8 @@
double rounding. See a paper by Boldo and Melquiond:
http://www.lri.fr/~melquion/doc/08-tc.pdf */
-long double
-__fmal (long double x, long double y, long double z)
+_Float128
+__fmal (_Float128 x, _Float128 y, _Float128 z)
{
union ieee854_long_double u, v, w;
int adjust = 0;
@@ -75,7 +75,7 @@ __fmal (long double x, long double y, long double z)
< IEEE854_LONG_DOUBLE_BIAS - LDBL_MANT_DIG - 2)
{
int neg = u.ieee.negative ^ v.ieee.negative;
- long double tiny = neg ? -0x1p-16494L : 0x1p-16494L;
+ _Float128 tiny = neg ? L(-0x1p-16494) : L(0x1p-16494);
if (w.ieee.exponent >= 3)
return tiny + z;
/* Scaling up, adding TINY and scaling down produces the
@@ -83,7 +83,7 @@ __fmal (long double x, long double y, long double z)
TINY has no effect and in other modes double rounding is
harmless. But it may not produce required underflow
exceptions. */
- v.d = z * 0x1p114L + tiny;
+ v.d = z * L(0x1p114) + tiny;
if (TININESS_AFTER_ROUNDING
? v.ieee.exponent < 115
: (w.ieee.exponent == 0
@@ -94,10 +94,10 @@ __fmal (long double x, long double y, long double z)
&& w.ieee.mantissa1 == 0
&& w.ieee.mantissa0 == 0)))
{
- long double force_underflow = x * y;
+ _Float128 force_underflow = x * y;
math_force_eval (force_underflow);
}
- return v.d * 0x1p-114L;
+ return v.d * L(0x1p-114);
}
if (u.ieee.exponent + v.ieee.exponent
>= 0x7fff + IEEE854_LONG_DOUBLE_BIAS - LDBL_MANT_DIG)
@@ -144,7 +144,7 @@ __fmal (long double x, long double y, long double z)
if (v.ieee.exponent)
v.ieee.exponent += LDBL_MANT_DIG;
else
- v.d *= 0x1p113L;
+ v.d *= L(0x1p113);
}
else if (v.ieee.exponent >= 0x7fff - LDBL_MANT_DIG)
{
@@ -152,7 +152,7 @@ __fmal (long double x, long double y, long double z)
if (u.ieee.exponent)
u.ieee.exponent += LDBL_MANT_DIG;
else
- u.d *= 0x1p113L;
+ u.d *= L(0x1p113);
}
else /* if (u.ieee.exponent + v.ieee.exponent
<= IEEE854_LONG_DOUBLE_BIAS + LDBL_MANT_DIG) */
@@ -166,7 +166,7 @@ __fmal (long double x, long double y, long double z)
if (w.ieee.exponent)
w.ieee.exponent += 2 * LDBL_MANT_DIG + 2;
else
- w.d *= 0x1p228L;
+ w.d *= L(0x1p228);
adjust = -1;
}
/* Otherwise x * y should just affect inexact
@@ -190,22 +190,22 @@ __fmal (long double x, long double y, long double z)
/* Multiplication m1 + m2 = x * y using Dekker's algorithm. */
#define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
- long double m1 = x * y;
+ _Float128 x1 = x * C;
+ _Float128 y1 = y * C;
+ _Float128 m1 = x * y;
x1 = (x - x1) + x1;
y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- long double m2 = (((x1 * y1 - m1) + x1 * y2) + x2 * y1) + x2 * y2;
+ _Float128 x2 = x - x1;
+ _Float128 y2 = y - y1;
+ _Float128 m2 = (((x1 * y1 - m1) + x1 * y2) + x2 * y1) + x2 * y2;
/* Addition a1 + a2 = z + m1 using Knuth's algorithm. */
- long double a1 = z + m1;
- long double t1 = a1 - z;
- long double t2 = a1 - t1;
+ _Float128 a1 = z + m1;
+ _Float128 t1 = a1 - z;
+ _Float128 t2 = a1 - t1;
t1 = m1 - t1;
t2 = z - t2;
- long double a2 = t1 + t2;
+ _Float128 a2 = t1 + t2;
/* Ensure the arithmetic is not scheduled after feclearexcept call. */
math_force_eval (m2);
math_force_eval (a2);
@@ -238,7 +238,7 @@ __fmal (long double x, long double y, long double z)
u.ieee.mantissa3 |= fetestexcept (FE_INEXACT) != 0;
feupdateenv (&env);
/* Result is a1 + u.d, scaled up. */
- return (a1 + u.d) * 0x1p113L;
+ return (a1 + u.d) * L(0x1p113);
}
else
{
@@ -255,11 +255,11 @@ __fmal (long double x, long double y, long double z)
/* If a1 + u.d is exact, the only rounding happens during
scaling down. */
if (j == 0)
- return v.d * 0x1p-228L;
+ return v.d * L(0x1p-228);
/* If result rounded to zero is not subnormal, no double
rounding will occur. */
if (v.ieee.exponent > 228)
- return (a1 + u.d) * 0x1p-228L;
+ return (a1 + u.d) * L(0x1p-228);
/* If v.d * 0x1p-228L with round to zero is a subnormal above
or equal to LDBL_MIN / 2, then v.d * 0x1p-228L shifts mantissa
down just by 1 bit, which means v.ieee.mantissa3 |= j would
@@ -278,21 +278,21 @@ __fmal (long double x, long double y, long double z)
{
w.d = a1 + u.d;
if (w.ieee.exponent == 229)
- return w.d * 0x1p-228L;
+ return w.d * L(0x1p-228);
}
/* v.ieee.mantissa3 & 2 is LSB bit of the result before rounding,
v.ieee.mantissa3 & 1 is the round bit and j is our sticky
bit. */
- w.d = 0.0L;
+ w.d = 0;
w.ieee.mantissa3 = ((v.ieee.mantissa3 & 3) << 1) | j;
w.ieee.negative = v.ieee.negative;
v.ieee.mantissa3 &= ~3U;
- v.d *= 0x1p-228L;
- w.d *= 0x1p-2L;
+ v.d *= L(0x1p-228);
+ w.d *= L(0x1p-2);
return v.d + w.d;
}
v.ieee.mantissa3 |= j;
- return v.d * 0x1p-228L;
+ return v.d * L(0x1p-228);
}
}
weak_alias (__fmal, fmal)
diff --git a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
index c89686f8f9..42203cfbbc 100644
--- a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
@@ -24,7 +24,7 @@
int
-__fpclassifyl (long double x)
+__fpclassifyl (_Float128 x)
{
u_int64_t hx, lx;
int retval = FP_NORMAL;
diff --git a/sysdeps/ieee754/ldbl-128/s_frexpl.c b/sysdeps/ieee754/ldbl-128/s_frexpl.c
index 70b2d3ae19..47a171f551 100644
--- a/sysdeps/ieee754/ldbl-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128/s_frexpl.c
@@ -30,10 +30,10 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double
-two114 = 2.0769187434139310514121985316880384E+34L; /* 0x4071000000000000, 0 */
+static const _Float128
+two114 = L(2.0769187434139310514121985316880384E+34); /* 0x4071000000000000, 0 */
-long double __frexpl(long double x, int *eptr)
+_Float128 __frexpl(_Float128 x, int *eptr)
{
u_int64_t hx, lx, ix;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
new file mode 100644
index 0000000000..ac7f6edce2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
@@ -0,0 +1,57 @@
+/* Get NaN payload. ldbl-128 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+long double
+getpayloadl (const long double *x)
+{
+ uint64_t hx, lx;
+ GET_LDOUBLE_WORDS64 (hx, lx, *x);
+ hx &= 0x7fffffffffffULL;
+ /* Construct the representation of the return value directly, since
+ 128-bit integers may not be available. */
+ int lz;
+ if (hx == 0)
+ {
+ if (lx == 0)
+ return 0.0L;
+ else
+ lz = __builtin_clzll (lx) + 64;
+ }
+ else
+ lz = __builtin_clzll (hx);
+ int shift = lz - 15;
+ if (shift >= 64)
+ {
+ hx = lx << (shift - 64);
+ lx = 0;
+ }
+ else
+ {
+ /* 2 <= SHIFT <= 63. */
+ hx = (hx << shift) | (lx >> (64 - shift));
+ lx <<= shift;
+ }
+ hx = (hx & 0xffffffffffffULL) | ((0x3fffULL + 127 - lz) << 48);
+ long double ret;
+ SET_LDOUBLE_WORDS64 (ret, hx, lx);
+ return ret;
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c
index 03e4d13371..dce8fc0b5d 100644
--- a/sysdeps/ieee754/ldbl-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isinfl.c
@@ -17,7 +17,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_private.h>
int
-__isinfl (long double x)
+__isinfl (_Float128 x)
{
int64_t hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 74960e7ff2..1dee642512 100644
--- a/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -25,7 +25,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-int __isnanl(long double x)
+int __isnanl(_Float128 x)
{
int64_t hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_issignalingl.c b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
index c06f14dd12..cb0f2a5383 100644
--- a/sysdeps/ieee754/ldbl-128/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
-__issignalingl (long double x)
+__issignalingl (_Float128 x)
{
u_int64_t hxi, lxi __attribute__ ((unused));
GET_LDOUBLE_WORDS64 (hxi, lxi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
used to designate infinity. */
diff --git a/sysdeps/ieee754/ldbl-128/s_llrintl.c b/sysdeps/ieee754/ldbl-128/s_llrintl.c
index 84fc576ab6..ff3ca39151 100644
--- a/sysdeps/ieee754/ldbl-128/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c
@@ -26,19 +26,19 @@
#include <math_private.h>
#include <fix-fp-int-convert-overflow.h>
-static const long double two112[2] =
+static const _Float128 two112[2] =
{
- 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
+ L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */
+ L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */
};
long long int
-__llrintl (long double x)
+__llrintl (_Float128 x)
{
int32_t j0;
u_int64_t i0,i1;
- long double w;
- long double t;
+ _Float128 w;
+ _Float128 t;
long long int result;
int sx;
@@ -52,7 +52,7 @@ __llrintl (long double x)
{
#if defined FE_INVALID || defined FE_INEXACT
/* X < LLONG_MAX + 1 implied by J0 < 63. */
- if (x > (long double) LLONG_MAX)
+ if (x > (_Float128) LLONG_MAX)
{
/* In the event of overflow we must raise the "invalid"
exception, but not "inexact". */
@@ -83,8 +83,8 @@ __llrintl (long double x)
FE_INVALID must be raised and the return value is
unspecified. */
#if defined FE_INVALID || defined FE_INEXACT
- if (x < (long double) LLONG_MIN
- && x > (long double) LLONG_MIN - 1.0L)
+ if (x < (_Float128) LLONG_MIN
+ && x > (_Float128) LLONG_MIN - 1)
{
/* If truncation produces LLONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
@@ -92,7 +92,7 @@ __llrintl (long double x)
feraiseexcept (t == LLONG_MIN ? FE_INEXACT : FE_INVALID);
return LLONG_MIN;
}
- else if (FIX_LDBL_LLONG_CONVERT_OVERFLOW && x != (long double) LLONG_MIN)
+ else if (FIX_LDBL_LLONG_CONVERT_OVERFLOW && x != (_Float128) LLONG_MIN)
{
feraiseexcept (FE_INVALID);
return sx == 0 ? LLONG_MAX : LLONG_MIN;
diff --git a/sysdeps/ieee754/ldbl-128/s_llroundl.c b/sysdeps/ieee754/ldbl-128/s_llroundl.c
index bfc81cc534..0e4fa9dfdb 100644
--- a/sysdeps/ieee754/ldbl-128/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llroundl.c
@@ -26,7 +26,7 @@
#include <fix-fp-int-convert-overflow.h>
long long int
-__llroundl (long double x)
+__llroundl (_Float128 x)
{
int64_t j0;
u_int64_t i1, i0;
@@ -79,13 +79,13 @@ __llroundl (long double x)
unspecified. */
#ifdef FE_INVALID
if (FIX_LDBL_LLONG_CONVERT_OVERFLOW
- && !(sign == -1 && x > (long double) LLONG_MIN - 0.5L))
+ && !(sign == -1 && x > (_Float128) LLONG_MIN - L(0.5)))
{
feraiseexcept (FE_INVALID);
return sign == 1 ? LLONG_MAX : LLONG_MIN;
}
else if (!FIX_LDBL_LLONG_CONVERT_OVERFLOW
- && x <= (long double) LLONG_MIN - 0.5L)
+ && x <= (_Float128) LLONG_MIN - L(0.5))
{
/* If truncation produces LLONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c
index b348f41e55..b8b2ffeba1 100644
--- a/sysdeps/ieee754/ldbl-128/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c
@@ -62,33 +62,33 @@
* Theoretical peak relative error = 5.3e-37,
* relative peak error spread = 2.3e-14
*/
-static const long double
- P12 = 1.538612243596254322971797716843006400388E-6L,
- P11 = 4.998469661968096229986658302195402690910E-1L,
- P10 = 2.321125933898420063925789532045674660756E1L,
- P9 = 4.114517881637811823002128927449878962058E2L,
- P8 = 3.824952356185897735160588078446136783779E3L,
- P7 = 2.128857716871515081352991964243375186031E4L,
- P6 = 7.594356839258970405033155585486712125861E4L,
- P5 = 1.797628303815655343403735250238293741397E5L,
- P4 = 2.854829159639697837788887080758954924001E5L,
- P3 = 3.007007295140399532324943111654767187848E5L,
- P2 = 2.014652742082537582487669938141683759923E5L,
- P1 = 7.771154681358524243729929227226708890930E4L,
- P0 = 1.313572404063446165910279910527789794488E4L,
+static const _Float128
+ P12 = L(1.538612243596254322971797716843006400388E-6),
+ P11 = L(4.998469661968096229986658302195402690910E-1),
+ P10 = L(2.321125933898420063925789532045674660756E1),
+ P9 = L(4.114517881637811823002128927449878962058E2),
+ P8 = L(3.824952356185897735160588078446136783779E3),
+ P7 = L(2.128857716871515081352991964243375186031E4),
+ P6 = L(7.594356839258970405033155585486712125861E4),
+ P5 = L(1.797628303815655343403735250238293741397E5),
+ P4 = L(2.854829159639697837788887080758954924001E5),
+ P3 = L(3.007007295140399532324943111654767187848E5),
+ P2 = L(2.014652742082537582487669938141683759923E5),
+ P1 = L(7.771154681358524243729929227226708890930E4),
+ P0 = L(1.313572404063446165910279910527789794488E4),
/* Q12 = 1.000000000000000000000000000000000000000E0L, */
- Q11 = 4.839208193348159620282142911143429644326E1L,
- Q10 = 9.104928120962988414618126155557301584078E2L,
- Q9 = 9.147150349299596453976674231612674085381E3L,
- Q8 = 5.605842085972455027590989944010492125825E4L,
- Q7 = 2.248234257620569139969141618556349415120E5L,
- Q6 = 6.132189329546557743179177159925690841200E5L,
- Q5 = 1.158019977462989115839826904108208787040E6L,
- Q4 = 1.514882452993549494932585972882995548426E6L,
- Q3 = 1.347518538384329112529391120390701166528E6L,
- Q2 = 7.777690340007566932935753241556479363645E5L,
- Q1 = 2.626900195321832660448791748036714883242E5L,
- Q0 = 3.940717212190338497730839731583397586124E4L;
+ Q11 = L(4.839208193348159620282142911143429644326E1),
+ Q10 = L(9.104928120962988414618126155557301584078E2),
+ Q9 = L(9.147150349299596453976674231612674085381E3),
+ Q8 = L(5.605842085972455027590989944010492125825E4),
+ Q7 = L(2.248234257620569139969141618556349415120E5),
+ Q6 = L(6.132189329546557743179177159925690841200E5),
+ Q5 = L(1.158019977462989115839826904108208787040E6),
+ Q4 = L(1.514882452993549494932585972882995548426E6),
+ Q3 = L(1.347518538384329112529391120390701166528E6),
+ Q2 = L(7.777690340007566932935753241556479363645E5),
+ Q1 = L(2.626900195321832660448791748036714883242E5),
+ Q0 = L(3.940717212190338497730839731583397586124E4);
/* Coefficients for log(x) = z + z^3 P(z^2)/Q(z^2),
* where z = 2(x-1)/(x+1)
@@ -96,33 +96,33 @@ static const long double
* Theoretical peak relative error = 1.1e-35,
* relative peak error spread 1.1e-9
*/
-static const long double
- R5 = -8.828896441624934385266096344596648080902E-1L,
- R4 = 8.057002716646055371965756206836056074715E1L,
- R3 = -2.024301798136027039250415126250455056397E3L,
- R2 = 2.048819892795278657810231591630928516206E4L,
- R1 = -8.977257995689735303686582344659576526998E4L,
- R0 = 1.418134209872192732479751274970992665513E5L,
+static const _Float128
+ R5 = L(-8.828896441624934385266096344596648080902E-1),
+ R4 = L(8.057002716646055371965756206836056074715E1),
+ R3 = L(-2.024301798136027039250415126250455056397E3),
+ R2 = L(2.048819892795278657810231591630928516206E4),
+ R1 = L(-8.977257995689735303686582344659576526998E4),
+ R0 = L(1.418134209872192732479751274970992665513E5),
/* S6 = 1.000000000000000000000000000000000000000E0L, */
- S5 = -1.186359407982897997337150403816839480438E2L,
- S4 = 3.998526750980007367835804959888064681098E3L,
- S3 = -5.748542087379434595104154610899551484314E4L,
- S2 = 4.001557694070773974936904547424676279307E5L,
- S1 = -1.332535117259762928288745111081235577029E6L,
- S0 = 1.701761051846631278975701529965589676574E6L;
+ S5 = L(-1.186359407982897997337150403816839480438E2),
+ S4 = L(3.998526750980007367835804959888064681098E3),
+ S3 = L(-5.748542087379434595104154610899551484314E4),
+ S2 = L(4.001557694070773974936904547424676279307E5),
+ S1 = L(-1.332535117259762928288745111081235577029E6),
+ S0 = L(1.701761051846631278975701529965589676574E6);
/* C1 + C2 = ln 2 */
-static const long double C1 = 6.93145751953125E-1L;
-static const long double C2 = 1.428606820309417232121458176568075500134E-6L;
+static const _Float128 C1 = L(6.93145751953125E-1);
+static const _Float128 C2 = L(1.428606820309417232121458176568075500134E-6);
-static const long double sqrth = 0.7071067811865475244008443621048490392848L;
+static const _Float128 sqrth = L(0.7071067811865475244008443621048490392848);
/* ln (2^16384 * (1 - 2^-113)) */
-static const long double zero = 0.0L;
+static const _Float128 zero = 0;
-long double
-__log1pl (long double xm1)
+_Float128
+__log1pl (_Float128 xm1)
{
- long double x, y, z, r, s;
+ _Float128 x, y, z, r, s;
ieee854_long_double_shape_type u;
int32_t hx;
int e;
@@ -145,16 +145,16 @@ __log1pl (long double xm1)
return xm1;
}
- if (xm1 >= 0x1p113L)
+ if (xm1 >= L(0x1p113))
x = xm1;
else
- x = xm1 + 1.0L;
+ x = xm1 + 1;
/* log1p(-1) = -inf */
- if (x <= 0.0L)
+ if (x <= 0)
{
- if (x == 0.0L)
- return (-1.0L / zero); /* log1p(-1) = -inf */
+ if (x == 0)
+ return (-1 / zero); /* log1p(-1) = -inf */
else
return (zero / (x - x));
}
@@ -171,14 +171,14 @@ __log1pl (long double xm1)
if (x < sqrth)
{ /* 2( 2x-1 )/( 2x+1 ) */
e -= 1;
- z = x - 0.5L;
- y = 0.5L * z + 0.5L;
+ z = x - L(0.5);
+ y = L(0.5) * z + L(0.5);
}
else
{ /* 2 (x-1)/(x+1) */
- z = x - 0.5L;
- z -= 0.5L;
- y = 0.5L * x + 0.5L;
+ z = x - L(0.5);
+ z -= L(0.5);
+ y = L(0.5) * x + L(0.5);
}
x = z / y;
z = x * x;
@@ -209,14 +209,14 @@ __log1pl (long double xm1)
{
e -= 1;
if (e != 0)
- x = 2.0L * x - 1.0L; /* 2x - 1 */
+ x = 2 * x - 1; /* 2x - 1 */
else
x = xm1;
}
else
{
if (e != 0)
- x = x - 1.0L;
+ x = x - 1;
else
x = xm1;
}
@@ -249,7 +249,7 @@ __log1pl (long double xm1)
+ Q0;
y = x * (z * r / s);
y = y + e * C2;
- z = y - 0.5L * z;
+ z = y - L(0.5) * z;
z = z + x;
z = z + e * C1;
return (z);
diff --git a/sysdeps/ieee754/ldbl-128/s_logbl.c b/sysdeps/ieee754/ldbl-128/s_logbl.c
index b7c1ca15d7..24baae64fa 100644
--- a/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -26,8 +26,8 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-long double
-__logbl (long double x)
+_Float128
+__logbl (_Float128 x)
{
int64_t lx, hx, ex;
@@ -48,7 +48,7 @@ __logbl (long double x)
ma = __builtin_clzll (hx);
ex -= ma - 16;
}
- return (long double) (ex - 16383);
+ return (_Float128) (ex - 16383);
}
weak_alias (__logbl, logbl)
diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
index 23f828f862..5ba405f1e2 100644
--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
@@ -26,19 +26,19 @@
#include <math_private.h>
#include <fix-fp-int-convert-overflow.h>
-static const long double two112[2] =
+static const _Float128 two112[2] =
{
- 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
+ L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */
+ L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */
};
long int
-__lrintl (long double x)
+__lrintl (_Float128 x)
{
int32_t j0;
u_int64_t i0,i1;
- long double w;
- long double t;
+ _Float128 w;
+ _Float128 t;
long int result;
int sx;
@@ -55,7 +55,7 @@ __lrintl (long double x)
#if defined FE_INVALID || defined FE_INEXACT
/* X < LONG_MAX + 1 implied by J0 < 31. */
if (sizeof (long int) == 4
- && x > (long double) LONG_MAX)
+ && x > (_Float128) LONG_MAX)
{
/* In the event of overflow we must raise the "invalid"
exception, but not "inexact". */
@@ -82,7 +82,7 @@ __lrintl (long double x)
#if defined FE_INVALID || defined FE_INEXACT
/* X < LONG_MAX + 1 implied by J0 < 63. */
if (sizeof (long int) == 8
- && x > (long double) LONG_MAX)
+ && x > (_Float128) LONG_MAX)
{
/* In the event of overflow we must raise the "invalid"
exception, but not "inexact". */
@@ -112,8 +112,8 @@ __lrintl (long double x)
FE_INVALID must be raised and the return value is
unspecified. */
#if defined FE_INVALID || defined FE_INEXACT
- if (x < (long double) LONG_MIN
- && x > (long double) LONG_MIN - 1.0L)
+ if (x < (_Float128) LONG_MIN
+ && x > (_Float128) LONG_MIN - 1)
{
/* If truncation produces LONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
@@ -121,7 +121,7 @@ __lrintl (long double x)
feraiseexcept (t == LONG_MIN ? FE_INEXACT : FE_INVALID);
return LONG_MIN;
}
- else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (long double) LONG_MIN)
+ else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (_Float128) LONG_MIN)
{
feraiseexcept (FE_INVALID);
return sx == 0 ? LONG_MAX : LONG_MIN;
diff --git a/sysdeps/ieee754/ldbl-128/s_lroundl.c b/sysdeps/ieee754/ldbl-128/s_lroundl.c
index f03262543f..8e60af5e73 100644
--- a/sysdeps/ieee754/ldbl-128/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lroundl.c
@@ -26,7 +26,7 @@
#include <fix-fp-int-convert-overflow.h>
long int
-__lroundl (long double x)
+__lroundl (_Float128 x)
{
int64_t j0;
u_int64_t i1, i0;
@@ -88,13 +88,13 @@ __lroundl (long double x)
unspecified. */
#ifdef FE_INVALID
if (FIX_LDBL_LONG_CONVERT_OVERFLOW
- && !(sign == -1 && x > (long double) LONG_MIN - 0.5L))
+ && !(sign == -1 && x > (_Float128) LONG_MIN - L(0.5)))
{
feraiseexcept (FE_INVALID);
return sign == 1 ? LONG_MAX : LONG_MIN;
}
else if (!FIX_LDBL_LONG_CONVERT_OVERFLOW
- && x <= (long double) LONG_MIN - 0.5L)
+ && x <= (_Float128) LONG_MIN - L(0.5))
{
/* If truncation produces LONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
diff --git a/sysdeps/ieee754/ldbl-128/s_modfl.c b/sysdeps/ieee754/ldbl-128/s_modfl.c
index 597a5c9a0c..01e150b24f 100644
--- a/sysdeps/ieee754/ldbl-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_modfl.c
@@ -30,9 +30,9 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0;
+static const _Float128 one = 1.0;
-long double __modfl(long double x, long double *iptr)
+_Float128 __modfl(_Float128 x, _Float128 *iptr)
{
int64_t i0,i1,j0;
u_int64_t i;
diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index 2017c04207..1565a8183f 100644
--- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -27,18 +27,18 @@
#include <math.h>
#include <math_private.h>
-static const long double
+static const _Float128
TWO112[2]={
- 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
+ L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */
+ L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */
};
-long double __nearbyintl(long double x)
+_Float128 __nearbyintl(_Float128 x)
{
fenv_t env;
int64_t i0,j0,sx;
u_int64_t i1 __attribute__ ((unused));
- long double w,t;
+ _Float128 w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
sx = (((u_int64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
diff --git a/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
index 4e9a2ce520..d29f58a7e0 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
@@ -28,7 +28,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-long double __nextafterl(long double x, long double y)
+_Float128 __nextafterl(_Float128 x, _Float128 y)
{
int64_t hx,hy,ix,iy;
u_int64_t lx,ly;
@@ -43,7 +43,7 @@ long double __nextafterl(long double x, long double y)
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
- long double u;
+ _Float128 u;
SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */
u = math_opt_barrier (x);
u = u * u;
@@ -69,12 +69,12 @@ long double __nextafterl(long double x, long double y)
}
hy = hx&0x7fff000000000000LL;
if(hy==0x7fff000000000000LL) {
- long double u = x + x; /* overflow */
+ _Float128 u = x + x; /* overflow */
math_force_eval (u);
__set_errno (ERANGE);
}
if(hy==0) {
- long double u = x*x; /* underflow */
+ _Float128 u = x*x; /* underflow */
math_force_eval (u); /* raise underflow flag */
__set_errno (ERANGE);
}
diff --git a/sysdeps/ieee754/ldbl-128/s_nextupl.c b/sysdeps/ieee754/ldbl-128/s_nextupl.c
index 3ee47d8090..9881804547 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextupl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextupl.c
@@ -20,8 +20,8 @@
#include <math_private.h>
/* Return the least floating-point number greater than X. */
-long double
-__nextupl (long double x)
+_Float128
+__nextupl (_Float128 x)
{
int64_t hx, ix;
u_int64_t lx;
diff --git a/sysdeps/ieee754/ldbl-128/s_remquol.c b/sysdeps/ieee754/ldbl-128/s_remquol.c
index 7356f5f4ef..5fd0946bd4 100644
--- a/sysdeps/ieee754/ldbl-128/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128/s_remquol.c
@@ -23,11 +23,11 @@
#include <math_private.h>
-static const long double zero = 0.0;
+static const _Float128 zero = 0.0;
-long double
-__remquol (long double x, long double y, int *quo)
+_Float128
+__remquol (_Float128 x, _Float128 y, int *quo)
{
int64_t hx,hy;
u_int64_t sx,lx,ly,qs;
@@ -87,7 +87,7 @@ __remquol (long double x, long double y, int *quo)
}
else
{
- long double y_half = 0.5L * y;
+ _Float128 y_half = L(0.5) * y;
if (x > y_half)
{
x -= y;
@@ -103,8 +103,8 @@ __remquol (long double x, long double y, int *quo)
*quo = qs ? -cquo : cquo;
/* Ensure correct sign of zero result in round-downward mode. */
- if (x == 0.0L)
- x = 0.0L;
+ if (x == 0)
+ x = 0;
if (sx)
x = -x;
return x;
diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c
index ae2142b2c9..410951626b 100644
--- a/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -30,17 +30,17 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double
+static const _Float128
TWO112[2]={
5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
-5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
};
-long double __rintl(long double x)
+_Float128 __rintl(_Float128 x)
{
int64_t i0,j0,sx;
u_int64_t i1 __attribute__ ((unused));
- long double w,t;
+ _Float128 w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
sx = (((u_int64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c
index 63ffd73d7e..36db9dc4df 100644
--- a/sysdeps/ieee754/ldbl-128/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_roundl.c
@@ -23,8 +23,8 @@
#include <math_private.h>
-long double
-__roundl (long double x)
+_Float128
+__roundl (_Float128 x)
{
int32_t j0;
u_int64_t i1, i0;
diff --git a/sysdeps/ieee754/ldbl-128/s_scalblnl.c b/sysdeps/ieee754/ldbl-128/s_scalblnl.c
index 1e24197c63..5864eaf93c 100644
--- a/sysdeps/ieee754/ldbl-128/s_scalblnl.c
+++ b/sysdeps/ieee754/ldbl-128/s_scalblnl.c
@@ -28,13 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double
-two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
-twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
-huge = 1.0E+4900L,
-tiny = 1.0E-4900L;
+static const _Float128
+two114 = L(2.0769187434139310514121985316880384E+34), /* 0x4071000000000000, 0 */
+twom114 = L(4.8148248609680896326399448564623183E-35), /* 0x3F8D000000000000, 0 */
+huge = L(1.0E+4900),
+tiny = L(1.0E-4900);
-long double __scalblnl (long double x, long int n)
+_Float128 __scalblnl (_Float128 x, long int n)
{
int64_t k,hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_scalbnl.c b/sysdeps/ieee754/ldbl-128/s_scalbnl.c
index a5cbd0d9d2..e6fe796079 100644
--- a/sysdeps/ieee754/ldbl-128/s_scalbnl.c
+++ b/sysdeps/ieee754/ldbl-128/s_scalbnl.c
@@ -28,13 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double
-two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
-twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
-huge = 1.0E+4900L,
-tiny = 1.0E-4900L;
+static const _Float128
+two114 = L(2.0769187434139310514121985316880384E+34), /* 0x4071000000000000, 0 */
+twom114 = L(4.8148248609680896326399448564623183E-35), /* 0x3F8D000000000000, 0 */
+huge = L(1.0E+4900),
+tiny = L(1.0E-4900);
-long double __scalbnl (long double x, int n)
+_Float128 __scalbnl (_Float128 x, int n)
{
int64_t k,hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_signbitl.c b/sysdeps/ieee754/ldbl-128/s_signbitl.c
index ee5d77e27a..53ed4a5bc2 100644
--- a/sysdeps/ieee754/ldbl-128/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128/s_signbitl.c
@@ -18,9 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
int
-__signbitl (long double x)
+__signbitl (_Float128 x)
{
return __builtin_signbitl (x);
}
diff --git a/sysdeps/ieee754/ldbl-128/s_sincosl.c b/sysdeps/ieee754/ldbl-128/s_sincosl.c
index 1abdb4419e..6247785b09 100644
--- a/sysdeps/ieee754/ldbl-128/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sincosl.c
@@ -24,7 +24,7 @@
#include <math_private.h>
void
-__sincosl (long double x, long double *sinx, long double *cosx)
+__sincosl (_Float128 x, _Float128 *sinx, _Float128 *cosx)
{
int64_t ix;
@@ -34,7 +34,7 @@ __sincosl (long double x, long double *sinx, long double *cosx)
/* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL;
if (ix <= 0x3ffe921fb54442d1LL)
- __kernel_sincosl (x, 0.0L, sinx, cosx, 0);
+ __kernel_sincosl (x, 0, sinx, cosx, 0);
else if (ix >= 0x7fff000000000000LL)
{
/* sin(Inf or NaN) is NaN */
@@ -45,7 +45,7 @@ __sincosl (long double x, long double *sinx, long double *cosx)
else
{
/* Argument reduction needed. */
- long double y[2];
+ _Float128 y[2];
int n;
n = __ieee754_rem_pio2l (x, y);
diff --git a/sysdeps/ieee754/ldbl-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c
index 582a53fd7a..887e45dbfa 100644
--- a/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -48,9 +48,9 @@
#include <math.h>
#include <math_private.h>
-long double __sinl(long double x)
+_Float128 __sinl(_Float128 x)
{
- long double y[2],z=0.0L;
+ _Float128 y[2],z=0;
int64_t n, ix;
/* High word of x. */
diff --git a/sysdeps/ieee754/ldbl-128/s_tanhl.c b/sysdeps/ieee754/ldbl-128/s_tanhl.c
index f7a1d20f79..0db8f5f775 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanhl.c
@@ -45,12 +45,12 @@
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0, two = 2.0, tiny = 1.0e-4900L;
+static const _Float128 one = 1.0, two = 2.0, tiny = L(1.0e-4900);
-long double
-__tanhl (long double x)
+_Float128
+__tanhl (_Float128 x)
{
- long double t, z;
+ _Float128 t, z;
u_int32_t jx, ix;
ieee854_long_double_shape_type u;
diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c
index c7d637402b..cd7b258616 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanl.c
@@ -48,9 +48,9 @@
#include <math.h>
#include <math_private.h>
-long double __tanl(long double x)
+_Float128 __tanl(_Float128 x)
{
- long double y[2],z=0.0L;
+ _Float128 y[2],z=0;
int64_t n, ix;
/* High word of x. */
diff --git a/sysdeps/ieee754/ldbl-128/s_totalorderl.c b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
new file mode 100644
index 0000000000..32ede1f4be
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
@@ -0,0 +1,54 @@
+/* Total order operation. ldbl-128 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalorderl (_Float128 x, _Float128 y)
+{
+ int64_t hx, hy;
+ uint64_t lx, ly;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ GET_LDOUBLE_WORDS64 (hy, ly, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ uint64_t uhx = hx & 0x7fffffffffffffffULL;
+ uint64_t uhy = hy & 0x7fffffffffffffffULL;
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((uhx > 0x7fff000000000000ULL || (uhx == 0x7fff000000000000ULL
+ && lx != 0))
+ && (uhy > 0x7fff000000000000ULL || (uhy == 0x7fff000000000000ULL
+ && ly != 0)))
+ {
+ hx ^= 0x0000800000000000ULL;
+ hy ^= 0x0000800000000000ULL;
+ }
+#endif
+ uint64_t hx_sign = hx >> 63;
+ uint64_t hy_sign = hy >> 63;
+ hx ^= hx_sign >> 1;
+ lx ^= hx_sign;
+ hy ^= hy_sign >> 1;
+ ly ^= hy_sign;
+ return hx < hy || (hx == hy && lx <= ly);
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
new file mode 100644
index 0000000000..5446809a42
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
@@ -0,0 +1,48 @@
+/* Total order operation on absolute values. ldbl-128 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalordermagl (_Float128 x, _Float128 y)
+{
+ uint64_t hx, hy;
+ uint64_t lx, ly;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ GET_LDOUBLE_WORDS64 (hy, ly, y);
+ hx &= 0x7fffffffffffffffULL;
+ hy &= 0x7fffffffffffffffULL;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((hx > 0x7fff000000000000ULL || (hx == 0x7fff000000000000ULL
+ && lx != 0))
+ && (hy > 0x7fff000000000000ULL || (hy == 0x7fff000000000000ULL
+ && ly != 0)))
+ {
+ hx ^= 0x0000800000000000ULL;
+ hy ^= 0x0000800000000000ULL;
+ }
+#endif
+ return hx < hy || (hx == hy && lx <= ly);
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_truncl.c b/sysdeps/ieee754/ldbl-128/s_truncl.c
index c71f0aba92..72e74ab6f7 100644
--- a/sysdeps/ieee754/ldbl-128/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128/s_truncl.c
@@ -23,8 +23,8 @@
#include <math_private.h>
-long double
-__truncl (long double x)
+_Float128
+__truncl (_Float128 x)
{
int32_t j0;
u_int64_t i0, i1, sx;
diff --git a/sysdeps/ieee754/ldbl-128/t_expl.h b/sysdeps/ieee754/ldbl-128/t_expl.h
index a23d3d9344..2f48c69631 100644
--- a/sysdeps/ieee754/ldbl-128/t_expl.h
+++ b/sysdeps/ieee754/ldbl-128/t_expl.h
@@ -29,942 +29,942 @@
__expl_table[T_EXPL_ARGN+2*i] == i/S+s
where absl(s) <= 2^-54 and absl(r) <= 2^-212. */
-static const long double __expl_table [] = {
- -3.47656250000000000584188889839535373E-01L, /* bffd640000000000002b1b04213cf000 */
- 6.90417668990715641167244540876988960E-32L, /* 3f97667c3fdb588a6ae1af8748357a17 */
- -3.43749999999999981853132895957607418E-01L, /* bffd5ffffffffffffac4ff5f4050b000 */
- -7.16021898043268093462818380603370350E-33L, /* bf94296c8219427edc1431ac2498583e */
- -3.39843750000000013418643523138766329E-01L, /* bffd5c000000000003de1f027a30e000 */
- 8.16920774283317801641347327589583265E-32L, /* 3f97a82b65774bdca1b4440d749ed8d3 */
- -3.35937500000000014998092453039303051E-01L, /* bffd5800000000000452a9f4d8857000 */
- -6.55865578425428447938248396879359670E-32L, /* bf97548b7d240f3d034b395e6eecfac8 */
- -3.32031250000000000981984049529998541E-01L, /* bffd540000000000004875277cda5000 */
- 6.91213046334032232108944519541512737E-32L, /* 3f9766e5f925338a19045c94443b66e1 */
- -3.28124999999999986646017645350399708E-01L, /* bffd4ffffffffffffc26a667bf44d000 */
- -6.16281060996110316602421505683742661E-32L, /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
- -3.24218749999999991645717430645867963E-01L, /* bffd4bfffffffffffd97901063e48000 */
- -7.90797211087760527593856542417304137E-32L, /* bf979a9afaaca1ada6a8ed1c80584d60 */
- -3.20312499999999998918211610690789652E-01L, /* bffd47ffffffffffffb02d9856d71000 */
- 8.64024799457616856987630373786503376E-32L, /* 3f97c0a098623f95579d5d9b2b67342d */
- -3.16406249999999998153974811017181883E-01L, /* bffd43ffffffffffff77c991f1076000 */
- -2.73176610180696076418536105483668404E-32L, /* bf961baeccb32f9b1fcbb8e60468e95a */
- -3.12500000000000011420976192575972779E-01L, /* bffd400000000000034ab8240483d000 */
- 7.16573502812389453744433792609989420E-32L, /* 3f977410f4c2cfc4335f28446c0fb363 */
- -3.08593750000000001735496343854851414E-01L, /* bffd3c000000000000800e995c176000 */
- -1.56292999645122272621237565671593071E-32L, /* bf95449b9cbdaff6ac1246adb2c826ac */
- -3.04687499999999982592401295899221626E-01L, /* bffd37fffffffffffafb8bc1e061a000 */
- 6.48993208584888904958594509625158417E-32L, /* 3f9750f9fe8366d82d77afa0031a92e1 */
- -3.00781249999999999230616898937763959E-01L, /* bffd33ffffffffffffc73ac39da54000 */
- 6.57082437496961397305801409357792029E-32L, /* 3f97552d3cb598ea80135cf3feb27ec4 */
- -2.96874999999999998788769281703245722E-01L, /* bffd2fffffffffffffa6a07fa5021000 */
- -3.26588297198283968096426564544269170E-32L, /* bf9653260fc1802f46b629aee171809b */
- -2.92968750000000015318089182805941695E-01L, /* bffd2c0000000000046a468614bd6000 */
- -1.73291974845198589684358727559290718E-32L, /* bf9567e9d158f52e483c8d8dcb5961dd */
- -2.89062500000000007736778942676309681E-01L, /* bffd280000000000023adf9f4c3d3000 */
- -6.83629745986675744404029225571026236E-32L, /* bf9762f5face6281c1daf1c6aedbdb45 */
- -2.85156250000000001367091555763661937E-01L, /* bffd2400000000000064dfa11e3fb000 */
- -5.44898442619766878281110054067026237E-32L, /* bf971aed6d2db9f542986a785edae072 */
- -2.81249999999999986958718100227029406E-01L, /* bffd1ffffffffffffc3db9265ca9d000 */
- 1.13007318374506125723591889451107046E-32L, /* 3f94d569fe387f456a97902907ac3856 */
- -2.77343750000000000356078829380495179E-01L, /* bffd1c0000000000001a462390083000 */
- -4.98979365468978332358409063436543102E-32L, /* bf970315bbf3e0d14b5c94c900702d4c */
- -2.73437499999999990276993957508540484E-01L, /* bffd17fffffffffffd32919bcdc94000 */
- -8.79390484115892344533724650295100871E-32L, /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
- -2.69531250000000002434203866460082225E-01L, /* bffd14000000000000b39ccf9e130000 */
- 9.44060754687026590886751809927191596E-32L, /* 3f97ea2f32cfecca5c64a26137a9210f */
- -2.65624999999999997296320716986257179E-01L, /* bffd0fffffffffffff3880f13a2bc000 */
- 2.07142664067265697791007875348396921E-32L, /* 3f95ae37ee685b9122fbe377bd205ee4 */
- -2.61718750000000010237478733739017956E-01L, /* bffd0c000000000002f3648179d40000 */
- -6.10552936159265665298996309192680256E-32L, /* bf973d0467d31e407515a3cca0f3b4e2 */
- -2.57812500000000011948220522778370303E-01L, /* bffd08000000000003719f81275bd000 */
- 6.72477169058908902499239631466443836E-32L, /* 3f975d2b8c475d3160cf72d227d8e6f9 */
- -2.53906249999999991822993360536596860E-01L, /* bffd03fffffffffffda4a4b62f818000 */
- -2.44868296623215865054704392917190994E-32L, /* bf95fc92516c6d057d29fc2528855976 */
- -2.49999999999999986862019457428548084E-01L, /* bffcfffffffffffff86d2d20d5ff4000 */
- -3.85302898949105073614122724961613078E-32L, /* bf96901f147cb7d643af71b6129ce929 */
- -2.46093750000000000237554160737318435E-01L, /* bffcf8000000000000230e8ade26b000 */
- -1.52823675242678363494345369284988589E-32L, /* bf953d6700c5f3fc303f79d0ec8c680a */
- -2.42187500000000003023380963205457065E-01L, /* bffcf0000000000001be2c1a78bb0000 */
- -7.78402037952209709489481182714311699E-34L, /* bf9102ab1f3998e887f0ee4cf940faa5 */
- -2.38281249999999995309623303145485725E-01L, /* bffce7fffffffffffd4bd2940f43f000 */
- -3.54307216794236899443913216397197696E-32L, /* bf966fef03ab69c3f289436205b21d02 */
- -2.34374999999999998425804947623207526E-01L, /* bffcdfffffffffffff17b097a6092000 */
- -2.86038428948386602859761879407549696E-32L, /* bf96290a0eba0131efe3a05fe188f2e3 */
- -2.30468749999999993822207406785200832E-01L, /* bffcd7fffffffffffc70519834eae000 */
- -2.54339521031747516806893838749365762E-32L, /* bf96081f0ad7f9107ae6cddb32c178ab */
- -2.26562499999999997823524030344489884E-01L, /* bffccffffffffffffebecf10093df000 */
- 4.31904611473158635644635628922959401E-32L, /* 3f96c083f0b1faa7c4c686193e38d67c */
- -2.22656250000000004835132405125162742E-01L, /* bffcc8000000000002c98a233f19f000 */
- 2.54709791629335691650310168420597566E-33L, /* 3f92a735903f5eed07a716ab931e20d9 */
- -2.18749999999999988969454021829236626E-01L, /* bffcbffffffffffff9a42dc14ce36000 */
- -3.77236096429336082213752014054909454E-32L, /* bf9687be8e5b2fca54d3e81157eac660 */
- -2.14843750000000010613256919115758495E-01L, /* bffcb80000000000061e3d828ecac000 */
- -4.55194148712216691177097854305964738E-32L, /* bf96d8b35c776aa3e1a4768271380503 */
- -2.10937499999999993204656148110447201E-01L, /* bffcaffffffffffffc152f2aea118000 */
- -2.95044199165561453749332254271716417E-32L, /* bf96326433b00b2439094d9bef22ddd1 */
- -2.07031250000000012233944895423355677E-01L, /* bffca80000000000070d695ee0e94000 */
- 1.93146788688385419095981415411012357E-32L, /* 3f959126729135a5e390d4bb802a0bde */
- -2.03125000000000008030983633336321863E-01L, /* bffca0000000000004a129fbc51af000 */
- 2.37361904671826193563212931215900137E-32L, /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
- -1.99218750000000001763815712796132779E-01L, /* bffc98000000000001044b12d9950000 */
- -3.63171243370923753295192486732883239E-33L, /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
- -1.95312500000000004883660234506677272E-01L, /* bffc90000000000002d0b3779d1f9000 */
- -3.19989507343607877747980892249711601E-33L, /* bf9309d63de96bb3ef744c865f22f1bd */
- -1.91406250000000013720152363227519348E-01L, /* bffc88000000000007e8bcb387121000 */
- -1.89295754093147174148371614722178860E-32L, /* bf958926e2e67dfe812c508290add2e7 */
- -1.87500000000000000182342082774432620E-01L, /* bffc800000000000001ae8b06a39f000 */
- -2.96812835183184815200854214892983927E-32L, /* bf96343a62d156bbe71f55d14ca4b6e5 */
- -1.83593750000000012410147185883290345E-01L, /* bffc78000000000007276a1adda8d000 */
- -2.02191931237489669058466239995304587E-32L, /* bf95a3efab92d26ec2df90df036a117f */
- -1.79687499999999997439177363346082917E-01L, /* bffc6ffffffffffffe8616db2927d000 */
- -9.92752326937775530007399526834009465E-33L, /* bf949c5f88ed17041e1a3f1829d543cd */
- -1.75781249999999995824373974504785174E-01L, /* bffc67fffffffffffd97c94f13ea3000 */
- 1.44184772065335613487885714828816178E-32L, /* 3f952b75c63476e7fcc2f5841c27bcce */
- -1.71874999999999986685050259043077809E-01L, /* bffc5ffffffffffff8530f6bc531a000 */
- -3.49007014971241147689894940544402482E-32L, /* bf966a6dfaa012aea8ffe6d90b02330f */
- -1.67968749999999997316058782350439701E-01L, /* bffc57fffffffffffe73eb914f2aa000 */
- 3.34025733574205019081305778794376391E-32L, /* 3f965adf4572561fd5456a6c13d8babf */
- -1.64062499999999993322730602128318480E-01L, /* bffc4ffffffffffffc269be4f68f3000 */
- -1.83345916769684984022099095506340635E-32L, /* bf957ccb69026cb2f6024c211576d5f4 */
- -1.60156249999999992419000744447607979E-01L, /* bffc47fffffffffffba13df21784a000 */
- 2.73442789798110494773517431626534726E-32L, /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
- -1.56249999999999987665010524130393080E-01L, /* bffc3ffffffffffff8e3ad45e7508000 */
- 2.02695576464836145806428118889332191E-32L, /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
- -1.52343749999999989905291167951491803E-01L, /* bffc37fffffffffffa2e48aecfc24000 */
- -3.61436631548815190395331054871041524E-32L, /* bf967756567ebd108075ae527cc2e7f0 */
- -1.48437500000000006686107754967759751E-01L, /* bffc30000000000003dab20261b3c000 */
- -2.15524270159131591469319477922198390E-32L, /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
- -1.44531250000000005132889939177166485E-01L, /* bffc28000000000002f57b1969e7b000 */
- 2.74741116529653547935086189244019604E-32L, /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
- -1.40625000000000000707469094533647325E-01L, /* bffc2000000000000068676d3d5c4000 */
- 4.40607097220049957013547629906723266E-33L, /* 3f936e0ac425daf795b42913cf0ef881 */
- -1.36718749999999995713752139187543306E-01L, /* bffc17fffffffffffd87762255991000 */
- -3.73751317180116492404578048203389108E-32L, /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
- -1.32812500000000007198453630478482191E-01L, /* bffc10000000000004264de3a4379000 */
- -3.97050085179660203884930593717220728E-32L, /* bf969c52048de14be3c9c1971e50869c */
- -1.28906250000000006070486371645733082E-01L, /* bffc080000000000037fd87db2cb0000 */
- 3.59610068058504988294019521946586131E-32L, /* 3f967570c10687cb8e9ebd0b280abf5a */
- -1.25000000000000003700729208608337966E-01L, /* bffc00000000000002222198bbc74000 */
- 3.23464851393124362331846965931995969E-33L, /* 3f930cb95da3bfc847e593716c91d57a */
- -1.21093750000000013729038501177102555E-01L, /* bffbf000000000000fd418d1f5fda000 */
- 2.45242487730722066611358741283977619E-32L, /* 3f95fd5945ad86a464292e26ac192a84 */
- -1.17187499999999999765305306880205578E-01L, /* bffbdfffffffffffffbabaf869845000 */
- -1.14557520298960389903199646350205537E-32L, /* bf94dbda735322179d9bcf392e1dd06d */
- -1.13281250000000009579647893740755690E-01L, /* bffbd000000000000b0b69bae7ab9000 */
- 2.37873962873837390105423621772752350E-32L, /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
- -1.09375000000000008981153004560108539E-01L, /* bffbc000000000000a5ac4bc1d2c3000 */
- 1.53152444860014076105003555837231015E-32L, /* 3f953e15ce931e12ef9a152522e32bdd */
- -1.05468749999999992399063850363228723E-01L, /* bffbaffffffffffff73c998091408000 */
- -8.75920903597804862471749360196688834E-33L, /* bf946bd7e310a01bae5687ebdc47fcc5 */
- -1.01562500000000007685885179918350550E-01L, /* bffba0000000000008dc7910a648c000 */
- -4.63820993797174451904075397785059501E-33L, /* bf938153d0e54001a472da180fb5e8aa */
- -9.76562499999999887262211517861331814E-02L, /* bffb8ffffffffffff300915aa6fd6000 */
- -2.63767025974952608658936466715705903E-33L, /* bf92b64215bb8d520be5404620d38088 */
- -9.37499999999999939650246024457439795E-02L, /* bffb7ffffffffffff90aca26bd0fc000 */
- -1.72047822349322956713582039121348377E-32L, /* bf9565545015c5b9b56d02cfefca2c7d */
- -8.98437500000000033088896383977486369E-02L, /* bffb70000000000003d09ca1e3cbe000 */
- 3.04831994420989436248526129869697270E-33L, /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
- -8.59374999999999947312400115121319225E-02L, /* bffb5ffffffffffff9ecefc03376e000 */
- 1.50416954438393392150792422537312281E-32L, /* 3f9538675ee99bd722fad0023c09c915 */
- -8.20312500000000054182280847004695514E-02L, /* bffb500000000000063f2dbd40200000 */
- 2.68399664523430004488075638997207289E-33L, /* 3f92bdf49766629882c49a3da88928ed */
- -7.81250000000000114767533968079748798E-02L, /* bffb4000000000000d3b56f81ba70000 */
- 1.72318124201659121296305402819694281E-32L, /* 3f9565e407aaabfb359e8a567d760de3 */
- -7.42187500000000035531829472486812869E-02L, /* bffb3000000000000418b6e9b5388000 */
- 2.09401756478514117051383998628099655E-32L, /* 3f95b2e91221fcd74be0a86d8ad658d2 */
- -7.03124999999999987474933134860732535E-02L, /* bffb1ffffffffffffe8e53453d2ac000 */
- 2.28515798224350800271565551341211666E-32L, /* 3f95da9bd6adf00894f05b5cc5530125 */
- -6.64062500000000042267533361089054159E-02L, /* bffb10000000000004df8473dbcf2000 */
- 1.97576478800281368377376002585430031E-32L, /* 3f959a59acbddb2f53bd3096b66370e9 */
- -6.25000000000000066329769382774201686E-02L, /* bffb00000000000007a5b5914e336000 */
- -1.46422615813786836245343723048221678E-33L, /* bf91e69295f069fc0c4a9db181ea25a3 */
- -5.85937500000000002823707957982406053E-02L, /* bffae0000000000000a6aeab10592000 */
- 9.25637741701318872896718218457555829E-33L, /* 3f94807eb021f1f40a37d4015b1eb76b */
- -5.46875000000000081586888005226044448E-02L, /* bffac0000000000012d00a3171e3a000 */
- -4.87144542459404765480424673678105050E-33L, /* bf9394b42faba6b7036fe7b36269daf3 */
- -5.07812499999999927720348253140567013E-02L, /* bffa9fffffffffffef555cc8dd914000 */
- -3.01901021987395945826043649523451725E-33L, /* bf92f59e7e3025691f290f8f67277faf */
- -4.68749999999999935349476738962633103E-02L, /* bffa7ffffffffffff117b4ea2b876000 */
- 1.21521638219189777347767475937119750E-32L, /* 3f94f8c7f88c5b56674b94d984ac8ecb */
- -4.29687500000000056305562847814228219E-02L, /* bffa6000000000000cfbb19be30c0000 */
- -1.18643699217679276275559592978275214E-32L, /* bf94ecd39f0833a876550e83eb012b99 */
- -3.90624999999999962692914526031373542E-02L, /* bffa3ffffffffffff765c743922f9000 */
- -4.91277156857520035712509544689973679E-33L, /* bf939823189996193872e58ac0dececb */
- -3.51562500000000108152468207687602886E-02L, /* bffa20000000000018f031e41177f000 */
- 1.18599806302656253755207072755609820E-32L, /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
- -3.12500000000000077376981036742289578E-02L, /* bffa00000000000011d787e0b386f000 */
- 9.97730386477005171963635210799577079E-33L, /* 3f949e70e498c46a0173ac0d46c699fc */
- -2.73437500000000139436129596418623235E-02L, /* bff9c00000000000404db66e70a08000 */
- 2.25755321633070123579875157841633859E-33L, /* 3f927719b1a93074bdf9f3c2cb784785 */
- -2.34375000000000088003629211828324876E-02L, /* bff98000000000002895a27d45feb000 */
- 2.84374279216848803102126617873942975E-33L, /* 3f92d87f70e749d6da6c260b68dc210b */
- -1.95312500000000107408831063404855424E-02L, /* bff9400000000000318898ba69f71000 */
- 2.47348089686935458989103979140011912E-33L, /* 3f929afa3de45086fe909fdddb41edce */
- -1.56250000000000081443917555362290635E-02L, /* bff9000000000000258f335e9cdd6000 */
- -2.43379314483517422161458863218426254E-33L, /* bf9294621c8a9ccacf2b020ec19cad27 */
- -1.17187500000000051490597418161403184E-02L, /* bff88000000000002f7ddfa26221f000 */
- 1.83405297208145390679150568810924707E-33L, /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
- -7.81249999999999715861805208310174953E-03L, /* bff7ffffffffffffcb95f3fff157d000 */
- 3.51548384878710915171654413641872451E-34L, /* 3f8fd349b76c22966f77a39fc37ed704 */
- -3.90625000000000309326013918295097128E-03L, /* bff7000000000000390f820c8e153000 */
- 6.38058004651791109324060099097251911E-36L, /* 3f8a0f665d3ac25a1ac94d688273dbcd */
+static const _Float128 __expl_table [] = {
+ L(-3.47656250000000000584188889839535373E-01), /* bffd640000000000002b1b04213cf000 */
+ L(6.90417668990715641167244540876988960E-32), /* 3f97667c3fdb588a6ae1af8748357a17 */
+ L(-3.43749999999999981853132895957607418E-01), /* bffd5ffffffffffffac4ff5f4050b000 */
+ L(-7.16021898043268093462818380603370350E-33), /* bf94296c8219427edc1431ac2498583e */
+ L(-3.39843750000000013418643523138766329E-01), /* bffd5c000000000003de1f027a30e000 */
+ L(8.16920774283317801641347327589583265E-32), /* 3f97a82b65774bdca1b4440d749ed8d3 */
+ L(-3.35937500000000014998092453039303051E-01), /* bffd5800000000000452a9f4d8857000 */
+ L(-6.55865578425428447938248396879359670E-32), /* bf97548b7d240f3d034b395e6eecfac8 */
+ L(-3.32031250000000000981984049529998541E-01), /* bffd540000000000004875277cda5000 */
+ L(6.91213046334032232108944519541512737E-32), /* 3f9766e5f925338a19045c94443b66e1 */
+ L(-3.28124999999999986646017645350399708E-01), /* bffd4ffffffffffffc26a667bf44d000 */
+ L(-6.16281060996110316602421505683742661E-32), /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
+ L(-3.24218749999999991645717430645867963E-01), /* bffd4bfffffffffffd97901063e48000 */
+ L(-7.90797211087760527593856542417304137E-32), /* bf979a9afaaca1ada6a8ed1c80584d60 */
+ L(-3.20312499999999998918211610690789652E-01), /* bffd47ffffffffffffb02d9856d71000 */
+ L(8.64024799457616856987630373786503376E-32), /* 3f97c0a098623f95579d5d9b2b67342d */
+ L(-3.16406249999999998153974811017181883E-01), /* bffd43ffffffffffff77c991f1076000 */
+ L(-2.73176610180696076418536105483668404E-32), /* bf961baeccb32f9b1fcbb8e60468e95a */
+ L(-3.12500000000000011420976192575972779E-01), /* bffd400000000000034ab8240483d000 */
+ L(7.16573502812389453744433792609989420E-32), /* 3f977410f4c2cfc4335f28446c0fb363 */
+ L(-3.08593750000000001735496343854851414E-01), /* bffd3c000000000000800e995c176000 */
+ L(-1.56292999645122272621237565671593071E-32), /* bf95449b9cbdaff6ac1246adb2c826ac */
+ L(-3.04687499999999982592401295899221626E-01), /* bffd37fffffffffffafb8bc1e061a000 */
+ L(6.48993208584888904958594509625158417E-32), /* 3f9750f9fe8366d82d77afa0031a92e1 */
+ L(-3.00781249999999999230616898937763959E-01), /* bffd33ffffffffffffc73ac39da54000 */
+ L(6.57082437496961397305801409357792029E-32), /* 3f97552d3cb598ea80135cf3feb27ec4 */
+ L(-2.96874999999999998788769281703245722E-01), /* bffd2fffffffffffffa6a07fa5021000 */
+ L(-3.26588297198283968096426564544269170E-32), /* bf9653260fc1802f46b629aee171809b */
+ L(-2.92968750000000015318089182805941695E-01), /* bffd2c0000000000046a468614bd6000 */
+ L(-1.73291974845198589684358727559290718E-32), /* bf9567e9d158f52e483c8d8dcb5961dd */
+ L(-2.89062500000000007736778942676309681E-01), /* bffd280000000000023adf9f4c3d3000 */
+ L(-6.83629745986675744404029225571026236E-32), /* bf9762f5face6281c1daf1c6aedbdb45 */
+ L(-2.85156250000000001367091555763661937E-01), /* bffd2400000000000064dfa11e3fb000 */
+ L(-5.44898442619766878281110054067026237E-32), /* bf971aed6d2db9f542986a785edae072 */
+ L(-2.81249999999999986958718100227029406E-01), /* bffd1ffffffffffffc3db9265ca9d000 */
+ L(1.13007318374506125723591889451107046E-32), /* 3f94d569fe387f456a97902907ac3856 */
+ L(-2.77343750000000000356078829380495179E-01), /* bffd1c0000000000001a462390083000 */
+ L(-4.98979365468978332358409063436543102E-32), /* bf970315bbf3e0d14b5c94c900702d4c */
+ L(-2.73437499999999990276993957508540484E-01), /* bffd17fffffffffffd32919bcdc94000 */
+ L(-8.79390484115892344533724650295100871E-32), /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
+ L(-2.69531250000000002434203866460082225E-01), /* bffd14000000000000b39ccf9e130000 */
+ L(9.44060754687026590886751809927191596E-32), /* 3f97ea2f32cfecca5c64a26137a9210f */
+ L(-2.65624999999999997296320716986257179E-01), /* bffd0fffffffffffff3880f13a2bc000 */
+ L(2.07142664067265697791007875348396921E-32), /* 3f95ae37ee685b9122fbe377bd205ee4 */
+ L(-2.61718750000000010237478733739017956E-01), /* bffd0c000000000002f3648179d40000 */
+ L(-6.10552936159265665298996309192680256E-32), /* bf973d0467d31e407515a3cca0f3b4e2 */
+ L(-2.57812500000000011948220522778370303E-01), /* bffd08000000000003719f81275bd000 */
+ L(6.72477169058908902499239631466443836E-32), /* 3f975d2b8c475d3160cf72d227d8e6f9 */
+ L(-2.53906249999999991822993360536596860E-01), /* bffd03fffffffffffda4a4b62f818000 */
+ L(-2.44868296623215865054704392917190994E-32), /* bf95fc92516c6d057d29fc2528855976 */
+ L(-2.49999999999999986862019457428548084E-01), /* bffcfffffffffffff86d2d20d5ff4000 */
+ L(-3.85302898949105073614122724961613078E-32), /* bf96901f147cb7d643af71b6129ce929 */
+ L(-2.46093750000000000237554160737318435E-01), /* bffcf8000000000000230e8ade26b000 */
+ L(-1.52823675242678363494345369284988589E-32), /* bf953d6700c5f3fc303f79d0ec8c680a */
+ L(-2.42187500000000003023380963205457065E-01), /* bffcf0000000000001be2c1a78bb0000 */
+ L(-7.78402037952209709489481182714311699E-34), /* bf9102ab1f3998e887f0ee4cf940faa5 */
+ L(-2.38281249999999995309623303145485725E-01), /* bffce7fffffffffffd4bd2940f43f000 */
+ L(-3.54307216794236899443913216397197696E-32), /* bf966fef03ab69c3f289436205b21d02 */
+ L(-2.34374999999999998425804947623207526E-01), /* bffcdfffffffffffff17b097a6092000 */
+ L(-2.86038428948386602859761879407549696E-32), /* bf96290a0eba0131efe3a05fe188f2e3 */
+ L(-2.30468749999999993822207406785200832E-01), /* bffcd7fffffffffffc70519834eae000 */
+ L(-2.54339521031747516806893838749365762E-32), /* bf96081f0ad7f9107ae6cddb32c178ab */
+ L(-2.26562499999999997823524030344489884E-01), /* bffccffffffffffffebecf10093df000 */
+ L(4.31904611473158635644635628922959401E-32), /* 3f96c083f0b1faa7c4c686193e38d67c */
+ L(-2.22656250000000004835132405125162742E-01), /* bffcc8000000000002c98a233f19f000 */
+ L(2.54709791629335691650310168420597566E-33), /* 3f92a735903f5eed07a716ab931e20d9 */
+ L(-2.18749999999999988969454021829236626E-01), /* bffcbffffffffffff9a42dc14ce36000 */
+ L(-3.77236096429336082213752014054909454E-32), /* bf9687be8e5b2fca54d3e81157eac660 */
+ L(-2.14843750000000010613256919115758495E-01), /* bffcb80000000000061e3d828ecac000 */
+ L(-4.55194148712216691177097854305964738E-32), /* bf96d8b35c776aa3e1a4768271380503 */
+ L(-2.10937499999999993204656148110447201E-01), /* bffcaffffffffffffc152f2aea118000 */
+ L(-2.95044199165561453749332254271716417E-32), /* bf96326433b00b2439094d9bef22ddd1 */
+ L(-2.07031250000000012233944895423355677E-01), /* bffca80000000000070d695ee0e94000 */
+ L(1.93146788688385419095981415411012357E-32), /* 3f959126729135a5e390d4bb802a0bde */
+ L(-2.03125000000000008030983633336321863E-01), /* bffca0000000000004a129fbc51af000 */
+ L(2.37361904671826193563212931215900137E-32), /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
+ L(-1.99218750000000001763815712796132779E-01), /* bffc98000000000001044b12d9950000 */
+ L(-3.63171243370923753295192486732883239E-33), /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
+ L(-1.95312500000000004883660234506677272E-01), /* bffc90000000000002d0b3779d1f9000 */
+ L(-3.19989507343607877747980892249711601E-33), /* bf9309d63de96bb3ef744c865f22f1bd */
+ L(-1.91406250000000013720152363227519348E-01), /* bffc88000000000007e8bcb387121000 */
+ L(-1.89295754093147174148371614722178860E-32), /* bf958926e2e67dfe812c508290add2e7 */
+ L(-1.87500000000000000182342082774432620E-01), /* bffc800000000000001ae8b06a39f000 */
+ L(-2.96812835183184815200854214892983927E-32), /* bf96343a62d156bbe71f55d14ca4b6e5 */
+ L(-1.83593750000000012410147185883290345E-01), /* bffc78000000000007276a1adda8d000 */
+ L(-2.02191931237489669058466239995304587E-32), /* bf95a3efab92d26ec2df90df036a117f */
+ L(-1.79687499999999997439177363346082917E-01), /* bffc6ffffffffffffe8616db2927d000 */
+ L(-9.92752326937775530007399526834009465E-33), /* bf949c5f88ed17041e1a3f1829d543cd */
+ L(-1.75781249999999995824373974504785174E-01), /* bffc67fffffffffffd97c94f13ea3000 */
+ L(1.44184772065335613487885714828816178E-32), /* 3f952b75c63476e7fcc2f5841c27bcce */
+ L(-1.71874999999999986685050259043077809E-01), /* bffc5ffffffffffff8530f6bc531a000 */
+ L(-3.49007014971241147689894940544402482E-32), /* bf966a6dfaa012aea8ffe6d90b02330f */
+ L(-1.67968749999999997316058782350439701E-01), /* bffc57fffffffffffe73eb914f2aa000 */
+ L(3.34025733574205019081305778794376391E-32), /* 3f965adf4572561fd5456a6c13d8babf */
+ L(-1.64062499999999993322730602128318480E-01), /* bffc4ffffffffffffc269be4f68f3000 */
+ L(-1.83345916769684984022099095506340635E-32), /* bf957ccb69026cb2f6024c211576d5f4 */
+ L(-1.60156249999999992419000744447607979E-01), /* bffc47fffffffffffba13df21784a000 */
+ L(2.73442789798110494773517431626534726E-32), /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
+ L(-1.56249999999999987665010524130393080E-01), /* bffc3ffffffffffff8e3ad45e7508000 */
+ L(2.02695576464836145806428118889332191E-32), /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
+ L(-1.52343749999999989905291167951491803E-01), /* bffc37fffffffffffa2e48aecfc24000 */
+ L(-3.61436631548815190395331054871041524E-32), /* bf967756567ebd108075ae527cc2e7f0 */
+ L(-1.48437500000000006686107754967759751E-01), /* bffc30000000000003dab20261b3c000 */
+ L(-2.15524270159131591469319477922198390E-32), /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
+ L(-1.44531250000000005132889939177166485E-01), /* bffc28000000000002f57b1969e7b000 */
+ L(2.74741116529653547935086189244019604E-32), /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
+ L(-1.40625000000000000707469094533647325E-01), /* bffc2000000000000068676d3d5c4000 */
+ L(4.40607097220049957013547629906723266E-33), /* 3f936e0ac425daf795b42913cf0ef881 */
+ L(-1.36718749999999995713752139187543306E-01), /* bffc17fffffffffffd87762255991000 */
+ L(-3.73751317180116492404578048203389108E-32), /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
+ L(-1.32812500000000007198453630478482191E-01), /* bffc10000000000004264de3a4379000 */
+ L(-3.97050085179660203884930593717220728E-32), /* bf969c52048de14be3c9c1971e50869c */
+ L(-1.28906250000000006070486371645733082E-01), /* bffc080000000000037fd87db2cb0000 */
+ L(3.59610068058504988294019521946586131E-32), /* 3f967570c10687cb8e9ebd0b280abf5a */
+ L(-1.25000000000000003700729208608337966E-01), /* bffc00000000000002222198bbc74000 */
+ L(3.23464851393124362331846965931995969E-33), /* 3f930cb95da3bfc847e593716c91d57a */
+ L(-1.21093750000000013729038501177102555E-01), /* bffbf000000000000fd418d1f5fda000 */
+ L(2.45242487730722066611358741283977619E-32), /* 3f95fd5945ad86a464292e26ac192a84 */
+ L(-1.17187499999999999765305306880205578E-01), /* bffbdfffffffffffffbabaf869845000 */
+ L(-1.14557520298960389903199646350205537E-32), /* bf94dbda735322179d9bcf392e1dd06d */
+ L(-1.13281250000000009579647893740755690E-01), /* bffbd000000000000b0b69bae7ab9000 */
+ L(2.37873962873837390105423621772752350E-32), /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
+ L(-1.09375000000000008981153004560108539E-01), /* bffbc000000000000a5ac4bc1d2c3000 */
+ L(1.53152444860014076105003555837231015E-32), /* 3f953e15ce931e12ef9a152522e32bdd */
+ L(-1.05468749999999992399063850363228723E-01), /* bffbaffffffffffff73c998091408000 */
+ L(-8.75920903597804862471749360196688834E-33), /* bf946bd7e310a01bae5687ebdc47fcc5 */
+ L(-1.01562500000000007685885179918350550E-01), /* bffba0000000000008dc7910a648c000 */
+ L(-4.63820993797174451904075397785059501E-33), /* bf938153d0e54001a472da180fb5e8aa */
+ L(-9.76562499999999887262211517861331814E-02), /* bffb8ffffffffffff300915aa6fd6000 */
+ L(-2.63767025974952608658936466715705903E-33), /* bf92b64215bb8d520be5404620d38088 */
+ L(-9.37499999999999939650246024457439795E-02), /* bffb7ffffffffffff90aca26bd0fc000 */
+ L(-1.72047822349322956713582039121348377E-32), /* bf9565545015c5b9b56d02cfefca2c7d */
+ L(-8.98437500000000033088896383977486369E-02), /* bffb70000000000003d09ca1e3cbe000 */
+ L(3.04831994420989436248526129869697270E-33), /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
+ L(-8.59374999999999947312400115121319225E-02), /* bffb5ffffffffffff9ecefc03376e000 */
+ L(1.50416954438393392150792422537312281E-32), /* 3f9538675ee99bd722fad0023c09c915 */
+ L(-8.20312500000000054182280847004695514E-02), /* bffb500000000000063f2dbd40200000 */
+ L(2.68399664523430004488075638997207289E-33), /* 3f92bdf49766629882c49a3da88928ed */
+ L(-7.81250000000000114767533968079748798E-02), /* bffb4000000000000d3b56f81ba70000 */
+ L(1.72318124201659121296305402819694281E-32), /* 3f9565e407aaabfb359e8a567d760de3 */
+ L(-7.42187500000000035531829472486812869E-02), /* bffb3000000000000418b6e9b5388000 */
+ L(2.09401756478514117051383998628099655E-32), /* 3f95b2e91221fcd74be0a86d8ad658d2 */
+ L(-7.03124999999999987474933134860732535E-02), /* bffb1ffffffffffffe8e53453d2ac000 */
+ L(2.28515798224350800271565551341211666E-32), /* 3f95da9bd6adf00894f05b5cc5530125 */
+ L(-6.64062500000000042267533361089054159E-02), /* bffb10000000000004df8473dbcf2000 */
+ L(1.97576478800281368377376002585430031E-32), /* 3f959a59acbddb2f53bd3096b66370e9 */
+ L(-6.25000000000000066329769382774201686E-02), /* bffb00000000000007a5b5914e336000 */
+ L(-1.46422615813786836245343723048221678E-33), /* bf91e69295f069fc0c4a9db181ea25a3 */
+ L(-5.85937500000000002823707957982406053E-02), /* bffae0000000000000a6aeab10592000 */
+ L(9.25637741701318872896718218457555829E-33), /* 3f94807eb021f1f40a37d4015b1eb76b */
+ L(-5.46875000000000081586888005226044448E-02), /* bffac0000000000012d00a3171e3a000 */
+ L(-4.87144542459404765480424673678105050E-33), /* bf9394b42faba6b7036fe7b36269daf3 */
+ L(-5.07812499999999927720348253140567013E-02), /* bffa9fffffffffffef555cc8dd914000 */
+ L(-3.01901021987395945826043649523451725E-33), /* bf92f59e7e3025691f290f8f67277faf */
+ L(-4.68749999999999935349476738962633103E-02), /* bffa7ffffffffffff117b4ea2b876000 */
+ L(1.21521638219189777347767475937119750E-32), /* 3f94f8c7f88c5b56674b94d984ac8ecb */
+ L(-4.29687500000000056305562847814228219E-02), /* bffa6000000000000cfbb19be30c0000 */
+ L(-1.18643699217679276275559592978275214E-32), /* bf94ecd39f0833a876550e83eb012b99 */
+ L(-3.90624999999999962692914526031373542E-02), /* bffa3ffffffffffff765c743922f9000 */
+ L(-4.91277156857520035712509544689973679E-33), /* bf939823189996193872e58ac0dececb */
+ L(-3.51562500000000108152468207687602886E-02), /* bffa20000000000018f031e41177f000 */
+ L(1.18599806302656253755207072755609820E-32), /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
+ L(-3.12500000000000077376981036742289578E-02), /* bffa00000000000011d787e0b386f000 */
+ L(9.97730386477005171963635210799577079E-33), /* 3f949e70e498c46a0173ac0d46c699fc */
+ L(-2.73437500000000139436129596418623235E-02), /* bff9c00000000000404db66e70a08000 */
+ L(2.25755321633070123579875157841633859E-33), /* 3f927719b1a93074bdf9f3c2cb784785 */
+ L(-2.34375000000000088003629211828324876E-02), /* bff98000000000002895a27d45feb000 */
+ L(2.84374279216848803102126617873942975E-33), /* 3f92d87f70e749d6da6c260b68dc210b */
+ L(-1.95312500000000107408831063404855424E-02), /* bff9400000000000318898ba69f71000 */
+ L(2.47348089686935458989103979140011912E-33), /* 3f929afa3de45086fe909fdddb41edce */
+ L(-1.56250000000000081443917555362290635E-02), /* bff9000000000000258f335e9cdd6000 */
+ L(-2.43379314483517422161458863218426254E-33), /* bf9294621c8a9ccacf2b020ec19cad27 */
+ L(-1.17187500000000051490597418161403184E-02), /* bff88000000000002f7ddfa26221f000 */
+ L(1.83405297208145390679150568810924707E-33), /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
+ L(-7.81249999999999715861805208310174953E-03), /* bff7ffffffffffffcb95f3fff157d000 */
+ L(3.51548384878710915171654413641872451E-34), /* 3f8fd349b76c22966f77a39fc37ed704 */
+ L(-3.90625000000000309326013918295097128E-03), /* bff7000000000000390f820c8e153000 */
+ L(6.38058004651791109324060099097251911E-36), /* 3f8a0f665d3ac25a1ac94d688273dbcd */
#define T_EXPL_ARG1 (2*89)
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 3.90625000000000245479958859972588985E-03L, /* 3ff70000000000002d48769ac9874000 */
- -6.58439598384342854976169982902779828E-36L, /* bf8a1811b923e6c626b07ef29761482a */
- 7.81250000000001311374391093664996358E-03L, /* 3ff800000000000078f3f3cd89111000 */
- 2.60265650555493781464273319671555602E-33L, /* 3f92b070c3b635b87af426735a71fc87 */
- 1.17187500000000269581156218247101912E-02L, /* 3ff8800000000000f8a50d02fe20d000 */
- 1.00961747974945520631836275894919326E-33L, /* 3f914f80c1a4f8042044fe3b757b030b */
- 1.56249999999999797878275270751825475E-02L, /* 3ff8ffffffffffff45935b69da62e000 */
- 2.03174577741375590087897353146748580E-33L, /* 3f925194e863496e0f6e91cbf6b22e26 */
- 1.95312499999999760319884511789111533E-02L, /* 3ff93fffffffffff917790ff9a8f4000 */
- 4.62788519658803722282100289809515007E-33L, /* 3f9380783ba81295feeb3e4879d7d52d */
- 2.34374999999999822953909016349145918E-02L, /* 3ff97fffffffffffae5a163bd3cd5000 */
- -3.19499956304699705390404384504876533E-33L, /* bf93096e2037ced8194cf344c692f8d6 */
- 2.73437500000000137220327275871555682E-02L, /* 3ff9c000000000003f481dea5dd51000 */
- -2.25757776523031994464630107442723424E-33L, /* bf92771abcf988a02b414bf2614e3734 */
- 3.12499999999999790857640618332718621E-02L, /* 3ff9ffffffffffff9f8cd40b51509000 */
- -4.22479470489989916319395454536511458E-33L, /* bf935efb7245612f371deca17cb7b30c */
- 3.51562499999999840753382405747597346E-02L, /* 3ffa1fffffffffffdb47bd275f722000 */
- 1.08459658374118041980976756063083500E-34L, /* 3f8e2055d18b7117c9db1c318b1e889b */
- 3.90624999999999989384433621470426757E-02L, /* 3ffa3ffffffffffffd8d5e18b042e000 */
- -7.41674226146122000759491297811091830E-33L, /* bf94341454e48029e5b0205d91baffdc */
- 4.29687500000000107505739500500200462E-02L, /* 3ffa60000000000018ca04cd9085c000 */
- -4.74689012756713017494437969420919847E-34L, /* bf903b7c268103c6f7fbaaa24142e287 */
- 4.68749999999999978700749928325717352E-02L, /* 3ffa7ffffffffffffb16b6d5479e3000 */
- -1.06208165308448830117773486334902917E-32L, /* bf94b92be4b3b5b5a596a0a5187cc955 */
- 5.07812499999999815072625435955786253E-02L, /* 3ffa9fffffffffffd55bd086d5cbc000 */
- -9.37038897148383660401929567549111394E-33L, /* bf94853b111b0175b491c80d00419416 */
- 5.46874999999999809511553152189867394E-02L, /* 3ffabfffffffffffd4138bfa74a61000 */
- 1.06642963074562437340498606682822123E-32L, /* 3f94bafa3fe991b39255d563dfa05d89 */
- 5.85937500000000184331996330905145551E-02L, /* 3ffae000000000002a810a5f2f8bf000 */
- -1.76639977694797200820296641773791945E-34L, /* bf8ed596f07ce4408f1705c8ec16864c */
- 6.25000000000000021544696744852045001E-02L, /* 3ffb000000000000027be32045e2b000 */
- 1.68616371995798354366633034788947149E-32L, /* 3f955e33d7440794d8a1b25233d086ab */
- 6.64062499999999965563110718495802889E-02L, /* 3ffb0ffffffffffffc079a38a3fed000 */
- -1.82463217667830160048872113565316215E-32L, /* bf957af6163bcdb97cefab44a942482a */
- 7.03124999999999759989183341261898222E-02L, /* 3ffb1fffffffffffe454218acea05000 */
- -1.07843770101525495515646940862541503E-32L, /* bf94bff72aada26d94e76e71c07e0580 */
- 7.42187499999999898968873730710101412E-02L, /* 3ffb2ffffffffffff45a166496dc1000 */
- 1.28629441689592874462780757154138223E-32L, /* 3f950b2724597b8b93ce1e9d1cf4d035 */
- 7.81249999999999957198938523510804668E-02L, /* 3ffb3ffffffffffffb10bc52adbc5000 */
- 1.13297573459968118467100063135856856E-33L, /* 3f91787eea895b3c245899cf34ad0abd */
- 8.20312500000000199911640621145851159E-02L, /* 3ffb500000000000170c59a661a89000 */
- -1.51161335208135146756554123073528707E-32L, /* bf9539f326c5ca84e7db5401566f3775 */
- 8.59375000000000134175373433347670743E-02L, /* 3ffb6000000000000f78287547af0000 */
- 1.09763629458404270323909815379924900E-32L, /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
- 8.98437500000000036533922600308306335E-02L, /* 3ffb70000000000004364a83b7a14000 */
- 3.11459653680110433194288029777718358E-33L, /* 3f9302c0248136d65cebeab69488d949 */
- 9.37500000000000184977946245216914691E-02L, /* 3ffb800000000000155395d870b17000 */
- -4.66656154468277949130395786965043927E-33L, /* bf9383aec9b993b6db492b1ede786d8a */
- 9.76562500000000237839723100419376084E-02L, /* 3ffb9000000000001b6bca237f6c4000 */
- -1.03028043424658760249140747856831301E-32L, /* bf94abf6352e3d2bb398e47919a343fb */
- 1.01562500000000012345545575236836572E-01L, /* 3ffba000000000000e3bc30cd9a1f000 */
- 2.15755372310795701322789783729456319E-32L, /* 3f95c01b3b819edd9d07548fafd61550 */
- 1.05468749999999976493840484471911438E-01L, /* 3ffbafffffffffffe4e634cd77985000 */
- 1.78771847038773333029677216592309083E-32L, /* 3f95734b6ae650f33dd43c49a1df9fc0 */
- 1.09375000000000002267015055992785402E-01L, /* 3ffbc00000000000029d1ad08de7b000 */
- 6.23263106693943817730045115112427717E-33L, /* 3f9402e4b39ce2198a45e1d045868cd6 */
- 1.13281250000000022354208618429577398E-01L, /* 3ffbd0000000000019c5cc3f9d2b5000 */
- 5.40514416644786448581426756221178868E-33L, /* 3f93c10ab4021472c662f69435de9269 */
- 1.17187500000000013252367133076817603E-01L, /* 3ffbe000000000000f47688cc561b000 */
- -7.12412585457324989451327215568641325E-33L, /* bf9427ecb343a8d1758990565fcfbf45 */
- 1.21093750000000020759863992944300792E-01L, /* 3ffbf0000000000017ef3af97bf04000 */
- 6.26591408357572503875647872077266444E-33L, /* 3f940446a09a2da771b45fc075514d12 */
- 1.25000000000000004739659392396765618E-01L, /* 3ffc00000000000002bb7344ecd89000 */
- -1.55611398459729463981000080101758830E-32L, /* bf95433135febefa9e6aa4db39e263d2 */
- 1.28906249999999982360888081057894783E-01L, /* 3ffc07fffffffffff5d4ed3154361000 */
- -1.77531518652835570781208599686606474E-32L, /* bf9570b7f225ea076f97f418d11359c1 */
- 1.32812500000000010568583998727400436E-01L, /* 3ffc1000000000000617a5d09526a000 */
- 2.12104021624990594668286391598300893E-32L, /* 3f95b885d767a1048d93055927a27adc */
- 1.36718749999999998434125157367005292E-01L, /* 3ffc17ffffffffffff18eaebc7970000 */
- 2.50454798592543203967309921276955297E-32L, /* 3f9604164e5598528a76faff26cd1c97 */
- 1.40625000000000015550032422969330356E-01L, /* 3ffc20000000000008f6c79d8928c000 */
- 7.80972982879849783680252962992639832E-33L, /* 3f9444674acf2b3225c7647e0d95edf3 */
- 1.44531250000000012402535562111122522E-01L, /* 3ffc28000000000007264a8bc1ff1000 */
- 2.79662468716455159585514763921671876E-32L, /* 3f96226b095bd78aa650faf95a221993 */
- 1.48437500000000007761020440087419948E-01L, /* 3ffc3000000000000479530ff8fe3000 */
- 2.15518492972728435680556239996258527E-32L, /* 3f95bf9d49295e73a957906a029768cb */
- 1.52343750000000001733189947520484032E-01L, /* 3ffc38000000000000ffc6109f71f000 */
- 8.34032236093545825619420380704500188E-33L, /* 3f945a71851226a1d0ce5e656693153e */
- 1.56249999999999988073295321246958484E-01L, /* 3ffc3ffffffffffff91fedd62ae0f000 */
- 2.44119337150624789345260194989620908E-32L, /* 3f95fb041a57bc1c1280680ac1620bea */
- 1.60156250000000002076894210913572460E-01L, /* 3ffc48000000000001327ed84a199000 */
- -7.36124501128859978061216696286151753E-33L, /* bf9431c62f01e59d2c1e00f195a0037f */
- 1.64062500000000000950861276373482172E-01L, /* 3ffc500000000000008c5285fba85000 */
- -4.80566184447001164583855800470217373E-33L, /* bf938f3d1fcafd390f22f80e6c19421f */
- 1.67968749999999989878071706155265999E-01L, /* 3ffc57fffffffffffa2a445c548c5000 */
- -4.42154428718618459799673088733365064E-32L, /* bf96cb28cf1c1b28006d53ffe633b22a */
- 1.71874999999999999459734108403218175E-01L, /* 3ffc5fffffffffffffb04554e9dd4000 */
- -3.29736288190321377985697972236270628E-32L, /* bf96566af0ebc852e84be12859b24a31 */
- 1.75781249999999997987525759778901845E-01L, /* 3ffc67fffffffffffed702df6ffff000 */
- -1.28800728638468399687523924685844352E-32L, /* bf950b8236b88ca0c1b739dc91a7e3fc */
- 1.79687500000000004929565820437175783E-01L, /* 3ffc70000000000002d779bb32d2e000 */
- 1.60624461317978482424582320675174225E-32L, /* 3f954d9a9cc0c963fd081f3dc922d04e */
- 1.83593750000000016873727045739708856E-01L, /* 3ffc78000000000009ba1f6263c9a000 */
- -3.83390389582056606880506003118452558E-32L, /* bf968e22a5d826f77f19ee788474df22 */
- 1.87500000000000013443068740761666872E-01L, /* 3ffc80000000000007bfd8c72a1bf000 */
- -2.74141662712926256150154726565203091E-32L, /* bf961caf5ac59c7f941f928e324c2cc1 */
- 1.91406249999999981494101786848611970E-01L, /* 3ffc87fffffffffff55502eeae001000 */
- 3.68992437075565165346469517256118001E-32L, /* 3f967f2f03f9096793372a27b92ad79d */
- 1.95312499999999989069921848800501648E-01L, /* 3ffc8ffffffffffff9b3015280394000 */
- 3.69712249337856518452988332367785220E-32L, /* 3f967fee5fdb5bd501ff93516999faa0 */
- 1.99218750000000021148042946919300804E-01L, /* 3ffc9800000000000c30e67939095000 */
- 2.50142536781142175091322844848566649E-32L, /* 3f9603c34ae58e10b300b07137ee618a */
- 2.03124999999999977732559198825437141E-01L, /* 3ffc9ffffffffffff329e7df079e4000 */
- -2.41951877287895024779300892731537816E-32L, /* bf95f683aefe6965f080df8f59dd34a1 */
- 2.07031249999999996744030653771913124E-01L, /* 3ffca7fffffffffffe1f80f4b73ca000 */
- -1.94346475904454000031592792989765585E-32L, /* bf9593a44f87870a3d100d498501ecc7 */
- 2.10937500000000000251399259834392298E-01L, /* 3ffcb000000000000025199873310000 */
- -1.33528748788094249098998693871759411E-33L, /* bf91bbb9b25c813668d6103d08acac35 */
- 2.14843749999999993936323609611875097E-01L, /* 3ffcb7fffffffffffc8128c866236000 */
- 1.14839877977014974625242788556545292E-32L, /* 3f94dd06b4655c9b83a1305b240e7a42 */
- 2.18750000000000015181732784749663837E-01L, /* 3ffcc0000000000008c06da5fff24000 */
- 1.42689085313142539755499441881408391E-32L, /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
- 2.22656249999999992172647770539596569E-01L, /* 3ffcc7fffffffffffb7ce2fe531f6000 */
- -3.34421462850496887359128610229650547E-32L, /* bf965b487962b5c2d9056ca6ac0c2e5c */
- 2.26562499999999989595607223847082419E-01L, /* 3ffccffffffffffffa0095277be5c000 */
- -3.08983588107248752517344356508205569E-32L, /* bf9640dded57157f8eded311213bdbcd */
- 2.30468749999999979130462438434567117E-01L, /* 3ffcd7fffffffffff3f8332996560000 */
- -3.01407539802851697849105682795217019E-32L, /* bf9638ffde35dbdfe1a1ffe45185de5d */
- 2.34375000000000012194252337217891971E-01L, /* 3ffce0000000000007078dd402c86000 */
- -8.46879710915628592284714319904522657E-33L, /* bf945fc7b29a2ac6c9eff9eb258a510f */
- 2.38281249999999982991877076137149870E-01L, /* 3ffce7fffffffffff6320b486eece000 */
- -2.93563878880439245627127095245798544E-32L, /* bf9630daaa4f40ff05caf29ace2ea7d4 */
- 2.42187499999999981447559841442773990E-01L, /* 3ffceffffffffffff54e24a09a8d5000 */
- -4.56766746558806021264215486909850481E-32L, /* bf96da556dee11f3113e5a3467b908e6 */
- 2.46093749999999991067720539980207318E-01L, /* 3ffcf7fffffffffffad9d405dcb5d000 */
- 2.14033004219908074003010247652128251E-32L, /* 3f95bc8776e8f9ae098884aa664cc3df */
- 2.50000000000000016613825838126835953E-01L, /* 3ffd00000000000004c9e24c12bb3000 */
- 2.57617532593749185996714235009382870E-32L, /* 3f960b867cc01178c0ec68226c6cb47d */
- 2.53906250000000013372004437827044321E-01L, /* 3ffd04000000000003daae05b3168000 */
- 7.20177123439204414298152646284640101E-32L, /* 3f9775eff59ddad7e7530b83934af87f */
- 2.57812499999999995765234725413886085E-01L, /* 3ffd07fffffffffffec7878bad9d5000 */
- 6.51253187532920882777046064603770602E-32L, /* 3f975226659ca241402e71c2011583b0 */
- 2.61718750000000007647689994011222248E-01L, /* 3ffd0c000000000002344cc793a0f000 */
- 3.02370610028725823590045201871491395E-32L, /* 3f9639ffe55fa2fa011674448b4e5b96 */
- 2.65624999999999986893899042596554269E-01L, /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
- -2.07683715950724761146070082510569258E-32L, /* bf95af579a92e872fef81abfdf06bae8 */
- 2.69531249999999979842788204900639327E-01L, /* 3ffd13fffffffffffa30a908d67db000 */
- 8.71465252506557329027658736641075706E-32L, /* 3f97c47d99e19830447a42b1c0ffac61 */
- 2.73437500000000006712165837793818271E-01L, /* 3ffd18000000000001ef453a58edb000 */
- -6.62704045767568912140550474455810301E-32L, /* bf9758187a204dcb06ece46588aeeaba */
- 2.77343749999999994411329302988535617E-01L, /* 3ffd1bfffffffffffe63a0fec9c9e000 */
- -4.87273466291944117406493607771338767E-32L, /* bf96fa0381b0844a0be46bac2d673f0c */
- 2.81250000000000012677892447379453135E-01L, /* 3ffd20000000000003a7769e125d6000 */
- -8.55871796664700790726282049552906783E-32L, /* bf97bc64e01332cf7616b0091b8dff2c */
- 2.85156249999999998558643013736363981E-01L, /* 3ffd23ffffffffffff95a5894bccf000 */
- -1.33068334720606220176455289635046875E-32L, /* bf95145f43290ecf5b7adcb24697bc73 */
- 2.89062500000000008831431235621753924E-01L, /* 3ffd280000000000028ba504fac59000 */
- -9.34157398616814623985483776710704237E-32L, /* bf97e50ad1115b941fcb5f0c88a428f7 */
- 2.92968750000000019840235286110877063E-01L, /* 3ffd2c000000000005b7f372d184f000 */
- 4.99302093775173155906059132992249671E-33L, /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
- 2.96875000000000015867911730971630513E-01L, /* 3ffd3000000000000492d860c79db000 */
- 7.86107787827057767235127454590866211E-33L, /* 3f944689517ee8f16cdb97d6a6938f32 */
- 3.00781250000000015814100002286124758E-01L, /* 3ffd340000000000048edfe73a17d000 */
- -1.65419431293024229981937172317171504E-32L, /* bf9557900e3efca16c89646b57f68dc0 */
- 3.04687499999999985213157159965287195E-01L, /* 3ffd37fffffffffffbbcec6f99b36000 */
- 9.68753602893894024018934325652944198E-32L, /* 3f97f70170e5458660c33a7e8d43d049 */
- 3.08593749999999989969324338045156215E-01L, /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
- 7.10268609610294706092252562643261106E-32L, /* 3f9770cae45cdf615010401a4b37d8d4 */
- 3.12500000000000002971606591018488854E-01L, /* 3ffd40000000000000db440fbc06b000 */
- 6.38924218802905979887732294952782964E-32L, /* 3f974bbf988bb5622bd8fbaa46e8b811 */
- 3.16406250000000006594921047402056305E-01L, /* 3ffd44000000000001e69e8954814000 */
- 3.96079878754651470094149874444850097E-32L, /* 3f969b5017b9fa7a1e86975258c73d3d */
- 3.20312500000000006713799366908329147E-01L, /* 3ffd48000000000001ef64159c065000 */
- -1.86401314975634286055150437995880517E-32L, /* bf958323f0434911794e5fb8bfe136ba */
- 3.24218749999999987061246567584951210E-01L, /* 3ffd4bfffffffffffc4549db9b928000 */
- -3.18643523744758601387071062700407431E-32L, /* bf964ae5fa7e26c2c3981bed12e14372 */
- 3.28124999999999991782776266707412953E-01L, /* 3ffd4ffffffffffffda1ad0840ca8000 */
- -4.46964199751314296839915534813144652E-32L, /* bf96d0277729ffd74727150df6d15547 */
- 3.32031250000000000393816557756032682E-01L, /* 3ffd540000000000001d0efc04fad000 */
- -9.03246333902065439930373230002688649E-33L, /* bf947731a008748cc6dee948839ef7ae */
- 3.35937499999999983810482995064392173E-01L, /* 3ffd57fffffffffffb556cab8ae61000 */
- 5.27742727066129518825981597650621794E-32L, /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
- 3.39843750000000004310441349760912471E-01L, /* 3ffd5c0000000000013e0def5ddc4000 */
- -3.85927263474732591932884416445586106E-32L, /* bf9690c51088ef3db9ca000829c450c2 */
- 3.43749999999999990248130003997484364E-01L, /* 3ffd5ffffffffffffd3070624a0af000 */
- 9.62005170171527308106468341512327487E-34L, /* 3f913fae595cea84432eb01430817fca */
- 3.47656250000000004085726414568625697E-01L, /* 3ffd640000000000012d79309e291000 */
- -6.59664093705705297250259434519072507E-32L, /* bf97568465eafb0e662e64a5dbfaf35f */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(3.90625000000000245479958859972588985E-03), /* 3ff70000000000002d48769ac9874000 */
+ L(-6.58439598384342854976169982902779828E-36), /* bf8a1811b923e6c626b07ef29761482a */
+ L(7.81250000000001311374391093664996358E-03), /* 3ff800000000000078f3f3cd89111000 */
+ L(2.60265650555493781464273319671555602E-33), /* 3f92b070c3b635b87af426735a71fc87 */
+ L(1.17187500000000269581156218247101912E-02), /* 3ff8800000000000f8a50d02fe20d000 */
+ L(1.00961747974945520631836275894919326E-33), /* 3f914f80c1a4f8042044fe3b757b030b */
+ L(1.56249999999999797878275270751825475E-02), /* 3ff8ffffffffffff45935b69da62e000 */
+ L(2.03174577741375590087897353146748580E-33), /* 3f925194e863496e0f6e91cbf6b22e26 */
+ L(1.95312499999999760319884511789111533E-02), /* 3ff93fffffffffff917790ff9a8f4000 */
+ L(4.62788519658803722282100289809515007E-33), /* 3f9380783ba81295feeb3e4879d7d52d */
+ L(2.34374999999999822953909016349145918E-02), /* 3ff97fffffffffffae5a163bd3cd5000 */
+ L(-3.19499956304699705390404384504876533E-33), /* bf93096e2037ced8194cf344c692f8d6 */
+ L(2.73437500000000137220327275871555682E-02), /* 3ff9c000000000003f481dea5dd51000 */
+ L(-2.25757776523031994464630107442723424E-33), /* bf92771abcf988a02b414bf2614e3734 */
+ L(3.12499999999999790857640618332718621E-02), /* 3ff9ffffffffffff9f8cd40b51509000 */
+ L(-4.22479470489989916319395454536511458E-33), /* bf935efb7245612f371deca17cb7b30c */
+ L(3.51562499999999840753382405747597346E-02), /* 3ffa1fffffffffffdb47bd275f722000 */
+ L(1.08459658374118041980976756063083500E-34), /* 3f8e2055d18b7117c9db1c318b1e889b */
+ L(3.90624999999999989384433621470426757E-02), /* 3ffa3ffffffffffffd8d5e18b042e000 */
+ L(-7.41674226146122000759491297811091830E-33), /* bf94341454e48029e5b0205d91baffdc */
+ L(4.29687500000000107505739500500200462E-02), /* 3ffa60000000000018ca04cd9085c000 */
+ L(-4.74689012756713017494437969420919847E-34), /* bf903b7c268103c6f7fbaaa24142e287 */
+ L(4.68749999999999978700749928325717352E-02), /* 3ffa7ffffffffffffb16b6d5479e3000 */
+ L(-1.06208165308448830117773486334902917E-32), /* bf94b92be4b3b5b5a596a0a5187cc955 */
+ L(5.07812499999999815072625435955786253E-02), /* 3ffa9fffffffffffd55bd086d5cbc000 */
+ L(-9.37038897148383660401929567549111394E-33), /* bf94853b111b0175b491c80d00419416 */
+ L(5.46874999999999809511553152189867394E-02), /* 3ffabfffffffffffd4138bfa74a61000 */
+ L(1.06642963074562437340498606682822123E-32), /* 3f94bafa3fe991b39255d563dfa05d89 */
+ L(5.85937500000000184331996330905145551E-02), /* 3ffae000000000002a810a5f2f8bf000 */
+ L(-1.76639977694797200820296641773791945E-34), /* bf8ed596f07ce4408f1705c8ec16864c */
+ L(6.25000000000000021544696744852045001E-02), /* 3ffb000000000000027be32045e2b000 */
+ L(1.68616371995798354366633034788947149E-32), /* 3f955e33d7440794d8a1b25233d086ab */
+ L(6.64062499999999965563110718495802889E-02), /* 3ffb0ffffffffffffc079a38a3fed000 */
+ L(-1.82463217667830160048872113565316215E-32), /* bf957af6163bcdb97cefab44a942482a */
+ L(7.03124999999999759989183341261898222E-02), /* 3ffb1fffffffffffe454218acea05000 */
+ L(-1.07843770101525495515646940862541503E-32), /* bf94bff72aada26d94e76e71c07e0580 */
+ L(7.42187499999999898968873730710101412E-02), /* 3ffb2ffffffffffff45a166496dc1000 */
+ L(1.28629441689592874462780757154138223E-32), /* 3f950b2724597b8b93ce1e9d1cf4d035 */
+ L(7.81249999999999957198938523510804668E-02), /* 3ffb3ffffffffffffb10bc52adbc5000 */
+ L(1.13297573459968118467100063135856856E-33), /* 3f91787eea895b3c245899cf34ad0abd */
+ L(8.20312500000000199911640621145851159E-02), /* 3ffb500000000000170c59a661a89000 */
+ L(-1.51161335208135146756554123073528707E-32), /* bf9539f326c5ca84e7db5401566f3775 */
+ L(8.59375000000000134175373433347670743E-02), /* 3ffb6000000000000f78287547af0000 */
+ L(1.09763629458404270323909815379924900E-32), /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
+ L(8.98437500000000036533922600308306335E-02), /* 3ffb70000000000004364a83b7a14000 */
+ L(3.11459653680110433194288029777718358E-33), /* 3f9302c0248136d65cebeab69488d949 */
+ L(9.37500000000000184977946245216914691E-02), /* 3ffb800000000000155395d870b17000 */
+ L(-4.66656154468277949130395786965043927E-33), /* bf9383aec9b993b6db492b1ede786d8a */
+ L(9.76562500000000237839723100419376084E-02), /* 3ffb9000000000001b6bca237f6c4000 */
+ L(-1.03028043424658760249140747856831301E-32), /* bf94abf6352e3d2bb398e47919a343fb */
+ L(1.01562500000000012345545575236836572E-01), /* 3ffba000000000000e3bc30cd9a1f000 */
+ L(2.15755372310795701322789783729456319E-32), /* 3f95c01b3b819edd9d07548fafd61550 */
+ L(1.05468749999999976493840484471911438E-01), /* 3ffbafffffffffffe4e634cd77985000 */
+ L(1.78771847038773333029677216592309083E-32), /* 3f95734b6ae650f33dd43c49a1df9fc0 */
+ L(1.09375000000000002267015055992785402E-01), /* 3ffbc00000000000029d1ad08de7b000 */
+ L(6.23263106693943817730045115112427717E-33), /* 3f9402e4b39ce2198a45e1d045868cd6 */
+ L(1.13281250000000022354208618429577398E-01), /* 3ffbd0000000000019c5cc3f9d2b5000 */
+ L(5.40514416644786448581426756221178868E-33), /* 3f93c10ab4021472c662f69435de9269 */
+ L(1.17187500000000013252367133076817603E-01), /* 3ffbe000000000000f47688cc561b000 */
+ L(-7.12412585457324989451327215568641325E-33), /* bf9427ecb343a8d1758990565fcfbf45 */
+ L(1.21093750000000020759863992944300792E-01), /* 3ffbf0000000000017ef3af97bf04000 */
+ L(6.26591408357572503875647872077266444E-33), /* 3f940446a09a2da771b45fc075514d12 */
+ L(1.25000000000000004739659392396765618E-01), /* 3ffc00000000000002bb7344ecd89000 */
+ L(-1.55611398459729463981000080101758830E-32), /* bf95433135febefa9e6aa4db39e263d2 */
+ L(1.28906249999999982360888081057894783E-01), /* 3ffc07fffffffffff5d4ed3154361000 */
+ L(-1.77531518652835570781208599686606474E-32), /* bf9570b7f225ea076f97f418d11359c1 */
+ L(1.32812500000000010568583998727400436E-01), /* 3ffc1000000000000617a5d09526a000 */
+ L(2.12104021624990594668286391598300893E-32), /* 3f95b885d767a1048d93055927a27adc */
+ L(1.36718749999999998434125157367005292E-01), /* 3ffc17ffffffffffff18eaebc7970000 */
+ L(2.50454798592543203967309921276955297E-32), /* 3f9604164e5598528a76faff26cd1c97 */
+ L(1.40625000000000015550032422969330356E-01), /* 3ffc20000000000008f6c79d8928c000 */
+ L(7.80972982879849783680252962992639832E-33), /* 3f9444674acf2b3225c7647e0d95edf3 */
+ L(1.44531250000000012402535562111122522E-01), /* 3ffc28000000000007264a8bc1ff1000 */
+ L(2.79662468716455159585514763921671876E-32), /* 3f96226b095bd78aa650faf95a221993 */
+ L(1.48437500000000007761020440087419948E-01), /* 3ffc3000000000000479530ff8fe3000 */
+ L(2.15518492972728435680556239996258527E-32), /* 3f95bf9d49295e73a957906a029768cb */
+ L(1.52343750000000001733189947520484032E-01), /* 3ffc38000000000000ffc6109f71f000 */
+ L(8.34032236093545825619420380704500188E-33), /* 3f945a71851226a1d0ce5e656693153e */
+ L(1.56249999999999988073295321246958484E-01), /* 3ffc3ffffffffffff91fedd62ae0f000 */
+ L(2.44119337150624789345260194989620908E-32), /* 3f95fb041a57bc1c1280680ac1620bea */
+ L(1.60156250000000002076894210913572460E-01), /* 3ffc48000000000001327ed84a199000 */
+ L(-7.36124501128859978061216696286151753E-33), /* bf9431c62f01e59d2c1e00f195a0037f */
+ L(1.64062500000000000950861276373482172E-01), /* 3ffc500000000000008c5285fba85000 */
+ L(-4.80566184447001164583855800470217373E-33), /* bf938f3d1fcafd390f22f80e6c19421f */
+ L(1.67968749999999989878071706155265999E-01), /* 3ffc57fffffffffffa2a445c548c5000 */
+ L(-4.42154428718618459799673088733365064E-32), /* bf96cb28cf1c1b28006d53ffe633b22a */
+ L(1.71874999999999999459734108403218175E-01), /* 3ffc5fffffffffffffb04554e9dd4000 */
+ L(-3.29736288190321377985697972236270628E-32), /* bf96566af0ebc852e84be12859b24a31 */
+ L(1.75781249999999997987525759778901845E-01), /* 3ffc67fffffffffffed702df6ffff000 */
+ L(-1.28800728638468399687523924685844352E-32), /* bf950b8236b88ca0c1b739dc91a7e3fc */
+ L(1.79687500000000004929565820437175783E-01), /* 3ffc70000000000002d779bb32d2e000 */
+ L(1.60624461317978482424582320675174225E-32), /* 3f954d9a9cc0c963fd081f3dc922d04e */
+ L(1.83593750000000016873727045739708856E-01), /* 3ffc78000000000009ba1f6263c9a000 */
+ L(-3.83390389582056606880506003118452558E-32), /* bf968e22a5d826f77f19ee788474df22 */
+ L(1.87500000000000013443068740761666872E-01), /* 3ffc80000000000007bfd8c72a1bf000 */
+ L(-2.74141662712926256150154726565203091E-32), /* bf961caf5ac59c7f941f928e324c2cc1 */
+ L(1.91406249999999981494101786848611970E-01), /* 3ffc87fffffffffff55502eeae001000 */
+ L(3.68992437075565165346469517256118001E-32), /* 3f967f2f03f9096793372a27b92ad79d */
+ L(1.95312499999999989069921848800501648E-01), /* 3ffc8ffffffffffff9b3015280394000 */
+ L(3.69712249337856518452988332367785220E-32), /* 3f967fee5fdb5bd501ff93516999faa0 */
+ L(1.99218750000000021148042946919300804E-01), /* 3ffc9800000000000c30e67939095000 */
+ L(2.50142536781142175091322844848566649E-32), /* 3f9603c34ae58e10b300b07137ee618a */
+ L(2.03124999999999977732559198825437141E-01), /* 3ffc9ffffffffffff329e7df079e4000 */
+ L(-2.41951877287895024779300892731537816E-32), /* bf95f683aefe6965f080df8f59dd34a1 */
+ L(2.07031249999999996744030653771913124E-01), /* 3ffca7fffffffffffe1f80f4b73ca000 */
+ L(-1.94346475904454000031592792989765585E-32), /* bf9593a44f87870a3d100d498501ecc7 */
+ L(2.10937500000000000251399259834392298E-01), /* 3ffcb000000000000025199873310000 */
+ L(-1.33528748788094249098998693871759411E-33), /* bf91bbb9b25c813668d6103d08acac35 */
+ L(2.14843749999999993936323609611875097E-01), /* 3ffcb7fffffffffffc8128c866236000 */
+ L(1.14839877977014974625242788556545292E-32), /* 3f94dd06b4655c9b83a1305b240e7a42 */
+ L(2.18750000000000015181732784749663837E-01), /* 3ffcc0000000000008c06da5fff24000 */
+ L(1.42689085313142539755499441881408391E-32), /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
+ L(2.22656249999999992172647770539596569E-01), /* 3ffcc7fffffffffffb7ce2fe531f6000 */
+ L(-3.34421462850496887359128610229650547E-32), /* bf965b487962b5c2d9056ca6ac0c2e5c */
+ L(2.26562499999999989595607223847082419E-01), /* 3ffccffffffffffffa0095277be5c000 */
+ L(-3.08983588107248752517344356508205569E-32), /* bf9640dded57157f8eded311213bdbcd */
+ L(2.30468749999999979130462438434567117E-01), /* 3ffcd7fffffffffff3f8332996560000 */
+ L(-3.01407539802851697849105682795217019E-32), /* bf9638ffde35dbdfe1a1ffe45185de5d */
+ L(2.34375000000000012194252337217891971E-01), /* 3ffce0000000000007078dd402c86000 */
+ L(-8.46879710915628592284714319904522657E-33), /* bf945fc7b29a2ac6c9eff9eb258a510f */
+ L(2.38281249999999982991877076137149870E-01), /* 3ffce7fffffffffff6320b486eece000 */
+ L(-2.93563878880439245627127095245798544E-32), /* bf9630daaa4f40ff05caf29ace2ea7d4 */
+ L(2.42187499999999981447559841442773990E-01), /* 3ffceffffffffffff54e24a09a8d5000 */
+ L(-4.56766746558806021264215486909850481E-32), /* bf96da556dee11f3113e5a3467b908e6 */
+ L(2.46093749999999991067720539980207318E-01), /* 3ffcf7fffffffffffad9d405dcb5d000 */
+ L(2.14033004219908074003010247652128251E-32), /* 3f95bc8776e8f9ae098884aa664cc3df */
+ L(2.50000000000000016613825838126835953E-01), /* 3ffd00000000000004c9e24c12bb3000 */
+ L(2.57617532593749185996714235009382870E-32), /* 3f960b867cc01178c0ec68226c6cb47d */
+ L(2.53906250000000013372004437827044321E-01), /* 3ffd04000000000003daae05b3168000 */
+ L(7.20177123439204414298152646284640101E-32), /* 3f9775eff59ddad7e7530b83934af87f */
+ L(2.57812499999999995765234725413886085E-01), /* 3ffd07fffffffffffec7878bad9d5000 */
+ L(6.51253187532920882777046064603770602E-32), /* 3f975226659ca241402e71c2011583b0 */
+ L(2.61718750000000007647689994011222248E-01), /* 3ffd0c000000000002344cc793a0f000 */
+ L(3.02370610028725823590045201871491395E-32), /* 3f9639ffe55fa2fa011674448b4e5b96 */
+ L(2.65624999999999986893899042596554269E-01), /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
+ L(-2.07683715950724761146070082510569258E-32), /* bf95af579a92e872fef81abfdf06bae8 */
+ L(2.69531249999999979842788204900639327E-01), /* 3ffd13fffffffffffa30a908d67db000 */
+ L(8.71465252506557329027658736641075706E-32), /* 3f97c47d99e19830447a42b1c0ffac61 */
+ L(2.73437500000000006712165837793818271E-01), /* 3ffd18000000000001ef453a58edb000 */
+ L(-6.62704045767568912140550474455810301E-32), /* bf9758187a204dcb06ece46588aeeaba */
+ L(2.77343749999999994411329302988535617E-01), /* 3ffd1bfffffffffffe63a0fec9c9e000 */
+ L(-4.87273466291944117406493607771338767E-32), /* bf96fa0381b0844a0be46bac2d673f0c */
+ L(2.81250000000000012677892447379453135E-01), /* 3ffd20000000000003a7769e125d6000 */
+ L(-8.55871796664700790726282049552906783E-32), /* bf97bc64e01332cf7616b0091b8dff2c */
+ L(2.85156249999999998558643013736363981E-01), /* 3ffd23ffffffffffff95a5894bccf000 */
+ L(-1.33068334720606220176455289635046875E-32), /* bf95145f43290ecf5b7adcb24697bc73 */
+ L(2.89062500000000008831431235621753924E-01), /* 3ffd280000000000028ba504fac59000 */
+ L(-9.34157398616814623985483776710704237E-32), /* bf97e50ad1115b941fcb5f0c88a428f7 */
+ L(2.92968750000000019840235286110877063E-01), /* 3ffd2c000000000005b7f372d184f000 */
+ L(4.99302093775173155906059132992249671E-33), /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
+ L(2.96875000000000015867911730971630513E-01), /* 3ffd3000000000000492d860c79db000 */
+ L(7.86107787827057767235127454590866211E-33), /* 3f944689517ee8f16cdb97d6a6938f32 */
+ L(3.00781250000000015814100002286124758E-01), /* 3ffd340000000000048edfe73a17d000 */
+ L(-1.65419431293024229981937172317171504E-32), /* bf9557900e3efca16c89646b57f68dc0 */
+ L(3.04687499999999985213157159965287195E-01), /* 3ffd37fffffffffffbbcec6f99b36000 */
+ L(9.68753602893894024018934325652944198E-32), /* 3f97f70170e5458660c33a7e8d43d049 */
+ L(3.08593749999999989969324338045156215E-01), /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
+ L(7.10268609610294706092252562643261106E-32), /* 3f9770cae45cdf615010401a4b37d8d4 */
+ L(3.12500000000000002971606591018488854E-01), /* 3ffd40000000000000db440fbc06b000 */
+ L(6.38924218802905979887732294952782964E-32), /* 3f974bbf988bb5622bd8fbaa46e8b811 */
+ L(3.16406250000000006594921047402056305E-01), /* 3ffd44000000000001e69e8954814000 */
+ L(3.96079878754651470094149874444850097E-32), /* 3f969b5017b9fa7a1e86975258c73d3d */
+ L(3.20312500000000006713799366908329147E-01), /* 3ffd48000000000001ef64159c065000 */
+ L(-1.86401314975634286055150437995880517E-32), /* bf958323f0434911794e5fb8bfe136ba */
+ L(3.24218749999999987061246567584951210E-01), /* 3ffd4bfffffffffffc4549db9b928000 */
+ L(-3.18643523744758601387071062700407431E-32), /* bf964ae5fa7e26c2c3981bed12e14372 */
+ L(3.28124999999999991782776266707412953E-01), /* 3ffd4ffffffffffffda1ad0840ca8000 */
+ L(-4.46964199751314296839915534813144652E-32), /* bf96d0277729ffd74727150df6d15547 */
+ L(3.32031250000000000393816557756032682E-01), /* 3ffd540000000000001d0efc04fad000 */
+ L(-9.03246333902065439930373230002688649E-33), /* bf947731a008748cc6dee948839ef7ae */
+ L(3.35937499999999983810482995064392173E-01), /* 3ffd57fffffffffffb556cab8ae61000 */
+ L(5.27742727066129518825981597650621794E-32), /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
+ L(3.39843750000000004310441349760912471E-01), /* 3ffd5c0000000000013e0def5ddc4000 */
+ L(-3.85927263474732591932884416445586106E-32), /* bf9690c51088ef3db9ca000829c450c2 */
+ L(3.43749999999999990248130003997484364E-01), /* 3ffd5ffffffffffffd3070624a0af000 */
+ L(9.62005170171527308106468341512327487E-34), /* 3f913fae595cea84432eb01430817fca */
+ L(3.47656250000000004085726414568625697E-01), /* 3ffd640000000000012d79309e291000 */
+ L(-6.59664093705705297250259434519072507E-32), /* bf97568465eafb0e662e64a5dbfaf35f */
- -1.98364257812501251077851763965418372E-03L, /* bff6040000000001cd90f658cf0b1000 */
- -3.71984513103117734260309047540278737E-34L, /* bf8fee73c54483194782aac4a6154d11 */
- -1.95312500000000378520649630233891879E-03L, /* bff60000000000008ba643bb5e2e8000 */
- -1.12194202736719050440745599339855038E-34L, /* bf8e2a436aeff7bc529873354f47a3f5 */
- -1.92260742187499397430259771221991482E-03L, /* bff5f7fffffffffe4361cb51170da000 */
- -2.30068299876822157331268484824540848E-34L, /* bf8f31d02f85cfe8c0cc02276ce0f437 */
- -1.89208984375001137424603270262074989E-03L, /* bff5f0000000000347456ed490c23000 */
- -1.15012507244426243338260435466985403E-34L, /* bf8e31c174d5677a937a34ad8d2a70b4 */
- -1.86157226562500172319250342061336738E-03L, /* bff5e800000000007f262fa3617b4000 */
- -3.12438344643346437509767736937785561E-34L, /* bf8f9f4d426a2457c273d34ef7d9bde9 */
- -1.83105468749999505256246872355430379E-03L, /* bff5dffffffffffe92f18c1c2b6fa000 */
- -5.91130415288336591179087455220308942E-35L, /* bf8d3a4c80b42dc036bae446c9807f78 */
- -1.80053710937499445182387245573120522E-03L, /* bff5d7fffffffffe669dea82b4a4c000 */
- -1.92396289352411531324908916321392100E-34L, /* bf8eff7a2123fb573ba9778550d669bd */
- -1.77001953125000387737631542516323906E-03L, /* bff5d000000000011e19915c3ddb7000 */
- 7.91101758977203355387806553469731354E-36L, /* 3f8a507f5a70faaccf469e3461873dea */
- -1.73950195312500034854670281415554486E-03L, /* bff5c8000000000019b7dc6ef97bd000 */
- 1.55906551582436824067407021178835755E-34L, /* 3f8e9e7880333e34955aebcde3cfb053 */
- -1.70898437499998955782591472611429852E-03L, /* bff5bffffffffffcfd80e88aa6b96000 */
- 8.22951661962611381718215899498500357E-35L, /* 3f8db58e6031a779b59f6ece191de7cc */
- -1.67846679687500586652037711131708544E-03L, /* bff5b80000000001b0df6fd21c133000 */
- -8.96642618848426299713145894522897419E-35L, /* bf8ddcbcab46d531801bfae4121f2f8a */
- -1.64794921875000109499161354039904782E-03L, /* bff5b0000000000050cbce8915575000 */
- -2.88077905394253859590587789680486639E-34L, /* bf8f7eebd4dd860ef73b674d5e707959 */
- -1.61743164062501133830507079150388351E-03L, /* bff5a80000000003449e8700c3e82000 */
- -3.68271725851639066312899986829350273E-34L, /* bf8fe9845fe20a5fe74059e0cae185d6 */
- -1.58691406249999015546015764131101956E-03L, /* bff59ffffffffffd2999e668cdd28000 */
- 8.48197657099957029953716507898788812E-35L, /* 3f8dc2faaebb97392e451b07b28c4b12 */
- -1.55639648437500317366570219290722587E-03L, /* bff5980000000000ea2cd9a40d256000 */
- -3.45156704719737676412949957712570373E-36L, /* bf8925a079505516c8e317ac1ff53255 */
- -1.52587890625000568759013197767046039E-03L, /* bff5900000000001a3ab8a3f6b698000 */
- -1.01902948542497496574967177677556729E-34L, /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
- -1.49536132812500945889014955936485340E-03L, /* bff5880000000002b9f1621b57743000 */
- -3.32264697086631598830366079048117140E-34L, /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
- -1.46484374999999931883259902869504725E-03L, /* bff57fffffffffffcdbd1c90e1b4a000 */
- -1.76487524793892929381101031660811433E-34L, /* bf8ed52f2f724bc1ae870b18356337b4 */
- -1.43432617187498876325946983333888768E-03L, /* bff577fffffffffcc2dff8faa5570000 */
- -3.54550084538495708816233114576143814E-34L, /* bf8fd74724576915868c1e8ce9f430f1 */
- -1.40380859374999215367421282192718062E-03L, /* bff56ffffffffffdbd0b18aac65ed000 */
- -1.90585907028351204486765167064669639E-34L, /* bf8efaaa0c0e23e50c11b2120348054f */
- -1.37329101562499692341771212945644892E-03L, /* bff567ffffffffff1cfd00f1b0577000 */
- -3.59631150411372589637918252836880320E-34L, /* bf8fde08239ac74942a46298ea4fb715 */
- -1.34277343749999137467356674296739172E-03L, /* bff55ffffffffffd839030b05d53d000 */
- -1.49571076125940368185068762485268117E-35L, /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
- -1.31225585937499247038404301859788734E-03L, /* bff557fffffffffdd469936e691e3000 */
- 3.10375845385355395586146533282311300E-34L, /* 3f8f9c8f6d63b7a4145716ffd92491fb */
- -1.28173828124999024755581675764821898E-03L, /* bff54ffffffffffd306589b0ab21d000 */
- -1.98541096105909793397376077900810019E-34L, /* bf8f07e808bbb1e35106c294ffbb9687 */
- -1.25122070312500340204619591143332523E-03L, /* bff5480000000000fb06d5f16ad2c000 */
- 3.62884195935761446237911443317457521E-34L, /* 3f8fe25b17d623178a386a6fa6c5afb2 */
- -1.22070312499999591578388993012071279E-03L, /* bff53ffffffffffed2a356c440074000 */
- -2.96756662615653130862526710937493307E-35L, /* bf8c3b90d8ff2a991e5bd16718fb0645 */
- -1.19018554687498821966212632349422735E-03L, /* bff537fffffffffc9ac3b585dda89000 */
- 1.44659971891167323357060028901142644E-34L, /* 3f8e809279ab249edf1dad9fe13fb0bf */
- -1.15966796875000160938908064907298384E-03L, /* bff530000000000076c0800db9639000 */
- 2.50088010538742402346270685365928513E-34L, /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
- -1.12915039062500267151512523291939657E-03L, /* bff5280000000000c51f7e7315137000 */
- 7.56402096465615210500092443924888831E-35L, /* 3f8d922c1e485d99aea2668ed32b55a6 */
- -1.09863281249998665006360103291051571E-03L, /* bff51ffffffffffc26f2d4c9ce2ba000 */
- 1.43982174467233642713619821353592061E-34L, /* 3f8e7ec530b3d92b6303bec1c81214d1 */
- -1.06811523437500522742248711752028025E-03L, /* bff518000000000181b7380f10446000 */
- 5.41265133745862349181293024531133174E-35L, /* 3f8d1fc9313d018b30e790e06b6be723 */
- -1.03759765624999980942114138999770552E-03L, /* bff50ffffffffffff1f01130490e1000 */
- 1.21525139612685854366189534669623436E-34L, /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
- -1.00708007812499602697537601515759439E-03L, /* bff507fffffffffedad7afcce7051000 */
- 1.00020246351201558505328236381833392E-34L, /* 3f8e09e640992512b1300744a7e984ed */
- -9.76562499999992592487302113340463694E-04L, /* bff4fffffffffffbbad8151f8adf6000 */
- -1.64984406575162932060422892046851002E-34L, /* bf8eb69a919986e8054b86fc34300f24 */
- -9.46044921874989085824996924138179594E-04L, /* bff4effffffffff9b55a204fd9792000 */
- -9.29539174108308550334255350011347171E-35L, /* bf8dee3a50ed896b4656fa577a1df3d7 */
- -9.15527343750013735214860599791540029E-04L, /* bff4e00000000007eaf5bf103f82d000 */
- 3.07557018309280519949818825519490586E-35L, /* 3f8c470cfbef77d32c74cb8042f6ee81 */
- -8.85009765625012292294986105781516428E-04L, /* bff4d000000000071605c65403b97000 */
- 4.77499983783821950338363358545463558E-35L, /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
- -8.54492187499986941239470706817188192E-04L, /* bff4bffffffffff878ddf9cab264a000 */
- -1.60128240346239526958630011447901568E-34L, /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
- -8.23974609374996290174598690241743810E-04L, /* bff4affffffffffddc86c249ebe06000 */
- 1.61677540391961912631535763471935882E-34L, /* 3f8eadd00841366b0dc2bc262c2c8c36 */
- -7.93457031249988696952538334288757473E-04L, /* bff49ffffffffff97bf6f0aa85a5f000 */
- 1.22318577008381887076634753347515709E-34L, /* 3f8e452db5b5d250878f71040da06d14 */
- -7.62939453124996723316499040007097041E-04L, /* bff48ffffffffffe1c7265b431108000 */
- -1.03845161748762410745671891558398468E-34L, /* bf8e14115ad884c96d1a820c73647220 */
- -7.32421874999998242520117923997325794E-04L, /* bff47ffffffffffefca4498b7aa8a000 */
- 5.64005211953031009549514026639438083E-35L, /* 3f8d2be06950f68f1a6d8ff829a6928e */
- -7.01904296874999772890934814265622012E-04L, /* bff46fffffffffffde7c0fe5d8041000 */
- 5.90245467325173644235991233229525762E-35L, /* 3f8d39d40cc49002189243c194b1db0e */
- -6.71386718750008699269643939210658742E-04L, /* bff460000000000503c91d798b60c000 */
- -5.20515801723324452151498579012322191E-35L, /* bf8d14c0f08a6a9285b32b8bda003eb5 */
- -6.40869140625005499535275057463709988E-04L, /* bff45000000000032b969184e9751000 */
- -6.69469163285461870099846471658294534E-35L, /* bf8d63f36bab7b24d936c9380e3d3fa6 */
- -6.10351562499999293780097329596079841E-04L, /* bff43fffffffffff97c7c433e35ed000 */
- -1.16941808547394177991845382085515086E-34L, /* bf8e36e27886f10b234a7dd8fc588bf0 */
- -5.79833984375000068291972326409994795E-04L, /* bff43000000000000a13ff6dcf2bf000 */
- 1.17885044988246219185041488459766001E-34L, /* 3f8e3964677e001a00412aab52790842 */
- -5.49316406249990904622170867910987793E-04L, /* bff41ffffffffffac1c25739c716b000 */
- -3.31875702128137033065075734368960972E-35L, /* bf8c60e928d8982c3c99aef4f885a121 */
- -5.18798828125011293653756992177727236E-04L, /* bff410000000000682a62cff36775000 */
- -5.69971237642088463334239430962628187E-35L, /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
- -4.88281249999990512232251384917893121E-04L, /* bff3fffffffffff50fb48992320df000 */
- 1.02144616714408655325510171265051108E-35L, /* 3f8ab279a3626612710b9b3ac71734ac */
- -4.57763671874997554564967307956493434E-04L, /* bff3dffffffffffd2e3c272e3cca9000 */
- -8.25484058867957231164162481843653503E-35L, /* bf8db6e71158e7bf93e2e683f07aa841 */
- -4.27246093749991203999790346349633286E-04L, /* bff3bffffffffff5dbe103cba0eb2000 */
- -3.51191203319375193921924105905691755E-35L, /* bf8c757356d0f3dd7fbefc0dd419ab50 */
- -3.96728515624986649402960638705483281E-04L, /* bff39ffffffffff09b996882706ec000 */
- -5.51925962073095883016589497244931171E-36L, /* bf89d586d49f22289cfc860bebb99056 */
- -3.66210937499999945095511981300980754E-04L, /* bff37fffffffffffefcb88bfc7df6000 */
- -2.11696465278144529364423332249588595E-35L, /* bf8bc23a84d28e5496c874ef9833be25 */
- -3.35693359374992480958458008559640163E-04L, /* bff35ffffffffff754c548a8798f2000 */
- -8.58941791799705081104736787493668352E-35L, /* bf8dc8b1192fb7c3662826d43acb7c68 */
- -3.05175781250009811036303273640122156E-04L, /* bff340000000000b4fb4f1aad1c76000 */
- -8.61173897858769926480551302277426632E-35L, /* bf8dc9e0eabb1c0b33051011b64769fa */
- -2.74658203124987298321920308390303850E-04L, /* bff31ffffffffff15b2056ac252fd000 */
- 3.35152809454778381053519808988046631E-37L, /* 3f85c82fb59ff8d7c80d44e635420ab1 */
- -2.44140624999999992770514819575735516E-04L, /* bff2fffffffffffffbbb82d6a7636000 */
- 3.54445837111124472730013879165516908E-35L, /* 3f8c78e955b01378be647b1c92aa9a77 */
- -2.13623046875012756463165168672749438E-04L, /* bff2c0000000001d6a1635fea6bbf000 */
- 1.50050816288650121729916777279129473E-35L, /* 3f8b3f1f6f616a61129a58e131cbd31d */
- -1.83105468749991323078784464300306893E-04L, /* bff27fffffffffebfe0cbd0c82399000 */
- -9.14919506501448661140572099029756008E-37L, /* bf873754bacaa9d9513b6127e791eb47 */
- -1.52587890625013337032336300236461546E-04L, /* bff240000000001ec0cb57f2cc995000 */
- 2.84906084373176180870418394956384516E-35L, /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
- -1.22070312499990746786116828458007518E-04L, /* bff1ffffffffffd553bbb49f35a34000 */
- 6.71618008964968339584520728412444537E-36L, /* 3f8a1dacb99c60071fc9cd2349495bf0 */
- -9.15527343750029275602791047595142231E-05L, /* bff180000000000d8040cd6ecde28000 */
- -1.95753652091078750312541716951402172E-35L, /* bf8ba0526cfb24d8d59122f1c7a09a14 */
- -6.10351562499913258461494008080572701E-05L, /* bff0ffffffffffaffebbb92d7f6a9000 */
- 5.69868489273961111703398456218119973E-36L, /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
- -3.05175781250092882818419203884960853E-05L, /* bff0000000000055ab55de88fac1d000 */
- 9.03341100018476837609128961872915953E-36L, /* 3f8a803d229fa3a0e834a63abb06662b */
+ L(-1.98364257812501251077851763965418372E-03), /* bff6040000000001cd90f658cf0b1000 */
+ L(-3.71984513103117734260309047540278737E-34), /* bf8fee73c54483194782aac4a6154d11 */
+ L(-1.95312500000000378520649630233891879E-03), /* bff60000000000008ba643bb5e2e8000 */
+ L(-1.12194202736719050440745599339855038E-34), /* bf8e2a436aeff7bc529873354f47a3f5 */
+ L(-1.92260742187499397430259771221991482E-03), /* bff5f7fffffffffe4361cb51170da000 */
+ L(-2.30068299876822157331268484824540848E-34), /* bf8f31d02f85cfe8c0cc02276ce0f437 */
+ L(-1.89208984375001137424603270262074989E-03), /* bff5f0000000000347456ed490c23000 */
+ L(-1.15012507244426243338260435466985403E-34), /* bf8e31c174d5677a937a34ad8d2a70b4 */
+ L(-1.86157226562500172319250342061336738E-03), /* bff5e800000000007f262fa3617b4000 */
+ L(-3.12438344643346437509767736937785561E-34), /* bf8f9f4d426a2457c273d34ef7d9bde9 */
+ L(-1.83105468749999505256246872355430379E-03), /* bff5dffffffffffe92f18c1c2b6fa000 */
+ L(-5.91130415288336591179087455220308942E-35), /* bf8d3a4c80b42dc036bae446c9807f78 */
+ L(-1.80053710937499445182387245573120522E-03), /* bff5d7fffffffffe669dea82b4a4c000 */
+ L(-1.92396289352411531324908916321392100E-34), /* bf8eff7a2123fb573ba9778550d669bd */
+ L(-1.77001953125000387737631542516323906E-03), /* bff5d000000000011e19915c3ddb7000 */
+ L(7.91101758977203355387806553469731354E-36), /* 3f8a507f5a70faaccf469e3461873dea */
+ L(-1.73950195312500034854670281415554486E-03), /* bff5c8000000000019b7dc6ef97bd000 */
+ L(1.55906551582436824067407021178835755E-34), /* 3f8e9e7880333e34955aebcde3cfb053 */
+ L(-1.70898437499998955782591472611429852E-03), /* bff5bffffffffffcfd80e88aa6b96000 */
+ L(8.22951661962611381718215899498500357E-35), /* 3f8db58e6031a779b59f6ece191de7cc */
+ L(-1.67846679687500586652037711131708544E-03), /* bff5b80000000001b0df6fd21c133000 */
+ L(-8.96642618848426299713145894522897419E-35), /* bf8ddcbcab46d531801bfae4121f2f8a */
+ L(-1.64794921875000109499161354039904782E-03), /* bff5b0000000000050cbce8915575000 */
+ L(-2.88077905394253859590587789680486639E-34), /* bf8f7eebd4dd860ef73b674d5e707959 */
+ L(-1.61743164062501133830507079150388351E-03), /* bff5a80000000003449e8700c3e82000 */
+ L(-3.68271725851639066312899986829350273E-34), /* bf8fe9845fe20a5fe74059e0cae185d6 */
+ L(-1.58691406249999015546015764131101956E-03), /* bff59ffffffffffd2999e668cdd28000 */
+ L(8.48197657099957029953716507898788812E-35), /* 3f8dc2faaebb97392e451b07b28c4b12 */
+ L(-1.55639648437500317366570219290722587E-03), /* bff5980000000000ea2cd9a40d256000 */
+ L(-3.45156704719737676412949957712570373E-36), /* bf8925a079505516c8e317ac1ff53255 */
+ L(-1.52587890625000568759013197767046039E-03), /* bff5900000000001a3ab8a3f6b698000 */
+ L(-1.01902948542497496574967177677556729E-34), /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
+ L(-1.49536132812500945889014955936485340E-03), /* bff5880000000002b9f1621b57743000 */
+ L(-3.32264697086631598830366079048117140E-34), /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
+ L(-1.46484374999999931883259902869504725E-03), /* bff57fffffffffffcdbd1c90e1b4a000 */
+ L(-1.76487524793892929381101031660811433E-34), /* bf8ed52f2f724bc1ae870b18356337b4 */
+ L(-1.43432617187498876325946983333888768E-03), /* bff577fffffffffcc2dff8faa5570000 */
+ L(-3.54550084538495708816233114576143814E-34), /* bf8fd74724576915868c1e8ce9f430f1 */
+ L(-1.40380859374999215367421282192718062E-03), /* bff56ffffffffffdbd0b18aac65ed000 */
+ L(-1.90585907028351204486765167064669639E-34), /* bf8efaaa0c0e23e50c11b2120348054f */
+ L(-1.37329101562499692341771212945644892E-03), /* bff567ffffffffff1cfd00f1b0577000 */
+ L(-3.59631150411372589637918252836880320E-34), /* bf8fde08239ac74942a46298ea4fb715 */
+ L(-1.34277343749999137467356674296739172E-03), /* bff55ffffffffffd839030b05d53d000 */
+ L(-1.49571076125940368185068762485268117E-35), /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
+ L(-1.31225585937499247038404301859788734E-03), /* bff557fffffffffdd469936e691e3000 */
+ L(3.10375845385355395586146533282311300E-34), /* 3f8f9c8f6d63b7a4145716ffd92491fb */
+ L(-1.28173828124999024755581675764821898E-03), /* bff54ffffffffffd306589b0ab21d000 */
+ L(-1.98541096105909793397376077900810019E-34), /* bf8f07e808bbb1e35106c294ffbb9687 */
+ L(-1.25122070312500340204619591143332523E-03), /* bff5480000000000fb06d5f16ad2c000 */
+ L(3.62884195935761446237911443317457521E-34), /* 3f8fe25b17d623178a386a6fa6c5afb2 */
+ L(-1.22070312499999591578388993012071279E-03), /* bff53ffffffffffed2a356c440074000 */
+ L(-2.96756662615653130862526710937493307E-35), /* bf8c3b90d8ff2a991e5bd16718fb0645 */
+ L(-1.19018554687498821966212632349422735E-03), /* bff537fffffffffc9ac3b585dda89000 */
+ L(1.44659971891167323357060028901142644E-34), /* 3f8e809279ab249edf1dad9fe13fb0bf */
+ L(-1.15966796875000160938908064907298384E-03), /* bff530000000000076c0800db9639000 */
+ L(2.50088010538742402346270685365928513E-34), /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
+ L(-1.12915039062500267151512523291939657E-03), /* bff5280000000000c51f7e7315137000 */
+ L(7.56402096465615210500092443924888831E-35), /* 3f8d922c1e485d99aea2668ed32b55a6 */
+ L(-1.09863281249998665006360103291051571E-03), /* bff51ffffffffffc26f2d4c9ce2ba000 */
+ L(1.43982174467233642713619821353592061E-34), /* 3f8e7ec530b3d92b6303bec1c81214d1 */
+ L(-1.06811523437500522742248711752028025E-03), /* bff518000000000181b7380f10446000 */
+ L(5.41265133745862349181293024531133174E-35), /* 3f8d1fc9313d018b30e790e06b6be723 */
+ L(-1.03759765624999980942114138999770552E-03), /* bff50ffffffffffff1f01130490e1000 */
+ L(1.21525139612685854366189534669623436E-34), /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
+ L(-1.00708007812499602697537601515759439E-03), /* bff507fffffffffedad7afcce7051000 */
+ L(1.00020246351201558505328236381833392E-34), /* 3f8e09e640992512b1300744a7e984ed */
+ L(-9.76562499999992592487302113340463694E-04), /* bff4fffffffffffbbad8151f8adf6000 */
+ L(-1.64984406575162932060422892046851002E-34), /* bf8eb69a919986e8054b86fc34300f24 */
+ L(-9.46044921874989085824996924138179594E-04), /* bff4effffffffff9b55a204fd9792000 */
+ L(-9.29539174108308550334255350011347171E-35), /* bf8dee3a50ed896b4656fa577a1df3d7 */
+ L(-9.15527343750013735214860599791540029E-04), /* bff4e00000000007eaf5bf103f82d000 */
+ L(3.07557018309280519949818825519490586E-35), /* 3f8c470cfbef77d32c74cb8042f6ee81 */
+ L(-8.85009765625012292294986105781516428E-04), /* bff4d000000000071605c65403b97000 */
+ L(4.77499983783821950338363358545463558E-35), /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
+ L(-8.54492187499986941239470706817188192E-04), /* bff4bffffffffff878ddf9cab264a000 */
+ L(-1.60128240346239526958630011447901568E-34), /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
+ L(-8.23974609374996290174598690241743810E-04), /* bff4affffffffffddc86c249ebe06000 */
+ L(1.61677540391961912631535763471935882E-34), /* 3f8eadd00841366b0dc2bc262c2c8c36 */
+ L(-7.93457031249988696952538334288757473E-04), /* bff49ffffffffff97bf6f0aa85a5f000 */
+ L(1.22318577008381887076634753347515709E-34), /* 3f8e452db5b5d250878f71040da06d14 */
+ L(-7.62939453124996723316499040007097041E-04), /* bff48ffffffffffe1c7265b431108000 */
+ L(-1.03845161748762410745671891558398468E-34), /* bf8e14115ad884c96d1a820c73647220 */
+ L(-7.32421874999998242520117923997325794E-04), /* bff47ffffffffffefca4498b7aa8a000 */
+ L(5.64005211953031009549514026639438083E-35), /* 3f8d2be06950f68f1a6d8ff829a6928e */
+ L(-7.01904296874999772890934814265622012E-04), /* bff46fffffffffffde7c0fe5d8041000 */
+ L(5.90245467325173644235991233229525762E-35), /* 3f8d39d40cc49002189243c194b1db0e */
+ L(-6.71386718750008699269643939210658742E-04), /* bff460000000000503c91d798b60c000 */
+ L(-5.20515801723324452151498579012322191E-35), /* bf8d14c0f08a6a9285b32b8bda003eb5 */
+ L(-6.40869140625005499535275057463709988E-04), /* bff45000000000032b969184e9751000 */
+ L(-6.69469163285461870099846471658294534E-35), /* bf8d63f36bab7b24d936c9380e3d3fa6 */
+ L(-6.10351562499999293780097329596079841E-04), /* bff43fffffffffff97c7c433e35ed000 */
+ L(-1.16941808547394177991845382085515086E-34), /* bf8e36e27886f10b234a7dd8fc588bf0 */
+ L(-5.79833984375000068291972326409994795E-04), /* bff43000000000000a13ff6dcf2bf000 */
+ L(1.17885044988246219185041488459766001E-34), /* 3f8e3964677e001a00412aab52790842 */
+ L(-5.49316406249990904622170867910987793E-04), /* bff41ffffffffffac1c25739c716b000 */
+ L(-3.31875702128137033065075734368960972E-35), /* bf8c60e928d8982c3c99aef4f885a121 */
+ L(-5.18798828125011293653756992177727236E-04), /* bff410000000000682a62cff36775000 */
+ L(-5.69971237642088463334239430962628187E-35), /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
+ L(-4.88281249999990512232251384917893121E-04), /* bff3fffffffffff50fb48992320df000 */
+ L(1.02144616714408655325510171265051108E-35), /* 3f8ab279a3626612710b9b3ac71734ac */
+ L(-4.57763671874997554564967307956493434E-04), /* bff3dffffffffffd2e3c272e3cca9000 */
+ L(-8.25484058867957231164162481843653503E-35), /* bf8db6e71158e7bf93e2e683f07aa841 */
+ L(-4.27246093749991203999790346349633286E-04), /* bff3bffffffffff5dbe103cba0eb2000 */
+ L(-3.51191203319375193921924105905691755E-35), /* bf8c757356d0f3dd7fbefc0dd419ab50 */
+ L(-3.96728515624986649402960638705483281E-04), /* bff39ffffffffff09b996882706ec000 */
+ L(-5.51925962073095883016589497244931171E-36), /* bf89d586d49f22289cfc860bebb99056 */
+ L(-3.66210937499999945095511981300980754E-04), /* bff37fffffffffffefcb88bfc7df6000 */
+ L(-2.11696465278144529364423332249588595E-35), /* bf8bc23a84d28e5496c874ef9833be25 */
+ L(-3.35693359374992480958458008559640163E-04), /* bff35ffffffffff754c548a8798f2000 */
+ L(-8.58941791799705081104736787493668352E-35), /* bf8dc8b1192fb7c3662826d43acb7c68 */
+ L(-3.05175781250009811036303273640122156E-04), /* bff340000000000b4fb4f1aad1c76000 */
+ L(-8.61173897858769926480551302277426632E-35), /* bf8dc9e0eabb1c0b33051011b64769fa */
+ L(-2.74658203124987298321920308390303850E-04), /* bff31ffffffffff15b2056ac252fd000 */
+ L(3.35152809454778381053519808988046631E-37), /* 3f85c82fb59ff8d7c80d44e635420ab1 */
+ L(-2.44140624999999992770514819575735516E-04), /* bff2fffffffffffffbbb82d6a7636000 */
+ L(3.54445837111124472730013879165516908E-35), /* 3f8c78e955b01378be647b1c92aa9a77 */
+ L(-2.13623046875012756463165168672749438E-04), /* bff2c0000000001d6a1635fea6bbf000 */
+ L(1.50050816288650121729916777279129473E-35), /* 3f8b3f1f6f616a61129a58e131cbd31d */
+ L(-1.83105468749991323078784464300306893E-04), /* bff27fffffffffebfe0cbd0c82399000 */
+ L(-9.14919506501448661140572099029756008E-37), /* bf873754bacaa9d9513b6127e791eb47 */
+ L(-1.52587890625013337032336300236461546E-04), /* bff240000000001ec0cb57f2cc995000 */
+ L(2.84906084373176180870418394956384516E-35), /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
+ L(-1.22070312499990746786116828458007518E-04), /* bff1ffffffffffd553bbb49f35a34000 */
+ L(6.71618008964968339584520728412444537E-36), /* 3f8a1dacb99c60071fc9cd2349495bf0 */
+ L(-9.15527343750029275602791047595142231E-05), /* bff180000000000d8040cd6ecde28000 */
+ L(-1.95753652091078750312541716951402172E-35), /* bf8ba0526cfb24d8d59122f1c7a09a14 */
+ L(-6.10351562499913258461494008080572701E-05), /* bff0ffffffffffaffebbb92d7f6a9000 */
+ L(5.69868489273961111703398456218119973E-36), /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
+ L(-3.05175781250092882818419203884960853E-05), /* bff0000000000055ab55de88fac1d000 */
+ L(9.03341100018476837609128961872915953E-36), /* 3f8a803d229fa3a0e834a63abb06662b */
#define T_EXPL_ARG2 (2*T_EXPL_ARG1 + 2 + 2*65)
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 3.05175781249814607084128277672749162E-05L, /* 3feffffffffffeaa02abb9102f499000 */
- 1.00271855391179733380665816525889949E-36L, /* 3f8755351afa042ac3f58114824d4c10 */
- 6.10351562500179243748093427073421439E-05L, /* 3ff1000000000052a95de07a4c26d000 */
- 1.67231624299180373502350811501181670E-36L, /* 3f881c87a53691cae9d77f4e40d66616 */
- 9.15527343749970728685313252158399200E-05L, /* 3ff17ffffffffff28040cc2acde28000 */
- 2.43665747834893104318707597514407880E-36L, /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
- 1.22070312500027751961838150070880064E-04L, /* 3ff200000000003ffddde6c153b53000 */
- -1.73322146370624186623546452226755405E-35L, /* bf8b709d8d658ed5dbbe943de56ee84e */
- 1.52587890624995916105682628143179430E-04L, /* 3ff23ffffffffff6954b56e285d23000 */
- 1.23580432650945898349135528000443828E-35L, /* 3f8b06d396601dde16de7d7bc27346e6 */
- 1.83105468750008670314358488289621794E-04L, /* 3ff2800000000013fe0cdc8c823b7000 */
- 4.30446229148833293310207915930740796E-35L, /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
- 2.13623046875005741337455947623248132E-04L, /* 3ff2c0000000000d3d1662de21a3f000 */
- -3.96110759869520786681660669615255057E-35L, /* bf8ca5379b04ff4a31aab0ceacc917e6 */
- 2.44140624999981493573336463433440506E-04L, /* 3ff2ffffffffffd553bbdf48e0534000 */
- -1.39617373942387888957350179316792928E-35L, /* bf8b28eeedc286015802b63f96b8c5cd */
- 2.74658203124984920706309918754626834E-04L, /* 3ff31fffffffffee9d60c8439ec1d000 */
- -3.16168080483901830349738314447356223E-36L, /* bf890cf74f81c77a611abc1243812444 */
- 3.05175781250008648918265055410966055E-04L, /* 3ff3400000000009f8b5c9a346636000 */
- 8.54421306185008998867856704677221443E-35L, /* 3f8dc649cd40922fc08adc6b6b20ead0 */
- 3.35693359374988945462612499316774515E-04L, /* 3ff35ffffffffff34146c540f15b2000 */
- 7.96443137431639500475160850431097078E-35L, /* 3f8da77638ed3148fc4d99d1c9e13446 */
- 3.66210937500027690542093987739604535E-04L, /* 3ff380000000001fecce34bea89c4000 */
- 2.14507323877752361258862577769090367E-35L, /* 3f8bc834e554d38894cf91957b0253d3 */
- 3.96728515625003928083564943615052121E-04L, /* 3ff3a00000000004875d9a4acf6ab000 */
- 4.88358523466632050664019922448605508E-35L, /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
- 4.27246093750017799227172345607351585E-04L, /* 3ff3c00000000014856794c3ee850000 */
- 6.66520494592631402182216588784828935E-35L, /* 3f8d6262118fcdb59b8f16108f5f1a6c */
- 4.57763671875002108342364320152138181E-04L, /* 3ff3e000000000026e45d855410b9000 */
- 7.21799615960261390920033272189522298E-35L, /* 3f8d7fc645cff8879462296af975c9fd */
- 4.88281249999999768797631616370963356E-04L, /* 3ff3ffffffffffffbbc2d7cc004df000 */
- -5.30564629906905979452258114088325361E-35L, /* bf8d1a18b71929a30d67a217a27ae851 */
- 5.18798828124997339054881383202487041E-04L, /* 3ff40ffffffffffe775055eea5851000 */
- -4.03682911253647925867848180522846377E-35L, /* bf8cad44f0f3e5199d8a589d9332acad */
- 5.49316406249980511907933706754958501E-04L, /* 3ff41ffffffffff4c410b29bb62fb000 */
- -2.08166843948323917121806956728438051E-35L, /* bf8bbab8cf691403249fe5b699e25143 */
- 5.79833984374989593561576568548497165E-04L, /* 3ff42ffffffffffa0047df328d817000 */
- -1.72745033420153042445343706432627539E-34L, /* bf8ecb3c2d7d3a9e6e960576be901fdf */
- 6.10351562500008540711511259540838154E-04L, /* 3ff4400000000004ec62f54f8c271000 */
- 7.41889382604319545724663095428976499E-35L, /* 3f8d8a74c002c81a47c93b8e05d15f8e */
- 6.40869140625020444702875407535884986E-04L, /* 3ff450000000000bc91b09718515d000 */
- -4.47321009727305792048065440180490107E-35L, /* bf8cdbac5c8fe70822081d8993eb5cb6 */
- 6.71386718750007531635964622352684074E-04L, /* 3ff460000000000457792973db05c000 */
- 5.13698959677949336513874456684462092E-35L, /* 3f8d112114436949c5ef38d8049004ab */
- 7.01904296875006634673332887754430334E-04L, /* 3ff4700000000003d31adf2cb8b1d000 */
- -8.25665755717729437292989870760751482E-35L, /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
- 7.32421874999998244664170215504673504E-04L, /* 3ff47ffffffffffefcf5498bd5c8a000 */
- -5.64005234937832153139057628112753364E-35L, /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
- 7.62939453125017456345986752604096408E-04L, /* 3ff490000000000a101a1b093d4a8000 */
- -1.11084094120417622468550608896588329E-34L, /* bf8e274feabd2d94f6694507a46accb1 */
- 7.93457031249987558617598988993908016E-04L, /* 3ff49ffffffffff8d3f9dcab74bbf000 */
- -1.22966480225449015129079129940978828E-34L, /* bf8e46e6a65eef8fa9e42eddf3da305e */
- 8.23974609374997378723747633335135819E-04L, /* 3ff4affffffffffe7d2afbaa55b26000 */
- -1.62270010016794279091906973366704963E-34L, /* bf8eaf633f057ebdb664a34566401c4e */
- 8.54492187500023938282350821569920958E-04L, /* 3ff4c0000000000dccaabce399e59000 */
- -1.39076361712838158775374263169606160E-34L, /* bf8e71ba779364b3bbdba7841f2c4ca1 */
- 8.85009765624987932362186815286691297E-04L, /* 3ff4cffffffffff90b218886edc2a000 */
- 4.07328275060905585228261577392403980E-35L, /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
- 9.15527343749975579461305518559161974E-04L, /* 3ff4dffffffffff1ec2a21f25df33000 */
- 1.16855112459192484947855553716334015E-35L, /* 3f8af10bf319e9f5270cf249eeffbe5c */
- 9.46044921875016761584725882821122521E-04L, /* 3ff4f00000000009a992c46c16d71000 */
- 9.51660680007524262741115611071680436E-35L, /* 3f8df9fd56e81f8edf133843910ee831 */
- 9.76562499999974118878133088548272636E-04L, /* 3ff4fffffffffff1149edc46a6df6000 */
- -5.65271128977550656964071208289181661E-36L, /* bf89e0e12689dd721aa2314c81eb6429 */
- 1.00708007812498671732140389760347830E-03L, /* 3ff507fffffffffc2be94b90ed091000 */
- -1.43355074891483635310132767255371379E-34L, /* bf8e7d1a688c247b16022daab1316d55 */
- 1.03759765625002637786192745235343007E-03L, /* 3ff51000000000079a57b966bc158000 */
- 2.95905815240957629366749917020106928E-34L, /* 3f8f895387fc73bb38f8a1b254c01a60 */
- 1.06811523437500860568717813047520763E-03L, /* 3ff51800000000027afcd5b35f5e6000 */
- -5.98328495358586628195372356742878314E-35L, /* bf8d3e204130013bf6328f1b70ff8c76 */
- 1.09863281250001439958487251556220070E-03L, /* 3ff5200000000004268077c6c66bd000 */
- 2.41371837889426603334113000868144760E-34L, /* 3f8f40d6948edf864054ccf151f9815e */
- 1.12915039062501298413451613770002366E-03L, /* 3ff5280000000003be0f5dd8fe81b000 */
- -1.28815268997394164973472617519705703E-34L, /* bf8e567321172ea089dce4bc8354ecb7 */
- 1.15966796874997272036339054191407232E-03L, /* 3ff52ffffffffff8231e3bcfff1e8000 */
- 1.02996064554316248496839462594377804E-34L, /* 3f8e11cf7d402789244f68e2d4f985b1 */
- 1.19018554687502744121802585360546796E-03L, /* 3ff5380000000007e8cdf3f8f6c20000 */
- -1.43453217726255628994625761307322163E-34L, /* bf8e7d5d3370d85a374f5f4802fc517a */
- 1.22070312499997743541996266398850614E-03L, /* 3ff53ffffffffff97f0722561f454000 */
- -1.41086259180534339713692694428211646E-34L, /* bf8e77125519ff76244dfec5fbd58402 */
- 1.25122070312501024092560690174507039E-03L, /* 3ff5480000000002f3a59d8820691000 */
- 3.84102646020099293168698506729765213E-34L, /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
- 1.28173828124997986521442660131425390E-03L, /* 3ff54ffffffffffa3250a764439d9000 */
- 1.44644589735033114377952806106652650E-34L, /* 3f8e808801b80dcf38323cdbfdca2549 */
- 1.31225585937501665804856968749058137E-03L, /* 3ff5580000000004cd25a414c6d62000 */
- 1.67474574742200577294563576414361377E-34L, /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
- 1.34277343749997290265837386401818888E-03L, /* 3ff55ffffffffff83091b042cfd59000 */
- -1.55650565030381326742591837551559103E-34L, /* bf8e9dca490d7fecfadba9625ffb91c5 */
- 1.37329101562497720784949380297774268E-03L, /* 3ff567fffffffff96e3c7312f5ccf000 */
- 1.65279335325630026116581677369221748E-34L, /* 3f8eb763496f5bd7404f2298b402074f */
- 1.40380859374999099958354100336136647E-03L, /* 3ff56ffffffffffd67e2f09f2a381000 */
- 1.89919944388961890195706641264717076E-34L, /* 3f8ef8e4d0ffdfeba982aa8829501389 */
- 1.43432617187497484122173130998160625E-03L, /* 3ff577fffffffff8bf9c1d71af8a8000 */
- 2.57638517142061429772064578590009568E-34L, /* 3f8f5675d82c1cc4ada70fd3a957b89a */
- 1.46484374999999929342158925502052945E-03L, /* 3ff57fffffffffffcbdd1c7671b46000 */
- 1.76487201934184070490166772482073801E-34L, /* 3f8ed52ef732458f6e4c5c07504f33cc */
- 1.49536132812502318451070466256902933E-03L, /* 3ff5880000000006aeb7066c8ad43000 */
- 2.38068367275295804321313550609246656E-34L, /* 3f8f3c7277ae6fc390ace5e06c0b025b */
- 1.52587890625000448053340248672949543E-03L, /* 3ff59000000000014a9ae2104b3bc000 */
- 1.01174455568392813258454590274740959E-34L, /* 3f8e0cf7c434762991bb38e12acee215 */
- 1.55639648437501113499837053523090913E-03L, /* 3ff5980000000003359e2c204355e000 */
- -2.82398418808099749023517211651363693E-35L, /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
- 1.58691406249999937955142588308171026E-03L, /* 3ff59fffffffffffd2380ecbc87c2000 */
- -1.27361695572422741562701199136538047E-34L, /* bf8e5295e0e206dfb0f0266c07225448 */
- 1.61743164062498000531048954475329309E-03L, /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
- -1.22606548862580061633942923016222044E-34L, /* bf8e45f1b17bb61039d21a351bb207b8 */
- 1.64794921875001835451453858682255576E-03L, /* 3ff5b000000000054a52fa20f6565000 */
- 1.39132339594152335892305491425264583E-34L, /* 3f8e71e0904c5449b414ee49b191cef2 */
- 1.67846679687501263995029340691547953E-03L, /* 3ff5b80000000003a4a9e912c910b000 */
- 6.67245854693585315412242764786197029E-35L, /* 3f8d62c4ccac1e7511a617d469468ccd */
- 1.70898437500002646861403514115369655E-03L, /* 3ff5c00000000007a109fbaa7e015000 */
- 6.87367172354719289559624829652240928E-36L, /* 3f8a245fa835eceb42bae8128d9336db */
- 1.73950195312501174308226096992992128E-03L, /* 3ff5c80000000003627c8d637a005000 */
- -2.20824271875474985927385878948759352E-34L, /* bf8f25869b1cbefb25e735992f232f57 */
- 1.77001953124997491747605207736194513E-03L, /* 3ff5cffffffffff8c53c84b6883b8000 */
- 3.43123048533596296514343180408963705E-34L, /* 3f8fc816b91d173ddadbbf09b1287906 */
- 1.80053710937497698911127570705069398E-03L, /* 3ff5d7fffffffff95e1899f4a8430000 */
- 3.99231237340890073475077494556136100E-35L, /* 3f8ca889148f62fa854da5674df41279 */
- 1.83105468750002267094899598630423914E-03L, /* 3ff5e0000000000688d21e62ba674000 */
- -3.22274595655810623999007524769365273E-34L, /* bf8fac605cb9ae01eb719675ced25560 */
- 1.86157226562500499224728040579690330E-03L, /* 3ff5e80000000001705ce28a6d89e000 */
- 3.07094985075881613489605622068441083E-34L, /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
- 1.89208984374998234666824993196980949E-03L, /* 3ff5effffffffffae969fdc7cd8cf000 */
- -3.06287628722973914692165056776495733E-34L, /* bf8f9720477d9cfa10e464df7f91020c */
- 1.92260742187501225343755557292811682E-03L, /* 3ff5f800000000038824e428ed49a000 */
- 6.30049124729794620592961282769623368E-35L, /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
- 1.95312499999998514894032051116231258E-03L, /* 3ff5fffffffffffbb82f6a04f1ae0000 */
- -6.14610057507500948543216998736262902E-35L, /* bf8d46c862d39255370e7974d48daa7e */
- 1.98364257812501222021119324146882732E-03L, /* 3ff6040000000001c2d8a1aa5188d000 */
- 3.71942298418113774118754986159801984E-34L, /* 3f8fee6567d9940495519ffe62cbc9a4 */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(3.05175781249814607084128277672749162E-05), /* 3feffffffffffeaa02abb9102f499000 */
+ L(1.00271855391179733380665816525889949E-36), /* 3f8755351afa042ac3f58114824d4c10 */
+ L(6.10351562500179243748093427073421439E-05), /* 3ff1000000000052a95de07a4c26d000 */
+ L(1.67231624299180373502350811501181670E-36), /* 3f881c87a53691cae9d77f4e40d66616 */
+ L(9.15527343749970728685313252158399200E-05), /* 3ff17ffffffffff28040cc2acde28000 */
+ L(2.43665747834893104318707597514407880E-36), /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
+ L(1.22070312500027751961838150070880064E-04), /* 3ff200000000003ffddde6c153b53000 */
+ L(-1.73322146370624186623546452226755405E-35), /* bf8b709d8d658ed5dbbe943de56ee84e */
+ L(1.52587890624995916105682628143179430E-04), /* 3ff23ffffffffff6954b56e285d23000 */
+ L(1.23580432650945898349135528000443828E-35), /* 3f8b06d396601dde16de7d7bc27346e6 */
+ L(1.83105468750008670314358488289621794E-04), /* 3ff2800000000013fe0cdc8c823b7000 */
+ L(4.30446229148833293310207915930740796E-35), /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
+ L(2.13623046875005741337455947623248132E-04), /* 3ff2c0000000000d3d1662de21a3f000 */
+ L(-3.96110759869520786681660669615255057E-35), /* bf8ca5379b04ff4a31aab0ceacc917e6 */
+ L(2.44140624999981493573336463433440506E-04), /* 3ff2ffffffffffd553bbdf48e0534000 */
+ L(-1.39617373942387888957350179316792928E-35), /* bf8b28eeedc286015802b63f96b8c5cd */
+ L(2.74658203124984920706309918754626834E-04), /* 3ff31fffffffffee9d60c8439ec1d000 */
+ L(-3.16168080483901830349738314447356223E-36), /* bf890cf74f81c77a611abc1243812444 */
+ L(3.05175781250008648918265055410966055E-04), /* 3ff3400000000009f8b5c9a346636000 */
+ L(8.54421306185008998867856704677221443E-35), /* 3f8dc649cd40922fc08adc6b6b20ead0 */
+ L(3.35693359374988945462612499316774515E-04), /* 3ff35ffffffffff34146c540f15b2000 */
+ L(7.96443137431639500475160850431097078E-35), /* 3f8da77638ed3148fc4d99d1c9e13446 */
+ L(3.66210937500027690542093987739604535E-04), /* 3ff380000000001fecce34bea89c4000 */
+ L(2.14507323877752361258862577769090367E-35), /* 3f8bc834e554d38894cf91957b0253d3 */
+ L(3.96728515625003928083564943615052121E-04), /* 3ff3a00000000004875d9a4acf6ab000 */
+ L(4.88358523466632050664019922448605508E-35), /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
+ L(4.27246093750017799227172345607351585E-04), /* 3ff3c00000000014856794c3ee850000 */
+ L(6.66520494592631402182216588784828935E-35), /* 3f8d6262118fcdb59b8f16108f5f1a6c */
+ L(4.57763671875002108342364320152138181E-04), /* 3ff3e000000000026e45d855410b9000 */
+ L(7.21799615960261390920033272189522298E-35), /* 3f8d7fc645cff8879462296af975c9fd */
+ L(4.88281249999999768797631616370963356E-04), /* 3ff3ffffffffffffbbc2d7cc004df000 */
+ L(-5.30564629906905979452258114088325361E-35), /* bf8d1a18b71929a30d67a217a27ae851 */
+ L(5.18798828124997339054881383202487041E-04), /* 3ff40ffffffffffe775055eea5851000 */
+ L(-4.03682911253647925867848180522846377E-35), /* bf8cad44f0f3e5199d8a589d9332acad */
+ L(5.49316406249980511907933706754958501E-04), /* 3ff41ffffffffff4c410b29bb62fb000 */
+ L(-2.08166843948323917121806956728438051E-35), /* bf8bbab8cf691403249fe5b699e25143 */
+ L(5.79833984374989593561576568548497165E-04), /* 3ff42ffffffffffa0047df328d817000 */
+ L(-1.72745033420153042445343706432627539E-34), /* bf8ecb3c2d7d3a9e6e960576be901fdf */
+ L(6.10351562500008540711511259540838154E-04), /* 3ff4400000000004ec62f54f8c271000 */
+ L(7.41889382604319545724663095428976499E-35), /* 3f8d8a74c002c81a47c93b8e05d15f8e */
+ L(6.40869140625020444702875407535884986E-04), /* 3ff450000000000bc91b09718515d000 */
+ L(-4.47321009727305792048065440180490107E-35), /* bf8cdbac5c8fe70822081d8993eb5cb6 */
+ L(6.71386718750007531635964622352684074E-04), /* 3ff460000000000457792973db05c000 */
+ L(5.13698959677949336513874456684462092E-35), /* 3f8d112114436949c5ef38d8049004ab */
+ L(7.01904296875006634673332887754430334E-04), /* 3ff4700000000003d31adf2cb8b1d000 */
+ L(-8.25665755717729437292989870760751482E-35), /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
+ L(7.32421874999998244664170215504673504E-04), /* 3ff47ffffffffffefcf5498bd5c8a000 */
+ L(-5.64005234937832153139057628112753364E-35), /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
+ L(7.62939453125017456345986752604096408E-04), /* 3ff490000000000a101a1b093d4a8000 */
+ L(-1.11084094120417622468550608896588329E-34), /* bf8e274feabd2d94f6694507a46accb1 */
+ L(7.93457031249987558617598988993908016E-04), /* 3ff49ffffffffff8d3f9dcab74bbf000 */
+ L(-1.22966480225449015129079129940978828E-34), /* bf8e46e6a65eef8fa9e42eddf3da305e */
+ L(8.23974609374997378723747633335135819E-04), /* 3ff4affffffffffe7d2afbaa55b26000 */
+ L(-1.62270010016794279091906973366704963E-34), /* bf8eaf633f057ebdb664a34566401c4e */
+ L(8.54492187500023938282350821569920958E-04), /* 3ff4c0000000000dccaabce399e59000 */
+ L(-1.39076361712838158775374263169606160E-34), /* bf8e71ba779364b3bbdba7841f2c4ca1 */
+ L(8.85009765624987932362186815286691297E-04), /* 3ff4cffffffffff90b218886edc2a000 */
+ L(4.07328275060905585228261577392403980E-35), /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
+ L(9.15527343749975579461305518559161974E-04), /* 3ff4dffffffffff1ec2a21f25df33000 */
+ L(1.16855112459192484947855553716334015E-35), /* 3f8af10bf319e9f5270cf249eeffbe5c */
+ L(9.46044921875016761584725882821122521E-04), /* 3ff4f00000000009a992c46c16d71000 */
+ L(9.51660680007524262741115611071680436E-35), /* 3f8df9fd56e81f8edf133843910ee831 */
+ L(9.76562499999974118878133088548272636E-04), /* 3ff4fffffffffff1149edc46a6df6000 */
+ L(-5.65271128977550656964071208289181661E-36), /* bf89e0e12689dd721aa2314c81eb6429 */
+ L(1.00708007812498671732140389760347830E-03), /* 3ff507fffffffffc2be94b90ed091000 */
+ L(-1.43355074891483635310132767255371379E-34), /* bf8e7d1a688c247b16022daab1316d55 */
+ L(1.03759765625002637786192745235343007E-03), /* 3ff51000000000079a57b966bc158000 */
+ L(2.95905815240957629366749917020106928E-34), /* 3f8f895387fc73bb38f8a1b254c01a60 */
+ L(1.06811523437500860568717813047520763E-03), /* 3ff51800000000027afcd5b35f5e6000 */
+ L(-5.98328495358586628195372356742878314E-35), /* bf8d3e204130013bf6328f1b70ff8c76 */
+ L(1.09863281250001439958487251556220070E-03), /* 3ff5200000000004268077c6c66bd000 */
+ L(2.41371837889426603334113000868144760E-34), /* 3f8f40d6948edf864054ccf151f9815e */
+ L(1.12915039062501298413451613770002366E-03), /* 3ff5280000000003be0f5dd8fe81b000 */
+ L(-1.28815268997394164973472617519705703E-34), /* bf8e567321172ea089dce4bc8354ecb7 */
+ L(1.15966796874997272036339054191407232E-03), /* 3ff52ffffffffff8231e3bcfff1e8000 */
+ L(1.02996064554316248496839462594377804E-34), /* 3f8e11cf7d402789244f68e2d4f985b1 */
+ L(1.19018554687502744121802585360546796E-03), /* 3ff5380000000007e8cdf3f8f6c20000 */
+ L(-1.43453217726255628994625761307322163E-34), /* bf8e7d5d3370d85a374f5f4802fc517a */
+ L(1.22070312499997743541996266398850614E-03), /* 3ff53ffffffffff97f0722561f454000 */
+ L(-1.41086259180534339713692694428211646E-34), /* bf8e77125519ff76244dfec5fbd58402 */
+ L(1.25122070312501024092560690174507039E-03), /* 3ff5480000000002f3a59d8820691000 */
+ L(3.84102646020099293168698506729765213E-34), /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
+ L(1.28173828124997986521442660131425390E-03), /* 3ff54ffffffffffa3250a764439d9000 */
+ L(1.44644589735033114377952806106652650E-34), /* 3f8e808801b80dcf38323cdbfdca2549 */
+ L(1.31225585937501665804856968749058137E-03), /* 3ff5580000000004cd25a414c6d62000 */
+ L(1.67474574742200577294563576414361377E-34), /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
+ L(1.34277343749997290265837386401818888E-03), /* 3ff55ffffffffff83091b042cfd59000 */
+ L(-1.55650565030381326742591837551559103E-34), /* bf8e9dca490d7fecfadba9625ffb91c5 */
+ L(1.37329101562497720784949380297774268E-03), /* 3ff567fffffffff96e3c7312f5ccf000 */
+ L(1.65279335325630026116581677369221748E-34), /* 3f8eb763496f5bd7404f2298b402074f */
+ L(1.40380859374999099958354100336136647E-03), /* 3ff56ffffffffffd67e2f09f2a381000 */
+ L(1.89919944388961890195706641264717076E-34), /* 3f8ef8e4d0ffdfeba982aa8829501389 */
+ L(1.43432617187497484122173130998160625E-03), /* 3ff577fffffffff8bf9c1d71af8a8000 */
+ L(2.57638517142061429772064578590009568E-34), /* 3f8f5675d82c1cc4ada70fd3a957b89a */
+ L(1.46484374999999929342158925502052945E-03), /* 3ff57fffffffffffcbdd1c7671b46000 */
+ L(1.76487201934184070490166772482073801E-34), /* 3f8ed52ef732458f6e4c5c07504f33cc */
+ L(1.49536132812502318451070466256902933E-03), /* 3ff5880000000006aeb7066c8ad43000 */
+ L(2.38068367275295804321313550609246656E-34), /* 3f8f3c7277ae6fc390ace5e06c0b025b */
+ L(1.52587890625000448053340248672949543E-03), /* 3ff59000000000014a9ae2104b3bc000 */
+ L(1.01174455568392813258454590274740959E-34), /* 3f8e0cf7c434762991bb38e12acee215 */
+ L(1.55639648437501113499837053523090913E-03), /* 3ff5980000000003359e2c204355e000 */
+ L(-2.82398418808099749023517211651363693E-35), /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
+ L(1.58691406249999937955142588308171026E-03), /* 3ff59fffffffffffd2380ecbc87c2000 */
+ L(-1.27361695572422741562701199136538047E-34), /* bf8e5295e0e206dfb0f0266c07225448 */
+ L(1.61743164062498000531048954475329309E-03), /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
+ L(-1.22606548862580061633942923016222044E-34), /* bf8e45f1b17bb61039d21a351bb207b8 */
+ L(1.64794921875001835451453858682255576E-03), /* 3ff5b000000000054a52fa20f6565000 */
+ L(1.39132339594152335892305491425264583E-34), /* 3f8e71e0904c5449b414ee49b191cef2 */
+ L(1.67846679687501263995029340691547953E-03), /* 3ff5b80000000003a4a9e912c910b000 */
+ L(6.67245854693585315412242764786197029E-35), /* 3f8d62c4ccac1e7511a617d469468ccd */
+ L(1.70898437500002646861403514115369655E-03), /* 3ff5c00000000007a109fbaa7e015000 */
+ L(6.87367172354719289559624829652240928E-36), /* 3f8a245fa835eceb42bae8128d9336db */
+ L(1.73950195312501174308226096992992128E-03), /* 3ff5c80000000003627c8d637a005000 */
+ L(-2.20824271875474985927385878948759352E-34), /* bf8f25869b1cbefb25e735992f232f57 */
+ L(1.77001953124997491747605207736194513E-03), /* 3ff5cffffffffff8c53c84b6883b8000 */
+ L(3.43123048533596296514343180408963705E-34), /* 3f8fc816b91d173ddadbbf09b1287906 */
+ L(1.80053710937497698911127570705069398E-03), /* 3ff5d7fffffffff95e1899f4a8430000 */
+ L(3.99231237340890073475077494556136100E-35), /* 3f8ca889148f62fa854da5674df41279 */
+ L(1.83105468750002267094899598630423914E-03), /* 3ff5e0000000000688d21e62ba674000 */
+ L(-3.22274595655810623999007524769365273E-34), /* bf8fac605cb9ae01eb719675ced25560 */
+ L(1.86157226562500499224728040579690330E-03), /* 3ff5e80000000001705ce28a6d89e000 */
+ L(3.07094985075881613489605622068441083E-34), /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
+ L(1.89208984374998234666824993196980949E-03), /* 3ff5effffffffffae969fdc7cd8cf000 */
+ L(-3.06287628722973914692165056776495733E-34), /* bf8f9720477d9cfa10e464df7f91020c */
+ L(1.92260742187501225343755557292811682E-03), /* 3ff5f800000000038824e428ed49a000 */
+ L(6.30049124729794620592961282769623368E-35), /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
+ L(1.95312499999998514894032051116231258E-03), /* 3ff5fffffffffffbb82f6a04f1ae0000 */
+ L(-6.14610057507500948543216998736262902E-35), /* bf8d46c862d39255370e7974d48daa7e */
+ L(1.98364257812501222021119324146882732E-03), /* 3ff6040000000001c2d8a1aa5188d000 */
+ L(3.71942298418113774118754986159801984E-34), /* 3f8fee6567d9940495519ffe62cbc9a4 */
- 7.06341639425619532977052017486130353E-01L, /* 3ffe69a59c8245a9ac00000000000000 */
- 7.09106182437398424589503065362805501E-01L, /* 3ffe6b0ff72deb89d000000000000000 */
- 7.11881545564596485142772053222870454E-01L, /* 3ffe6c7bbce9a6d93000000000000000 */
- 7.14667771155948150507697391731198877E-01L, /* 3ffe6de8ef213d71e000000000000000 */
- 7.17464901725936049503573599395167548E-01L, /* 3ffe6f578f41e1a9e400000000000000 */
- 7.20272979955439790478166628417966422E-01L, /* 3ffe70c79eba33c06c00000000000000 */
- 7.23092048692387218133958981525211129E-01L, /* 3ffe72391efa434c7400000000000000 */
- 7.25922150952408251622927082280511968E-01L, /* 3ffe73ac117390acd800000000000000 */
- 7.28763329919491220643124052003258839E-01L, /* 3ffe752077990e79d000000000000000 */
- 7.31615628946641782803794740175362676E-01L, /* 3ffe769652df22f7e000000000000000 */
- 7.34479091556544505525749855223693885E-01L, /* 3ffe780da4bba98c4800000000000000 */
- 7.37353761442226890432394270646909717E-01L, /* 3ffe79866ea5f432d400000000000000 */
- 7.40239682467726090031590047146892175E-01L, /* 3ffe7b00b216ccf53000000000000000 */
- 7.43136898668758316688354170764796436E-01L, /* 3ffe7c7c70887763c000000000000000 */
- 7.46045454253390638577059235103661194E-01L, /* 3ffe7df9ab76b20fd000000000000000 */
- 7.48965393602715662213498148958024103E-01L, /* 3ffe7f78645eb8076400000000000000 */
- 7.51896761271528629722027403659012634E-01L, /* 3ffe80f89cbf42526400000000000000 */
- 7.54839601989007347171423134568613023E-01L, /* 3ffe827a561889716000000000000000 */
- 7.57793960659394638668118204805068672E-01L, /* 3ffe83fd91ec46ddc000000000000000 */
- 7.60759882362683631518152083117456641E-01L, /* 3ffe858251bdb68b8c00000000000000 */
- 7.63737412355305483879774897104653064E-01L, /* 3ffe87089711986c9400000000000000 */
- 7.66726596070820082262642358728044201E-01L, /* 3ffe8890636e31f54400000000000000 */
- 7.69727479120609181517664865168626420E-01L, /* 3ffe8a19b85b4fa2d800000000000000 */
- 7.72740107294572486917871856348938309E-01L, /* 3ffe8ba4976246833800000000000000 */
- 7.75764526561826289752232810315035749E-01L, /* 3ffe8d31020df5be4400000000000000 */
- 7.78800783071404878477039801509818062E-01L, /* 3ffe8ebef9eac820b000000000000000 */
- 7.81848923152964780936002853195532225E-01L, /* 3ffe904e8086b5a87800000000000000 */
- 7.84908993317491698871180005880887620E-01L, /* 3ffe91df97714512d800000000000000 */
- 7.87981040258010162480317717381694820E-01L, /* 3ffe9372403b8d6bcc00000000000000 */
- 7.91065110850296016042904057030682452E-01L, /* 3ffe95067c78379f2800000000000000 */
- 7.94161252153591734614934694036492147E-01L, /* 3ffe969c4dbb800b4800000000000000 */
- 7.97269511411324433014513601847284008E-01L, /* 3ffe9833b59b38154400000000000000 */
- 8.00389936051826789142893403550260700E-01L, /* 3ffe99ccb5aec7bec800000000000000 */
- 8.03522573689060742863077280162542593E-01L, /* 3ffe9b674f8f2f3d7c00000000000000 */
- 8.06667472123343942680406826184480451E-01L, /* 3ffe9d0384d70893f800000000000000 */
- 8.09824679342079301047618855591281317E-01L, /* 3ffe9ea15722892c7800000000000000 */
- 8.12994243520486992160556383169023320E-01L, /* 3ffea040c80f8374f000000000000000 */
- 8.16176213022339780422953481320291758E-01L, /* 3ffea1e1d93d687d0000000000000000 */
- 8.19370636400700819157449927843117621E-01L, /* 3ffea3848c4d49954c00000000000000 */
- 8.22577562398664585696650419777142815E-01L, /* 3ffea528e2e1d9f09800000000000000 */
- 8.25797039950100647542896581398963463E-01L, /* 3ffea6cede9f70467c00000000000000 */
- 8.29029118180400342863478613253391813E-01L, /* 3ffea876812c0877bc00000000000000 */
- 8.32273846407226292054559735333896242E-01L, /* 3ffeaa1fcc2f45343800000000000000 */
- 8.35531274141265073440720811959181447E-01L, /* 3ffeabcac15271a2a400000000000000 */
- 8.38801451086982535754188461396552157E-01L, /* 3ffead7762408309bc00000000000000 */
- 8.42084427143382358016410194068157580E-01L, /* 3ffeaf25b0a61a7b4c00000000000000 */
- 8.45380252404767357221615498019673396E-01L, /* 3ffeb0d5ae318680c400000000000000 */
- 8.48688977161503960155997106085123960E-01L, /* 3ffeb2875c92c4c99400000000000000 */
- 8.52010651900789478530029441571969073E-01L, /* 3ffeb43abd7b83db1c00000000000000 */
- 8.55345327307422548246407245642330963E-01L, /* 3ffeb5efd29f24c26400000000000000 */
- 8.58693054264576483003423845730139874E-01L, /* 3ffeb7a69db2bcc77800000000000000 */
- 8.62053883854575708767242758767679334E-01L, /* 3ffeb95f206d17228000000000000000 */
- 8.65427867359675251357487013592617586E-01L, /* 3ffebb195c86b6b29000000000000000 */
- 8.68815056262843166123843730019871145E-01L, /* 3ffebcd553b9d7b62000000000000000 */
- 8.72215502248546159513864495238522068E-01L, /* 3ffebe9307c271855000000000000000 */
- 8.75629257203538208242932228131394368E-01L, /* 3ffec0527a5e384ddc00000000000000 */
- 8.79056373217652342599848225290770642E-01L, /* 3ffec213ad4c9ed0d800000000000000 */
- 8.82496902584595399599010079327854328E-01L, /* 3ffec3d6a24ed8221800000000000000 */
- 8.85950897802745995779361010136199184E-01L, /* 3ffec59b5b27d9696800000000000000 */
- 8.89418411575955636383383762222365476E-01L, /* 3ffec761d99c5ba58800000000000000 */
- 8.92899496814352794382685374330321793E-01L, /* 3ffec92a1f72dd70d400000000000000 */
- 8.96394206635150403439382671422208659E-01L, /* 3ffecaf42e73a4c7d800000000000000 */
- 8.99902594363456265202927397695020773E-01L, /* 3ffeccc00868c0d18800000000000000 */
- 9.03424713533086704009278378180169966E-01L, /* 3ffece8daf1e0ba94c00000000000000 */
- 9.06960617887383580004723171441582963E-01L, /* 3ffed05d24612c2af000000000000000 */
- 9.10510361380034133338412516422977205E-01L, /* 3ffed22e6a0197c02c00000000000000 */
- 9.14073998175894436579724811053893063E-01L, /* 3ffed40181d094303400000000000000 */
- 9.17651582651815816982221463149471674E-01L, /* 3ffed5d66da13970f400000000000000 */
- 9.21243169397474526149949269893113524E-01L, /* 3ffed7ad2f48737a2000000000000000 */
- 9.24848813216204823639543519675498828E-01L, /* 3ffed985c89d041a3000000000000000 */
- 9.28468569125835141431224428743007593E-01L, /* 3ffedb603b7784cd1800000000000000 */
- 9.32102492359527579068867453315760940E-01L, /* 3ffedd3c89b26894e000000000000000 */
- 9.35750638366620729469147477175283711E-01L, /* 3ffedf1ab529fdd41c00000000000000 */
- 9.39413062813475779888605643463961314E-01L, /* 3ffee0fabfbc702a3c00000000000000 */
- 9.43089821584325888048638830696290825E-01L, /* 3ffee2dcab49ca51b400000000000000 */
- 9.46780970782128888929563004239753354E-01L, /* 3ffee4c079b3f8000400000000000000 */
- 9.50486566729423443256052905780961737E-01L, /* 3ffee6a62cdec7c7b000000000000000 */
- 9.54206665969188322362626308859034907E-01L, /* 3ffee88dc6afecfbfc00000000000000 */
- 9.57941325265705301283958306157728657E-01L, /* 3ffeea77490f0196b000000000000000 */
- 9.61690601605425299247542625380447134E-01L, /* 3ffeec62b5e5881fb000000000000000 */
- 9.65454552197837823079851204965962097E-01L, /* 3ffeee500f1eed967000000000000000 */
- 9.69233234476344074348475032820715569E-01L, /* 3ffef03f56a88b5d7800000000000000 */
- 9.73026706099133165128733935489435680E-01L, /* 3ffef2308e71a927a800000000000000 */
- 9.76835024950062025261843245971249416E-01L, /* 3ffef423b86b7ee79000000000000000 */
- 9.80658249139538557015427500118676107E-01L, /* 3ffef618d68936c09c00000000000000 */
- 9.84496437005408397968864164795377292E-01L, /* 3ffef80feabfeefa4800000000000000 */
- 9.88349647113845042323276857132441364E-01L, /* 3ffefa08f706bbf53800000000000000 */
- 9.92217938260243514925207364285597578E-01L, /* 3ffefc03fd56aa225000000000000000 */
- 9.96101369470117486981664001177705359E-01L, /* 3ffefe00ffaabffbbc00000000000000 */
+ L(7.06341639425619532977052017486130353E-01), /* 3ffe69a59c8245a9ac00000000000000 */
+ L(7.09106182437398424589503065362805501E-01), /* 3ffe6b0ff72deb89d000000000000000 */
+ L(7.11881545564596485142772053222870454E-01), /* 3ffe6c7bbce9a6d93000000000000000 */
+ L(7.14667771155948150507697391731198877E-01), /* 3ffe6de8ef213d71e000000000000000 */
+ L(7.17464901725936049503573599395167548E-01), /* 3ffe6f578f41e1a9e400000000000000 */
+ L(7.20272979955439790478166628417966422E-01), /* 3ffe70c79eba33c06c00000000000000 */
+ L(7.23092048692387218133958981525211129E-01), /* 3ffe72391efa434c7400000000000000 */
+ L(7.25922150952408251622927082280511968E-01), /* 3ffe73ac117390acd800000000000000 */
+ L(7.28763329919491220643124052003258839E-01), /* 3ffe752077990e79d000000000000000 */
+ L(7.31615628946641782803794740175362676E-01), /* 3ffe769652df22f7e000000000000000 */
+ L(7.34479091556544505525749855223693885E-01), /* 3ffe780da4bba98c4800000000000000 */
+ L(7.37353761442226890432394270646909717E-01), /* 3ffe79866ea5f432d400000000000000 */
+ L(7.40239682467726090031590047146892175E-01), /* 3ffe7b00b216ccf53000000000000000 */
+ L(7.43136898668758316688354170764796436E-01), /* 3ffe7c7c70887763c000000000000000 */
+ L(7.46045454253390638577059235103661194E-01), /* 3ffe7df9ab76b20fd000000000000000 */
+ L(7.48965393602715662213498148958024103E-01), /* 3ffe7f78645eb8076400000000000000 */
+ L(7.51896761271528629722027403659012634E-01), /* 3ffe80f89cbf42526400000000000000 */
+ L(7.54839601989007347171423134568613023E-01), /* 3ffe827a561889716000000000000000 */
+ L(7.57793960659394638668118204805068672E-01), /* 3ffe83fd91ec46ddc000000000000000 */
+ L(7.60759882362683631518152083117456641E-01), /* 3ffe858251bdb68b8c00000000000000 */
+ L(7.63737412355305483879774897104653064E-01), /* 3ffe87089711986c9400000000000000 */
+ L(7.66726596070820082262642358728044201E-01), /* 3ffe8890636e31f54400000000000000 */
+ L(7.69727479120609181517664865168626420E-01), /* 3ffe8a19b85b4fa2d800000000000000 */
+ L(7.72740107294572486917871856348938309E-01), /* 3ffe8ba4976246833800000000000000 */
+ L(7.75764526561826289752232810315035749E-01), /* 3ffe8d31020df5be4400000000000000 */
+ L(7.78800783071404878477039801509818062E-01), /* 3ffe8ebef9eac820b000000000000000 */
+ L(7.81848923152964780936002853195532225E-01), /* 3ffe904e8086b5a87800000000000000 */
+ L(7.84908993317491698871180005880887620E-01), /* 3ffe91df97714512d800000000000000 */
+ L(7.87981040258010162480317717381694820E-01), /* 3ffe9372403b8d6bcc00000000000000 */
+ L(7.91065110850296016042904057030682452E-01), /* 3ffe95067c78379f2800000000000000 */
+ L(7.94161252153591734614934694036492147E-01), /* 3ffe969c4dbb800b4800000000000000 */
+ L(7.97269511411324433014513601847284008E-01), /* 3ffe9833b59b38154400000000000000 */
+ L(8.00389936051826789142893403550260700E-01), /* 3ffe99ccb5aec7bec800000000000000 */
+ L(8.03522573689060742863077280162542593E-01), /* 3ffe9b674f8f2f3d7c00000000000000 */
+ L(8.06667472123343942680406826184480451E-01), /* 3ffe9d0384d70893f800000000000000 */
+ L(8.09824679342079301047618855591281317E-01), /* 3ffe9ea15722892c7800000000000000 */
+ L(8.12994243520486992160556383169023320E-01), /* 3ffea040c80f8374f000000000000000 */
+ L(8.16176213022339780422953481320291758E-01), /* 3ffea1e1d93d687d0000000000000000 */
+ L(8.19370636400700819157449927843117621E-01), /* 3ffea3848c4d49954c00000000000000 */
+ L(8.22577562398664585696650419777142815E-01), /* 3ffea528e2e1d9f09800000000000000 */
+ L(8.25797039950100647542896581398963463E-01), /* 3ffea6cede9f70467c00000000000000 */
+ L(8.29029118180400342863478613253391813E-01), /* 3ffea876812c0877bc00000000000000 */
+ L(8.32273846407226292054559735333896242E-01), /* 3ffeaa1fcc2f45343800000000000000 */
+ L(8.35531274141265073440720811959181447E-01), /* 3ffeabcac15271a2a400000000000000 */
+ L(8.38801451086982535754188461396552157E-01), /* 3ffead7762408309bc00000000000000 */
+ L(8.42084427143382358016410194068157580E-01), /* 3ffeaf25b0a61a7b4c00000000000000 */
+ L(8.45380252404767357221615498019673396E-01), /* 3ffeb0d5ae318680c400000000000000 */
+ L(8.48688977161503960155997106085123960E-01), /* 3ffeb2875c92c4c99400000000000000 */
+ L(8.52010651900789478530029441571969073E-01), /* 3ffeb43abd7b83db1c00000000000000 */
+ L(8.55345327307422548246407245642330963E-01), /* 3ffeb5efd29f24c26400000000000000 */
+ L(8.58693054264576483003423845730139874E-01), /* 3ffeb7a69db2bcc77800000000000000 */
+ L(8.62053883854575708767242758767679334E-01), /* 3ffeb95f206d17228000000000000000 */
+ L(8.65427867359675251357487013592617586E-01), /* 3ffebb195c86b6b29000000000000000 */
+ L(8.68815056262843166123843730019871145E-01), /* 3ffebcd553b9d7b62000000000000000 */
+ L(8.72215502248546159513864495238522068E-01), /* 3ffebe9307c271855000000000000000 */
+ L(8.75629257203538208242932228131394368E-01), /* 3ffec0527a5e384ddc00000000000000 */
+ L(8.79056373217652342599848225290770642E-01), /* 3ffec213ad4c9ed0d800000000000000 */
+ L(8.82496902584595399599010079327854328E-01), /* 3ffec3d6a24ed8221800000000000000 */
+ L(8.85950897802745995779361010136199184E-01), /* 3ffec59b5b27d9696800000000000000 */
+ L(8.89418411575955636383383762222365476E-01), /* 3ffec761d99c5ba58800000000000000 */
+ L(8.92899496814352794382685374330321793E-01), /* 3ffec92a1f72dd70d400000000000000 */
+ L(8.96394206635150403439382671422208659E-01), /* 3ffecaf42e73a4c7d800000000000000 */
+ L(8.99902594363456265202927397695020773E-01), /* 3ffeccc00868c0d18800000000000000 */
+ L(9.03424713533086704009278378180169966E-01), /* 3ffece8daf1e0ba94c00000000000000 */
+ L(9.06960617887383580004723171441582963E-01), /* 3ffed05d24612c2af000000000000000 */
+ L(9.10510361380034133338412516422977205E-01), /* 3ffed22e6a0197c02c00000000000000 */
+ L(9.14073998175894436579724811053893063E-01), /* 3ffed40181d094303400000000000000 */
+ L(9.17651582651815816982221463149471674E-01), /* 3ffed5d66da13970f400000000000000 */
+ L(9.21243169397474526149949269893113524E-01), /* 3ffed7ad2f48737a2000000000000000 */
+ L(9.24848813216204823639543519675498828E-01), /* 3ffed985c89d041a3000000000000000 */
+ L(9.28468569125835141431224428743007593E-01), /* 3ffedb603b7784cd1800000000000000 */
+ L(9.32102492359527579068867453315760940E-01), /* 3ffedd3c89b26894e000000000000000 */
+ L(9.35750638366620729469147477175283711E-01), /* 3ffedf1ab529fdd41c00000000000000 */
+ L(9.39413062813475779888605643463961314E-01), /* 3ffee0fabfbc702a3c00000000000000 */
+ L(9.43089821584325888048638830696290825E-01), /* 3ffee2dcab49ca51b400000000000000 */
+ L(9.46780970782128888929563004239753354E-01), /* 3ffee4c079b3f8000400000000000000 */
+ L(9.50486566729423443256052905780961737E-01), /* 3ffee6a62cdec7c7b000000000000000 */
+ L(9.54206665969188322362626308859034907E-01), /* 3ffee88dc6afecfbfc00000000000000 */
+ L(9.57941325265705301283958306157728657E-01), /* 3ffeea77490f0196b000000000000000 */
+ L(9.61690601605425299247542625380447134E-01), /* 3ffeec62b5e5881fb000000000000000 */
+ L(9.65454552197837823079851204965962097E-01), /* 3ffeee500f1eed967000000000000000 */
+ L(9.69233234476344074348475032820715569E-01), /* 3ffef03f56a88b5d7800000000000000 */
+ L(9.73026706099133165128733935489435680E-01), /* 3ffef2308e71a927a800000000000000 */
+ L(9.76835024950062025261843245971249416E-01), /* 3ffef423b86b7ee79000000000000000 */
+ L(9.80658249139538557015427500118676107E-01), /* 3ffef618d68936c09c00000000000000 */
+ L(9.84496437005408397968864164795377292E-01), /* 3ffef80feabfeefa4800000000000000 */
+ L(9.88349647113845042323276857132441364E-01), /* 3ffefa08f706bbf53800000000000000 */
+ L(9.92217938260243514925207364285597578E-01), /* 3ffefc03fd56aa225000000000000000 */
+ L(9.96101369470117486981664001177705359E-01), /* 3ffefe00ffaabffbbc00000000000000 */
#define T_EXPL_RES1 (T_EXPL_ARG2 + 2 + 2*65 + 89)
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
- 1.00391388933834757590801700644078664E+00L, /* 3fff0100802ab5577800000000000000 */
- 1.00784309720644799091004983893071767E+00L, /* 3fff0202015600445c00000000000000 */
- 1.01178768355933151879000320150225889E+00L, /* 3fff0304848362076c00000000000000 */
- 1.01574770858668572692806719715008512E+00L, /* 3fff04080ab55de39000000000000000 */
- 1.01972323271377413034244341361045372E+00L, /* 3fff050c94ef7a206c00000000000000 */
- 1.02371431660235789884438872832106426E+00L, /* 3fff06122436410dd000000000000000 */
- 1.02772102115162167201845022646011785E+00L, /* 3fff0718b98f42085000000000000000 */
- 1.03174340749910264936062276319717057E+00L, /* 3fff08205601127ec800000000000000 */
- 1.03578153702162378824169763902318664E+00L, /* 3fff0928fa934ef90800000000000000 */
- 1.03983547133622999947277776300325058E+00L, /* 3fff0a32a84e9c1f5800000000000000 */
- 1.04390527230112850620713516036630608E+00L, /* 3fff0b3d603ca7c32800000000000000 */
- 1.04799100201663270004459604933799710E+00L, /* 3fff0c49236829e8bc00000000000000 */
- 1.05209272282610977189420964350574650E+00L, /* 3fff0d55f2dce5d1e800000000000000 */
- 1.05621049731693195106174698594259098E+00L, /* 3fff0e63cfa7ab09d000000000000000 */
- 1.06034438832143151909548350886325352E+00L, /* 3fff0f72bad65671b800000000000000 */
- 1.06449445891785943185681162503897212E+00L, /* 3fff1082b577d34ed800000000000000 */
- 1.06866077243134810492719566354935523E+00L, /* 3fff1193c09c1c595c00000000000000 */
- 1.07284339243487741866189821848820429E+00L, /* 3fff12a5dd543ccc4c00000000000000 */
- 1.07704238275024494209120007326419000E+00L, /* 3fff13b90cb25176a400000000000000 */
- 1.08125780744903959851299646288680378E+00L, /* 3fff14cd4fc989cd6400000000000000 */
- 1.08548973085361949442173568058933597E+00L, /* 3fff15e2a7ae28fecc00000000000000 */
- 1.08973821753809324563988525369495619E+00L, /* 3fff16f9157587069400000000000000 */
- 1.09400333232930546678574046381982043E+00L, /* 3fff18109a3611c35000000000000000 */
- 1.09828514030782586896606289883493446E+00L, /* 3fff192937074e0cd800000000000000 */
- 1.10258370680894224324930519287590869E+00L, /* 3fff1a42ed01d8cbc800000000000000 */
- 1.10689909742365749645287564817408565E+00L, /* 3fff1b5dbd3f68122400000000000000 */
- 1.11123137799969046168868658241990488E+00L, /* 3fff1c79a8dacc350c00000000000000 */
- 1.11558061464248076122274255794764031E+00L, /* 3fff1d96b0eff0e79400000000000000 */
- 1.11994687371619722204840741142106708E+00L, /* 3fff1eb4d69bde569c00000000000000 */
- 1.12433022184475073235176978414529003E+00L, /* 3fff1fd41afcba45e800000000000000 */
- 1.12873072591281087273529237791080959E+00L, /* 3fff20f47f31c92e4800000000000000 */
- 1.13314845306682632219974493636982515E+00L, /* 3fff2216045b6f5cd000000000000000 */
- 1.13758347071604959399593326452304609E+00L, /* 3fff2338ab9b32134800000000000000 */
- 1.14203584653356560174586320499656722E+00L, /* 3fff245c7613b8a9b000000000000000 */
- 1.14650564845732405583333957110880874E+00L, /* 3fff258164e8cdb0d800000000000000 */
- 1.15099294469117646722011727433709893E+00L, /* 3fff26a7793f60164400000000000000 */
- 1.15549780370591653744227755851170514E+00L, /* 3fff27ceb43d84490400000000000000 */
- 1.16002029424032515603215642840950750E+00L, /* 3fff28f7170a755fd800000000000000 */
- 1.16456048530221917269855680387991015E+00L, /* 3fff2a20a2ce96406400000000000000 */
- 1.16911844616950438835445424956560601E+00L, /* 3fff2b4b58b372c79400000000000000 */
- 1.17369424639123270948104504896036815E+00L, /* 3fff2c7739e3c0f32c00000000000000 */
- 1.17828795578866324378353169777255971E+00L, /* 3fff2da4478b620c7400000000000000 */
- 1.18289964445632783673900689791480545E+00L, /* 3fff2ed282d763d42400000000000000 */
- 1.18752938276310060494722620205720887E+00L, /* 3fff3001ecf601af7000000000000000 */
- 1.19217724135327157730657177125976887E+00L, /* 3fff31328716a5d63c00000000000000 */
- 1.19684329114762477708211463323095813E+00L, /* 3fff32645269ea829000000000000000 */
- 1.20152760334452030077656559114984702E+00L, /* 3fff339750219b212c00000000000000 */
- 1.20623024942098072687102217059873510E+00L, /* 3fff34cb8170b5835400000000000000 */
- 1.21095130113378179892436037334846333E+00L, /* 3fff3600e78b6b11d000000000000000 */
- 1.21569083052054743854242246925423387E+00L, /* 3fff373783a722012400000000000000 */
- 1.22044890990084875515009343871497549E+00L, /* 3fff386f56fa7686e800000000000000 */
- 1.22522561187730755216662714701669756E+00L, /* 3fff39a862bd3c106400000000000000 */
- 1.23002100933670455162882717559114099E+00L, /* 3fff3ae2a8287e7a8000000000000000 */
- 1.23483517545109100499445276000187732E+00L, /* 3fff3c1e2876834aa800000000000000 */
- 1.23966818367890557750499169742397498E+00L, /* 3fff3d5ae4e2cae92c00000000000000 */
- 1.24452010776609517384017067342938390E+00L, /* 3fff3e98deaa11dcbc00000000000000 */
- 1.24939102174724003813111039562500082E+00L, /* 3fff3fd8170a52071800000000000000 */
- 1.25428099994668373895478907797951251E+00L, /* 3fff41188f42c3e32000000000000000 */
- 1.25919011697966698459794088194030337E+00L, /* 3fff425a4893dfc3f800000000000000 */
- 1.26411844775346637881341393949696794E+00L, /* 3fff439d443f5f159000000000000000 */
- 1.26906606746853711786826579555054195E+00L, /* 3fff44e183883d9e4800000000000000 */
- 1.27403305161966090564007458851847332E+00L, /* 3fff462707b2bac20c00000000000000 */
- 1.27901947599709753244923149395617656E+00L, /* 3fff476dd2045ac67800000000000000 */
- 1.28402541668774150540599521264084615E+00L, /* 3fff48b5e3c3e8186800000000000000 */
- 1.28905095007628295311619126550795045E+00L, /* 3fff49ff3e397492bc00000000000000 */
- 1.29409615284637330434591717676084954E+00L, /* 3fff4b49e2ae5ac67400000000000000 */
- 1.29916110198179535206719492634874769E+00L, /* 3fff4c95d26d3f440800000000000000 */
- 1.30424587476763775839572190307080746E+00L, /* 3fff4de30ec211e60000000000000000 */
- 1.30935054879147461104338390214252286E+00L, /* 3fff4f3198fa0f1cf800000000000000 */
- 1.31447520194454914310711046709911898E+00L, /* 3fff50817263c13cd000000000000000 */
- 1.31961991242296217130558488861424848E+00L, /* 3fff51d29c4f01cb3000000000000000 */
- 1.32478475872886558573071624778094701E+00L, /* 3fff5325180cfacf7800000000000000 */
- 1.32996981967165983640200010995613411E+00L, /* 3fff5478e6f02823d000000000000000 */
- 1.33517517436919680440254865061433520E+00L, /* 3fff55ce0a4c58c7bc00000000000000 */
- 1.34040090224898678084031189428060316E+00L, /* 3fff57248376b033d800000000000000 */
- 1.34564708304941055283521222918352578E+00L, /* 3fff587c53c5a7af0400000000000000 */
- 1.35091379682093615244298234756570309E+00L, /* 3fff59d57c910fa4e000000000000000 */
- 1.35620112392734021300455538039386738E+00L, /* 3fff5b2fff3210fd9400000000000000 */
- 1.36150914504693443252136830778908916E+00L, /* 3fff5c8bdd032e770800000000000000 */
- 1.36683794117379636690046140756749082E+00L, /* 3fff5de9176045ff5400000000000000 */
- 1.37218759361900544124779344201670028E+00L, /* 3fff5f47afa69210a800000000000000 */
- 1.37755818401188367960941150158760138E+00L, /* 3fff60a7a734ab0e8800000000000000 */
- 1.38294979430124120867162673675920814E+00L, /* 3fff6208ff6a88a46000000000000000 */
- 1.38836250675662681297595213436579797E+00L, /* 3fff636bb9a983258400000000000000 */
- 1.39379640396958309755959248832368758E+00L, /* 3fff64cfd75454ee7c00000000000000 */
- 1.39925156885490681313299887733592186E+00L, /* 3fff663559cf1bc7c400000000000000 */
- 1.40472808465191417726103395580139477E+00L, /* 3fff679c427f5a49f400000000000000 */
- 1.41022603492571069194738697660795879E+00L, /* 3fff690492cbf9432c00000000000000 */
- 1.41574550356846662335641440222389065E+00L, /* 3fff6a6e4c1d491e1800000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
+ L(1.00391388933834757590801700644078664E+00), /* 3fff0100802ab5577800000000000000 */
+ L(1.00784309720644799091004983893071767E+00), /* 3fff0202015600445c00000000000000 */
+ L(1.01178768355933151879000320150225889E+00), /* 3fff0304848362076c00000000000000 */
+ L(1.01574770858668572692806719715008512E+00), /* 3fff04080ab55de39000000000000000 */
+ L(1.01972323271377413034244341361045372E+00), /* 3fff050c94ef7a206c00000000000000 */
+ L(1.02371431660235789884438872832106426E+00), /* 3fff06122436410dd000000000000000 */
+ L(1.02772102115162167201845022646011785E+00), /* 3fff0718b98f42085000000000000000 */
+ L(1.03174340749910264936062276319717057E+00), /* 3fff08205601127ec800000000000000 */
+ L(1.03578153702162378824169763902318664E+00), /* 3fff0928fa934ef90800000000000000 */
+ L(1.03983547133622999947277776300325058E+00), /* 3fff0a32a84e9c1f5800000000000000 */
+ L(1.04390527230112850620713516036630608E+00), /* 3fff0b3d603ca7c32800000000000000 */
+ L(1.04799100201663270004459604933799710E+00), /* 3fff0c49236829e8bc00000000000000 */
+ L(1.05209272282610977189420964350574650E+00), /* 3fff0d55f2dce5d1e800000000000000 */
+ L(1.05621049731693195106174698594259098E+00), /* 3fff0e63cfa7ab09d000000000000000 */
+ L(1.06034438832143151909548350886325352E+00), /* 3fff0f72bad65671b800000000000000 */
+ L(1.06449445891785943185681162503897212E+00), /* 3fff1082b577d34ed800000000000000 */
+ L(1.06866077243134810492719566354935523E+00), /* 3fff1193c09c1c595c00000000000000 */
+ L(1.07284339243487741866189821848820429E+00), /* 3fff12a5dd543ccc4c00000000000000 */
+ L(1.07704238275024494209120007326419000E+00), /* 3fff13b90cb25176a400000000000000 */
+ L(1.08125780744903959851299646288680378E+00), /* 3fff14cd4fc989cd6400000000000000 */
+ L(1.08548973085361949442173568058933597E+00), /* 3fff15e2a7ae28fecc00000000000000 */
+ L(1.08973821753809324563988525369495619E+00), /* 3fff16f9157587069400000000000000 */
+ L(1.09400333232930546678574046381982043E+00), /* 3fff18109a3611c35000000000000000 */
+ L(1.09828514030782586896606289883493446E+00), /* 3fff192937074e0cd800000000000000 */
+ L(1.10258370680894224324930519287590869E+00), /* 3fff1a42ed01d8cbc800000000000000 */
+ L(1.10689909742365749645287564817408565E+00), /* 3fff1b5dbd3f68122400000000000000 */
+ L(1.11123137799969046168868658241990488E+00), /* 3fff1c79a8dacc350c00000000000000 */
+ L(1.11558061464248076122274255794764031E+00), /* 3fff1d96b0eff0e79400000000000000 */
+ L(1.11994687371619722204840741142106708E+00), /* 3fff1eb4d69bde569c00000000000000 */
+ L(1.12433022184475073235176978414529003E+00), /* 3fff1fd41afcba45e800000000000000 */
+ L(1.12873072591281087273529237791080959E+00), /* 3fff20f47f31c92e4800000000000000 */
+ L(1.13314845306682632219974493636982515E+00), /* 3fff2216045b6f5cd000000000000000 */
+ L(1.13758347071604959399593326452304609E+00), /* 3fff2338ab9b32134800000000000000 */
+ L(1.14203584653356560174586320499656722E+00), /* 3fff245c7613b8a9b000000000000000 */
+ L(1.14650564845732405583333957110880874E+00), /* 3fff258164e8cdb0d800000000000000 */
+ L(1.15099294469117646722011727433709893E+00), /* 3fff26a7793f60164400000000000000 */
+ L(1.15549780370591653744227755851170514E+00), /* 3fff27ceb43d84490400000000000000 */
+ L(1.16002029424032515603215642840950750E+00), /* 3fff28f7170a755fd800000000000000 */
+ L(1.16456048530221917269855680387991015E+00), /* 3fff2a20a2ce96406400000000000000 */
+ L(1.16911844616950438835445424956560601E+00), /* 3fff2b4b58b372c79400000000000000 */
+ L(1.17369424639123270948104504896036815E+00), /* 3fff2c7739e3c0f32c00000000000000 */
+ L(1.17828795578866324378353169777255971E+00), /* 3fff2da4478b620c7400000000000000 */
+ L(1.18289964445632783673900689791480545E+00), /* 3fff2ed282d763d42400000000000000 */
+ L(1.18752938276310060494722620205720887E+00), /* 3fff3001ecf601af7000000000000000 */
+ L(1.19217724135327157730657177125976887E+00), /* 3fff31328716a5d63c00000000000000 */
+ L(1.19684329114762477708211463323095813E+00), /* 3fff32645269ea829000000000000000 */
+ L(1.20152760334452030077656559114984702E+00), /* 3fff339750219b212c00000000000000 */
+ L(1.20623024942098072687102217059873510E+00), /* 3fff34cb8170b5835400000000000000 */
+ L(1.21095130113378179892436037334846333E+00), /* 3fff3600e78b6b11d000000000000000 */
+ L(1.21569083052054743854242246925423387E+00), /* 3fff373783a722012400000000000000 */
+ L(1.22044890990084875515009343871497549E+00), /* 3fff386f56fa7686e800000000000000 */
+ L(1.22522561187730755216662714701669756E+00), /* 3fff39a862bd3c106400000000000000 */
+ L(1.23002100933670455162882717559114099E+00), /* 3fff3ae2a8287e7a8000000000000000 */
+ L(1.23483517545109100499445276000187732E+00), /* 3fff3c1e2876834aa800000000000000 */
+ L(1.23966818367890557750499169742397498E+00), /* 3fff3d5ae4e2cae92c00000000000000 */
+ L(1.24452010776609517384017067342938390E+00), /* 3fff3e98deaa11dcbc00000000000000 */
+ L(1.24939102174724003813111039562500082E+00), /* 3fff3fd8170a52071800000000000000 */
+ L(1.25428099994668373895478907797951251E+00), /* 3fff41188f42c3e32000000000000000 */
+ L(1.25919011697966698459794088194030337E+00), /* 3fff425a4893dfc3f800000000000000 */
+ L(1.26411844775346637881341393949696794E+00), /* 3fff439d443f5f159000000000000000 */
+ L(1.26906606746853711786826579555054195E+00), /* 3fff44e183883d9e4800000000000000 */
+ L(1.27403305161966090564007458851847332E+00), /* 3fff462707b2bac20c00000000000000 */
+ L(1.27901947599709753244923149395617656E+00), /* 3fff476dd2045ac67800000000000000 */
+ L(1.28402541668774150540599521264084615E+00), /* 3fff48b5e3c3e8186800000000000000 */
+ L(1.28905095007628295311619126550795045E+00), /* 3fff49ff3e397492bc00000000000000 */
+ L(1.29409615284637330434591717676084954E+00), /* 3fff4b49e2ae5ac67400000000000000 */
+ L(1.29916110198179535206719492634874769E+00), /* 3fff4c95d26d3f440800000000000000 */
+ L(1.30424587476763775839572190307080746E+00), /* 3fff4de30ec211e60000000000000000 */
+ L(1.30935054879147461104338390214252286E+00), /* 3fff4f3198fa0f1cf800000000000000 */
+ L(1.31447520194454914310711046709911898E+00), /* 3fff50817263c13cd000000000000000 */
+ L(1.31961991242296217130558488861424848E+00), /* 3fff51d29c4f01cb3000000000000000 */
+ L(1.32478475872886558573071624778094701E+00), /* 3fff5325180cfacf7800000000000000 */
+ L(1.32996981967165983640200010995613411E+00), /* 3fff5478e6f02823d000000000000000 */
+ L(1.33517517436919680440254865061433520E+00), /* 3fff55ce0a4c58c7bc00000000000000 */
+ L(1.34040090224898678084031189428060316E+00), /* 3fff57248376b033d800000000000000 */
+ L(1.34564708304941055283521222918352578E+00), /* 3fff587c53c5a7af0400000000000000 */
+ L(1.35091379682093615244298234756570309E+00), /* 3fff59d57c910fa4e000000000000000 */
+ L(1.35620112392734021300455538039386738E+00), /* 3fff5b2fff3210fd9400000000000000 */
+ L(1.36150914504693443252136830778908916E+00), /* 3fff5c8bdd032e770800000000000000 */
+ L(1.36683794117379636690046140756749082E+00), /* 3fff5de9176045ff5400000000000000 */
+ L(1.37218759361900544124779344201670028E+00), /* 3fff5f47afa69210a800000000000000 */
+ L(1.37755818401188367960941150158760138E+00), /* 3fff60a7a734ab0e8800000000000000 */
+ L(1.38294979430124120867162673675920814E+00), /* 3fff6208ff6a88a46000000000000000 */
+ L(1.38836250675662681297595213436579797E+00), /* 3fff636bb9a983258400000000000000 */
+ L(1.39379640396958309755959248832368758E+00), /* 3fff64cfd75454ee7c00000000000000 */
+ L(1.39925156885490681313299887733592186E+00), /* 3fff663559cf1bc7c400000000000000 */
+ L(1.40472808465191417726103395580139477E+00), /* 3fff679c427f5a49f400000000000000 */
+ L(1.41022603492571069194738697660795879E+00), /* 3fff690492cbf9432c00000000000000 */
+ L(1.41574550356846662335641440222389065E+00), /* 3fff6a6e4c1d491e1800000000000000 */
- 9.98018323540573404351050612604012713E-01L, /* 3ffefefc41f8d4bdb000000000000000 */
- 9.98048781107475468932221929208026268E-01L, /* 3ffeff003ff556aa8800000000000000 */
- 9.98079239603882895082165305211674422E-01L, /* 3ffeff043df9d4986000000000000000 */
- 9.98109699029824021243584297735651489E-01L, /* 3ffeff083c064e972c00000000000000 */
- 9.98140159385327269125909310787392315E-01L, /* 3ffeff0c3a1ac4b6ec00000000000000 */
- 9.98170620670420977171843901487591211E-01L, /* 3ffeff10383737079400000000000000 */
- 9.98201082885133511579667242585856002E-01L, /* 3ffeff14365ba5991c00000000000000 */
- 9.98231546029493238547658506831794512E-01L, /* 3ffeff183488107b7c00000000000000 */
- 9.98262010103528552029672482603928074E-01L, /* 3ffeff1c32bc77beb000000000000000 */
- 9.98292475107267818223988342651864514E-01L, /* 3ffeff2030f8db72b000000000000000 */
- 9.98322941040739375573309644096298143E-01L, /* 3ffeff242f3d3ba77000000000000000 */
- 9.98353407903971645787066790944663808E-01L, /* 3ffeff282d89986cf000000000000000 */
- 9.98383875696992967307963340317655820E-01L, /* 3ffeff2c2bddf1d32400000000000000 */
- 9.98414344419831761845429696222709026E-01L, /* 3ffeff302a3a47ea0c00000000000000 */
- 9.98444814072516340086593800151604228E-01L, /* 3ffeff34289e9ac19800000000000000 */
- 9.98475284655075123740886056111776270E-01L, /* 3ffeff38270aea69c800000000000000 */
- 9.98505756167536479006585636852832977E-01L, /* 3ffeff3c257f36f29400000000000000 */
- 9.98536228609928799837547330753295682E-01L, /* 3ffeff4023fb806bf800000000000000 */
- 9.98566701982280452432050310562772211E-01L, /* 3ffeff44227fc6e5ec00000000000000 */
- 9.98597176284619802988373749030870385E-01L, /* 3ffeff48210c0a706800000000000000 */
- 9.98627651516975245460372434536111541E-01L, /* 3ffeff4c1fa04b1b6800000000000000 */
- 9.98658127679375173801901155457017012E-01L, /* 3ffeff501e3c88f6e800000000000000 */
- 9.98688604771847954211239084543194622E-01L, /* 3ffeff541ce0c412e000000000000000 */
- 9.98719082794421980642241010173165705E-01L, /* 3ffeff581b8cfc7f4c00000000000000 */
- 9.98749561747125619293186105096538085E-01L, /* 3ffeff5c1a41324c2400000000000000 */
- 9.98780041629987291873504773320746608E-01L, /* 3ffeff6018fd65896800000000000000 */
- 9.98810522443035364581476187595399097E-01L, /* 3ffeff6417c196471000000000000000 */
- 9.98841004186298203615379520670103375E-01L, /* 3ffeff68168dc4951400000000000000 */
- 9.98871486859804230684645176552294288E-01L, /* 3ffeff6c1561f0837400000000000000 */
- 9.98901970463581839743127943620493170E-01L, /* 3ffeff70143e1a222c00000000000000 */
- 9.98932454997659369233531378995394334E-01L, /* 3ffeff74132241813000000000000000 */
- 9.98962940462065268620861502313346136E-01L, /* 3ffeff78120e66b08400000000000000 */
- 9.98993426856827904103397486323956400E-01L, /* 3ffeff7c110289c02000000000000000 */
- 9.99023914181975669634994119405746460E-01L, /* 3ffeff800ffeaac00000000000000000 */
- 9.99054402437536959169506189937237650E-01L, /* 3ffeff840f02c9c02000000000000000 */
- 9.99084891623540138905212870668037795E-01L, /* 3ffeff880e0ee6d07800000000000000 */
- 9.99115381740013658307120181234495249E-01L, /* 3ffeff8c0d2302010c00000000000000 */
- 9.99145872786985911329082910015131347E-01L, /* 3ffeff900c3f1b61d800000000000000 */
- 9.99176364764485236413804614130640402E-01L, /* 3ffeff940b633302d000000000000000 */
- 9.99206857672540083026291313217370771E-01L, /* 3ffeff980a8f48f3f800000000000000 */
- 9.99237351511178817364822180024930276E-01L, /* 3ffeff9c09c35d454800000000000000 */
- 9.99267846280429861138827618560753763E-01L, /* 3ffeffa008ff7006c000000000000000 */
- 9.99298341980321608302162417203362565E-01L, /* 3ffeffa4084381485c00000000000000 */
- 9.99328838610882452808681364331278019E-01L, /* 3ffeffa8078f911a1800000000000000 */
- 9.99359336172140816367814863951934967E-01L, /* 3ffeffac06e39f8bf400000000000000 */
- 9.99389834664125092933417704443854745E-01L, /* 3ffeffb0063facadec00000000000000 */
- 9.99420334086863676459344674185558688E-01L, /* 3ffeffb405a3b88ffc00000000000000 */
- 9.99450834440384988655026177184481639E-01L, /* 3ffeffb8050fc3422400000000000000 */
- 9.99481335724717395718741386190231424E-01L, /* 3ffeffbc0483ccd45c00000000000000 */
- 9.99511837939889374871071936468069907E-01L, /* 3ffeffc003ffd556ac00000000000000 */
- 9.99542341085929264554721385138691403E-01L, /* 3ffeffc40383dcd90800000000000000 */
- 9.99572845162865514234695751838444266E-01L, /* 3ffeffc8030fe36b7400000000000000 */
- 9.99603350170726517864849824945849832E-01L, /* 3ffeffcc02a3e91dec00000000000000 */
- 9.99633856109540669399038392839429434E-01L, /* 3ffeffd0023fee006c00000000000000 */
- 9.99664362979336418302267475155531429E-01L, /* 3ffeffd401e3f222f800000000000000 */
- 9.99694870780142130772816244643763639E-01L, /* 3ffeffd8018ff5958800000000000000 */
- 9.99725379511986284031266336569387931E-01L, /* 3ffeffdc0143f8682400000000000000 */
- 9.99755889174897216520321308053098619E-01L, /* 3ffeffe000fffaaac000000000000000 */
- 9.99786399768903377704987178731244057E-01L, /* 3ffeffe400c3fc6d6000000000000000 */
- 9.99816911294033217050269968240172602E-01L, /* 3ffeffe8008ffdc00800000000000000 */
- 9.99847423750315072998873233700578567E-01L, /* 3ffeffec0063feb2ac00000000000000 */
- 9.99877937137777450526954226006637327E-01L, /* 3ffefff0003fff555800000000000000 */
- 9.99908451456448688077216502279043198E-01L, /* 3ffefff40023ffb80000000000000000 */
- 9.99938966706357262870241697783058044E-01L, /* 3ffefff8000fffeaac00000000000000 */
- 9.99969482887531541104308985268289689E-01L, /* 3ffefffc0003fffd5400000000000000 */
+ L(9.98018323540573404351050612604012713E-01), /* 3ffefefc41f8d4bdb000000000000000 */
+ L(9.98048781107475468932221929208026268E-01), /* 3ffeff003ff556aa8800000000000000 */
+ L(9.98079239603882895082165305211674422E-01), /* 3ffeff043df9d4986000000000000000 */
+ L(9.98109699029824021243584297735651489E-01), /* 3ffeff083c064e972c00000000000000 */
+ L(9.98140159385327269125909310787392315E-01), /* 3ffeff0c3a1ac4b6ec00000000000000 */
+ L(9.98170620670420977171843901487591211E-01), /* 3ffeff10383737079400000000000000 */
+ L(9.98201082885133511579667242585856002E-01), /* 3ffeff14365ba5991c00000000000000 */
+ L(9.98231546029493238547658506831794512E-01), /* 3ffeff183488107b7c00000000000000 */
+ L(9.98262010103528552029672482603928074E-01), /* 3ffeff1c32bc77beb000000000000000 */
+ L(9.98292475107267818223988342651864514E-01), /* 3ffeff2030f8db72b000000000000000 */
+ L(9.98322941040739375573309644096298143E-01), /* 3ffeff242f3d3ba77000000000000000 */
+ L(9.98353407903971645787066790944663808E-01), /* 3ffeff282d89986cf000000000000000 */
+ L(9.98383875696992967307963340317655820E-01), /* 3ffeff2c2bddf1d32400000000000000 */
+ L(9.98414344419831761845429696222709026E-01), /* 3ffeff302a3a47ea0c00000000000000 */
+ L(9.98444814072516340086593800151604228E-01), /* 3ffeff34289e9ac19800000000000000 */
+ L(9.98475284655075123740886056111776270E-01), /* 3ffeff38270aea69c800000000000000 */
+ L(9.98505756167536479006585636852832977E-01), /* 3ffeff3c257f36f29400000000000000 */
+ L(9.98536228609928799837547330753295682E-01), /* 3ffeff4023fb806bf800000000000000 */
+ L(9.98566701982280452432050310562772211E-01), /* 3ffeff44227fc6e5ec00000000000000 */
+ L(9.98597176284619802988373749030870385E-01), /* 3ffeff48210c0a706800000000000000 */
+ L(9.98627651516975245460372434536111541E-01), /* 3ffeff4c1fa04b1b6800000000000000 */
+ L(9.98658127679375173801901155457017012E-01), /* 3ffeff501e3c88f6e800000000000000 */
+ L(9.98688604771847954211239084543194622E-01), /* 3ffeff541ce0c412e000000000000000 */
+ L(9.98719082794421980642241010173165705E-01), /* 3ffeff581b8cfc7f4c00000000000000 */
+ L(9.98749561747125619293186105096538085E-01), /* 3ffeff5c1a41324c2400000000000000 */
+ L(9.98780041629987291873504773320746608E-01), /* 3ffeff6018fd65896800000000000000 */
+ L(9.98810522443035364581476187595399097E-01), /* 3ffeff6417c196471000000000000000 */
+ L(9.98841004186298203615379520670103375E-01), /* 3ffeff68168dc4951400000000000000 */
+ L(9.98871486859804230684645176552294288E-01), /* 3ffeff6c1561f0837400000000000000 */
+ L(9.98901970463581839743127943620493170E-01), /* 3ffeff70143e1a222c00000000000000 */
+ L(9.98932454997659369233531378995394334E-01), /* 3ffeff74132241813000000000000000 */
+ L(9.98962940462065268620861502313346136E-01), /* 3ffeff78120e66b08400000000000000 */
+ L(9.98993426856827904103397486323956400E-01), /* 3ffeff7c110289c02000000000000000 */
+ L(9.99023914181975669634994119405746460E-01), /* 3ffeff800ffeaac00000000000000000 */
+ L(9.99054402437536959169506189937237650E-01), /* 3ffeff840f02c9c02000000000000000 */
+ L(9.99084891623540138905212870668037795E-01), /* 3ffeff880e0ee6d07800000000000000 */
+ L(9.99115381740013658307120181234495249E-01), /* 3ffeff8c0d2302010c00000000000000 */
+ L(9.99145872786985911329082910015131347E-01), /* 3ffeff900c3f1b61d800000000000000 */
+ L(9.99176364764485236413804614130640402E-01), /* 3ffeff940b633302d000000000000000 */
+ L(9.99206857672540083026291313217370771E-01), /* 3ffeff980a8f48f3f800000000000000 */
+ L(9.99237351511178817364822180024930276E-01), /* 3ffeff9c09c35d454800000000000000 */
+ L(9.99267846280429861138827618560753763E-01), /* 3ffeffa008ff7006c000000000000000 */
+ L(9.99298341980321608302162417203362565E-01), /* 3ffeffa4084381485c00000000000000 */
+ L(9.99328838610882452808681364331278019E-01), /* 3ffeffa8078f911a1800000000000000 */
+ L(9.99359336172140816367814863951934967E-01), /* 3ffeffac06e39f8bf400000000000000 */
+ L(9.99389834664125092933417704443854745E-01), /* 3ffeffb0063facadec00000000000000 */
+ L(9.99420334086863676459344674185558688E-01), /* 3ffeffb405a3b88ffc00000000000000 */
+ L(9.99450834440384988655026177184481639E-01), /* 3ffeffb8050fc3422400000000000000 */
+ L(9.99481335724717395718741386190231424E-01), /* 3ffeffbc0483ccd45c00000000000000 */
+ L(9.99511837939889374871071936468069907E-01), /* 3ffeffc003ffd556ac00000000000000 */
+ L(9.99542341085929264554721385138691403E-01), /* 3ffeffc40383dcd90800000000000000 */
+ L(9.99572845162865514234695751838444266E-01), /* 3ffeffc8030fe36b7400000000000000 */
+ L(9.99603350170726517864849824945849832E-01), /* 3ffeffcc02a3e91dec00000000000000 */
+ L(9.99633856109540669399038392839429434E-01), /* 3ffeffd0023fee006c00000000000000 */
+ L(9.99664362979336418302267475155531429E-01), /* 3ffeffd401e3f222f800000000000000 */
+ L(9.99694870780142130772816244643763639E-01), /* 3ffeffd8018ff5958800000000000000 */
+ L(9.99725379511986284031266336569387931E-01), /* 3ffeffdc0143f8682400000000000000 */
+ L(9.99755889174897216520321308053098619E-01), /* 3ffeffe000fffaaac000000000000000 */
+ L(9.99786399768903377704987178731244057E-01), /* 3ffeffe400c3fc6d6000000000000000 */
+ L(9.99816911294033217050269968240172602E-01), /* 3ffeffe8008ffdc00800000000000000 */
+ L(9.99847423750315072998873233700578567E-01), /* 3ffeffec0063feb2ac00000000000000 */
+ L(9.99877937137777450526954226006637327E-01), /* 3ffefff0003fff555800000000000000 */
+ L(9.99908451456448688077216502279043198E-01), /* 3ffefff40023ffb80000000000000000 */
+ L(9.99938966706357262870241697783058044E-01), /* 3ffefff8000fffeaac00000000000000 */
+ L(9.99969482887531541104308985268289689E-01), /* 3ffefffc0003fffd5400000000000000 */
#define T_EXPL_RES2 (T_EXPL_RES1 + 1 + 89 + 65)
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
- 1.00003051804379100575559391472779680E+00L, /* 3fff0002000200015400000000000000 */
- 1.00006103701893306334724798034585547E+00L, /* 3fff00040008000aac00000000000000 */
- 1.00009155692545448346209013834595680E+00L, /* 3fff0006001200240000000000000000 */
- 1.00012207776338379883185325525118969E+00L, /* 3fff0008002000555800000000000000 */
- 1.00015259953274932014366527255333494E+00L, /* 3fff000a003200a6ac00000000000000 */
- 1.00018312223357958012925905677548144E+00L, /* 3fff000c004801200400000000000000 */
- 1.00021364586590294498691378066723701E+00L, /* 3fff000e006201c95c00000000000000 */
- 1.00024417042974783642605984823603649E+00L, /* 3fff0010008002aab400000000000000 */
- 1.00027469592514273166727889474714175E+00L, /* 3fff001200a203cc1000000000000000 */
- 1.00030522235211605242000132420798764E+00L, /* 3fff001400c805357000000000000000 */
- 1.00033574971069616488250630936818197E+00L, /* 3fff001600f206eed000000000000000 */
- 1.00036627800091160178652671675081365E+00L, /* 3fff0018012009003800000000000000 */
- 1.00039680722279067381919048784766346E+00L, /* 3fff001a01520b71a000000000000000 */
- 1.00042733737636191371223048918182030E+00L, /* 3fff001c01880e4b1000000000000000 */
- 1.00045786846165368766392589350289200E+00L, /* 3fff001e01c211948400000000000000 */
- 1.00048840047869447289485833607614040E+00L, /* 3fff0020020015560000000000000000 */
- 1.00051893342751269111445822090900037E+00L, /* 3fff0022024219978400000000000000 */
- 1.00054946730813676403215595200890675E+00L, /* 3fff002402881e611000000000000000 */
- 1.00058000212059516886853316464112140E+00L, /* 3fff002602d223baa800000000000000 */
- 1.00061053786491632733302026281307917E+00L, /* 3fff0028032029ac4c00000000000000 */
- 1.00064107454112866113504765053221490E+00L, /* 3fff002a0372303dfc00000000000000 */
- 1.00067161214926059198404573180596344E+00L, /* 3fff002c03c83777b800000000000000 */
- 1.00070215068934059710059614189958666E+00L, /* 3fff002e04223f618400000000000000 */
- 1.00073269016139709819412928482051939E+00L, /* 3fff0030048048036000000000000000 */
- 1.00076323056545857248522679583402351E+00L, /* 3fff003204e251655000000000000000 */
- 1.00079377190155338617216784768970683E+00L, /* 3fff003405485b8f5000000000000000 */
- 1.00082431416971007198668530691065826E+00L, /* 3fff003605b266896800000000000000 */
- 1.00085485736995705163820957750431262E+00L, /* 3fff00380620725b9800000000000000 */
- 1.00088540150232269132501983222027775E+00L, /* 3fff003a06927f0ddc00000000000000 */
- 1.00091594656683552377884893758164253E+00L, /* 3fff003c07088ca83c00000000000000 */
- 1.00094649256352402622027852885366883E+00L, /* 3fff003e07829b32bc00000000000000 */
- 1.00097703949241650933643654752813745E+00L, /* 3fff00400800aab55400000000000000 */
- 1.00100758735354156137020709138596430E+00L, /* 3fff00420882bb381000000000000000 */
- 1.00103813614692760403102056443458423E+00L, /* 3fff00440908ccc2f000000000000000 */
- 1.00106868587260300351715613942360505E+00L, /* 3fff00460992df5df000000000000000 */
- 1.00109923653059629256034668287611566E+00L, /* 3fff00480a20f3111800000000000000 */
- 1.00112978812093589287002259879955091E+00L, /* 3fff004a0ab307e46800000000000000 */
- 1.00116034064365022615561429120134562E+00L, /* 3fff004c0b491ddfe000000000000000 */
- 1.00119089409876788066000585786241572E+00L, /* 3fff004e0be3350b8c00000000000000 */
- 1.00122144848631711155917400901671499E+00L, /* 3fff00500c814d6f6000000000000000 */
- 1.00125200380632656260715407370298635E+00L, /* 3fff00520d2367136c00000000000000 */
- 1.00128256005882454449107399341301061E+00L, /* 3fff00540dc981ffa800000000000000 */
- 1.00131311724383964545381786592770368E+00L, /* 3fff00560e739e3c2000000000000000 */
- 1.00134367536140017618251363273884635E+00L, /* 3fff00580f21bbd0cc00000000000000 */
- 1.00137423441153472492004539162735455E+00L, /* 3fff005a0fd3dac5b800000000000000 */
- 1.00140479439427171337584354660066310E+00L, /* 3fff005c1089fb22e400000000000000 */
- 1.00143535530963956325933850166620687E+00L, /* 3fff005e11441cf05000000000000000 */
- 1.00146591715766680730226312334707472E+00L, /* 3fff0060120240360400000000000000 */
- 1.00149647993838186721404781565070152E+00L, /* 3fff006212c464fc0000000000000000 */
- 1.00152704365181316470412298258452211E+00L, /* 3fff0064138a8b4a4400000000000000 */
- 1.00155760829798923250422149067162536E+00L, /* 3fff00661454b328d800000000000000 */
- 1.00158817387693849232377374391944613E+00L, /* 3fff00681522dc9fbc00000000000000 */
- 1.00161874038868942138336137759324629E+00L, /* 3fff006a15f507b6f400000000000000 */
- 1.00164930783327055241471725821611471E+00L, /* 3fff006c16cb34768800000000000000 */
- 1.00167987621071025161612055853765924E+00L, /* 3fff006e17a562e67400000000000000 */
- 1.00171044552103705171930414508096874E+00L, /* 3fff00701883930ec000000000000000 */
- 1.00174101576427937443369842185347807E+00L, /* 3fff00721965c4f76c00000000000000 */
- 1.00177158694046569697988502412044909E+00L, /* 3fff00741a4bf8a87c00000000000000 */
- 1.00180215904962455208959681840497069E+00L, /* 3fff00761b362e29f800000000000000 */
- 1.00183273209178441698341543997230474E+00L, /* 3fff00781c246583e400000000000000 */
- 1.00186330606697365785962006157205906E+00L, /* 3fff007a1d169ebe3c00000000000000 */
- 1.00189388097522080744994354972732253E+00L, /* 3fff007c1e0cd9e10800000000000000 */
- 1.00192445681655439848611877096118405E+00L, /* 3fff007e1f0716f45000000000000000 */
- 1.00195503359100279716642489802325144E+00L, /* 3fff0080200556001000000000000000 */
- 1.00198561129859459173374602869444061E+00L, /* 3fff00822107970c5400000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
+ L(1.00003051804379100575559391472779680E+00), /* 3fff0002000200015400000000000000 */
+ L(1.00006103701893306334724798034585547E+00), /* 3fff00040008000aac00000000000000 */
+ L(1.00009155692545448346209013834595680E+00), /* 3fff0006001200240000000000000000 */
+ L(1.00012207776338379883185325525118969E+00), /* 3fff0008002000555800000000000000 */
+ L(1.00015259953274932014366527255333494E+00), /* 3fff000a003200a6ac00000000000000 */
+ L(1.00018312223357958012925905677548144E+00), /* 3fff000c004801200400000000000000 */
+ L(1.00021364586590294498691378066723701E+00), /* 3fff000e006201c95c00000000000000 */
+ L(1.00024417042974783642605984823603649E+00), /* 3fff0010008002aab400000000000000 */
+ L(1.00027469592514273166727889474714175E+00), /* 3fff001200a203cc1000000000000000 */
+ L(1.00030522235211605242000132420798764E+00), /* 3fff001400c805357000000000000000 */
+ L(1.00033574971069616488250630936818197E+00), /* 3fff001600f206eed000000000000000 */
+ L(1.00036627800091160178652671675081365E+00), /* 3fff0018012009003800000000000000 */
+ L(1.00039680722279067381919048784766346E+00), /* 3fff001a01520b71a000000000000000 */
+ L(1.00042733737636191371223048918182030E+00), /* 3fff001c01880e4b1000000000000000 */
+ L(1.00045786846165368766392589350289200E+00), /* 3fff001e01c211948400000000000000 */
+ L(1.00048840047869447289485833607614040E+00), /* 3fff0020020015560000000000000000 */
+ L(1.00051893342751269111445822090900037E+00), /* 3fff0022024219978400000000000000 */
+ L(1.00054946730813676403215595200890675E+00), /* 3fff002402881e611000000000000000 */
+ L(1.00058000212059516886853316464112140E+00), /* 3fff002602d223baa800000000000000 */
+ L(1.00061053786491632733302026281307917E+00), /* 3fff0028032029ac4c00000000000000 */
+ L(1.00064107454112866113504765053221490E+00), /* 3fff002a0372303dfc00000000000000 */
+ L(1.00067161214926059198404573180596344E+00), /* 3fff002c03c83777b800000000000000 */
+ L(1.00070215068934059710059614189958666E+00), /* 3fff002e04223f618400000000000000 */
+ L(1.00073269016139709819412928482051939E+00), /* 3fff0030048048036000000000000000 */
+ L(1.00076323056545857248522679583402351E+00), /* 3fff003204e251655000000000000000 */
+ L(1.00079377190155338617216784768970683E+00), /* 3fff003405485b8f5000000000000000 */
+ L(1.00082431416971007198668530691065826E+00), /* 3fff003605b266896800000000000000 */
+ L(1.00085485736995705163820957750431262E+00), /* 3fff00380620725b9800000000000000 */
+ L(1.00088540150232269132501983222027775E+00), /* 3fff003a06927f0ddc00000000000000 */
+ L(1.00091594656683552377884893758164253E+00), /* 3fff003c07088ca83c00000000000000 */
+ L(1.00094649256352402622027852885366883E+00), /* 3fff003e07829b32bc00000000000000 */
+ L(1.00097703949241650933643654752813745E+00), /* 3fff00400800aab55400000000000000 */
+ L(1.00100758735354156137020709138596430E+00), /* 3fff00420882bb381000000000000000 */
+ L(1.00103813614692760403102056443458423E+00), /* 3fff00440908ccc2f000000000000000 */
+ L(1.00106868587260300351715613942360505E+00), /* 3fff00460992df5df000000000000000 */
+ L(1.00109923653059629256034668287611566E+00), /* 3fff00480a20f3111800000000000000 */
+ L(1.00112978812093589287002259879955091E+00), /* 3fff004a0ab307e46800000000000000 */
+ L(1.00116034064365022615561429120134562E+00), /* 3fff004c0b491ddfe000000000000000 */
+ L(1.00119089409876788066000585786241572E+00), /* 3fff004e0be3350b8c00000000000000 */
+ L(1.00122144848631711155917400901671499E+00), /* 3fff00500c814d6f6000000000000000 */
+ L(1.00125200380632656260715407370298635E+00), /* 3fff00520d2367136c00000000000000 */
+ L(1.00128256005882454449107399341301061E+00), /* 3fff00540dc981ffa800000000000000 */
+ L(1.00131311724383964545381786592770368E+00), /* 3fff00560e739e3c2000000000000000 */
+ L(1.00134367536140017618251363273884635E+00), /* 3fff00580f21bbd0cc00000000000000 */
+ L(1.00137423441153472492004539162735455E+00), /* 3fff005a0fd3dac5b800000000000000 */
+ L(1.00140479439427171337584354660066310E+00), /* 3fff005c1089fb22e400000000000000 */
+ L(1.00143535530963956325933850166620687E+00), /* 3fff005e11441cf05000000000000000 */
+ L(1.00146591715766680730226312334707472E+00), /* 3fff0060120240360400000000000000 */
+ L(1.00149647993838186721404781565070152E+00), /* 3fff006212c464fc0000000000000000 */
+ L(1.00152704365181316470412298258452211E+00), /* 3fff0064138a8b4a4400000000000000 */
+ L(1.00155760829798923250422149067162536E+00), /* 3fff00661454b328d800000000000000 */
+ L(1.00158817387693849232377374391944613E+00), /* 3fff00681522dc9fbc00000000000000 */
+ L(1.00161874038868942138336137759324629E+00), /* 3fff006a15f507b6f400000000000000 */
+ L(1.00164930783327055241471725821611471E+00), /* 3fff006c16cb34768800000000000000 */
+ L(1.00167987621071025161612055853765924E+00), /* 3fff006e17a562e67400000000000000 */
+ L(1.00171044552103705171930414508096874E+00), /* 3fff00701883930ec000000000000000 */
+ L(1.00174101576427937443369842185347807E+00), /* 3fff00721965c4f76c00000000000000 */
+ L(1.00177158694046569697988502412044909E+00), /* 3fff00741a4bf8a87c00000000000000 */
+ L(1.00180215904962455208959681840497069E+00), /* 3fff00761b362e29f800000000000000 */
+ L(1.00183273209178441698341543997230474E+00), /* 3fff00781c246583e400000000000000 */
+ L(1.00186330606697365785962006157205906E+00), /* 3fff007a1d169ebe3c00000000000000 */
+ L(1.00189388097522080744994354972732253E+00), /* 3fff007c1e0cd9e10800000000000000 */
+ L(1.00192445681655439848611877096118405E+00), /* 3fff007e1f0716f45000000000000000 */
+ L(1.00195503359100279716642489802325144E+00), /* 3fff0080200556001000000000000000 */
+ L(1.00198561129859459173374602869444061E+00), /* 3fff00822107970c5400000000000000 */
};
diff --git a/sysdeps/ieee754/ldbl-128/t_sincosl.c b/sysdeps/ieee754/ldbl-128/t_sincosl.c
index de5fe0d9e9..51cced9dbb 100644
--- a/sysdeps/ieee754/ldbl-128/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/t_sincosl.c
@@ -25,669 +25,672 @@
Computed using gmp.
*/
-const long double __sincosl_table[] = {
+/* Include to grab typedefs and wrappers for _Float128 and such. */
+#include <math_private.h>
+
+const _Float128 __sincosl_table[] = {
/* x = 1.48437500000000000000000000000000000e-01L 3ffc3000000000000000000000000000 */
/* cos(x) = 0.fd2f5320e1b790209b4dda2f98f79caaa7b873aff1014b0fbc5243766d03cb006bc837c4358 */
- 9.89003367927322909016887196069562069e-01L, /* 3ffefa5ea641c36f2041369bb45f31ef */
- 2.15663692029265697782289400027743703e-35L, /* 3f8bcaaa7b873aff1014b0fbc5243767 */
+ L(9.89003367927322909016887196069562069e-01), /* 3ffefa5ea641c36f2041369bb45f31ef */
+ L(2.15663692029265697782289400027743703e-35), /* 3f8bcaaa7b873aff1014b0fbc5243767 */
/* sin(x) = 0.25dc50bc95711d0d9787d108fd438cf5959ee0bfb7a1e36e8b1a112968f356657420e9cc9ea */
- 1.47892995873409608580026675734609314e-01L, /* 3ffc2ee285e4ab88e86cbc3e8847ea1c */
- 9.74950446464233268291647449768590886e-36L, /* 3f8a9eb2b3dc17f6f43c6dd16342252d */
+ L(1.47892995873409608580026675734609314e-01), /* 3ffc2ee285e4ab88e86cbc3e8847ea1c */
+ L(9.74950446464233268291647449768590886e-36), /* 3f8a9eb2b3dc17f6f43c6dd16342252d */
/* x = 1.56250000000000000000000000000000000e-01 3ffc4000000000000000000000000000 */
/* cos(x) = 0.fce1a053e621438b6d60c76e8c45bf0a9dc71aa16f922acc10e95144ec796a249813c9cb649 */
- 9.87817783816471944100503034363211317e-01L, /* 3ffef9c340a7cc428716dac18edd188b */
- 4.74271307836705897892468107620526395e-35L, /* 3f8cf854ee38d50b7c915660874a8a27 */
+ L(9.87817783816471944100503034363211317e-01), /* 3ffef9c340a7cc428716dac18edd188b */
+ L(4.74271307836705897892468107620526395e-35), /* 3f8cf854ee38d50b7c915660874a8a27 */
/* sin(x) = 0.27d66258bacd96a3eb335b365c87d59438c5142bb56a489e9b8db9d36234ffdebb6bdc22d8e */
- 1.55614992773556041209920643203516258e-01L, /* 3ffc3eb312c5d66cb51f599ad9b2e43f */
--7.83989563419287980121718050629497270e-36L, /* bf8a4d78e75d7a8952b6ec2c8e48c594 */
+ L(1.55614992773556041209920643203516258e-01), /* 3ffc3eb312c5d66cb51f599ad9b2e43f */
+L(-7.83989563419287980121718050629497270e-36), /* bf8a4d78e75d7a8952b6ec2c8e48c594 */
/* x = 1.64062500000000000000000000000000000e-01 3ffc5000000000000000000000000000 */
/* cos(x) = 0.fc8ffa01ba6807417e05962b0d9fdf1fddb0cc4c07d22e19e08019bffa50a6c7acdb40307a3 */
- 9.86571908399497588757337407495308409e-01L, /* 3ffef91ff40374d00e82fc0b2c561b40 */
--2.47327949936985362476252401212720725e-35L, /* bf8c070112799d9fc16e8f30fbff3200 */
+ L(9.86571908399497588757337407495308409e-01), /* 3ffef91ff40374d00e82fc0b2c561b40 */
+L(-2.47327949936985362476252401212720725e-35), /* bf8c070112799d9fc16e8f30fbff3200 */
/* sin(x) = 0.29cfd49b8be4f665276cab01cbf0426934906c3dd105473b226e410b1450f62e53ff7c6cce1 */
- 1.63327491736612850846866172454354370e-01L, /* 3ffc4e7ea4dc5f27b3293b65580e5f82 */
- 1.81380344301155485770367902300754350e-36L, /* 3f88349a48361ee882a39d913720858a */
+ L(1.63327491736612850846866172454354370e-01), /* 3ffc4e7ea4dc5f27b3293b65580e5f82 */
+ L(1.81380344301155485770367902300754350e-36), /* 3f88349a48361ee882a39d913720858a */
/* x = 1.71875000000000000000000000000000000e-01 3ffc6000000000000000000000000000 */
/* cos(x) = 0.fc3a6170f767ac735d63d99a9d439e1db5e59d3ef153a4265d5855850ed82b536bf361b80e3 */
- 9.85265817718213816204294709759578994e-01L, /* 3ffef874c2e1eecf58e6bac7b3353a87 */
- 2.26568029505818066141517497778527952e-35L, /* 3f8be1db5e59d3ef153a4265d5855851 */
+ L(9.85265817718213816204294709759578994e-01), /* 3ffef874c2e1eecf58e6bac7b3353a87 */
+ L(2.26568029505818066141517497778527952e-35), /* 3f8be1db5e59d3ef153a4265d5855851 */
/* sin(x) = 0.2bc89f9f424de5485de7ce03b2514952b9faf5648c3244d4736feb95dbb9da49f3b58a9253b */
- 1.71030022031395019281347969239834331e-01L, /* 3ffc5e44fcfa126f2a42ef3e701d928a */
- 7.01395875187487608875416030203241317e-36L, /* 3f8a2a573f5eac9186489a8e6dfd72bb */
+ L(1.71030022031395019281347969239834331e-01), /* 3ffc5e44fcfa126f2a42ef3e701d928a */
+ L(7.01395875187487608875416030203241317e-36), /* 3f8a2a573f5eac9186489a8e6dfd72bb */
/* x = 1.79687500000000000000000000000000000e-01 3ffc7000000000000000000000000000 */
/* cos(x) = 0.fbe0d7f7fef11e70aa43b8abf4f6a457cea20c8f3f676b47781f9821bbe9ce04b3c7b981c0b */
- 9.83899591489663972178309351416487245e-01L, /* 3ffef7c1afeffde23ce154877157e9ed */
- 2.73414318948066207810486330723761265e-35L, /* 3f8c22be75106479fb3b5a3bc0fcc10e */
+ L(9.83899591489663972178309351416487245e-01), /* 3ffef7c1afeffde23ce154877157e9ed */
+ L(2.73414318948066207810486330723761265e-35), /* 3f8c22be75106479fb3b5a3bc0fcc10e */
/* sin(x) = 0.2dc0bb80b49a97ffb34e8dd1f8db9df7af47ed2dcf58b12c8e7827e048cae929da02c04ecac */
- 1.78722113535153659375356241864180724e-01L, /* 3ffc6e05dc05a4d4bffd9a746e8fc6dd */
--1.52906926517265103202547561260594148e-36L, /* bf8804285c09691853a769b8c3ec0fdc */
+ L(1.78722113535153659375356241864180724e-01), /* 3ffc6e05dc05a4d4bffd9a746e8fc6dd */
+L(-1.52906926517265103202547561260594148e-36), /* bf8804285c09691853a769b8c3ec0fdc */
/* x = 1.87500000000000000000000000000000000e-01 3ffc8000000000000000000000000000 */
/* cos(x) = 0.fb835efcf670dd2ce6fe7924697eea13ea358867e9cdb3899b783f4f9f43aa5626e8b67b3bc */
- 9.82473313101255257487327683243622495e-01L, /* 3ffef706bdf9ece1ba59cdfcf248d2fe */
--1.64924358891557584625463868014230342e-35L, /* bf8b5ec15ca779816324c766487c0b06 */
+ L(9.82473313101255257487327683243622495e-01), /* 3ffef706bdf9ece1ba59cdfcf248d2fe */
+L(-1.64924358891557584625463868014230342e-35), /* bf8b5ec15ca779816324c766487c0b06 */
/* sin(x) = 0.2fb8205f75e56a2b56a1c4792f856258769af396e0189ef72c05e4df59a6b00e4b44a6ea515 */
- 1.86403296762269884552379983103205261e-01L, /* 3ffc7dc102fbaf2b515ab50e23c97c2b */
- 1.76460304806826780010586715975331753e-36L, /* 3f882c3b4d79cb700c4f7b9602f26fad */
+ L(1.86403296762269884552379983103205261e-01), /* 3ffc7dc102fbaf2b515ab50e23c97c2b */
+ L(1.76460304806826780010586715975331753e-36), /* 3f882c3b4d79cb700c4f7b9602f26fad */
/* x = 1.95312500000000000000000000000000000e-01 3ffc9000000000000000000000000000 */
/* cos(x) = 0.fb21f7f5c156696b00ac1fe28ac5fd76674a92b4df80d9c8a46c684399005deccc41386257c */
- 9.80987069605669190469329896435309665e-01L, /* 3ffef643efeb82acd2d601583fc5158c */
--1.90899259410096419886996331536278461e-36L, /* bf8844cc5ab6a5903f931badc9cbde34 */
+ L(9.80987069605669190469329896435309665e-01), /* 3ffef643efeb82acd2d601583fc5158c */
+L(-1.90899259410096419886996331536278461e-36), /* bf8844cc5ab6a5903f931badc9cbde34 */
/* sin(x) = 0.31aec65df552876f82ece9a2356713246eba6799983d7011b0b3698d6e1da919c15d57c30c1 */
- 1.94073102892909791156055200214145404e-01L, /* 3ffc8d7632efaa943b7c17674d11ab39 */
--9.67304741051998267208945242944928999e-36L, /* bf8a9b7228b30cccf851fdc9e992ce52 */
+ L(1.94073102892909791156055200214145404e-01), /* 3ffc8d7632efaa943b7c17674d11ab39 */
+L(-9.67304741051998267208945242944928999e-36), /* bf8a9b7228b30cccf851fdc9e992ce52 */
/* x = 2.03125000000000000000000000000000000e-01 3ffca000000000000000000000000000 */
/* cos(x) = 0.fabca467fb3cb8f1d069f01d8ea33ade5bfd68296ecd1cc9f7b7609bbcf3676e726c3301334 */
- 9.79440951715548359998530954502987493e-01L, /* 3ffef57948cff67971e3a0d3e03b1d46 */
- 4.42878056591560757066844797290067990e-35L, /* 3f8cd6f2dfeb414b7668e64fbdbb04de */
+ L(9.79440951715548359998530954502987493e-01), /* 3ffef57948cff67971e3a0d3e03b1d46 */
+ L(4.42878056591560757066844797290067990e-35), /* 3f8cd6f2dfeb414b7668e64fbdbb04de */
/* sin(x) = 0.33a4a5a19d86246710f602c44df4fa513f4639ce938477aeeabb82e8e0a7ed583a188879fd4 */
- 2.01731063801638804725038151164000971e-01L, /* 3ffc9d252d0cec31233887b016226fa8 */
--4.27513434754966978435151290617384120e-36L, /* bf896bb02e718c5b1ee21445511f45c8 */
+ L(2.01731063801638804725038151164000971e-01), /* 3ffc9d252d0cec31233887b016226fa8 */
+L(-4.27513434754966978435151290617384120e-36), /* bf896bb02e718c5b1ee21445511f45c8 */
/* x = 2.10937500000000000000000000000000000e-01 3ffcb000000000000000000000000000 */
/* cos(x) = 0.fa5365e8f1d3ca27be1db5d76ae64d983d7470a4ab0f4ccf65a2b8c67a380df949953a09bc1 */
- 9.77835053797959793331971572944454549e-01L, /* 3ffef4a6cbd1e3a7944f7c3b6baed5cd */
--3.79207422905180416937210853779192702e-35L, /* bf8c933e145c7adaa7859984d2ea39cc */
+ L(9.77835053797959793331971572944454549e-01), /* 3ffef4a6cbd1e3a7944f7c3b6baed5cd */
+L(-3.79207422905180416937210853779192702e-35), /* bf8c933e145c7adaa7859984d2ea39cc */
/* sin(x) = 0.3599b652f40ec999df12a0a4c8561de159c98d4e54555de518b97f48886f715d8df5f4f093e */
- 2.09376712085993643711890752724881652e-01L, /* 3ffcaccdb297a0764ccef895052642b1 */
--1.59470287344329449965314638482515925e-36L, /* bf880f531b3958d5d5510d73a3405bbc */
+ L(2.09376712085993643711890752724881652e-01), /* 3ffcaccdb297a0764ccef895052642b1 */
+L(-1.59470287344329449965314638482515925e-36), /* bf880f531b3958d5d5510d73a3405bbc */
/* x = 2.18750000000000000000000000000000000e-01 3ffcc000000000000000000000000000 */
/* cos(x) = 0.f9e63e1d9e8b6f6f2e296bae5b5ed9c11fd7fa2fe11e09fc7bde901abed24b6365e72f7db4e */
- 9.76169473868635276723989035435135534e-01L, /* 3ffef3cc7c3b3d16dede5c52d75cb6be */
--2.87727974249481583047944860626985460e-35L, /* bf8c31f701402e80f70fb01c210b7f2a */
+ L(9.76169473868635276723989035435135534e-01), /* 3ffef3cc7c3b3d16dede5c52d75cb6be */
+L(-2.87727974249481583047944860626985460e-35), /* bf8c31f701402e80f70fb01c210b7f2a */
/* sin(x) = 0.378df09db8c332ce0d2b53d865582e4526ea336c768f68c32b496c6d11c1cd241bb9f1da523 */
- 2.17009581095010156760578095826055396e-01L, /* 3ffcbc6f84edc6199670695a9ec32ac1 */
- 1.07356488794216831812829549198201194e-35L, /* 3f8ac8a4dd466d8ed1ed1865692d8da2 */
+ L(2.17009581095010156760578095826055396e-01), /* 3ffcbc6f84edc6199670695a9ec32ac1 */
+ L(1.07356488794216831812829549198201194e-35), /* 3f8ac8a4dd466d8ed1ed1865692d8da2 */
/* x = 2.26562500000000000000000000000000000e-01 3ffcd000000000000000000000000000 */
/* cos(x) = 0.f9752eba9fff6b98842beadab054a932fb0f8d5b875ae63d6b2288d09b148921aeb6e52f61b */
- 9.74444313585988980349711056045434344e-01L, /* 3ffef2ea5d753ffed7310857d5b560a9 */
- 3.09947905955053419304514538592548333e-35L, /* 3f8c4997d87c6adc3ad731eb59144685 */
+ L(9.74444313585988980349711056045434344e-01), /* 3ffef2ea5d753ffed7310857d5b560a9 */
+ L(3.09947905955053419304514538592548333e-35), /* 3f8c4997d87c6adc3ad731eb59144685 */
/* sin(x) = 0.39814cb10513453cb97b21bc1ca6a337b150c21a675ab85503bc09a436a10ab1473934e20c8 */
- 2.24629204957705292350428549796424820e-01L, /* 3ffccc0a6588289a29e5cbd90de0e535 */
- 2.42061510849297469844695751870058679e-36L, /* 3f889bd8a8610d33ad5c2a81de04d21b */
+ L(2.24629204957705292350428549796424820e-01), /* 3ffccc0a6588289a29e5cbd90de0e535 */
+ L(2.42061510849297469844695751870058679e-36), /* 3f889bd8a8610d33ad5c2a81de04d21b */
/* x = 2.34375000000000000000000000000000000e-01 3ffce000000000000000000000000000 */
/* cos(x) = 0.f90039843324f9b940416c1984b6cbed1fc733d97354d4265788a86150493ce657cae032674 */
- 9.72659678244912752670913058267565260e-01L, /* 3ffef20073086649f3728082d833096e */
--3.91759231819314904966076958560252735e-35L, /* bf8ca09701c6613465595ecd43babcf5 */
+ L(9.72659678244912752670913058267565260e-01), /* 3ffef20073086649f3728082d833096e */
+L(-3.91759231819314904966076958560252735e-35), /* bf8ca09701c6613465595ecd43babcf5 */
/* sin(x) = 0.3b73c2bf6b4b9f668ef9499c81f0d965087f1753fa64b086e58cb8470515c18c1412f8c2e02 */
- 2.32235118611511462413930877746235872e-01L, /* 3ffcdb9e15fb5a5cfb3477ca4ce40f87 */
--4.96930483364191020075024624332928910e-36L, /* bf89a6bde03a2b0166d3de469cd1ee3f */
+ L(2.32235118611511462413930877746235872e-01), /* 3ffcdb9e15fb5a5cfb3477ca4ce40f87 */
+L(-4.96930483364191020075024624332928910e-36), /* bf89a6bde03a2b0166d3de469cd1ee3f */
/* x = 2.42187500000000000000000000000000000e-01 3ffcf000000000000000000000000000 */
/* cos(x) = 0.f887604e2c39dbb20e4ec5825059a789ffc95b275ad9954078ba8a28d3fcfe9cc2c1d49697b */
- 9.70815676770349462947490545785046027e-01L, /* 3ffef10ec09c5873b7641c9d8b04a0b3 */
- 2.97458820972393859125277682021202860e-35L, /* 3f8c3c4ffe4ad93ad6ccaa03c5d45147 */
+ L(9.70815676770349462947490545785046027e-01), /* 3ffef10ec09c5873b7641c9d8b04a0b3 */
+ L(2.97458820972393859125277682021202860e-35), /* 3f8c3c4ffe4ad93ad6ccaa03c5d45147 */
/* sin(x) = 0.3d654aff15cb457a0fca854698aba33039a8a40626609204472d9d40309b626eccc6dff0ffa */
- 2.39826857830661564441369251810886574e-01L, /* 3ffceb2a57f8ae5a2bd07e542a34c55d */
- 2.39867036569896287240938444445071448e-36L, /* 3f88981cd45203133049022396cea018 */
+ L(2.39826857830661564441369251810886574e-01), /* 3ffceb2a57f8ae5a2bd07e542a34c55d */
+ L(2.39867036569896287240938444445071448e-36), /* 3f88981cd45203133049022396cea018 */
/* x = 2.50000000000000000000000000000000000e-01 3ffd0000000000000000000000000000 */
/* cos(x) = 0.f80aa4fbef750ba783d33cb95f94f8a41426dbe79edc4a023ef9ec13c944551c0795b84fee1 */
- 9.68912421710644784144595449494189205e-01L, /* 3ffef01549f7deea174f07a67972bf2a */
--5.53634706113461989398873287749326500e-36L, /* bf89d6faf649061848ed7f704184fb0e */
+ L(9.68912421710644784144595449494189205e-01), /* 3ffef01549f7deea174f07a67972bf2a */
+L(-5.53634706113461989398873287749326500e-36), /* bf89d6faf649061848ed7f704184fb0e */
/* sin(x) = 0.3f55dda9e62aed7513bd7b8e6a3d1635dd5676648d7db525898d7086af9330f03c7f285442a */
- 2.47403959254522929596848704849389203e-01L, /* 3ffcfaaeed4f31576ba89debdc7351e9 */
--7.36487001108599532943597115275811618e-36L, /* bf8a39445531336e50495b4ece51ef2a */
+ L(2.47403959254522929596848704849389203e-01), /* 3ffcfaaeed4f31576ba89debdc7351e9 */
+L(-7.36487001108599532943597115275811618e-36), /* bf8a39445531336e50495b4ece51ef2a */
/* x = 2.57812500000000000000000000000000000e-01 3ffd0800000000000000000000000000 */
/* cos(x) = 0.f78a098069792daabc9ee42591b7c5a68cb1ab822aeb446b3311b4ba5371b8970e2c1547ad7 */
- 9.66950029230677822008341623610531503e-01L, /* 3ffeef141300d2f25b55793dc84b2370 */
--4.38972214432792412062088059990480514e-35L, /* bf8cd2cb9a72a3eea8a5dca667725a2d */
+ L(9.66950029230677822008341623610531503e-01), /* 3ffeef141300d2f25b55793dc84b2370 */
+L(-4.38972214432792412062088059990480514e-35), /* bf8cd2cb9a72a3eea8a5dca667725a2d */
/* sin(x) = 0.414572fd94556e6473d620271388dd47c0ba050cdb5270112e3e370e8c4705ae006426fb5d5 */
- 2.54965960415878467487556574864872628e-01L, /* 3ffd0515cbf65155b991cf58809c4e23 */
- 2.20280377918534721005071688328074154e-35L, /* 3f8bd47c0ba050cdb5270112e3e370e9 */
+ L(2.54965960415878467487556574864872628e-01), /* 3ffd0515cbf65155b991cf58809c4e23 */
+ L(2.20280377918534721005071688328074154e-35), /* 3f8bd47c0ba050cdb5270112e3e370e9 */
/* x = 2.65625000000000000000000000000000000e-01 3ffd1000000000000000000000000000 */
/* cos(x) = 0.f7058fde0788dfc805b8fe88789e4f4253e3c50afe8b22f41159620ab5940ff7df9557c0d1f */
- 9.64928619104771009581074665315748371e-01L, /* 3ffeee0b1fbc0f11bf900b71fd10f13d */
--3.66685832670820775002475545602761113e-35L, /* bf8c85ed60e1d7a80ba6e85f7534efaa */
+ L(9.64928619104771009581074665315748371e-01), /* 3ffeee0b1fbc0f11bf900b71fd10f13d */
+L(-3.66685832670820775002475545602761113e-35), /* bf8c85ed60e1d7a80ba6e85f7534efaa */
/* sin(x) = 0.4334033bcd90d6604f5f36c1d4b84451a87150438275b77470b50e5b968fa7962b5ffb379b7 */
- 2.62512399769153281450949626395692931e-01L, /* 3ffd0cd00cef364359813d7cdb0752e1 */
- 3.24923677072031064673177178571821843e-36L, /* 3f89146a1c5410e09d6ddd1c2d4396e6 */
+ L(2.62512399769153281450949626395692931e-01), /* 3ffd0cd00cef364359813d7cdb0752e1 */
+ L(3.24923677072031064673177178571821843e-36), /* 3f89146a1c5410e09d6ddd1c2d4396e6 */
/* x = 2.73437500000000000000000000000000000e-01 3ffd1800000000000000000000000000 */
/* cos(x) = 0.f67d3a26af7d07aa4bd6d42af8c0067fefb96d5b46c031eff53627f215ea3242edc3f2e13eb */
- 9.62848314709379699899701093480214365e-01L, /* 3ffeecfa744d5efa0f5497ada855f180 */
- 4.88986966383343450799422013051821394e-36L, /* 3f899ffbee5b56d1b00c7bfd4d89fc85 */
+ L(9.62848314709379699899701093480214365e-01), /* 3ffeecfa744d5efa0f5497ada855f180 */
+ L(4.88986966383343450799422013051821394e-36), /* 3f899ffbee5b56d1b00c7bfd4d89fc85 */
/* sin(x) = 0.452186aa5377ab20bbf2524f52e3a06a969f47166ab88cf88c111ad12c55941021ef3317a1a */
- 2.70042816718585031552755063618827102e-01L, /* 3ffd14861aa94ddeac82efc9493d4b8f */
--2.37608892440611310321138680065803162e-35L, /* bf8bf956960b8e99547730773eee52ed */
+ L(2.70042816718585031552755063618827102e-01), /* 3ffd14861aa94ddeac82efc9493d4b8f */
+L(-2.37608892440611310321138680065803162e-35), /* bf8bf956960b8e99547730773eee52ed */
/* x = 2.81250000000000000000000000000000000e-01 3ffd2000000000000000000000000000 */
/* cos(x) = 0.f5f10a7bb77d3dfa0c1da8b57842783280d01ce3c0f82bae3b9d623c168d2e7c29977994451 */
- 9.60709243015561903066659350581313472e-01L, /* 3ffeebe214f76efa7bf4183b516af085 */
--5.87011558231583960712013351601221840e-36L, /* bf89f35fcbf8c70fc1f5147118a770fa */
+ L(9.60709243015561903066659350581313472e-01), /* 3ffeebe214f76efa7bf4183b516af085 */
+L(-5.87011558231583960712013351601221840e-36), /* bf89f35fcbf8c70fc1f5147118a770fa */
/* sin(x) = 0.470df5931ae1d946076fe0dcff47fe31bb2ede618ebc607821f8462b639e1f4298b5ae87fd3 */
- 2.77556751646336325922023446828128568e-01L, /* 3ffd1c37d64c6b8765181dbf8373fd20 */
--1.35848595468998128214344668770082997e-36L, /* bf87ce44d1219e71439f87de07b9d49c */
+ L(2.77556751646336325922023446828128568e-01), /* 3ffd1c37d64c6b8765181dbf8373fd20 */
+L(-1.35848595468998128214344668770082997e-36), /* bf87ce44d1219e71439f87de07b9d49c */
/* x = 2.89062500000000000000000000000000000e-01 3ffd2800000000000000000000000000 */
/* cos(x) = 0.f561030ddd7a78960ea9f4a32c6521554995667f5547bafee9ec48b3155cdb0f7fd00509713 */
- 9.58511534581228627301969408154919822e-01L, /* 3ffeeac2061bbaf4f12c1d53e94658ca */
- 2.50770779371636481145735089393154404e-35L, /* 3f8c0aaa4cab33faaa3dd7f74f624599 */
+ L(9.58511534581228627301969408154919822e-01), /* 3ffeeac2061bbaf4f12c1d53e94658ca */
+ L(2.50770779371636481145735089393154404e-35), /* 3f8c0aaa4cab33faaa3dd7f74f624599 */
/* sin(x) = 0.48f948446abcd6b0f7fccb100e7a1b26eccad880b0d24b59948c7cdd49514d44b933e6985c2 */
- 2.85053745940547424587763033323252561e-01L, /* 3ffd23e52111aaf35ac3dff32c4039e8 */
- 2.04269325885902918802700123680403749e-35L, /* 3f8bb26eccad880b0d24b59948c7cdd5 */
+ L(2.85053745940547424587763033323252561e-01), /* 3ffd23e52111aaf35ac3dff32c4039e8 */
+ L(2.04269325885902918802700123680403749e-35), /* 3f8bb26eccad880b0d24b59948c7cdd5 */
/* x = 2.96875000000000000000000000000000000e-01 3ffd3000000000000000000000000000 */
/* cos(x) = 0.f4cd261d3e6c15bb369c8758630d2ac00b7ace2a51c0631bfeb39ed158ba924cc91e259c195 */
- 9.56255323543175296975599942263028361e-01L, /* 3ffee99a4c3a7cd82b766d390eb0c61a */
- 3.21616572190865997051103645135837207e-35L, /* 3f8c56005bd671528e0318dff59cf68b */
+ L(9.56255323543175296975599942263028361e-01), /* 3ffee99a4c3a7cd82b766d390eb0c61a */
+ L(3.21616572190865997051103645135837207e-35), /* 3f8c56005bd671528e0318dff59cf68b */
/* sin(x) = 0.4ae37710fad27c8aa9c4cf96c03519b9ce07dc08a1471775499f05c29f86190aaebaeb9716e */
- 2.92533342023327543624702326493913423e-01L, /* 3ffd2b8ddc43eb49f22aa7133e5b00d4 */
- 1.93539408668704450308003687950685128e-35L, /* 3f8b9b9ce07dc08a1471775499f05c2a */
+ L(2.92533342023327543624702326493913423e-01), /* 3ffd2b8ddc43eb49f22aa7133e5b00d4 */
+ L(1.93539408668704450308003687950685128e-35), /* 3f8b9b9ce07dc08a1471775499f05c2a */
/* x = 3.04687500000000000000000000000000000e-01 3ffd3800000000000000000000000000 */
/* cos(x) = 0.f43575f94d4f6b272f5fb76b14d2a64ab52df1ee8ddf7c651034e5b2889305a9ea9015d758a */
- 9.53940747608894733981324795987611623e-01L, /* 3ffee86aebf29a9ed64e5ebf6ed629a5 */
- 2.88075689052478602008395972924657164e-35L, /* 3f8c3255a96f8f746efbe32881a72d94 */
+ L(9.53940747608894733981324795987611623e-01), /* 3ffee86aebf29a9ed64e5ebf6ed629a5 */
+ L(2.88075689052478602008395972924657164e-35), /* 3f8c3255a96f8f746efbe32881a72d94 */
/* sin(x) = 0.4ccc7a50127e1de0cb6b40c302c651f7bded4f9e7702b0471ae0288d091a37391950907202f */
- 2.99995083378683051163248282011699944e-01L, /* 3ffd3331e94049f877832dad030c0b19 */
- 1.35174265535697850139283361475571050e-35L, /* 3f8b1f7bded4f9e7702b0471ae0288d1 */
+ L(2.99995083378683051163248282011699944e-01), /* 3ffd3331e94049f877832dad030c0b19 */
+ L(1.35174265535697850139283361475571050e-35), /* 3f8b1f7bded4f9e7702b0471ae0288d1 */
/* x = 3.12500000000000000000000000000000000e-01 3ffd4000000000000000000000000000 */
/* cos(x) = 0.f399f500c9e9fd37ae9957263dab8877102beb569f101ee4495350868e5847d181d50d3cca2 */
- 9.51567948048172202145488217364270962e-01L, /* 3ffee733ea0193d3fa6f5d32ae4c7b57 */
- 6.36842628598115658308749288799884606e-36L, /* 3f8a0ee2057d6ad3e203dc892a6a10d2 */
+ L(9.51567948048172202145488217364270962e-01), /* 3ffee733ea0193d3fa6f5d32ae4c7b57 */
+ L(6.36842628598115658308749288799884606e-36), /* 3f8a0ee2057d6ad3e203dc892a6a10d2 */
/* sin(x) = 0.4eb44a5da74f600207aaa090f0734e288603ffadb3eb2542a46977b105f8547128036dcf7f0 */
- 3.07438514580380850670502958201982091e-01L, /* 3ffd3ad129769d3d80081eaa8243c1cd */
- 1.06515172423204645839241099453417152e-35L, /* 3f8ac510c07ff5b67d64a8548d2ef621 */
+ L(3.07438514580380850670502958201982091e-01), /* 3ffd3ad129769d3d80081eaa8243c1cd */
+ L(1.06515172423204645839241099453417152e-35), /* 3f8ac510c07ff5b67d64a8548d2ef621 */
/* x = 3.20312500000000000000000000000000000e-01 3ffd4800000000000000000000000000 */
/* cos(x) = 0.f2faa5a1b74e82fd61fa05f9177380e8e69b7b15a945e8e5ae1124bf3d12b0617e03af4fab5 */
- 9.49137069684463027665847421762105623e-01L, /* 3ffee5f54b436e9d05fac3f40bf22ee7 */
- 6.84433965991637152250309190468859701e-37L, /* 3f86d1cd36f62b528bd1cb5c22497e7a */
+ L(9.49137069684463027665847421762105623e-01), /* 3ffee5f54b436e9d05fac3f40bf22ee7 */
+ L(6.84433965991637152250309190468859701e-37), /* 3f86d1cd36f62b528bd1cb5c22497e7a */
/* sin(x) = 0.509adf9a7b9a5a0f638a8fa3a60a199418859f18b37169a644fdb986c21ecb00133853bc35b */
- 3.14863181319745250865036315126939016e-01L, /* 3ffd426b7e69ee69683d8e2a3e8e9828 */
- 1.92431240212432926993057705062834160e-35L, /* 3f8b99418859f18b37169a644fdb986c */
+ L(3.14863181319745250865036315126939016e-01), /* 3ffd426b7e69ee69683d8e2a3e8e9828 */
+ L(1.92431240212432926993057705062834160e-35), /* 3f8b99418859f18b37169a644fdb986c */
/* x = 3.28125000000000000000000000000000000e-01 3ffd5000000000000000000000000000 */
/* cos(x) = 0.f2578a595224dd2e6bfa2eb2f99cc674f5ea6f479eae2eb580186897ae3f893df1113ca06b8 */
- 9.46648260886053321846099507295532976e-01L, /* 3ffee4af14b2a449ba5cd7f45d65f33a */
--4.32906339663000890941529420498824645e-35L, /* bf8ccc5850ac85c30a8e8a53ff3cbb43 */
+ L(9.46648260886053321846099507295532976e-01), /* 3ffee4af14b2a449ba5cd7f45d65f33a */
+L(-4.32906339663000890941529420498824645e-35), /* bf8ccc5850ac85c30a8e8a53ff3cbb43 */
/* sin(x) = 0.5280326c3cf481823ba6bb08eac82c2093f2bce3c4eb4ee3dec7df41c92c8a4226098616075 */
- 3.22268630433386625687745919893188031e-01L, /* 3ffd4a00c9b0f3d20608ee9aec23ab21 */
--1.49505897804759263483853908335500228e-35L, /* bf8b3df6c0d431c3b14b11c213820be3 */
+ L(3.22268630433386625687745919893188031e-01), /* 3ffd4a00c9b0f3d20608ee9aec23ab21 */
+L(-1.49505897804759263483853908335500228e-35), /* bf8b3df6c0d431c3b14b11c213820be3 */
/* x = 3.35937500000000000000000000000000000e-01 3ffd5800000000000000000000000000 */
/* cos(x) = 0.f1b0a5b406b526d886c55feadc8d0dcc8eb9ae2ac707051771b48e05b25b000009660bdb3e3 */
- 9.44101673557004345630017691253124860e-01L, /* 3ffee3614b680d6a4db10d8abfd5b91a */
- 1.03812535240120229609822461172145584e-35L, /* 3f8ab991d735c558e0e0a2ee3691c0b6 */
+ L(9.44101673557004345630017691253124860e-01), /* 3ffee3614b680d6a4db10d8abfd5b91a */
+ L(1.03812535240120229609822461172145584e-35), /* 3f8ab991d735c558e0e0a2ee3691c0b6 */
/* sin(x) = 0.54643b3da29de9b357155eef0f332fb3e66c83bf4dddd9491c5eb8e103ccd92d6175220ed51 */
- 3.29654409930860171914317725126463176e-01L, /* 3ffd5190ecf68a77a6cd5c557bbc3ccd */
--1.22606996784743214973082192294232854e-35L, /* bf8b04c19937c40b22226b6e3a1471f0 */
+ L(3.29654409930860171914317725126463176e-01), /* 3ffd5190ecf68a77a6cd5c557bbc3ccd */
+L(-1.22606996784743214973082192294232854e-35), /* bf8b04c19937c40b22226b6e3a1471f0 */
/* x = 3.43750000000000000000000000000000000e-01 3ffd6000000000000000000000000000 */
/* cos(x) = 0.f105fa4d66b607a67d44e042725204435142ac8ad54dfb0907a4f6b56b06d98ee60f19e557a */
- 9.41497463127881068644511236053670815e-01L, /* 3ffee20bf49acd6c0f4cfa89c084e4a4 */
- 3.20709366603165602071590241054884900e-36L, /* 3f8910d450ab22b5537ec241e93dad5b */
+ L(9.41497463127881068644511236053670815e-01), /* 3ffee20bf49acd6c0f4cfa89c084e4a4 */
+ L(3.20709366603165602071590241054884900e-36), /* 3f8910d450ab22b5537ec241e93dad5b */
/* sin(x) = 0.5646f27e8bd65cbe3a5d61ff06572290ee826d9674a00246b05ae26753cdfc90d9ce81a7d02 */
- 3.37020069022253076261281754173810024e-01L, /* 3ffd591bc9fa2f5972f8e97587fc195d */
--2.21435756148839473677777545049890664e-35L, /* bf8bd6f117d92698b5ffdb94fa51d98b */
+ L(3.37020069022253076261281754173810024e-01), /* 3ffd591bc9fa2f5972f8e97587fc195d */
+L(-2.21435756148839473677777545049890664e-35), /* bf8bd6f117d92698b5ffdb94fa51d98b */
/* x = 3.51562500000000000000000000000000000e-01 3ffd6800000000000000000000000000 */
/* cos(x) = 0.f0578ad01ede707fa39c09dc6b984afef74f3dc8d0efb0f4c5a6b13771145b3e0446fe33887 */
- 9.38835788546265488632578305984712554e-01L, /* 3ffee0af15a03dbce0ff473813b8d731 */
--3.98758068773974031348585072752245458e-35L, /* bf8ca808458611b978827859d2ca7644 */
+ L(9.38835788546265488632578305984712554e-01), /* 3ffee0af15a03dbce0ff473813b8d731 */
+L(-3.98758068773974031348585072752245458e-35), /* bf8ca808458611b978827859d2ca7644 */
/* sin(x) = 0.582850a41e1dd46c7f602ea244cdbbbfcdfa8f3189be794dda427ce090b5f85164f1f80ac13 */
- 3.44365158145698408207172046472223747e-01L, /* 3ffd60a14290787751b1fd80ba891337 */
--3.19791885005480924937758467594051927e-36L, /* bf89100c815c339d9061ac896f60c7dc */
+ L(3.44365158145698408207172046472223747e-01), /* 3ffd60a14290787751b1fd80ba891337 */
+L(-3.19791885005480924937758467594051927e-36), /* bf89100c815c339d9061ac896f60c7dc */
/* x = 3.59375000000000000000000000000000000e-01 3ffd7000000000000000000000000000 */
/* cos(x) = 0.efa559f5ec3aec3a4eb03319278a2d41fcf9189462261125fe6147b078f1daa0b06750a1654 */
- 9.36116812267055290294237411019508588e-01L, /* 3ffedf4ab3ebd875d8749d6066324f14 */
- 3.40481591236710658435409862439032162e-35L, /* 3f8c6a0fe7c8c4a31130892ff30a3d84 */
+ L(9.36116812267055290294237411019508588e-01), /* 3ffedf4ab3ebd875d8749d6066324f14 */
+ L(3.40481591236710658435409862439032162e-35), /* 3f8c6a0fe7c8c4a31130892ff30a3d84 */
/* sin(x) = 0.5a084e28e35fda2776dfdbbb5531d74ced2b5d17c0b1afc4647529d50c295e36d8ceec126c1 */
- 3.51689228994814059222584896955547016e-01L, /* 3ffd682138a38d7f689ddb7f6eed54c7 */
- 1.75293433418270210567525412802083294e-35L, /* 3f8b74ced2b5d17c0b1afc4647529d51 */
+ L(3.51689228994814059222584896955547016e-01), /* 3ffd682138a38d7f689ddb7f6eed54c7 */
+ L(1.75293433418270210567525412802083294e-35), /* 3f8b74ced2b5d17c0b1afc4647529d51 */
/* x = 3.67187500000000000000000000000000000e-01 3ffd7800000000000000000000000000 */
/* cos(x) = 0.eeef6a879146af0bf9b95ea2ea0ac0d3e2e4d7e15d93f48cbd41bf8e4fded40bef69e19eafa */
- 9.33340700242548435655299229469995527e-01L, /* 3ffeddded50f228d5e17f372bd45d416 */
--4.75255707251679831124800898831382223e-35L, /* bf8cf960e8d940f513605b9a15f2038e */
+ L(9.33340700242548435655299229469995527e-01), /* 3ffeddded50f228d5e17f372bd45d416 */
+L(-4.75255707251679831124800898831382223e-35), /* bf8cf960e8d940f513605b9a15f2038e */
/* sin(x) = 0.5be6e38ce8095542bc14ee9da0d36483e6734bcab2e07624188af5653f114eeb46738fa899d */
- 3.58991834546065053677710299152868941e-01L, /* 3ffd6f9b8e33a025550af053ba76834e */
--2.06772389262723368139416970257112089e-35L, /* bf8bb7c198cb4354d1f89dbe7750a9ac */
+ L(3.58991834546065053677710299152868941e-01), /* 3ffd6f9b8e33a025550af053ba76834e */
+L(-2.06772389262723368139416970257112089e-35), /* bf8bb7c198cb4354d1f89dbe7750a9ac */
/* x = 3.75000000000000000000000000000000000e-01 3ffd8000000000000000000000000000 */
/* cos(x) = 0.ee35bf5ccac89052cd91ddb734d3a47e262e3b609db604e217053803be0091e76daf28a89b7 */
- 9.30507621912314291149476792229555481e-01L, /* 3ffedc6b7eb9959120a59b23bb6e69a7 */
- 2.74541088551732982573335285685416092e-35L, /* 3f8c23f13171db04edb02710b829c01e */
+ L(9.30507621912314291149476792229555481e-01), /* 3ffedc6b7eb9959120a59b23bb6e69a7 */
+ L(2.74541088551732982573335285685416092e-35), /* 3f8c23f13171db04edb02710b829c01e */
/* sin(x) = 0.5dc40955d9084f48a94675a2498de5d851320ff5528a6afb3f2e24de240fce6cbed1ba0ccd6 */
- 3.66272529086047561372909351716264177e-01L, /* 3ffd7710255764213d22a519d6892638 */
--1.96768433534936592675897818253108989e-35L, /* bf8ba27aecdf00aad759504c0d1db21e */
+ L(3.66272529086047561372909351716264177e-01), /* 3ffd7710255764213d22a519d6892638 */
+L(-1.96768433534936592675897818253108989e-35), /* bf8ba27aecdf00aad759504c0d1db21e */
/* x = 3.82812500000000000000000000000000000e-01 3ffd8800000000000000000000000000 */
/* cos(x) = 0.ed785b5c44741b4493c56bcb9d338a151c6f6b85d8f8aca658b28572c162b199680eb9304da */
- 9.27617750192851909628030798799961350e-01L, /* 3ffedaf0b6b888e83689278ad7973a67 */
- 7.58520371916345756281201167126854712e-36L, /* 3f8a42a38ded70bb1f1594cb1650ae58 */
+ L(9.27617750192851909628030798799961350e-01), /* 3ffedaf0b6b888e83689278ad7973a67 */
+ L(7.58520371916345756281201167126854712e-36), /* 3f8a42a38ded70bb1f1594cb1650ae58 */
/* sin(x) = 0.5f9fb80f21b53649c432540a50e22c53057ff42ae0fdf1307760dc0093f99c8efeb2fbd7073 */
- 3.73530868238692946416839752660848112e-01L, /* 3ffd7e7ee03c86d4d92710c950294389 */
--1.48023494778986556048879113411517128e-35L, /* bf8b3acfa800bd51f020ecf889f23ff7 */
+ L(3.73530868238692946416839752660848112e-01), /* 3ffd7e7ee03c86d4d92710c950294389 */
+L(-1.48023494778986556048879113411517128e-35), /* bf8b3acfa800bd51f020ecf889f23ff7 */
/* x = 3.90625000000000000000000000000000000e-01 3ffd9000000000000000000000000000 */
/* cos(x) = 0.ecb7417b8d4ee3fec37aba4073aa48f1f14666006fb431d9671303c8100d10190ec8179c41d */
- 9.24671261467036098502113014560138771e-01L, /* 3ffed96e82f71a9dc7fd86f57480e755 */
--4.14187124860031825108649347251175815e-35L, /* bf8cb87075cccffc825e7134c767e1bf */
+ L(9.24671261467036098502113014560138771e-01), /* 3ffed96e82f71a9dc7fd86f57480e755 */
+L(-4.14187124860031825108649347251175815e-35), /* bf8cb87075cccffc825e7134c767e1bf */
/* sin(x) = 0.6179e84a09a5258a40e9b5face03e525f8b5753cd0105d93fe6298010c3458e84d75fe420e9 */
- 3.80766408992390192057200703388896675e-01L, /* 3ffd85e7a1282694962903a6d7eb3810 */
--2.02009541175208636336924533372496107e-35L, /* bf8bada074a8ac32fefa26c019d67fef */
+ L(3.80766408992390192057200703388896675e-01), /* 3ffd85e7a1282694962903a6d7eb3810 */
+L(-2.02009541175208636336924533372496107e-35), /* bf8bada074a8ac32fefa26c019d67fef */
/* x = 3.98437500000000000000000000000000000e-01 3ffd9800000000000000000000000000 */
/* cos(x) = 0.ebf274bf0bda4f62447e56a093626798d3013b5942b1abfd155aacc9dc5c6d0806a20d6b9c1 */
- 9.21668335573351918175411368202712714e-01L, /* 3ffed7e4e97e17b49ec488fcad4126c5 */
--1.83587995433957622948710263541479322e-35L, /* bf8b8672cfec4a6bd4e5402eaa553362 */
+ L(9.21668335573351918175411368202712714e-01), /* 3ffed7e4e97e17b49ec488fcad4126c5 */
+L(-1.83587995433957622948710263541479322e-35), /* bf8b8672cfec4a6bd4e5402eaa553362 */
/* sin(x) = 0.6352929dd264bd44a02ea766325d8aa8bd9695fc8def3caefba5b94c9a3c873f7b2d3776ead */
- 3.87978709727025046051079690813741960e-01L, /* 3ffd8d4a4a774992f51280ba9d98c976 */
- 8.01904783870935075844443278617586301e-36L, /* 3f8a5517b2d2bf91bde795df74b72993 */
+ L(3.87978709727025046051079690813741960e-01), /* 3ffd8d4a4a774992f51280ba9d98c976 */
+ L(8.01904783870935075844443278617586301e-36), /* 3f8a5517b2d2bf91bde795df74b72993 */
/* x = 4.06250000000000000000000000000000000e-01 3ffda000000000000000000000000000 */
/* cos(x) = 0.eb29f839f201fd13b93796827916a78f15c85230a4e8ea4b21558265a14367e1abb4c30695a */
- 9.18609155794918267837824977718549863e-01L, /* 3ffed653f073e403fa27726f2d04f22d */
- 2.97608282778274433460057745798409849e-35L, /* 3f8c3c78ae429185274752590aac132d */
+ L(9.18609155794918267837824977718549863e-01), /* 3ffed653f073e403fa27726f2d04f22d */
+ L(2.97608282778274433460057745798409849e-35), /* 3f8c3c78ae429185274752590aac132d */
/* sin(x) = 0.6529afa7d51b129631ec197c0a840a11d7dc5368b0a47956feb285caa8371c4637ef17ef01b */
- 3.95167330240934236244832640419653657e-01L, /* 3ffd94a6be9f546c4a58c7b065f02a10 */
- 7.57560031388312550940040194042627704e-36L, /* 3f8a423afb8a6d16148f2adfd650b955 */
+ L(3.95167330240934236244832640419653657e-01), /* 3ffd94a6be9f546c4a58c7b065f02a10 */
+ L(7.57560031388312550940040194042627704e-36), /* 3f8a423afb8a6d16148f2adfd650b955 */
/* x = 4.14062500000000000000000000000000000e-01 3ffda800000000000000000000000000 */
/* cos(x) = 0.ea5dcf0e30cf03e6976ef0b1ec26515fba47383855c3b4055a99b5e86824b2cd1a691fdca7b */
- 9.15493908848301228563917732180221882e-01L, /* 3ffed4bb9e1c619e07cd2edde163d84d */
--3.50775517955306954815090901168305659e-35L, /* bf8c75022dc63e3d51e25fd52b3250bd */
+ L(9.15493908848301228563917732180221882e-01), /* 3ffed4bb9e1c619e07cd2edde163d84d */
+L(-3.50775517955306954815090901168305659e-35), /* bf8c75022dc63e3d51e25fd52b3250bd */
/* sin(x) = 0.66ff380ba0144109e39a320b0a3fa5fd65ea0585bcbf9b1a769a9b0334576c658139e1a1cbe */
- 4.02331831777773111217105598880982387e-01L, /* 3ffd9bfce02e805104278e68c82c28ff */
--1.95678722882848174723569916504871563e-35L, /* bf8ba029a15fa7a434064e5896564fcd */
+ L(4.02331831777773111217105598880982387e-01), /* 3ffd9bfce02e805104278e68c82c28ff */
+L(-1.95678722882848174723569916504871563e-35), /* bf8ba029a15fa7a434064e5896564fcd */
/* x = 4.21875000000000000000000000000000000e-01 3ffdb000000000000000000000000000 */
/* cos(x) = 0.e98dfc6c6be031e60dd3089cbdd18a75b1f6b2c1e97f79225202f03dbea45b07a5ec4efc062 */
- 9.12322784872117846492029542047341734e-01L, /* 3ffed31bf8d8d7c063cc1ba611397ba3 */
- 7.86903886556373674267948132178845568e-36L, /* 3f8a4eb63ed6583d2fef244a405e07b8 */
+ L(9.12322784872117846492029542047341734e-01), /* 3ffed31bf8d8d7c063cc1ba611397ba3 */
+ L(7.86903886556373674267948132178845568e-36), /* 3f8a4eb63ed6583d2fef244a405e07b8 */
/* sin(x) = 0.68d32473143327973bc712bcc4ccddc47630d755850c0655243b205934dc49ffed8eb76adcb */
- 4.09471777053295066122694027011452236e-01L, /* 3ffda34c91cc50cc9e5cef1c4af31333 */
- 2.23945241468457597921655785729821354e-35L, /* 3f8bdc47630d755850c0655243b20593 */
+ L(4.09471777053295066122694027011452236e-01), /* 3ffda34c91cc50cc9e5cef1c4af31333 */
+ L(2.23945241468457597921655785729821354e-35), /* 3f8bdc47630d755850c0655243b20593 */
/* x = 4.29687500000000000000000000000000000e-01 3ffdb800000000000000000000000000 */
/* cos(x) = 0.e8ba8393eca7821aa563d83491b6101189b3b101c3677f73d7bad7c10f9ee02b7ab4009739a */
- 9.09095977415431051650381735684476417e-01L, /* 3ffed1750727d94f04354ac7b069236c */
- 1.20886014028444155733776025085677953e-35L, /* 3f8b01189b3b101c3677f73d7bad7c11 */
+ L(9.09095977415431051650381735684476417e-01), /* 3ffed1750727d94f04354ac7b069236c */
+ L(1.20886014028444155733776025085677953e-35), /* 3f8b01189b3b101c3677f73d7bad7c11 */
/* sin(x) = 0.6aa56d8e8249db4eb60a761fe3f9e559be456b9e13349ca99b0bfb787f22b95db3b70179615 */
- 4.16586730282041119259112448831069657e-01L, /* 3ffdaa95b63a09276d3ad829d87f8fe8 */
--2.00488106831998813675438269796963612e-35L, /* bf8baa641ba9461eccb635664f404878 */
+ L(4.16586730282041119259112448831069657e-01), /* 3ffdaa95b63a09276d3ad829d87f8fe8 */
+L(-2.00488106831998813675438269796963612e-35), /* bf8baa641ba9461eccb635664f404878 */
/* x = 4.37500000000000000000000000000000000e-01 3ffdc000000000000000000000000000 */
/* cos(x) = 0.e7e367d2956cfb16b6aa11e5419cd0057f5c132a6455bf064297e6a76fe2b72bb630d6d50ff */
- 9.05813683425936420744516660652700258e-01L, /* 3ffecfc6cfa52ad9f62d6d5423ca833a */
--3.60950307605941169775676563004467163e-35L, /* bf8c7fd4051f66acdd5207cdeb40cac5 */
+ L(9.05813683425936420744516660652700258e-01), /* 3ffecfc6cfa52ad9f62d6d5423ca833a */
+L(-3.60950307605941169775676563004467163e-35), /* bf8c7fd4051f66acdd5207cdeb40cac5 */
/* sin(x) = 0.6c760c14c8585a51dbd34660ae6c52ac7036a0b40887a0b63724f8b4414348c3063a637f457 */
- 4.23676257203938010361683988031102480e-01L, /* 3ffdb1d83053216169476f4d1982b9b1 */
- 1.40484456388654470329473096579312595e-35L, /* 3f8b2ac7036a0b40887a0b63724f8b44 */
+ L(4.23676257203938010361683988031102480e-01), /* 3ffdb1d83053216169476f4d1982b9b1 */
+ L(1.40484456388654470329473096579312595e-35), /* 3f8b2ac7036a0b40887a0b63724f8b44 */
/* x = 4.45312500000000000000000000000000000e-01 3ffdc800000000000000000000000000 */
/* cos(x) = 0.e708ac84d4172a3e2737662213429e14021074d7e702e77d72a8f1101a7e70410df8273e9aa */
- 9.02476103237941504925183272675895999e-01L, /* 3ffece115909a82e547c4e6ecc442685 */
- 2.26282899501344419018306295680210602e-35L, /* 3f8be14021074d7e702e77d72a8f1102 */
+ L(9.02476103237941504925183272675895999e-01), /* 3ffece115909a82e547c4e6ecc442685 */
+ L(2.26282899501344419018306295680210602e-35), /* 3f8be14021074d7e702e77d72a8f1102 */
/* sin(x) = 0.6e44f8c36eb10a1c752d093c00f4d47ba446ac4c215d26b0316442f168459e677d06e7249e3 */
- 4.30739925110803197216321517850849190e-01L, /* 3ffdb913e30dbac42871d4b424f003d3 */
- 1.54096780001629398850891218396761548e-35L, /* 3f8b47ba446ac4c215d26b0316442f17 */
+ L(4.30739925110803197216321517850849190e-01), /* 3ffdb913e30dbac42871d4b424f003d3 */
+ L(1.54096780001629398850891218396761548e-35), /* 3f8b47ba446ac4c215d26b0316442f17 */
/* x = 4.53125000000000000000000000000000000e-01 3ffdd000000000000000000000000000 */
/* cos(x) = 0.e62a551594b970a770b15d41d4c0e483e47aca550111df6966f9e7ac3a94ae49e6a71eb031e */
- 8.99083440560138456216544929209379307e-01L, /* 3ffecc54aa2b2972e14ee162ba83a982 */
--2.06772615490904370666670275154751976e-35L, /* bf8bb7c1b8535aafeee209699061853c */
+ L(8.99083440560138456216544929209379307e-01), /* 3ffecc54aa2b2972e14ee162ba83a982 */
+L(-2.06772615490904370666670275154751976e-35), /* bf8bb7c1b8535aafeee209699061853c */
/* sin(x) = 0.70122c5ec5028c8cff33abf4fd340ccc382e038379b09cf04f9a52692b10b72586060cbb001 */
- 4.37777302872755132861618974702796680e-01L, /* 3ffdc048b17b140a3233fcceafd3f4d0 */
- 9.62794364503442612477117426033922467e-36L, /* 3f8a998705c0706f36139e09f34a4d25 */
+ L(4.37777302872755132861618974702796680e-01), /* 3ffdc048b17b140a3233fcceafd3f4d0 */
+ L(9.62794364503442612477117426033922467e-36), /* 3f8a998705c0706f36139e09f34a4d25 */
/* x = 4.60937500000000000000000000000000000e-01 3ffdd800000000000000000000000000 */
/* cos(x) = 0.e54864fe33e8575cabf5bd0e5cf1b1a8bc7c0d5f61702450fa6b6539735820dd2603ae355d5 */
- 8.95635902463170698900570000446256350e-01L, /* 3ffeca90c9fc67d0aeb957eb7a1cb9e3 */
- 3.73593741659866883088620495542311808e-35L, /* 3f8c8d45e3e06afb0b812287d35b29cc */
+ L(8.95635902463170698900570000446256350e-01), /* 3ffeca90c9fc67d0aeb957eb7a1cb9e3 */
+ L(3.73593741659866883088620495542311808e-35), /* 3f8c8d45e3e06afb0b812287d35b29cc */
/* sin(x) = 0.71dd9fb1ff4677853acb970a9f6729c6e3aac247b1c57cea66c77413f1f98e8b9e98e49d851 */
- 4.44787960964527211433056012529525211e-01L, /* 3ffdc7767ec7fd19de14eb2e5c2a7d9d */
--1.67187936511493678007508371613954899e-35L, /* bf8b6391c553db84e3a831599388bec1 */
+ L(4.44787960964527211433056012529525211e-01), /* 3ffdc7767ec7fd19de14eb2e5c2a7d9d */
+L(-1.67187936511493678007508371613954899e-35), /* bf8b6391c553db84e3a831599388bec1 */
/* x = 4.68750000000000000000000000000000000e-01 3ffde000000000000000000000000000 */
/* cos(x) = 0.e462dfc670d421ab3d1a15901228f146a0547011202bf5ab01f914431859aef577966bc4fa4 */
- 8.92133699366994404723900253723788575e-01L, /* 3ffec8c5bf8ce1a843567a342b202452 */
--1.10771937602567314732693079264692504e-35L, /* bf8ad72bf571fddbfa814a9fc0dd779d */
+ L(8.92133699366994404723900253723788575e-01), /* 3ffec8c5bf8ce1a843567a342b202452 */
+L(-1.10771937602567314732693079264692504e-35), /* bf8ad72bf571fddbfa814a9fc0dd779d */
/* sin(x) = 0.73a74b8f52947b681baf6928eb3fb021769bf4779bad0e3aa9b1cdb75ec60aad9fc63ff19d5 */
- 4.51771471491683776581688750134062870e-01L, /* 3ffdce9d2e3d4a51eda06ebda4a3acff */
--1.19387223016472295893794387275284505e-35L, /* bf8afbd12c81710c8a5e38aac9c64914 */
+ L(4.51771471491683776581688750134062870e-01), /* 3ffdce9d2e3d4a51eda06ebda4a3acff */
+L(-1.19387223016472295893794387275284505e-35), /* bf8afbd12c81710c8a5e38aac9c64914 */
/* x = 4.76562500000000000000000000000000000e-01 3ffde800000000000000000000000000 */
/* cos(x) = 0.e379c9045f29d517c4808aa497c2057b2b3d109e76c0dc302d4d0698b36e3f0bdbf33d8e952 */
- 8.88577045028035543317609023116020980e-01L, /* 3ffec6f39208be53aa2f890115492f84 */
- 4.12354278954664731443813655177022170e-36L, /* 3f895ecacf44279db0370c0b5341a62d */
+ L(8.88577045028035543317609023116020980e-01), /* 3ffec6f39208be53aa2f890115492f84 */
+ L(4.12354278954664731443813655177022170e-36), /* 3f895ecacf44279db0370c0b5341a62d */
/* sin(x) = 0.756f28d011d98528a44a75fc29c779bd734ecdfb582fdb74b68a4c4c4be54cfd0b2d3ad292f */
- 4.58727408216736592377295028972874773e-01L, /* 3ffdd5bca340476614a29129d7f0a71e */
--4.70946994194182908929251719575431779e-36L, /* bf8990a32c4c8129f40922d25d6ceced */
+ L(4.58727408216736592377295028972874773e-01), /* 3ffdd5bca340476614a29129d7f0a71e */
+L(-4.70946994194182908929251719575431779e-36), /* bf8990a32c4c8129f40922d25d6ceced */
/* x = 4.84375000000000000000000000000000000e-01 3ffdf000000000000000000000000000 */
/* cos(x) = 0.e28d245c58baef72225e232abc003c4366acd9eb4fc2808c2ab7fe7676cf512ac7f945ae5fb */
- 8.84966156526143291697296536966647926e-01L, /* 3ffec51a48b8b175dee444bc46557800 */
- 4.53370570288325630442037826313462165e-35L, /* 3f8ce21b3566cf5a7e14046155bff3b4 */
+ L(8.84966156526143291697296536966647926e-01), /* 3ffec51a48b8b175dee444bc46557800 */
+ L(4.53370570288325630442037826313462165e-35), /* 3f8ce21b3566cf5a7e14046155bff3b4 */
/* sin(x) = 0.77353054ca72690d4c6e171fd99e6b39fa8e1ede5f052fd2964534c75340970a3a9cd3c5c32 */
- 4.65655346585160182681199512507546779e-01L, /* 3ffddcd4c15329c9a43531b85c7f667a */
--1.56282598978971872478619772155305961e-35L, /* bf8b4c60571e121a0fad02d69bacb38b */
+ L(4.65655346585160182681199512507546779e-01), /* 3ffddcd4c15329c9a43531b85c7f667a */
+L(-1.56282598978971872478619772155305961e-35), /* bf8b4c60571e121a0fad02d69bacb38b */
/* x = 4.92187500000000000000000000000000000e-01 3ffdf800000000000000000000000000 */
/* cos(x) = 0.e19cf580eeec046aa1422fa74807ecefb2a1911c94e7b5f20a00f70022d940193691e5bd790 */
- 8.81301254251340599140161908298100173e-01L, /* 3ffec339eb01ddd808d542845f4e9010 */
--1.43419192312116687783945619009629445e-35L, /* bf8b3104d5e6ee36b184a0df5ff08ffe */
+ L(8.81301254251340599140161908298100173e-01), /* 3ffec339eb01ddd808d542845f4e9010 */
+L(-1.43419192312116687783945619009629445e-35), /* bf8b3104d5e6ee36b184a0df5ff08ffe */
/* sin(x) = 0.78f95b0560a9a3bd6df7bd981dc38c61224d08bc20631ea932e605e53b579e9e0767dfcbbcb */
- 4.72554863751304451146551317808516942e-01L, /* 3ffde3e56c1582a68ef5b7def660770e */
- 9.31324774957768018850224267625371204e-36L, /* 3f8a8c2449a117840c63d5265cc0bca7 */
+ L(4.72554863751304451146551317808516942e-01), /* 3ffde3e56c1582a68ef5b7def660770e */
+ L(9.31324774957768018850224267625371204e-36), /* 3f8a8c2449a117840c63d5265cc0bca7 */
/* x = 5.00000000000000000000000000000000000e-01 3ffe0000000000000000000000000000 */
/* cos(x) = 0.e0a94032dbea7cedbddd9da2fafad98556566b3a89f43eabd72350af3e8b19e801204d8fe2e */
- 8.77582561890372716116281582603829681e-01L, /* 3ffec1528065b7d4f9db7bbb3b45f5f6 */
--2.89484960181363924855192538540698851e-35L, /* bf8c33d54d4ca62bb05e0aa146e57a86 */
+ L(8.77582561890372716116281582603829681e-01), /* 3ffec1528065b7d4f9db7bbb3b45f5f6 */
+L(-2.89484960181363924855192538540698851e-35), /* bf8c33d54d4ca62bb05e0aa146e57a86 */
/* sin(x) = 0.7abba1d12c17bfa1d92f0d93f60ded9992f45b4fcaf13cd58b303693d2a0db47db35ae8a3a9 */
- 4.79425538604203000273287935215571402e-01L, /* 3ffdeaee8744b05efe8764bc364fd838 */
--1.38426977616718318950175848639381926e-35L, /* bf8b2666d0ba4b0350ec32a74cfc96c3 */
+ L(4.79425538604203000273287935215571402e-01), /* 3ffdeaee8744b05efe8764bc364fd838 */
+L(-1.38426977616718318950175848639381926e-35), /* bf8b2666d0ba4b0350ec32a74cfc96c3 */
/* x = 5.07812500000000000000000000000000000e-01 3ffe0400000000000000000000000000 */
/* cos(x) = 0.dfb20840f3a9b36f7ae2c515342890b5ec583b8366cc2b55029e95094d31112383f2553498b */
- 8.73810306413054508282556837071377159e-01L, /* 3ffebf641081e75366def5c58a2a6851 */
- 1.25716864497849302237218128599994785e-35L, /* 3f8b0b5ec583b8366cc2b55029e95095 */
+ L(8.73810306413054508282556837071377159e-01), /* 3ffebf641081e75366def5c58a2a6851 */
+ L(1.25716864497849302237218128599994785e-35), /* 3f8b0b5ec583b8366cc2b55029e95095 */
/* sin(x) = 0.7c7bfdaf13e5ed17212f8a7525bfb113aba6c0741b5362bb8d59282a850b63716bca0c910f0 */
- 4.86266951793275574311011306895834993e-01L, /* 3ffdf1eff6bc4f97b45c84be29d496ff */
--1.12269393250914752644352376448094271e-35L, /* bf8add8a8b27f17c9593a88e54dafaaf */
+ L(4.86266951793275574311011306895834993e-01), /* 3ffdf1eff6bc4f97b45c84be29d496ff */
+L(-1.12269393250914752644352376448094271e-35), /* bf8add8a8b27f17c9593a88e54dafaaf */
/* x = 5.15625000000000000000000000000000000e-01 3ffe0800000000000000000000000000 */
/* cos(x) = 0.deb7518814a7a931bbcc88c109cd41c50bf8bb48f20ae8c36628d1d3d57574f7dc58f27d91c */
- 8.69984718058417388828915599901466243e-01L, /* 3ffebd6ea310294f526377991182139b */
--4.68168638300575626782741319792183837e-35L, /* bf8cf1d7a03a25b86fa8b9e4ceb97161 */
+ L(8.69984718058417388828915599901466243e-01), /* 3ffebd6ea310294f526377991182139b */
+L(-4.68168638300575626782741319792183837e-35), /* bf8cf1d7a03a25b86fa8b9e4ceb97161 */
/* sin(x) = 0.7e3a679daaf25c676542bcb4028d0964172961c921823a4ef0c3a9070d886dbd073f6283699 */
- 4.93078685753923057265136552753487121e-01L, /* 3ffdf8e99e76abc9719d950af2d00a34 */
- 7.06498693112535056352301101088624950e-36L, /* 3f8a2c82e52c3924304749de187520e2 */
+ L(4.93078685753923057265136552753487121e-01), /* 3ffdf8e99e76abc9719d950af2d00a34 */
+ L(7.06498693112535056352301101088624950e-36), /* 3f8a2c82e52c3924304749de187520e2 */
/* x = 5.23437500000000000000000000000000000e-01 3ffe0c00000000000000000000000000 */
/* cos(x) = 0.ddb91ff318799172bd2452d0a3889f5169c64a0094bcf0b8aa7dcf0d7640a2eba68955a80be */
- 8.66106030320656714696616831654267220e-01L, /* 3ffebb723fe630f322e57a48a5a14711 */
- 2.35610597588322493119667003904687628e-35L, /* 3f8bf5169c64a0094bcf0b8aa7dcf0d7 */
+ L(8.66106030320656714696616831654267220e-01), /* 3ffebb723fe630f322e57a48a5a14711 */
+ L(2.35610597588322493119667003904687628e-35), /* 3f8bf5169c64a0094bcf0b8aa7dcf0d7 */
/* sin(x) = 0.7ff6d8a34bd5e8fa54c97482db5159df1f24e8038419c0b448b9eea8939b5d4dfcf40900257 */
- 4.99860324733013463819556536946425724e-01L, /* 3ffdffdb628d2f57a3e95325d20b6d45 */
- 1.94636052312235297538564591686645139e-35L, /* 3f8b9df1f24e8038419c0b448b9eea89 */
+ L(4.99860324733013463819556536946425724e-01), /* 3ffdffdb628d2f57a3e95325d20b6d45 */
+ L(1.94636052312235297538564591686645139e-35), /* 3f8b9df1f24e8038419c0b448b9eea89 */
/* x = 5.31250000000000000000000000000000000e-01 3ffe1000000000000000000000000000 */
/* cos(x) = 0.dcb7777ac420705168f31e3eb780ce9c939ecada62843b54522f5407eb7f21e556059fcd734 */
- 8.62174479934880504367162510253324274e-01L, /* 3ffeb96eeef58840e0a2d1e63c7d6f02 */
--3.71556818317533582234562471835771823e-35L, /* bf8c8b1b6309a92cebde255d6e855fc1 */
+ L(8.62174479934880504367162510253324274e-01), /* 3ffeb96eeef58840e0a2d1e63c7d6f02 */
+L(-3.71556818317533582234562471835771823e-35), /* bf8c8b1b6309a92cebde255d6e855fc1 */
/* sin(x) = 0.81b149ce34caa5a4e650f8d09fd4d6aa74206c32ca951a93074c83b2d294d25dbb0f7fdfad2 */
- 5.06611454814257367642296000893867192e-01L, /* 3ffe0362939c69954b49cca1f1a13faa */
--3.10963699824274155702706043065967062e-35L, /* bf8c4aac5efc9e69ab572b67c59be269 */
+ L(5.06611454814257367642296000893867192e-01), /* 3ffe0362939c69954b49cca1f1a13faa */
+L(-3.10963699824274155702706043065967062e-35), /* bf8c4aac5efc9e69ab572b67c59be269 */
/* x = 5.39062500000000000000000000000000000e-01 3ffe1400000000000000000000000000 */
/* cos(x) = 0.dbb25c25b8260c14f6e7bc98ec991b70c65335198b0ab628bad20cc7b229d4dd62183cfa055 */
- 8.58190306862660347046629564970494649e-01L, /* 3ffeb764b84b704c1829edcf7931d932 */
- 2.06439574601190798155563653000684861e-35L, /* 3f8bb70c65335198b0ab628bad20cc7b */
+ L(8.58190306862660347046629564970494649e-01), /* 3ffeb764b84b704c1829edcf7931d932 */
+ L(2.06439574601190798155563653000684861e-35), /* 3f8bb70c65335198b0ab628bad20cc7b */
/* sin(x) = 0.8369b434a372da7eb5c8a71fe36ce1e0b2b493f6f5cb2e38bcaec2a556b3678c401940d1c3c */
- 5.13331663943471218288801270215706878e-01L, /* 3ffe06d3686946e5b4fd6b914e3fc6da */
--2.26614796466671970772244932848067224e-35L, /* bf8be1f4d4b6c090a34d1c743513d5ab */
+ L(5.13331663943471218288801270215706878e-01), /* 3ffe06d3686946e5b4fd6b914e3fc6da */
+L(-2.26614796466671970772244932848067224e-35), /* bf8be1f4d4b6c090a34d1c743513d5ab */
/* x = 5.46875000000000000000000000000000000e-01 3ffe1800000000000000000000000000 */
/* cos(x) = 0.daa9d20860827063fde51c09e855e9932e1b17143e7244fd267a899d41ae1f3bc6a0ec42e27 */
- 8.54153754277385385143451785105103176e-01L, /* 3ffeb553a410c104e0c7fbca3813d0ac */
--1.68707534013095152873222061722573172e-35L, /* bf8b66cd1e4e8ebc18dbb02d9857662c */
+ L(8.54153754277385385143451785105103176e-01), /* 3ffeb553a410c104e0c7fbca3813d0ac */
+L(-1.68707534013095152873222061722573172e-35), /* bf8b66cd1e4e8ebc18dbb02d9857662c */
/* sin(x) = 0.852010f4f0800521378bd8dd614753d080c2e9e0775ffc609947b9132f5357404f464f06a58 */
- 5.20020541953727004760213699874674730e-01L, /* 3ffe0a4021e9e1000a426f17b1bac28f */
--3.32415021330884924833711842866896734e-35L, /* bf8c617bf9e8b0fc45001cfb35c23767 */
+ L(5.20020541953727004760213699874674730e-01), /* 3ffe0a4021e9e1000a426f17b1bac28f */
+L(-3.32415021330884924833711842866896734e-35), /* bf8c617bf9e8b0fc45001cfb35c23767 */
/* x = 5.54687500000000000000000000000000000e-01 3ffe1c00000000000000000000000000 */
/* cos(x) = 0.d99ddd44e44a43d4d4a3a3ed95204106fd54d78e8c7684545c0da0b7c2c72be7a89b7c182ad */
- 8.50065068549420263957072899177793617e-01L, /* 3ffeb33bba89c89487a9a94747db2a41 */
--4.73753917078785974356016104842568442e-35L, /* bf8cf7c81559438b9c4bdd5d1f92fa42 */
+ L(8.50065068549420263957072899177793617e-01), /* 3ffeb33bba89c89487a9a94747db2a41 */
+L(-4.73753917078785974356016104842568442e-35), /* bf8cf7c81559438b9c4bdd5d1f92fa42 */
/* sin(x) = 0.86d45935ab396cb4e421e822dee54f3562dfcefeaa782184c23401d231f5ad981a1cc195b18 */
- 5.26677680590386730710789410624833901e-01L, /* 3ffe0da8b26b5672d969c843d045bdcb */
--3.67066148195515214077582496518566735e-35L, /* bf8c8654e901880aac3ef3d9ee5ff16e */
+ L(5.26677680590386730710789410624833901e-01), /* 3ffe0da8b26b5672d969c843d045bdcb */
+L(-3.67066148195515214077582496518566735e-35), /* bf8c8654e901880aac3ef3d9ee5ff16e */
/* x = 5.62500000000000000000000000000000000e-01 3ffe2000000000000000000000000000 */
/* cos(x) = 0.d88e820b1526311dd561efbc0c1a9a5375eb26f65d246c5744b13ca26a7e0fd42556da843c8 */
- 8.45924499231067954459723078597493262e-01L, /* 3ffeb11d04162a4c623baac3df781835 */
- 1.98054947141989878179164342925274053e-35L, /* 3f8ba5375eb26f65d246c5744b13ca27 */
+ L(8.45924499231067954459723078597493262e-01), /* 3ffeb11d04162a4c623baac3df781835 */
+ L(1.98054947141989878179164342925274053e-35), /* 3f8ba5375eb26f65d246c5744b13ca27 */
/* sin(x) = 0.88868625b4e1dbb2313310133022527200c143a5cb16637cb7daf8ade82459ff2e98511f40f */
- 5.33302673536020173329131103308161529e-01L, /* 3ffe110d0c4b69c3b764626620266045 */
--3.42715291319551615996993795226755157e-35L, /* bf8c6c6ff9f5e2d1a74ce41a41283a91 */
+ L(5.33302673536020173329131103308161529e-01), /* 3ffe110d0c4b69c3b764626620266045 */
+L(-3.42715291319551615996993795226755157e-35), /* bf8c6c6ff9f5e2d1a74ce41a41283a91 */
/* x = 5.70312500000000000000000000000000000e-01 3ffe2400000000000000000000000000 */
/* cos(x) = 0.d77bc4985e93a607c9d868b906bbc6bbe3a04258814acb0358468b826fc91bd4d814827f65e */
- 8.41732299041338366963111794309701085e-01L, /* 3ffeaef78930bd274c0f93b0d1720d78 */
--4.30821936750410026005408345400225948e-35L, /* bf8cca20e2fded3bf5a9a7e53dcba3ed */
+ L(8.41732299041338366963111794309701085e-01), /* 3ffeaef78930bd274c0f93b0d1720d78 */
+L(-4.30821936750410026005408345400225948e-35), /* bf8cca20e2fded3bf5a9a7e53dcba3ed */
/* sin(x) = 0.8a3690fc5bfc11bf9535e2739a8512f448a41251514bbed7fc18d530f9b4650fcbb2861b0aa */
- 5.39895116435204405041660709903993340e-01L, /* 3ffe146d21f8b7f8237f2a6bc4e7350a */
- 1.42595803521626714477253741404712093e-35L, /* 3f8b2f448a41251514bbed7fc18d5310 */
+ L(5.39895116435204405041660709903993340e-01), /* 3ffe146d21f8b7f8237f2a6bc4e7350a */
+ L(1.42595803521626714477253741404712093e-35), /* 3f8b2f448a41251514bbed7fc18d5310 */
/* x = 5.78125000000000000000000000000000000e-01 3ffe2800000000000000000000000000 */
/* cos(x) = 0.d665a937b4ef2b1f6d51bad6d988a4419c1d7051faf31a9efa151d7631117efac03713f950a */
- 8.37488723850523685315353348917240617e-01L, /* 3ffeaccb526f69de563edaa375adb311 */
- 2.72761997872084533045777718677326179e-35L, /* 3f8c220ce0eb828fd798d4f7d0a8ebb2 */
+ L(8.37488723850523685315353348917240617e-01), /* 3ffeaccb526f69de563edaa375adb311 */
+ L(2.72761997872084533045777718677326179e-35), /* 3f8c220ce0eb828fd798d4f7d0a8ebb2 */
/* sin(x) = 0.8be472f9776d809af2b88171243d63d66dfceeeb739cc894e023fbc165a0e3f26ff729c5d57 */
- 5.46454606919203564403349553749411001e-01L, /* 3ffe17c8e5f2eedb0135e57102e2487b */
--2.11870230730160315420936523771864858e-35L, /* bf8bc29920311148c63376b1fdc043ea */
+ L(5.46454606919203564403349553749411001e-01), /* 3ffe17c8e5f2eedb0135e57102e2487b */
+L(-2.11870230730160315420936523771864858e-35), /* bf8bc29920311148c63376b1fdc043ea */
/* x = 5.85937500000000000000000000000000000e-01 3ffe2c00000000000000000000000000 */
/* cos(x) = 0.d54c3441844897fc8f853f0655f1ba695eba9fbfd7439dbb1171d862d9d9146ca5136f825ac */
- 8.33194032664581363070224042208032321e-01L, /* 3ffeaa98688308912ff91f0a7e0cabe3 */
- 4.39440050052045486567668031751259899e-35L, /* 3f8cd34af5d4fdfeba1cedd88b8ec317 */
+ L(8.33194032664581363070224042208032321e-01), /* 3ffeaa98688308912ff91f0a7e0cabe3 */
+ L(4.39440050052045486567668031751259899e-35), /* 3f8cd34af5d4fdfeba1cedd88b8ec317 */
/* sin(x) = 0.8d902565817ee7839bce3cd128060119492cd36d42d82ada30d7f8bde91324808377ddbf5d4 */
- 5.52980744630527369849695082681623667e-01L, /* 3ffe1b204acb02fdcf07379c79a2500c */
- 8.26624790417342895897164123189984127e-37L, /* 3f8719492cd36d42d82ada30d7f8bde9 */
+ L(5.52980744630527369849695082681623667e-01), /* 3ffe1b204acb02fdcf07379c79a2500c */
+ L(8.26624790417342895897164123189984127e-37), /* 3f8719492cd36d42d82ada30d7f8bde9 */
/* x = 5.93750000000000000000000000000000000e-01 3ffe3000000000000000000000000000 */
/* cos(x) = 0.d42f6a1b9f0168cdf031c2f63c8d9304d86f8d34cb1d5fccb68ca0f2241427fc18d1fd5bbdf */
- 8.28848487609325734810171790119116638e-01L, /* 3ffea85ed4373e02d19be06385ec791b */
- 1.43082508100496581719048175506239770e-35L, /* 3f8b304d86f8d34cb1d5fccb68ca0f22 */
+ L(8.28848487609325734810171790119116638e-01), /* 3ffea85ed4373e02d19be06385ec791b */
+ L(1.43082508100496581719048175506239770e-35), /* 3f8b304d86f8d34cb1d5fccb68ca0f22 */
/* sin(x) = 0.8f39a191b2ba6122a3fa4f41d5a3ffd421417d46f19a22230a14f7fcc8fce5c75b4b28b29d1 */
- 5.59473131247366877384844006003116688e-01L, /* 3ffe1e7343236574c24547f49e83ab48 */
--1.28922620524163922306886952100992796e-37L, /* bf845ef5f415c8732eeee7af584019b8 */
+ L(5.59473131247366877384844006003116688e-01), /* 3ffe1e7343236574c24547f49e83ab48 */
+L(-1.28922620524163922306886952100992796e-37), /* bf845ef5f415c8732eeee7af584019b8 */
/* x = 6.01562500000000000000000000000000000e-01 3ffe3400000000000000000000000000 */
/* cos(x) = 0.d30f4f392c357ab0661c5fa8a7d9b26627846fef214b1d19a22379ff9eddba087cf410eb097 */
- 8.24452353914429207485643598212356053e-01L, /* 3ffea61e9e72586af560cc38bf514fb3 */
- 3.79160239225080026987031418939026741e-35L, /* 3f8c93313c237f790a58e8cd111bcffd */
+ L(8.24452353914429207485643598212356053e-01), /* 3ffea61e9e72586af560cc38bf514fb3 */
+ L(3.79160239225080026987031418939026741e-35), /* 3f8c93313c237f790a58e8cd111bcffd */
/* sin(x) = 0.90e0e0d81ca678796cc92c8ea8c2815bc72ca78abe571bfa8576aacc571e096a33237e0e830 */
- 5.65931370507905990773159095689276114e-01L, /* 3ffe21c1c1b0394cf0f2d992591d5185 */
- 1.02202775968053982310991962521535027e-36L, /* 3f875bc72ca78abe571bfa8576aacc57 */
+ L(5.65931370507905990773159095689276114e-01), /* 3ffe21c1c1b0394cf0f2d992591d5185 */
+ L(1.02202775968053982310991962521535027e-36), /* 3f875bc72ca78abe571bfa8576aacc57 */
/* x = 6.09375000000000000000000000000000000e-01 3ffe3800000000000000000000000000 */
/* cos(x) = 0.d1ebe81a95ee752e48a26bcd32d6e922d7eb44b8ad2232f6930795e84b56317269b9dd1dfa6 */
- 8.20005899897234008255550633876556043e-01L, /* 3ffea3d7d0352bdcea5c9144d79a65ae */
--1.72008811955230823416724332297991247e-35L, /* bf8b6dd2814bb4752ddcd096cf86a17b */
+ L(8.20005899897234008255550633876556043e-01), /* 3ffea3d7d0352bdcea5c9144d79a65ae */
+L(-1.72008811955230823416724332297991247e-35), /* bf8b6dd2814bb4752ddcd096cf86a17b */
/* sin(x) = 0.9285dc9bc45dd9ea3d02457bcce59c4175aab6ff7929a8d287195525fdace200dba032874fb */
- 5.72355068234507240384953706824503608e-01L, /* 3ffe250bb93788bbb3d47a048af799cb */
- 2.12572273479933123944580199464514529e-35L, /* 3f8bc4175aab6ff7929a8d2871955260 */
+ L(5.72355068234507240384953706824503608e-01), /* 3ffe250bb93788bbb3d47a048af799cb */
+ L(2.12572273479933123944580199464514529e-35), /* 3f8bc4175aab6ff7929a8d2871955260 */
/* x = 6.17187500000000000000000000000000000e-01 3ffe3c00000000000000000000000000 */
/* cos(x) = 0.d0c5394d772228195e25736c03574707de0af1ca344b13bd3914bfe27518e9e426f5deff1e1 */
- 8.15509396946375476876345384201386217e-01L, /* 3ffea18a729aee445032bc4ae6d806af */
--4.28589138410712954051679139949341961e-35L, /* bf8cc7c10fa871ae5da76216375a00ec */
+ L(8.15509396946375476876345384201386217e-01), /* 3ffea18a729aee445032bc4ae6d806af */
+L(-4.28589138410712954051679139949341961e-35), /* bf8cc7c10fa871ae5da76216375a00ec */
/* sin(x) = 0.94288e48bd0335fc41c4cbd2920497a8f5d1d8185c99fa0081f90c27e2a53ffdd208a0dbe69 */
- 5.78743832357770354521111378581385347e-01L, /* 3ffe28511c917a066bf8838997a52409 */
- 1.77998063432551282609698670002456093e-35L, /* 3f8b7a8f5d1d8185c99fa0081f90c27e */
+ L(5.78743832357770354521111378581385347e-01), /* 3ffe28511c917a066bf8838997a52409 */
+ L(1.77998063432551282609698670002456093e-35), /* 3f8b7a8f5d1d8185c99fa0081f90c27e */
/* x = 6.25000000000000000000000000000000000e-01 3ffe4000000000000000000000000000 */
/* cos(x) = 0.cf9b476c897c25c5bfe750dd3f308eaf7bcc1ed00179a256870f4200445043dcdb1974b5878 */
- 8.10963119505217902189534803941080724e-01L, /* 3ffe9f368ed912f84b8b7fcea1ba7e61 */
- 1.10481292856794436426051402418804358e-35L, /* 3f8ad5ef7983da002f344ad0e1e84009 */
+ L(8.10963119505217902189534803941080724e-01), /* 3ffe9f368ed912f84b8b7fcea1ba7e61 */
+ L(1.10481292856794436426051402418804358e-35), /* 3f8ad5ef7983da002f344ad0e1e84009 */
/* sin(x) = 0.95c8ef544210ec0b91c49bd2aa09e8515fa61a156ebb10f5f8c232a6445b61ebf3c2ec268f9 */
- 5.85097272940462154805399314150080459e-01L, /* 3ffe2b91dea88421d817238937a55414 */
--1.78164576278056195136525335403380464e-35L, /* bf8b7aea059e5ea9144ef0a073dcd59c */
+ L(5.85097272940462154805399314150080459e-01), /* 3ffe2b91dea88421d817238937a55414 */
+L(-1.78164576278056195136525335403380464e-35), /* bf8b7aea059e5ea9144ef0a073dcd59c */
/* x = 6.32812500000000000000000000000000000e-01 3ffe4400000000000000000000000000 */
/* cos(x) = 0.ce6e171f92f2e27f32225327ec440ddaefae248413efc0e58ceee1ae369aabe73f88c87ed1a */
- 8.06367345055103913698795406077297399e-01L, /* 3ffe9cdc2e3f25e5c4fe6444a64fd888 */
- 1.04235088143133625463876245029180850e-35L, /* 3f8abb5df5c490827df81cb19ddc35c7 */
+ L(8.06367345055103913698795406077297399e-01), /* 3ffe9cdc2e3f25e5c4fe6444a64fd888 */
+ L(1.04235088143133625463876245029180850e-35), /* 3f8abb5df5c490827df81cb19ddc35c7 */
/* sin(x) = 0.9766f93cd18413a6aafc1cfc6fc28abb6817bf94ce349901ae3f48c3215d3eb60acc5f78903 */
- 5.91415002201316315087000225758031236e-01L, /* 3ffe2ecdf279a308274d55f839f8df85 */
- 8.07390238063560077355762466502569603e-36L, /* 3f8a576d02f7f299c6932035c7e91864 */
+ L(5.91415002201316315087000225758031236e-01), /* 3ffe2ecdf279a308274d55f839f8df85 */
+ L(8.07390238063560077355762466502569603e-36), /* 3f8a576d02f7f299c6932035c7e91864 */
/* x = 6.40625000000000000000000000000000000e-01 3ffe4800000000000000000000000000 */
/* cos(x) = 0.cd3dad1b5328a2e459f993f4f5108819faccbc4eeba9604e81c7adad51cc8a2561631a06826 */
- 8.01722354098418450607492605652964208e-01L, /* 3ffe9a7b5a36a65145c8b3f327e9ea21 */
- 6.09487851305233089325627939458963741e-36L, /* 3f8a033f599789dd752c09d038f5b5aa */
+ L(8.01722354098418450607492605652964208e-01), /* 3ffe9a7b5a36a65145c8b3f327e9ea21 */
+ L(6.09487851305233089325627939458963741e-36), /* 3f8a033f599789dd752c09d038f5b5aa */
/* sin(x) = 0.9902a58a45e27bed68412b426b675ed503f54d14c8172e0d373f42cadf04daf67319a7f94be */
- 5.97696634538701531238647618967334337e-01L, /* 3ffe32054b148bc4f7dad0825684d6cf */
--2.49527608940873714527427941350461554e-35L, /* bf8c0957e0559759bf468f964605e9a9 */
+ L(5.97696634538701531238647618967334337e-01), /* 3ffe32054b148bc4f7dad0825684d6cf */
+L(-2.49527608940873714527427941350461554e-35), /* bf8c0957e0559759bf468f964605e9a9 */
/* x = 6.48437500000000000000000000000000000e-01 3ffe4c00000000000000000000000000 */
/* cos(x) = 0.cc0a0e21709883a3ff00911e11a07ee3bd7ea2b04e081be99be0264791170761ae64b8b744a */
- 7.97028430141468342004642741431945296e-01L, /* 3ffe98141c42e1310747fe01223c2341 */
--8.35364432831812599727083251866305534e-37L, /* bf871c42815d4fb1f7e416641fd9b86f */
+ L(7.97028430141468342004642741431945296e-01), /* 3ffe98141c42e1310747fe01223c2341 */
+L(-8.35364432831812599727083251866305534e-37), /* bf871c42815d4fb1f7e416641fd9b86f */
/* sin(x) = 0.9a9bedcdf01b38d993f3d7820781de292033ead73b89e28f39313dbe3a6e463f845b5fa8490 */
- 6.03941786554156657267270287527367726e-01L, /* 3ffe3537db9be03671b327e7af040f04 */
--2.54578992328947177770363936132309779e-35L, /* bf8c0eb6fe60a94623b0eb863676120e */
+ L(6.03941786554156657267270287527367726e-01), /* 3ffe3537db9be03671b327e7af040f04 */
+L(-2.54578992328947177770363936132309779e-35), /* bf8c0eb6fe60a94623b0eb863676120e */
/* x = 6.56250000000000000000000000000000000e-01 3ffe5000000000000000000000000000 */
/* cos(x) = 0.cad33f00658fe5e8204bbc0f3a66a0e6a773f87987a780b243d7be83b3db1448ca0e0e62787 */
- 7.92285859677178543141501323781709399e-01L, /* 3ffe95a67e00cb1fcbd04097781e74cd */
- 2.47519558228473167879248891673807645e-35L, /* 3f8c07353b9fc3cc3d3c05921ebdf41e */
+ L(7.92285859677178543141501323781709399e-01), /* 3ffe95a67e00cb1fcbd04097781e74cd */
+ L(2.47519558228473167879248891673807645e-35), /* 3f8c07353b9fc3cc3d3c05921ebdf41e */
/* sin(x) = 0.9c32cba2b14156ef05256c4f857991ca6a547cd7ceb1ac8a8e62a282bd7b9183648a462bd04 */
- 6.10150077075791371273742393566183220e-01L, /* 3ffe386597456282adde0a4ad89f0af3 */
- 1.33842237929938963780969418369150532e-35L, /* 3f8b1ca6a547cd7ceb1ac8a8e62a282c */
+ L(6.10150077075791371273742393566183220e-01), /* 3ffe386597456282adde0a4ad89f0af3 */
+ L(1.33842237929938963780969418369150532e-35), /* 3f8b1ca6a547cd7ceb1ac8a8e62a282c */
/* x = 6.64062500000000000000000000000000000e-01 3ffe5400000000000000000000000000 */
/* cos(x) = 0.c99944936cf48c8911ff93fe64b3ddb7981e414bdaf6aae1203577de44878c62bc3bc9cf7b9 */
- 7.87494932167606083931328295965533034e-01L, /* 3ffe93328926d9e9191223ff27fcc968 */
--2.57915385618070637156514241185180920e-35L, /* bf8c12433f0df5a1284aa8f6fe54410e */
+ L(7.87494932167606083931328295965533034e-01), /* 3ffe93328926d9e9191223ff27fcc968 */
+L(-2.57915385618070637156514241185180920e-35), /* bf8c12433f0df5a1284aa8f6fe54410e */
/* sin(x) = 0.9dc738ad14204e689ac582d0f85826590feece34886cfefe2e08cf2bb8488d55424dc9d3525 */
- 6.16321127181550943005700433761731837e-01L, /* 3ffe3b8e715a28409cd1358b05a1f0b0 */
- 2.88497530050197716298085892460478666e-35L, /* 3f8c32c87f7671a44367f7f17046795e */
+ L(6.16321127181550943005700433761731837e-01), /* 3ffe3b8e715a28409cd1358b05a1f0b0 */
+ L(2.88497530050197716298085892460478666e-35), /* 3f8c32c87f7671a44367f7f17046795e */
/* x = 6.71875000000000000000000000000000000e-01 3ffe5800000000000000000000000000 */
/* cos(x) = 0.c85c23c26ed7b6f014ef546c47929682122876bfbf157de0aff3c4247d820c746e32cd4174f */
- 7.82655940026272796930787447428139026e-01L, /* 3ffe90b84784ddaf6de029dea8d88f25 */
- 1.69332045679237919427807771288506254e-35L, /* 3f8b682122876bfbf157de0aff3c4248 */
+ L(7.82655940026272796930787447428139026e-01), /* 3ffe90b84784ddaf6de029dea8d88f25 */
+ L(1.69332045679237919427807771288506254e-35), /* 3f8b682122876bfbf157de0aff3c4248 */
/* sin(x) = 0.9f592e9b66a9cf906a3c7aa3c10199849040c45ec3f0a747597311038101780c5f266059dbf */
- 6.22454560222343683041926705090443330e-01L, /* 3ffe3eb25d36cd539f20d478f5478203 */
- 1.91974786921147072717621236192269859e-35L, /* 3f8b9849040c45ec3f0a747597311038 */
+ L(6.22454560222343683041926705090443330e-01), /* 3ffe3eb25d36cd539f20d478f5478203 */
+ L(1.91974786921147072717621236192269859e-35), /* 3f8b9849040c45ec3f0a747597311038 */
/* x = 6.79687500000000000000000000000000000e-01 3ffe5c00000000000000000000000000 */
/* cos(x) = 0.c71be181ecd6875ce2da5615a03cca207d9adcb9dfb0a1d6c40a4f0056437f1a59ccddd06ee */
- 7.77769178600317903122203513685412863e-01L, /* 3ffe8e37c303d9ad0eb9c5b4ac2b407a */
--4.05296033424632846931240580239929672e-35L, /* bf8caefc13291a31027af149dfad87fd */
+ L(7.77769178600317903122203513685412863e-01), /* 3ffe8e37c303d9ad0eb9c5b4ac2b407a */
+L(-4.05296033424632846931240580239929672e-35), /* bf8caefc13291a31027af149dfad87fd */
/* sin(x) = 0.a0e8a725d33c828c11fa50fd9e9a15ffecfad43f3e534358076b9b0f6865694842b1e8c67dc */
- 6.28550001845029662028004327939032867e-01L, /* 3ffe41d14e4ba679051823f4a1fb3d34 */
- 1.65507421184028099672784511397428852e-35L, /* 3f8b5ffecfad43f3e534358076b9b0f7 */
+ L(6.28550001845029662028004327939032867e-01), /* 3ffe41d14e4ba679051823f4a1fb3d34 */
+ L(1.65507421184028099672784511397428852e-35), /* 3f8b5ffecfad43f3e534358076b9b0f7 */
/* x = 6.87500000000000000000000000000000000e-01 3ffe6000000000000000000000000000 */
/* cos(x) = 0.c5d882d2ee48030c7c07d28e981e34804f82ed4cf93655d2365389b716de6ad44676a1cc5da */
- 7.72834946152471544810851845913425178e-01L, /* 3ffe8bb105a5dc900618f80fa51d303c */
- 3.94975229341211664237241534741146939e-35L, /* 3f8ca4027c176a67c9b2ae91b29c4db9 */
+ L(7.72834946152471544810851845913425178e-01), /* 3ffe8bb105a5dc900618f80fa51d303c */
+ L(3.94975229341211664237241534741146939e-35), /* 3f8ca4027c176a67c9b2ae91b29c4db9 */
/* sin(x) = 0.a2759c0e79c35582527c32b55f5405c182c66160cb1d9eb7bb0b7cdf4ad66f317bda4332914 */
- 6.34607080015269296850309914203671436e-01L, /* 3ffe44eb381cf386ab04a4f8656abea8 */
- 4.33025916939968369326060156455927002e-36L, /* 3f897060b1985832c767adeec2df37d3 */
+ L(6.34607080015269296850309914203671436e-01), /* 3ffe44eb381cf386ab04a4f8656abea8 */
+ L(4.33025916939968369326060156455927002e-36), /* 3f897060b1985832c767adeec2df37d3 */
/* x = 6.95312500000000000000000000000000000e-01 3ffe6400000000000000000000000000 */
/* cos(x) = 0.c4920cc2ec38fb891b38827db08884fc66371ac4c2052ca8885b981bbcfd3bb7b093ee31515 */
- 7.67853543842850365879920759114193964e-01L, /* 3ffe89241985d871f712367104fb6111 */
- 3.75100035267325597157244776081706979e-36L, /* 3f893f198dc6b130814b2a2216e606ef */
+ L(7.67853543842850365879920759114193964e-01), /* 3ffe89241985d871f712367104fb6111 */
+ L(3.75100035267325597157244776081706979e-36), /* 3f893f198dc6b130814b2a2216e606ef */
/* sin(x) = 0.a400072188acf49cd6b173825e038346f105e1301afe642bcc364cea455e21e506e3e927ed8 */
- 6.40625425040230409188409779413961021e-01L, /* 3ffe48000e431159e939ad62e704bc07 */
- 2.46542747294664049615806500747173281e-36L, /* 3f88a37882f0980d7f3215e61b267523 */
+ L(6.40625425040230409188409779413961021e-01), /* 3ffe48000e431159e939ad62e704bc07 */
+ L(2.46542747294664049615806500747173281e-36), /* 3f88a37882f0980d7f3215e61b267523 */
/* x = 7.03125000000000000000000000000000000e-01 3ffe6800000000000000000000000000 */
/* cos(x) = 0.c348846bbd3631338ffe2bfe9dd1381a35b4e9c0c51b4c13fe376bad1bf5caacc4542be0aa9 */
- 7.62825275710576250507098753625429792e-01L, /* 3ffe869108d77a6c62671ffc57fd3ba2 */
- 4.22067411888601505004748939382325080e-35L, /* 3f8cc0d1ada74e0628da609ff1bb5d69 */
+ L(7.62825275710576250507098753625429792e-01), /* 3ffe869108d77a6c62671ffc57fd3ba2 */
+ L(4.22067411888601505004748939382325080e-35), /* 3f8cc0d1ada74e0628da609ff1bb5d69 */
/* sin(x) = 0.a587e23555bb08086d02b9c662cdd29316c3e9bd08d93793634a21b1810cce73bdb97a99b9e */
- 6.46604669591152370524042159882800763e-01L, /* 3ffe4b0fc46aab761010da05738cc59c */
--3.41742981816219412415674365946079826e-35L, /* bf8c6b6749e0b217b9364364e5aef274 */
+ L(6.46604669591152370524042159882800763e-01), /* 3ffe4b0fc46aab761010da05738cc59c */
+L(-3.41742981816219412415674365946079826e-35), /* bf8c6b6749e0b217b9364364e5aef274 */
/* x = 7.10937500000000000000000000000000000e-01 3ffe6c00000000000000000000000000 */
/* cos(x) = 0.c1fbeef380e4ffdd5a613ec8722f643ffe814ec2343e53adb549627224fdc9f2a7b77d3d69f */
- 7.57750448655219342240234832230493361e-01L, /* 3ffe83f7dde701c9ffbab4c27d90e45f */
--2.08767968311222650582659938787920125e-35L, /* bf8bbc0017eb13dcbc1ac524ab69d8de */
+ L(7.57750448655219342240234832230493361e-01), /* 3ffe83f7dde701c9ffbab4c27d90e45f */
+L(-2.08767968311222650582659938787920125e-35), /* bf8bbc0017eb13dcbc1ac524ab69d8de */
/* sin(x) = 0.a70d272a76a8d4b6da0ec90712bb748b96dabf88c3079246f3db7eea6e58ead4ed0e2843303 */
- 6.52544448725765956407573982284767763e-01L, /* 3ffe4e1a4e54ed51a96db41d920e2577 */
--8.61758060284379660697102362141557170e-36L, /* bf8a6e8d24a80ee79f0db721849022b2 */
+ L(6.52544448725765956407573982284767763e-01), /* 3ffe4e1a4e54ed51a96db41d920e2577 */
+L(-8.61758060284379660697102362141557170e-36), /* bf8a6e8d24a80ee79f0db721849022b2 */
/* x = 7.18750000000000000000000000000000000e-01 3ffe7000000000000000000000000000 */
/* cos(x) = 0.c0ac518c8b6ae710ba37a3eeb90cb15aebcb8bed4356fb507a48a6e97de9aa6d9660116b436 */
- 7.52629372418066476054541324847143116e-01L, /* 3ffe8158a31916d5ce21746f47dd7219 */
- 3.71306958657663189665450864311104571e-35L, /* 3f8c8ad75e5c5f6a1ab7da83d245374c */
+ L(7.52629372418066476054541324847143116e-01), /* 3ffe8158a31916d5ce21746f47dd7219 */
+ L(3.71306958657663189665450864311104571e-35), /* 3f8c8ad75e5c5f6a1ab7da83d245374c */
/* sin(x) = 0.a88fcfebd9a8dd47e2f3c76ef9e2439920f7e7fbe735f8bcc985491ec6f12a2d4214f8cfa99 */
- 6.58444399910567541589583954884041989e-01L, /* 3ffe511f9fd7b351ba8fc5e78eddf3c5 */
--4.54412944084300330523721391865787219e-35L, /* bf8ce336f840c020c6503a19b3d5b70a */
+ L(6.58444399910567541589583954884041989e-01), /* 3ffe511f9fd7b351ba8fc5e78eddf3c5 */
+L(-4.54412944084300330523721391865787219e-35), /* bf8ce336f840c020c6503a19b3d5b70a */
/* x = 7.26562500000000000000000000000000000e-01 3ffe7400000000000000000000000000 */
/* cos(x) = 0.bf59b17550a4406875969296567cf3e3b4e483061877c02811c6cae85fad5a6c3da58f49292 */
- 7.47462359563216166669700384714767552e-01L, /* 3ffe7eb362eaa14880d0eb2d252cacfa */
--9.11094340926220027288083639048016945e-36L, /* bf8a8389636f9f3cf107fafdc726a2f4 */
+ L(7.47462359563216166669700384714767552e-01), /* 3ffe7eb362eaa14880d0eb2d252cacfa */
+L(-9.11094340926220027288083639048016945e-36), /* bf8a8389636f9f3cf107fafdc726a2f4 */
/* sin(x) = 0.aa0fd66eddb921232c28520d3911b8a03193b47f187f1471ac216fbcd5bb81029294d3a73f1 */
- 6.64304163042946276515506587432846246e-01L, /* 3ffe541facddbb7242465850a41a7223 */
- 4.26004843895378210155889028714676019e-35L, /* 3f8cc5018c9da3f8c3f8a38d610b7de7 */
+ L(6.64304163042946276515506587432846246e-01), /* 3ffe541facddbb7242465850a41a7223 */
+ L(4.26004843895378210155889028714676019e-35), /* 3f8cc5018c9da3f8c3f8a38d610b7de7 */
/* x = 7.34375000000000000000000000000000000e-01 3ffe7800000000000000000000000000 */
/* cos(x) = 0.be0413f84f2a771c614946a88cbf4da1d75a5560243de8f2283fefa0ea4a48468a52d51d8b3 */
- 7.42249725458501306991347253449610537e-01L, /* 3ffe7c0827f09e54ee38c2928d51197f */
--3.78925270049800913539923473871287550e-35L, /* bf8c92f1452d54fede10b86ebe0082f9 */
+ L(7.42249725458501306991347253449610537e-01), /* 3ffe7c0827f09e54ee38c2928d51197f */
+L(-3.78925270049800913539923473871287550e-35), /* bf8c92f1452d54fede10b86ebe0082f9 */
/* sin(x) = 0.ab8d34b36acd987210ed343ec65d7e3adc2e7109fce43d55c8d57dfdf55b9e01d2cc1f1b9ec */
- 6.70123380473162894654531583500648495e-01L, /* 3ffe571a6966d59b30e421da687d8cbb */
--1.33165852952743729897634069393684656e-36L, /* bf87c523d18ef6031bc2aa372a82020b */
+ L(6.70123380473162894654531583500648495e-01), /* 3ffe571a6966d59b30e421da687d8cbb */
+L(-1.33165852952743729897634069393684656e-36), /* bf87c523d18ef6031bc2aa372a82020b */
/* x = 7.42187500000000000000000000000000000e-01 3ffe7c00000000000000000000000000 */
/* cos(x) = 0.bcab7e6bfb2a14a9b122c574a376bec98ab14808c64a4e731b34047e217611013ac99c0f25d */
- 7.36991788256240741057089385586450844e-01L, /* 3ffe7956fcd7f654295362458ae946ed */
- 4.72358938637974850573747497460125519e-35L, /* 3f8cf64c558a404632527398d9a023f1 */
+ L(7.36991788256240741057089385586450844e-01), /* 3ffe7956fcd7f654295362458ae946ed */
+ L(4.72358938637974850573747497460125519e-35), /* 3f8cf64c558a404632527398d9a023f1 */
/* sin(x) = 0.ad07e4c409d08c4fa3a9057bb0ac24b8636e74e76f51e09bd6b2319707cbd9f5e254643897a */
- 6.75901697026178809189642203142423973e-01L, /* 3ffe5a0fc98813a1189f47520af76158 */
- 2.76252586616364878801928456702948857e-35L, /* 3f8c25c31b73a73b7a8f04deb5918cb8 */
+ L(6.75901697026178809189642203142423973e-01), /* 3ffe5a0fc98813a1189f47520af76158 */
+ L(2.76252586616364878801928456702948857e-35), /* 3f8c25c31b73a73b7a8f04deb5918cb8 */
/* x = 7.50000000000000000000000000000000000e-01 3ffe8000000000000000000000000000 */
/* cos(x) = 0.bb4ff632a908f73ec151839cb9d993b4e0bfb8f20e7e44e6e4aee845e35575c3106dbe6fd06 */
- 7.31688868873820886311838753000084529e-01L, /* 3ffe769fec655211ee7d82a3073973b3 */
- 1.48255637548931697184991710293198620e-35L, /* 3f8b3b4e0bfb8f20e7e44e6e4aee845e */
+ L(7.31688868873820886311838753000084529e-01), /* 3ffe769fec655211ee7d82a3073973b3 */
+ L(1.48255637548931697184991710293198620e-35), /* 3f8b3b4e0bfb8f20e7e44e6e4aee845e */
/* sin(x) = 0.ae7fe0b5fc786b2d966e1d6af140a488476747c2646425fc7533f532cd044cb10a971a49a6a */
- 6.81638760023334166733241952779893908e-01L, /* 3ffe5cffc16bf8f0d65b2cdc3ad5e281 */
- 2.74838775935027549024224114338667371e-35L, /* 3f8c24423b3a3e1323212fe3a99fa996 */
+ L(6.81638760023334166733241952779893908e-01), /* 3ffe5cffc16bf8f0d65b2cdc3ad5e281 */
+ L(2.74838775935027549024224114338667371e-35), /* 3f8c24423b3a3e1323212fe3a99fa996 */
/* x = 7.57812500000000000000000000000000000e-01 3ffe8400000000000000000000000000 */
/* cos(x) = 0.b9f180ba77dd0751628e135a9508299012230f14becacdd14c3f8862d122de5b56d55b53360 */
- 7.26341290974108590410147630237598973e-01L, /* 3ffe73e30174efba0ea2c51c26b52a10 */
- 3.12683579338351123545814364980658990e-35L, /* 3f8c4c80911878a5f6566e8a61fc4317 */
+ L(7.26341290974108590410147630237598973e-01), /* 3ffe73e30174efba0ea2c51c26b52a10 */
+ L(3.12683579338351123545814364980658990e-35), /* 3f8c4c80911878a5f6566e8a61fc4317 */
/* sin(x) = 0.aff522a954f2ba16d9defdc416e33f5e9a5dfd5a6c228e0abc4d521327ff6e2517a7b3851dd */
- 6.87334219303873534951703613035647220e-01L, /* 3ffe5fea4552a9e5742db3bdfb882dc6 */
- 4.76739454455410744997012795035529128e-35L, /* 3f8cfaf4d2efead361147055e26a9099 */
+ L(6.87334219303873534951703613035647220e-01), /* 3ffe5fea4552a9e5742db3bdfb882dc6 */
+ L(4.76739454455410744997012795035529128e-35), /* 3f8cfaf4d2efead361147055e26a9099 */
/* x = 7.65625000000000000000000000000000000e-01 3ffe8800000000000000000000000000 */
/* cos(x) = 0.b890237d3bb3c284b614a0539016bfa1053730bbdf940fa895e185f8e58884d3dda15e63371 */
- 7.20949380945696418043812784148447688e-01L, /* 3ffe712046fa776785096c2940a7202d */
- 4.78691285733673379499536326050811832e-35L, /* 3f8cfd0829b985defca07d44af0c2fc7 */
+ L(7.20949380945696418043812784148447688e-01), /* 3ffe712046fa776785096c2940a7202d */
+ L(4.78691285733673379499536326050811832e-35), /* 3f8cfd0829b985defca07d44af0c2fc7 */
/* sin(x) = 0.b167a4c90d63c4244cf5493b7cc23bd3c3c1225e078baa0c53d6d400b926281f537a1a260e6 */
- 6.92987727246317910281815490823048210e-01L, /* 3ffe62cf49921ac7884899ea9276f984 */
- 4.50089871077663557180849219529189918e-35L, /* 3f8cde9e1e0912f03c5d50629eb6a006 */
+ L(6.92987727246317910281815490823048210e-01), /* 3ffe62cf49921ac7884899ea9276f984 */
+ L(4.50089871077663557180849219529189918e-35), /* 3f8cde9e1e0912f03c5d50629eb6a006 */
/* x = 7.73437500000000000000000000000000000e-01 3ffe8c00000000000000000000000000 */
/* cos(x) = 0.b72be40067aaf2c050dbdb7a14c3d7d4f203f6b3f0224a4afe55d6ec8e92b508fd5c5984b3b */
- 7.15513467882981573520620561289896903e-01L, /* 3ffe6e57c800cf55e580a1b7b6f42988 */
--3.02191815581445336509438104625489192e-35L, /* bf8c41586fe04a607eedada80d51489c */
+ L(7.15513467882981573520620561289896903e-01), /* 3ffe6e57c800cf55e580a1b7b6f42988 */
+L(-3.02191815581445336509438104625489192e-35), /* bf8c41586fe04a607eedada80d51489c */
/* sin(x) = 0.b2d7614b1f3aaa24df2d6e20a77e1ca3e6d838c03e29c1bcb026e6733324815fadc9eb89674 */
- 6.98598938789681741301929277107891591e-01L, /* 3ffe65aec2963e755449be5adc414efc */
- 2.15465226809256290914423429408722521e-35L, /* 3f8bca3e6d838c03e29c1bcb026e6733 */
+ L(6.98598938789681741301929277107891591e-01), /* 3ffe65aec2963e755449be5adc414efc */
+ L(2.15465226809256290914423429408722521e-35), /* 3f8bca3e6d838c03e29c1bcb026e6733 */
/* x = 7.81250000000000000000000000000000000e-01 3ffe9000000000000000000000000000 */
/* cos(x) = 0.b5c4c7d4f7dae915ac786ccf4b1a498d3e73b6e5e74fe7519d9c53ee6d6b90e881bddfc33e1 */
- 7.10033883566079674974121643959490219e-01L, /* 3ffe6b898fa9efb5d22b58f0d99e9635 */
--4.09623224763692443220896752907902465e-35L, /* bf8cb3960c6248d0c580c573131d608d */
+ L(7.10033883566079674974121643959490219e-01), /* 3ffe6b898fa9efb5d22b58f0d99e9635 */
+L(-4.09623224763692443220896752907902465e-35), /* bf8cb3960c6248d0c580c573131d608d */
/* sin(x) = 0.b44452709a59752905913765434a59d111f0433eb2b133f7d103207e2aeb4aae111ddc385b3 */
- 7.04167511454533672780059509973942844e-01L, /* 3ffe6888a4e134b2ea520b226eca8695 */
--2.87259372740393348676633610275598640e-35L, /* bf8c3177707de60a6a76604177e6fc0f */
+ L(7.04167511454533672780059509973942844e-01), /* 3ffe6888a4e134b2ea520b226eca8695 */
+L(-2.87259372740393348676633610275598640e-35), /* bf8c3177707de60a6a76604177e6fc0f */
/* x = 7.89062500000000000000000000000000000e-01 3ffe9400000000000000000000000000 */
/* cos(x) = 0.b45ad4975b1294cadca4cf40ec8f22a68cd14b175835239a37e63acb85e8e9505215df18140 */
- 7.04510962440574606164129481545916976e-01L, /* 3ffe68b5a92eb6252995b9499e81d91e */
- 2.60682037357042658395360726992048803e-35L, /* 3f8c1534668a58bac1a91cd1bf31d65c */
+ L(7.04510962440574606164129481545916976e-01), /* 3ffe68b5a92eb6252995b9499e81d91e */
+ L(2.60682037357042658395360726992048803e-35), /* 3f8c1534668a58bac1a91cd1bf31d65c */
/* sin(x) = 0.b5ae7285bc10cf515753847e8f8b7a30e0a580d929d770103509880680f7b8b0e8ad23b65d8 */
- 7.09693105363899724959669028139035515e-01L, /* 3ffe6b5ce50b78219ea2aea708fd1f17 */
--4.37026016974122945368562319136420097e-36L, /* bf8973c7d69fc9b58a23fbf2bd9dfe60 */
+ L(7.09693105363899724959669028139035515e-01), /* 3ffe6b5ce50b78219ea2aea708fd1f17 */
+L(-4.37026016974122945368562319136420097e-36), /* bf8973c7d69fc9b58a23fbf2bd9dfe60 */
};
diff --git a/sysdeps/ieee754/ldbl-128/x2y2m1l.c b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
index 733742da04..16006a107a 100644
--- a/sysdeps/ieee754/ldbl-128/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
@@ -18,59 +18,30 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_splitl.h>
#include <stdlib.h>
+
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
given that |X| >= |Y| and the values are small enough that no
overflow occurs. */
static inline void
-add_split (long double *hi, long double *lo, long double x, long double y)
+add_split (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
{
/* Apply Dekker's algorithm. */
*hi = x + y;
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
static int
compare (const void *p, const void *q)
{
- long double pld = fabsl (*(const long double *) p);
- long double qld = fabsl (*(const long double *) q);
+ _Float128 pld = fabsl (*(const _Float128 *) p);
+ _Float128 qld = fabsl (*(const _Float128 *) q);
if (pld < qld)
return -1;
else if (pld == qld)
@@ -83,22 +54,22 @@ compare (const void *p, const void *q)
It is given that 1 > X >= Y >= epsilon / 2, and that X^2 + Y^2 >=
0.5. */
-long double
-__x2y2m1l (long double x, long double y)
+_Float128
+__x2y2m1l (_Float128 x, _Float128 y)
{
- long double vals[5];
+ _Float128 vals[5];
SET_RESTORE_ROUNDL (FE_TONEAREST);
- mul_split (&vals[1], &vals[0], x, x);
- mul_split (&vals[3], &vals[2], y, y);
- vals[4] = -1.0L;
- qsort (vals, 5, sizeof (long double), compare);
+ mul_splitl (&vals[1], &vals[0], x, x);
+ mul_splitl (&vals[3], &vals[2], y, y);
+ vals[4] = -1;
+ qsort (vals, 5, sizeof (_Float128), compare);
/* Add up the values so that each element of VALS has absolute value
at most equal to the last set bit of the next nonzero
element. */
for (size_t i = 0; i <= 3; i++)
{
add_split (&vals[i + 1], &vals[i], vals[i + 1], vals[i]);
- qsort (vals + i + 1, 4 - i, sizeof (long double), compare);
+ qsort (vals + i + 1, 4 - i, sizeof (_Float128), compare);
}
/* Now any error from this addition will be small. */
return vals[4] + vals[3] + vals[2] + vals[1] + vals[0];
diff --git a/sysdeps/ieee754/ldbl-128ibm/Makefile b/sysdeps/ieee754/ldbl-128ibm/Makefile
index 6242edda41..bdba6cc6b5 100644
--- a/sysdeps/ieee754/ldbl-128ibm/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm/Makefile
@@ -11,5 +11,6 @@ endif
ifeq ($(subdir),math)
tests += test-fmodl-ldbl-128ibm test-remainderl-ldbl-128ibm \
- test-remquol-ldbl-128ibm
+ test-remquol-ldbl-128ibm test-canonical-ldbl-128ibm \
+ test-totalorderl-ldbl-128ibm
endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
new file mode 100644
index 0000000000..c7b7c63f95
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
@@ -0,0 +1,39 @@
+/* Define iscanonical macro. ldbl-128ibm version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __NO_LONG_DOUBLE_MATH
+# define iscanonical(x) ((void) (__typeof (x)) (x), 1)
+#else
+extern int __iscanonicall (long double __x)
+ __THROW __attribute__ ((__const__));
+
+/* Return nonzero value if X is canonical. In IEEE interchange binary
+ formats, all values are canonical, but the argument must still be
+ converted to its semantic type for any exceptions arising from the
+ conversion, before being discarded; in IBM long double, there are
+ encodings that are not consistently handled as corresponding to any
+ particular value of the type, and we return 0 for those. */
+# define iscanonical(x) \
+ (sizeof (x) == sizeof (long double) \
+ ? __iscanonicall (x) \
+ : ((void) (__typeof (x)) (x), 1))
+#endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index ca3cbb53af..5916caf2de 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -65,6 +65,10 @@
#include <fenv.h>
#include <inttypes.h>
#include <math_private.h>
+
+#define _Float128 long double
+#define L(x) x ## L
+
#include <sysdeps/ieee754/ldbl-128/t_expl.h>
static const long double C[] = {
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
index 39a238aa9b..00bce29284 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
@@ -1,3 +1,5 @@
/* Looks like we can use ieee854 e_j0l.c as is for IBM extended format. */
+#define _Float128 long double
+#define L(x) x ## L
#include <sysdeps/ieee754/ldbl-128/e_j0l.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
index c86e24f7c0..da9fd9eeca 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
@@ -1,2 +1,4 @@
/* Looks like we can use ieee854 e_j1l.c as is for IBM extended format. */
+#define _Float128 long double
+#define L(x) x ## L
#include <sysdeps/ieee754/ldbl-128/e_j1l.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
index 9bcaaf765a..8ac8283bd8 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -1,3 +1,5 @@
/* Looks like we can use ieee854 e_lgammal_r.c as is for IBM extended format. */
+#define _Float128 long double
+#define L(x) x ## L
#include <sysdeps/ieee754/ldbl-128/e_lgammal_r.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h
new file mode 100644
index 0000000000..bee080bd29
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h
@@ -0,0 +1,5 @@
+#include_next <bits/iscanonical.h>
+
+#ifndef _ISOMAC
+libm_hidden_proto (__iscanonicall)
+#endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
index 010a671dce..64bfc46414 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
@@ -2,5 +2,9 @@
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
+
+#define _Float128 long double
+#define L(x) x ## L
+
#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
index 177a04817b..140576315a 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
+#include <mul_split.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -36,32 +37,6 @@ add_split (double *hi, double *lo, double x, double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Value with extended range, used in intermediate computations. */
typedef struct
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
new file mode 100644
index 0000000000..c23ba0c9d5
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
@@ -0,0 +1,34 @@
+/* Get NaN payload. ldbl-128ibm version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fix-int-fp-convert-zero.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+long double
+getpayloadl (const long double *x)
+{
+ double xhi = ldbl_high (*x);
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, xhi);
+ ix &= 0x7ffffffffffffULL;
+ if (FIX_INT_FP_CONVERT_ZERO && ix == 0)
+ return 0.0L;
+ return (long double) ix;
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c b/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c
new file mode 100644
index 0000000000..63ddb82402
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c
@@ -0,0 +1,60 @@
+/* Test whether long double value is canonical. ldbl-128ibm version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+__iscanonicall (long double x)
+{
+ double xhi, xlo;
+ uint64_t hx, lx;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo);
+ int64_t ix = hx & 0x7fffffffffffffffULL;
+ int64_t iy = lx & 0x7fffffffffffffffULL;
+ int hexp = (ix & 0x7ff0000000000000LL) >> 52;
+ int lexp = (iy & 0x7ff0000000000000LL) >> 52;
+
+ if (iy == 0)
+ /* Low part 0 is always OK. */
+ return 1;
+
+ if (hexp == 0x7ff)
+ /* If a NaN, the low part does not matter. If an infinity, the
+ low part must be 0, in which case we have already returned. */
+ return ix != 0x7ff0000000000000LL;
+
+ /* The high part is finite and the low part is nonzero. There must
+ be sufficient difference between the exponents. */
+ bool low_p2;
+ if (lexp == 0)
+ {
+ /* Adjust the exponent for subnormal low part. */
+ lexp = 12 - __builtin_clzll (iy);
+ low_p2 = iy == (1LL << (51 + lexp));
+ }
+ else
+ low_p2 = (iy & 0xfffffffffffffLL) == 0;
+ int expdiff = hexp - lexp;
+ return expdiff > 53 || (expdiff == 53 && low_p2 && (ix & 1) == 0);
+}
+libm_hidden_def (__iscanonicall)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c b/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
index 091513908b..94cfffcd4b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignalingl (long double x)
@@ -29,7 +30,7 @@ __issignalingl (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (xi, xhi);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
# error untested
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
new file mode 100644
index 0000000000..ff55779433
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
@@ -0,0 +1,62 @@
+/* Total order operation. ldbl-128ibm version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalorderl (long double x, long double y)
+{
+ double xhi, xlo, yhi, ylo;
+ int64_t hx, hy, lx, ly;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint64_t hx_sign = hx >> 63;
+ uint64_t hy_sign = hy >> 63;
+ int64_t hx_adj = hx ^ (hx_sign >> 1);
+ int64_t hy_adj = hy ^ (hy_sign >> 1);
+ if (hx_adj < hy_adj)
+ return 1;
+ else if (hx_adj > hy_adj)
+ return 0;
+
+ /* The high doubles are identical. If they are NaNs or both the low
+ parts are zero, the low parts are not significant (and if they
+ are infinities, both the low parts must be zero). */
+ if ((hx & 0x7fffffffffffffffULL) >= 0x7ff0000000000000ULL)
+ return 1;
+ EXTRACT_WORDS64 (lx, xlo);
+ EXTRACT_WORDS64 (ly, ylo);
+ if (((lx | ly) & 0x7fffffffffffffffULL) == 0)
+ return 1;
+
+ /* Otherwise compare the low parts. */
+ uint64_t lx_sign = lx >> 63;
+ uint64_t ly_sign = ly >> 63;
+ lx ^= lx_sign >> 1;
+ ly ^= ly_sign >> 1;
+ return lx <= ly;
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
new file mode 100644
index 0000000000..739e23194e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
@@ -0,0 +1,64 @@
+/* Total order operation on absolute values. ldbl-128ibm version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalordermagl (long double x, long double y)
+{
+ double xhi, xlo, yhi, ylo;
+ int64_t hx, hy, lx, ly;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint64_t x_sign = hx & 0x8000000000000000ULL;
+ uint64_t y_sign = hy & 0x8000000000000000ULL;
+ hx ^= x_sign;
+ hy ^= y_sign;
+ if (hx < hy)
+ return 1;
+ else if (hx > hy)
+ return 0;
+
+ /* The high doubles are identical. If they are NaNs or both the low
+ parts are zero, the low parts are not significant (and if they
+ are infinities, both the low parts must be zero). */
+ if (hx >= 0x7ff0000000000000ULL)
+ return 1;
+ EXTRACT_WORDS64 (lx, xlo);
+ EXTRACT_WORDS64 (ly, ylo);
+ if (((lx | ly) & 0x7fffffffffffffffULL) == 0)
+ return 1;
+ lx ^= x_sign;
+ ly ^= y_sign;
+
+ /* Otherwise compare the low parts. */
+ uint64_t lx_sign = lx >> 63;
+ uint64_t ly_sign = ly >> 63;
+ lx ^= lx_sign >> 1;
+ ly ^= ly_sign >> 1;
+ return lx <= ly;
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c
new file mode 100644
index 0000000000..1fe1bc4555
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c
@@ -0,0 +1,230 @@
+/* Test iscanonical and canonicalizel for ldbl-128ibm.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+struct test
+{
+ double hi, lo;
+ bool canonical;
+};
+
+static const struct test tests[] =
+ {
+ { __builtin_nan (""), 0.0, true },
+ { __builtin_nan (""), DBL_MAX, true },
+ { __builtin_nan (""), __builtin_inf (), true },
+ { __builtin_nan (""), __builtin_nan (""), true },
+ { __builtin_nan (""), __builtin_nans (""), true },
+ { __builtin_nans (""), 0.0, true },
+ { __builtin_nans (""), DBL_MAX, true },
+ { __builtin_nans (""), __builtin_inf (), true },
+ { __builtin_nans (""), __builtin_nan (""), true },
+ { __builtin_nans (""), __builtin_nans (""), true },
+ { __builtin_inf (), 0.0, true },
+ { __builtin_inf (), -0.0, true },
+ { -__builtin_inf (), 0.0, true },
+ { -__builtin_inf (), -0.0, true },
+ { __builtin_inf (), DBL_TRUE_MIN, false },
+ { __builtin_inf (), -DBL_TRUE_MIN, false },
+ { -__builtin_inf (), DBL_TRUE_MIN, false },
+ { -__builtin_inf (), -DBL_TRUE_MIN, false },
+ { __builtin_inf (), DBL_MIN, false },
+ { __builtin_inf (), -DBL_MIN, false },
+ { -__builtin_inf (), DBL_MIN, false },
+ { -__builtin_inf (), -DBL_MIN, false },
+ { __builtin_inf (), __builtin_inf (), false },
+ { __builtin_inf (), -__builtin_inf (), false },
+ { -__builtin_inf (), __builtin_inf (), false },
+ { -__builtin_inf (), -__builtin_inf (), false },
+ { __builtin_inf (), __builtin_nan (""), false },
+ { __builtin_inf (), -__builtin_nan (""), false },
+ { -__builtin_inf (), __builtin_nan (""), false },
+ { -__builtin_inf (), -__builtin_nan (""), false },
+ { 0.0, 0.0, true },
+ { 0.0, -0.0, true },
+ { -0.0, 0.0, true },
+ { -0.0, -0.0, true },
+ { 0.0, DBL_TRUE_MIN, false },
+ { 0.0, -DBL_TRUE_MIN, false },
+ { -0.0, DBL_TRUE_MIN, false },
+ { -0.0, -DBL_TRUE_MIN, false },
+ { 0.0, DBL_MAX, false },
+ { 0.0, -DBL_MAX, false },
+ { -0.0, DBL_MAX, false },
+ { -0.0, -DBL_MAX, false },
+ { 0.0, __builtin_inf (), false },
+ { 0.0, -__builtin_inf (), false },
+ { -0.0, __builtin_inf (), false },
+ { -0.0, -__builtin_inf (), false },
+ { 0.0, __builtin_nan (""), false },
+ { 0.0, -__builtin_nan (""), false },
+ { -0.0, __builtin_nan (""), false },
+ { -0.0, -__builtin_nan (""), false },
+ { 1.0, 0.0, true },
+ { 1.0, -0.0, true },
+ { -1.0, 0.0, true },
+ { -1.0, -0.0, true },
+ { 1.0, DBL_TRUE_MIN, true },
+ { 1.0, -DBL_TRUE_MIN, true },
+ { -1.0, DBL_TRUE_MIN, true },
+ { -1.0, -DBL_TRUE_MIN, true },
+ { 1.0, DBL_MAX, false },
+ { 1.0, -DBL_MAX, false },
+ { -1.0, DBL_MAX, false },
+ { -1.0, -DBL_MAX, false },
+ { 1.0, __builtin_inf (), false },
+ { 1.0, -__builtin_inf (), false },
+ { -1.0, __builtin_inf (), false },
+ { -1.0, -__builtin_inf (), false },
+ { 1.0, __builtin_nan (""), false },
+ { 1.0, -__builtin_nan (""), false },
+ { -1.0, __builtin_nan (""), false },
+ { -1.0, -__builtin_nan (""), false },
+ { 0x1p1023, 0x1.1p969, true },
+ { 0x1p1023, -0x1.1p969, true },
+ { -0x1p1023, 0x1.1p969, true },
+ { -0x1p1023, -0x1.1p969, true },
+ { 0x1p1023, 0x1.1p970, false },
+ { 0x1p1023, -0x1.1p970, false },
+ { -0x1p1023, 0x1.1p970, false },
+ { -0x1p1023, -0x1.1p970, false },
+ { 0x1p1023, 0x1p970, true },
+ { 0x1p1023, -0x1p970, true },
+ { -0x1p1023, 0x1p970, true },
+ { -0x1p1023, -0x1p970, true },
+ { 0x1.0000000000001p1023, 0x1p970, false },
+ { 0x1.0000000000001p1023, -0x1p970, false },
+ { -0x1.0000000000001p1023, 0x1p970, false },
+ { -0x1.0000000000001p1023, -0x1p970, false },
+ { 0x1p-969, 0x1.1p-1023, true },
+ { 0x1p-969, -0x1.1p-1023, true },
+ { -0x1p-969, 0x1.1p-1023, true },
+ { -0x1p-969, -0x1.1p-1023, true },
+ { 0x1p-969, 0x1.1p-1022, false },
+ { 0x1p-969, -0x1.1p-1022, false },
+ { -0x1p-969, 0x1.1p-1022, false },
+ { -0x1p-969, -0x1.1p-1022, false },
+ { 0x1p-969, 0x1p-1022, true },
+ { 0x1p-969, -0x1p-1022, true },
+ { -0x1p-969, 0x1p-1022, true },
+ { -0x1p-969, -0x1p-1022, true },
+ { 0x1.0000000000001p-969, 0x1p-1022, false },
+ { 0x1.0000000000001p-969, -0x1p-1022, false },
+ { -0x1.0000000000001p-969, 0x1p-1022, false },
+ { -0x1.0000000000001p-969, -0x1p-1022, false },
+ { 0x1p-970, 0x1.1p-1024, true },
+ { 0x1p-970, -0x1.1p-1024, true },
+ { -0x1p-970, 0x1.1p-1024, true },
+ { -0x1p-970, -0x1.1p-1024, true },
+ { 0x1p-970, 0x1.1p-1023, false },
+ { 0x1p-970, -0x1.1p-1023, false },
+ { -0x1p-970, 0x1.1p-1023, false },
+ { -0x1p-970, -0x1.1p-1023, false },
+ { 0x1p-970, 0x1p-1023, true },
+ { 0x1p-970, -0x1p-1023, true },
+ { -0x1p-970, 0x1p-1023, true },
+ { -0x1p-970, -0x1p-1023, true },
+ { 0x1.0000000000001p-970, 0x1p-1023, false },
+ { 0x1.0000000000001p-970, -0x1p-1023, false },
+ { -0x1.0000000000001p-970, 0x1p-1023, false },
+ { -0x1.0000000000001p-970, -0x1p-1023, false },
+ { 0x1p-1000, 0x1.1p-1054, true },
+ { 0x1p-1000, -0x1.1p-1054, true },
+ { -0x1p-1000, 0x1.1p-1054, true },
+ { -0x1p-1000, -0x1.1p-1054, true },
+ { 0x1p-1000, 0x1.1p-1053, false },
+ { 0x1p-1000, -0x1.1p-1053, false },
+ { -0x1p-1000, 0x1.1p-1053, false },
+ { -0x1p-1000, -0x1.1p-1053, false },
+ { 0x1p-1000, 0x1p-1053, true },
+ { 0x1p-1000, -0x1p-1053, true },
+ { -0x1p-1000, 0x1p-1053, true },
+ { -0x1p-1000, -0x1p-1053, true },
+ { 0x1.0000000000001p-1000, 0x1p-1053, false },
+ { 0x1.0000000000001p-1000, -0x1p-1053, false },
+ { -0x1.0000000000001p-1000, 0x1p-1053, false },
+ { -0x1.0000000000001p-1000, -0x1p-1053, false },
+ { 0x1p-1021, 0x1p-1074, true },
+ { 0x1p-1021, -0x1p-1074, true },
+ { -0x1p-1021, 0x1p-1074, true },
+ { -0x1p-1021, -0x1p-1074, true },
+ { 0x1.0000000000001p-1021, 0x1p-1074, false },
+ { 0x1.0000000000001p-1021, -0x1p-1074, false },
+ { -0x1.0000000000001p-1021, 0x1p-1074, false },
+ { -0x1.0000000000001p-1021, -0x1p-1074, false },
+ { 0x1p-1022, 0x1p-1074, false },
+ { 0x1p-1022, -0x1p-1074, false },
+ { -0x1p-1022, 0x1p-1074, false },
+ { -0x1p-1022, -0x1p-1074, false },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ld = ldbl_pack (tests[i].hi, tests[i].lo);
+ bool canonical = iscanonical (ld);
+ if (canonical == tests[i].canonical)
+ {
+ printf ("PASS: iscanonical test %zu\n", i);
+ long double ldc = 12345.0L;
+ bool canonicalize_ret = canonicalizel (&ldc, &ld);
+ if (canonicalize_ret == !canonical)
+ {
+ printf ("PASS: canonicalizel test %zu\n", i);
+ bool canon_ok;
+ if (!canonical)
+ canon_ok = ldc == 12345.0L;
+ else if (isnan (ld))
+ canon_ok = isnan (ldc) && !issignaling (ldc);
+ else
+ canon_ok = ldc == ld;
+ if (canon_ok)
+ printf ("PASS: canonicalized value test %zu\n", i);
+ else
+ {
+ printf ("FAIL: canonicalized value test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: canonicalizel test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: iscanonical test %zu\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
new file mode 100644
index 0000000000..8e61a89f53
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
@@ -0,0 +1,73 @@
+/* Test totalorderl and totalordermagl for ldbl-128ibm.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+struct test
+{
+ double hi, lo1, lo2;
+};
+
+static const struct test tests[] =
+ {
+ { __builtin_nan (""), 1, __builtin_nans ("") },
+ { -__builtin_nan (""), 1, __builtin_nans ("") },
+ { __builtin_nans (""), 1, __builtin_nan ("") },
+ { -__builtin_nans (""), 1, __builtin_nan ("") },
+ { __builtin_inf (), 0.0, -0.0 },
+ { -__builtin_inf (), 0.0, -0.0 },
+ { 1.5, 0.0, -0.0 },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ldx = ldbl_pack (tests[i].hi, tests[i].lo1);
+ long double ldy = ldbl_pack (tests[i].hi, tests[i].lo2);
+ bool to1 = totalorderl (ldx, ldy);
+ bool to2 = totalorderl (ldy, ldx);
+ if (to1 && to2)
+ printf ("PASS: test %zu\n", i);
+ else
+ {
+ printf ("FAIL: test %zu\n", i);
+ result = 1;
+ }
+ to1 = totalordermagl (ldx, ldy);
+ to2 = totalordermagl (ldy, ldx);
+ if (to1 && to2)
+ printf ("PASS: test %zu (totalordermagl)\n", i);
+ else
+ {
+ printf ("FAIL: test %zu (totalordermagl)\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
index da2e929175..a8b489530d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
@@ -18,7 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_split.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -33,36 +33,6 @@ add_split (double *hi, double *lo, double x, double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile
new file mode 100644
index 0000000000..dcbfbbac25
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/Makefile
@@ -0,0 +1,21 @@
+# Makefile for sysdeps/ieee754/ldbl-96.
+# Copyright (C) 2016 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, see
+# <http://www.gnu.org/licenses/>.
+
+ifeq ($(subdir),math)
+tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96
+endif
diff --git a/sysdeps/ieee754/ldbl-96/bits/iscanonical.h b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
new file mode 100644
index 0000000000..af0c72cc7f
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
@@ -0,0 +1,35 @@
+/* Define iscanonical macro. ldbl-96 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
+#endif
+
+extern int __iscanonicall (long double __x)
+ __THROW __attribute__ ((__const__));
+
+/* Return nonzero value if X is canonical. In IEEE interchange binary
+ formats, all values are canonical, but the argument must still be
+ converted to its semantic type for any exceptions arising from the
+ conversion, before being discarded; in extended precision, there
+ are encodings that are not consistently handled as corresponding to
+ any particular value of the type, and we return 0 for those. */
+#define iscanonical(x) \
+ (sizeof (x) == sizeof (long double) \
+ ? __iscanonicall (x) \
+ : ((void) (__typeof (x)) (x), 1))
diff --git a/sysdeps/ieee754/ldbl-96/gamma_productl.c b/sysdeps/ieee754/ldbl-96/gamma_productl.c
index 849b57d95d..8ad045263b 100644
--- a/sysdeps/ieee754/ldbl-96/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-96/gamma_productl.c
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of X + X_EPS, X + X_EPS + 1, ..., X + X_EPS + N
- 1, in the form R * (1 + *EPS) where the return value R is an
@@ -68,7 +38,7 @@ __gamma_productl (long double x, long double x_eps, int n, long double *eps)
{
*eps += x_eps / (x + i);
long double lo;
- mul_split (&ret, &lo, ret, x + i);
+ mul_splitl (&ret, &lo, ret, x + i);
*eps += lo / ret;
}
return ret;
diff --git a/sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h b/sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h
new file mode 100644
index 0000000000..bee080bd29
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h
@@ -0,0 +1,5 @@
+#include_next <bits/iscanonical.h>
+
+#ifndef _ISOMAC
+libm_hidden_proto (__iscanonicall)
+#endif
diff --git a/sysdeps/ieee754/ldbl-96/lgamma_productl.c b/sysdeps/ieee754/ldbl-96/lgamma_productl.c
index de67cbe665..9aa0137fbb 100644
--- a/sysdeps/ieee754/ldbl-96/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-96/lgamma_productl.c
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of 1 + (T / (X + X_EPS)), 1 + (T / (X + X_EPS +
1)), ..., 1 + (T / (X + X_EPS + N - 1)), minus 1. X is such that
@@ -65,11 +35,11 @@ __lgamma_productl (long double t, long double x, long double x_eps, int n)
long double xi = x + i;
long double quot = t / xi;
long double mhi, mlo;
- mul_split (&mhi, &mlo, quot, xi);
+ mul_splitl (&mhi, &mlo, quot, xi);
long double quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
/* We want (1 + RET + RET_EPS) * (1 + QUOT + QUOT_LO) - 1. */
long double rhi, rlo;
- mul_split (&rhi, &rlo, ret, quot);
+ mul_splitl (&rhi, &rlo, ret, quot);
long double rpq = ret + quot;
long double rpq_eps = (ret - rpq) + quot;
long double nret = rpq + rhi;
diff --git a/math/cargl.c b/sysdeps/ieee754/ldbl-96/s_getpayloadl.c
index 31b72924e9..3ef90d07de 100644
--- a/math/cargl.c
+++ b/sysdeps/ieee754/ldbl-96/s_getpayloadl.c
@@ -1,7 +1,6 @@
-/* Compute argument of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Get NaN payload. ldbl-96 version.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,12 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <complex.h>
#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
long double
-__cargl (__complex__ long double x)
+getpayloadl (const long double *x)
{
- return __atan2l (__imag__ x, __real__ x);
+ uint16_t se __attribute__ ((unused));
+ uint32_t hx, lx;
+ GET_LDOUBLE_WORDS (se, hx, lx, *x);
+ hx &= 0x3fffffff;
+ uint64_t ix = ((uint64_t) hx << 32) | lx;
+ return (long double) ix;
}
-weak_alias (__cargl, cargl)
diff --git a/sysdeps/ieee754/ldbl-96/s_iscanonicall.c b/sysdeps/ieee754/ldbl-96/s_iscanonicall.c
new file mode 100644
index 0000000000..91ce80d4f1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_iscanonicall.c
@@ -0,0 +1,44 @@
+/* Test whether long double value is canonical. ldbl-96 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+int
+__iscanonicall (long double x)
+{
+ uint32_t se, i0, i1 __attribute__ ((unused));
+
+ GET_LDOUBLE_WORDS (se, i0, i1, x);
+ int32_t ix = se & 0x7fff;
+ bool mant_high = (i0 & 0x80000000) != 0;
+
+ if (LDBL_MIN_EXP == -16381)
+ /* Intel variant: the high mantissa bit should have a value
+ determined by the exponent. */
+ return ix > 0 ? mant_high : !mant_high;
+ else
+ /* M68K variant: both values of the high bit are valid for the
+ greatest and smallest exponents, while other exponents require
+ the high bit to be set. */
+ return ix == 0 || ix == 0x7fff || mant_high;
+}
+libm_hidden_def (__iscanonicall)
diff --git a/sysdeps/ieee754/ldbl-96/s_issignalingl.c b/sysdeps/ieee754/ldbl-96/s_issignalingl.c
index 73646cac0c..364e5db222 100644
--- a/sysdeps/ieee754/ldbl-96/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-96/s_issignalingl.c
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignalingl (long double x)
{
u_int32_t exi, hxi, lxi;
GET_LDOUBLE_WORDS (exi, hxi, lxi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
# error not implemented
#else
/* To keep the following comparison simple, toggle the quiet/signaling bit,
diff --git a/sysdeps/ieee754/ldbl-96/s_totalorderl.c b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
new file mode 100644
index 0000000000..ddc28b84b0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
@@ -0,0 +1,57 @@
+/* Total order operation. ldbl-96 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalorderl (long double x, long double y)
+{
+ int16_t expx, expy;
+ uint32_t hx, hy;
+ uint32_t lx, ly;
+ GET_LDOUBLE_WORDS (expx, hx, lx, x);
+ GET_LDOUBLE_WORDS (expy, hy, ly, y);
+ if (LDBL_MIN_EXP == -16382)
+ {
+ /* M68K variant: for the greatest exponent, the high mantissa
+ bit is not significant and both values of it are valid, so
+ set it before comparing. For the Intel variant, only one
+ value of the high mantissa bit is valid for each exponent, so
+ this is not necessary. */
+ if ((expx & 0x7fff) == 0x7fff)
+ hx |= 0x80000000;
+ if ((expy & 0x7fff) == 0x7fff)
+ hy |= 0x80000000;
+ }
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint32_t x_sign = expx >> 15;
+ uint32_t y_sign = expy >> 15;
+ expx ^= x_sign >> 17;
+ hx ^= x_sign;
+ lx ^= x_sign;
+ expy ^= y_sign >> 17;
+ hy ^= y_sign;
+ ly ^= y_sign;
+ return expx < expy || (expx == expy && (hx < hy || (hx == hy && lx <= ly)));
+}
diff --git a/sysdeps/ieee754/ldbl-96/s_totalordermagl.c b/sysdeps/ieee754/ldbl-96/s_totalordermagl.c
new file mode 100644
index 0000000000..4ca28e7527
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_totalordermagl.c
@@ -0,0 +1,51 @@
+/* Total order operation on absolute values. ldbl-96 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+totalordermagl (long double x, long double y)
+{
+ uint16_t expx, expy;
+ uint32_t hx, hy;
+ uint32_t lx, ly;
+ GET_LDOUBLE_WORDS (expx, hx, lx, x);
+ GET_LDOUBLE_WORDS (expy, hy, ly, y);
+ expx &= 0x7fff;
+ expy &= 0x7fff;
+ if (LDBL_MIN_EXP == -16382)
+ {
+ /* M68K variant: for the greatest exponent, the high mantissa
+ bit is not significant and both values of it are valid, so
+ set it before comparing. For the Intel variant, only one
+ value of the high mantissa bit is valid for each exponent, so
+ this is not necessary. */
+ if (expx == 0x7fff)
+ hx |= 0x80000000;
+ if (expy == 0x7fff)
+ hy |= 0x80000000;
+ }
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ return expx < expy || (expx == expy && (hx < hy || (hx == hy && lx <= ly)));
+}
diff --git a/sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c b/sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c
new file mode 100644
index 0000000000..ce6dc5b3fa
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c
@@ -0,0 +1,141 @@
+/* Test iscanonical and canonicalizel for ldbl-96.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+struct test
+{
+ bool sign;
+ uint16_t exponent;
+ bool high;
+ uint64_t mantissa;
+ bool canonical;
+};
+
+#define M68K_VARIANT (LDBL_MIN_EXP == -16382)
+
+static const struct test tests[] =
+ {
+ { false, 0, true, 0, M68K_VARIANT },
+ { true, 0, true, 0, M68K_VARIANT },
+ { false, 0, true, 1, M68K_VARIANT },
+ { true, 0, true, 1, M68K_VARIANT },
+ { false, 0, true, 0x100000000ULL, M68K_VARIANT },
+ { true, 0, true, 0x100000000ULL, M68K_VARIANT },
+ { false, 0, false, 0, true },
+ { true, 0, false, 0, true },
+ { false, 0, false, 1, true },
+ { true, 0, false, 1, true },
+ { false, 0, false, 0x100000000ULL, true },
+ { true, 0, false, 0x100000000ULL, true },
+ { false, 1, true, 0, true },
+ { true, 1, true, 0, true },
+ { false, 1, true, 1, true },
+ { true, 1, true, 1, true },
+ { false, 1, true, 0x100000000ULL, true },
+ { true, 1, true, 0x100000000ULL, true },
+ { false, 1, false, 0, false },
+ { true, 1, false, 0, false },
+ { false, 1, false, 1, false },
+ { true, 1, false, 1, false },
+ { false, 1, false, 0x100000000ULL, false },
+ { true, 1, false, 0x100000000ULL, false },
+ { false, 0x7ffe, true, 0, true },
+ { true, 0x7ffe, true, 0, true },
+ { false, 0x7ffe, true, 1, true },
+ { true, 0x7ffe, true, 1, true },
+ { false, 0x7ffe, true, 0x100000000ULL, true },
+ { true, 0x7ffe, true, 0x100000000ULL, true },
+ { false, 0x7ffe, false, 0, false },
+ { true, 0x7ffe, false, 0, false },
+ { false, 0x7ffe, false, 1, false },
+ { true, 0x7ffe, false, 1, false },
+ { false, 0x7ffe, false, 0x100000000ULL, false },
+ { true, 0x7ffe, false, 0x100000000ULL, false },
+ { false, 0x7fff, true, 0, true },
+ { true, 0x7fff, true, 0, true },
+ { false, 0x7fff, true, 1, true },
+ { true, 0x7fff, true, 1, true },
+ { false, 0x7fff, true, 0x100000000ULL, true },
+ { true, 0x7fff, true, 0x100000000ULL, true },
+ { false, 0x7fff, false, 0, M68K_VARIANT },
+ { true, 0x7fff, false, 0, M68K_VARIANT },
+ { false, 0x7fff, false, 1, M68K_VARIANT },
+ { true, 0x7fff, false, 1, M68K_VARIANT },
+ { false, 0x7fff, false, 0x100000000ULL, M68K_VARIANT },
+ { true, 0x7fff, false, 0x100000000ULL, M68K_VARIANT },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ld;
+ SET_LDOUBLE_WORDS (ld, tests[i].exponent | (tests[i].sign << 15),
+ (tests[i].mantissa >> 32) | (tests[i].high << 31),
+ tests[i].mantissa & 0xffffffffULL);
+ bool canonical = iscanonical (ld);
+ if (canonical == tests[i].canonical)
+ {
+ printf ("PASS: iscanonical test %zu\n", i);
+ long double ldc = 12345.0L;
+ bool canonicalize_ret = canonicalizel (&ldc, &ld);
+ if (canonicalize_ret == !canonical)
+ {
+ printf ("PASS: canonicalizel test %zu\n", i);
+ bool canon_ok;
+ if (!canonical)
+ canon_ok = ldc == 12345.0L;
+ else if (isnan (ld))
+ canon_ok = isnan (ldc) && !issignaling (ldc);
+ else
+ canon_ok = ldc == ld;
+ if (canon_ok)
+ printf ("PASS: canonicalized value test %zu\n", i);
+ else
+ {
+ printf ("FAIL: canonicalized value test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: canonicalizel test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: iscanonical test %zu\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c b/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c
new file mode 100644
index 0000000000..6afc1b5c1b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c
@@ -0,0 +1,82 @@
+/* Test totalorderl and totalordermagl for ldbl-96.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+static const uint64_t tests[] =
+ {
+ 0, 1, 0x4000000000000000ULL, 0x4000000000000001ULL,
+ 0x7fffffffffffffffULL
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ if (LDBL_MIN_EXP == -16382)
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ldx, ldy, ldnx, ldny;
+ /* Verify that the high bit of the mantissa is ignored for
+ infinities and NaNs for the M68K variant of this
+ format. */
+ SET_LDOUBLE_WORDS (ldx, 0x7fff,
+ tests[i] >> 32, tests[i] & 0xffffffffULL);
+ SET_LDOUBLE_WORDS (ldy, 0x7fff,
+ (tests[i] >> 32) | 0x80000000,
+ tests[i] & 0xffffffffULL);
+ SET_LDOUBLE_WORDS (ldnx, 0xffff,
+ tests[i] >> 32, tests[i] & 0xffffffffULL);
+ SET_LDOUBLE_WORDS (ldny, 0xffff,
+ (tests[i] >> 32) | 0x80000000,
+ tests[i] & 0xffffffffULL);
+ bool to1 = totalorderl (ldx, ldy);
+ bool to2 = totalorderl (ldy, ldx);
+ bool to3 = totalorderl (ldnx, ldny);
+ bool to4 = totalorderl (ldny, ldnx);
+ if (to1 && to2 && to3 && to4)
+ printf ("PASS: test %zu\n", i);
+ else
+ {
+ printf ("FAIL: test %zu\n", i);
+ result = 1;
+ }
+ to1 = totalordermagl (ldx, ldy);
+ to2 = totalordermagl (ldy, ldx);
+ to3 = totalordermagl (ldnx, ldny);
+ to4 = totalordermagl (ldny, ldnx);
+ if (to1 && to2 && to3 && to4)
+ printf ("PASS: test %zu (totalordermagl)\n", i);
+ else
+ {
+ printf ("FAIL: test %zu (totalordermagl)\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-96/x2y2m1l.c b/sysdeps/ieee754/ldbl-96/x2y2m1l.c
index 733742da04..b86ba1ce17 100644
--- a/sysdeps/ieee754/ldbl-96/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-96/x2y2m1l.c
@@ -18,7 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_splitl.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -33,36 +33,6 @@ add_split (long double *hi, long double *lo, long double x, long double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
@@ -88,8 +58,8 @@ __x2y2m1l (long double x, long double y)
{
long double vals[5];
SET_RESTORE_ROUNDL (FE_TONEAREST);
- mul_split (&vals[1], &vals[0], x, x);
- mul_split (&vals[3], &vals[2], y, y);
+ mul_splitl (&vals[1], &vals[0], x, x);
+ mul_splitl (&vals[3], &vals[2], y, y);
vals[4] = -1.0L;
qsort (vals, 5, sizeof (long double), compare);
/* Add up the values so that each element of VALS has absolute value
diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
index af08209570..745fa4c8cf 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -24,6 +24,7 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
vdprintf_chk obstack_printf_chk obstack_vprintf_chk \
syslog syslog_chk vsyslog vsyslog_chk \
strfmon strfmon_l \
+ strfroml \
strtold strtold_l strtoldint wcstold wcstold_l wcstoldint \
qecvt qfcvt qgcvt qecvt_r qfcvt_r \
isinf isnan finite signbit scalb log2 lgamma_r ceil \
@@ -41,7 +42,8 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
isoc99_vscanf isoc99_vfscanf isoc99_vsscanf \
isoc99_wscanf isoc99_fwscanf isoc99_swscanf \
isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf \
- nextup nextdown
+ nextup nextdown totalorder totalordermag getpayload \
+ canonicalize
libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
libnldbl-inhibit-o = $(object-suffixes)
libnldbl-static-only-routines = $(libnldbl-routines)
@@ -57,6 +59,7 @@ CFLAGS-nldbl-atanh.c = -fno-builtin-atanhl
CFLAGS-nldbl-cabs.c = -fno-builtin-cabsl
CFLAGS-nldbl-cacos.c = -fno-builtin-cacosl
CFLAGS-nldbl-cacosh.c = -fno-builtin-cacoshl
+CFLAGS-nldbl-canonicalize.c = -fno-builtin-canonicalizel
CFLAGS-nldbl-carg.c = -fno-builtin-cargl
CFLAGS-nldbl-casin.c = -fno-builtin-casinl
CFLAGS-nldbl-casinh.c = -fno-builtin-casinhl
@@ -98,6 +101,7 @@ CFLAGS-nldbl-fmin.c = -fno-builtin-fminl
CFLAGS-nldbl-fmod.c = -fno-builtin-fmodl
CFLAGS-nldbl-frexp.c = -fno-builtin-frexpl
CFLAGS-nldbl-gamma.c = -fno-builtin-gammal
+CFLAGS-nldbl-getpayload.c = -fno-builtin-getpayloadl
CFLAGS-nldbl-hypot.c = -fno-builtin-hypotl
CFLAGS-nldbl-ilogb.c = -fno-builtin-ilogbl
CFLAGS-nldbl-isinf.c = -fno-builtin-isinfl
@@ -142,6 +146,8 @@ CFLAGS-nldbl-sqrt.c = -fno-builtin-sqrtl
CFLAGS-nldbl-tan.c = -fno-builtin-tanl
CFLAGS-nldbl-tanh.c = -fno-builtin-tanhl
CFLAGS-nldbl-tgamma.c = -fno-builtin-tgammal
+CFLAGS-nldbl-totalorder.c = -fno-builtin-totalorderl
+CFLAGS-nldbl-totalordermag.c = -fno-builtin-totalordermagl
CFLAGS-nldbl-trunc.c = -fno-builtin-truncl
CFLAGS-nldbl-y0.c = -fno-builtin-y0l
CFLAGS-nldbl-y1.c = -fno-builtin-y1l
diff --git a/sysdeps/ieee754/ldbl-opt/cabs.c b/sysdeps/ieee754/ldbl-opt/cabs.c
deleted file mode 100644
index a181de2fa8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cabs.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/cabs.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cabs, cabsl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cabsl.c b/sysdeps/ieee754/ldbl-opt/cabsl.c
deleted file mode 100644
index b861633544..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cabsl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cabsl.c>
-long_double_symbol (libm, __cabsl, cabsl);
diff --git a/sysdeps/ieee754/ldbl-opt/carg.c b/sysdeps/ieee754/ldbl-opt/carg.c
deleted file mode 100644
index 2ed358113c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/carg.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/carg.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __carg, cargl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cargl.c b/sysdeps/ieee754/ldbl-opt/cargl.c
deleted file mode 100644
index 952dc60664..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cargl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cargl.c>
-long_double_symbol (libm, __cargl, cargl);
diff --git a/sysdeps/ieee754/ldbl-opt/cimag.c b/sysdeps/ieee754/ldbl-opt/cimag.c
deleted file mode 100644
index f8052581b3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cimag.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/cimag.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cimag, cimagl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cimagl.c b/sysdeps/ieee754/ldbl-opt/cimagl.c
deleted file mode 100644
index 112365e3ae..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cimagl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cimagl.c>
-long_double_symbol (libm, __cimagl, cimagl);
diff --git a/sysdeps/ieee754/ldbl-opt/conj.c b/sysdeps/ieee754/ldbl-opt/conj.c
deleted file mode 100644
index e4edade05e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/conj.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/conj.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __conj, conjl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/conjl.c b/sysdeps/ieee754/ldbl-opt/conjl.c
deleted file mode 100644
index c98e0ed1c3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/conjl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/conjl.c>
-long_double_symbol (libm, __conjl, conjl);
diff --git a/sysdeps/ieee754/ldbl-opt/creal.c b/sysdeps/ieee754/ldbl-opt/creal.c
deleted file mode 100644
index 0d1c93e640..0000000000
--- a/sysdeps/ieee754/ldbl-opt/creal.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/creal.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __creal, creall, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/creall.c b/sysdeps/ieee754/ldbl-opt/creall.c
deleted file mode 100644
index 68fedd4ccd..0000000000
--- a/sysdeps/ieee754/ldbl-opt/creall.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/creall.c>
-long_double_symbol (libm, __creall, creall);
diff --git a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
new file mode 100644
index 0000000000..2569607283
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
@@ -0,0 +1,66 @@
+/* Overrides for ldbl-opt versioning for double types.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_TYPE_MACROS_DOUBLE
+
+#include <math_ldbl_opt.h>
+
+#define LDOUBLE_cabsl_libm_version GLIBC_2_1
+#define LDOUBLE_cargl_libm_version GLIBC_2_1
+#define LDOUBLE_cimagl_libm_version GLIBC_2_1
+#define LDOUBLE_conjl_libm_version GLIBC_2_1
+#define LDOUBLE_creall_libm_version GLIBC_2_1
+#define LDOUBLE_cacosl_libm_version GLIBC_2_1
+#define LDOUBLE_cacoshl_libm_version GLIBC_2_1
+#define LDOUBLE_ccosl_libm_version GLIBC_2_1
+#define LDOUBLE_ccoshl_libm_version GLIBC_2_1
+#define LDOUBLE_casinl_libm_version GLIBC_2_1
+#define LDOUBLE_csinl_libm_version GLIBC_2_1
+#define LDOUBLE_casinhl_libm_version GLIBC_2_1
+#define LDOUBLE_csinhl_libm_version GLIBC_2_1
+#define LDOUBLE_catanl_libm_version GLIBC_2_1
+#define LDOUBLE_catanhl_libm_version GLIBC_2_1
+#define LDOUBLE_ctanl_libm_version GLIBC_2_1
+#define LDOUBLE_ctanhl_libm_version GLIBC_2_1
+#define LDOUBLE_cexpl_libm_version GLIBC_2_1
+#define LDOUBLE_clogl_libm_version GLIBC_2_1
+#define LDOUBLE_cprojl_libm_version GLIBC_2_1
+#define LDOUBLE_csqrtl_libm_version GLIBC_2_1
+#define LDOUBLE_cpowl_libm_version GLIBC_2_1
+#define LDOUBLE_clog10l_libm_version GLIBC_2_1
+#define LDOUBLE___clog10l_libm_version GLIBC_2_1
+#define LDOUBLE_fdiml_libm_version GLIBC_2_1
+#define LDOUBLE_fmaxl_libm_version GLIBC_2_1
+#define LDOUBLE_fminl_libm_version GLIBC_2_1
+#define LDOUBLE_nanl_libm_version GLIBC_2_1
+
+/* Define compat symbols for long double on platforms
+ where it was not always a distinct type. */
+#if !defined M_LIBM_NEED_COMPAT
+# define M_LIBM_NEED_COMPAT(f) \
+ LONG_DOUBLE_COMPAT (libm, LDOUBLE_ ## f ## l_libm_version)
+#endif
+
+#if !defined declare_mgen_libm_compat
+# define declare_mgen_libm_compat(from, to) \
+ compat_symbol (libm, from, to ## l, \
+ LDOUBLE_ ## to ## l_libm_version);
+#endif
+
+#include_next <math-type-macros-double.h>
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h b/sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h
new file mode 100644
index 0000000000..ae3713d49d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h
@@ -0,0 +1,31 @@
+/* Overrides for ldbl-opt versioning for long double types.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_TYPE_MACROS_LDOUBLE
+
+#include <math_ldbl_opt.h>
+
+/* Use properly versioned symbols for long double on platforms where
+ it was not always a distinct type. */
+#if !defined declare_mgen_alias
+# define declare_mgen_alias(from, to) \
+ long_double_symbol (libm, from ## l, to ## l);
+#endif
+
+#include_next <math-type-macros-ldouble.h>
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c b/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c
new file mode 100644
index 0000000000..3b33d5c57e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for canonicalize.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+canonicalizel (double *cx, double *x)
+{
+ return canonicalize (cx, x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c b/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c
new file mode 100644
index 0000000000..3cdad0b2d6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for getpayload.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+getpayloadl (const double *x)
+{
+ return getpayload (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c b/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c
new file mode 100644
index 0000000000..d6df69e418
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c
@@ -0,0 +1,8 @@
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+strfroml (char *dest, size_t size, const char *format, long double f)
+{
+ return strfromd (dest, size, format, f);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
new file mode 100644
index 0000000000..0be5a6d07e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for totalorder.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+totalorderl (double x, double y)
+{
+ return totalorder (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c
new file mode 100644
index 0000000000..2780383aea
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for totalordermag.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+totalordermagl (double x, double y)
+{
+ return totalordermag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacos.c b/sysdeps/ieee754/ldbl-opt/s_cacos.c
deleted file mode 100644
index db90a9ef18..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacos.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cacos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cacos, cacosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacosh.c b/sysdeps/ieee754/ldbl-opt/s_cacosh.c
deleted file mode 100644
index e68049d46d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacosh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cacosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cacosh, cacoshl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacoshl.c b/sysdeps/ieee754/ldbl-opt/s_cacoshl.c
deleted file mode 100644
index ed4a299845..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacoshl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cacoshl.c>
-long_double_symbol (libm, __cacoshl, cacoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacosl.c b/sysdeps/ieee754/ldbl-opt/s_cacosl.c
deleted file mode 100644
index 9b840054e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacosl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cacosl.c>
-long_double_symbol (libm, __cacosl, cacosl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_canonicalizel.c b/sysdeps/ieee754/ldbl-opt/s_canonicalizel.c
new file mode 100644
index 0000000000..d5d67dfe0c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/s_canonicalizel.c
@@ -0,0 +1,5 @@
+/* canonicalizel is not subject to complex aliasing rules. It was
+ added in glibc 2.25. */
+#define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
+#include <math-type-macros-ldouble.h>
+#include <s_canonicalize_template.c>
diff --git a/sysdeps/ieee754/ldbl-opt/s_casin.c b/sysdeps/ieee754/ldbl-opt/s_casin.c
deleted file mode 100644
index 04c47ca602..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casin.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_casin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __casin, casinl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinh.c b/sysdeps/ieee754/ldbl-opt/s_casinh.c
deleted file mode 100644
index 19c4fa30f8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_casinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __casinh, casinhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinhl.c b/sysdeps/ieee754/ldbl-opt/s_casinhl.c
deleted file mode 100644
index 976fa8e5b0..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_casinhl.c>
-long_double_symbol (libm, __casinhl, casinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinl.c b/sysdeps/ieee754/ldbl-opt/s_casinl.c
deleted file mode 100644
index 7afb77cd4d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_casinl.c>
-long_double_symbol (libm, __casinl, casinl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_catan.c b/sysdeps/ieee754/ldbl-opt/s_catan.c
deleted file mode 100644
index 19f61736d2..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catan.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_catan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __catan, catanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanh.c b/sysdeps/ieee754/ldbl-opt/s_catanh.c
deleted file mode 100644
index cff7861444..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_catanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __catanh, catanhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanhl.c b/sysdeps/ieee754/ldbl-opt/s_catanhl.c
deleted file mode 100644
index e9562825e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_catanhl.c>
-long_double_symbol (libm, __catanhl, catanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanl.c b/sysdeps/ieee754/ldbl-opt/s_catanl.c
deleted file mode 100644
index ee2fdf5d6c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_catanl.c>
-long_double_symbol (libm, __catanl, catanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccos.c b/sysdeps/ieee754/ldbl-opt/s_ccos.c
deleted file mode 100644
index 2c43c7f392..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccos.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ccos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ccos, ccosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccosh.c b/sysdeps/ieee754/ldbl-opt/s_ccosh.c
deleted file mode 100644
index 3753cd56bc..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccosh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ccosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ccosh, ccoshl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccoshl.c b/sysdeps/ieee754/ldbl-opt/s_ccoshl.c
deleted file mode 100644
index 9f0c1e1a32..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccoshl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ccoshl.c>
-long_double_symbol (libm, __ccoshl, ccoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccosl.c b/sysdeps/ieee754/ldbl-opt/s_ccosl.c
deleted file mode 100644
index e93e80538e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccosl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ccosl.c>
-long_double_symbol (libm, __ccosl, ccosl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cexp.c b/sysdeps/ieee754/ldbl-opt/s_cexp.c
deleted file mode 100644
index d983c96b7b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cexp.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cexp.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cexp, cexpl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cexpl.c b/sysdeps/ieee754/ldbl-opt/s_cexpl.c
deleted file mode 100644
index d5ae1fc0d0..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cexpl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cexpl.c>
-long_double_symbol (libm, __cexpl, cexpl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog.c b/sysdeps/ieee754/ldbl-opt/s_clog.c
deleted file mode 100644
index 3e0e90cf89..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_clog.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_clog.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __clog, clogl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog10.c b/sysdeps/ieee754/ldbl-opt/s_clog10.c
deleted file mode 100644
index ac3f4a3a71..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_clog10.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_clog10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __clog10, __clog10l, GLIBC_2_1);
-compat_symbol (libm, clog10, clog10l, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog10l.c b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
index 954f68095a..6ebd6dd72d 100644
--- a/sysdeps/ieee754/ldbl-opt/s_clog10l.c
+++ b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
@@ -1,10 +1,31 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#define __clog10l __clog10l_internal
-#include <math/s_clog10l.c>
-#undef __clog10l
+/* clog10l alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define M_DECL_FUNC(x) __clog10l_internal
+#include <math-type-macros-ldouble.h>
+
+#undef declare_mgen_alias
+#define declare_mgen_alias(from, to)
+
+#include <s_clog10_template.c>
+
+/* __clog10l is also a public symbol. */
strong_alias (__clog10l_internal, __clog10l__internal)
long_double_symbol (libm, __clog10l_internal, __clog10l);
long_double_symbol (libm, __clog10l__internal, clog10l);
diff --git a/sysdeps/ieee754/ldbl-opt/s_clogl.c b/sysdeps/ieee754/ldbl-opt/s_clogl.c
deleted file mode 100644
index 75126c8b89..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_clogl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_clogl.c>
-long_double_symbol (libm, __clogl, clogl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cpow.c b/sysdeps/ieee754/ldbl-opt/s_cpow.c
deleted file mode 100644
index 4801d7cdf9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cpow.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cpow.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cpow, cpowl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cpowl.c b/sysdeps/ieee754/ldbl-opt/s_cpowl.c
deleted file mode 100644
index 61840e3381..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cpowl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cpowl.c>
-long_double_symbol (libm, __cpowl, cpowl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cproj.c b/sysdeps/ieee754/ldbl-opt/s_cproj.c
deleted file mode 100644
index f298c3795a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cproj.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cproj.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cproj, cprojl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cprojl.c b/sysdeps/ieee754/ldbl-opt/s_cprojl.c
deleted file mode 100644
index 1cc058007e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cprojl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cprojl.c>
-long_double_symbol (libm, __cprojl, cprojl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csin.c b/sysdeps/ieee754/ldbl-opt/s_csin.c
deleted file mode 100644
index 7017c95450..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csin.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csin, csinl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinh.c b/sysdeps/ieee754/ldbl-opt/s_csinh.c
deleted file mode 100644
index a1fa6671db..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csinh, csinhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinhl.c b/sysdeps/ieee754/ldbl-opt/s_csinhl.c
deleted file mode 100644
index 484d466ce8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csinhl.c>
-long_double_symbol (libm, __csinhl, csinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinl.c b/sysdeps/ieee754/ldbl-opt/s_csinl.c
deleted file mode 100644
index f71642e886..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csinl.c>
-long_double_symbol (libm, __csinl, csinl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csqrt.c b/sysdeps/ieee754/ldbl-opt/s_csqrt.c
deleted file mode 100644
index 2b6dcfe010..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csqrt.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csqrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csqrt, csqrtl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csqrtl.c b/sysdeps/ieee754/ldbl-opt/s_csqrtl.c
deleted file mode 100644
index 045ff93e43..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csqrtl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csqrtl.c>
-long_double_symbol (libm, __csqrtl, csqrtl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctan.c b/sysdeps/ieee754/ldbl-opt/s_ctan.c
deleted file mode 100644
index a6a21f9f23..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctan.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ctan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ctan, ctanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanh.c b/sysdeps/ieee754/ldbl-opt/s_ctanh.c
deleted file mode 100644
index fd4be129f8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ctanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ctanh, ctanhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanhl.c b/sysdeps/ieee754/ldbl-opt/s_ctanhl.c
deleted file mode 100644
index f159373b39..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ctanhl.c>
-long_double_symbol (libm, __ctanhl, ctanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanl.c b/sysdeps/ieee754/ldbl-opt/s_ctanl.c
deleted file mode 100644
index 0c2d94cf49..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ctanl.c>
-long_double_symbol (libm, __ctanl, ctanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_fdim.c b/sysdeps/ieee754/ldbl-opt/s_fdim.c
deleted file mode 100644
index 02c95bfa81..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fdim.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fdim.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fdiml.c b/sysdeps/ieee754/ldbl-opt/s_fdiml.c
deleted file mode 100644
index 06b760b7b4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fdiml.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fdiml.c>
-long_double_symbol (libm, __fdiml, fdiml);
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmax.c b/sysdeps/ieee754/ldbl-opt/s_fmax.c
deleted file mode 100644
index 11e759121f..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmax.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fmax.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmaxl.c b/sysdeps/ieee754/ldbl-opt/s_fmaxl.c
deleted file mode 100644
index 98221b2cdc..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmaxl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fmaxl.c>
-long_double_symbol (libm, __fmaxl, fmaxl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmin.c b/sysdeps/ieee754/ldbl-opt/s_fmin.c
deleted file mode 100644
index c3fe44d9d9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmin.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fmin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fminl.c b/sysdeps/ieee754/ldbl-opt/s_fminl.c
deleted file mode 100644
index 9bfdc7ad79..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fminl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fminl.c>
-long_double_symbol (libm, __fminl, fminl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexp.c b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
index 20e107be7e..65f96e0a4c 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
@@ -1,5 +1,26 @@
-#include <math_ldbl_opt.h>
-#include <math/s_ldexp.c>
+/* ldexp alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define M_LIBM_NEED_COMPAT(f) 0
+#include <math-type-macros-double.h>
+#include <s_ldexp_template.c>
+
#if IS_IN (libm)
# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
index ed87a92b96..7a264377e5 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
@@ -1,7 +1,26 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ldexpl.c>
+/* ldexpl alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define declare_mgen_alias(f,t)
+#include <math-type-macros-ldouble.h>
+#include <s_ldexp_template.c>
+
strong_alias (__ldexpl, __ldexpl_2)
#if IS_IN (libm)
long_double_symbol (libm, __ldexpl, ldexpl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_nan.c b/sysdeps/ieee754/ldbl-opt/s_nan.c
deleted file mode 100644
index 418aad2076..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_nan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nan, nanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nanl.c b/sysdeps/ieee754/ldbl-opt/s_nanl.c
deleted file mode 100644
index 9496e0b5ce..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_nanl.c>
-long_double_symbol (libm, __nanl, nanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_nextdownl.c b/sysdeps/ieee754/ldbl-opt/s_nextdownl.c
new file mode 100644
index 0000000000..c92c02edf6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/s_nextdownl.c
@@ -0,0 +1,5 @@
+/* nextdownl is not subject to complex aliasing rules. It was
+ added in glibc 2.24. */
+#define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
+#include <math-type-macros-ldouble.h>
+#include <s_nextdown_template.c>
diff --git a/sysdeps/m68k/coldfire/fpu/libm-test-ulps-name b/sysdeps/m68k/coldfire/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..d0b67ea9eb
--- /dev/null
+++ b/sysdeps/m68k/coldfire/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+ColdFire
diff --git a/sysdeps/m68k/fpu/bits/fenv.h b/sysdeps/m68k/fpu/bits/fenv.h
index 2228861624..b8e52b290e 100644
--- a/sysdeps/m68k/fpu/bits/fenv.h
+++ b/sysdeps/m68k/fpu/bits/fenv.h
@@ -85,3 +85,11 @@ fenv_t;
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/m68k/fpu/fegetmode.c b/sysdeps/m68k/fpu/fegetmode.c
new file mode 100644
index 0000000000..9a5698c6f3
--- /dev/null
+++ b/sysdeps/m68k/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. M68K version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/math/s_fminl.c b/sysdeps/m68k/fpu/fesetexcept.c
index 84e9e518e4..bad05a9345 100644
--- a/math/s_fminl.c
+++ b/sysdeps/m68k/fpu/fesetexcept.c
@@ -1,7 +1,6 @@
-/* Return minimum numeric value of X and Y.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Set given exception flags. M68K version.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,12 +16,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
+#include <fenv.h>
-
-long double
-__fminl (long double x, long double y)
+int
+fesetexcept (int excepts)
{
- return (islessequal (x, y) || isnan (y)) ? x : y;
+ fexcept_t fpsr;
+
+ __asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr));
+ fpsr |= excepts & FE_ALL_EXCEPT;
+ __asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr));
+
+ return 0;
}
-weak_alias (__fminl, fminl)
diff --git a/sysdeps/m68k/fpu/fesetmode.c b/sysdeps/m68k/fpu/fesetmode.c
new file mode 100644
index 0000000000..2a45f72fba
--- /dev/null
+++ b/sysdeps/m68k/fpu/fesetmode.c
@@ -0,0 +1,32 @@
+/* Install given floating-point control modes. M68K version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+ femode_t mode;
+ if (modep == FE_DFL_MODE)
+ mode = _FPU_DEFAULT;
+ else
+ mode = *modep;
+ _FPU_SETCW (mode);
+ return 0;
+}
diff --git a/sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c b/sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c
deleted file mode 100644
index 1347b0468c..0000000000
--- a/sysdeps/m68k/m680x0/fpu/k_rem_pio2l.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
diff --git a/sysdeps/m68k/m680x0/fpu/libm-test-ulps-name b/sysdeps/m68k/m680x0/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..35c8a9e5f0
--- /dev/null
+++ b/sysdeps/m68k/m680x0/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+M68k
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccosh.c b/sysdeps/m68k/m680x0/fpu/s_ccosh_template.c
index 47a4fb0c94..83b449e7a8 100644
--- a/sysdeps/m68k/m680x0/fpu/s_ccosh.c
+++ b/sysdeps/m68k/m680x0/fpu/s_ccosh_template.c
@@ -21,27 +21,19 @@
#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 s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__ccosh) (__complex__ float_type x)
+CFLOAT
+s(__ccosh) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT retval;
unsigned long ix_cond = __m81_test (__imag__ x);
if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
{
/* Imaginary part is finite. */
- float_type sin_ix, cos_ix;
+ FLOAT sin_ix, cos_ix;
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
: "f" (__imag__ x));
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccoshf.c b/sysdeps/m68k/m680x0/fpu/s_ccoshf.c
deleted file mode 100644
index 3c8e7c7bb7..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_ccoshf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_ccosh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ccoshl.c b/sysdeps/m68k/m680x0/fpu/s_ccoshl.c
deleted file mode 100644
index 772d5786cf..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_ccoshl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_ccosh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexp.c b/sysdeps/m68k/m680x0/fpu/s_cexp_template.c
index f715b77d2d..828ac6c9e9 100644
--- a/sysdeps/m68k/m680x0/fpu/s_cexp.c
+++ b/sysdeps/m68k/m680x0/fpu/s_cexp_template.c
@@ -22,21 +22,14 @@
#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 s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__cexp) (__complex__ float_type x)
+CFLOAT
+s(__cexp) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT retval;
unsigned long ix_cond;
ix_cond = __m81_test (__imag__ x);
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexpf.c b/sysdeps/m68k/m680x0/fpu/s_cexpf.c
deleted file mode 100644
index 177a360f9b..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_cexpf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_cexp.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cexpl.c b/sysdeps/m68k/m680x0/fpu/s_cexpl.c
deleted file mode 100644
index bbda4ba990..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_cexpl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_cexp.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csin.c b/sysdeps/m68k/m680x0/fpu/s_csin_template.c
index b8419be897..628d0d519b 100644
--- a/sysdeps/m68k/m680x0/fpu/s_csin.c
+++ b/sysdeps/m68k/m680x0/fpu/s_csin_template.c
@@ -21,27 +21,19 @@
#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 s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__csin) (__complex__ float_type x)
+CFLOAT
+s(__csin) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT 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;
+ FLOAT sin_rx, cos_rx;
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_rx), "=f" (cos_rx)
: "f" (__real__ x));
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinf.c b/sysdeps/m68k/m680x0/fpu/s_csinf.c
deleted file mode 100644
index b760e192c3..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_csin.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinh.c b/sysdeps/m68k/m680x0/fpu/s_csinh_template.c
index c633cd8875..56f3babd95 100644
--- a/sysdeps/m68k/m680x0/fpu/s_csinh.c
+++ b/sysdeps/m68k/m680x0/fpu/s_csinh_template.c
@@ -21,21 +21,14 @@
#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 s(name) M_SUF (name)
#define m81(func) __m81_u(s(func))
-__complex__ float_type
-s(__csinh) (__complex__ float_type x)
+CFLOAT
+s(__csinh) (CFLOAT x)
{
- __complex__ float_type retval;
+ CFLOAT retval;
unsigned long ix_cond;
ix_cond = __m81_test (__imag__ x);
@@ -43,7 +36,7 @@ s(__csinh) (__complex__ float_type x)
if ((ix_cond & (__M81_COND_INF|__M81_COND_NAN)) == 0)
{
/* Imaginary part is finite. */
- float_type sin_ix, cos_ix;
+ FLOAT sin_ix, cos_ix;
__asm ("fsincos%.x %2,%1:%0" : "=f" (sin_ix), "=f" (cos_ix)
: "f" (__imag__ x));
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinhf.c b/sysdeps/m68k/m680x0/fpu/s_csinhf.c
deleted file mode 100644
index 2f7a43e6a8..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinhf.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF f
-#define float_type float
-#include <s_csinh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinhl.c b/sysdeps/m68k/m680x0/fpu/s_csinhl.c
deleted file mode 100644
index 026a20e7be..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinhl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_csinh.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_csinl.c b/sysdeps/m68k/m680x0/fpu/s_csinl.c
deleted file mode 100644
index ea2dad0556..0000000000
--- a/sysdeps/m68k/m680x0/fpu/s_csinl.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_csin.c>
diff --git a/sysdeps/m68k/nptl/bits/pthreadtypes.h b/sysdeps/m68k/nptl/bits/pthreadtypes.h
index d8faa7a000..d195492f35 100644
--- a/sysdeps/m68k/nptl/bits/pthreadtypes.h
+++ b/sysdeps/m68k/nptl/bits/pthreadtypes.h
@@ -64,7 +64,7 @@ typedef union
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
unsigned int __nusers;
__extension__ union
diff --git a/sysdeps/m68k/sys/ucontext.h b/sysdeps/m68k/sys/ucontext.h
index ef85368cb2..1c363a8c31 100644
--- a/sysdeps/m68k/sys/ucontext.h
+++ b/sysdeps/m68k/sys/ucontext.h
@@ -23,6 +23,12 @@
#include <features.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+
/* Type for general register. */
typedef int greg_t;
diff --git a/sysdeps/mach/hurd/adjtime.c b/sysdeps/mach/hurd/adjtime.c
index d65b95b9c6..7cfdd53e82 100644
--- a/sysdeps/mach/hurd/adjtime.c
+++ b/sysdeps/mach/hurd/adjtime.c
@@ -28,11 +28,15 @@ __adjtime (const struct timeval *delta, struct timeval *olddelta)
{
error_t err;
mach_port_t hostpriv;
+ struct timeval dummy;
err = __get_privileged_ports (&hostpriv, NULL);
if (err)
return __hurd_fail (EPERM);
+ if (olddelta == NULL)
+ olddelta = &dummy;
+
err = __host_adjust_time (hostpriv,
/* `time_value_t' and `struct timeval' are in
fact identical with the names changed. */
diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
index 257e438ed2..5a8cd89fee 100644
--- a/sysdeps/mach/hurd/bits/socket.h
+++ b/sysdeps/mach/hurd/bits/socket.h
@@ -220,13 +220,13 @@ struct cmsghdr
of cmsghdr structure. */
int cmsg_level; /* Originating protocol. */
int cmsg_type; /* Protocol specific type. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+#if __glibc_c99_flexarr_available
__extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
#endif
};
/* Ancillary data object manipulation macros. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+#if __glibc_c99_flexarr_available
# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
#else
# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 76140cf093..d730f82280 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -473,7 +473,8 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
err = __io_map ((mach_port_t) fd, &memobj_rd, &memobj_wr);
if (err)
return __hurd_fail (err), MAP_FAILED;
- __mach_port_deallocate (__mach_task_self (), memobj_wr);
+ if (memobj_wr != MACH_PORT_NULL)
+ __mach_port_deallocate (__mach_task_self (), memobj_wr);
}
mapaddr = (vm_address_t) addr;
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index 2e8b59e7c0..9e863a8033 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -108,12 +108,6 @@ __fork (void)
/* Run things that prepare for forking before we create the task. */
RUN_HOOK (_hurd_fork_prepare_hook, ());
- /* Acquire malloc locks. This needs to come last because fork
- handlers may use malloc, and the libio list lock has an
- indirect malloc dependency as well (via the getdelim
- function). */
- __malloc_fork_lock_parent ();
-
/* Lock things that want to be locked before we fork. */
{
void *const *p;
@@ -124,6 +118,13 @@ __fork (void)
}
__mutex_lock (&_hurd_siglock);
+ /* Acquire malloc locks. This needs to come last because fork
+ handlers may use malloc, and the libio list lock has an
+ indirect malloc dependency as well (via the getdelim
+ function). */
+ call_function_static_weak (__malloc_fork_lock_parent);
+ _hurd_malloc_fork_prepare ();
+
newtask = MACH_PORT_NULL;
thread = sigthread = MACH_PORT_NULL;
newproc = MACH_PORT_NULL;
@@ -612,7 +613,8 @@ __fork (void)
}
/* Release malloc locks. */
- __malloc_fork_unlock_parent ();
+ _hurd_malloc_fork_parent ();
+ call_function_static_weak (__malloc_fork_unlock_parent);
/* Run things that want to run in the parent to restore it to
normality. Usually prepare hooks and parent hooks are
@@ -666,7 +668,8 @@ __fork (void)
__sigemptyset (&_hurdsig_traced);
/* Release malloc locks. */
- __malloc_fork_unlock_child ();
+ _hurd_malloc_fork_child ();
+ call_function_static_weak (__malloc_fork_unlock_child);
/* Run things that want to run in the child task to set up. */
RUN_HOOK (_hurd_fork_child_hook, ());
diff --git a/sysdeps/mach/hurd/i386/bits/sigcontext.h b/sysdeps/mach/hurd/i386/bits/sigcontext.h
index 6d15b039ef..73585e18d1 100644
--- a/sysdeps/mach/hurd/i386/bits/sigcontext.h
+++ b/sysdeps/mach/hurd/i386/bits/sigcontext.h
@@ -16,12 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
-#ifndef sc_pc
-
/* Signal handlers are actually called:
void handler (int sig, int code, struct sigcontext *scp); */
@@ -116,4 +117,4 @@ struct sigcontext
#define DBG_SINGLE_TRAP 0x1 /* single step */
#define DBG_BRKPNT_FAULT 0x2 /* breakpoint instruction */
-#endif /* sc_pc */
+#endif /* bits/sigcontext.h */
diff --git a/sysdeps/mach/hurd/malloc-machine.h b/sysdeps/mach/hurd/malloc-machine.h
index f778b0d025..87a5d19bcb 100644
--- a/sysdeps/mach/hurd/malloc-machine.h
+++ b/sysdeps/mach/hurd/malloc-machine.h
@@ -23,27 +23,6 @@
#include <atomic.h>
#include <libc-lock.h>
-/* Assume hurd, with cthreads */
-
-/* Cthreads `mutex_t' is a pointer to a mutex, and malloc wants just the
- mutex itself. */
-#undef mutex_t
-#define mutex_t struct mutex
-
-#undef mutex_init
-#define mutex_init(m) ({ __mutex_init(m); 0; })
-
-#undef mutex_lock
-#define mutex_lock(m) ({ __mutex_lock(m); 0; })
-
-#undef mutex_unlock
-#define mutex_unlock(m) ({ __mutex_unlock(m); 0; })
-
-#define mutex_trylock(m) (!__mutex_trylock(m))
-
-/* No we're *not* using pthreads. */
-#define __pthread_initialize ((void (*)(void))0)
-
/* madvise is a stub on Hurd, so don't bother calling it. */
#include <sys/mman.h>
diff --git a/sysdeps/mach/hurd/net/ethernet.h b/sysdeps/mach/hurd/net/ethernet.h
index 404311e7a2..ddac67800c 100644
--- a/sysdeps/mach/hurd/net/ethernet.h
+++ b/sysdeps/mach/hurd/net/ethernet.h
@@ -31,15 +31,15 @@ __BEGIN_DECLS
systems. */
struct ether_addr
{
- u_int8_t ether_addr_octet[ETH_ALEN];
+ uint8_t ether_addr_octet[ETH_ALEN];
};
/* 10Mb/s ethernet header */
struct ether_header
{
- u_int8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
- u_int8_t ether_shost[ETH_ALEN]; /* source ether addr */
- u_int16_t ether_type; /* packet type ID field */
+ uint8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
+ uint8_t ether_shost[ETH_ALEN]; /* source ether addr */
+ uint16_t ether_type; /* packet type ID field */
};
/* Ethernet protocol ID's */
diff --git a/sysdeps/mach/hurd/net/if_arp.h b/sysdeps/mach/hurd/net/if_arp.h
index 7ed5550a73..90d389df29 100644
--- a/sysdeps/mach/hurd/net/if_arp.h
+++ b/sysdeps/mach/hurd/net/if_arp.h
@@ -132,7 +132,7 @@ struct arpreq
struct arpd_request
{
unsigned short int req; /* Request type. */
- u_int32_t ip; /* IP address of entry. */
+ uint32_t ip; /* IP address of entry. */
unsigned long int dev; /* Device entry is tied to. */
unsigned long int stamp;
unsigned long int updated;
diff --git a/sysdeps/mach/hurd/net/if_ppp.h b/sysdeps/mach/hurd/net/if_ppp.h
index 1b1c3ea6eb..8ee620bd03 100644
--- a/sysdeps/mach/hurd/net/if_ppp.h
+++ b/sysdeps/mach/hurd/net/if_ppp.h
@@ -114,11 +114,13 @@ struct npioctl {
/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
struct ppp_option_data {
- u_int8_t *ptr;
- u_int32_t length;
+ uint8_t *ptr;
+ uint32_t length;
int transmit;
};
+/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */
+#ifdef __USE_MISC
struct ifpppstatsreq {
struct ifreq b;
struct ppp_stats stats; /* statistic information */
@@ -131,6 +133,7 @@ struct ifpppcstatsreq {
#define ifr__name b.ifr_ifrn.ifrn_name
#define stats_ptr b.ifr_ifru.ifru_data
+#endif
/*
* Ioctl definitions.
diff --git a/sysdeps/mach/hurd/net/route.h b/sysdeps/mach/hurd/net/route.h
index a596ce18e3..d974950172 100644
--- a/sysdeps/mach/hurd/net/route.h
+++ b/sysdeps/mach/hurd/net/route.h
@@ -55,12 +55,12 @@ struct in6_rtmsg
struct in6_addr rtmsg_dst;
struct in6_addr rtmsg_src;
struct in6_addr rtmsg_gateway;
- u_int32_t rtmsg_type;
- u_int16_t rtmsg_dst_len;
- u_int16_t rtmsg_src_len;
- u_int32_t rtmsg_metric;
+ uint32_t rtmsg_type;
+ uint16_t rtmsg_dst_len;
+ uint16_t rtmsg_src_len;
+ uint32_t rtmsg_metric;
unsigned long int rtmsg_info;
- u_int32_t rtmsg_flags;
+ uint32_t rtmsg_flags;
int rtmsg_ifindex;
};
@@ -109,7 +109,7 @@ struct in6_rtmsg
#define RTF_NAT 0x08000000
#define RTF_ADDRCLASSMASK 0xF8000000
-#define RT_ADDRCLASS(flags) ((__u_int32_t) flags >> 23)
+#define RT_ADDRCLASS(flags) ((uint32_t) flags >> 23)
#define RT_TOS(tos) ((tos) & IPTOS_TOS_MASK)
diff --git a/sysdeps/mach/i386/syscall.S b/sysdeps/mach/i386/syscall.S
index adb7716948..643cddc9ba 100644
--- a/sysdeps/mach/i386/syscall.S
+++ b/sysdeps/mach/i386/syscall.S
@@ -22,5 +22,8 @@ ENTRY (syscall)
popl %eax /* Pop syscall number into %eax. */
pushl %ecx /* Push back return address. */
.byte 0x9a, 0, 0, 0, 0, 7, 0 /* lcall $7, $0 -- gas bug */
+ popl %ecx /* Pop return address into %ecx. */
+ pushl $0 /* Push back dumb syscall number. */
+ pushl %ecx /* Push back return address. */
ret
END (syscall)
diff --git a/sysdeps/mach/sys/reboot.h b/sysdeps/mach/sys/reboot.h
index fc7308929b..9beb8aef72 100644
--- a/sysdeps/mach/sys/reboot.h
+++ b/sysdeps/mach/sys/reboot.h
@@ -27,7 +27,7 @@
* (pre-GNU) HISTORY
*
* Revision 2.8 93/03/11 13:46:40 danner
- * u_long -> u_int.
+ * unsigned long -> unsigned int.
* [93/03/09 danner]
*
* Revision 2.7 92/05/21 17:25:11 jfriedl
@@ -145,8 +145,8 @@
#define B_TYPEMASK 0xff
#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)
-#define B_MAGICMASK ((u_int)0xf0000000U)
-#define B_DEVMAGIC ((u_int)0xa0000000U)
+#define B_MAGICMASK 0xf0000000U
+#define B_DEVMAGIC 0xa0000000U
#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
diff --git a/sysdeps/microblaze/bits/fenv.h b/sysdeps/microblaze/bits/fenv.h
index 3891f4a186..0d2ab2bc58 100644
--- a/sysdeps/microblaze/bits/fenv.h
+++ b/sysdeps/microblaze/bits/fenv.h
@@ -40,3 +40,11 @@ typedef unsigned int fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1l)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/microblaze/libm-test-ulps-name b/sysdeps/microblaze/libm-test-ulps-name
new file mode 100644
index 0000000000..1edbaa8d98
--- /dev/null
+++ b/sysdeps/microblaze/libm-test-ulps-name
@@ -0,0 +1 @@
+MicroBlaze
diff --git a/sysdeps/microblaze/nptl/bits/pthreadtypes.h b/sysdeps/microblaze/nptl/bits/pthreadtypes.h
index 9e9e307cf9..2a1ca0a191 100644
--- a/sysdeps/microblaze/nptl/bits/pthreadtypes.h
+++ b/sysdeps/microblaze/nptl/bits/pthreadtypes.h
@@ -63,7 +63,7 @@ typedef union
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
unsigned int __nusers;
__extension__ union
diff --git a/sysdeps/mips/Makefile b/sysdeps/mips/Makefile
index 3d3552322b..7c1d77941e 100644
--- a/sysdeps/mips/Makefile
+++ b/sysdeps/mips/Makefile
@@ -9,6 +9,7 @@ endif
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),debug)
diff --git a/sysdeps/mips/bits/fenv.h b/sysdeps/mips/bits/fenv.h
index f829bd3807..6341ee279e 100644
--- a/sysdeps/mips/bits/fenv.h
+++ b/sysdeps/mips/bits/fenv.h
@@ -83,3 +83,11 @@ fenv_t;
/* Floating-point environment where none of the exception is masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h
index bc90435442..7a3546b4f1 100644
--- a/sysdeps/mips/bits/wordsize.h
+++ b/sysdeps/mips/bits/wordsize.h
@@ -17,7 +17,15 @@
#include <sgidefs.h>
-#define __WORDSIZE _MIPS_SZPTR
+#define __WORDSIZE _MIPS_SZPTR
+
#if _MIPS_SIM == _ABI64
# define __WORDSIZE_TIME64_COMPAT32 1
+#else
+# define __WORDSIZE_TIME64_COMPAT32 0
+#endif
+
+#if __WORDSIZE == 32
+#define __WORDSIZE32_SIZE_ULONG 0
+#define __WORDSIZE32_PTRDIFF_LONG 0
#endif
diff --git a/sysdeps/mips/fpu/fegetmode.c b/sysdeps/mips/fpu/fegetmode.c
new file mode 100644
index 0000000000..3754aef88d
--- /dev/null
+++ b/sysdeps/mips/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. MIPS version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/math/conjf.c b/sysdeps/mips/fpu/fesetexcept.c
index 3587c942bd..1c3d91ad69 100644
--- a/math/conjf.c
+++ b/sysdeps/mips/fpu/fesetexcept.c
@@ -1,7 +1,6 @@
-/* Return complex conjugate of complex float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Set given exception flags. MIPS version.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <complex.h>
+#include <fenv.h>
+#include <fpu_control.h>
-float _Complex
-__conjf (float _Complex z)
+int
+fesetexcept (int excepts)
{
- return ~z;
+ fpu_control_t temp;
+
+ _FPU_GETCW (temp);
+ temp |= excepts & FE_ALL_EXCEPT;
+ _FPU_SETCW (temp);
+
+ return 0;
}
-weak_alias (__conjf, conjf)
diff --git a/sysdeps/mips/fpu/fesetmode.c b/sysdeps/mips/fpu/fesetmode.c
new file mode 100644
index 0000000000..d15c9ebbef
--- /dev/null
+++ b/sysdeps/mips/fpu/fesetmode.c
@@ -0,0 +1,38 @@
+/* Install given floating-point control modes. MIPS version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+#define FCSR_STATUS 0xfe83f07c
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t cw;
+
+ _FPU_GETCW (cw);
+ cw &= FCSR_STATUS;
+ if (modep == FE_DFL_MODE)
+ cw |= _FPU_DEFAULT;
+ else
+ cw |= *modep & ~FCSR_STATUS;
+ _FPU_SETCW (cw);
+
+ return 0;
+}
diff --git a/sysdeps/mips/include/sys/asm.h b/sysdeps/mips/include/sys/asm.h
index 7e288df117..67acf74dc0 100644
--- a/sysdeps/mips/include/sys/asm.h
+++ b/sysdeps/mips/include/sys/asm.h
@@ -16,8 +16,9 @@
<http://www.gnu.org/licenses/>. */
#ifndef _SYS_ASM_H
+#include_next <sys/asm.h>
-# include_next <sys/asm.h>
+# ifndef _ISOMAC
# undef __mips_cfi_startproc
# define __mips_cfi_startproc cfi_startproc
@@ -50,4 +51,5 @@
cfi_restore (gp)
# endif
-#endif
+# endif /* _ISOMAC */
+#endif /* sys/asm.h */
diff --git a/sysdeps/mips/localplt.data b/sysdeps/mips/localplt.data
new file mode 100644
index 0000000000..f0c5970c08
--- /dev/null
+++ b/sysdeps/mips/localplt.data
@@ -0,0 +1,3 @@
+# MIPS does not use PLTs in shared libraries, and implicit GOT
+# relocation means this test cannot check for GOT relocations as an
+# alternative.
diff --git a/sysdeps/mips/math-tests.h b/sysdeps/mips/math-tests.h
index f41c1616b0..fb08bca418 100644
--- a/sysdeps/mips/math-tests.h
+++ b/sysdeps/mips/math-tests.h
@@ -35,4 +35,10 @@
# define EXCEPTION_TESTS_long_double 0
#endif
+/* NaN payload preservation when converting a signaling NaN to quiet
+ is only required in NAN2008 mode. */
+#if defined __mips_hard_float && !defined __mips_nan2008
+# define SNAN_TESTS_PRESERVE_PAYLOAD 0
+#endif
+
#include_next <math-tests.h>
diff --git a/sysdeps/mips/math_private.h b/sysdeps/mips/math_private.h
index 2ea3c5708a..4587d0163a 100644
--- a/sysdeps/mips/math_private.h
+++ b/sysdeps/mips/math_private.h
@@ -19,14 +19,6 @@
#ifndef MIPS_MATH_PRIVATE_H
#define MIPS_MATH_PRIVATE_H 1
-#ifdef __mips_nan2008
-/* MIPS aligned to IEEE 754-2008. */
-#else
-/* One of the few architectures where the meaning of the quiet/signaling bit is
- inverse to IEEE 754-2008 (as well as common practice for IEEE 754-1985). */
-# define HIGH_ORDER_BIT_IS_SET_FOR_SNAN
-#endif
-
/* Inline functions to speed up the math library implementation. The
default versions of these routines are in generic/math_private.h
and call fesetround, feholdexcept, etc. These routines use inlined
diff --git a/sysdeps/mips/mips32/libm-test-ulps-name b/sysdeps/mips/mips32/libm-test-ulps-name
new file mode 100644
index 0000000000..d0622692ce
--- /dev/null
+++ b/sysdeps/mips/mips32/libm-test-ulps-name
@@ -0,0 +1 @@
+MIPS 32-bit
diff --git a/sysdeps/mips/mips64/libm-test-ulps-name b/sysdeps/mips/mips64/libm-test-ulps-name
new file mode 100644
index 0000000000..916e314f86
--- /dev/null
+++ b/sysdeps/mips/mips64/libm-test-ulps-name
@@ -0,0 +1 @@
+MIPS 64-bit
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c b/sysdeps/mips/nan-high-order-bit.h
index c1dd0b4093..0aaef0fec6 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
+++ b/sysdeps/mips/nan-high-order-bit.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Specify NaN high-order bit conventions. MIPS version.
+ Copyright (C) 2016 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
@@ -15,20 +16,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep-cancel.h>
+#ifndef NAN_HIGH_ORDER_BIT_H
+#define NAN_HIGH_ORDER_BIT_H 1
-
-/* Reserve storage for the data of the file associated with FD. */
-int
-fallocate (int fd, int mode, __off_t offset, __off_t len)
-{
-#ifdef __NR_fallocate
- return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
+#ifdef __mips_nan2008
+/* MIPS aligned to IEEE 754-2008. */
+# define HIGH_ORDER_BIT_IS_SET_FOR_SNAN 0
#else
- __set_errno (ENOSYS);
- return -1;
+/* One of the few architectures where the meaning of the
+ quiet/signaling bit is inverse to IEEE 754-2008 (as well as common
+ practice for IEEE 754-1985). */
+# define HIGH_ORDER_BIT_IS_SET_FOR_SNAN 1
#endif
-}
-strong_alias (fallocate, fallocate64)
+
+#endif /* nan-high-order-bit.h */
diff --git a/sysdeps/mips/nptl/Makefile b/sysdeps/mips/nptl/Makefile
index 117744ffe2..dda154d842 100644
--- a/sysdeps/mips/nptl/Makefile
+++ b/sysdeps/mips/nptl/Makefile
@@ -21,4 +21,5 @@ endif
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += nptl-sysdep
+libpthread-shared-only-routines += nptl-sysdep
endif
diff --git a/sysdeps/mips/nptl/bits/pthreadtypes.h b/sysdeps/mips/nptl/bits/pthreadtypes.h
index 68ed94b145..c7533a8e32 100644
--- a/sysdeps/mips/nptl/bits/pthreadtypes.h
+++ b/sysdeps/mips/nptl/bits/pthreadtypes.h
@@ -87,7 +87,7 @@ typedef union
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
#if _MIPS_SIM == _ABI64
int __spins;
diff --git a/sysdeps/mips/sys/ucontext.h b/sysdeps/mips/sys/ucontext.h
index b3d752bc46..89970a8337 100644
--- a/sysdeps/mips/sys/ucontext.h
+++ b/sysdeps/mips/sys/ucontext.h
@@ -21,9 +21,16 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <sgidefs.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+#include <sgidefs.h>
+
+
/* Type for general register. */
#if _MIPS_SIM == _ABIO32
typedef __uint32_t greg_t;
diff --git a/sysdeps/nacl/Makefile b/sysdeps/nacl/Makefile
index 71a4f8fa4b..a25bd6957f 100644
--- a/sysdeps/nacl/Makefile
+++ b/sysdeps/nacl/Makefile
@@ -123,7 +123,8 @@ endif
ifeq ($(subdir),nptl)
# We do not need any wrappers in libpthread.
-libpthread-routines := $(filter-out ptw-%,$(libpthread-routines))
+libpthread-routines := \
+ $(filter-out $(pthread-compat-wrappers),$(libpthread-routines))
endif
ifeq ($(subdir),misc)
diff --git a/sysdeps/nacl/clock.c b/sysdeps/nacl/clock.c
index 664ad650c3..b6fbcfd2dd 100644
--- a/sysdeps/nacl/clock.c
+++ b/sysdeps/nacl/clock.c
@@ -24,6 +24,6 @@
clock_t
clock (void)
{
- nacl_abi_clock_t result;
+ nacl_irt_clock_t result;
return NACL_CALL (__nacl_irt_basic.clock (&result), result);
}
diff --git a/sysdeps/nacl/dup.c b/sysdeps/nacl/dup.c
index 34a7cd46d4..cbce3f5a5a 100644
--- a/sysdeps/nacl/dup.c
+++ b/sysdeps/nacl/dup.c
@@ -27,4 +27,5 @@ __dup (int fd)
int result;
return NACL_CALL (__nacl_irt_fdio.dup (fd, &result), result);
}
+libc_hidden_def (__dup)
weak_alias (__dup, dup)
diff --git a/sysdeps/nacl/libm.abilist b/sysdeps/nacl/libm.abilist
index 838fedeacf..b0fc19f9f7 100644
--- a/sysdeps/nacl/libm.abilist
+++ b/sysdeps/nacl/libm.abilist
@@ -379,3 +379,22 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/nios2/bits/fenv.h b/sysdeps/nios2/bits/fenv.h
index 9d046217c8..8ac3831ed9 100644
--- a/sysdeps/nios2/bits/fenv.h
+++ b/sysdeps/nios2/bits/fenv.h
@@ -42,3 +42,11 @@ typedef unsigned int fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/nios2/libm-test-ulps-name b/sysdeps/nios2/libm-test-ulps-name
new file mode 100644
index 0000000000..4ee7692b1b
--- /dev/null
+++ b/sysdeps/nios2/libm-test-ulps-name
@@ -0,0 +1 @@
+Nios II
diff --git a/sysdeps/nios2/nptl/bits/pthreadtypes.h b/sysdeps/nios2/nptl/bits/pthreadtypes.h
index 76076d009a..ee8b7ba762 100644
--- a/sysdeps/nios2/nptl/bits/pthreadtypes.h
+++ b/sysdeps/nios2/nptl/bits/pthreadtypes.h
@@ -64,7 +64,7 @@ typedef union
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
unsigned int __nusers;
__extension__ union
diff --git a/sysdeps/nptl/Makeconfig b/sysdeps/nptl/Makeconfig
index 2f4918d112..babee94746 100644
--- a/sysdeps/nptl/Makeconfig
+++ b/sysdeps/nptl/Makeconfig
@@ -26,7 +26,3 @@ shared-thread-library = $(common-objpfx)nptl/libpthread_nonshared.a \
static-thread-library = $(common-objpfx)nptl/libpthread.a
rpath-dirs += nptl
-
-# This makes for ptw-*.? object rules in sysd-rules.
-ptw-CPPFLAGS := -DPTW
-sysd-rules-patterns += ptw-%:%
diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index 616d897a36..ea135f8e18 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -128,7 +128,7 @@ __libc_fork (void)
handlers may use malloc, and the libio list lock has an
indirect malloc dependency as well (via the getdelim
function). */
- __malloc_fork_lock_parent ();
+ call_function_static_weak (__malloc_fork_lock_parent);
}
#ifndef NDEBUG
@@ -192,7 +192,7 @@ __libc_fork (void)
if (multiple_threads)
{
/* Release malloc locks. */
- __malloc_fork_unlock_child ();
+ call_function_static_weak (__malloc_fork_unlock_child);
/* Reset the file list. These are recursive mutexes. */
fresetlockfiles ();
@@ -240,7 +240,7 @@ __libc_fork (void)
if (multiple_threads)
{
/* Release malloc locks, parent process variant. */
- __malloc_fork_unlock_parent ();
+ call_function_static_weak (__malloc_fork_unlock_parent);
/* We execute this even if the 'fork' call failed. */
_IO_list_unlock ();
diff --git a/sysdeps/nptl/malloc-machine.h b/sysdeps/nptl/malloc-machine.h
index 1a2af6f987..b20c423f60 100644
--- a/sysdeps/nptl/malloc-machine.h
+++ b/sysdeps/nptl/malloc-machine.h
@@ -22,14 +22,6 @@
#include <atomic.h>
#include <libc-lock.h>
-
-__libc_lock_define (typedef, mutex_t)
-
-#define mutex_init(m) __libc_lock_init (*(m))
-#define mutex_lock(m) __libc_lock_lock (*(m))
-#define mutex_trylock(m) __libc_lock_trylock (*(m))
-#define mutex_unlock(m) __libc_lock_unlock (*(m))
-
#include <sysdeps/generic/malloc-machine.h>
#endif /* !defined(_MALLOC_MACHINE_H) */
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index fd0894efd2..cc6517bca1 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -26,6 +26,7 @@
#include <bits/pthreadtypes.h>
#include <bits/setjmp.h>
#include <bits/wordsize.h>
+#include <bits/types/struct_timespec.h>
/* Detach state. */
diff --git a/sysdeps/posix/dup.c b/sysdeps/posix/dup.c
index abf3ff59dd..bbd67bcc4b 100644
--- a/sysdeps/posix/dup.c
+++ b/sysdeps/posix/dup.c
@@ -24,7 +24,7 @@
int
__dup (int fd)
{
- return fcntl (fd, F_DUPFD, 0);
+ return __fcntl (fd, F_DUPFD, 0);
}
libc_hidden_def (__dup)
weak_alias (__dup, dup)
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 574ce08aea..740e9555d5 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -82,6 +82,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <nscd/nscd_proto.h>
#include <resolv/res_hconf.h>
#include <scratch_buffer.h>
+#include <inet/net-internal.h>
#ifdef HAVE_LIBIDN
extern int __idna_to_ascii_lz (const char *input, char **output, int flags);
@@ -570,31 +571,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
goto free_and_return;
}
- if (scope_delim != NULL)
+ if (scope_delim != NULL
+ && __inet6_scopeid_pton ((struct in6_addr *) at->addr,
+ scope_delim + 1,
+ &at->scopeid) != 0)
{
- int try_numericscope = 0;
- if (IN6_IS_ADDR_LINKLOCAL (at->addr)
- || IN6_IS_ADDR_MC_LINKLOCAL (at->addr))
- {
- at->scopeid = if_nametoindex (scope_delim + 1);
- if (at->scopeid == 0)
- try_numericscope = 1;
- }
- else
- try_numericscope = 1;
-
- if (try_numericscope != 0)
- {
- char *end;
- assert (sizeof (uint32_t) <= sizeof (unsigned long));
- at->scopeid = (uint32_t) strtoul (scope_delim + 1, &end,
- 10);
- if (*end != '\0')
- {
- result = -EAI_NONAME;
- goto free_and_return;
- }
- }
+ result = -EAI_NONAME;
+ goto free_and_return;
}
if (req->ai_flags & AI_CANONNAME)
@@ -816,8 +799,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
nip = __nss_hosts_database;
/* Initialize configurations. */
- if (__glibc_unlikely (!_res_hconf.initialized))
- _res_hconf_init ();
+ _res_hconf_init ();
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
diff --git a/sysdeps/posix/shm_open.c b/sysdeps/posix/shm_open.c
index f2961620b4..0182e7baf5 100644
--- a/sysdeps/posix/shm_open.c
+++ b/sysdeps/posix/shm_open.c
@@ -40,6 +40,11 @@ shm_open (const char *name, int oflag, mode_t mode)
# ifdef O_CLOEXEC
oflag |= O_CLOEXEC;
# endif
+
+ /* Disable asynchronous cancellation. */
+ int state;
+ pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
+
int fd = open (shm_name, oflag, mode);
if (fd == -1 && __glibc_unlikely (errno == EISDIR))
/* It might be better to fold this error with EINVAL since
@@ -70,6 +75,8 @@ shm_open (const char *name, int oflag, mode_t mode)
}
# endif
+ pthread_setcancelstate (state, NULL);
+
return fd;
}
diff --git a/sysdeps/posix/wait3.c b/sysdeps/posix/wait3.c
index cf43d973a7..73722d2be6 100644
--- a/sysdeps/posix/wait3.c
+++ b/sysdeps/posix/wait3.c
@@ -33,7 +33,7 @@ __wait3 (int *stat_loc, int options, struct rusage *usage)
__set_errno (ENOSYS);
return (pid_t) -1;
}
- return __waitpid (WAIT_ANY, stat_loc.__iptr, options);
+ return __waitpid (WAIT_ANY, stat_loc, options);
}
weak_alias (__wait3, wait3)
diff --git a/sysdeps/powerpc/Versions b/sysdeps/powerpc/Versions
index b959ea49fe..95849668f2 100644
--- a/sysdeps/powerpc/Versions
+++ b/sysdeps/powerpc/Versions
@@ -3,6 +3,9 @@ libm {
# symbols used in macros from sysdeps/powerpc/bits/fenv.h
__fe_dfl_env; __fe_enabled_env; __fe_nonieee_env; __fe_nomask_env;
}
+ GLIBC_2.25 {
+ __fe_dfl_mode;
+ }
}
libc {
diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h
index d2a6d34a99..8d2bf3d163 100644
--- a/sysdeps/powerpc/bits/fenv.h
+++ b/sysdeps/powerpc/bits/fenv.h
@@ -169,3 +169,12 @@ extern const fenv_t __fe_nonieee_env;
# define FE_MASK_ENV FE_DFL_ENV
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef double femode_t;
+
+/* Default floating-point control modes. */
+extern const femode_t __fe_dfl_mode;
+# define FE_DFL_MODE (&__fe_dfl_mode)
+#endif
diff --git a/sysdeps/powerpc/fpu/fegetmode.c b/sysdeps/powerpc/fpu/fegetmode.c
new file mode 100644
index 0000000000..1bd49f94dd
--- /dev/null
+++ b/sysdeps/powerpc/fpu/fegetmode.c
@@ -0,0 +1,26 @@
+/* Store current floating-point control modes. PowerPC version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ *modep = fegetenv_register ();
+ return 0;
+}
diff --git a/sysdeps/powerpc/fpu/fenv_const.c b/sysdeps/powerpc/fpu/fenv_const.c
index b061daf578..93a4375430 100644
--- a/sysdeps/powerpc/fpu/fenv_const.c
+++ b/sysdeps/powerpc/fpu/fenv_const.c
@@ -23,6 +23,10 @@
const unsigned long long __fe_dfl_env __attribute__ ((aligned (8))) =
0xfff8000000000000ULL;
+/* The same representation is used for femode_t. */
+extern const unsigned long long __fe_dfl_mode
+ __attribute__ ((aligned (8), alias ("__fe_dfl_env")));
+
/* Floating-point environment where none of the exceptions are masked. */
const unsigned long long __fe_enabled_env __attribute__ ((aligned (8))) =
0xfff80000000000f8ULL;
diff --git a/sysdeps/powerpc/fpu/fenv_private.h b/sysdeps/powerpc/fpu/fenv_private.h
index 02ac980909..ecc05bc937 100644
--- a/sysdeps/powerpc/fpu/fenv_private.h
+++ b/sysdeps/powerpc/fpu/fenv_private.h
@@ -23,56 +23,58 @@
#include <fenv_libc.h>
#include <fpu_control.h>
-#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM \
+/* Mask for the exception enable bits. */
+#define _FPU_ALL_TRAPS (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM \
| _FPU_MASK_XM | _FPU_MASK_IM)
+/* Mask the rounding mode bits. */
+#define _FPU_MASK_RN (~0x3)
+
/* Mask everything but the rounding moded and non-IEEE arithmetic flags. */
-#define _FPU_MASK_ROUNDING 0xffffffff00000007LL
+#define _FPU_MASK_NOT_RN_NI 0xffffffff00000007LL
/* Mask restore rounding mode and exception enabled. */
-#define _FPU_MASK_EXCEPT_ROUND 0xffffffff1fffff00LL
+#define _FPU_MASK_TRAPS_RN 0xffffffff1fffff00LL
/* Mask exception enable but fraction rounded/inexact and FP result/CC
bits. */
-#define _FPU_MASK_FRAC_INEX_RET_CC 0x1ff80fff
+#define _FPU_MASK_FRAC_INEX_RET_CC 0xffffffff1ff80fff
static __always_inline void
-libc_feholdexcept_ppc (fenv_t *envp)
+__libc_feholdbits_ppc (fenv_t *envp, unsigned long long mask,
+ unsigned long long bits)
{
fenv_union_t old, new;
old.fenv = *envp = fegetenv_register ();
- new.l = old.l & _FPU_MASK_ROUNDING;
+ new.l = (old.l & mask) | bits;
/* If the old env had any enabled exceptions, then mask SIGFPE in the
MSR FE0/FE1 bits. This may allow the FPU to run faster because it
always takes the default action and can not generate SIGFPE. */
- if ((old.l & _FPU_MASK_ALL) != 0)
+ if ((old.l & _FPU_ALL_TRAPS) != 0)
(void) __fe_mask_env ();
fesetenv_register (new.fenv);
}
static __always_inline void
-libc_fesetround_ppc (int r)
+libc_feholdexcept_ppc (fenv_t *envp)
{
- __fesetround_inline (r);
+ __libc_feholdbits_ppc (envp, _FPU_MASK_NOT_RN_NI, 0LL);
}
static __always_inline void
libc_feholdexcept_setround_ppc (fenv_t *envp, int r)
{
- fenv_union_t old, new;
-
- old.fenv = *envp = fegetenv_register ();
-
- new.l = (old.l & _FPU_MASK_ROUNDING) | r;
-
- if ((old.l & _FPU_MASK_ALL) != 0)
- (void) __fe_mask_env ();
+ __libc_feholdbits_ppc (envp, _FPU_MASK_NOT_RN_NI & _FPU_MASK_RN, r);
+}
- fesetenv_register (new.fenv);
+static __always_inline void
+libc_fesetround_ppc (int r)
+{
+ __fesetround_inline (r);
}
static __always_inline int
@@ -84,98 +86,67 @@ libc_fetestexcept_ppc (int e)
}
static __always_inline void
-libc_fesetenv_ppc (const fenv_t *envp)
+libc_feholdsetround_ppc (fenv_t *e, int r)
+{
+ __libc_feholdbits_ppc (e, _FPU_MASK_TRAPS_RN, r);
+}
+
+static __always_inline unsigned long long
+__libc_femergeenv_ppc (const fenv_t *envp, unsigned long long old_mask,
+ unsigned long long new_mask)
{
fenv_union_t old, new;
new.fenv = *envp;
old.fenv = fegetenv_register ();
+ /* Merge bits while masking unwanted bits from new and old env. */
+ new.l = (old.l & old_mask) | (new.l & new_mask);
+
/* If the old env has no enabled exceptions and the new env has any enabled
exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits. This will put the
hardware into "precise mode" and may cause the FPU to run slower on some
hardware. */
- if ((old.l & _FPU_MASK_ALL) == 0 && (new.l & _FPU_MASK_ALL) != 0)
+ if ((old.l & _FPU_ALL_TRAPS) == 0 && (new.l & _FPU_ALL_TRAPS) != 0)
(void) __fe_nomask_env_priv ();
/* If the old env had any enabled exceptions and the new env has no enabled
exceptions, then mask SIGFPE in the MSR FE0/FE1 bits. This may allow the
FPU to run faster because it always takes the default action and can not
generate SIGFPE. */
- if ((old.l & _FPU_MASK_ALL) != 0 && (new.l & _FPU_MASK_ALL) == 0)
- (void) __fe_mask_env ();
-
- fesetenv_register (*envp);
-}
-
-static __always_inline int
-libc_feupdateenv_test_ppc (fenv_t *envp, int ex)
-{
- fenv_union_t old, new;
-
- new.fenv = *envp;
- old.fenv = fegetenv_register ();
-
- /* Restore rounding mode and exception enable from *envp and merge
- exceptions. Leave fraction rounded/inexact and FP result/CC bits
- unchanged. */
- new.l = (old.l & _FPU_MASK_EXCEPT_ROUND)
- | (new.l & _FPU_MASK_FRAC_INEX_RET_CC);
-
- if ((old.l & _FPU_MASK_ALL) == 0 && (new.l & _FPU_MASK_ALL) != 0)
- (void) __fe_nomask_env_priv ();
-
- if ((old.l & _FPU_MASK_ALL) != 0 && (new.l & _FPU_MASK_ALL) == 0)
+ if ((old.l & _FPU_ALL_TRAPS) != 0 && (new.l & _FPU_ALL_TRAPS) == 0)
(void) __fe_mask_env ();
+ /* Atomically enable and raise (if appropriate) exceptions set in `new'. */
fesetenv_register (new.fenv);
- return old.l & ex;
+ return old.l;
}
static __always_inline void
-libc_feupdateenv_ppc (fenv_t *e)
+libc_fesetenv_ppc (const fenv_t *envp)
{
- libc_feupdateenv_test_ppc (e, 0);
+ /* Replace the entire environment. */
+ __libc_femergeenv_ppc (envp, 0LL, -1LL);
}
static __always_inline void
-libc_feholdsetround_ppc (fenv_t *e, int r)
+libc_feresetround_ppc (fenv_t *envp)
{
- fenv_union_t old, new;
-
- old.fenv = fegetenv_register ();
- /* Clear current precision and set newer one. */
- new.l = (old.l & ~0x3 & ~_FPU_MASK_ALL) | r;
- *e = old.fenv;
+ __libc_femergeenv_ppc (envp, _FPU_MASK_TRAPS_RN, _FPU_MASK_FRAC_INEX_RET_CC);
+}
- if ((old.l & _FPU_MASK_ALL) != 0)
- (void) __fe_mask_env ();
- fesetenv_register (new.fenv);
+static __always_inline int
+libc_feupdateenv_test_ppc (fenv_t *envp, int ex)
+{
+ return __libc_femergeenv_ppc (envp, _FPU_MASK_TRAPS_RN,
+ _FPU_MASK_FRAC_INEX_RET_CC) & ex;
}
static __always_inline void
-libc_feresetround_ppc (fenv_t *envp)
+libc_feupdateenv_ppc (fenv_t *e)
{
- fenv_union_t old, new;
-
- new.fenv = *envp;
- old.fenv = fegetenv_register ();
-
- /* Restore rounding mode and exception enable from *envp and merge
- exceptions. Leave fraction rounded/inexact and FP result/CC bits
- unchanged. */
- new.l = (old.l & _FPU_MASK_EXCEPT_ROUND)
- | (new.l & _FPU_MASK_FRAC_INEX_RET_CC);
-
- if ((old.l & _FPU_MASK_ALL) == 0 && (new.l & _FPU_MASK_ALL) != 0)
- (void) __fe_nomask_env_priv ();
-
- if ((old.l & _FPU_MASK_ALL) != 0 && (new.l & _FPU_MASK_ALL) == 0)
- (void) __fe_mask_env ();
-
- /* Atomically enable and raise (if appropriate) exceptions set in `new'. */
- fesetenv_register (new.fenv);
+ libc_feupdateenv_test_ppc (e, 0);
}
#define libc_feholdexceptf libc_feholdexcept_ppc
@@ -202,17 +173,18 @@ libc_feresetround_ppc (fenv_t *envp)
#define HAVE_RM_CTX 1
static __always_inline void
-libc_feholdexcept_setround_ppc_ctx (struct rm_ctx *ctx, int r)
+libc_feholdsetround_ppc_ctx (struct rm_ctx *ctx, int r)
{
fenv_union_t old, new;
old.fenv = fegetenv_register ();
- new.l = (old.l & _FPU_MASK_ROUNDING) | r;
+ new.l = (old.l & _FPU_MASK_TRAPS_RN) | r;
+
ctx->env = old.fenv;
if (__glibc_unlikely (new.l != old.l))
{
- if ((old.l & _FPU_MASK_ALL) != 0)
+ if ((old.l & _FPU_ALL_TRAPS) != 0)
(void) __fe_mask_env ();
fesetenv_register (new.fenv);
ctx->updated_status = true;
@@ -231,26 +203,7 @@ static __always_inline void
libc_feupdateenv_ppc_ctx (struct rm_ctx *ctx)
{
if (__glibc_unlikely (ctx->updated_status))
- libc_feupdateenv_test_ppc (&ctx->env, 0);
-}
-
-static __always_inline void
-libc_feholdsetround_ppc_ctx (struct rm_ctx *ctx, int r)
-{
- fenv_union_t old, new;
-
- old.fenv = fegetenv_register ();
- new.l = (old.l & ~0x3 & ~_FPU_MASK_ALL) | r;
- ctx->env = old.fenv;
- if (__glibc_unlikely (new.l != old.l))
- {
- if ((old.l & _FPU_MASK_ALL) != 0)
- (void) __fe_mask_env ();
- fesetenv_register (new.fenv);
- ctx->updated_status = true;
- }
- else
- ctx->updated_status = false;
+ libc_feresetround_ppc (&ctx->env);
}
static __always_inline void
@@ -260,9 +213,6 @@ libc_feresetround_ppc_ctx (struct rm_ctx *ctx)
libc_feresetround_ppc (&ctx->env);
}
-#define libc_feholdexcept_setround_ctx libc_feholdexcept_setround_ppc_ctx
-#define libc_feholdexcept_setroundf_ctx libc_feholdexcept_setround_ppc_ctx
-#define libc_feholdexcept_setroundl_ctx libc_feholdexcept_setround_ppc_ctx
#define libc_fesetenv_ctx libc_fesetenv_ppc_ctx
#define libc_fesetenvf_ctx libc_fesetenv_ppc_ctx
#define libc_fesetenvl_ctx libc_fesetenv_ppc_ctx
diff --git a/sysdeps/powerpc/fpu/fesetexcept.c b/sysdeps/powerpc/fpu/fesetexcept.c
new file mode 100644
index 0000000000..fdd98f92a4
--- /dev/null
+++ b/sysdeps/powerpc/fpu/fesetexcept.c
@@ -0,0 +1,42 @@
+/* Set given exception flags. PowerPC version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fesetexcept (int excepts)
+{
+ fenv_union_t u, n;
+
+ u.fenv = fegetenv_register ();
+ n.l = (u.l
+ | (excepts & FPSCR_STICKY_BITS)
+ /* Turn FE_INVALID into FE_INVALID_SOFTWARE. */
+ | (excepts >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT))
+ & FE_INVALID_SOFTWARE));
+ if (n.l != u.l)
+ {
+ fesetenv_register (n.fenv);
+
+ /* Deal with FE_INVALID_SOFTWARE not being implemented on some chips. */
+ if (excepts & FE_INVALID)
+ feraiseexcept (FE_INVALID);
+ }
+
+ return 0;
+}
diff --git a/sysdeps/powerpc/fpu/fesetmode.c b/sysdeps/powerpc/fpu/fesetmode.c
new file mode 100644
index 0000000000..ec6d11c775
--- /dev/null
+++ b/sysdeps/powerpc/fpu/fesetmode.c
@@ -0,0 +1,49 @@
+/* Install given floating-point control modes. PowerPC version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+#include <fpu_control.h>
+
+#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM \
+ | _FPU_MASK_XM | _FPU_MASK_IM)
+
+#define FPU_STATUS 0xbffff700ULL
+
+int
+fesetmode (const femode_t *modep)
+{
+ fenv_union_t old, new;
+
+ /* Logic regarding enabled exceptions as in fesetenv. */
+
+ new.fenv = *modep;
+ old.fenv = fegetenv_register ();
+ new.l = (new.l & ~FPU_STATUS) | (old.l & FPU_STATUS);
+
+ if (old.l == new.l)
+ return 0;
+
+ if ((old.l & _FPU_MASK_ALL) == 0 && (new.l & _FPU_MASK_ALL) != 0)
+ (void) __fe_nomask_env_priv ();
+
+ if ((old.l & _FPU_MASK_ALL) != 0 && (new.l & _FPU_MASK_ALL) == 0)
+ (void) __fe_mask_env ();
+
+ fesetenv_register (new.fenv);
+ return 0;
+}
diff --git a/sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h b/sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h
new file mode 100644
index 0000000000..cb2a272d72
--- /dev/null
+++ b/sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h
@@ -0,0 +1,28 @@
+/* Fix for missing "invalid" exceptions from floating-point
+ comparisons. PowerPC version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H 1
+
+/* As of GCC 5, comparisons use unordered comparison instructions when
+ they should use ordered comparisons
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684>. */
+#define FIX_COMPARE_INVALID 1
+
+#endif /* fix-fp-int-compare-invalid.h */
diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps
index 7f37c813d0..a0e2568080 100644
--- a/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/sysdeps/powerpc/fpu/libm-test-ulps
@@ -36,8 +36,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "acosh_downward":
double: 1
@@ -52,8 +52,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "acosh_upward":
double: 2
@@ -122,8 +122,8 @@ double: 3
float: 3
idouble: 3
ifloat: 3
-ildouble: 4
-ldouble: 4
+ildouble: 7
+ldouble: 7
Function: "atan":
double: 1
@@ -216,8 +216,8 @@ double: 3
float: 3
idouble: 3
ifloat: 3
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "cabs":
double: 1
@@ -272,8 +272,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Real part of "cacos_towardzero":
double: 2
@@ -288,8 +288,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Real part of "cacos_upward":
double: 2
@@ -328,8 +328,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "cacosh_downward":
double: 2
@@ -344,8 +344,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "cacosh_towardzero":
double: 2
@@ -432,8 +432,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Real part of "casin_towardzero":
double: 3
@@ -448,8 +448,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Real part of "casin_upward":
double: 2
@@ -488,8 +488,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "casinh_downward":
double: 3
@@ -504,8 +504,8 @@ double: 5
float: 3
idouble: 5
ifloat: 3
-ildouble: 5
-ldouble: 5
+ildouble: 8
+ldouble: 8
Function: Imaginary part of "casinh_towardzero":
double: 3
@@ -696,8 +696,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "ccos_downward":
double: 1
@@ -900,9 +900,9 @@ ildouble: 3
ldouble: 3
Function: Imaginary part of "clog10":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
@@ -1132,8 +1132,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "csin":
ildouble: 1
@@ -1198,8 +1198,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "csinh_downward":
double: 2
@@ -1318,8 +1318,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "ctan":
double: 2
@@ -1390,8 +1390,8 @@ double: 2
float: 1
idouble: 2
ifloat: 1
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
@@ -1478,8 +1478,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: "erfc_downward":
double: 3
@@ -1564,8 +1564,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "exp2_upward":
double: 1
@@ -1588,8 +1588,8 @@ ildouble: 2
ldouble: 2
Function: "exp_upward":
-float: 1
double: 1
+float: 1
idouble: 1
ifloat: 1
ildouble: 1
@@ -1624,8 +1624,8 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 4
-ldouble: 4
+ildouble: 6
+ldouble: 6
Function: "fma":
ildouble: 1
@@ -1688,8 +1688,8 @@ double: 4
float: 5
idouble: 4
ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
Function: "hypot":
double: 1
@@ -1752,8 +1752,8 @@ double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: "j1_downward":
double: 3
@@ -1840,8 +1840,8 @@ double: 4
float: 5
idouble: 4
ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
Function: "log":
float: 1
@@ -1910,8 +1910,8 @@ double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
Function: "log2":
double: 1
@@ -2184,16 +2184,16 @@ double: 3
float: 3
idouble: 3
ifloat: 3
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "tanh_towardzero":
double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 3
-ldouble: 3
+ildouble: 4
+ldouble: 4
Function: "tanh_upward":
double: 3
diff --git a/sysdeps/powerpc/fpu/libm-test-ulps-name b/sysdeps/powerpc/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..8c5f7fa2ab
--- /dev/null
+++ b/sysdeps/powerpc/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+PowerPC
diff --git a/sysdeps/powerpc/nofpu/fegetmode.c b/sysdeps/powerpc/nofpu/fegetmode.c
new file mode 100644
index 0000000000..e7d68182f6
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/fegetmode.c
@@ -0,0 +1,33 @@
+/* Store current floating-point control modes. PowerPC soft-float version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+int
+fegetmode (femode_t *modep)
+{
+ fenv_union_t u;
+
+ u.l[0] = __sim_round_mode_thread;
+ u.l[1] = __sim_disabled_exceptions_thread;
+
+ *modep = u.fenv;
+
+ return 0;
+}
diff --git a/sysdeps/powerpc/nofpu/fenv_const.c b/sysdeps/powerpc/nofpu/fenv_const.c
index ebf5c68fc5..ce1da3c197 100644
--- a/sysdeps/powerpc/nofpu/fenv_const.c
+++ b/sysdeps/powerpc/nofpu/fenv_const.c
@@ -25,6 +25,10 @@
const unsigned long long __fe_dfl_env __attribute__ ((aligned (8))) =
0x000000003e000000ULL;
+/* The same representation is used for femode_t. */
+extern const unsigned long long __fe_dfl_mode
+ __attribute__ ((aligned (8), alias ("__fe_dfl_env")));
+
/* Floating-point environment where none of the exceptions are masked. */
const unsigned long long __fe_enabled_env __attribute__ ((aligned (8))) =
0x0000000000000000ULL;
diff --git a/math/s_fmaxf.c b/sysdeps/powerpc/nofpu/fesetexcept.c
index c241963bd1..3b19665cac 100644
--- a/math/s_fmaxf.c
+++ b/sysdeps/powerpc/nofpu/fesetexcept.c
@@ -1,7 +1,6 @@
-/* Return maximum numeric value of X and Y.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Set given exception flags. PowerPC soft-float version.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,12 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
+#include "soft-supp.h"
-
-float
-__fmaxf (float x, float y)
+int
+fesetexcept (int excepts)
{
- return (isgreaterequal (x, y) || isnan (y)) ? x : y;
+ __sim_exceptions_thread |= (excepts & FE_ALL_EXCEPT);
+ SIM_SET_GLOBAL (__sim_exceptions_global, __sim_exceptions_thread);
+
+ return 0;
}
-weak_alias (__fmaxf, fmaxf)
diff --git a/sysdeps/powerpc/nofpu/fesetmode.c b/sysdeps/powerpc/nofpu/fesetmode.c
new file mode 100644
index 0000000000..8f9f66c8f0
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/fesetmode.c
@@ -0,0 +1,34 @@
+/* Install given floating-point control modes. PowerPC soft-float version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+int
+fesetmode (const femode_t *modep)
+{
+ fenv_union_t u;
+
+ u.fenv = *modep;
+ __sim_round_mode_thread = u.l[0];
+ SIM_SET_GLOBAL (__sim_round_mode_global, __sim_round_mode_thread);
+ __sim_disabled_exceptions_thread = u.l[1];
+ SIM_SET_GLOBAL (__sim_disabled_exceptions_global,
+ __sim_disabled_exceptions_thread);
+ return 0;
+}
diff --git a/sysdeps/powerpc/nofpu/libm-test-ulps-name b/sysdeps/powerpc/nofpu/libm-test-ulps-name
new file mode 100644
index 0000000000..3ed2c6ec8a
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/libm-test-ulps-name
@@ -0,0 +1 @@
+PowerPC soft-float
diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
index 77bd82ecba..835fd92968 100644
--- a/sysdeps/powerpc/nptl/elide.h
+++ b/sysdeps/powerpc/nptl/elide.h
@@ -102,6 +102,9 @@ __elide_unlock (int is_lock_free)
{
if (is_lock_free)
{
+ /* This code is expected to crash when trying to unlock a lock not
+ held by this thread. More information is available in the
+ __pthread_rwlock_unlock() implementation. */
__libc_tend (0);
return true;
}
diff --git a/sysdeps/powerpc/powerpc32/bits/wordsize.h b/sysdeps/powerpc/powerpc32/bits/wordsize.h
index f31ac9ab08..04ca9debf0 100644
--- a/sysdeps/powerpc/powerpc32/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc32/bits/wordsize.h
@@ -5,4 +5,7 @@
# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c
new file mode 100644
index 0000000000..b65df80249
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fegetmode.c
@@ -0,0 +1,37 @@
+/* Store current floating-point control modes. e500 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+#include <sysdep.h>
+#include <sys/prctl.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ fenv_union_t u;
+ INTERNAL_SYSCALL_DECL (err);
+ int r;
+
+ r = INTERNAL_SYSCALL (prctl, err, 2, PR_GET_FPEXC, &u.l[0]);
+ if (INTERNAL_SYSCALL_ERROR_P (r, err))
+ return -1;
+
+ u.l[1] = fegetenv_register ();
+ *modep = u.fenv;
+ return 0;
+}
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
index 11e24ca182..eab47c8c0f 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
@@ -28,6 +28,10 @@
const unsigned long long __fe_dfl_env __attribute__ ((aligned (8))) =
0x3cULL;
+/* The same representation is used for femode_t. */
+extern const unsigned long long __fe_dfl_mode
+ __attribute__ ((aligned (8), alias ("__fe_dfl_env")));
+
/* Floating-point environment where none of the exceptions are masked. */
const unsigned long long __fe_enabled_env __attribute__ ((aligned (8))) =
(((unsigned long long) (PR_FP_EXC_DIV
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c
new file mode 100644
index 0000000000..ff82f223ed
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c
@@ -0,0 +1,37 @@
+/* Set given exception flags. e500 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fesetexcept (int excepts)
+{
+ unsigned long old_spefscr, spefscr;
+ int excepts_spe = __fexcepts_to_spe (excepts);
+
+ old_spefscr = fegetenv_register ();
+ spefscr = old_spefscr | excepts_spe;
+ fesetenv_register (spefscr);
+
+ /* If the state of the "invalid" or "underflow" flag has changed,
+ inform the kernel. */
+ if (((spefscr ^ old_spefscr) & (SPEFSCR_FINVS | SPEFSCR_FUNFS)) != 0)
+ __fe_note_change ();
+
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c
index e846bf58c5..6c97316f59 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fesetmode.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Install given floating-point control modes. e500 version.
+ Copyright (C) 2016 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
@@ -15,25 +16,28 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <fcntl.h>
+#include <fenv_libc.h>
#include <sysdep.h>
+#include <sys/prctl.h>
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
+#define SPEFSCR_STATUS 0xff3eff00
int
-posix_fadvise (int fd, off_t offset, off_t len, int advise)
+fesetmode (const femode_t *modep)
{
-#ifdef __NR_fadvise64
+ fenv_union_t u;
INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64, err, 6, fd, 0,
- __LONG_LONG_PAIR (offset >> 31, offset), len,
- advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
+ int r;
+
+ u.fenv = *modep;
+ unsigned int spefscr = fegetenv_register ();
+ spefscr = (spefscr & SPEFSCR_STATUS) | (u.l[1] & ~SPEFSCR_STATUS);
+
+ fesetenv_register (spefscr);
+ r = INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC,
+ u.l[0] | PR_FP_EXC_SW_ENABLE);
+ if (INTERNAL_SYSCALL_ERROR_P (r, err))
+ return -1;
+
return 0;
-#else
- return ENOSYS;
-#endif
}
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c b/sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c
new file mode 100644
index 0000000000..e1314810a6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fetestexceptflag.c
@@ -0,0 +1,25 @@
+/* Test exception in saved exception state. e500 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv_libc.h>
+
+int
+fetestexceptflag (const fexcept_t *flagp, int excepts)
+{
+ return __fexcepts_from_spe (*flagp) & excepts & FE_ALL_EXCEPT;
+}
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
index aed783ad59..1eec8474ed 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
@@ -24,22 +24,39 @@ ENTRY(__copysignl)
/* long double [f1,f2] copysign (long double [f1,f2] x, long double [f3,f4] y);
copysign(x,y) returns a value with the magnitude of x and
with the sign bit of y. */
+#ifdef _ARCH_PPCGR
+ /* fsel available. */
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
stfd fp3,8(r1)
fmr fp0,fp1
fabs fp1,fp1
- fcmpu cr7,fp0,fp1
lwz r3,8+HIWORD(r1)
cmpwi cr6,r3,0
addi r1,r1,16
cfi_adjust_cfa_offset (-16)
- beq cr7,L(0)
+ fneg fp3,fp2
+ fsel fp2,fp0,fp2,fp3
+ bgelr cr6
+ fneg fp1,fp1
fneg fp2,fp2
-L(0): bgelr cr6
+ blr
+#else
+ stwu r1,-32(r1)
+ cfi_adjust_cfa_offset (32)
+ stfd fp3,8(r1)
+ stfd fp1,16(r1)
+ lwz r3,8+HIWORD(r1)
+ lwz r4,16+HIWORD(r1)
+ xor r3,r3,r4
+ cmpwi cr6,r3,0
+ addi r1,r1,32
+ cfi_adjust_cfa_offset (-32)
+ bgelr cr6
fneg fp1,fp1
fneg fp2,fp2
blr
+#endif
END (__copysignl)
#if IS_IN (libm)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
index c860a1b5d3..0c0d128ab0 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __finite __redirect___finite
+#define __finitef __redirect___finitef
+#define __finitel __redirect___finitel
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -23,11 +26,14 @@
extern __typeof (__finite) __finite_ppc32 attribute_hidden;
extern __typeof (__finite) __finite_power7 attribute_hidden;
-
-libc_ifunc (__finite,
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __finite_power7
- : __finite_ppc32);
+#undef __finite
+#undef __finitef
+#undef __finitel
+
+libc_ifunc_redirected (__redirect___finite, __finite,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __finite_power7
+ : __finite_ppc32);
weak_alias (__finite, finite)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c
index 831c94f3fc..683477a0f5 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __finitef __redirect___finitef
#include <math.h>
#include <shlib-compat.h>
#include "init-arch.h"
@@ -23,10 +24,11 @@
extern __typeof (__finitef) __finitef_ppc32 attribute_hidden;
/* The power7 finite(double) works for float. */
extern __typeof (__finitef) __finite_power7 attribute_hidden;
+#undef __finitef
-libc_ifunc (__finitef,
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __finite_power7
- : __finitef_ppc32);
+libc_ifunc_redirected (__redirect___finitef, __finitef,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __finite_power7
+ : __finitef_ppc32);
weak_alias (__finitef, finitef)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
index 506c1115e8..fe6c91294f 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isinf __redirect___isinf
+#define __isinff __redirect___isinff
+#define __isinfl __redirect___isinfl
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -23,11 +26,14 @@
extern __typeof (__isinf) __isinf_ppc32 attribute_hidden;
extern __typeof (__isinf) __isinf_power7 attribute_hidden;
-
-libc_ifunc (__isinf,
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isinf_power7
- : __isinf_ppc32);
+#undef __isinf
+#undef __isinff
+#undef __isinfl
+
+libc_ifunc_redirected (__redirect___isinf, __isinf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isinf_power7
+ : __isinf_ppc32);
weak_alias (__isinf, isinf)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c
index 2ab83ee7cb..1706092dd6 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isinff __redirect___isinff
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -24,10 +25,11 @@
extern __typeof (__isinff) __isinff_ppc32 attribute_hidden;
/* The power7 isinf(double) works for float. */
extern __typeof (__isinff) __isinf_power7 attribute_hidden;
+#undef __isinff
-libc_ifunc (__isinff,
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isinf_power7
- : __isinff_ppc32);
+libc_ifunc_redirected (__redirect___isinff, __isinff,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isinf_power7
+ : __isinff_ppc32);
weak_alias (__isinff, isinff)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
index 8f848d7bbc..3655b813b0 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isnan __redirect___isnan
+#define __isnanf __redirect___isnanf
+#define __isnanl __redirect___isnanl
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -25,15 +28,18 @@ extern __typeof (__isnan) __isnan_ppc32 attribute_hidden;
extern __typeof (__isnan) __isnan_power5 attribute_hidden;
extern __typeof (__isnan) __isnan_power6 attribute_hidden;
extern __typeof (__isnan) __isnan_power7 attribute_hidden;
-
-libc_ifunc (__isnan,
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isnan_power7 :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __isnan_power6 :
- (hwcap & PPC_FEATURE_POWER5)
- ? __isnan_power5
- : __isnan_ppc32);
+#undef __isnan
+#undef __isnanf
+#undef __isnanl
+
+libc_ifunc_redirected (__redirect___isnan, __isnan,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isnan_power7
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __isnan_power6
+ : (hwcap & PPC_FEATURE_POWER5)
+ ? __isnan_power5
+ : __isnan_ppc32);
weak_alias (__isnan, isnan)
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c
index c43c0f3293..e1d6707e10 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c
@@ -26,13 +26,14 @@ extern __typeof (__isnanf) __isnanf_power5 attribute_hidden;
extern __typeof (__isnanf) __isnanf_power6 attribute_hidden;
extern __typeof (__isnanf) __isnan_power7 attribute_hidden;
-libc_ifunc (__isnanf,
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isnan_power7 :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __isnanf_power6 :
- (hwcap & PPC_FEATURE_POWER5)
- ? __isnanf_power5
- : __isnan_ppc32);
+libc_ifunc_hidden (__isnanf, __isnanf,
+ (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isnan_power7
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __isnanf_power6
+ : (hwcap & PPC_FEATURE_POWER5)
+ ? __isnanf_power5
+ : __isnan_ppc32);
+hidden_def (__isnanf)
weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
index c08519c7a1..49d424f6c8 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c
@@ -18,17 +18,19 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define memcmp __redirect_memcmp
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (memcmp) __memcmp_ppc attribute_hidden;
extern __typeof (memcmp) __memcmp_power7 attribute_hidden;
+# undef memcmp
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (memcmp,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memcmp_power7
- : __memcmp_ppc);
+libc_ifunc_redirected (__redirect_memcmp, memcmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcmp_power7
+ : __memcmp_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
index f379e479a2..1a5da219eb 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c
@@ -20,6 +20,8 @@
DSO. In static binaries we need memcpy before the initialization
happened. */
#if defined SHARED && IS_IN (libc)
+# undef memcpy
+# define memcpy __redirect_memcpy
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -29,17 +31,18 @@ extern __typeof (memcpy) __memcpy_cell attribute_hidden;
extern __typeof (memcpy) __memcpy_power6 attribute_hidden;
extern __typeof (memcpy) __memcpy_a2 attribute_hidden;
extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
+# undef memcpy
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (memcpy,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memcpy_power7 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __memcpy_a2 :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __memcpy_power6 :
- (hwcap & PPC_FEATURE_CELL_BE)
- ? __memcpy_cell
- : __memcpy_ppc);
+libc_ifunc_redirected (__redirect_memcpy, memcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcpy_power7
+ : (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __memcpy_a2
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __memcpy_power6
+ : (hwcap & PPC_FEATURE_CELL_BE)
+ ? __memcpy_cell
+ : __memcpy_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
index 417318461b..1dfb5bec0a 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c
@@ -19,16 +19,18 @@
#if defined SHARED && IS_IN (libc)
/* Redefine memmove so that the compiler won't complain about the type
mismatch with the IFUNC selector in strong_alias, below. */
+# define memmove __redirect_memmove
# include <string.h>
# include "init-arch.h"
extern __typeof (memmove) __memmove_ppc attribute_hidden;
extern __typeof (memmove) __memmove_power7 attribute_hidden;
+# undef memmove
-libc_ifunc (memmove,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memmove_power7
- : __memmove_ppc);
+libc_ifunc_redirected (__redirect_memmove, memmove,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memmove_power7
+ : __memmove_ppc);
#else
# include <string/memmove.c>
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
index 3c77b5f1bd..3c7c644fe9 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
@@ -17,23 +17,28 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
# define NO_MEMPCPY_STPCPY_REDIRECT
+/* Omit the mempcpy inline definitions because it would redefine mempcpy. */
+# define _HAVE_STRING_ARCH_mempcpy 1
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__mempcpy) __mempcpy_ppc attribute_hidden;
extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
+# undef mempcpy
+# undef __mempcpy
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (__mempcpy,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __mempcpy_power7
- : __mempcpy_ppc);
+libc_ifunc_redirected (__redirect___mempcpy, __mempcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __mempcpy_power7
+ : __mempcpy_ppc);
weak_alias (__mempcpy, mempcpy)
-libc_hidden_def (mempcpy)
#else
# include <string/mempcpy.c>
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c b/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
index 1d7fc7f2c8..a5c0142dc4 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/memset.c
@@ -18,6 +18,7 @@
/* Define multiple versions only for definition in libc. */
#if defined SHARED && IS_IN (libc)
+# define memset __redirect_memset
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -25,13 +26,14 @@
extern __typeof (memset) __memset_ppc attribute_hidden;
extern __typeof (memset) __memset_power6 attribute_hidden;
extern __typeof (memset) __memset_power7 attribute_hidden;
+# undef memset
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (memset,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memset_power7 :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __memset_power6
- : __memset_ppc);
+libc_ifunc_redirected (__redirect_memset, memset,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memset_power7
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __memset_power6
+ : __memset_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
index f06030eeeb..d72b5df787 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c
@@ -17,20 +17,21 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define __rawmemchr __redirect___rawmemchr
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__rawmemchr) __rawmemchr_ppc attribute_hidden;
extern __typeof (__rawmemchr) __rawmemchr_power7 attribute_hidden;
+# undef __rawmemchr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (__rawmemchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __rawmemchr_power7
- : __rawmemchr_ppc);
-
+libc_ifunc_redirected (__redirect___rawmemchr, __rawmemchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __rawmemchr_power7
+ : __rawmemchr_ppc);
weak_alias (__rawmemchr, rawmemchr)
#else
#include <string/rawmemchr.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
index 2cfde632cb..c23384f01c 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c
@@ -18,18 +18,22 @@
/* Define multiple versions only for definition in libc. */
#if defined SHARED && IS_IN (libc)
+# define strchr __redirect_strchr
+/* Omit the strchr inline definitions because it would redefine strchr. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strchr) __strchr_ppc attribute_hidden;
extern __typeof (strchr) __strchr_power7 attribute_hidden;
+# undef strchr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strchr_power7
- : __strchr_ppc);
+libc_ifunc_redirected (__redirect_strchr, strchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchr_power7
+ : __strchr_ppc);
weak_alias (strchr, index)
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
index af5921a15a..b676b26c15 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c
@@ -17,15 +17,17 @@
<http://www.gnu.org/licenses/>. */
#if defined SHARED && IS_IN (libc)
+# define strlen __redirect_strlen
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strlen) __strlen_ppc attribute_hidden;
extern __typeof (strlen) __strlen_power7 attribute_hidden;
+# undef strlen
-libc_ifunc (strlen,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strlen_power7
- : __strlen_ppc);
+libc_ifunc_redirected (__redirect_strlen, strlen,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strlen_power7
+ : __strlen_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
index 7cc7628091..c384b4c64a 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c
@@ -18,6 +18,9 @@
/* Define multiple versions only for definition in libc. */
#if defined SHARED && IS_IN (libc)
+# define strncmp __redirect_strncmp
+/* Omit the strncmp inline definitions because it would redefine strncmp. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -25,11 +28,12 @@
extern __typeof (strncmp) __strncmp_ppc attribute_hidden;
extern __typeof (strncmp) __strncmp_power4 attribute_hidden;
extern __typeof (strncmp) __strncmp_power7 attribute_hidden;
+# undef strncmp
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strncmp,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strncmp_power7
- : __strncmp_ppc);
+libc_ifunc_redirected (__redirect_strncmp, strncmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncmp_power7
+ : __strncmp_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
index 8f1e7c9e54..c3681bec46 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c
@@ -17,17 +17,20 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__strnlen) __strnlen_ppc attribute_hidden;
extern __typeof (__strnlen) __strnlen_power7 attribute_hidden;
+# undef strnlen
+# undef __strnlen
-libc_ifunc (__strnlen,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strnlen_power7
- : __strnlen_ppc);
+libc_ifunc_redirected (__redirect___strnlen, __strnlen,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strnlen_power7
+ : __strnlen_ppc);
weak_alias (__strnlen, strnlen)
-libc_hidden_def (strnlen)
#endif
diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/power6/memset.S
index b2a222edd2..d5dbe83af2 100644
--- a/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -394,7 +394,7 @@ L(cacheAlignedx):
/* A simple loop for the longer (>640 bytes) lengths. This form limits
the branch miss-predicted to exactly 1 at loop exit.*/
L(cacheAligned512):
- cmpli cr1,rLEN,128
+ cmplwi cr1,rLEN,128
blt cr1,L(cacheAligned1)
dcbz 0,rMEMP
addi rLEN,rLEN,-128
diff --git a/sysdeps/powerpc/powerpc32/power9/multiarch/Implies b/sysdeps/powerpc/powerpc32/power9/multiarch/Implies
index 4393b56872..1a46ef0035 100644
--- a/sysdeps/powerpc/powerpc32/power9/multiarch/Implies
+++ b/sysdeps/powerpc/powerpc32/power9/multiarch/Implies
@@ -1 +1 @@
-powerpc/powerpc32/power8/fpu/multiarch
+powerpc/powerpc32/power8/multiarch
diff --git a/sysdeps/powerpc/powerpc32/ppc-mcount.S b/sysdeps/powerpc/powerpc32/ppc-mcount.S
index 68df440cf3..1d36b91243 100644
--- a/sysdeps/powerpc/powerpc32/ppc-mcount.S
+++ b/sysdeps/powerpc/powerpc32/ppc-mcount.S
@@ -40,22 +40,38 @@
*/
ENTRY(_mcount)
+#if defined PIC && !defined SHARED
+# define CALLER_LR_OFFSET 68
+ stwu r1,-64(r1)
+ cfi_adjust_cfa_offset (64)
+ stw r30, 48(r1)
+ cfi_rel_offset (r30, 48)
+#else
+# define CALLER_LR_OFFSET 52
stwu r1,-48(r1)
cfi_adjust_cfa_offset (48)
+#endif
/* We need to save the parameter-passing registers. */
stw r3, 12(r1)
stw r4, 16(r1)
stw r5, 20(r1)
stw r6, 24(r1)
mflr r4
- lwz r3, 52(r1)
+#if defined PIC && !defined SHARED
+ bcl 20,31,0f
+0:
+ mflr r30
+ addis r30, r30, _GLOBAL_OFFSET_TABLE_-0b@ha
+ addi r30, r30, _GLOBAL_OFFSET_TABLE_-0b@l
+#endif
+ lwz r3, CALLER_LR_OFFSET(r1)
mfcr r5
stw r7, 28(r1)
stw r8, 32(r1)
stw r9, 36(r1)
stw r10,40(r1)
stw r4, 44(r1)
- cfi_offset (lr, -4)
+ cfi_rel_offset (lr, 44)
stw r5, 8(r1)
#ifndef SHARED
bl JUMPTARGET(__mcount_internal)
@@ -71,13 +87,18 @@ ENTRY(_mcount)
mtcrf 0xff,r6
lwz r5, 20(r1)
lwz r6, 24(r1)
- lwz r0, 52(r1)
+ lwz r0, CALLER_LR_OFFSET(r1)
lwz r7, 28(r1)
lwz r8, 32(r1)
mtlr r0
lwz r9, 36(r1)
lwz r10,40(r1)
/* ...unwind the stack frame, and return to your usual programming. */
+#if defined PIC && !defined SHARED
+ lwz r30, 48(r1)
+ addi r1,r1,64
+#else
addi r1,r1,48
+#endif
bctr
END(_mcount)
diff --git a/sysdeps/powerpc/powerpc64/bits/wordsize.h b/sysdeps/powerpc/powerpc64/bits/wordsize.h
index f31ac9ab08..04ca9debf0 100644
--- a/sysdeps/powerpc/powerpc64/bits/wordsize.h
+++ b/sysdeps/powerpc/powerpc64/bits/wordsize.h
@@ -5,4 +5,7 @@
# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
index 067edc2ea6..c7d67f15a5 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __finite __redirect___finite
+#define __finitef __redirect___finitef
+#define __finitel __redirect___finitel
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -24,13 +27,16 @@
extern __typeof (__finite) __finite_ppc64 attribute_hidden;
extern __typeof (__finite) __finite_power7 attribute_hidden;
extern __typeof (__finite) __finite_power8 attribute_hidden;
-
-libc_ifunc (__finite,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __finite_power8 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __finite_power7
- : __finite_ppc64);
+#undef __finite
+#undef __finitef
+#undef __finitel
+
+libc_ifunc_redirected (__redirect___finite, __finite,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __finite_power8
+ : (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __finite_power7
+ : __finite_ppc64);
weak_alias (__finite, finite)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
index e0b4686ced..c9ecd0d5f8 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __finitef __redirect___finitef
#include <math.h>
#include <shlib-compat.h>
#include "init-arch.h"
@@ -24,12 +25,13 @@ extern __typeof (__finitef) __finitef_ppc64 attribute_hidden;
/* The double-precision version also works for single-precision. */
extern __typeof (__finitef) __finite_power7 attribute_hidden;
extern __typeof (__finitef) __finite_power8 attribute_hidden;
+#undef __finitef
-libc_ifunc (__finitef,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __finite_power8 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __finite_power7
- : __finitef_ppc64);
+libc_ifunc_redirected (__redirect___finitef, __finitef,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __finite_power8
+ : (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __finite_power7
+ : __finitef_ppc64);
weak_alias (__finitef, finitef)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
index 07e159d9c1..a13ec27a45 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isinf __redirect___isinf
+#define __isinff __redirect___isinff
+#define __isinfl __redirect___isinfl
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -24,13 +27,16 @@
extern __typeof (__isinf) __isinf_ppc64 attribute_hidden;
extern __typeof (__isinf) __isinf_power7 attribute_hidden;
extern __typeof (__isinf) __isinf_power8 attribute_hidden;
-
-libc_ifunc (__isinf,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __isinf_power8 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isinf_power7
- : __isinf_ppc64);
+#undef __isinf
+#undef __isinff
+#undef __isinfl
+
+libc_ifunc_redirected (__redirect___isinf, __isinf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __isinf_power8
+ : (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isinf_power7
+ : __isinf_ppc64);
weak_alias (__isinf, isinf)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
index 2cb161b54c..cafc118cd5 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isinff __redirect___isinff
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -25,12 +26,13 @@ extern __typeof (__isinff) __isinff_ppc64 attribute_hidden;
/* The double-precision version also works for single-precision. */
extern __typeof (__isinff) __isinf_power7 attribute_hidden;
extern __typeof (__isinff) __isinf_power8 attribute_hidden;
+#undef __isinff
-libc_ifunc (__isinff,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __isinf_power8 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isinf_power7
- : __isinff_ppc64);
+libc_ifunc_redirected (__redirect___isinff, __isinff,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __isinf_power8
+ : (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isinf_power7
+ : __isinff_ppc64);
weak_alias (__isinff, isinff)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
index a614f25047..fce3c9d299 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define __isnan __redirect___isnan
+#define __isnanf __redirect___isnanf
+#define __isnanl __redirect___isnanl
#include <math.h>
#include <math_ldbl_opt.h>
#include <shlib-compat.h>
@@ -27,19 +30,22 @@ extern __typeof (__isnan) __isnan_power6 attribute_hidden;
extern __typeof (__isnan) __isnan_power6x attribute_hidden;
extern __typeof (__isnan) __isnan_power7 attribute_hidden;
extern __typeof (__isnan) __isnan_power8 attribute_hidden;
-
-libc_ifunc (__isnan,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __isnan_power8 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isnan_power7 :
- (hwcap & PPC_FEATURE_POWER6_EXT)
- ? __isnan_power6x :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __isnan_power6 :
- (hwcap & PPC_FEATURE_POWER5)
- ? __isnan_power5
- : __isnan_ppc64);
+#undef __isnan
+#undef __isnanf
+#undef __isnanl
+
+libc_ifunc_redirected (__redirect___isnan, __isnan,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __isnan_power8
+ : (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isnan_power7
+ : (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __isnan_power6x
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __isnan_power6
+ : (hwcap & PPC_FEATURE_POWER5)
+ ? __isnan_power5
+ : __isnan_ppc64);
weak_alias (__isnan, isnan)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
index acbc131721..903ea867f5 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
@@ -27,17 +27,18 @@ extern __typeof (__isnanf) __isnan_power6x attribute_hidden;
extern __typeof (__isnanf) __isnan_power7 attribute_hidden;
extern __typeof (__isnanf) __isnan_power8 attribute_hidden;
-libc_ifunc (__isnanf,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __isnan_power8 :
- (hwcap & PPC_FEATURE_ARCH_2_06)
- ? __isnan_power7 :
- (hwcap & PPC_FEATURE_POWER6_EXT)
- ? __isnan_power6x :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __isnan_power6 :
- (hwcap & PPC_FEATURE_POWER5)
- ? __isnan_power5
- : __isnan_ppc64);
+libc_ifunc_hidden (__isnanf, __isnanf,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __isnan_power8
+ : (hwcap & PPC_FEATURE_ARCH_2_06)
+ ? __isnan_power7
+ : (hwcap & PPC_FEATURE_POWER6_EXT)
+ ? __isnan_power6x
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __isnan_power6
+ : (hwcap & PPC_FEATURE_POWER5)
+ ? __isnan_power5
+ : __isnan_ppc64);
+hidden_def (__isnanf)
weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
index 1e1b9d43e6..548076d25b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysignl.S
@@ -30,16 +30,14 @@ ENTRY(__copysignl)
blt L(0)
fmr fp0,fp1
fabs fp1,fp1
- fcmpu cr1,fp0,fp1
- beqlr cr1
- fneg fp2,fp2
+ fneg fp3,fp2
+ fsel fp2,fp0,fp2,fp3
blr
L(0):
fmr fp0,fp1
fnabs fp1,fp1
- fcmpu cr1,fp0,fp1
- beqlr cr1
- fneg fp2,fp2
+ fneg fp3,fp2
+ fsel fp2,fp0,fp3,fp2
blr
END (__copysignl)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
index e8cf6ae23d..a45ebd75a4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
@@ -18,6 +18,7 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define memcmp __redirect_memcmp
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -25,15 +26,16 @@
extern __typeof (memcmp) __memcmp_ppc attribute_hidden;
extern __typeof (memcmp) __memcmp_power4 attribute_hidden;
extern __typeof (memcmp) __memcmp_power7 attribute_hidden;
+# undef memcmp
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (memcmp,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __memcmp_power7 :
- (hwcap & PPC_FEATURE_POWER4)
- ? __memcmp_power4
- : __memcmp_ppc);
+libc_ifunc_redirected (__redirect_memcmp, memcmp,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __memcmp_power7
+ : (hwcap & PPC_FEATURE_POWER4)
+ ? __memcmp_power4
+ : __memcmp_ppc);
#else
#include <string/memcmp.c>
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
index 3c77b5f1bd..36ec954e6f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
@@ -17,23 +17,28 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
# define NO_MEMPCPY_STPCPY_REDIRECT
+/* Omit the mempcpy inline definitions because it would redefine mempcpy. */
+# define _HAVE_STRING_ARCH_mempcpy 1
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__mempcpy) __mempcpy_ppc attribute_hidden;
extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
+# undef mempcpy
+# undef __mempcpy
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (__mempcpy,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __mempcpy_power7
- : __mempcpy_ppc);
+libc_ifunc_redirected (__redirect___mempcpy, __mempcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __mempcpy_power7
+ : __mempcpy_ppc);
weak_alias (__mempcpy, mempcpy)
-libc_hidden_def (mempcpy)
#else
# include <string/mempcpy.c>
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
index f06030eeeb..b53b148111 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
@@ -17,19 +17,21 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define __rawmemchr __redirect___rawmemchr
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__rawmemchr) __rawmemchr_ppc attribute_hidden;
extern __typeof (__rawmemchr) __rawmemchr_power7 attribute_hidden;
+# undef __rawmemchr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (__rawmemchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __rawmemchr_power7
- : __rawmemchr_ppc);
+libc_ifunc_redirected (__redirect___rawmemchr, __rawmemchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __rawmemchr_power7
+ : __rawmemchr_ppc);
weak_alias (__rawmemchr, rawmemchr)
#else
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
index bbc169180b..e378138379 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
@@ -26,14 +26,15 @@ extern __typeof (__stpcpy) __stpcpy_ppc attribute_hidden;
extern __typeof (__stpcpy) __stpcpy_power7 attribute_hidden;
extern __typeof (__stpcpy) __stpcpy_power8 attribute_hidden;
-libc_ifunc (__stpcpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __stpcpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __stpcpy_power7
- : __stpcpy_ppc);
+libc_ifunc_hidden (__stpcpy, __stpcpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __stpcpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __stpcpy_power7
+ : __stpcpy_ppc);
weak_alias (__stpcpy, stpcpy)
+libc_hidden_def (__stpcpy)
libc_hidden_def (stpcpy)
#else
# include <string/stpcpy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
index b1484b1e36..fb3b529205 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define stpncpy __redirect_stpncpy
+# define __stpncpy __redirect___stpncpy
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,13 +26,14 @@
extern __typeof (__stpncpy) __stpncpy_ppc attribute_hidden;
extern __typeof (__stpncpy) __stpncpy_power7 attribute_hidden;
extern __typeof (__stpncpy) __stpncpy_power8 attribute_hidden;
+# undef stpncpy
+# undef __stpncpy
-libc_ifunc (__stpncpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __stpncpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __stpncpy_power7
- : __stpncpy_ppc);
-
+libc_ifunc_redirected (__redirect___stpncpy, __stpncpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __stpncpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __stpncpy_power7
+ : __stpncpy_ppc);
weak_alias (__stpncpy, stpncpy)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat.c b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
index a2894ae027..5080ed1150 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define strcat __redirect_strcat
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,11 +25,12 @@
extern __typeof (strcat) __strcat_ppc attribute_hidden;
extern __typeof (strcat) __strcat_power7 attribute_hidden;
extern __typeof (strcat) __strcat_power8 attribute_hidden;
+# undef strcat
-libc_ifunc (strcat,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strcat_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcat_power7
- : __strcat_ppc);
+libc_ifunc_redirected (__redirect_strcat, strcat,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcat_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcat_power7
+ : __strcat_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
index 2cfde632cb..e24d6b319e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
@@ -18,18 +18,22 @@
/* Define multiple versions only for definition in libc. */
#if defined SHARED && IS_IN (libc)
+# define strchr __redirect_strchr
+/* Omit the strchr inline definitions because it would redefine strchr. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strchr) __strchr_ppc attribute_hidden;
extern __typeof (strchr) __strchr_power7 attribute_hidden;
+# undef strchr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strchr_power7
- : __strchr_ppc);
+libc_ifunc_redirected (__redirect_strchr, strchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchr_power7
+ : __strchr_ppc);
weak_alias (strchr, index)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
index aee888a4b7..06f89cb375 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
@@ -17,6 +17,9 @@
<http://www.gnu.org/licenses/>. */
#if defined SHARED && IS_IN (libc)
+# define strcmp __redirect_strcmp
+/* Omit the strcmp inline definitions because it would redefine strcmp. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,11 +27,12 @@
extern __typeof (strcmp) __strcmp_ppc attribute_hidden;
extern __typeof (strcmp) __strcmp_power7 attribute_hidden;
extern __typeof (strcmp) __strcmp_power8 attribute_hidden;
+# undef strcmp
-libc_ifunc (strcmp,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strcmp_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcmp_power7
- : __strcmp_ppc);
+libc_ifunc_redirected (__redirect_strcmp, strcmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcmp_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcmp_power7
+ : __strcmp_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
index d2c38589e7..8708fc72ce 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#if defined SHARED && IS_IN (libc)
+# define strcpy __redirect_strcpy
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,11 +25,12 @@
extern __typeof (strcpy) __strcpy_ppc attribute_hidden;
extern __typeof (strcpy) __strcpy_power7 attribute_hidden;
extern __typeof (strcpy) __strcpy_power8 attribute_hidden;
+#undef strcpy
-libc_ifunc (strcpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strcpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strcpy_power7
- : __strcpy_ppc);
+libc_ifunc_redirected (__redirect_strcpy, strcpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strcpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strcpy_power7
+ : __strcpy_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
index 1eb6e517af..63a1aa049a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -18,6 +18,9 @@
/* Define multiple versions only for definition in libc. */
#if defined SHARED && IS_IN (libc)
+# define strncmp __redirect_strncmp
+/* Omit the strncmp inline definitions because it would redefine strncmp. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -26,15 +29,16 @@ extern __typeof (strncmp) __strncmp_ppc attribute_hidden;
extern __typeof (strncmp) __strncmp_power4 attribute_hidden;
extern __typeof (strncmp) __strncmp_power7 attribute_hidden;
extern __typeof (strncmp) __strncmp_power8 attribute_hidden;
+# undef strncmp
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strncmp,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strncmp_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strncmp_power7 :
- (hwcap & PPC_FEATURE_POWER4)
- ? __strncmp_power4
- : __strncmp_ppc);
+libc_ifunc_redirected (__redirect_strncmp, strncmp,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncmp_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncmp_power7
+ : (hwcap & PPC_FEATURE_POWER4)
+ ? __strncmp_power4
+ : __strncmp_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
index 0176514c1e..64495df4bc 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
@@ -18,6 +18,9 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define strncpy __redirect_strncpy
+/* Omit the strncpy inline definitions because it would redefine strncpy. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -25,14 +28,15 @@
extern __typeof (strncpy) __strncpy_ppc attribute_hidden;
extern __typeof (strncpy) __strncpy_power7 attribute_hidden;
extern __typeof (strncpy) __strncpy_power8 attribute_hidden;
+# undef strncpy
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strncpy,
- (hwcap2 & PPC_FEATURE2_ARCH_2_07)
- ? __strncpy_power8 :
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strncpy_power7
- : __strncpy_ppc);
+libc_ifunc_redirected (__redirect_strncpy, strncpy,
+ (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+ ? __strncpy_power8
+ : (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strncpy_power7
+ : __strncpy_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
index c4907e9ec8..71dc12dd9f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
@@ -17,19 +17,21 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (__strnlen) __strnlen_ppc attribute_hidden;
extern __typeof (__strnlen) __strnlen_power7 attribute_hidden;
-
-libc_ifunc (__strnlen,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strnlen_power7
- : __strnlen_ppc);
+# undef strnlen
+# undef __strnlen
+libc_ifunc_redirected (__redirect___strnlen, __strnlen,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strnlen_power7
+ : __strnlen_ppc);
weak_alias (__strnlen, strnlen)
-libc_hidden_def (strnlen)
#else
#include <string/strnlen.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
index 45742bc910..e485b02248 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
@@ -18,18 +18,20 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define strrchr __redirect_strrchr
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strrchr) __strrchr_ppc attribute_hidden;
extern __typeof (strrchr) __strrchr_power7 attribute_hidden;
+#undef strrchr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strrchr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strrchr_power7
- : __strrchr_ppc);
+libc_ifunc_redirected (__redirect_strrchr, strrchr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strrchr_power7
+ : __strrchr_ppc);
weak_alias (strrchr, rindex)
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr.c b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
index 7efc4b0913..9a390c2623 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
@@ -18,17 +18,19 @@
/* Define multiple versions only for definition in libc. */
#if IS_IN (libc)
+# define strstr __redirect_strstr
# include <string.h>
# include <shlib-compat.h>
# include "init-arch.h"
extern __typeof (strstr) __strstr_ppc attribute_hidden;
extern __typeof (strstr) __strstr_power7 attribute_hidden;
+# undef strstr
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
ifunc symbol properly. */
-libc_ifunc (strstr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __strstr_power7
- : __strstr_ppc);
+libc_ifunc_redirected (__redirect_strstr, strstr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strstr_power7
+ : __strstr_ppc);
#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
index 44c9b971ce..a4705423b0 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
@@ -17,6 +17,8 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define wcschr __redirect_wcschr
+# define __wcschr __redirect___wcschr
# include <wchar.h>
# include <shlib-compat.h>
# include "init-arch.h"
@@ -24,15 +26,16 @@
extern __typeof (wcschr) __wcschr_ppc attribute_hidden;
extern __typeof (wcschr) __wcschr_power6 attribute_hidden;
extern __typeof (wcschr) __wcschr_power7 attribute_hidden;
+# undef wcschr
+# undef __wcschr
-libc_ifunc (__wcschr,
- (hwcap & PPC_FEATURE_HAS_VSX)
- ? __wcschr_power7 :
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __wcschr_power6
- : __wcschr_ppc);
+libc_ifunc_redirected (__redirect___wcschr, __wcschr,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __wcschr_power7
+ : (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __wcschr_power6
+ : __wcschr_ppc);
weak_alias (__wcschr, wcschr)
-libc_hidden_builtin_def (wcschr)
#else
#undef libc_hidden_def
#define libc_hidden_def(a)
diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S
index c2d1c4e600..d445b1e1ef 100644
--- a/sysdeps/powerpc/powerpc64/power6/memset.S
+++ b/sysdeps/powerpc/powerpc64/power6/memset.S
@@ -251,7 +251,7 @@ L(cacheAlignedx):
/* A simple loop for the longer (>640 bytes) lengths. This form limits
the branch miss-predicted to exactly 1 at loop exit.*/
L(cacheAligned512):
- cmpli cr1,rLEN,128
+ cmpldi cr1,rLEN,128
blt cr1,L(cacheAligned1)
dcbz 0,rMEMP
addi rLEN,rLEN,-128
diff --git a/sysdeps/powerpc/powerpc64/power9/fpu/Implies b/sysdeps/powerpc/powerpc64/power9/fpu/Implies
index fad2505ab9..ae0dbaf857 100644
--- a/sysdeps/powerpc/powerpc64/power9/fpu/Implies
+++ b/sysdeps/powerpc/powerpc64/power9/fpu/Implies
@@ -1,2 +1 @@
powerpc/powerpc64/power8/fpu
-powerpc/powerpc64/power8
diff --git a/sysdeps/powerpc/sys/platform/ppc.h b/sysdeps/powerpc/sys/platform/ppc.h
index 4d8a41165b..bf6ee31296 100644
--- a/sysdeps/powerpc/sys/platform/ppc.h
+++ b/sysdeps/powerpc/sys/platform/ppc.h
@@ -24,7 +24,7 @@
#include <bits/ppc.h>
/* Read the Time Base Register. */
-static inline uint64_t
+static __inline__ uint64_t
__ppc_get_timebase (void)
{
#if __GNUC_PREREQ (4, 8)
@@ -56,7 +56,7 @@ __ppc_get_timebase (void)
/* Provides a hint that performance will probably be improved if shared
resources dedicated to the executing processor are released for use by other
processors. */
-static inline void
+static __inline__ void
__ppc_yield (void)
{
__asm__ volatile ("or 27,27,27");
@@ -66,7 +66,7 @@ __ppc_yield (void)
resources dedicated to the executing processor are released until
all outstanding storage accesses to caching-inhibited storage have been
completed. */
-static inline void
+static __inline__ void
__ppc_mdoio (void)
{
__asm__ volatile ("or 29,29,29");
@@ -76,7 +76,7 @@ __ppc_mdoio (void)
resources dedicated to the executing processor are released until all
outstanding storage accesses to cacheable storage for which the data is not
in the cache have been completed. */
-static inline void
+static __inline__ void
__ppc_mdoom (void)
{
__asm__ volatile ("or 30,30,30");
@@ -94,19 +94,19 @@ __ppc_mdoom (void)
use unguarded. The default value is 'medium'.
*/
-static inline void
+static __inline__ void
__ppc_set_ppr_med (void)
{
__asm__ volatile ("or 2,2,2");
}
-static inline void
+static __inline__ void
__ppc_set_ppr_med_low (void)
{
__asm__ volatile ("or 6,6,6");
}
-static inline void
+static __inline__ void
__ppc_set_ppr_low (void)
{
__asm__ volatile ("or 1,1,1");
@@ -129,13 +129,13 @@ __ppc_set_ppr_low (void)
#ifdef _ARCH_PWR8
-static inline void
+static __inline__ void
__ppc_set_ppr_very_low (void)
{
__asm__ volatile ("or 31,31,31");
}
-static inline void
+static __inline__ void
__ppc_set_ppr_med_high (void)
{
__asm__ volatile ("or 5,5,5");
diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h
index 9927db7667..5508267c0c 100644
--- a/sysdeps/pthread/semaphore.h
+++ b/sysdeps/pthread/semaphore.h
@@ -21,8 +21,7 @@
#include <features.h>
#include <sys/types.h>
#ifdef __USE_XOPEN2K
-# define __need_timespec
-# include <time.h>
+# include <bits/types/struct_timespec.h>
#endif
/* Get the definition for sem_t. */
diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
index c9fb69cd6c..347ac28528 100644
--- a/sysdeps/s390/configure
+++ b/sysdeps/s390/configure
@@ -177,5 +177,41 @@ then
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z196 zarch instruction support as default" >&5
+$as_echo_n "checking for S390 z196 zarch instruction support as default... " >&6; }
+if ${libc_cv_asm_s390_min_z196_zarch+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.c <<\EOF
+float testinsn (double e)
+{
+ float d;
+ __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
+ return d;
+}
+EOF
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+ -o conftest.o &> /dev/null'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; } ;
+then
+ libc_cv_asm_s390_min_z196_zarch=yes
+else
+ libc_cv_asm_s390_min_z196_zarch=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z196_zarch" >&5
+$as_echo "$libc_cv_asm_s390_min_z196_zarch" >&6; }
+
+if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
+then
+ $as_echo "#define HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT 1" >>confdefs.h
+
+fi
+
test -n "$critic_missing" && as_fn_error $? "
*** $critic_missing" "$LINENO" 5
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index 1db6d84a20..8a782e7c3a 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -86,5 +86,31 @@ then
AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
fi
+AC_CACHE_CHECK(for S390 z196 zarch instruction support as default,
+ libc_cv_asm_s390_min_z196_zarch, [dnl
+cat > conftest.c <<\EOF
+float testinsn (double e)
+{
+ float d;
+ __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
+ return d;
+}
+EOF
+dnl
+dnl test, if assembler supports S390 z196 zarch instructions as default
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+ -o conftest.o &> /dev/null]) ;
+then
+ libc_cv_asm_s390_min_z196_zarch=yes
+else
+ libc_cv_asm_s390_min_z196_zarch=no
+fi
+rm -f conftest* ])
+
+if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
+then
+ AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT)
+fi
+
test -n "$critic_missing" && AC_MSG_ERROR([
*** $critic_missing])
diff --git a/sysdeps/s390/fpu/bits/fenv.h b/sysdeps/s390/fpu/bits/fenv.h
index 6de74b9939..d33f5d921d 100644
--- a/sysdeps/s390/fpu/bits/fenv.h
+++ b/sysdeps/s390/fpu/bits/fenv.h
@@ -90,3 +90,11 @@ typedef struct
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/s390/fpu/fegetmode.c b/sysdeps/s390/fpu/fegetmode.c
new file mode 100644
index 0000000000..a6e67c20b1
--- /dev/null
+++ b/sysdeps/s390/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. S/390 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/sysdeps/s390/fpu/fesetexcept.c b/sysdeps/s390/fpu/fesetexcept.c
new file mode 100644
index 0000000000..e875f13fae
--- /dev/null
+++ b/sysdeps/s390/fpu/fesetexcept.c
@@ -0,0 +1,33 @@
+/* Set given exception flags. S/390 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+
+int
+fesetexcept (int excepts)
+{
+ fexcept_t temp;
+
+ _FPU_GETCW (temp);
+ temp |= (excepts & FE_ALL_EXCEPT) << FPC_FLAGS_SHIFT;
+ _FPU_SETCW (temp);
+
+ return 0;
+}
diff --git a/math/s_ccosl.c b/sysdeps/s390/fpu/fesetmode.c
index 9e981147fc..85a2f2b4e8 100644
--- a/math/s_ccosl.c
+++ b/sysdeps/s390/fpu/fesetmode.c
@@ -1,7 +1,6 @@
-/* Return cosine of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Install given floating-point control modes. S/390 version.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,20 +16,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <complex.h>
#include <fenv.h>
-#include <math.h>
-#include <math_private.h>
+#include <fpu_control.h>
+#include <fenv_libc.h>
+#define FPC_STATUS (FPC_FLAGS_MASK | FPC_DXC_MASK)
-__complex__ long double
-__ccosl (__complex__ long double x)
+int
+fesetmode (const femode_t *modep)
{
- __complex__ long double y;
+ fpu_control_t fpc;
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
+ _FPU_GETCW (fpc);
+ fpc &= FPC_STATUS;
+ if (modep == FE_DFL_MODE)
+ fpc |= _FPU_DEFAULT;
+ else
+ fpc |= *modep & ~FPC_STATUS;
+ _FPU_SETCW (fpc);
- return __ccoshl (y);
+ return 0;
}
-weak_alias (__ccosl, ccosl)
diff --git a/sysdeps/s390/fpu/fetestexceptflag.c b/sysdeps/s390/fpu/fetestexceptflag.c
new file mode 100644
index 0000000000..c472d8c87d
--- /dev/null
+++ b/sysdeps/s390/fpu/fetestexceptflag.c
@@ -0,0 +1,31 @@
+/* Test exception in saved exception state. S/390 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fenv_libc.h>
+
+int
+fetestexceptflag (const fexcept_t *flagp, int excepts)
+{
+ /* As *flagp is obtained by an earlier call of fegetexceptflag the
+ bits 0-5 of dxc-byte are either zero or correspond to the
+ flag-bits. Evaluate flags and last dxc-exception-code. */
+ return (((*flagp >> FPC_FLAGS_SHIFT) | (*flagp >> FPC_DXC_SHIFT))
+ & excepts
+ & FE_ALL_EXCEPT);
+}
diff --git a/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h b/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h
new file mode 100644
index 0000000000..c4c119f25a
--- /dev/null
+++ b/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h
@@ -0,0 +1,36 @@
+/* Fix for missing "invalid" exceptions from floating-point
+ comparisons. s390 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H 1
+
+/* GCC uses unordered comparison instructions like cebr (Short BFP COMPARE)
+ when it should use ordered comparison instructions like kebr
+ (Short BFP COMPARE AND SIGNAL) in order to raise invalid exceptions if
+ any operand is quiet (or signaling) NAN. See gcc bugzilla:
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77918>.
+ There exists an equivalent gcc bugzilla for Intel:
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52451>.
+ Once the s390 gcc bug is fixed, the definition of FIX_COMPARE_INVALID
+ should have a __GNUC_PREREQ conditional added so that e.g. the workaround
+ to call feraiseexcept (FE_INVALID) in math/s_iseqsig_template.c can be
+ avoided. */
+#define FIX_COMPARE_INVALID 1
+
+#endif /* fix-fp-int-compare-invalid.h */
diff --git a/sysdeps/s390/fpu/fraiseexcpt.c b/sysdeps/s390/fpu/fraiseexcpt.c
index 92a1a7db68..ac6dfe7739 100644
--- a/sysdeps/s390/fpu/fraiseexcpt.c
+++ b/sysdeps/s390/fpu/fraiseexcpt.c
@@ -35,6 +35,23 @@ fexceptadd (float d, float e)
__asm__ __volatile__ ("aebr %0,%1" : : "f" (d), "f" (e) );
}
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
+static __inline__ void
+fexceptround (double e)
+{
+ float d;
+ /* Load rounded from double to float with M3 = round toward 0, M4 = Suppress
+ IEEE-inexact exception.
+ In case of e=0x1p128 and the overflow-mask bit is zero, only the
+ IEEE-overflow flag is set. If overflow-mask bit is one, DXC field is set to
+ 0x20 "IEEE overflow, exact".
+ In case of e=0x1p-150 and the underflow-mask bit is zero, only the
+ IEEE-underflow flag is set. If underflow-mask bit is one, DXC field is set
+ to 0x10 "IEEE underflow, exact".
+ This instruction is available with a zarch machine >= z196. */
+ __asm__ __volatile__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
+}
+#endif
int
__feraiseexcept (int excepts)
@@ -54,13 +71,29 @@ __feraiseexcept (int excepts)
/* Next: overflow. */
if (FE_OVERFLOW & excepts)
- /* I don't think we can do the same trick as intel so we will have
- to live with inexact coming also. */
- fexceptadd (FLT_MAX, 1.0e32);
+ {
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
+ fexceptround (0x1p128);
+#else
+ /* If overflow-mask bit is zero, both IEEE-overflow and IEEE-inexact flags
+ are set. If overflow-mask bit is one, DXC field is set to 0x2C "IEEE
+ overflow, inexact and incremented". */
+ fexceptadd (FLT_MAX, 1.0e32);
+#endif
+ }
/* Next: underflow. */
if (FE_UNDERFLOW & excepts)
- fexceptdiv (FLT_MIN, 3.0);
+ {
+#ifdef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
+ fexceptround (0x1p-150);
+#else
+ /* If underflow-mask bit is zero, both IEEE-underflow and IEEE-inexact
+ flags are set. If underflow-mask bit is one, DXC field is set to 0x1C
+ "IEEE underflow, inexact and incremented". */
+ fexceptdiv (FLT_MIN, 3.0);
+#endif
+ }
/* Last: inexact. */
if (FE_INEXACT & excepts)
diff --git a/sysdeps/s390/fpu/fsetexcptflg.c b/sysdeps/s390/fpu/fsetexcptflg.c
index 25ade854bd..56a52c6bb7 100644
--- a/sysdeps/s390/fpu/fsetexcptflg.c
+++ b/sysdeps/s390/fpu/fsetexcptflg.c
@@ -45,8 +45,7 @@ fesetexceptflag (const fexcept_t *flagp, int excepts)
& newexcepts;
/* Store the new status word (along with the rest of the environment.
- Possibly new exceptions are set but they won't get executed unless
- the next floating-point instruction. */
+ Possibly new exceptions are set but they won't get executed. */
_FPU_SETCW (temp);
/* Success. */
diff --git a/sysdeps/s390/fpu/libm-test-ulps b/sysdeps/s390/fpu/libm-test-ulps
index bc5795b361..9a72be074c 100644
--- a/sysdeps/s390/fpu/libm-test-ulps
+++ b/sysdeps/s390/fpu/libm-test-ulps
@@ -126,9 +126,7 @@ ildouble: 4
ldouble: 4
Function: "atan":
-double: 1
float: 1
-idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -372,9 +370,7 @@ ildouble: 3
ldouble: 3
Function: "carg":
-double: 1
float: 1
-idouble: 1
ifloat: 1
ildouble: 2
ldouble: 2
@@ -884,9 +880,7 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "clog":
-double: 1
float: 1
-idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -900,9 +894,9 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "clog10":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 2
ldouble: 2
diff --git a/sysdeps/s390/fpu/libm-test-ulps-name b/sysdeps/s390/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..4a55100a0e
--- /dev/null
+++ b/sysdeps/s390/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+S/390
diff --git a/sysdeps/s390/multiarch/ifunc-resolve.h b/sysdeps/s390/multiarch/ifunc-resolve.h
index 26e097ad6e..768829b39b 100644
--- a/sysdeps/s390/multiarch/ifunc-resolve.h
+++ b/sysdeps/s390/multiarch/ifunc-resolve.h
@@ -40,53 +40,46 @@
".machine pop" "\n" \
: "=QS" (STFLE_BITS), "+d" (reg0) \
: : "cc");
+#define s390_libc_ifunc_init() \
+ unsigned long long stfle_bits = 0ULL; \
+ if (__glibc_likely((dl_hwcap & HWCAP_S390_STFLE) \
+ && (dl_hwcap & HWCAP_S390_ZARCH) \
+ && (dl_hwcap & HWCAP_S390_HIGH_GPRS))) \
+ { \
+ S390_STORE_STFLE (stfle_bits); \
+ }
-#define s390_libc_ifunc(FUNC) \
- __asm__ (".globl " #FUNC "\n\t" \
- ".type " #FUNC ",@gnu_indirect_function\n\t" \
- ".set " #FUNC ",__resolve_" #FUNC "\n\t"); \
- \
+#define s390_libc_ifunc(TYPE_FUNC, RESOLVERFUNC, FUNC) \
/* Make the declarations of the optimized functions hidden in order
to prevent GOT slots being generated for them. */ \
- extern void *__##FUNC##_z196 attribute_hidden; \
- extern void *__##FUNC##_z10 attribute_hidden; \
- extern void *__##FUNC##_default attribute_hidden; \
- \
- void *__resolve_##FUNC (unsigned long int dl_hwcap) \
- { \
- if ((dl_hwcap & HWCAP_S390_STFLE) \
- && (dl_hwcap & HWCAP_S390_ZARCH) \
- && (dl_hwcap & HWCAP_S390_HIGH_GPRS)) \
- { \
- unsigned long long stfle_bits; \
- S390_STORE_STFLE (stfle_bits); \
- \
- if (S390_IS_Z196 (stfle_bits)) \
- return &__##FUNC##_z196; \
- else if (S390_IS_Z10 (stfle_bits)) \
- return &__##FUNC##_z10; \
- else \
- return &__##FUNC##_default; \
- } \
- else \
- return &__##FUNC##_default; \
- }
+ extern __typeof (TYPE_FUNC) RESOLVERFUNC##_z196 attribute_hidden; \
+ extern __typeof (TYPE_FUNC) RESOLVERFUNC##_z10 attribute_hidden; \
+ extern __typeof (TYPE_FUNC) RESOLVERFUNC##_default attribute_hidden; \
+ __ifunc (TYPE_FUNC, FUNC, \
+ __glibc_likely (S390_IS_Z196 (stfle_bits)) \
+ ? RESOLVERFUNC##_z196 \
+ : __glibc_likely (S390_IS_Z10 (stfle_bits)) \
+ ? RESOLVERFUNC##_z10 \
+ : RESOLVERFUNC##_default, \
+ unsigned long int dl_hwcap, s390_libc_ifunc_init);
#define s390_vx_libc_ifunc(FUNC) \
- s390_vx_libc_ifunc2(FUNC, FUNC)
+ s390_vx_libc_ifunc2_redirected(FUNC, FUNC, FUNC)
-#define s390_vx_libc_ifunc2(RESOLVERFUNC, FUNC) \
+#define s390_vx_libc_ifunc_redirected(TYPE_FUNC, FUNC) \
+ s390_vx_libc_ifunc2_redirected(TYPE_FUNC, FUNC, FUNC)
+
+#define s390_vx_libc_ifunc2(RESOLVERFUNC, FUNC) \
+ s390_vx_libc_ifunc2_redirected(FUNC, RESOLVERFUNC, FUNC)
+
+#define s390_vx_libc_ifunc_init()
+#define s390_vx_libc_ifunc2_redirected(TYPE_FUNC, RESOLVERFUNC, FUNC) \
/* Make the declarations of the optimized functions hidden in order
to prevent GOT slots being generated for them. */ \
- extern __typeof (FUNC) RESOLVERFUNC##_vx attribute_hidden; \
- extern __typeof (FUNC) RESOLVERFUNC##_c attribute_hidden; \
- extern void *__resolve_##RESOLVERFUNC (unsigned long int) __asm__ (#FUNC); \
- \
- void *__resolve_##RESOLVERFUNC (unsigned long int dl_hwcap) \
- { \
- if (dl_hwcap & HWCAP_S390_VX) \
- return &RESOLVERFUNC##_vx; \
- else \
- return &RESOLVERFUNC##_c; \
- } \
- __asm__ (".type " #FUNC ", %gnu_indirect_function");
+ extern __typeof (TYPE_FUNC) RESOLVERFUNC##_vx attribute_hidden; \
+ extern __typeof (TYPE_FUNC) RESOLVERFUNC##_c attribute_hidden; \
+ __ifunc (TYPE_FUNC, FUNC, \
+ (dl_hwcap & HWCAP_S390_VX) \
+ ? RESOLVERFUNC##_vx \
+ : RESOLVERFUNC##_c, \
+ unsigned long int dl_hwcap, s390_vx_libc_ifunc_init);
diff --git a/sysdeps/s390/multiarch/memchr.c b/sysdeps/s390/multiarch/memchr.c
index f80de1cc1f..891ec7aa56 100644
--- a/sysdeps/s390/multiarch/memchr.c
+++ b/sysdeps/s390/multiarch/memchr.c
@@ -17,8 +17,11 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define memchr __redirect_memchr
# include <string.h>
+# undef memchr
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__memchr, memchr)
+s390_vx_libc_ifunc2_redirected (__redirect_memchr, __memchr, memchr)
+
#endif
diff --git a/sysdeps/s390/multiarch/mempcpy.c b/sysdeps/s390/multiarch/mempcpy.c
index 34d8329ba8..bee3ee47bb 100644
--- a/sysdeps/s390/multiarch/mempcpy.c
+++ b/sysdeps/s390/multiarch/mempcpy.c
@@ -18,9 +18,15 @@
#if defined SHARED && IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+/* Omit the mempcpy inline definitions because it would redefine mempcpy. */
+# define _HAVE_STRING_ARCH_mempcpy 1
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
# include <ifunc-resolve.h>
-s390_libc_ifunc (__mempcpy)
-__asm__ (".weak mempcpy\n\t"
- ".set mempcpy,__mempcpy\n\t");
+s390_libc_ifunc (__redirect___mempcpy, ____mempcpy, __mempcpy)
+weak_alias (__mempcpy, mempcpy);
#endif
diff --git a/sysdeps/s390/multiarch/rawmemchr.c b/sysdeps/s390/multiarch/rawmemchr.c
index 7186ccd9d4..c4afa24004 100644
--- a/sysdeps/s390/multiarch/rawmemchr.c
+++ b/sysdeps/s390/multiarch/rawmemchr.c
@@ -17,10 +17,13 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define __rawmemchr __redirect___rawmemchr
# include <string.h>
+# undef __rawmemchr
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__rawmemchr)
+s390_vx_libc_ifunc2_redirected (__redirect___rawmemchr, __rawmemchr
+ , __rawmemchr)
weak_alias (__rawmemchr, rawmemchr)
#else
diff --git a/sysdeps/s390/multiarch/stpcpy.c b/sysdeps/s390/multiarch/stpcpy.c
index dcde01278b..cea6c0793f 100644
--- a/sysdeps/s390/multiarch/stpcpy.c
+++ b/sysdeps/s390/multiarch/stpcpy.c
@@ -17,13 +17,18 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define stpcpy __redirect_stpcpy
+# define __stpcpy __redirect___stpcpy
+/* Omit the stpcpy inline definitions because it would redefine stpcpy. */
+# define __NO_STRING_INLINES
# define NO_MEMPCPY_STPCPY_REDIRECT
# include <string.h>
+# undef stpcpy
+# undef __stpcpy
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__stpcpy)
+s390_vx_libc_ifunc_redirected (__redirect___stpcpy, __stpcpy);
weak_alias (__stpcpy, stpcpy)
-libc_hidden_builtin_def (stpcpy)
#else
# include <string/stpcpy.c>
diff --git a/sysdeps/s390/multiarch/stpncpy.c b/sysdeps/s390/multiarch/stpncpy.c
index f5335b42ac..cbbe8ba4fe 100644
--- a/sysdeps/s390/multiarch/stpncpy.c
+++ b/sysdeps/s390/multiarch/stpncpy.c
@@ -17,10 +17,14 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define stpncpy __redirect_stpncpy
+# define __stpncpy __redirect___stpncpy
# include <string.h>
+# undef stpncpy
+# undef __stpncpy
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__stpncpy)
+s390_vx_libc_ifunc_redirected (__redirect___stpncpy, __stpncpy)
weak_alias (__stpncpy, stpncpy)
#else
diff --git a/sysdeps/s390/multiarch/strcat.c b/sysdeps/s390/multiarch/strcat.c
index c3b5e1c9d6..0c74c91954 100644
--- a/sysdeps/s390/multiarch/strcat.c
+++ b/sysdeps/s390/multiarch/strcat.c
@@ -17,10 +17,12 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcat __redirect_strcat
# include <string.h>
+# undef strcat
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strcat, strcat)
+s390_vx_libc_ifunc2_redirected (__redirect_strcat, __strcat, strcat)
#else
# include <string/strcat.c>
diff --git a/sysdeps/s390/multiarch/strchr.c b/sysdeps/s390/multiarch/strchr.c
index 3c8c7e4600..3b378b9320 100644
--- a/sysdeps/s390/multiarch/strchr.c
+++ b/sysdeps/s390/multiarch/strchr.c
@@ -17,10 +17,14 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strchr __redirect_strchr
+/* Omit the strchr inline definitions because it would redefine strchr. */
+# define __NO_STRING_INLINES
# include <string.h>
+# undef strchr
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strchr, strchr)
+s390_vx_libc_ifunc2_redirected (__redirect_strchr, __strchr, strchr)
weak_alias (strchr, index)
#else
diff --git a/sysdeps/s390/multiarch/strcmp.c b/sysdeps/s390/multiarch/strcmp.c
index c4ccd34420..faeaaa54a6 100644
--- a/sysdeps/s390/multiarch/strcmp.c
+++ b/sysdeps/s390/multiarch/strcmp.c
@@ -17,10 +17,13 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcmp __redirect_strcmp
+/* Omit the strcmp inline definitions because it would redefine strcmp. */
+# define __NO_STRING_INLINES
# include <string.h>
# include <ifunc-resolve.h>
+# undef strcmp
+s390_vx_libc_ifunc2_redirected (__redirect_strcmp, __strcmp, strcmp)
-# undef strcmp
-s390_vx_libc_ifunc2 (__strcmp, strcmp)
#endif
diff --git a/sysdeps/s390/multiarch/strcpy.c b/sysdeps/s390/multiarch/strcpy.c
index f348199112..9053b12963 100644
--- a/sysdeps/s390/multiarch/strcpy.c
+++ b/sysdeps/s390/multiarch/strcpy.c
@@ -17,8 +17,11 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcpy __redirect_strcpy
# include <string.h>
+# undef strcpy
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strcpy, strcpy)
+s390_vx_libc_ifunc2_redirected (__redirect_strcpy, __strcpy, strcpy)
+
#endif
diff --git a/sysdeps/s390/multiarch/strcspn.c b/sysdeps/s390/multiarch/strcspn.c
index c23452a791..d1fe33b91f 100644
--- a/sysdeps/s390/multiarch/strcspn.c
+++ b/sysdeps/s390/multiarch/strcspn.c
@@ -17,10 +17,14 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strcspn __redirect_strcspn
+/* Omit the strcspn inline definitions because it would redefine strcspn. */
+# define __NO_STRING_INLINES
# include <string.h>
+# undef strcspn
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strcspn, strcspn)
+s390_vx_libc_ifunc2_redirected (__redirect_strcspn, __strcspn, strcspn)
#else
# include <string/strcspn.c>
diff --git a/sysdeps/s390/multiarch/strlen.c b/sysdeps/s390/multiarch/strlen.c
index 098d4e1e58..8329f2bec6 100644
--- a/sysdeps/s390/multiarch/strlen.c
+++ b/sysdeps/s390/multiarch/strlen.c
@@ -17,10 +17,12 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strlen __redirect_strlen
# include <string.h>
# include <ifunc-resolve.h>
+# undef strlen
-s390_vx_libc_ifunc2 (__strlen, strlen)
+s390_vx_libc_ifunc2_redirected (__redirect_strlen, __strlen, strlen)
#else
# include <string/strlen.c>
diff --git a/sysdeps/s390/multiarch/strncmp.c b/sysdeps/s390/multiarch/strncmp.c
index 9a72c79bfd..2bdf4bf8de 100644
--- a/sysdeps/s390/multiarch/strncmp.c
+++ b/sysdeps/s390/multiarch/strncmp.c
@@ -17,13 +17,14 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strncmp __redirect_strncmp
+/* Omit the strncmp inline definitions because it would redefine strncmp. */
+# define __NO_STRING_INLINES
# include <string.h>
+# undef strncmp
# include <ifunc-resolve.h>
-
-# undef strcmp
-extern __typeof (strncmp) __strncmp;
-s390_vx_libc_ifunc2 (__strncmp, strncmp)
+s390_vx_libc_ifunc2_redirected (__redirect_strncmp, __strncmp, strncmp)
#else
# include <string/strncmp.c>
diff --git a/sysdeps/s390/multiarch/strncpy.c b/sysdeps/s390/multiarch/strncpy.c
index 1464551875..c4d13a98a9 100644
--- a/sysdeps/s390/multiarch/strncpy.c
+++ b/sysdeps/s390/multiarch/strncpy.c
@@ -17,8 +17,13 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strncpy __redirect_strncpy
+/* Omit the strncpy inline definitions because it would redefine strncpy. */
+# define __NO_STRING_INLINES
# include <string.h>
+# undef strncpy
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strncpy, strncpy)
+s390_vx_libc_ifunc2_redirected (__redirect_strncpy, __strncpy, strncpy);
+
#endif
diff --git a/sysdeps/s390/multiarch/strnlen.c b/sysdeps/s390/multiarch/strnlen.c
index 48c3bb73e6..ecb69ebad3 100644
--- a/sysdeps/s390/multiarch/strnlen.c
+++ b/sysdeps/s390/multiarch/strnlen.c
@@ -17,12 +17,15 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
# include <string.h>
+# undef strnlen
+# undef __strnlen
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__strnlen)
+s390_vx_libc_ifunc_redirected (__redirect___strnlen, __strnlen)
weak_alias (__strnlen, strnlen)
-libc_hidden_def (strnlen)
#else
# include <string/strnlen.c>
diff --git a/sysdeps/s390/multiarch/strpbrk.c b/sysdeps/s390/multiarch/strpbrk.c
index cdc139929f..09c3fffdf1 100644
--- a/sysdeps/s390/multiarch/strpbrk.c
+++ b/sysdeps/s390/multiarch/strpbrk.c
@@ -17,10 +17,14 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strpbrk __redirect_strpbrk
+/* Omit the strpbrk inline definitions because it would redefine strpbrk. */
+# define __NO_STRING_INLINES
# include <string.h>
+# undef strpbrk
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strpbrk, strpbrk)
+s390_vx_libc_ifunc2_redirected (__redirect_strpbrk, __strpbrk, strpbrk)
#else
# include <string/strpbrk.c>
diff --git a/sysdeps/s390/multiarch/strrchr.c b/sysdeps/s390/multiarch/strrchr.c
index e515d6b6e6..2da8581708 100644
--- a/sysdeps/s390/multiarch/strrchr.c
+++ b/sysdeps/s390/multiarch/strrchr.c
@@ -17,11 +17,13 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strrchr __redirect_strrchr
# include <string.h>
+# undef strrchr
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strrchr, strrchr)
-weak_alias (strrchr, rindex)
+s390_vx_libc_ifunc2_redirected (__redirect_strrchr, __strrchr, strrchr)
+weak_alias (strrchr, rindex);
#else
# include <string/strrchr.c>
diff --git a/sysdeps/s390/multiarch/strspn.c b/sysdeps/s390/multiarch/strspn.c
index 7c26af8ced..1d9514d463 100644
--- a/sysdeps/s390/multiarch/strspn.c
+++ b/sysdeps/s390/multiarch/strspn.c
@@ -17,10 +17,14 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define strspn __redirect_strspn
+/* Omit the strspn inline definitions because it would redefine strspn. */
+# define __NO_STRING_INLINES
# include <string.h>
+# undef strspn
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__strspn, strspn)
+s390_vx_libc_ifunc2_redirected (__redirect_strspn, __strspn, strspn)
#else
# include <string/strspn.c>
diff --git a/sysdeps/s390/multiarch/wcschr.c b/sysdeps/s390/multiarch/wcschr.c
index fb51097cd6..3e0ff8b6db 100644
--- a/sysdeps/s390/multiarch/wcschr.c
+++ b/sysdeps/s390/multiarch/wcschr.c
@@ -17,12 +17,15 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wcschr __redirect_wcschr
+# define __wcschr __redirect___wcschr
# include <wchar.h>
+# undef wcschr
+# undef __wcschr
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__wcschr)
+s390_vx_libc_ifunc_redirected (__redirect___wcschr, __wcschr)
weak_alias (__wcschr, wcschr)
-libc_hidden_weak (wcschr)
#else
# include <wcsmbs/wcschr.c>
diff --git a/sysdeps/s390/multiarch/wcscmp.c b/sysdeps/s390/multiarch/wcscmp.c
index 705ef4596e..dc29b32a29 100644
--- a/sysdeps/s390/multiarch/wcscmp.c
+++ b/sysdeps/s390/multiarch/wcscmp.c
@@ -17,10 +17,12 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define __wcscmp __redirect___wcscmp
# include <wchar.h>
+# undef __wcscmp
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__wcscmp)
+s390_vx_libc_ifunc_redirected (__redirect___wcscmp, __wcscmp)
weak_alias (__wcscmp, wcscmp)
#else
diff --git a/sysdeps/s390/multiarch/wcspbrk.c b/sysdeps/s390/multiarch/wcspbrk.c
index 198144d2c5..9824bd536c 100644
--- a/sysdeps/s390/multiarch/wcspbrk.c
+++ b/sysdeps/s390/multiarch/wcspbrk.c
@@ -17,10 +17,12 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wcspbrk __redirect_wcspbrk
# include <wchar.h>
+# undef wcspbrk
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__wcspbrk, wcspbrk)
+s390_vx_libc_ifunc2_redirected (__redirect_wcspbrk, __wcspbrk, wcspbrk)
#else
# include <wcsmbs/wcspbrk.c>
diff --git a/sysdeps/s390/multiarch/wcsspn.c b/sysdeps/s390/multiarch/wcsspn.c
index 167a881d13..d153d44b2f 100644
--- a/sysdeps/s390/multiarch/wcsspn.c
+++ b/sysdeps/s390/multiarch/wcsspn.c
@@ -17,10 +17,12 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wcsspn __redirect_wcsspn
# include <wchar.h>
+# undef wcsspn
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc2 (__wcsspn, wcsspn)
+s390_vx_libc_ifunc2_redirected (__redirect_wcsspn, __wcsspn, wcsspn)
#else
# include <wcsmbs/wcsspn.c>
diff --git a/sysdeps/s390/multiarch/wmemchr.c b/sysdeps/s390/multiarch/wmemchr.c
index f2bfe3c7a5..45b344182f 100644
--- a/sysdeps/s390/multiarch/wmemchr.c
+++ b/sysdeps/s390/multiarch/wmemchr.c
@@ -17,12 +17,15 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wmemchr __redirect_wmemchr
+# define __wmemchr __redirect___wmemchr
# include <wchar.h>
+# undef wmemchr
+# undef __wmemchr
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__wmemchr)
+s390_vx_libc_ifunc_redirected (__redirect___wmemchr, __wmemchr)
weak_alias (__wmemchr, wmemchr)
-libc_hidden_weak (wmemchr)
#else
# include <wcsmbs/wmemchr.c>
diff --git a/sysdeps/s390/multiarch/wmemset.c b/sysdeps/s390/multiarch/wmemset.c
index e9e695fc0a..2fc57ee71d 100644
--- a/sysdeps/s390/multiarch/wmemset.c
+++ b/sysdeps/s390/multiarch/wmemset.c
@@ -17,12 +17,15 @@
<http://www.gnu.org/licenses/>. */
#if defined HAVE_S390_VX_ASM_SUPPORT && IS_IN (libc)
+# define wmemset __redirect_wmemset
+# define __wmemset __redirect___wmemset
# include <wchar.h>
+# undef wmemset
+# undef __wmemset
# include <ifunc-resolve.h>
-s390_vx_libc_ifunc (__wmemset)
+s390_vx_libc_ifunc_redirected (__redirect___wmemset, __wmemset)
weak_alias (__wmemset, wmemset)
-libc_hidden_weak (wmemset)
#else
# include <wcsmbs/wmemset.c>
diff --git a/sysdeps/s390/nptl/Makefile b/sysdeps/s390/nptl/Makefile
index 5734b983b0..352edc0504 100644
--- a/sysdeps/s390/nptl/Makefile
+++ b/sysdeps/s390/nptl/Makefile
@@ -20,5 +20,6 @@ gen-as-const-headers += tcb-offsets.sym
endif
ifeq ($(subdir),nptl)
-libpthread-routines += ptw-sysdep
+libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
endif
diff --git a/sysdeps/s390/nptl/bits/pthreadtypes.h b/sysdeps/s390/nptl/bits/pthreadtypes.h
index 40d10fea59..21d13bd7e7 100644
--- a/sysdeps/s390/nptl/bits/pthreadtypes.h
+++ b/sysdeps/s390/nptl/bits/pthreadtypes.h
@@ -86,7 +86,7 @@ typedef union
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
#if __WORDSIZE == 64
# ifdef ENABLE_LOCK_ELISION
diff --git a/sysdeps/s390/s390-32/bits/wordsize.h b/sysdeps/s390/s390-32/bits/wordsize.h
index da791fa28e..c7a5fbf655 100644
--- a/sysdeps/s390/s390-32/bits/wordsize.h
+++ b/sysdeps/s390/s390-32/bits/wordsize.h
@@ -5,8 +5,11 @@
#else
# define __WORDSIZE 32
# define __WORDSIZE32_SIZE_ULONG 1
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
+#define __WORDSIZE_TIME64_COMPAT32 0
+
#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
/* Signal that we didn't used to have a `long double'. The changes all
diff --git a/sysdeps/s390/s390-32/multiarch/memcmp.c b/sysdeps/s390/s390-32/multiarch/memcmp.c
index 44f72dc8ca..453b1706f7 100644
--- a/sysdeps/s390/s390-32/multiarch/memcmp.c
+++ b/sysdeps/s390/s390-32/multiarch/memcmp.c
@@ -17,8 +17,11 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define memcmp __redirect_memcmp
+# include <string.h>
+# undef memcmp
# include <ifunc-resolve.h>
-s390_libc_ifunc (memcmp)
-__asm__(".weak bcmp ; bcmp = memcmp");
+s390_libc_ifunc (__redirect_memcmp, __memcmp, memcmp)
+weak_alias (memcmp, bcmp);
#endif
diff --git a/sysdeps/s390/s390-32/multiarch/memcpy.c b/sysdeps/s390/s390-32/multiarch/memcpy.c
index 2a98aa0b82..33e4bcdca2 100644
--- a/sysdeps/s390/s390-32/multiarch/memcpy.c
+++ b/sysdeps/s390/s390-32/multiarch/memcpy.c
@@ -18,7 +18,10 @@
/* In the static lib memcpy is needed before the reloc is resolved. */
#if defined SHARED && IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
# include <ifunc-resolve.h>
-s390_libc_ifunc (memcpy)
+s390_libc_ifunc (__redirect_memcpy, __memcpy, memcpy)
#endif
diff --git a/sysdeps/s390/s390-32/multiarch/memset.c b/sysdeps/s390/s390-32/multiarch/memset.c
index 89b8102f2a..84ddedaf04 100644
--- a/sysdeps/s390/s390-32/multiarch/memset.c
+++ b/sysdeps/s390/s390-32/multiarch/memset.c
@@ -17,7 +17,10 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
# include <ifunc-resolve.h>
-s390_libc_ifunc (memset)
+s390_libc_ifunc (__redirect_memset, __memset, memset)
#endif
diff --git a/sysdeps/s390/s390-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h
index da791fa28e..31e0ec6699 100644
--- a/sysdeps/s390/s390-64/bits/wordsize.h
+++ b/sysdeps/s390/s390-64/bits/wordsize.h
@@ -5,8 +5,11 @@
#else
# define __WORDSIZE 32
# define __WORDSIZE32_SIZE_ULONG 1
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
+#define __WORDSIZE_TIME64_COMPAT32 0
+
#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
/* Signal that we didn't used to have a `long double'. The changes all
diff --git a/sysdeps/s390/s390-64/multiarch/memcmp.c b/sysdeps/s390/s390-64/multiarch/memcmp.c
index 44f72dc8ca..453b1706f7 100644
--- a/sysdeps/s390/s390-64/multiarch/memcmp.c
+++ b/sysdeps/s390/s390-64/multiarch/memcmp.c
@@ -17,8 +17,11 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define memcmp __redirect_memcmp
+# include <string.h>
+# undef memcmp
# include <ifunc-resolve.h>
-s390_libc_ifunc (memcmp)
-__asm__(".weak bcmp ; bcmp = memcmp");
+s390_libc_ifunc (__redirect_memcmp, __memcmp, memcmp)
+weak_alias (memcmp, bcmp);
#endif
diff --git a/sysdeps/s390/s390-64/multiarch/memcpy.c b/sysdeps/s390/s390-64/multiarch/memcpy.c
index 2a98aa0b82..33e4bcdca2 100644
--- a/sysdeps/s390/s390-64/multiarch/memcpy.c
+++ b/sysdeps/s390/s390-64/multiarch/memcpy.c
@@ -18,7 +18,10 @@
/* In the static lib memcpy is needed before the reloc is resolved. */
#if defined SHARED && IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
# include <ifunc-resolve.h>
-s390_libc_ifunc (memcpy)
+s390_libc_ifunc (__redirect_memcpy, __memcpy, memcpy)
#endif
diff --git a/sysdeps/s390/s390-64/multiarch/memset.c b/sysdeps/s390/s390-64/multiarch/memset.c
index 89b8102f2a..84ddedaf04 100644
--- a/sysdeps/s390/s390-64/multiarch/memset.c
+++ b/sysdeps/s390/s390-64/multiarch/memset.c
@@ -17,7 +17,10 @@
<http://www.gnu.org/licenses/>. */
#if IS_IN (libc)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
# include <ifunc-resolve.h>
-s390_libc_ifunc (memset)
+s390_libc_ifunc (__redirect_memset, __memset, memset)
#endif
diff --git a/sysdeps/sh/bits/fenv.h b/sysdeps/sh/bits/fenv.h
index 254c50fb97..200b53899b 100644
--- a/sysdeps/sh/bits/fenv.h
+++ b/sysdeps/sh/bits/fenv.h
@@ -74,3 +74,11 @@ fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/sh/libm-test-ulps-name b/sysdeps/sh/libm-test-ulps-name
new file mode 100644
index 0000000000..b6c67c9520
--- /dev/null
+++ b/sysdeps/sh/libm-test-ulps-name
@@ -0,0 +1 @@
+SH
diff --git a/sysdeps/sh/nptl/bits/pthreadtypes.h b/sysdeps/sh/nptl/bits/pthreadtypes.h
index 13fbd7379a..5354f78676 100644
--- a/sysdeps/sh/nptl/bits/pthreadtypes.h
+++ b/sysdeps/sh/nptl/bits/pthreadtypes.h
@@ -64,7 +64,7 @@ typedef union
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
unsigned int __nusers;
__extension__ union
diff --git a/sysdeps/sh/sh4/fpu/fegetmode.c b/sysdeps/sh/sh4/fpu/fegetmode.c
new file mode 100644
index 0000000000..53691b214c
--- /dev/null
+++ b/sysdeps/sh/sh4/fpu/fegetmode.c
@@ -0,0 +1,27 @@
+/* Store current floating-point control modes. SH4 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ _FPU_GETCW (*modep);
+ return 0;
+}
diff --git a/sysdeps/sh/sh4/fpu/fesetexcept.c b/sysdeps/sh/sh4/fpu/fesetexcept.c
new file mode 100644
index 0000000000..6be9494c95
--- /dev/null
+++ b/sysdeps/sh/sh4/fpu/fesetexcept.c
@@ -0,0 +1,32 @@
+/* Set given exception flags. SH4 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexcept (int excepts)
+{
+ fpu_control_t temp;
+
+ _FPU_GETCW (temp);
+ temp |= (excepts & FE_ALL_EXCEPT);
+ _FPU_SETCW (temp);
+
+ return 0;
+}
diff --git a/sysdeps/sh/sh4/fpu/fesetmode.c b/sysdeps/sh/sh4/fpu/fesetmode.c
new file mode 100644
index 0000000000..eb1cddc1e7
--- /dev/null
+++ b/sysdeps/sh/sh4/fpu/fesetmode.c
@@ -0,0 +1,38 @@
+/* Install given floating-point control modes. SH4 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+#define FPU_STATUS 0x3f07c
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t fpscr;
+
+ _FPU_GETCW (fpscr);
+ fpscr &= FPU_STATUS;
+ if (modep == FE_DFL_MODE)
+ fpscr |= _FPU_DEFAULT;
+ else
+ fpscr |= *modep & ~FPU_STATUS;
+ _FPU_SETCW (fpscr);
+
+ return 0;
+}
diff --git a/sysdeps/sparc/fpu/bits/fenv.h b/sysdeps/sparc/fpu/bits/fenv.h
index 29328f714f..37c82ff5eb 100644
--- a/sysdeps/sparc/fpu/bits/fenv.h
+++ b/sysdeps/sparc/fpu/bits/fenv.h
@@ -91,3 +91,11 @@ typedef unsigned long int fenv_t;
# define __fenv_stfsr(X) __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X))
# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X))
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned long int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/sparc/fpu/fegetmode.c b/sysdeps/sparc/fpu/fegetmode.c
new file mode 100644
index 0000000000..68e694e03d
--- /dev/null
+++ b/sysdeps/sparc/fpu/fegetmode.c
@@ -0,0 +1,26 @@
+/* Store current floating-point control modes. SPARC version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fegetmode (femode_t *modep)
+{
+ __fenv_stfsr (*modep);
+ return 0;
+}
diff --git a/sysdeps/sparc/fpu/fesetexcept.c b/sysdeps/sparc/fpu/fesetexcept.c
new file mode 100644
index 0000000000..ef1c5de112
--- /dev/null
+++ b/sysdeps/sparc/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. SPARC version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fesetexcept (int excepts)
+{
+ fenv_t tmp;
+
+ __fenv_stfsr (tmp);
+ tmp |= excepts & FE_ALL_EXCEPT;
+ __fenv_ldfsr (tmp);
+
+ return 0;
+}
diff --git a/sysdeps/sparc/fpu/fesetmode.c b/sysdeps/sparc/fpu/fesetmode.c
new file mode 100644
index 0000000000..4a0080e1a4
--- /dev/null
+++ b/sysdeps/sparc/fpu/fesetmode.c
@@ -0,0 +1,38 @@
+/* Install given floating-point control modes. SPARC version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+#define FPU_CONTROL_BITS 0xcfc00000UL
+
+int
+fesetmode (const femode_t *modep)
+{
+ femode_t fsr;
+
+ __fenv_stfsr (fsr);
+ fsr &= ~FPU_CONTROL_BITS;
+ if (modep == FE_DFL_MODE)
+ fsr |= _FPU_DEFAULT;
+ else
+ fsr |= *modep & FPU_CONTROL_BITS;
+ __fenv_ldfsr (fsr);
+
+ return 0;
+}
diff --git a/sysdeps/sparc/fpu/libm-test-ulps-name b/sysdeps/sparc/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..71240543c4
--- /dev/null
+++ b/sysdeps/sparc/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+Sparc
diff --git a/sysdeps/sparc/nptl/bits/pthreadtypes.h b/sysdeps/sparc/nptl/bits/pthreadtypes.h
index d45cb61277..e781a258aa 100644
--- a/sysdeps/sparc/nptl/bits/pthreadtypes.h
+++ b/sysdeps/sparc/nptl/bits/pthreadtypes.h
@@ -87,7 +87,7 @@ typedef union
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
#if __WORDSIZE == 64
int __spins;
diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h
index d8fd1a513d..2f66f10d72 100644
--- a/sysdeps/sparc/sparc32/bits/wordsize.h
+++ b/sysdeps/sparc/sparc32/bits/wordsize.h
@@ -5,4 +5,7 @@
# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
diff --git a/sysdeps/sparc/sparc32/sem_init.c b/sysdeps/sparc/sparc32/sem_init.c
deleted file mode 100644
index ae49ec573b..0000000000
--- a/sysdeps/sparc/sparc32/sem_init.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 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
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <semaphore.h>
-#include <shlib-compat.h>
-#include "semaphoreP.h"
-#include <futex-internal.h>
-
-
-int
-__new_sem_init (sem_t *sem, int pshared, unsigned int value)
-{
- /* Parameter sanity check. */
- if (__glibc_unlikely (value > SEM_VALUE_MAX))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- pshared = pshared != 0 ? PTHREAD_PROCESS_SHARED : PTHREAD_PROCESS_PRIVATE;
- int err = futex_supports_pshared (pshared);
- if (err != 0)
- {
- __set_errno (err);
- return -1;
- }
-
- /* Map to the internal type. */
- struct new_sem *isem = (struct new_sem *) sem;
-
- /* Use the values the caller provided. */
- isem->value = value << SEM_VALUE_SHIFT;
- isem->pad = 0;
- isem->nwaiters = 0;
-
- isem->private = (pshared == PTHREAD_PROCESS_PRIVATE
- ? FUTEX_PRIVATE : FUTEX_SHARED);
-
- return 0;
-}
-versioned_symbol (libpthread, __new_sem_init, sem_init, GLIBC_2_1);
-
-
-
-#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
-int
-attribute_compat_text_section
-__old_sem_init (sem_t *sem, int pshared, unsigned int value)
-{
- /* Parameter sanity check. */
- if (__glibc_unlikely (value > SEM_VALUE_MAX))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- /* Map to the internal type. */
- struct old_sem *isem = (struct old_sem *) sem;
-
- /* Use the value the user provided. */
- isem->value = value;
-
- /* We cannot store the PSHARED attribute. So we always use the
- operations needed for shared semaphores. */
-
- return 0;
-}
-compat_symbol (libpthread, __old_sem_init, sem_init, GLIBC_2_0);
-#endif
diff --git a/sysdeps/sparc/sparc32/sem_open.c b/sysdeps/sparc/sparc32/sem_open.c
deleted file mode 100644
index 57796bdc76..0000000000
--- a/sysdeps/sparc/sparc32/sem_open.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 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
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <search.h>
-#include <semaphore.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include "semaphoreP.h"
-#include <futex-internal.h>
-#include <shm-directory.h>
-
-
-/* Comparison function for search of existing mapping. */
-int
-attribute_hidden
-__sem_search (const void *a, const void *b)
-{
- const struct inuse_sem *as = (const struct inuse_sem *) a;
- const struct inuse_sem *bs = (const struct inuse_sem *) b;
-
- if (as->ino != bs->ino)
- /* Cannot return the difference the type is larger than int. */
- return as->ino < bs->ino ? -1 : (as->ino == bs->ino ? 0 : 1);
-
- if (as->dev != bs->dev)
- /* Cannot return the difference the type is larger than int. */
- return as->dev < bs->dev ? -1 : (as->dev == bs->dev ? 0 : 1);
-
- return strcmp (as->name, bs->name);
-}
-
-
-/* The search tree for existing mappings. */
-void *__sem_mappings attribute_hidden;
-
-/* Lock to protect the search tree. */
-int __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER;
-
-
-/* Search for existing mapping and if possible add the one provided. */
-static sem_t *
-check_add_mapping (const char *name, size_t namelen, int fd, sem_t *existing)
-{
- sem_t *result = SEM_FAILED;
-
- /* Get the information about the file. */
- struct stat64 st;
- if (__fxstat64 (_STAT_VER, fd, &st) == 0)
- {
- /* Get the lock. */
- lll_lock (__sem_mappings_lock, LLL_PRIVATE);
-
- /* Search for an existing mapping given the information we have. */
- struct inuse_sem *fake;
- fake = (struct inuse_sem *) alloca (sizeof (*fake) + namelen);
- memcpy (fake->name, name, namelen);
- fake->dev = st.st_dev;
- fake->ino = st.st_ino;
-
- struct inuse_sem **foundp = __tfind (fake, &__sem_mappings,
- __sem_search);
- if (foundp != NULL)
- {
- /* There is already a mapping. Use it. */
- result = (*foundp)->sem;
- ++(*foundp)->refcnt;
- }
- else
- {
- /* We haven't found a mapping. Install ione. */
- struct inuse_sem *newp;
-
- newp = (struct inuse_sem *) malloc (sizeof (*newp) + namelen);
- if (newp != NULL)
- {
- /* If the caller hasn't provided any map it now. */
- if (existing == SEM_FAILED)
- existing = (sem_t *) mmap (NULL, sizeof (sem_t),
- PROT_READ | PROT_WRITE, MAP_SHARED,
- fd, 0);
-
- newp->dev = st.st_dev;
- newp->ino = st.st_ino;
- newp->refcnt = 1;
- newp->sem = existing;
- memcpy (newp->name, name, namelen);
-
- /* Insert the new value. */
- if (existing != MAP_FAILED
- && __tsearch (newp, &__sem_mappings, __sem_search) != NULL)
- /* Successful. */
- result = existing;
- else
- /* Something went wrong while inserting the new
- value. We fail completely. */
- free (newp);
- }
- }
-
- /* Release the lock. */
- lll_unlock (__sem_mappings_lock, LLL_PRIVATE);
- }
-
- if (result != existing && existing != SEM_FAILED && existing != MAP_FAILED)
- {
- /* Do not disturb errno. */
- int save = errno;
- munmap (existing, sizeof (sem_t));
- errno = save;
- }
-
- return result;
-}
-
-
-sem_t *
-sem_open (const char *name, int oflag, ...)
-{
- int fd;
- sem_t *result;
-
- /* Create the name of the final file in local variable SHM_NAME. */
- SHM_GET_NAME (EINVAL, SEM_FAILED, SEM_SHM_PREFIX);
-
- /* If the semaphore object has to exist simply open it. */
- if ((oflag & O_CREAT) == 0 || (oflag & O_EXCL) == 0)
- {
- try_again:
- fd = __libc_open (shm_name,
- (oflag & ~(O_CREAT|O_ACCMODE)) | O_NOFOLLOW | O_RDWR);
-
- if (fd == -1)
- {
- /* If we are supposed to create the file try this next. */
- if ((oflag & O_CREAT) != 0 && errno == ENOENT)
- goto try_create;
-
- /* Return. errno is already set. */
- }
- else
- /* Check whether we already have this semaphore mapped and
- create one if necessary. */
- result = check_add_mapping (name, namelen, fd, SEM_FAILED);
- }
- else
- {
- /* We have to open a temporary file first since it must have the
- correct form before we can start using it. */
- char *tmpfname;
- mode_t mode;
- unsigned int value;
- va_list ap;
-
- try_create:
- va_start (ap, oflag);
-
- mode = va_arg (ap, mode_t);
- value = va_arg (ap, unsigned int);
-
- va_end (ap);
-
- if (value > SEM_VALUE_MAX)
- {
- __set_errno (EINVAL);
- return SEM_FAILED;
- }
-
- /* Create the initial file content. */
- union
- {
- sem_t initsem;
- struct new_sem newsem;
- } sem;
-
- sem.newsem.value = value << SEM_VALUE_SHIFT;
- sem.newsem.pad = 0;
- sem.newsem.nwaiters = 0;
-
- /* This always is a shared semaphore. */
- sem.newsem.private = FUTEX_SHARED;
-
- /* Initialize the remaining bytes as well. */
- memset ((char *) &sem.initsem + sizeof (struct new_sem), '\0',
- sizeof (sem_t) - sizeof (struct new_sem));
-
- tmpfname = __alloca (shm_dirlen + sizeof SEM_SHM_PREFIX + 6);
- char *xxxxxx = __mempcpy (tmpfname, shm_dir, shm_dirlen);
-
- int retries = 0;
-#define NRETRIES 50
- while (1)
- {
- /* Add the suffix for mktemp. */
- strcpy (xxxxxx, "XXXXXX");
-
- /* We really want to use mktemp here. We cannot use mkstemp
- since the file must be opened with a specific mode. The
- mode cannot later be set since then we cannot apply the
- file create mask. */
- if (__mktemp (tmpfname) == NULL)
- return SEM_FAILED;
-
- /* Open the file. Make sure we do not overwrite anything. */
- fd = __libc_open (tmpfname, O_RDWR | O_CREAT | O_EXCL, mode);
- if (fd == -1)
- {
- if (errno == EEXIST)
- {
- if (++retries < NRETRIES)
- continue;
-
- __set_errno (EAGAIN);
- }
-
- return SEM_FAILED;
- }
-
- /* We got a file. */
- break;
- }
-
- if (TEMP_FAILURE_RETRY (__libc_write (fd, &sem.initsem, sizeof (sem_t)))
- == sizeof (sem_t)
- /* Map the sem_t structure from the file. */
- && (result = (sem_t *) mmap (NULL, sizeof (sem_t),
- PROT_READ | PROT_WRITE, MAP_SHARED,
- fd, 0)) != MAP_FAILED)
- {
- /* Create the file. Don't overwrite an existing file. */
- if (link (tmpfname, shm_name) != 0)
- {
- /* Undo the mapping. */
- (void) munmap (result, sizeof (sem_t));
-
- /* Reinitialize 'result'. */
- result = SEM_FAILED;
-
- /* This failed. If O_EXCL is not set and the problem was
- that the file exists, try again. */
- if ((oflag & O_EXCL) == 0 && errno == EEXIST)
- {
- /* Remove the file. */
- (void) unlink (tmpfname);
-
- /* Close the file. */
- (void) __libc_close (fd);
-
- goto try_again;
- }
- }
- else
- /* Insert the mapping into the search tree. This also
- determines whether another thread sneaked by and already
- added such a mapping despite the fact that we created it. */
- result = check_add_mapping (name, namelen, fd, result);
- }
-
- /* Now remove the temporary name. This should never fail. If
- it fails we leak a file name. Better fix the kernel. */
- (void) unlink (tmpfname);
- }
-
- /* Map the mmap error to the error we need. */
- if (MAP_FAILED != (void *) SEM_FAILED && result == MAP_FAILED)
- result = SEM_FAILED;
-
- /* We don't need the file descriptor anymore. */
- if (fd != -1)
- {
- /* Do not disturb errno. */
- int save = errno;
- __libc_close (fd);
- errno = save;
- }
-
- return result;
-}
diff --git a/sysdeps/sparc/sparc32/sem_wait.c b/sysdeps/sparc/sparc32/sem_wait.c
deleted file mode 100644
index 84b523a768..0000000000
--- a/sysdeps/sparc/sparc32/sem_wait.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* sem_wait -- wait on a semaphore. Generic futex-using version.
- Copyright (C) 2003-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Mackerras <paulus@au.ibm.com>, 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <lowlevellock.h> /* lll_futex* used by the old code. */
-#include "sem_waitcommon.c"
-
-int
-__new_sem_wait (sem_t *sem)
-{
- if (__new_sem_wait_fast ((struct new_sem *) sem, 0) == 0)
- return 0;
- else
- return __new_sem_wait_slow((struct new_sem *) sem, NULL);
-}
-versioned_symbol (libpthread, __new_sem_wait, sem_wait, GLIBC_2_1);
-
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
-int
-attribute_compat_text_section
-__old_sem_wait (sem_t *sem)
-{
- int *futex = (int *) sem;
- int err;
-
- do
- {
- if (atomic_decrement_if_positive (futex) > 0)
- return 0;
-
- /* Enable asynchronous cancellation. Required by the standard. */
- int oldtype = __pthread_enable_asynccancel ();
-
- /* Always assume the semaphore is shared. */
- err = lll_futex_wait (futex, 0, LLL_SHARED);
-
- /* Disable asynchronous cancellation. */
- __pthread_disable_asynccancel (oldtype);
- }
- while (err == 0 || err == -EWOULDBLOCK);
-
- __set_errno (-err);
- return -1;
-}
-
-compat_symbol (libpthread, __old_sem_wait, sem_wait, GLIBC_2_0);
-#endif
-
-int
-__new_sem_trywait (sem_t *sem)
-{
- /* We must not fail spuriously, so require a definitive result even if this
- may lead to a long execution time. */
- if (__new_sem_wait_fast ((struct new_sem *) sem, 1) == 0)
- return 0;
- __set_errno (EAGAIN);
- return -1;
-}
-versioned_symbol (libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1);
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
-int
-__old_sem_trywait (sem_t *sem)
-{
- int *futex = (int *) sem;
- int val;
-
- if (*futex > 0)
- {
- val = atomic_decrement_if_positive (futex);
- if (val > 0)
- return 0;
- }
-
- __set_errno (EAGAIN);
- return -1;
-}
-compat_symbol (libpthread, __old_sem_trywait, sem_trywait, GLIBC_2_0);
-#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/Makefile b/sysdeps/sparc/sparc32/sparcv9/Makefile
index 08c5a96c95..526673e7b4 100644
--- a/sysdeps/sparc/sparc32/sparcv9/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/Makefile
@@ -4,13 +4,11 @@ ifeq ($(have-as-vis3),yes)
ASFLAGS-.o += -Wa,-Av9d
ASFLAGS-.os += -Wa,-Av9d
ASFLAGS-.op += -Wa,-Av9d
-ASFLAGS-.og += -Wa,-Av9d
ASFLAGS-.oS += -Wa,-Av9d
else
ASFLAGS-.o += -Wa,-Av9a
ASFLAGS-.os += -Wa,-Av9a
ASFLAGS-.op += -Wa,-Av9a
-ASFLAGS-.og += -Wa,-Av9a
ASFLAGS-.oS += -Wa,-Av9a
endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
index 2973b49ffb..61765173b7 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
@@ -19,5 +19,7 @@
#include <math.h>
#define __fdim __fdim_vis3
+#define declare_mgen_alias(t, f)
+#define M_LIBM_NEED_COMPAT(f) 0
#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
index c9c77049a2..2d07f312b4 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
@@ -27,6 +27,7 @@ sparc_libm_ifunc(__fdim, hwcap & HWCAP_SPARC_VIS3 ? __fdim_vis3 : __fdim_generic
weak_alias (__fdim, fdim)
# define __fdim __fdim_generic
+# define declare_mgen_alias(t, f)
#endif
#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c
index 75997c62d7..3f35b0dbff 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c
@@ -19,5 +19,6 @@
#include <math.h>
#define __fdimf __fdimf_vis3
+#define declare_mgen_alias(t, f)
#include <math/s_fdimf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
index 767520fb18..b9add1c355 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
@@ -27,6 +27,8 @@ sparc_libm_ifunc(__fdimf, hwcap & HWCAP_SPARC_VIS3 ? __fdimf_vis3 : __fdimf_gene
weak_alias (__fdimf, fdimf)
# define __fdimf __fdimf_generic
+# define declare_mgen_alias(t, f)
+
#endif
#include <math/s_fdimf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/sem_init.c b/sysdeps/sparc/sparc32/sparcv9/sem_init.c
deleted file mode 100644
index c90d1b599a..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/sem_init.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <nptl/sem_init.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/sem_open.c b/sysdeps/sparc/sparc32/sparcv9/sem_open.c
deleted file mode 100644
index bff2d2db6a..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/sem_open.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <nptl/sem_open.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/sem_wait.c b/sysdeps/sparc/sparc32/sparcv9/sem_wait.c
deleted file mode 100644
index bccdaed92e..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/sem_wait.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <nptl/sem_wait.c>
diff --git a/sysdeps/sparc/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile
index fbabf69263..a5e403630e 100644
--- a/sysdeps/sparc/sparc64/Makefile
+++ b/sysdeps/sparc/sparc64/Makefile
@@ -8,7 +8,6 @@ ifeq ($(have-as-vis3),yes)
ASFLAGS-.o += -Wa,-Av9d
ASFLAGS-.os += -Wa,-Av9d
ASFLAGS-.op += -Wa,-Av9d
-ASFLAGS-.og += -Wa,-Av9d
ASFLAGS-.oS += -Wa,-Av9d
endif
diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h
index d8fd1a513d..2f66f10d72 100644
--- a/sysdeps/sparc/sparc64/bits/wordsize.h
+++ b/sysdeps/sparc/sparc64/bits/wordsize.h
@@ -5,4 +5,7 @@
# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/sha256-block.c b/sysdeps/sparc/sparc64/multiarch/sha256-block.c
index 79966b93d7..9d65315a5a 100644
--- a/sysdeps/sparc/sparc64/multiarch/sha256-block.c
+++ b/sysdeps/sparc/sparc64/multiarch/sha256-block.c
@@ -1,12 +1,12 @@
#include <sparc-ifunc.h>
-#define sha256_process_block sha256_process_block_generic
-extern void sha256_process_block_generic (const void *buffer, size_t len,
- struct sha256_ctx *ctx);
+#define __sha256_process_block __sha256_process_block_generic
+extern void __sha256_process_block_generic (const void *buffer, size_t len,
+ struct sha256_ctx *ctx);
#include <crypt/sha256-block.c>
-#undef sha256_process_block
+#undef __sha256_process_block
extern void __sha256_process_block_crop (const void *buffer, size_t len,
struct sha256_ctx *ctx);
@@ -25,6 +25,8 @@ static bool cpu_supports_sha256(int hwcap)
return false;
}
-extern void sha256_process_block (const void *buffer, size_t len,
- struct sha256_ctx *ctx);
-sparc_libc_ifunc(sha256_process_block, cpu_supports_sha256(hwcap) ? __sha256_process_block_crop : sha256_process_block_generic);
+extern void __sha256_process_block (const void *buffer, size_t len,
+ struct sha256_ctx *ctx);
+sparc_libc_ifunc (__sha256_process_block,
+ cpu_supports_sha256(hwcap) ? __sha256_process_block_crop
+ : __sha256_process_block_generic);
diff --git a/sysdeps/sparc/sparc64/multiarch/sha512-block.c b/sysdeps/sparc/sparc64/multiarch/sha512-block.c
index 0d1c3dd6d8..2863e05d09 100644
--- a/sysdeps/sparc/sparc64/multiarch/sha512-block.c
+++ b/sysdeps/sparc/sparc64/multiarch/sha512-block.c
@@ -1,12 +1,12 @@
#include <sparc-ifunc.h>
-#define sha512_process_block sha512_process_block_generic
-extern void sha512_process_block_generic (const void *buffer, size_t len,
- struct sha512_ctx *ctx);
+#define __sha512_process_block __sha512_process_block_generic
+extern void __sha512_process_block_generic (const void *buffer, size_t len,
+ struct sha512_ctx *ctx);
#include <crypt/sha512-block.c>
-#undef sha512_process_block
+#undef __sha512_process_block
extern void __sha512_process_block_crop (const void *buffer, size_t len,
struct sha512_ctx *ctx);
@@ -25,6 +25,8 @@ static bool cpu_supports_sha512(int hwcap)
return false;
}
-extern void sha512_process_block (const void *buffer, size_t len,
- struct sha512_ctx *ctx);
-sparc_libc_ifunc(sha512_process_block, cpu_supports_sha512(hwcap) ? __sha512_process_block_crop : sha512_process_block_generic);
+extern void __sha512_process_block (const void *buffer, size_t len,
+ struct sha512_ctx *ctx);
+sparc_libc_ifunc (__sha512_process_block,
+ cpu_supports_sha512(hwcap) ? __sha512_process_block_crop
+ : __sha512_process_block_generic);
diff --git a/sysdeps/tile/bits/fenv.h b/sysdeps/tile/bits/fenv.h
index a87a39fc28..eee9e011cc 100644
--- a/sysdeps/tile/bits/fenv.h
+++ b/sysdeps/tile/bits/fenv.h
@@ -43,3 +43,11 @@ typedef unsigned int fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1l)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/tile/libm-test-ulps-name b/sysdeps/tile/libm-test-ulps-name
new file mode 100644
index 0000000000..69673dcaa2
--- /dev/null
+++ b/sysdeps/tile/libm-test-ulps-name
@@ -0,0 +1 @@
+Tile
diff --git a/sysdeps/tile/nptl/bits/pthreadtypes.h b/sysdeps/tile/nptl/bits/pthreadtypes.h
index 7d6865066a..b14b1c6f5e 100644
--- a/sysdeps/tile/nptl/bits/pthreadtypes.h
+++ b/sysdeps/tile/nptl/bits/pthreadtypes.h
@@ -87,7 +87,7 @@ typedef union
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
#if __WORDSIZE == 64
int __spins;
diff --git a/sysdeps/tile/preconfigure b/sysdeps/tile/preconfigure
index dfe050cc6d..f3e5d7edae 100644
--- a/sysdeps/tile/preconfigure
+++ b/sysdeps/tile/preconfigure
@@ -2,7 +2,7 @@
case "$machine" in
tilepro)
base_machine=tile machine=tile/tilepro ;;
- tilegx)
+ tilegx*)
base_machine=tile
if $CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep -q __LP64__; then
machine=tile/tilegx/tilegx64
diff --git a/sysdeps/tile/tilegx/bits/wordsize.h b/sysdeps/tile/tilegx/bits/wordsize.h
index 5d4e4b4470..9dc4da5de9 100644
--- a/sysdeps/tile/tilegx/bits/wordsize.h
+++ b/sysdeps/tile/tilegx/bits/wordsize.h
@@ -5,4 +5,7 @@
# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
diff --git a/sysdeps/tile/tilepro/bits/wordsize.h b/sysdeps/tile/tilepro/bits/wordsize.h
index da587a2f12..8281538131 100644
--- a/sysdeps/tile/tilepro/bits/wordsize.h
+++ b/sysdeps/tile/tilepro/bits/wordsize.h
@@ -1,3 +1,4 @@
/* Determine the wordsize from the preprocessor defines. */
-#define __WORDSIZE 32
+#define __WORDSIZE 32
+#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/unix/alpha/Makefile b/sysdeps/unix/alpha/Makefile
index 441aa02a83..0660847f15 100644
--- a/sysdeps/unix/alpha/Makefile
+++ b/sysdeps/unix/alpha/Makefile
@@ -1,3 +1,4 @@
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h
index 94a2ce0e37..38c2432002 100644
--- a/sysdeps/unix/sysdep.h
+++ b/sysdeps/unix/sysdep.h
@@ -24,42 +24,79 @@
#define SYSCALL__(name, args) PSEUDO (__##name, name, args)
#define SYSCALL(name, args) PSEUDO (name, name, args)
-#define __SYSCALL0(name) \
+#define __SYSCALL_CONCAT_X(a,b) a##b
+#define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X (a, b)
+
+
+#define __INTERNAL_SYSCALL0(name, err) \
+ INTERNAL_SYSCALL (name, err, 0)
+#define __INTERNAL_SYSCALL1(name, err, a1) \
+ INTERNAL_SYSCALL (name, err, 1, a1)
+#define __INTERNAL_SYSCALL2(name, err, a1, a2) \
+ INTERNAL_SYSCALL (name, err, 2, a1, a2)
+#define __INTERNAL_SYSCALL3(name, err, a1, a2, a3) \
+ INTERNAL_SYSCALL (name, err, 3, a1, a2, a3)
+#define __INTERNAL_SYSCALL4(name, err, a1, a2, a3, a4) \
+ INTERNAL_SYSCALL (name, err, 4, a1, a2, a3, a4)
+#define __INTERNAL_SYSCALL5(name, err, a1, a2, a3, a4, a5) \
+ INTERNAL_SYSCALL (name, err, 5, a1, a2, a3, a4, a5)
+#define __INTERNAL_SYSCALL6(name, err, a1, a2, a3, a4, a5, a6) \
+ INTERNAL_SYSCALL (name, err, 6, a1, a2, a3, a4, a5, a6)
+#define __INTERNAL_SYSCALL7(name, err, a1, a2, a3, a4, a5, a6, a7) \
+ INTERNAL_SYSCALL (name, err, 7, a1, a2, a3, a4, a5, a6, a7)
+
+#define __INTERNAL_SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,o,...) o
+#define __INTERNAL_SYSCALL_NARGS(...) \
+ __INTERNAL_SYSCALL_NARGS_X (__VA_ARGS__,7,6,5,4,3,2,1,0,)
+#define __INTERNAL_SYSCALL_DISP(b,...) \
+ __SYSCALL_CONCAT (b,__INTERNAL_SYSCALL_NARGS(__VA_ARGS__))(__VA_ARGS__)
+
+/* Issue a syscall defined by syscall number plus any other argument required.
+ It is similar to INTERNAL_SYSCALL macro, but without the need to pass the
+ expected argument number as second parameter. */
+#define INTERNAL_SYSCALL_CALL(...) \
+ __INTERNAL_SYSCALL_DISP (__INTERNAL_SYSCALL, __VA_ARGS__)
+
+#define __INLINE_SYSCALL0(name) \
INLINE_SYSCALL (name, 0)
-#define __SYSCALL1(name, a1) \
+#define __INLINE_SYSCALL1(name, a1) \
INLINE_SYSCALL (name, 1, a1)
-#define __SYSCALL2(name, a1, a2) \
+#define __INLINE_SYSCALL2(name, a1, a2) \
INLINE_SYSCALL (name, 2, a1, a2)
-#define __SYSCALL3(name, a1, a2, a3) \
+#define __INLINE_SYSCALL3(name, a1, a2, a3) \
INLINE_SYSCALL (name, 3, a1, a2, a3)
-#define __SYSCALL4(name, a1, a2, a3, a4) \
+#define __INLINE_SYSCALL4(name, a1, a2, a3, a4) \
INLINE_SYSCALL (name, 4, a1, a2, a3, a4)
-#define __SYSCALL5(name, a1, a2, a3, a4, a5) \
+#define __INLINE_SYSCALL5(name, a1, a2, a3, a4, a5) \
INLINE_SYSCALL (name, 5, a1, a2, a3, a4, a5)
-#define __SYSCALL6(name, a1, a2, a3, a4, a5, a6) \
+#define __INLINE_SYSCALL6(name, a1, a2, a3, a4, a5, a6) \
INLINE_SYSCALL (name, 6, a1, a2, a3, a4, a5, a6)
-#define __SYSCALL7(name, a1, a2, a3, a4, a5, a6, a7) \
+#define __INLINE_SYSCALL7(name, a1, a2, a3, a4, a5, a6, a7) \
INLINE_SYSCALL (name, 7, a1, a2, a3, a4, a5, a6, a7)
-#define __SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
-#define __SYSCALL_NARGS(...) \
- __SYSCALL_NARGS_X (__VA_ARGS__,7,6,5,4,3,2,1,0,)
-#define __SYSCALL_CONCAT_X(a,b) a##b
-#define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X (a, b)
-#define __SYSCALL_DISP(b,...) \
- __SYSCALL_CONCAT (b,__SYSCALL_NARGS(__VA_ARGS__))(__VA_ARGS__)
+#define __INLINE_SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
+#define __INLINE_SYSCALL_NARGS(...) \
+ __INLINE_SYSCALL_NARGS_X (__VA_ARGS__,7,6,5,4,3,2,1,0,)
+#define __INLINE_SYSCALL_DISP(b,...) \
+ __SYSCALL_CONCAT (b,__INLINE_SYSCALL_NARGS(__VA_ARGS__))(__VA_ARGS__)
-#define __SYSCALL_CALL(...) __SYSCALL_DISP (__SYSCALL, __VA_ARGS__)
+/* Issue a syscall defined by syscall number plus any other argument
+ required. Any error will be handled using arch defined macros and errno
+ will be set accordingly.
+ It is similar to INLINE_SYSCALL macro, but without the need to pass the
+ expected argument number as second parameter. */
+#define INLINE_SYSCALL_CALL(...) \
+ __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__)
#define SYSCALL_CANCEL(...) \
({ \
long int sc_ret; \
if (SINGLE_THREAD_P) \
- sc_ret = __SYSCALL_CALL (__VA_ARGS__); \
+ sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \
else \
{ \
int sc_cancel_oldtype = LIBC_CANCEL_ASYNC (); \
- sc_ret = __SYSCALL_CALL (__VA_ARGS__); \
+ sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \
LIBC_CANCEL_RESET (sc_cancel_oldtype); \
} \
sc_ret; \
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index f0b052dfe9..b3d68665f9 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -14,7 +14,7 @@ endif
ifeq ($(subdir),misc)
include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
-sysdep_routines += clone llseek umount umount2 readahead \
+sysdep_routines += clone umount umount2 readahead \
setfsuid setfsgid epoll_pwait signalfd \
eventfd eventfd_read eventfd_write prlimit \
personality
@@ -42,7 +42,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/socket_type.h bits/syscall.h bits/sysctl.h \
bits/mman-linux.h
-tests += tst-clone tst-clone2 tst-fanotify tst-personality
+tests += tst-clone tst-clone2 tst-fanotify tst-personality tst-quota \
+ tst-sync_file_range
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
@@ -172,6 +173,8 @@ ifeq ($(subdir),io)
sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
sync_file_range fallocate fallocate64
sysdep_headers += bits/fcntl-linux.h
+
+tests += tst-fallocate tst-fallocate64
endif
ifeq ($(subdir),elf)
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h b/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
index 5b09b7c8c3..cb3e97d90d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
@@ -16,10 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
+#define __need_size_t
+#include <stddef.h>
/* Structure describing a signal stack (obsolete). */
struct sigstack
@@ -28,8 +33,15 @@ struct sigstack
int ss_onstack; /* Nonzero if executing on this stack. */
};
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
-/* Possible values for `ss_flags.'. */
+/* Possible values for `ss_flags'. */
enum
{
SS_ONSTACK = 1,
@@ -44,11 +56,4 @@ enum
/* System default stack size. */
#define SIGSTKSZ 16384
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- void *ss_sp;
- int ss_flags;
- size_t ss_size;
- } stack_t;
+#endif /* bits/sigstack.h */
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 2c2f49e85b..77accdf5c1 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2090,3 +2090,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libm.abilist b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
index 781d2d3571..9d5936c5c6 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libm.abilist
@@ -410,3 +410,23 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
index 01da3ca858..2e3e1ee87d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
@@ -23,11 +23,14 @@
#include <features.h>
#include <signal.h>
-#include <sys/procfs.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+#include <sys/procfs.h>
+
typedef elf_greg_t greg_t;
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index c089545e9b..45941b0a3d 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -10,7 +10,7 @@ ifeq ($(subdir),misc)
sysdep_headers += alpha/ptrace.h alpha/regdef.h sys/io.h
sysdep_routines += ieee_get_fp_control ieee_set_fp_control \
- ioperm llseek
+ ioperm
# Support old timeval32 entry points
sysdep_routines += osf_select osf_gettimeofday osf_settimeofday \
@@ -39,5 +39,6 @@ endif # math
ifeq ($(subdir),nptl)
# pull in __syscall_error routine, __sigprocmask, __syscall_rt_sigaction
-libpthread-routines += ptw-sysdep ptw-sigprocmask ptw-rt_sigaction
+libpthread-routines += sysdep sigprocmask rt_sigaction
+libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction
endif
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
index 1a1779b5d4..b7af0380e9 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
@@ -63,7 +63,7 @@ typedef union
int __owner;
unsigned int __nusers;
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
int __spins;
__pthread_list_t __list;
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
index fbc8f5a026..1c17605bd5 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
@@ -175,8 +175,7 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
+#include <bits/types/struct_timeval.h>
/* Structure which says how much of each resource has been used. */
struct rusage
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h b/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
index 6ad3363ddf..b2de7a1d3e 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
@@ -16,10 +16,15 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
+#define __need_size_t
+#include <stddef.h>
/* Structure describing a signal stack (obsolete). */
struct sigstack
@@ -28,8 +33,15 @@ struct sigstack
int ss_onstack; /* Nonzero if executing on this stack. */
};
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ __ptr_t ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
-/* Possible values for `ss_flags.'. */
+/* Possible values for `ss_flags'. */
enum
{
SS_ONSTACK = 1,
@@ -44,11 +56,4 @@ enum
/* System default stack size. */
#define SIGSTKSZ 16384
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- __ptr_t ss_sp;
- int ss_flags;
- size_t ss_size;
- } stack_t;
+#endif /* bits/sigstack.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
index 51fc433d6e..f0961f69cc 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#define __WORDSIZE 64
+#define __WORDSIZE_TIME64_COMPAT32 0
#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
index 732749e845..f09222d225 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
@@ -23,6 +23,7 @@
#include_next <kernel-features.h>
#undef __ASSUME_ST_INO_64_BIT
+#define __ASSUME_ST_INO_64_BIT 0
/* There never has been support for fstat64. */
#undef __ASSUME_STATFS64
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 8afba471f7..659b7fcf37 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2001,6 +2001,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/alpha/libm.abilist b/sysdeps/unix/sysv/linux/alpha/libm.abilist
index f342c6b1da..ce5be3c567 100644
--- a/sysdeps/unix/sysv/linux/alpha/libm.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libm.abilist
@@ -420,6 +420,26 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __c1_cabsf F
GLIBC_2.3.4 __c1_cacosf F
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
index 01da7bf035..9fb9bdc35a 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
@@ -20,9 +20,7 @@
#define _SYS_ACCT_H 1
#include <features.h>
-#define __need_time_t
-#include <time.h>
-
+#include <bits/types/time_t.h>
__BEGIN_DECLS
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h b/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
index a42e662cf5..0fa4c1f996 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
@@ -21,7 +21,10 @@
#include <features.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
/* Type for general register. */
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index 6ca607eee0..1ebbc36a20 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -27,6 +27,13 @@
# undef __ASSUME_SET_ROBUST_LIST
#endif
+/* ARM fadvise64_64 reorganize the syscall arguments. */
+#define __ASSUME_FADVISE64_64_6ARG 1
+
/* Define this if your 32-bit syscall API requires 64-bit register
pairs to start with an even-number register. */
#define __ASSUME_ALIGNED_REGISTER_PAIRS 1
+
+/* ARM only has a syscall for fadvise64{_64} and it is defined with a
+ non-standard name. */
+#define __NR_fadvise64_64 __NR_arm_fadvise64_64
diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist
index de3bdf46fc..8bc979ad7f 100644
--- a/sysdeps/unix/sysv/linux/arm/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libc.abilist
@@ -91,6 +91,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/libm.abilist b/sysdeps/unix/sysv/linux/arm/libm.abilist
index 7a02fb1726..675dfa5b86 100644
--- a/sysdeps/unix/sysv/linux/arm/libm.abilist
+++ b/sysdeps/unix/sysv/linux/arm/libm.abilist
@@ -68,6 +68,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F
diff --git a/sysdeps/unix/sysv/linux/arm/posix_fadvise64.c b/sysdeps/unix/sysv/linux/arm/posix_fadvise64.c
deleted file mode 100644
index ffb3ecd3c5..0000000000
--- a/sysdeps/unix/sysv/linux/arm/posix_fadvise64.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2003-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
-{
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise,
- __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset),
- __LONG_LONG_PAIR ((long)(len >> 32), (long)len));
- if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
- return 0;
- return INTERNAL_SYSCALL_ERRNO (ret, err);
-}
-weak_alias (__posix_fadvise64_l64, posix_fadvise64);
diff --git a/sysdeps/unix/sysv/linux/arm/sys/ucontext.h b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
index f32eadc099..c7aceadb7d 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
@@ -23,9 +23,11 @@
#include <features.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
typedef int greg_t;
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index 4d70a6baba..f2824bb55b 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -53,8 +53,8 @@
#define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */
#define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */
#define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */
+#define IP_MULTICAST_TTL 33 /* unsigned char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 34 /* bool; set/get IP multicast loopback */
#define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
#define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
#define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index 8af0e0e95e..e2a62bc6e5 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -175,8 +175,7 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
+#include <bits/types/struct_timeval.h>
/* Structure which says how much of each resource has been used. */
diff --git a/sysdeps/unix/sysv/linux/bits/sigcontext.h b/sysdeps/unix/sysv/linux/bits/sigcontext.h
index 46cacb7b2c..bdeaae8ad2 100644
--- a/sysdeps/unix/sysv/linux/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/bits/sigcontext.h
@@ -15,6 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
@@ -30,3 +33,5 @@
# define __need_NULL
# include <stddef.h>
#endif
+
+#endif /* bits/sigcontext.h */
diff --git a/sysdeps/unix/sysv/linux/bits/sigstack.h b/sysdeps/unix/sysv/linux/bits/sigstack.h
index 115a98ec6b..d858f09b73 100644
--- a/sysdeps/unix/sysv/linux/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/bits/sigstack.h
@@ -16,10 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
+#define __need_size_t
+#include <stddef.h>
/* Structure describing a signal stack (obsolete). */
struct sigstack
@@ -28,8 +33,15 @@ struct sigstack
int ss_onstack; /* Nonzero if executing on this stack. */
};
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
-/* Possible values for `ss_flags.'. */
+/* Possible values for `ss_flags'. */
enum
{
SS_ONSTACK = 1,
@@ -44,11 +56,4 @@ enum
/* System default stack size. */
#define SIGSTKSZ 8192
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- void *ss_sp;
- int ss_flags;
- size_t ss_size;
- } stack_t;
+#endif /* bits/sigstack.h */
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 2266047e04..514c373635 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -273,13 +273,13 @@ struct cmsghdr
with this. */
int cmsg_level; /* Originating protocol. */
int cmsg_type; /* Protocol specific type. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+#if __glibc_c99_flexarr_available
__extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
#endif
};
/* Ancillary data object manipulation macros. */
-#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+#if __glibc_c99_flexarr_available
# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
#else
# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h
index 87eb51f2ed..1fade54b62 100644
--- a/sysdeps/unix/sysv/linux/bits/time.h
+++ b/sysdeps/unix/sysv/linux/bits/time.h
@@ -20,24 +20,10 @@
* Never include this file directly; use <time.h> instead.
*/
-#if defined __need_timeval || defined __USE_GNU
-# ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL 1
-# include <bits/types.h>
+#ifndef _BITS_TIME_H
+#define _BITS_TIME_H 1
-/* A time value that is accurate to the nearest
- microsecond but also has a range of years. */
-struct timeval
- {
- __time_t tv_sec; /* Seconds. */
- __suseconds_t tv_usec; /* Microseconds. */
- };
-# endif /* struct timeval */
-#endif
-
-#ifndef __need_timeval
-# ifndef _BITS_TIME_H
-# define _BITS_TIME_H 1
+#include <bits/types.h>
/* ISO/IEC 9899:1999 7.23.1: Components of time
The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is
@@ -45,47 +31,46 @@ struct timeval
/* CAE XSH, Issue 4, Version 2: <time.h>
The value of CLOCKS_PER_SEC is required to be 1 million on all
XSI-conformant systems. */
-# define CLOCKS_PER_SEC ((clock_t) 1000000)
+#define CLOCKS_PER_SEC ((__clock_t) 1000000)
-# if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \
+#if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \
&& !defined __USE_XOPEN2K
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
presents the real value for clock ticks per second for the system. */
-# include <bits/types.h>
extern long int __sysconf (int);
-# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
-# endif
+# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
+#endif
-# ifdef __USE_POSIX199309
+#ifdef __USE_POSIX199309
/* Identifier for system-wide realtime clock. */
-# define CLOCK_REALTIME 0
+# define CLOCK_REALTIME 0
/* Monotonic system-wide clock. */
-# define CLOCK_MONOTONIC 1
+# define CLOCK_MONOTONIC 1
/* High-resolution timer from the CPU. */
-# define CLOCK_PROCESS_CPUTIME_ID 2
+# define CLOCK_PROCESS_CPUTIME_ID 2
/* Thread-specific CPU-time clock. */
-# define CLOCK_THREAD_CPUTIME_ID 3
+# define CLOCK_THREAD_CPUTIME_ID 3
/* Monotonic system-wide clock, not adjusted for frequency scaling. */
-# define CLOCK_MONOTONIC_RAW 4
+# define CLOCK_MONOTONIC_RAW 4
/* Identifier for system-wide realtime clock, updated only on ticks. */
-# define CLOCK_REALTIME_COARSE 5
+# define CLOCK_REALTIME_COARSE 5
/* Monotonic system-wide clock, updated only on ticks. */
-# define CLOCK_MONOTONIC_COARSE 6
+# define CLOCK_MONOTONIC_COARSE 6
/* Monotonic system-wide clock that includes time spent in suspension. */
-# define CLOCK_BOOTTIME 7
+# define CLOCK_BOOTTIME 7
/* Like CLOCK_REALTIME but also wakes suspended system. */
-# define CLOCK_REALTIME_ALARM 8
+# define CLOCK_REALTIME_ALARM 8
/* Like CLOCK_BOOTTIME but also wakes suspended system. */
-# define CLOCK_BOOTTIME_ALARM 9
+# define CLOCK_BOOTTIME_ALARM 9
/* Like CLOCK_REALTIME but in International Atomic Time. */
-# define CLOCK_TAI 11
+# define CLOCK_TAI 11
/* Flag to indicate time is absolute. */
-# define TIMER_ABSTIME 1
-# endif
+# define TIMER_ABSTIME 1
+#endif
-# ifdef __USE_GNU
-# include <bits/timex.h>
+#ifdef __USE_GNU
+# include <bits/timex.h>
__BEGIN_DECLS
@@ -93,9 +78,6 @@ __BEGIN_DECLS
extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW;
__END_DECLS
-# endif /* use GNU */
-
-# endif /* bits/time.h */
-#endif
+#endif /* use GNU */
-#undef __need_timeval
+#endif /* bits/time.h */
diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h
index 5eb7ccbd2e..1bf6121d88 100644
--- a/sysdeps/unix/sysv/linux/bits/timex.h
+++ b/sysdeps/unix/sysv/linux/bits/timex.h
@@ -19,6 +19,7 @@
#define _BITS_TIMEX_H 1
#include <bits/types.h>
+#include <bits/types/struct_timeval.h>
/* These definitions from linux/timex.h as of 3.18. */
diff --git a/sysdeps/unix/sysv/linux/fallocate.c b/sysdeps/unix/sysv/linux/fallocate.c
index 6a58a5f50a..a38e9a6a98 100644
--- a/sysdeps/unix/sysv/linux/fallocate.c
+++ b/sysdeps/unix/sysv/linux/fallocate.c
@@ -19,17 +19,12 @@
#include <fcntl.h>
#include <sysdep-cancel.h>
-
+#ifndef __OFF_T_MATCHES_OFF64_T
/* Reserve storage for the data of the file associated with FD. */
int
fallocate (int fd, int mode, __off_t offset, __off_t len)
{
-#ifdef __NR_fallocate
return SYSCALL_CANCEL (fallocate, fd, mode,
- __LONG_LONG_PAIR (offset >> 31, offset),
- __LONG_LONG_PAIR (len >> 31, len));
-#else
- __set_errno (ENOSYS);
- return -1;
-#endif
+ SYSCALL_LL (offset), SYSCALL_LL (len));
}
+#endif
diff --git a/sysdeps/unix/sysv/linux/fallocate64.c b/sysdeps/unix/sysv/linux/fallocate64.c
index 8e76d6f2bc..d466095f67 100644
--- a/sysdeps/unix/sysv/linux/fallocate64.c
+++ b/sysdeps/unix/sysv/linux/fallocate64.c
@@ -24,14 +24,10 @@
int
fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
{
-#ifdef __NR_fallocate
return SYSCALL_CANCEL (fallocate, fd, mode,
- __LONG_LONG_PAIR ((long int) (offset >> 32),
- (long int) offset),
- __LONG_LONG_PAIR ((long int) (len >> 32),
- (long int) len));
-#else
- __set_errno (ENOSYS);
- return -1;
-#endif
+ SYSCALL_LL64 (offset), SYSCALL_LL64 (len));
}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (fallocate64, fallocate)
+#endif
diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
index 858679dd55..e33023bc67 100644
--- a/sysdeps/unix/sysv/linux/fxstat.c
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -36,7 +36,7 @@ int
__fxstat (int vers, int fd, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (fstat, 2, fd, (struct kernel_stat *) buf);
+ return INLINE_SYSCALL (fstat, 2, fd, buf);
#ifdef STAT_IS_KERNEL_STAT
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
index 5468dd6c60..8d102826c6 100644
--- a/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/fxstat64.c
@@ -33,7 +33,7 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf)
{
int result;
result = INLINE_SYSCALL (fstat64, 2, fd, buf);
-#if defined _HAVE_STAT64___ST_INO && !defined __ASSUME_ST_INO_64_BIT
+#if defined _HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT
if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
buf->st_ino = buf->__st_ino;
#endif
diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
index b0422ff5b0..6d379ccca1 100644
--- a/sysdeps/unix/sysv/linux/generic/sysdep.h
+++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
@@ -22,7 +22,9 @@
#include <sysdeps/unix/sysv/linux/sysdep.h>
/* Provide the common name to allow more code reuse. */
-#define __NR__llseek __NR_llseek
+#ifdef __NR_llseek
+# define __NR__llseek __NR_llseek
+#endif
#if __WORDSIZE == 64
/* By defining the older names, glibc will build syscall wrappers for
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c
deleted file mode 100644
index 458964c53f..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Chris Metcalf <cmetcalf@tilera.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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <sys/types.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Seek to OFFSET on FD, starting from WHENCE. */
-extern loff_t __llseek (int fd, loff_t offset, int whence);
-
-loff_t
-__llseek (int fd, loff_t offset, int whence)
-{
- loff_t retval;
-
- return (loff_t) (INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff),
- &retval, whence) ?: retval);
-}
-weak_alias (__llseek, llseek)
-strong_alias (__llseek, __libc_lseek64)
-strong_alias (__llseek, __lseek64)
-weak_alias (__llseek, lseek64)
-
-/* llseek doesn't have a prototype. Since the second parameter is a
- 64bit type, this results in wrong behaviour if no prototype is
- provided. */
-link_warning (llseek, "\
-the `llseek' function may be dangerous; use `lseek64' instead.")
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c
deleted file mode 100644
index 7c93a8f375..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Chris Metcalf <cmetcalf@tilera.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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-posix_fadvise (int fd, off_t offset, off_t len, int advise)
-{
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
- __LONG_LONG_PAIR (offset >> 31, offset),
- __LONG_LONG_PAIR (len >> 31, len),
- advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
-}
diff --git a/sysdeps/unix/sysv/linux/hppa/atomic-machine.h b/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
index 3f0fd15e72..addef2c1ec 100644
--- a/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
+++ b/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
@@ -17,13 +17,6 @@
<http://www.gnu.org/licenses/>. */
#include <stdint.h> /* Required for type definitions e.g. uint8_t. */
-#include <abort-instr.h> /* Required for ABORT_INSTRUCTIUON. */
-
-/* We need EFAULT, ENONSYS */
-#if !defined EFAULT && !defined ENOSYS
-#define EFAULT 14
-#define ENOSYS 251
-#endif
#ifndef _ATOMIC_MACHINE_H
#define _ATOMIC_MACHINE_H 1
@@ -62,7 +55,7 @@ typedef uintmax_t uatomic_max_t;
#define _ASM_EDEADLOCK "-45"
/* The only basic operation needed is compare and exchange. The mem
- pointer must be word aligned. */
+ pointer must be word aligned. We no longer loop on deadlock. */
#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
({ \
register long lws_errno asm("r21"); \
@@ -74,20 +67,15 @@ typedef uintmax_t uatomic_max_t;
"0: \n\t" \
"ble " _LWS "(%%sr2, %%r0) \n\t" \
"ldi " _LWS_CAS ", %%r20 \n\t" \
- "ldi " _ASM_EAGAIN ", %%r20 \n\t" \
- "cmpb,=,n %%r20, %%r21, 0b \n\t" \
- "nop \n\t" \
- "ldi " _ASM_EDEADLOCK ", %%r20 \n\t" \
- "cmpb,=,n %%r20, %%r21, 0b \n\t" \
- "nop \n\t" \
+ "cmpiclr,<> " _ASM_EAGAIN ", %%r21, %%r0\n\t" \
+ "b,n 0b \n\t" \
+ "cmpclr,= %%r0, %%r21, %%r0 \n\t" \
+ "iitlbp %%r0,(%%sr0, %%r0) \n\t" \
: "=r" (lws_ret), "=r" (lws_errno) \
: "r" (lws_mem), "r" (lws_old), "r" (lws_new) \
: _LWS_CLOBBER \
); \
\
- if (lws_errno == -EFAULT || lws_errno == -ENOSYS) \
- ABORT_INSTRUCTION; \
- \
(__typeof (oldval)) lws_ret; \
})
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 3261b9395d..299b705156 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -1855,6 +1855,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/hppa/libm.abilist b/sysdeps/unix/sysv/linux/hppa/libm.abilist
index bf40ddf929..75b71ad8f7 100644
--- a/sysdeps/unix/sysv/linux/hppa/libm.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libm.abilist
@@ -380,5 +380,24 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
index f6fd367bd9..fa2bd8c048 100644
--- a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
@@ -23,9 +23,10 @@
#include <features.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
/* Type for general register. */
diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index b015ff7c76..2596cdfbb2 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -1,21 +1,26 @@
# The default ABI is 32.
default-abi := 32
+# %ebp is used to pass the 6th argument to system calls, so these
+# system calls are incompatible with a frame pointer.
+uses-6-syscall-arguments = -fomit-frame-pointer
+
ifeq ($(subdir),misc)
sysdep_routines += ioperm iopl vm86
-# %ebp may be used to pass the 6th argument to syscall.
-CFLAGS-epoll_pwait.o += -fomit-frame-pointer
-CFLAGS-epoll_pwait.os += -fomit-frame-pointer
-CFLAGS-mmap.o += -fomit-frame-pointer
-CFLAGS-mmap.os += -fomit-frame-pointer
-CFLAGS-mmap64.o += -fomit-frame-pointer
-CFLAGS-mmap64.os += -fomit-frame-pointer
+CFLAGS-epoll_pwait.o += $(uses-6-syscall-arguments)
+CFLAGS-epoll_pwait.os += $(uses-6-syscall-arguments)
+CFLAGS-mmap.o += $(uses-6-syscall-arguments)
+CFLAGS-mmap.os += $(uses-6-syscall-arguments)
+CFLAGS-mmap64.o += $(uses-6-syscall-arguments)
+CFLAGS-mmap64.os += $(uses-6-syscall-arguments)
+CFLAGS-pselect.o += $(uses-6-syscall-arguments)
+CFLAGS-pselect.os += $(uses-6-syscall-arguments)
+CFLAGS-rtld-mmap.os += $(uses-6-syscall-arguments)
endif
ifeq ($(subdir),sysvipc)
-# %ebp may be used to pass the 6th argument to syscall.
-CFLAGS-semtimedop.o += -fomit-frame-pointer
-CFLAGS-semtimedop.os += -fomit-frame-pointer
+CFLAGS-semtimedop.o += $(uses-6-syscall-arguments)
+CFLAGS-semtimedop.os += $(uses-6-syscall-arguments)
endif
ifeq ($(subdir),elf)
@@ -23,14 +28,25 @@ sysdep-others += lddlibc4
install-bin += lddlibc4
endif
-# fallocate, posix_fallocate use six-argument inline syscalls.
ifeq ($(subdir),io)
sysdep_routines += libc-do-syscall
+CFLAGS-posix_fadvise64.o += $(uses-6-syscall-arguments)
+CFLAGS-posix_fadvise64.os += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate.o += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate.os += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate64.o += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate64.os += $(uses-6-syscall-arguments)
+CFLAGS-sync_file_range.o += $(uses-6-syscall-arguments)
+CFLAGS-sync_file_range.os += $(uses-6-syscall-arguments)
+CFLAGS-fallocate.o += $(uses-6-syscall-arguments)
+CFLAGS-fallocate.os += $(uses-6-syscall-arguments)
+CFLAGS-fallocate64.o += $(uses-6-syscall-arguments)
+CFLAGS-fallocate64.os += $(uses-6-syscall-arguments)
endif
-# libpthread uses six-argument inline syscalls.
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += libc-do-syscall
+libpthread-shared-only-routines += libc-do-syscall
endif
ifeq ($(subdir),resource)
@@ -49,6 +65,14 @@ ifeq ($(subdir),nptl)
# pull in __syscall_error routine
libpthread-routines += sysdep
libpthread-shared-only-routines += sysdep
+CFLAGS-pthread_rwlock_timedrdlock.o += $(uses-6-syscall-arguments)
+CFLAGS-pthread_rwlock_timedrdlock.os += $(uses-6-syscall-arguments)
+CFLAGS-pthread_rwlock_timedwrlock.o += $(uses-6-syscall-arguments)
+CFLAGS-pthread_rwlock_timedwrlock.os += $(uses-6-syscall-arguments)
+CFLAGS-sem_wait.o += $(uses-6-syscall-arguments)
+CFLAGS-sem_wait.os += $(uses-6-syscall-arguments)
+CFLAGS-sem_timedwait.o += $(uses-6-syscall-arguments)
+CFLAGS-sem_timedwait.os += $(uses-6-syscall-arguments)
endif
ifeq ($(subdir),rt)
diff --git a/sysdeps/unix/sysv/linux/i386/fxstat.c b/sysdeps/unix/sysv/linux/i386/fxstat.c
index c1a7613ca7..b21dced00a 100644
--- a/sysdeps/unix/sysv/linux/i386/fxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/fxstat.c
@@ -37,7 +37,7 @@ __fxstat (int vers, int fd, struct stat *buf)
int result;
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (fstat, 2, fd, (struct kernel_stat *) buf);
+ return INLINE_SYSCALL (fstat, 2, fd, buf);
{
struct stat64 buf64;
diff --git a/sysdeps/unix/sysv/linux/i386/gettimeofday.c b/sysdeps/unix/sysv/linux/i386/gettimeofday.c
index 965bb81a4b..6ab1215519 100644
--- a/sysdeps/unix/sysv/linux/i386/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/i386/gettimeofday.c
@@ -16,14 +16,20 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifdef SHARED
+# define __gettimeofday __redirect___gettimeofday
+#endif
+
#include <sys/time.h>
#ifdef SHARED
+# undef __gettimeofday
+# define __gettimeofday_type __redirect___gettimeofday
-# undef libc_ifunc_hidden_def
-# define libc_ifunc_hidden_def(name) \
- libc_ifunc_hidden_def1 (__GI_##name, __gettimeofday_syscall)
-
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__gettimeofday_syscall, __GI___gettimeofday, \
+ __gettimeofday_syscall);
#endif
#include <sysdeps/unix/sysv/linux/x86/gettimeofday.c>
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 6465a555b1..f00345f673 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2013,6 +2013,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist
index 92e94022c7..5db3def6fd 100644
--- a/sysdeps/unix/sysv/linux/i386/libm.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libm.abilist
@@ -422,4 +422,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/i386/lxstat.c b/sysdeps/unix/sysv/linux/i386/lxstat.c
index 3ddaf74c8f..445d154f46 100644
--- a/sysdeps/unix/sysv/linux/i386/lxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/lxstat.c
@@ -38,7 +38,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
int result;
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf);
+ return INLINE_SYSCALL (lstat, 2, name, buf);
{
struct stat64 buf64;
diff --git a/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S b/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
deleted file mode 100644
index 4b5d65cedc..0000000000
--- a/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Copyright (C) 1995-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
-#define EINVAL 22
-#define ENOSYS 38
-#define EOVERFLOW 75
-
-#define SVRSP 16 /* saved register space */
-#define PARMS 4+SVRSP /* space for 4 saved regs */
-#define FD PARMS
-#define OFFLO FD+4
-#define OFFHI OFFLO+4
-#define LENLO OFFHI+4
-#define LENHI LENLO+4
-#define FLAGS LENHI+4
-
- .text
-ENTRY (__posix_fadvise64_l64)
-
- /* Save registers. */
- pushl %ebp
- cfi_adjust_cfa_offset (4)
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- pushl %esi
- cfi_adjust_cfa_offset (4)
- pushl %edi
- cfi_adjust_cfa_offset (4)
-
- movl FD(%esp), %ebx
- cfi_rel_offset (ebx, 8)
- movl OFFLO(%esp), %ecx
- movl OFFHI(%esp), %edx
- movl LENLO(%esp), %esi
- cfi_rel_offset (esi, 4)
- movl LENHI(%esp), %edi
- cfi_rel_offset (edi, 0)
- movl FLAGS(%esp), %ebp
- cfi_rel_offset (ebp, 12)
-
- movl $SYS_ify(fadvise64_64), %eax
- ENTER_KERNEL
-
- /* Restore registers. */
- popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
- popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
- popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
-
- /* The function returns zero, or the error number. So all we
- have to do is negate the value passed back from the kernel. */
- /* If 0 > %eax > -4096 there was an error. */
- negl %eax
-
- /* Successful; return the syscall's value. */
- ret
-
-END (__posix_fadvise64_l64)
-
- .section .text.compat, "ax"
-ENTRY (__posix_fadvise64_l32)
- DO_CALL (fadvise64, 5)
- negl %eax
- ret
-PSEUDO_END_ERRVAL (__posix_fadvise64_l32)
-
-default_symbol_version (__posix_fadvise64_l64, posix_fadvise64, GLIBC_2.3.3)
-symbol_version (__posix_fadvise64_l32, posix_fadvise64, GLIBC_2.2)
diff --git a/sysdeps/unix/sysv/linux/i386/time.c b/sysdeps/unix/sysv/linux/i386/time.c
index 62b78b22de..980a11828f 100644
--- a/sysdeps/unix/sysv/linux/i386/time.c
+++ b/sysdeps/unix/sysv/linux/i386/time.c
@@ -17,10 +17,18 @@
<http://www.gnu.org/licenses/>. */
#ifdef SHARED
+# define time __redirect_time
+#endif
+
+#include <time.h>
+
+#ifdef SHARED
+# undef time
+# define time_type __redirect_time
-# undef libc_ifunc_hidden_def
-# define libc_ifunc_hidden_def(name) \
- libc_ifunc_hidden_def1 (__GI_##name, __time_syscall)
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__time_syscall, __GI_time, __time_syscall);
#endif
#include <sysdeps/unix/sysv/linux/x86/time.c>
diff --git a/sysdeps/unix/sysv/linux/i386/xstat.c b/sysdeps/unix/sysv/linux/i386/xstat.c
index eb8549944b..915a80e820 100644
--- a/sysdeps/unix/sysv/linux/i386/xstat.c
+++ b/sysdeps/unix/sysv/linux/i386/xstat.c
@@ -38,7 +38,7 @@ __xstat (int vers, const char *name, struct stat *buf)
int result;
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (stat, 2, name, (struct kernel_stat *) buf);
+ return INLINE_SYSCALL (stat, 2, name, buf);
{
struct stat64 buf64;
diff --git a/sysdeps/unix/sysv/linux/ia64/Makefile b/sysdeps/unix/sysv/linux/ia64/Makefile
index 1de62c528a..4d6766db5e 100644
--- a/sysdeps/unix/sysv/linux/ia64/Makefile
+++ b/sysdeps/unix/sysv/linux/ia64/Makefile
@@ -19,6 +19,7 @@ endif
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),nptl)
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h b/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
index 591e7a22f0..af15ee856b 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
@@ -16,13 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
-#ifndef _BITS_SIGCONTEXT_H
-#define _BITS_SIGCONTEXT_H 1
-
#define __need_size_t
#include <stddef.h>
#include <bits/sigstack.h>
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h b/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
index 0cd5e84043..f22e503f48 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
@@ -16,12 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
-#ifndef _SIGSTACK_H
-#define _SIGSTACK_H 1
+#define __need_size_t
+#include <stddef.h>
/* Structure describing a signal stack (obsolete). */
struct sigstack
@@ -30,8 +33,15 @@ struct sigstack
int ss_onstack; /* Nonzero if executing on this stack. */
};
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ __ptr_t ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
-/* Possible values for `ss_flags.'. */
+/* Possible values for `ss_flags'. */
enum
{
SS_ONSTACK = 1,
@@ -50,13 +60,4 @@ enum
/* System default stack size. */
#define SIGSTKSZ 262144
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- __ptr_t ss_sp;
- int ss_flags;
- size_t ss_size;
- } stack_t;
-
-#endif /* bits/sigstack.h */
+#endif /* bits/sigstack.h */
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index 4536271b6e..e5fcf88b18 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -1877,6 +1877,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/ia64/libm.abilist b/sysdeps/unix/sysv/linux/ia64/libm.abilist
index e2737a2ba9..a80c93a00f 100644
--- a/sysdeps/unix/sysv/linux/ia64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libm.abilist
@@ -351,4 +351,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h b/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
index c79fced452..730aa78fda 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
@@ -21,7 +21,11 @@
#include <features.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
/*
* These are here mostly for backwards compatibility with older Unices.
diff --git a/sysdeps/unix/sysv/linux/include/sys/sysinfo.h b/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
index 50077fb08c..b76f7e0d09 100644
--- a/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
+++ b/sysdeps/unix/sysv/linux/include/sys/sysinfo.h
@@ -21,6 +21,9 @@
#include_next <sys/sysinfo.h>
+# ifndef _ISOMAC
+
extern __typeof (sysinfo) __sysinfo __THROW;
+# endif /* _ISOMAC */
#endif /* sys/sysinfo.h */
diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h
index ace90ee033..4b4ff88895 100644
--- a/sysdeps/unix/sysv/linux/include/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/include/sys/timex.h
@@ -21,6 +21,9 @@
#include_next <sys/timex.h>
+# ifndef _ISOMAC
+
libc_hidden_proto (__adjtimex)
+# endif /* _ISOMAC */
#endif /* sys/timex.h */
diff --git a/sysdeps/unix/sysv/linux/llseek.c b/sysdeps/unix/sysv/linux/llseek.c
deleted file mode 100644
index b6f3ea5f0d..0000000000
--- a/sysdeps/unix/sysv/linux/llseek.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Long-long seek operation.
- Copyright (C) 1996-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <sys/types.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Seek to OFFSET on FD, starting from WHENCE. */
-extern loff_t __llseek (int fd, loff_t offset, int whence);
-
-loff_t
-__llseek (int fd, loff_t offset, int whence)
-{
- loff_t retval;
-
- return (loff_t) (INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff),
- &retval, whence) ?: retval);
-}
-weak_alias (__llseek, llseek)
-strong_alias (__llseek, __libc_lseek64)
-strong_alias (__llseek, __lseek64)
-weak_alias (__llseek, lseek64)
-
-/* llseek doesn't have a prototype. Since the second parameter is a
- 64bit type, this results in wrong behaviour if no prototype is
- provided. */
-link_warning (llseek, "\
-the `llseek' function may be dangerous; use `lseek64' instead.")
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c b/sysdeps/unix/sysv/linux/lseek.c
index dbf0b2652b..3b81bffe92 100644
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c
+++ b/sysdeps/unix/sysv/linux/lseek.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Linux lseek implementation, 32 bits off_t.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Chris Metcalf <cmetcalf@tilera.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
@@ -16,23 +16,42 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <unistd.h>
+#include <stdint.h>
#include <sys/types.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
+
+#ifndef __OFF_T_MATCHES_OFF64_T
-#include "overflow.h"
+/* Test for overflows of structures where we ask the kernel to fill them
+ in with standard 64-bit syscalls but return them through APIs that
+ only expose the low 32 bits of some fields. */
+
+static inline off_t lseek_overflow (loff_t res)
+{
+ off_t retval = (off_t) res;
+ if (retval == res)
+ return retval;
+
+ __set_errno (EOVERFLOW);
+ return (off_t) -1;
+}
off_t
__lseek (int fd, off_t offset, int whence)
{
+# ifdef __NR__llseek
loff_t res;
- int rc = INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 31),
- (off_t) offset, &res, whence);
+ int rc = INLINE_SYSCALL_CALL (_llseek, fd,
+ (long) (((uint64_t) (offset)) >> 32),
+ (long) offset, &res, whence);
return rc ?: lseek_overflow (res);
+# else
+ return INLINE_SYSCALL_CALL (lseek, fd, offset, whence);
+# endif
}
libc_hidden_def (__lseek)
weak_alias (__lseek, lseek)
strong_alias (__lseek, __libc_lseek)
+#endif /* __OFF_T_MATCHES_OFF64_T */
diff --git a/sysdeps/unix/sysv/linux/lseek64.c b/sysdeps/unix/sysv/linux/lseek64.c
index d81e98fb51..c4a0851d8c 100644
--- a/sysdeps/unix/sysv/linux/lseek64.c
+++ b/sysdeps/unix/sysv/linux/lseek64.c
@@ -1 +1,54 @@
-/* We don't need a definition since the llseek function is what we need. */
+/* Linux lseek implementation, 64 bits off_t.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sysdep.h>
+#include <errno.h>
+
+off64_t
+__lseek64 (int fd, off64_t offset, int whence)
+{
+#ifdef __NR__llseek
+ loff_t res;
+ int rc = INLINE_SYSCALL_CALL (_llseek, fd,
+ (long) (((uint64_t) (offset)) >> 32),
+ (long) offset, &res, whence);
+ return rc ?: res;
+#else
+ return INLINE_SYSCALL_CALL (lseek, fd, offset, whence);
+#endif
+}
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (__lseek64, lseek)
+weak_alias (__lseek64, __lseek)
+strong_alias (__lseek64, __libc_lseek)
+libc_hidden_def (__lseek)
+#endif
+
+strong_alias (__lseek64, __libc_lseek64)
+weak_alias (__lseek64, lseek64)
+
+/* llseek doesn't have a prototype. Since the second parameter is a
+ 64bit type, this results in wrong behaviour if no prototype is
+ provided. */
+weak_alias (__lseek64, llseek)
+link_warning (llseek, "\
+the `llseek' function may be dangerous; use `lseek64' instead.")
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
index e36204aa1b..c8bf06d1eb 100644
--- a/sysdeps/unix/sysv/linux/lxstat.c
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -35,7 +35,7 @@ int
__lxstat (int vers, const char *name, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf);
+ return INLINE_SYSCALL (lstat, 2, name, buf);
#ifdef STAT_IS_KERNEL_STAT
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c
index 09a678a3a9..4d8c0a6ab4 100644
--- a/sysdeps/unix/sysv/linux/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/lxstat64.c
@@ -32,7 +32,7 @@ ___lxstat64 (int vers, const char *name, struct stat64 *buf)
{
int result;
result = INLINE_SYSCALL (lstat64, 2, name, buf);
-#if defined _HAVE_STAT64___ST_INO && !defined __ASSUME_ST_INO_64_BIT
+#if defined _HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT
if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
buf->st_ino = buf->__st_ino;
#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 287d7a5df9..8f382f680b 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -92,6 +92,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0x98
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
index 7a02fb1726..675dfa5b86 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
@@ -68,6 +68,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index c9229fa94f..320b7fef5f 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -1969,6 +1969,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
index 9af59d7d90..c795dbdc88 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
@@ -420,4 +420,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h b/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
index d8ee5423a5..66f4b55307 100644
--- a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
@@ -23,6 +23,12 @@
#include <features.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+
/* Type for general register. */
typedef int greg_t;
diff --git a/sysdeps/unix/sysv/linux/microblaze/Makefile b/sysdeps/unix/sysv/linux/microblaze/Makefile
index 44a838fa11..d178bc6f34 100644
--- a/sysdeps/unix/sysv/linux/microblaze/Makefile
+++ b/sysdeps/unix/sysv/linux/microblaze/Makefile
@@ -5,4 +5,5 @@ endif
ifeq ($(subdir),nptl)
# pull in __syscall_error routine
libpthread-routines += sysdep
-endif \ No newline at end of file
+libpthread-shared-only-routines += sysdep
+endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/libc.abilist
index 04097919b6..21b14262c6 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libc.abilist
@@ -2090,3 +2090,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/microblaze/libm.abilist b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
index 0b1f1360e0..cdc8f19971 100644
--- a/sysdeps/unix/sysv/linux/microblaze/libm.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/libm.abilist
@@ -379,3 +379,22 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mips/Makefile
index c6729c15f9..bca11d39e0 100644
--- a/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/Makefile
@@ -99,6 +99,12 @@ sysdep-dl-routines += dl-static
sysdep_routines += dl-vdso
endif
+
+# Supporting non-executable stacks on MIPS requires changes to both
+# the Linux kernel and glibc. See
+# <https://sourceware.org/ml/libc-alpha/2016-01/msg00567.html> and
+# <https://sourceware.org/ml/libc-alpha/2016-01/msg00719.html>.
+test-xfail-check-execstack = yes
endif
ifeq ($(subdir),stdlib)
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index 4ce5ff6dd0..e3bcccfea8 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -183,8 +183,7 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
+#include <bits/types/struct_timeval.h>
/* Structure which says how much of each resource has been used. */
struct rusage
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h b/sysdeps/unix/sysv/linux/mips/bits/sigstack.h
index 2e9665444a..9e1ace9fdd 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/sigstack.h
@@ -16,10 +16,15 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
+#define __need_size_t
+#include <stddef.h>
/* Structure describing a signal stack (obsolete). */
struct sigstack
@@ -28,8 +33,15 @@ struct sigstack
int ss_onstack; /* Nonzero if executing on this stack. */
};
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ size_t ss_size;
+ int ss_flags;
+ } stack_t;
-/* Possible values for `ss_flags.'. */
+/* Possible values for `ss_flags'. */
enum
{
SS_ONSTACK = 1,
@@ -44,11 +56,4 @@ enum
/* System default stack size. */
#define SIGSTKSZ 8192
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- void *ss_sp;
- size_t ss_size;
- int ss_flags;
- } stack_t;
+#endif /* bits/sigstack.h */
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index f31653e584..5c4b596c54 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -1944,6 +1944,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
index 2e2bb00738..a610b03eba 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
@@ -381,6 +381,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F
_gp_disp _gp_disp A
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index a56bd992f7..001fa6c129 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -1942,6 +1942,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
deleted file mode 100644
index 705c0c75de..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-posix_fadvise (int fd, off_t offset, off_t len, int advise)
-{
-/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
-#ifdef __NR_fadvise64
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0,
- __LONG_LONG_PAIR (offset >> 31, offset),
- __LONG_LONG_PAIR (len >> 31, len),
- advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
-#else
- return ENOSYS;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c
deleted file mode 100644
index 0ded3c3357..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
-{
-/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
-#ifdef __NR_fadvise64
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0,
- __LONG_LONG_PAIR ((long) (offset >> 32),
- (long) offset),
- __LONG_LONG_PAIR ((long) (len >> 32),
- (long) len),
- advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
-#else
- return ENOSYS;
-#endif
-}
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
-
-int
-attribute_compat_text_section
-__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
-{
- return __posix_fadvise64_l64 (fd, offset, len, advise);
-}
-
-versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
-compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
-#else
-strong_alias (__posix_fadvise64_l64, posix_fadvise64);
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
deleted file mode 100644
index de831c79e4..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Selective file content synch'ing.
- Copyright (C) 2006-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-int
-sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
-{
- return SYSCALL_CANCEL (sync_file_range, fd, 0,
- __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
- __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
- flags);
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
index 7daa595282..dfd888cf70 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
@@ -412,4 +412,24 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/llseek.c b/sysdeps/unix/sysv/linux/mips/mips64/llseek.c
deleted file mode 100644
index 24013a8224..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/llseek.c
+++ /dev/null
@@ -1 +0,0 @@
-/* lseek() is 64-bit capable already. */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
deleted file mode 100644
index 4e432f42be..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep-cancel.h>
-
-
-/* Reserve storage for the data of the file associated with FD. */
-int
-fallocate (int fd, int mode, __off_t offset, __off_t len)
-{
-#ifdef __NR_fallocate
- return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
-#else
- __set_errno (ENOSYS);
- return -1;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
deleted file mode 100644
index 95c9eabba3..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep-cancel.h>
-
-
-/* Reserve storage for the data of the file associated with FD. */
-int
-fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
-{
-#ifdef __NR_fallocate
- return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
-#else
- __set_errno (ENOSYS);
- return -1;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 44552df7b0..2d870013f7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -1940,6 +1940,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c
deleted file mode 100644
index 3b1ef7e1fe..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 2003-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-posix_fadvise (int fd, off_t offset, off_t len, int advise)
-{
-#ifdef __NR_fadvise64
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
-#else
- return ENOSYS;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c
deleted file mode 100644
index e7ddc873fc..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
-{
-/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
-#ifdef __NR_fadvise64
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
-#else
- return ENOSYS;
-#endif
-}
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
-
-int
-attribute_compat_text_section
-__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
-{
- return __posix_fadvise64_l64 (fd, offset, len, advise);
-}
-
-versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
-compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
-#else
-strong_alias (__posix_fadvise64_l64, posix_fadvise64);
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c
deleted file mode 100644
index e652e5bec3..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <fcntl.h>
-#include <sysdep.h>
-
-#define posix_fallocate static internal_fallocate
-#include <sysdeps/posix/posix_fallocate.c>
-#undef posix_fallocate
-
-/* Reserve storage for the data of the file associated with FD. */
-int
-posix_fallocate (int fd, __off_t offset, __off_t len)
-{
- INTERNAL_SYSCALL_DECL (err);
- int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len);
-
- if (! INTERNAL_SYSCALL_ERROR_P (res, err))
- return 0;
- if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
- return INTERNAL_SYSCALL_ERRNO (res, err);
- return internal_fallocate (fd, offset, len);
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c
deleted file mode 100644
index d5659e0367..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <fcntl.h>
-#include <sysdep.h>
-
-extern int __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len);
-#define __posix_fallocate64_l64 static internal_fallocate64
-#include <sysdeps/posix/posix_fallocate64.c>
-#undef __posix_fallocate64_l64
-
-/* Reserve storage for the data of the file associated with FD. */
-int
-__posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
-{
- INTERNAL_SYSCALL_DECL (err);
- int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len);
-
- if (! INTERNAL_SYSCALL_ERROR_P (res, err))
- return 0;
- if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
- return INTERNAL_SYSCALL_ERRNO (res, err);
- return internal_fallocate64 (fd, offset, len);
-}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
index f55a94ac89..58fd46a9b9 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
@@ -3,7 +3,6 @@
mmap64 - mmap b:aniiii __mmap64 mmap64
readahead - readahead i:iii __readahead readahead
-sync_file_range - sync_file_range Ci:iiii sync_file_range
prlimit64 EXTRA prlimit64 i:iipp prlimit64
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c
deleted file mode 100644
index d3b72183ce..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/wordsize-64/fallocate.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c
deleted file mode 100644
index fb2b6813a2..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* fallocate64 is in fallocate.c */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 8d2a09dc9c..aa1ee66ab7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -1935,6 +1935,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c
deleted file mode 100644
index 86ff6ef5b9..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (C) 2003-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#define posix_fadvise64 __no_posix_fadvise64
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-#undef posix_fadvise64
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-posix_fadvise (int fd, off_t offset, off_t len, int advise)
-{
-#ifdef __NR_fadvise64
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
-#else
- return ENOSYS;
-#endif
-}
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
-strong_alias (posix_fadvise, __posix_fadvise64_l32);
-compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
-strong_alias (posix_fadvise, __posix_fadvise64_l64);
-versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
-#else
-weak_alias (posix_fadvise, posix_fadvise64);
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
index c9f72c4ce1..bc756e9b84 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
@@ -1 +1,33 @@
-/* posix_fadvise64 is in posix_fadvise.c */
+/* Copyright (C) 2003-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#undef weak_alias
+#define weak_alias(a, b)
+#undef strong_alias
+#define strong_alias(a, b)
+
+#include <sysdeps/unix/sysv/linux/posix_fadvise64.c>
+
+/* Although both posix_fadvise and posix_fadvise64 has the same semantic
+ on mips64, there were were releases with both symbol versions (BZ#14044).
+ So we need to continue export them. */
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+_strong_alias (__posix_fadvise64_l64, __posix_fadvise64_l32);
+compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
+versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
+#endif
+_strong_alias (__posix_fadvise64_l64, posix_fadvise);
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c
deleted file mode 100644
index b3fe81bc8c..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c
deleted file mode 100644
index f466f13e45..0000000000
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* posix_fallocate64 is in posix_fallocate.c */
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
index 890a74494a..533f19d7d1 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
@@ -2,8 +2,6 @@
mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64
-sync_file_range - sync_file_range Ci:iiii sync_file_range
-
prlimit EXTRA prlimit64 i:iipp prlimit prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
index 66cc687abb..d2d851e81c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
@@ -1,7 +1,5 @@
# File name Caller Syscall name Args Strong name Weak names
-lseek - lseek i:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
-
ftruncate - ftruncate i:ii __ftruncate ftruncate ftruncate64 __ftruncate64
truncate - truncate i:si truncate truncate64
diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
index b5d2e2ab10..1ab0c686ef 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
@@ -20,12 +20,15 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
-#include <sgidefs.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+#include <sgidefs.h>
+
/* Type for general register. Even in o32 we assume 64-bit registers,
like the kernel. */
diff --git a/sysdeps/unix/sysv/linux/mips/sys/user.h b/sysdeps/unix/sysv/linux/mips/sys/user.h
index b240438d0a..f3547d9085 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/user.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/user.h
@@ -19,6 +19,7 @@
#define _SYS_USER_H 1
#include <sgidefs.h>
+#include <stddef.h>
/* The whole purpose of this file is for GDB and GDB only. Don't read
too much into it. Don't use it for anything other than GDB unless
diff --git a/sysdeps/unix/sysv/linux/net/ethernet.h b/sysdeps/unix/sysv/linux/net/ethernet.h
index 3160e9341b..833473e41d 100644
--- a/sysdeps/unix/sysv/linux/net/ethernet.h
+++ b/sysdeps/unix/sysv/linux/net/ethernet.h
@@ -21,8 +21,9 @@
#ifndef __NET_ETHERNET_H
#define __NET_ETHERNET_H 1
-#include <sys/cdefs.h>
#include <sys/types.h>
+#include <stdint.h>
+
#include <linux/if_ether.h> /* IEEE 802.3 Ethernet constants */
__BEGIN_DECLS
@@ -31,15 +32,15 @@ __BEGIN_DECLS
systems. */
struct ether_addr
{
- u_int8_t ether_addr_octet[ETH_ALEN];
+ uint8_t ether_addr_octet[ETH_ALEN];
} __attribute__ ((__packed__));
/* 10Mb/s ethernet header */
struct ether_header
{
- u_int8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
- u_int8_t ether_shost[ETH_ALEN]; /* source ether addr */
- u_int16_t ether_type; /* packet type ID field */
+ uint8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
+ uint8_t ether_shost[ETH_ALEN]; /* source ether addr */
+ uint16_t ether_type; /* packet type ID field */
} __attribute__ ((__packed__));
/* Ethernet protocol ID's */
diff --git a/sysdeps/unix/sysv/linux/net/if_arp.h b/sysdeps/unix/sysv/linux/net/if_arp.h
index 1b3f1d3820..9a20c8358f 100644
--- a/sysdeps/unix/sysv/linux/net/if_arp.h
+++ b/sysdeps/unix/sysv/linux/net/if_arp.h
@@ -20,12 +20,11 @@
/* Based on the 4.4BSD and Linux version of this file. */
#ifndef _NET_IF_ARP_H
-
#define _NET_IF_ARP_H 1
-#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <stdint.h>
__BEGIN_DECLS
@@ -171,7 +170,7 @@ struct arpreq_old
struct arpd_request
{
unsigned short int req; /* Request type. */
- u_int32_t ip; /* IP address of entry. */
+ uint32_t ip; /* IP address of entry. */
unsigned long int dev; /* Device entry is tied to. */
unsigned long int stamp;
unsigned long int updated;
diff --git a/sysdeps/unix/sysv/linux/net/if_ppp.h b/sysdeps/unix/sysv/linux/net/if_ppp.h
index 1b1c3ea6eb..31a20766f0 100644
--- a/sysdeps/unix/sysv/linux/net/if_ppp.h
+++ b/sysdeps/unix/sysv/linux/net/if_ppp.h
@@ -49,8 +49,7 @@
#define __NET_IF_PPP_H 1
#include <sys/types.h>
-#include <sys/cdefs.h>
-
+#include <stdint.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <net/ppp_defs.h>
@@ -114,11 +113,13 @@ struct npioctl {
/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
struct ppp_option_data {
- u_int8_t *ptr;
- u_int32_t length;
- int transmit;
+ uint8_t *ptr;
+ uint32_t length;
+ int transmit;
};
+/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */
+#ifdef __USE_MISC
struct ifpppstatsreq {
struct ifreq b;
struct ppp_stats stats; /* statistic information */
@@ -131,6 +132,7 @@ struct ifpppcstatsreq {
#define ifr__name b.ifr_ifrn.ifrn_name
#define stats_ptr b.ifr_ifru.ifru_data
+#endif
/*
* Ioctl definitions.
diff --git a/sysdeps/unix/sysv/linux/net/if_shaper.h b/sysdeps/unix/sysv/linux/net/if_shaper.h
index 956ad62c9b..e318794e0f 100644
--- a/sysdeps/unix/sysv/linux/net/if_shaper.h
+++ b/sysdeps/unix/sysv/linux/net/if_shaper.h
@@ -18,8 +18,8 @@
#ifndef _NET_IF_SHAPER_H
#define _NET_IF_SHAPER_H 1
-#include <features.h>
#include <sys/types.h>
+#include <stdint.h>
#include <net/if.h>
#include <sys/ioctl.h>
@@ -43,11 +43,11 @@ __BEGIN_DECLS
struct shaperconf
{
- u_int16_t ss_cmd;
+ uint16_t ss_cmd;
union
{
char ssu_name[14];
- u_int32_t ssu_speed;
+ uint32_t ssu_speed;
} ss_u;
#define ss_speed ss_u.ssu_speed
#define ss_name ss_u.ssu_name
diff --git a/sysdeps/unix/sysv/linux/net/ppp_defs.h b/sysdeps/unix/sysv/linux/net/ppp_defs.h
index f8924c4f27..5e492e9dbf 100644
--- a/sysdeps/unix/sysv/linux/net/ppp_defs.h
+++ b/sysdeps/unix/sysv/linux/net/ppp_defs.h
@@ -1,9 +1,7 @@
#ifndef _NET_PPP_DEFS_H
#define _NET_PPP_DEFS_H 1
-#define __need_time_t
-#include <time.h>
-
+#include <bits/types/time_t.h>
#include <asm/types.h>
#include <linux/ppp_defs.h>
diff --git a/sysdeps/unix/sysv/linux/net/route.h b/sysdeps/unix/sysv/linux/net/route.h
index 11d21c6cf1..ea785ab04a 100644
--- a/sysdeps/unix/sysv/linux/net/route.h
+++ b/sysdeps/unix/sysv/linux/net/route.h
@@ -59,12 +59,12 @@ struct in6_rtmsg
struct in6_addr rtmsg_dst;
struct in6_addr rtmsg_src;
struct in6_addr rtmsg_gateway;
- u_int32_t rtmsg_type;
- u_int16_t rtmsg_dst_len;
- u_int16_t rtmsg_src_len;
- u_int32_t rtmsg_metric;
+ uint32_t rtmsg_type;
+ uint16_t rtmsg_dst_len;
+ uint16_t rtmsg_src_len;
+ uint32_t rtmsg_metric;
unsigned long int rtmsg_info;
- u_int32_t rtmsg_flags;
+ uint32_t rtmsg_flags;
int rtmsg_ifindex;
};
@@ -113,7 +113,7 @@ struct in6_rtmsg
#define RTF_NAT 0x08000000
#define RTF_ADDRCLASSMASK 0xF8000000
-#define RT_ADDRCLASS(flags) ((__u_int32_t) flags >> 23)
+#define RT_ADDRCLASS(flags) ((uint32_t) flags >> 23)
#define RT_TOS(tos) ((tos) & IPTOS_TOS_MASK)
diff --git a/sysdeps/unix/sysv/linux/netinet/if_ether.h b/sysdeps/unix/sysv/linux/netinet/if_ether.h
index e9ed13774f..ccd8cebbaf 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_ether.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_ether.h
@@ -70,10 +70,10 @@ __BEGIN_DECLS
*/
struct ether_arp {
struct arphdr ea_hdr; /* fixed-size header */
- u_int8_t arp_sha[ETH_ALEN]; /* sender hardware address */
- u_int8_t arp_spa[4]; /* sender protocol address */
- u_int8_t arp_tha[ETH_ALEN]; /* target hardware address */
- u_int8_t arp_tpa[4]; /* target protocol address */
+ uint8_t arp_sha[ETH_ALEN]; /* sender hardware address */
+ uint8_t arp_spa[4]; /* sender protocol address */
+ uint8_t arp_tha[ETH_ALEN]; /* target hardware address */
+ uint8_t arp_tpa[4]; /* target protocol address */
};
#define arp_hrd ea_hdr.ar_hrd
#define arp_pro ea_hdr.ar_pro
@@ -88,14 +88,14 @@ struct ether_arp {
*/
#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
/* struct in_addr *ipaddr; */ \
- /* u_char enaddr[ETH_ALEN]; */ \
+ /* uint8_t enaddr[ETH_ALEN]; */ \
{ \
(enaddr)[0] = 0x01; \
(enaddr)[1] = 0x00; \
(enaddr)[2] = 0x5e; \
- (enaddr)[3] = ((u_int8_t *)ipaddr)[1] & 0x7f; \
- (enaddr)[4] = ((u_int8_t *)ipaddr)[2]; \
- (enaddr)[5] = ((u_int8_t *)ipaddr)[3]; \
+ (enaddr)[3] = ((uint8_t *)ipaddr)[1] & 0x7f; \
+ (enaddr)[4] = ((uint8_t *)ipaddr)[2]; \
+ (enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
}
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/netinet/if_fddi.h b/sysdeps/unix/sysv/linux/netinet/if_fddi.h
index 6e0ab370de..675801418f 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_fddi.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_fddi.h
@@ -18,18 +18,16 @@
#ifndef _NETINET_IF_FDDI_H
#define _NETINET_IF_FDDI_H 1
-#include <sys/cdefs.h>
#include <sys/types.h>
-#include <asm/types.h>
-
+#include <stdint.h>
#include <linux/if_fddi.h>
#ifdef __USE_MISC
struct fddi_header {
- u_int8_t fddi_fc; /* Frame Control (FC) value */
- u_int8_t fddi_dhost[FDDI_K_ALEN]; /* Destination host */
- u_int8_t fddi_shost[FDDI_K_ALEN]; /* Source host */
+ uint8_t fddi_fc; /* Frame Control (FC) value */
+ uint8_t fddi_dhost[FDDI_K_ALEN]; /* Destination host */
+ uint8_t fddi_shost[FDDI_K_ALEN]; /* Source host */
};
#endif
diff --git a/sysdeps/unix/sysv/linux/netinet/if_tr.h b/sysdeps/unix/sysv/linux/netinet/if_tr.h
index c203d11be1..814a35d5da 100644
--- a/sysdeps/unix/sysv/linux/netinet/if_tr.h
+++ b/sysdeps/unix/sysv/linux/netinet/if_tr.h
@@ -18,8 +18,8 @@
#ifndef _NETINET_IF_TR_H
#define _NETINET_IF_TR_H 1
-#include <sys/cdefs.h>
#include <sys/types.h>
+#include <stdint.h>
/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
and FCS/CRC (frame check sequence). */
@@ -35,22 +35,22 @@
/* This is an Token-Ring frame header. */
struct trh_hdr
{
- u_int8_t ac; /* access control field */
- u_int8_t fc; /* frame control field */
- u_int8_t daddr[TR_ALEN]; /* destination address */
- u_int8_t saddr[TR_ALEN]; /* source address */
- u_int16_t rcf; /* route control field */
- u_int16_t rseg[8]; /* routing registers */
+ uint8_t ac; /* access control field */
+ uint8_t fc; /* frame control field */
+ uint8_t daddr[TR_ALEN]; /* destination address */
+ uint8_t saddr[TR_ALEN]; /* source address */
+ uint16_t rcf; /* route control field */
+ uint16_t rseg[8]; /* routing registers */
};
/* This is an Token-Ring LLC structure */
struct trllc
{
- u_int8_t dsap; /* destination SAP */
- u_int8_t ssap; /* source SAP */
- u_int8_t llc; /* LLC control field */
- u_int8_t protid[3]; /* protocol id */
- u_int16_t ethertype; /* ether type field */
+ uint8_t dsap; /* destination SAP */
+ uint8_t ssap; /* source SAP */
+ uint8_t llc; /* LLC control field */
+ uint8_t protid[3]; /* protocol id */
+ uint16_t ethertype; /* ether type field */
};
/* Token-Ring statistics collection data. */
@@ -97,12 +97,12 @@ struct tr_statistics
struct trn_hdr
{
- u_int8_t trn_ac; /* access control field */
- u_int8_t trn_fc; /* field control field */
- u_int8_t trn_dhost[TR_ALEN]; /* destination host */
- u_int8_t trn_shost[TR_ALEN]; /* source host */
- u_int16_t trn_rcf; /* route control field */
- u_int16_t trn_rseg[8]; /* routing registers */
+ uint8_t trn_ac; /* access control field */
+ uint8_t trn_fc; /* field control field */
+ uint8_t trn_dhost[TR_ALEN]; /* destination host */
+ uint8_t trn_shost[TR_ALEN]; /* source host */
+ uint16_t trn_rcf; /* route control field */
+ uint16_t trn_rseg[8]; /* routing registers */
};
#endif
diff --git a/sysdeps/unix/sysv/linux/netipx/ipx.h b/sysdeps/unix/sysv/linux/netipx/ipx.h
index 855ab9903d..338aab5095 100644
--- a/sysdeps/unix/sysv/linux/netipx/ipx.h
+++ b/sysdeps/unix/sysv/linux/netipx/ipx.h
@@ -18,9 +18,8 @@
#ifndef __NETIPX_IPX_H
#define __NETIPX_IPX_H 1
-#include <features.h>
-
#include <sys/types.h>
+#include <stdint.h>
#include <bits/sockaddr.h>
__BEGIN_DECLS
@@ -34,10 +33,10 @@ __BEGIN_DECLS
struct sockaddr_ipx
{
sa_family_t sipx_family;
- u_int16_t sipx_port;
- u_int32_t sipx_network;
+ uint16_t sipx_port;
+ uint32_t sipx_network;
unsigned char sipx_node[IPX_NODE_LEN];
- u_int8_t sipx_type;
+ uint8_t sipx_type;
unsigned char sipx_zero; /* 16 byte fill */
};
diff --git a/sysdeps/unix/sysv/linux/netrose/rose.h b/sysdeps/unix/sysv/linux/netrose/rose.h
index 3cb7f84eb0..762d3f5888 100644
--- a/sysdeps/unix/sysv/linux/netrose/rose.h
+++ b/sysdeps/unix/sysv/linux/netrose/rose.h
@@ -21,6 +21,9 @@
#ifndef _NETROSE_ROSE_H
#define _NETROSE_ROSE_H 1
+#include <sys/socket.h>
+#include <netax25/ax25.h>
+
/* Socket level values. */
#define SOL_ROSE 260
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 0443b92361..2471d68e87 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2131,3 +2131,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/nios2/libm.abilist b/sysdeps/unix/sysv/linux/nios2/libm.abilist
index a36e2f32fc..a6c505d19a 100644
--- a/sysdeps/unix/sysv/linux/nios2/libm.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libm.abilist
@@ -379,3 +379,22 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h b/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
index a44ec61fa0..26c55de312 100644
--- a/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
@@ -24,6 +24,12 @@
#include <features.h>
#include <signal.h>
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+
/* These definitions must be in sync with the kernel. */
#define MCONTEXT_VERSION 2
diff --git a/sysdeps/unix/sysv/linux/posix_fadvise.c b/sysdeps/unix/sysv/linux/posix_fadvise.c
index 093d707ccf..869a642f6d 100644
--- a/sysdeps/unix/sysv/linux/posix_fadvise.c
+++ b/sysdeps/unix/sysv/linux/posix_fadvise.c
@@ -22,27 +22,46 @@
/* Advice the system about the expected behaviour of the application with
respect to the file associated with FD. */
+#ifndef __OFF_T_MATCHES_OFF64_T
+
+/* Both arm and powerpc implements fadvise64_64 with last 'advise' argument
+ just after 'fd' to avoid the requirement of implementing 7-arg syscalls.
+ ARM also defines __NR_fadvise64_64 as __NR_arm_fadvise64_64.
+
+ tile requires __ASSUME_ALIGNED_REGISTER_PAIRS but implements the 32-bit
+ fadvise64_64 without the padding 0 after fd.
+
+ s390 implements fadvice64_64 using a specific struct with arguments
+ packed inside. This is the only implementation handled in arch-specific
+ code. */
+
int
posix_fadvise (int fd, off_t offset, off_t len, int advise)
{
-#if defined(__NR_fadvise64) || defined(__NR_fadvise64_64)
INTERNAL_SYSCALL_DECL (err);
# ifdef __NR_fadvise64
- int ret = INTERNAL_SYSCALL (fadvise64, err, 5, fd,
- __LONG_LONG_PAIR (offset >> 31, offset), len,
- advise);
+ int ret = INTERNAL_SYSCALL_CALL (fadvise64, err, fd,
+ __ALIGNMENT_ARG SYSCALL_LL (offset),
+ len, advise);
# else
- int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
- __LONG_LONG_PAIR ((long) (offset >> 31),
- (long) offset),
- __LONG_LONG_PAIR ((long) (len >> 31),
- (long) len),
- advise);
+# ifdef __ASSUME_FADVISE64_64_6ARG
+ int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd, advise,
+ __ALIGNMENT_ARG SYSCALL_LL (offset),
+ SYSCALL_LL (len));
+# else
+
+# ifdef __ASSUME_FADVISE64_64_NO_ALIGN
+# undef __ALIGNMENT_ARG
+# define __ALIGNMENT_ARG
+# endif
+
+ int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd,
+ __ALIGNMENT_ARG SYSCALL_LL (offset),
+ SYSCALL_LL (len), advise);
+# endif
# endif
if (INTERNAL_SYSCALL_ERROR_P (ret, err))
return INTERNAL_SYSCALL_ERRNO (ret, err);
return 0;
-#else
- return ENOSYS;
-#endif
}
+#endif /* __OFF_T_MATCHES_OFF64_T */
diff --git a/sysdeps/unix/sysv/linux/posix_fadvise64.c b/sysdeps/unix/sysv/linux/posix_fadvise64.c
index 6d10558a5e..b4adb5fad6 100644
--- a/sysdeps/unix/sysv/linux/posix_fadvise64.c
+++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c
@@ -17,10 +17,29 @@
#include <errno.h>
#include <fcntl.h>
-#include <sysdep.h>
+#include <shlib-compat.h>
int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
-int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise);
+
+/* Both arm and powerpc implements fadvise64_64 with last 'advise' argument
+ just after 'fd' to avoid the requirement of implementing 7-arg syscalls.
+ ARM also defines __NR_fadvise64_64 as __NR_arm_fadvise64_64.
+
+ tile requires __ASSUME_ALIGNED_REGISTER_PAIRS but implements the 32-bit
+ fadvise64_64 without the padding 0 after fd.
+
+ s390 implements fadvice64_64 using a specific struct with arguments
+ packed inside. This is the only implementation handled in arch-specific
+ code. */
+
+#ifdef __ASSUME_FADVISE64_64_NO_ALIGN
+# undef __ALIGNMENT_ARG
+# define __ALIGNMENT_ARG
+#endif
+
+#ifndef __NR_fadvise64_64
+# define __NR_fadvise64_64 __NR_fadvise64
+#endif
/* Advice the system about the expected behaviour of the application with
respect to the file associated with FD. */
@@ -29,20 +48,24 @@ int
__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
{
INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
- __LONG_LONG_PAIR ((long) (offset >> 32),
- (long) offset),
- __LONG_LONG_PAIR ((long) (len >> 32),
- (long) len),
- advise);
+#ifdef __ASSUME_FADVISE64_64_6ARG
+ int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd, advise,
+ SYSCALL_LL64 (offset), SYSCALL_LL64 (len));
+#else
+ int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd,
+ __ALIGNMENT_ARG SYSCALL_LL64 (offset),
+ SYSCALL_LL64 (len), advise);
+#endif
if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
return 0;
return INTERNAL_SYSCALL_ERRNO (ret, err);
}
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+/* The type of the len argument was changed from size_t to off_t in
+ POSIX.1-2003 TC1. */
+#ifndef __OFF_T_MATCHES_OFF64_T
+# if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise);
int
attribute_compat_text_section
@@ -53,6 +76,10 @@ __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
+# else
+weak_alias (__posix_fadvise64_l64, posix_fadvise64);
+# endif
#else
-strong_alias (__posix_fadvise64_l64, posix_fadvise64);
+weak_alias (__posix_fadvise64_l64, posix_fadvise64);
+strong_alias (__posix_fadvise64_l64, posix_fadvise);
#endif
diff --git a/sysdeps/unix/sysv/linux/posix_fallocate.c b/sysdeps/unix/sysv/linux/posix_fallocate.c
index fc9ac37893..139cb562fe 100644
--- a/sysdeps/unix/sysv/linux/posix_fallocate.c
+++ b/sysdeps/unix/sysv/linux/posix_fallocate.c
@@ -27,10 +27,8 @@ int
posix_fallocate (int fd, __off_t offset, __off_t len)
{
INTERNAL_SYSCALL_DECL (err);
- int res = INTERNAL_SYSCALL (fallocate, err, 6, fd, 0,
- __LONG_LONG_PAIR (offset >> 31, offset),
- __LONG_LONG_PAIR (len >> 31, len));
-
+ int res = INTERNAL_SYSCALL_CALL (fallocate, err, fd, 0,
+ SYSCALL_LL (offset), SYSCALL_LL (len));
if (! INTERNAL_SYSCALL_ERROR_P (res, err))
return 0;
if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
diff --git a/sysdeps/unix/sysv/linux/posix_fallocate64.c b/sysdeps/unix/sysv/linux/posix_fallocate64.c
index 4a0a722448..557580eea9 100644
--- a/sysdeps/unix/sysv/linux/posix_fallocate64.c
+++ b/sysdeps/unix/sysv/linux/posix_fallocate64.c
@@ -28,12 +28,14 @@ int
__posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
{
INTERNAL_SYSCALL_DECL (err);
- int res = INTERNAL_SYSCALL (fallocate, err, 6, fd, 0,
- __LONG_LONG_PAIR ((long int) (offset >> 32),
- (long int) offset),
- __LONG_LONG_PAIR ((long int) (len >> 32),
- (long int) len));
-
+#ifdef INTERNAL_SYSCALL_TYPES
+ int res = INTERNAL_SYSCALL_TYPES (fallocate, err, 4, int, fd,
+ int, 0, off_t, offset,
+ off_t, len);
+#else
+ int res = INTERNAL_SYSCALL_CALL (fallocate, err, fd, 0,
+ SYSCALL_LL64 (offset), SYSCALL_LL64 (len));
+#endif
if (! INTERNAL_SYSCALL_ERROR_P (res, err))
return 0;
if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile
index c89ed9ec7d..2cfb46eca3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/Makefile
+++ b/sysdeps/unix/sysv/linux/powerpc/Makefile
@@ -8,6 +8,7 @@ abi-64-v2-condition := __WORDSIZE == 64 && _CALL_ELF == 2
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),stdlib)
@@ -34,4 +35,5 @@ ifeq ($(subdir),nptl)
libpthread-routines += sysdep
libpthread-sysdep_routines += elision-lock elision-unlock elision-timed \
elision-trylock
+libpthread-shared-only-routines += sysdep
endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
index 345e79ae72..d230ac9678 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
@@ -87,7 +87,7 @@ typedef union
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
#if __WORDSIZE == 64
short __spins;
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h b/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
index 5b9c0c1be9..b06f439306 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
@@ -16,10 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
+#define __need_size_t
+#include <stddef.h>
/* Structure describing a signal stack (obsolete). */
struct sigstack
@@ -28,8 +33,15 @@ struct sigstack
int ss_onstack; /* Nonzero if executing on this stack. */
};
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
-/* Possible values for `ss_flags.'. */
+/* Possible values for `ss_flags'. */
enum
{
SS_ONSTACK = 1,
@@ -44,11 +56,4 @@ enum
/* System default stack size. */
#define SIGSTKSZ 16384
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- void *ss_sp;
- int ss_flags;
- size_t ss_size;
- } stack_t;
+#endif /* bits/sigstack.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
index 3e8a1e0a15..109f08ccdc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
@@ -5,6 +5,9 @@
# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
+# define __WORDSIZE_TIME64_COMPAT32 0
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index 25a4e7caff..16c00d7aee 100644
--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -15,6 +15,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#if defined SHARED && !defined __powerpc64__
+# define __gettimeofday __redirect___gettimeofday
+#else
+# define __redirect___gettimeofday __gettimeofday
+#endif
#include <sys/time.h>
@@ -24,30 +29,14 @@
# include <libc-vdso.h>
# include <dl-machine.h>
-void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday");
-
-static int
-__gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
-{
- return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
-}
+# ifndef __powerpc64__
+# undef __gettimeofday
-void *
-gettimeofday_ifunc (void)
+int
+__gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz)
{
- PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
-
- /* If the vDSO is not available we fall back syscall. */
- void *vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
- return (vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday)
- : (void*)__gettimeofday_syscall);
+ return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
}
-asm (".type __gettimeofday, %gnu_indirect_function");
-
-/* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't
- let us do it in C because it doesn't know we're defining __gettimeofday
- here in this file. */
-asm (".globl __GI___gettimeofday");
/* __GI___gettimeofday is defined as hidden and for ppc32 it enables the
compiler make a local call (symbol@local) for internal GLIBC usage. It
@@ -55,16 +44,29 @@ asm (".globl __GI___gettimeofday");
For ppc64 a call to a function in another translation unit might use a
different toc pointer thus disallowing direct branchess and making internal
ifuncs calls safe. */
-#ifdef __powerpc64__
-asm ("__GI___gettimeofday = __gettimeofday");
-#else
-int
-__gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz)
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__gettimeofday_vsyscall, __GI___gettimeofday, \
+ __gettimeofday_vsyscall);
+
+# endif /* !__powerpc64__ */
+
+static int
+__gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
{
- return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
+ return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
}
-asm ("__GI___gettimeofday = __gettimeofday_vsyscall");
-#endif
+
+# define INIT_ARCH() \
+ PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); \
+ void *vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
+
+/* If the vDSO is not available we fall back syscall. */
+libc_ifunc_hidden (__redirect___gettimeofday, __gettimeofday,
+ vdso_gettimeofday
+ ? VDSO_IFUNC_RET (vdso_gettimeofday)
+ : (void *) __gettimeofday_syscall);
+libc_hidden_def (__gettimeofday)
#else
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index 996535f224..42a53f2c1c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -46,4 +46,9 @@
# define __ASSUME_ALIGNED_REGISTER_PAIRS 1
#endif
+/* powerpc compat fadvise64_64 reorganize the syscall argument. */
+#ifndef __powerpc64__
+# define __ASSUME_FADVISE64_64_6ARG 1
+#endif
+
#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index ba9a29a3bd..4b0cde8faf 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -1973,6 +1973,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
index abe8c5d8a8..9a5f983c3c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
@@ -421,6 +421,28 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __fe_dfl_mode D 0x8
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index f19534c7b8..0557c16130 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -1978,6 +1978,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
index 1c25f56c4c..24f0127055 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
@@ -420,6 +420,28 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __fe_dfl_mode D 0x8
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c
deleted file mode 100644
index c26206f80a..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (C) 2003-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-
-int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
-int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise);
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
-{
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advise,
- __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset),
- __LONG_LONG_PAIR ((long)(len >> 32), (long)len));
- if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
- return 0;
- return INTERNAL_SYSCALL_ERRNO (ret, err);
-}
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
-
-int
-attribute_compat_text_section
-__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
-{
- return __posix_fadvise64_l64 (fd, offset, len, advise);
-}
-
-versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
-compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
-#else
-strong_alias (__posix_fadvise64_l64, posix_fadvise64);
-#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index 7c59b9b4e9..df824f5a69 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -97,7 +97,7 @@ L(oldpid):
#ifdef SHARED
b JUMPTARGET(__GI__exit)
#else
- b JUMPTARGET(_exit)
+ bl JUMPTARGET(_exit)
/* We won't ever get here but provide a nop so that the linker
will insert a toc adjusting stub if necessary. */
nop
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
index f8de1ab30b..821384ebd6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
@@ -2178,3 +2178,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
index 6819133256..c40a3f1cba 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
@@ -92,6 +92,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 _Exit F
GLIBC_2.3 _IO_2_1_stderr_ D 0xe0
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
index 9d19474c34..00c7d22dfc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist
@@ -415,3 +415,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __fe_dfl_mode D 0x8
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
index cedb18945c..bfbaa36634 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist
@@ -96,6 +96,28 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __fe_dfl_mode D 0x8
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 _LIB_VERSION D 0x4
GLIBC_2.3 __clog10 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
index 2b97bc71bd..e40bced8c5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
@@ -19,11 +19,14 @@
#define _SYS_UCONTEXT_H 1
#include <features.h>
+#define __need_sigset_t
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
#if __WORDSIZE == 32
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/user.h b/sysdeps/unix/sysv/linux/powerpc/sys/user.h
index 97459fba80..4f2ebc2535 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/user.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/user.h
@@ -18,6 +18,7 @@
#ifndef _SYS_USER_H
#define _SYS_USER_H 1
+#include <stddef.h>
#include <features.h>
#include <asm/ptrace.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
index 797341944c..3da0b66dac 100644
--- a/sysdeps/unix/sysv/linux/powerpc/time.c
+++ b/sysdeps/unix/sysv/linux/powerpc/time.c
@@ -17,6 +17,11 @@
<http://www.gnu.org/licenses/>. */
#ifdef SHARED
+# ifndef __powerpc64__
+# define time __redirect_time
+# else
+# define __redirect_time time
+# endif
# include <time.h>
# include <sysdep.h>
@@ -24,7 +29,26 @@
# include <libc-vdso.h>
# include <dl-machine.h>
-void *time_ifunc (void) asm ("time");
+# ifndef __powerpc64__
+# undef time
+
+time_t
+__time_vsyscall (time_t *t)
+{
+ return INLINE_VSYSCALL (time, 1, t);
+}
+
+/* __GI_time is defined as hidden and for ppc32 it enables the
+ compiler make a local call (symbol@local) for internal GLIBC usage. It
+ means the PLT won't be used and the ifunc resolver will be called directly.
+ For ppc64 a call to a function in another translation unit might use a
+ different toc pointer thus disallowing direct branchess and making internal
+ ifuncs calls safe. */
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ __hidden_ver1 (__time_vsyscall, __GI_time, __time_vsyscall);
+
+# endif /* !__powerpc64__ */
static time_t
time_syscall (time_t *t)
@@ -42,42 +66,19 @@ time_syscall (time_t *t)
return result;
}
-void *
-time_ifunc (void)
-{
- PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565);
-
- /* If the vDSO is not available we fall back to the syscall. */
+# define INIT_ARCH() \
+ PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); \
void *vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615);
- return (vdso_time ? VDSO_IFUNC_RET (vdso_time)
- : (void*)time_syscall);
-}
-asm (".type time, %gnu_indirect_function");
-/* This is doing "libc_hidden_def (time)" but the compiler won't
- * let us do it in C because it doesn't know we're defining time
- * here in this file. */
-asm (".globl __GI_time");
-
-/* __GI_time is defined as hidden and for ppc32 it enables the
- compiler make a local call (symbol@local) for internal GLIBC usage. It
- means the PLT won't be used and the ifunc resolver will be called directly.
- For ppc64 a call to a function in another translation unit might use a
- different toc pointer thus disallowing direct branchess and making internal
- ifuncs calls safe. */
-#ifdef __powerpc64__
-asm ("__GI_time = time");
-#else
-time_t
-__time_vsyscall (time_t *t)
-{
- return INLINE_VSYSCALL (time, 1, t);
-}
-asm ("__GI_time = __time_vsyscall");
-#endif
+/* If the vDSO is not available we fall back to the syscall. */
+libc_ifunc_hidden (__redirect_time, time,
+ vdso_time
+ ? VDSO_IFUNC_RET (vdso_time)
+ : (void *) time_syscall);
+libc_hidden_def (time)
#else
#include <sysdeps/posix/time.c>
-#endif
+#endif /* !SHARED */
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
index 1bcff64781..46d974d952 100644
--- a/sysdeps/unix/sysv/linux/pread.c
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -28,8 +28,7 @@
ssize_t
__libc_pread (int fd, void *buf, size_t count, off_t offset)
{
- return SYSCALL_CANCEL (pread, fd, buf, count,
- __ALIGNMENT_ARG SYSCALL_LL (offset));
+ return SYSCALL_CANCEL (pread, fd, buf, count, SYSCALL_LL_PRW (offset));
}
strong_alias (__libc_pread, __pread)
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
index 58c6aeb541..f51beae77a 100644
--- a/sysdeps/unix/sysv/linux/pread64.c
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -26,8 +26,7 @@
ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
{
- return SYSCALL_CANCEL (pread64, fd, buf, count,
- __ALIGNMENT_ARG SYSCALL_LL64 (offset));
+ return SYSCALL_CANCEL (pread64, fd, buf, count, SYSCALL_LL64_PRW (offset));
}
weak_alias (__libc_pread64, __pread64)
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
index 9c502beac1..1371df8a60 100644
--- a/sysdeps/unix/sysv/linux/pwrite.c
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -28,8 +28,7 @@
ssize_t
__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
{
- return SYSCALL_CANCEL (pwrite, fd, buf, count,
- __ALIGNMENT_ARG SYSCALL_LL (offset));
+ return SYSCALL_CANCEL (pwrite, fd, buf, count, SYSCALL_LL_PRW (offset));
}
strong_alias (__libc_pwrite, __pwrite)
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
index b49e6bc286..22f1f05a44 100644
--- a/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/pwrite64.c
@@ -26,8 +26,7 @@
ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
{
- return SYSCALL_CANCEL (pwrite64, fd, buf, count,
- __ALIGNMENT_ARG SYSCALL_LL64 (offset));
+ return SYSCALL_CANCEL (pwrite64, fd, buf, count, SYSCALL_LL64_PRW (offset));
}
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile
index 497ffd566c..f8ed013e9e 100644
--- a/sysdeps/unix/sysv/linux/s390/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/Makefile
@@ -6,6 +6,7 @@ abi-64-condition := __WORDSIZE == 64
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),stdlib)
diff --git a/sysdeps/unix/sysv/linux/s390/localplt.data b/sysdeps/unix/sysv/linux/s390/localplt.data
index b25abf8006..122641312c 100644
--- a/sysdeps/unix/sysv/linux/s390/localplt.data
+++ b/sysdeps/unix/sysv/linux/s390/localplt.data
@@ -8,7 +8,14 @@ libm.so: matherr
# The dynamic loader uses __libc_memalign internally to allocate aligned
# TLS storage. The other malloc family of functions are expected to allow
# user symbol interposition.
-ld.so: __libc_memalign
+# It is also allowed to call __libc_memalign via function-pointer loaded from
+# GOT instead of calling via a plt-stub. In this case there is a R_390_GLOB_DAT
+# relocation in section .rela.dyn instead of R_390_JMP_SLOT in .rela.plt.
+# After commit "elf: Do not use memalign for TCB/TLS blocks allocation
+# [BZ #17730]" __libc_memalign is only called in elf/dl-minimal.c: malloc() in
+# ld.so and gcc -O2/-O3 leads to R_390_GLOB_DAT. If build with
+# -fno-optimize-sibling-calls an R_390_JMP_SLOT is generated.
+ld.so: __libc_memalign + RELA R_390_GLOB_DAT
ld.so: malloc
ld.so: calloc
ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
index 10e825cb0f..2abf11218c 100644
--- a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
+++ b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
@@ -26,8 +26,8 @@
/* In glibc release 2.19 new versions of longjmp-functions were introduced,
but were reverted before 2.20. Thus both versions are the same function. */
-DEFINE_LONGJMP (__v2longjmp)
+strong_alias (longjmp_ifunc, __v2longjmp)
compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19);
-DEFINE_LONGJMP (__v2siglongjmp)
+strong_alias (siglongjmp_ifunc, __v2siglongjmp)
compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19);
#endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 4cd5d85e42..5b39a60638 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -1973,6 +1973,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
index 9b567c6356..6e52936a88 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
@@ -410,6 +410,26 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 8cdb9df0c8..a9db32f6c2 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -1874,6 +1874,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
index 78a82fbd71..a01c58857b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
@@ -408,6 +408,26 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
index 78f5fd77a1..35d30685d1 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
@@ -18,15 +18,15 @@
#ifndef _SYS_UCONTEXT_H
#define _SYS_UCONTEXT_H 1
-/* Forward definition to avoid parse errors */
-struct ucontext;
-typedef struct ucontext ucontext_t;
+
#include <features.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by in <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
/* Type for a program status word. */
typedef struct
@@ -74,14 +74,14 @@ typedef struct
} mcontext_t;
/* Userlevel context. */
-struct ucontext
+typedef struct ucontext
{
unsigned long int uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
__sigset_t uc_sigmask;
- };
+ } ucontext_t;
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
index ad05fc39e1..ea4fdbc8bd 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -44,3 +44,9 @@
/* SH does not have a 64-bit inode field. */
#undef __ASSUME_ST_INO_64_BIT
+#define __ASSUME_ST_INO_64_BIT 0
+
+/* SH4 ABI does not really require argument alignment for 64-bits, but
+ the kernel interface for p{read,write}64 adds a dummy long argument
+ before the offset. */
+#define __ASSUME_PRW_DUMMY_ARG 1
diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist
index 69791b4911..294af0a501 100644
--- a/sysdeps/unix/sysv/linux/sh/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libc.abilist
@@ -1859,6 +1859,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/sh/libm.abilist b/sysdeps/unix/sysv/linux/sh/libm.abilist
index f98ade7642..96497844bb 100644
--- a/sysdeps/unix/sysv/linux/sh/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sh/libm.abilist
@@ -380,5 +380,24 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F
diff --git a/sysdeps/unix/sysv/linux/sh/pread.c b/sysdeps/unix/sysv/linux/sh/pread.c
deleted file mode 100644
index d3f99f35db..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pread.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
- the kernel interface for pread adds a dummy long argument before the
- offset. */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pread.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pread64.c b/sysdeps/unix/sysv/linux/sh/pread64.c
deleted file mode 100644
index b2e8a25788..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pread64.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
- the kernel interface for pread adds a dummy long argument before the
- offset. */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pread64.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite.c b/sysdeps/unix/sysv/linux/sh/pwrite.c
deleted file mode 100644
index 391ed5e17b..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pwrite.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
- the kernel interface for pwrite adds a dummy long argument before the
- offset. */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pwrite.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite64.c b/sysdeps/unix/sysv/linux/sh/pwrite64.c
deleted file mode 100644
index 683a5d9886..0000000000
--- a/sysdeps/unix/sysv/linux/sh/pwrite64.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ralf Baechle <ralf@gnu.org>, 1998.
-
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-/* SH4 ABI does not really require argument alignment for 64-bits, but
- the kernel interface for pread adds a dummy long argument before the
- offset. */
-#define __ALIGNMENT_ARG
-#include <sysdeps/unix/sysv/linux/pwrite64.c>
diff --git a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
index ab9a7e66bf..2c5fa0431c 100644
--- a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
@@ -23,9 +23,10 @@
#include <features.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
typedef int greg_t;
diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/Makefile
index e67aecf8f0..a67d199eb5 100644
--- a/sysdeps/unix/sysv/linux/sparc/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/Makefile
@@ -6,6 +6,7 @@ abi-64-condition := __WORDSIZE == 64
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
+librt-shared-only-routines += rt-sysdep
endif
ifeq ($(subdir),sysvipc)
@@ -15,4 +16,5 @@ endif
ifeq ($(subdir),nptl)
# pull in __syscall_error routine
libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/resource.h b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
index 305ca5ef93..c5eac6fe0e 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
@@ -191,8 +191,7 @@ enum __rusage_who
#endif
};
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
+#include <bits/types/struct_timeval.h>
/* Structure which says how much of each resource has been used. */
struct rusage
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h b/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
index 43253f2c99..8794dddfa4 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
@@ -15,6 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H 1
+
#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
@@ -75,3 +78,5 @@ struct sigcontext
};
#endif /* sparc64 */
+
+#endif /* bits/sigcontext.h */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h b/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
index 5b9c0c1be9..b06f439306 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
@@ -16,10 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SIGNAL_H
+#ifndef _BITS_SIGSTACK_H
+#define _BITS_SIGSTACK_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
# error "Never include this file directly. Use <signal.h> instead"
#endif
+#define __need_size_t
+#include <stddef.h>
/* Structure describing a signal stack (obsolete). */
struct sigstack
@@ -28,8 +33,15 @@ struct sigstack
int ss_onstack; /* Nonzero if executing on this stack. */
};
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
-/* Possible values for `ss_flags.'. */
+/* Possible values for `ss_flags'. */
enum
{
SS_ONSTACK = 1,
@@ -44,11 +56,4 @@ enum
/* System default stack size. */
#define SIGSTKSZ 16384
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- void *ss_sp;
- int ss_flags;
- size_t ss_size;
- } stack_t;
+#endif /* bits/sigstack.h */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
index 2d958d29e5..121b4fe8c9 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
@@ -2,8 +2,12 @@
#if defined __arch64__ || defined __sparcv9
# define __WORDSIZE 64
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
+# define __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
+# define __WORDSIZE_TIME64_COMPAT32 0
#endif
#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index fce58a8e88..32747bd22d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -1965,6 +1965,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
index d2e8421967..ba10933919 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
@@ -413,6 +413,26 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 16ce7399bf..b0ac4d4472 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -1903,6 +1903,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
index e000221432..82245edfba 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
@@ -411,4 +411,24 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
index d7bf2aedb9..5856398e62 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
@@ -20,8 +20,15 @@
#include <features.h>
#include <signal.h>
+
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
#include <bits/wordsize.h>
+
#if __WORDSIZE == 64
#define MC_TSTATE 0
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/user.h b/sysdeps/unix/sysv/linux/sparc/sys/user.h
index fddf87227b..ec20bf7ad2 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/user.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/user.h
@@ -18,6 +18,8 @@
#ifndef _SYS_USER_H
#define _SYS_USER_H 1
+#include <stddef.h>
+
struct sunos_regs
{
unsigned int psr, pc, npc, y;
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index bb3eecfde1..fda8593287 100644
--- a/sysdeps/unix/sysv/linux/spawni.c
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <spawn.h>
+#include <assert.h>
#include <fcntl.h>
#include <paths.h>
#include <string.h>
@@ -44,11 +45,12 @@
3. Child must synchronize with parent to enforce 2. and to possible
return execv issues.
- The first issue is solved by blocking all signals in child, even the
- NPTL-internal ones (SIGCANCEL and SIGSETXID). The second and third issue
- is done by a stack allocation in parent and a synchronization with using
- a pipe or waitpid (in case or error). The pipe has the advantage of
- allowing the child the communicate an exec error. */
+ The first issue is solved by blocking all signals in child, even
+ the NPTL-internal ones (SIGCANCEL and SIGSETXID). The second and
+ third issue is done by a stack allocation in parent, and by using a
+ field in struct spawn_args where the child can write an error
+ code. CLONE_VFORK ensures that the parent does not run until the
+ child has either exec'ed successfully or exited. */
/* The Unix standard contains a long explanation of the way to signal
@@ -58,10 +60,6 @@
normal program exit with the exit code 127. */
#define SPAWN_ERROR 127
-/* We need to block both SIGCANCEL and SIGSETXID. */
-#define SIGALL_SET \
- ((__sigset_t) { .__val = {[0 ... _SIGSET_NWORDS-1 ] = -1 } })
-
#ifdef __ia64__
# define CLONE(__fn, __stack, __stacksize, __flags, __args) \
__clone2 (__fn, __stack, __stacksize, __flags, __args, 0, 0, 0)
@@ -79,7 +77,6 @@
struct posix_spawn_args
{
- int pipe[2];
sigset_t oldmask;
const char *file;
int (*exec) (const char *, char *const *, char *const *);
@@ -89,6 +86,7 @@ struct posix_spawn_args
ptrdiff_t argc;
char *const *envp;
int xflags;
+ int err;
};
/* Older version requires that shell script without shebang definition
@@ -125,11 +123,8 @@ __spawni_child (void *arguments)
struct posix_spawn_args *args = arguments;
const posix_spawnattr_t *restrict attr = args->attr;
const posix_spawn_file_actions_t *file_actions = args->fa;
- int p = args->pipe[1];
int ret;
- close_not_cancel (args->pipe[0]);
-
/* The child must ensure that no signal handler are enabled because it shared
memory with parent, so the signal disposition must be either SIG_DFL or
SIG_IGN. It does by iterating over all signals and although it could
@@ -203,17 +198,6 @@ __spawni_child (void *arguments)
{
struct __spawn_action *action = &file_actions->__actions[cnt];
- /* Dup the pipe fd onto an unoccupied one to avoid any file
- operation to clobber it. */
- if ((action->action.close_action.fd == p)
- || (action->action.open_action.fd == p)
- || (action->action.dup2_action.fd == p))
- {
- if ((ret = __dup (p)) < 0)
- goto fail;
- p = ret;
- }
-
switch (action->tag)
{
case spawn_do_close:
@@ -235,6 +219,14 @@ __spawni_child (void *arguments)
case spawn_do_open:
{
+ /* POSIX states that if fildes was already an open file descriptor,
+ it shall be closed before the new file is opened. This avoid
+ pontential issues when posix_spawn plus addopen action is called
+ with the process already at maximum number of file descriptor
+ opened and also for multiple actions on single-open special
+ paths (like /dev/watchdog). */
+ close_not_cancel (action->action.open_action.fd);
+
ret = open_not_cancel (action->action.open_action.path,
action->action.
open_action.oflag | O_LARGEFILE,
@@ -273,6 +265,7 @@ __spawni_child (void *arguments)
__sigprocmask (SIG_SETMASK, (attr->__flags & POSIX_SPAWN_SETSIGMASK)
? &attr->__ss : &args->oldmask, 0);
+ args->err = 0;
args->exec (args->file, args->argv, args->envp);
/* This is compatibility function required to enable posix_spawn run
@@ -280,14 +273,13 @@ __spawni_child (void *arguments)
(2.15). */
maybe_script_execute (args);
- ret = -errno;
-
fail:
- /* Since sizeof errno < PIPE_BUF, the write is atomic. */
- ret = -ret;
- if (ret)
- while (write_not_cancel (p, &ret, sizeof ret) < 0)
- continue;
+ /* errno should have an appropriate non-zero value; otherwise,
+ there's a bug in glibc or the kernel. For lack of an error code
+ (EINTERNALBUG) describing that, use ECHILD. Another option would
+ be to set args->err to some negative sentinel and have the parent
+ abort(), but that seems needlessly harsh. */
+ args->err = errno ? : ECHILD;
_exit (SPAWN_ERROR);
}
@@ -304,9 +296,6 @@ __spawnix (pid_t * pid, const char *file,
struct posix_spawn_args args;
int ec;
- if (__pipe2 (args.pipe, O_CLOEXEC))
- return errno;
-
/* To avoid imposing hard limits on posix_spawn{p} the total number of
arguments is first calculated to allocate a mmap to hold all possible
values. */
@@ -333,15 +322,16 @@ __spawnix (pid_t * pid, const char *file,
void *stack = __mmap (NULL, stack_size, prot,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
if (__glibc_unlikely (stack == MAP_FAILED))
- {
- close_not_cancel (args.pipe[0]);
- close_not_cancel (args.pipe[1]);
- return errno;
- }
+ return errno;
/* Disable asynchronous cancellation. */
- int cs = LIBC_CANCEL_ASYNC ();
+ int state;
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state), 0);
+ /* Child must set args.err to something non-negative - we rely on
+ the parent and child sharing VM. */
+ args.err = -1;
args.file = file;
args.exec = exec;
args.fa = file_actions;
@@ -351,13 +341,12 @@ __spawnix (pid_t * pid, const char *file,
args.envp = envp;
args.xflags = xflags;
- __sigprocmask (SIG_BLOCK, &SIGALL_SET, &args.oldmask);
+ __libc_signal_block_all (&args.oldmask);
/* The clone flags used will create a new child that will run in the same
memory space (CLONE_VM) and the execution of calling thread will be
- suspend until the child calls execve or _exit. These condition as
- signal below either by pipe write (_exit with SPAWN_ERROR) or
- a successful execve.
+ suspend until the child calls execve or _exit.
+
Also since the calling thread execution will be suspend, there is not
need for CLONE_SETTLS. Although parent and child share the same TLS
namespace, there will be no concurrent access for TLS variables (errno
@@ -365,28 +354,24 @@ __spawnix (pid_t * pid, const char *file,
new_pid = CLONE (__spawni_child, STACK (stack, stack_size), stack_size,
CLONE_VM | CLONE_VFORK | SIGCHLD, &args);
- close_not_cancel (args.pipe[1]);
-
if (new_pid > 0)
{
- if (__read (args.pipe[0], &ec, sizeof ec) != sizeof ec)
- ec = 0;
- else
- __waitpid (new_pid, NULL, 0);
+ ec = args.err;
+ assert (ec >= 0);
+ if (ec != 0)
+ __waitpid (new_pid, NULL, 0);
}
else
ec = -new_pid;
__munmap (stack, stack_size);
- close_not_cancel (args.pipe[0]);
-
if ((ec == 0) && (pid != NULL))
*pid = new_pid;
- __sigprocmask (SIG_SETMASK, &args.oldmask, 0);
+ __libc_signal_restore_set (&args.oldmask);
- LIBC_CANCEL_RESET (cs);
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
return ec;
}
diff --git a/sysdeps/unix/sysv/linux/sync_file_range.c b/sysdeps/unix/sysv/linux/sync_file_range.c
index a8f42146a7..89f21e6009 100644
--- a/sysdeps/unix/sysv/linux/sync_file_range.c
+++ b/sysdeps/unix/sysv/linux/sync_file_range.c
@@ -16,37 +16,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <fcntl.h>
-#include <sys/types.h>
-
#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_sync_file_range
int
-sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+sync_file_range (int fd, __off64_t offset, __off64_t len, unsigned int flags)
{
+#if defined (__NR_sync_file_range2)
+ return SYSCALL_CANCEL (sync_file_range2, fd, flags, SYSCALL_LL64 (offset),
+ SYSCALL_LL64 (len));
+#elif defined (__NR_sync_file_range)
return SYSCALL_CANCEL (sync_file_range, fd,
- __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
- __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
- flags);
-}
-#elif defined __NR_sync_file_range2
-int
-sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
-{
- return SYSCALL_CANCEL (sync_file_range2, fd, flags,
- __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
- __LONG_LONG_PAIR ((long) (to >> 32), (long) to));
-}
-#else
-int
-sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
-{
- __set_errno (ENOSYS);
- return -1;
-}
-stub_warning (sync_file_range)
+ __ALIGNMENT_ARG SYSCALL_LL64 (offset),
+ SYSCALL_LL64 (len), flags);
#endif
+}
diff --git a/sysdeps/unix/sysv/linux/sys/acct.h b/sysdeps/unix/sysv/linux/sys/acct.h
index ea0e7fde23..bc8a08e96b 100644
--- a/sysdeps/unix/sysv/linux/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/sys/acct.h
@@ -18,12 +18,10 @@
#ifndef _SYS_ACCT_H
#define _SYS_ACCT_H 1
-#include <features.h>
-
-#include <endian.h>
-#define __need_time_t
-#include <time.h>
#include <sys/types.h>
+#include <stdint.h>
+#include <endian.h>
+#include <bits/types/time_t.h>
__BEGIN_DECLS
@@ -35,15 +33,15 @@ __BEGIN_DECLS
specific encoding system used.
*/
-typedef u_int16_t comp_t;
+typedef uint16_t comp_t;
struct acct
{
char ac_flag; /* Flags. */
- u_int16_t ac_uid; /* Real user ID. */
- u_int16_t ac_gid; /* Real group ID. */
- u_int16_t ac_tty; /* Controlling terminal. */
- u_int32_t ac_btime; /* Beginning time. */
+ uint16_t ac_uid; /* Real user ID. */
+ uint16_t ac_gid; /* Real group ID. */
+ uint16_t ac_tty; /* Controlling terminal. */
+ uint32_t ac_btime; /* Beginning time. */
comp_t ac_utime; /* User time. */
comp_t ac_stime; /* System time. */
comp_t ac_etime; /* Elapsed time. */
@@ -53,7 +51,7 @@ struct acct
comp_t ac_minflt; /* Minor pagefaults. */
comp_t ac_majflt; /* Major pagefaults. */
comp_t ac_swaps; /* Number of swaps. */
- u_int32_t ac_exitcode; /* Process exitcode. */
+ uint32_t ac_exitcode; /* Process exitcode. */
char ac_comm[ACCT_COMM+1]; /* Command name. */
char ac_pad[10]; /* Padding bytes. */
};
@@ -63,13 +61,13 @@ struct acct_v3
{
char ac_flag; /* Flags */
char ac_version; /* Always set to ACCT_VERSION */
- u_int16_t ac_tty; /* Control Terminal */
- u_int32_t ac_exitcode; /* Exitcode */
- u_int32_t ac_uid; /* Real User ID */
- u_int32_t ac_gid; /* Real Group ID */
- u_int32_t ac_pid; /* Process ID */
- u_int32_t ac_ppid; /* Parent Process ID */
- u_int32_t ac_btime; /* Process Creation Time */
+ uint16_t ac_tty; /* Control Terminal */
+ uint32_t ac_exitcode; /* Exitcode */
+ uint32_t ac_uid; /* Real User ID */
+ uint32_t ac_gid; /* Real Group ID */
+ uint32_t ac_pid; /* Process ID */
+ uint32_t ac_ppid; /* Parent Process ID */
+ uint32_t ac_btime; /* Process Creation Time */
float ac_etime; /* Elapsed Time */
comp_t ac_utime; /* User Time */
comp_t ac_stime; /* System Time */
diff --git a/sysdeps/unix/sysv/linux/sys/quota.h b/sysdeps/unix/sysv/linux/sys/quota.h
index 316febe875..f34e741ef0 100644
--- a/sysdeps/unix/sysv/linux/sys/quota.h
+++ b/sysdeps/unix/sysv/linux/sys/quota.h
@@ -1,6 +1,22 @@
/* This just represents the non-kernel parts of <linux/quota.h>.
- *
- * here's the corresponding copyright:
+ Copyright (C) 1998-2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved.
*
@@ -38,13 +54,7 @@
#include <features.h>
#include <sys/types.h>
-/*
- * Select between different incompatible quota versions.
- * Default to the version used by Linux kernel version 2.4.22
- * or later. */
-#ifndef _LINUX_QUOTA_VERSION
-# define _LINUX_QUOTA_VERSION 2
-#endif
+#include <linux/quota.h>
/*
* Convert diskblocks to blocks and the other way around.
@@ -54,10 +64,10 @@
#define btodb(num) ((num) >> 10)
/*
- * Convert count of filesystem blocks to diskquota blocks, meant
- * for filesystems where i_blksize != BLOCK_SIZE
+ * Convert count of filesystem blocks to diskquota blocks, meant for
+ * filesystems where i_blksize != 1024.
*/
-#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / BLOCK_SIZE)
+#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / 1024)
/*
* Definitions for disk quotas imposed on the average user
@@ -71,113 +81,33 @@
#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
-#define MAXQUOTAS 2
-#define USRQUOTA 0 /* element used for user quotas */
-#define GRPQUOTA 1 /* element used for group quotas */
-
-/*
- * Definitions for the default names of the quotas files.
- */
-#define INITQFNAMES { \
- "user", /* USRQUOTA */ \
- "group", /* GRPQUOTA */ \
- "undefined", \
-};
-
#define QUOTAFILENAME "quota"
#define QUOTAGROUP "staff"
#define NR_DQHASH 43 /* Just an arbitrary number any suggestions ? */
#define NR_DQUOTS 256 /* Number of quotas active at one time */
-/*
- * Command definitions for the 'quotactl' system call.
- * The commands are broken into a main command defined below
- * and a subcommand that is used to convey the type of
- * quota that is being manipulated (see above).
- */
-#define SUBCMDMASK 0x00ff
-#define SUBCMDSHIFT 8
-#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
-
-#if _LINUX_QUOTA_VERSION < 2
-# define Q_QUOTAON 0x0100 /* enable quotas */
-# define Q_QUOTAOFF 0x0200 /* disable quotas */
-# define Q_GETQUOTA 0x0300 /* get limits and usage */
-# define Q_SETQUOTA 0x0400 /* set limits and usage */
-# define Q_SETUSE 0x0500 /* set usage */
-# define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
-# define Q_SETQLIM 0x0700 /* set limits */
-# define Q_GETSTATS 0x0800 /* get collected stats */
-# define Q_RSQUASH 0x1000 /* set root_squash option */
-#else
-# define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
-# define Q_QUOTAON 0x800002 /* turn quotas on */
-# define Q_QUOTAOFF 0x800003 /* turn quotas off */
-# define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
-# define Q_GETINFO 0x800005 /* get information about quota files */
-# define Q_SETINFO 0x800006 /* set information about quota files */
-# define Q_GETQUOTA 0x800007 /* get user quota structure */
-# define Q_SETQUOTA 0x800008 /* set user quota structure */
-# define Q_GETNEXTQUOTA 0x800009 /* get disk limits and usage >= ID */
-#endif
-
-/*
- * The following structure defines the format of the disk quota file
- * (as it appears on disk) - the file is an array of these structures
- * indexed by user or group number.
- */
-#if _LINUX_QUOTA_VERSION < 2
-struct dqblk
- {
- u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
- u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
- u_int32_t dqb_curblocks; /* current block count */
- u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
- u_int32_t dqb_isoftlimit; /* preferred inode limit */
- u_int32_t dqb_curinodes; /* current # allocated inodes */
- time_t dqb_btime; /* time limit for excessive disk use */
- time_t dqb_itime; /* time limit for excessive files */
- };
-#else
-
-/* Flags that indicate which fields in dqblk structure are valid. */
-#define QIF_BLIMITS 1
-#define QIF_SPACE 2
-#define QIF_ILIMITS 4
-#define QIF_INODES 8
-#define QIF_BTIME 16
-#define QIF_ITIME 32
-#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
-#define QIF_USAGE (QIF_SPACE | QIF_INODES)
-#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
-#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
-
+/* Old name for struct if_dqblk. */
struct dqblk
{
- u_int64_t dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */
- u_int64_t dqb_bsoftlimit; /* preferred limit on disk quota blocks */
- u_int64_t dqb_curspace; /* current quota block count */
- u_int64_t dqb_ihardlimit; /* maximum # allocated inodes */
- u_int64_t dqb_isoftlimit; /* preferred inode limit */
- u_int64_t dqb_curinodes; /* current # allocated inodes */
- u_int64_t dqb_btime; /* time limit for excessive disk use */
- u_int64_t dqb_itime; /* time limit for excessive files */
- u_int32_t dqb_valid; /* bitmask of QIF_* constants */
+ __uint64_t dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */
+ __uint64_t dqb_bsoftlimit; /* preferred limit on disk quota blocks */
+ __uint64_t dqb_curspace; /* current quota block count */
+ __uint64_t dqb_ihardlimit; /* maximum # allocated inodes */
+ __uint64_t dqb_isoftlimit; /* preferred inode limit */
+ __uint64_t dqb_curinodes; /* current # allocated inodes */
+ __uint64_t dqb_btime; /* time limit for excessive disk use */
+ __uint64_t dqb_itime; /* time limit for excessive files */
+ __uint32_t dqb_valid; /* bitmask of QIF_* constants */
};
-#endif
/*
* Shorthand notation.
*/
#define dq_bhardlimit dq_dqb.dqb_bhardlimit
#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
-#if _LINUX_QUOTA_VERSION < 2
-# define dq_curblocks dq_dqb.dqb_curblocks
-#else
-# define dq_curspace dq_dqb.dqb_curspace
-# define dq_valid dq_dqb.dqb_valid
-#endif
+#define dq_curspace dq_dqb.dqb_curspace
+#define dq_valid dq_dqb.dqb_valid
#define dq_ihardlimit dq_dqb.dqb_ihardlimit
#define dq_isoftlimit dq_dqb.dqb_isoftlimit
#define dq_curinodes dq_dqb.dqb_curinodes
@@ -186,40 +116,19 @@ struct dqblk
#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
-#if _LINUX_QUOTA_VERSION < 2
-struct dqstats
- {
- u_int32_t lookups;
- u_int32_t drops;
- u_int32_t reads;
- u_int32_t writes;
- u_int32_t cache_hits;
- u_int32_t pages_allocated;
- u_int32_t allocated_dquots;
- u_int32_t free_dquots;
- u_int32_t syncs;
- };
-#else
-
-/* Flags that indicate which fields in dqinfo structure are valid. */
-# define IIF_BGRACE 1
-# define IIF_IGRACE 2
-# define IIF_FLAGS 4
-# define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
-
+/* Old name for struct if_dqinfo. */
struct dqinfo
{
- u_int64_t dqi_bgrace;
- u_int64_t dqi_igrace;
- u_int32_t dqi_flags;
- u_int32_t dqi_valid;
+ __uint64_t dqi_bgrace;
+ __uint64_t dqi_igrace;
+ __uint32_t dqi_flags;
+ __uint32_t dqi_valid;
};
-#endif
__BEGIN_DECLS
extern int quotactl (int __cmd, const char *__special, int __id,
- caddr_t __addr) __THROW;
+ __caddr_t __addr) __THROW;
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h
index 3286997cc0..492c488c5d 100644
--- a/sysdeps/unix/sysv/linux/sys/timerfd.h
+++ b/sysdeps/unix/sysv/linux/sys/timerfd.h
@@ -19,6 +19,7 @@
#define _SYS_TIMERFD_H 1
#include <time.h>
+#include <bits/types/struct_itimerspec.h>
/* Get the platform-dependent flags. */
#include <bits/timerfd.h>
@@ -35,7 +36,7 @@ enum
__BEGIN_DECLS
/* Return file descriptor for new interval timer source. */
-extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
+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
diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
index a469f57121..e3ecd5638e 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -48,6 +48,16 @@
__LONG_LONG_PAIR ((long) ((val) >> 32), (long) ((val) & 0xffffffff))
#endif
+/* Provide a common macro to pass 64-bit value on pread and pwrite
+ syscalls. */
+#ifdef __ASSUME_PRW_DUMMY_ARG
+# define SYSCALL_LL_PRW(val) 0, SYSCALL_LL (val)
+# define SYSCALL_LL64_PRW(val) 0, SYSCALL_LL64 (val)
+#else
+# define SYSCALL_LL_PRW(val) __ALIGNMENT_ARG SYSCALL_LL (val)
+# define SYSCALL_LL64_PRW(val) __ALIGNMENT_ARG SYSCALL_LL64 (val)
+#endif
+
/* Provide a macro to pass the off{64}_t argument on p{readv,writev}{64}. */
#define LO_HI_LONG(val) \
(long) (val), \
diff --git a/sysdeps/unix/sysv/linux/tile/Makefile b/sysdeps/unix/sysv/linux/tile/Makefile
index 1c1cfff280..43acea3633 100644
--- a/sysdeps/unix/sysv/linux/tile/Makefile
+++ b/sysdeps/unix/sysv/linux/tile/Makefile
@@ -25,4 +25,5 @@ endif
ifeq ($(subdir),nptl)
# pull in __syscall_error routine
libpthread-routines += sysdep
+libpthread-shared-only-routines += sysdep
endif
diff --git a/sysdeps/unix/sysv/linux/tile/kernel-features.h b/sysdeps/unix/sysv/linux/tile/kernel-features.h
index 9425e1c5e5..ded0e43fd5 100644
--- a/sysdeps/unix/sysv/linux/tile/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/tile/kernel-features.h
@@ -23,4 +23,5 @@
pairs to start with an even-number register. */
#ifndef _LP64
# define __ASSUME_ALIGNED_REGISTER_PAIRS 1
+# define __ASSUME_FADVISE64_64_NO_ALIGN 1
#endif
diff --git a/sysdeps/unix/sysv/linux/tile/sys/ucontext.h b/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
index d930a1fea6..59c9bd1c4c 100644
--- a/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
@@ -22,13 +22,15 @@
#include <features.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
/* Get register type and register names. */
#include <arch/abi.h>
+
/* Type for general register. */
typedef uint_reg_t greg_t;
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist
index f99c298211..4d92d81b85 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist
@@ -2097,3 +2097,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
index 00e82c1425..1d4d6f98c6 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist
@@ -380,3 +380,22 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist
index c601ab0ee2..a68aef7bb7 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist
@@ -2097,3 +2097,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
index 00e82c1425..1d4d6f98c6 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist
@@ -380,3 +380,22 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist
index f99c298211..4d92d81b85 100644
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist
@@ -2097,3 +2097,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
index 00e82c1425..1d4d6f98c6 100644
--- a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist
@@ -380,3 +380,22 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/tst-fallocate-common.c b/sysdeps/unix/sysv/linux/tst-fallocate-common.c
new file mode 100644
index 0000000000..d98bf4a3e6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-fallocate-common.c
@@ -0,0 +1,93 @@
+/* Basic fallocate test (no specific flags is checked).
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+static void do_prepare (void);
+#define PREPARE(argc, argv) do_prepare ()
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+
+#define TIMEOUT 20 /* sec. */
+
+#define XSTR(s) STR(S)
+#define STR(s) #s
+
+#include <test-skeleton.c>
+
+static char *temp_filename;
+static int temp_fd;
+
+void
+do_prepare (void)
+{
+ temp_fd = create_temp_file ("tst-fallocate.", &temp_filename);
+ if (temp_fd == -1)
+ FAIL_EXIT1 ("cannot create temporary file: %m");
+}
+
+static int
+do_test_with_offset (off_t offset)
+{
+ int ret;
+ struct stat finfo;
+#define BLK_SIZE 1024
+ char bwrite[BLK_SIZE] = { 0xf0 };
+ char bread[BLK_SIZE];
+
+ /* It tries to fallocate 1024 bytes from 'offset' and then write 1024 bytes.
+ After both operation rewind the file descriptor and read 1024 bytes
+ and check if both buffer have the same contents. */
+ ret = fallocate (temp_fd, 0, offset, BLK_SIZE);
+ if (ret == -1)
+ {
+ /* fallocate might not be fully supported by underlying filesystem (for
+ instance some NFS versions). */
+ if (errno == EOPNOTSUPP)
+ FAIL_EXIT (77, "fallocate not supported");
+ FAIL_EXIT1 ("fallocate failed");
+ }
+
+ ret = fstat (temp_fd, &finfo);
+ if (ret == -1)
+ FAIL_EXIT1 ("fstat failed");
+
+ if (finfo.st_size < (offset + BLK_SIZE))
+ FAIL_EXIT1 ("size of first fallocate less than expected (%llu)",
+ (long long unsigned int)offset + BLK_SIZE);
+
+ if (lseek (temp_fd, offset, SEEK_SET) == (off_t) -1)
+ FAIL_EXIT1 ("fseek (0, SEEK_SET) failed");
+
+ if (write (temp_fd, bwrite, BLK_SIZE) != BLK_SIZE)
+ FAIL_EXIT1 ("fail trying to write " XSTR (BLK_SIZE) " bytes");
+
+ if (lseek (temp_fd, offset, SEEK_SET) == (off_t) -1)
+ FAIL_EXIT1 ("fseek (0, SEEK_SET) failed");
+
+ if (read (temp_fd, bread, BLK_SIZE) != BLK_SIZE)
+ FAIL_EXIT1 ("fail trying to read " XSTR (BLK_SIZE) " bytes");
+
+ if (memcmp (bwrite, bread, BLK_SIZE) != 0)
+ FAIL_EXIT1 ("buffer written different than buffer readed");
+
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/tst-fallocate.c b/sysdeps/unix/sysv/linux/tst-fallocate.c
new file mode 100644
index 0000000000..ec3867c14d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-fallocate.c
@@ -0,0 +1,25 @@
+/* Basic fallocate test (no specific flags is checked).
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "tst-fallocate-common.c"
+
+static int
+do_test (void)
+{
+ return do_test_with_offset (0);
+}
diff --git a/sysdeps/unix/sysv/linux/tst-fallocate64.c b/sysdeps/unix/sysv/linux/tst-fallocate64.c
new file mode 100644
index 0000000000..1036df0451
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-fallocate64.c
@@ -0,0 +1,47 @@
+/* Basic fallocate64 test (no specific flags is checked).
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#define _FILE_OFFSET_BITS 64
+#include "tst-fallocate-common.c"
+
+static int
+do_test (void)
+{
+ ssize_t ret;
+
+ ret = do_test_with_offset (0);
+ if (ret == 1)
+ return 1;
+
+ off_t base_offset = UINT32_MAX + 2048LL;
+ ret = do_test_with_offset (base_offset);
+ if (ret == 1)
+ return 1;
+
+ struct stat st;
+ if (fstat (temp_fd, &st) == -1)
+ FAIL_EXIT1 ("fstat on temporary file failed: %m");
+
+ /* The file size should >= base_offset plus bytes written. */
+ off_t expected_value = base_offset + ret;
+ if (st.st_size < expected_value)
+ FAIL_EXIT1 ("file size less than expected (%jd > %jd)",
+ (intmax_t) expected_value, (intmax_t) st.st_size);
+
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/tst-quota.c b/sysdeps/unix/sysv/linux/tst-quota.c
new file mode 100644
index 0000000000..3a0c392103
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-quota.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sys/quota.h>
+
+#include <stdbool.h>
+#include <stdio.h>
+
+static bool errors;
+
+void
+check_size (const char *name1, size_t size1,
+ const char *name2, size_t size2)
+{
+ const char *prefix;
+ const char *op;
+ if (size1 != size2)
+ {
+ prefix = "error";
+ op = "!=";
+ errors = true;
+ }
+ else
+ {
+ prefix = "info";
+ op = "==";
+ }
+ printf ("%s: sizeof (%s) [%zu] %s sizeof (%s) [%zu]\n",
+ prefix, name1, size1, op, name2, size2);
+}
+
+#define CHECK_SIZE(type1, type2) \
+ check_size (#type1, sizeof (type1), #type2, sizeof (type2))
+
+int
+do_test (void)
+{
+ CHECK_SIZE (struct if_dqblk, struct dqblk);
+ CHECK_SIZE (struct if_dqinfo, struct dqinfo);
+ return errors;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/unix/sysv/linux/tst-setgetname.c b/sysdeps/unix/sysv/linux/tst-setgetname.c
index f490d8354c..30fbe4e790 100644
--- a/sysdeps/unix/sysv/linux/tst-setgetname.c
+++ b/sysdeps/unix/sysv/linux/tst-setgetname.c
@@ -56,7 +56,7 @@ get_self_comm (long tid, char *buf, size_t len)
{
int res = 0;
#define FMT "/proc/self/task/%lu/comm"
- char fname[sizeof (FMT) + 8];
+ char fname[sizeof (FMT) + 32];
sprintf (fname, FMT, (unsigned long) tid);
int fd = open (fname, O_RDONLY);
diff --git a/sysdeps/unix/sysv/linux/tst-sync_file_range.c b/sysdeps/unix/sysv/linux/tst-sync_file_range.c
new file mode 100644
index 0000000000..499a234e00
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-sync_file_range.c
@@ -0,0 +1,131 @@
+/* Basic sync_file_range (not specific flag is checked).
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/* sync_file_range is only define for LFS. */
+#define _FILE_OFFSET_BITS 64
+#include <fcntl.h>
+#include <errno.h>
+
+static void do_prepare (void);
+#define PREPARE(argc, argv) do_prepare ()
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+
+#define TIMEOUT 20 /* sec. */
+
+#define XSTR(s) STR(S)
+#define STR(s) #s
+
+#include <test-skeleton.c>
+
+static char *temp_filename;
+static int temp_fd;
+
+static char fifoname[] = "/tmp/tst-posix_fadvise-fifo-XXXXXX";
+static int fifofd;
+
+void
+do_prepare (void)
+{
+ temp_fd = create_temp_file ("tst-file_sync_range.", &temp_filename);
+ if (temp_fd == -1)
+ FAIL_EXIT1 ("cannot create temporary file: %m");
+
+ if (mktemp (fifoname) == NULL)
+ FAIL_EXIT1 ("cannot generate temp file name: %m");
+ add_temp_file (fifoname);
+
+ if (mkfifo (fifoname, S_IWUSR | S_IRUSR) != 0)
+ FAIL_EXIT1 ("cannot create fifo: %m");
+
+ fifofd = open (fifoname, O_RDONLY | O_NONBLOCK);
+ if (fifofd == -1)
+ FAIL_EXIT1 ("cannot open fifo: %m");
+}
+
+static int
+do_test (void)
+{
+ int ret;
+
+ /* This tests first check for some invalid usage and then check for
+ a simple usage. It does not cover for all possible issue since for
+ EIO/ENOMEM/ENOSPC would require to create very specific scenarios that
+ are outside the current test coverage (basically correct kernel argument
+ passing. */
+
+ /* Check for invalid file descriptor. */
+ if ((ret = sync_file_range (-1, 0, 0, 0)) != -1)
+ FAIL_EXIT1 ("sync_file_range did not fail on an invalid descriptor "
+ "(returned %d, expected -1)", ret);
+ if (errno != EBADF)
+ FAIL_EXIT1 ("sync_file_range on an invalid descriptor did not set errno to "
+ "EBADF (%d)", errno);
+
+ if ((ret = sync_file_range (fifofd, 0, 0, 0)) != -1)
+ FAIL_EXIT1 ("sync_file_range did not fail on an invalid descriptor "
+ "(returned %d, expected -1)", ret);
+ if (errno != ESPIPE)
+ FAIL_EXIT1 ("sync_file_range on an invalid descriptor did not set errno to "
+ "EBADF (%d)", errno);
+
+ /* Check for invalid flags (it must be
+ SYNC_FILE_RANGE_{WAIT_BEFORE,WRITE,WAIT_AFTER) or a 'or' combination of
+ them. */
+ if ((ret = sync_file_range (temp_fd, 0, 0, -1)) != -1)
+ FAIL_EXIT1 ("sync_file_range did not failed with invalid flags "
+ "(returned %d, " "expected -1)", ret);
+ if (errno != EINVAL)
+ FAIL_EXIT1 ("sync_file_range with invalid flag did not set errno to "
+ "EINVAL (%d)", errno);
+
+ /* Check for negative offset. */
+ if ((ret = sync_file_range (temp_fd, -1, 1, 0)) != -1)
+ FAIL_EXIT1 ("sync_file_range did not failed with invalid offset "
+ "(returned %d, expected -1)", ret);
+ if (errno != EINVAL)
+ FAIL_EXIT1 ("sync_file_range with invalid offset did not set errno to "
+ "EINVAL (%d)", errno);
+
+ /* offset + nbytes must be a positive value. */
+ if ((ret = sync_file_range (temp_fd, 1024, -2048, 0)) != -1)
+ FAIL_EXIT1 ("sync_file_range did not failed with invalid nbytes (returned %d, "
+ "expected -1)", ret);
+ if (errno != EINVAL)
+ FAIL_EXIT1 ("sync_file_range with invalid offset did not set errno to "
+ "EINVAL (%d)", errno);
+
+ /* offset + nbytes must be larger or equal than offset */
+ if ((ret = sync_file_range (temp_fd, -1024, 1024, 0)) != -1)
+ FAIL_EXIT1 ("sync_file_range did not failed with invalid offset "
+ "(returned %d, expected -1)", ret);
+ if (errno != EINVAL)
+ FAIL_EXIT1 ("sync_file_range with invalid offset did not set errno to "
+ "EINVAL (%d)", errno);
+
+ /* Check simple successful case. */
+ if ((ret = sync_file_range (temp_fd, 0, 1024, 0)) == -1)
+ FAIL_EXIT1 ("sync_file_range failed (errno = %d)", errno);
+
+ /* Finally check also a successful case with a 64-bit offset. */
+ off_t large_offset = UINT32_MAX + 2048LL;
+ if ((ret = sync_file_range (temp_fd, large_offset, 1024, 0)) == -1)
+ FAIL_EXIT1 ("sync_file_range failed (errno = %d)", errno);
+
+ return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c b/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c
deleted file mode 100644
index df33112d6b..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* fallocate64 is in posix_fallocate.c */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c b/sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c
deleted file mode 100644
index 137b591b78..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2003-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#define posix_fadvise64 __no_posix_fadvise64
-#include <errno.h>
-#include <fcntl.h>
-#include <sysdep.h>
-#undef posix_fadvise64
-
-/* Advice the system about the expected behaviour of the application with
- respect to the file associated with FD. */
-
-int
-posix_fadvise (int fd, off_t offset, off_t len, int advise)
-{
-#ifdef __NR_fadvise64
- INTERNAL_SYSCALL_DECL (err);
- int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise);
- if (INTERNAL_SYSCALL_ERROR_P (ret, err))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
-#else
- return ENOSYS;
-#endif
-}
-weak_alias (posix_fadvise, posix_fadvise64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise64.c b/sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise64.c
deleted file mode 100644
index c9f72c4ce1..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* posix_fadvise64 is in posix_fadvise.c */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c b/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
deleted file mode 100644
index 8caee318d5..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 2007-2016 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <fcntl.h>
-#include <sysdep.h>
-
-#define posix_fallocate static internal_fallocate
-#include <sysdeps/posix/posix_fallocate.c>
-#undef posix_fallocate
-
-/* Reserve storage for the data of the file associated with FD. */
-int
-posix_fallocate (int fd, __off_t offset, __off_t len)
-{
- INTERNAL_SYSCALL_DECL (err);
-#ifdef INTERNAL_SYSCALL_TYPES
- int res = INTERNAL_SYSCALL_TYPES (fallocate, err, 4, int, fd,
- int, 0, off_t, offset,
- off_t, len);
-#else
- int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len);
-#endif
-
- if (! INTERNAL_SYSCALL_ERROR_P (res, err))
- return 0;
-
- if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP)
- return INTERNAL_SYSCALL_ERRNO (res, err);
-
- return internal_fallocate (fd, offset, len);
-}
-weak_alias (posix_fallocate, posix_fallocate64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c b/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c
deleted file mode 100644
index f466f13e45..0000000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* posix_fallocate64 is in posix_fallocate.c */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
index 2eb94191d9..3f3569fa6e 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
@@ -1,8 +1,5 @@
# File name Caller Syscall name # args Strong name Weak names
-# Whee! 64-bit systems naturally implement llseek.
-llseek EXTRA lseek i:iii __libc_lseek __lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64
-lseek llseek -
fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64
statfs - statfs i:sp __statfs statfs statfs64
mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64
diff --git a/sysdeps/unix/sysv/linux/x86/gettimeofday.c b/sysdeps/unix/sysv/linux/x86/gettimeofday.c
index 36f7c26ffb..c82452f855 100644
--- a/sysdeps/unix/sysv/linux/x86/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/x86/gettimeofday.c
@@ -29,20 +29,20 @@ __gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
}
-void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday");
-
-void *
-gettimeofday_ifunc (void)
-{
- PREPARE_VERSION_KNOWN (linux26, LINUX_2_6);
-
- /* If the vDSO is not available we fall back to syscall. */
- return (_dl_vdso_vsym ("__vdso_gettimeofday", &linux26)
- ?: (void*) (&__gettimeofday_syscall));
-}
-asm (".type __gettimeofday, %gnu_indirect_function");
-
-libc_ifunc_hidden_def(__gettimeofday)
+# ifndef __gettimeofday_type
+/* The i386 gettimeofday.c includes this file with a defined
+ __gettimeofday_type macro. For x86_64 we have to define it to __gettimeofday
+ as the internal symbol is the ifunc'ed one. */
+# define __gettimeofday_type __gettimeofday
+# endif
+
+# undef INIT_ARCH
+# define INIT_ARCH() PREPARE_VERSION_KNOWN (linux26, LINUX_2_6)
+/* If the vDSO is not available we fall back to syscall. */
+libc_ifunc_hidden (__gettimeofday_type, __gettimeofday,
+ (_dl_vdso_vsym ("__vdso_gettimeofday", &linux26)
+ ?: &__gettimeofday_syscall))
+libc_hidden_def (__gettimeofday)
#else
diff --git a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
index 062063526b..99ee9463ea 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
@@ -21,9 +21,11 @@
#include <features.h>
#include <signal.h>
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
+/* We need the signal context definitions even if they are not exposed
+ by <signal.h>. */
#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
#ifdef __x86_64__
diff --git a/sysdeps/unix/sysv/linux/x86/time.c b/sysdeps/unix/sysv/linux/x86/time.c
index f5f7f918c9..a40fe3943d 100644
--- a/sysdeps/unix/sysv/linux/x86/time.c
+++ b/sysdeps/unix/sysv/linux/x86/time.c
@@ -30,20 +30,20 @@ __time_syscall (time_t *t)
return INTERNAL_SYSCALL (time, err, 1, t);
}
-void *time_ifunc (void) __asm__ ("time");
-
-void *
-time_ifunc (void)
-{
- PREPARE_VERSION_KNOWN (linux26, LINUX_2_6);
-
+# ifndef time_type
+/* The i386 time.c includes this file with a defined time_type macro.
+ For x86_64 we have to define it to time as the internal symbol is the
+ ifunc'ed one. */
+# define time_type time
+# endif
+
+#undef INIT_ARCH
+#define INIT_ARCH() PREPARE_VERSION_KNOWN (linux26, LINUX_2_6);
/* If the vDSO is not available we fall back on the syscall. */
- return _dl_vdso_vsym ("__vdso_time", &linux26)
- ?: (void*) &__time_syscall;
-}
-asm (".type time, %gnu_indirect_function");
-
-libc_ifunc_hidden_def(time)
+libc_ifunc_hidden (time_type, time,
+ (_dl_vdso_vsym ("__vdso_time", &linux26)
+ ?: &__time_syscall))
+libc_hidden_def (time)
#else
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 8e6fa57974..b8623fc59f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -1854,6 +1854,9 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
index 65b470817c..b0bbadac09 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
@@ -411,4 +411,25 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
GLIBC_2.4 GLIBC_2.4 A
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index bcf63701de..8aed2f4635 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -8,7 +8,7 @@ msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
pread64 - pread64 Ci:ipii __libc_pread __libc_pread64 __pread64 pread64 __pread pread
preadv64 - preadv Ci:ipii preadv64 preadv
-pwrite64 - pwrite64 Ci:ipii __libc_pwrite __pwrite64 pwrite64 __pwrite pwrite
+pwrite64 - pwrite64 Ci:ipii __libc_pwrite __libc_pwrite64 __pwrite64 pwrite64 __pwrite pwrite
pwritev64 - pwritev Ci:ipii pwritev64 pwritev
shmat - shmat i:ipi __shmat shmat
shmctl - shmctl i:iip __shmctl shmctl
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 1e12f48ec9..a61d874dfe 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2097,3 +2097,6 @@ GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
index d35e9f0207..87f085202f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist
@@ -410,3 +410,24 @@ GLIBC_2.24 nextdownl F
GLIBC_2.24 nextup F
GLIBC_2.24 nextupf F
GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S b/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S
new file mode 100644
index 0000000000..d81e98fb51
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S
@@ -0,0 +1 @@
+/* We don't need a definition since the llseek function is what we need. */
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list
index dce4302515..a41c8ac882 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list
@@ -3,5 +3,5 @@
fallocate - fallocate Ci:iiii fallocate fallocate64
gettimeofday - gettimeofday:__vdso_gettimeofday@LINUX_2.6 i:pP __gettimeofday gettimeofday
personality EXTRA personality Ei:i __personality personality
-posix_fadvise - fadvise64 Vi:iiii posix_fadvise posix_fadvise64
+posix_fadvise64 - fadvise64 Vi:iiii posix_fadvise posix_fadvise64
time - time:__vdso_time@LINUX_2.6 Ei:P time
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
index b8b075023c..cbd5aeb1d2 100644
--- a/sysdeps/unix/sysv/linux/xstat.c
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -35,7 +35,7 @@ int
__xstat (int vers, const char *name, struct stat *buf)
{
if (vers == _STAT_VER_KERNEL)
- return INLINE_SYSCALL (stat, 2, name, (struct kernel_stat *) buf);
+ return INLINE_SYSCALL (stat, 2, name, buf);
#ifdef STAT_IS_KERNEL_STAT
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c
index 2075383ddf..00a4459f4f 100644
--- a/sysdeps/unix/sysv/linux/xstat64.c
+++ b/sysdeps/unix/sysv/linux/xstat64.c
@@ -33,7 +33,7 @@ ___xstat64 (int vers, const char *name, struct stat64 *buf)
{
int result;
result = INLINE_SYSCALL (stat64, 2, name, buf);
-#if defined _HAVE_STAT64___ST_INO && !defined __ASSUME_ST_INO_64_BIT
+#if defined _HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT
if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
buf->st_ino = buf->__st_ino;
#endif
diff --git a/sysdeps/unix/sysv/linux/xstatconv.c b/sysdeps/unix/sysv/linux/xstatconv.c
index c5fbf3d8bf..27b528ca11 100644
--- a/sysdeps/unix/sysv/linux/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/xstatconv.c
@@ -190,7 +190,7 @@ __xstat32_conv (int vers, struct stat64 *kbuf, struct stat *buf)
buf->__pad1 = 0;
#endif
#ifdef _HAVE_STAT64___ST_INO
-# ifndef __ASSUME_ST_INO_64_BIT
+# if !__ASSUME_ST_INO_64_BIT
if (kbuf->st_ino == 0)
buf->st_ino = kbuf->__st_ino;
else
diff --git a/sysdeps/wordsize-32/bits/wordsize.h b/sysdeps/wordsize-32/bits/wordsize.h
index 2aa16bcde5..a251f3a923 100644
--- a/sysdeps/wordsize-32/bits/wordsize.h
+++ b/sysdeps/wordsize-32/bits/wordsize.h
@@ -15,4 +15,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define __WORDSIZE 32
+#define __WORDSIZE 32
+#define __WORDSIZE_TIME64_COMPAT32 0
+#define __WORDSIZE32_SIZE_ULONG 0
+#define __WORDSIZE32_PTRDIFF_LONG 0
diff --git a/sysdeps/wordsize-64/bits/wordsize.h b/sysdeps/wordsize-64/bits/wordsize.h
index 0944f9e267..8b5c502a9b 100644
--- a/sysdeps/wordsize-64/bits/wordsize.h
+++ b/sysdeps/wordsize-64/bits/wordsize.h
@@ -15,4 +15,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define __WORDSIZE 64
+#define __WORDSIZE 64
+#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/x86/bits/pthreadtypes.h b/sysdeps/x86/bits/pthreadtypes.h
index 16b8f4fbb1..c641a405e3 100644
--- a/sysdeps/x86/bits/pthreadtypes.h
+++ b/sysdeps/x86/bits/pthreadtypes.h
@@ -98,7 +98,7 @@ typedef union
unsigned int __nusers;
#endif
/* KIND must stay at this position in the structure to maintain
- binary compatibility. */
+ binary compatibility with static initializers. */
int __kind;
#ifdef __x86_64__
short __spins;
diff --git a/sysdeps/x86/bits/wordsize.h b/sysdeps/x86/bits/wordsize.h
index e25af287e8..70f652bca1 100644
--- a/sysdeps/x86/bits/wordsize.h
+++ b/sysdeps/x86/bits/wordsize.h
@@ -4,10 +4,14 @@
# define __WORDSIZE 64
#else
# define __WORDSIZE 32
+#define __WORDSIZE32_SIZE_ULONG 0
+#define __WORDSIZE32_PTRDIFF_LONG 0
#endif
#ifdef __x86_64__
# define __WORDSIZE_TIME64_COMPAT32 1
/* Both x86-64 and x32 use the 64-bit system call interface. */
# define __SYSCALL_WORDSIZE 64
+#else
+# define __WORDSIZE_TIME64_COMPAT32 0
#endif
diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
index cf4f64b0d8..35268e8d9a 100644
--- a/sysdeps/x86/cacheinfo.c
+++ b/sysdeps/x86/cacheinfo.c
@@ -259,7 +259,9 @@ intel_check_word (int name, unsigned int value, bool *has_level_2,
static long int __attribute__ ((noinline))
handle_intel (int name, unsigned int maxidx)
{
- assert (maxidx >= 2);
+ /* Return -1 for older CPUs. */
+ if (maxidx < 2)
+ return -1;
/* OK, we can use the CPUID instruction to get all info about the
caches. */
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 9ce4b495a5..e228a76c40 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -60,12 +60,20 @@ get_common_indeces (struct cpu_features *cpu_features,
{
/* Determine if AVX is usable. */
if (CPU_FEATURES_CPU_P (cpu_features, AVX))
- cpu_features->feature[index_arch_AVX_Usable]
- |= bit_arch_AVX_Usable;
- /* Determine if AVX2 is usable. */
- if (CPU_FEATURES_CPU_P (cpu_features, AVX2))
- cpu_features->feature[index_arch_AVX2_Usable]
- |= bit_arch_AVX2_Usable;
+ {
+ cpu_features->feature[index_arch_AVX_Usable]
+ |= bit_arch_AVX_Usable;
+ /* The following features depend on AVX being usable. */
+ /* Determine if AVX2 is usable. */
+ if (CPU_FEATURES_CPU_P (cpu_features, AVX2))
+ cpu_features->feature[index_arch_AVX2_Usable]
+ |= bit_arch_AVX2_Usable;
+ /* Determine if FMA is usable. */
+ if (CPU_FEATURES_CPU_P (cpu_features, FMA))
+ cpu_features->feature[index_arch_FMA_Usable]
+ |= bit_arch_FMA_Usable;
+ }
+
/* Check if OPMASK state, upper 256-bit of ZMM0-ZMM15 and
ZMM16-ZMM31 state are enabled. */
if ((xcrlow & (bit_Opmask_state | bit_ZMM0_15_state
@@ -83,10 +91,6 @@ get_common_indeces (struct cpu_features *cpu_features,
|= bit_arch_AVX512DQ_Usable;
}
}
- /* Determine if FMA is usable. */
- if (CPU_FEATURES_CPU_P (cpu_features, FMA))
- cpu_features->feature[index_arch_FMA_Usable]
- |= bit_arch_FMA_Usable;
}
}
}
@@ -205,6 +209,20 @@ init_cpu_features (struct cpu_features *cpu_features)
if (CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable))
cpu_features->feature[index_arch_AVX_Fast_Unaligned_Load]
|= bit_arch_AVX_Fast_Unaligned_Load;
+
+ /* To avoid SSE transition penalty, use _dl_runtime_resolve_slow.
+ If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt. */
+ cpu_features->feature[index_arch_Use_dl_runtime_resolve_slow]
+ |= bit_arch_Use_dl_runtime_resolve_slow;
+ if (cpu_features->max_cpuid >= 0xd)
+ {
+ unsigned int eax;
+
+ __cpuid_count (0xd, 1, eax, ebx, ecx, edx);
+ if ((eax & (1 << 2)) != 0)
+ cpu_features->feature[index_arch_Use_dl_runtime_resolve_opt]
+ |= bit_arch_Use_dl_runtime_resolve_opt;
+ }
}
/* This spells out "AuthenticAMD". */
else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index 97ffe765f4..bba33e6b0b 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -37,6 +37,8 @@
#define bit_arch_Prefer_No_VZEROUPPER (1 << 17)
#define bit_arch_Fast_Unaligned_Copy (1 << 18)
#define bit_arch_Prefer_ERMS (1 << 19)
+#define bit_arch_Use_dl_runtime_resolve_opt (1 << 20)
+#define bit_arch_Use_dl_runtime_resolve_slow (1 << 21)
/* CPUID Feature flags. */
@@ -63,7 +65,7 @@
/* XCR0 Feature flags. */
#define bit_XMM_state (1 << 1)
-#define bit_YMM_state (2 << 1)
+#define bit_YMM_state (1 << 2)
#define bit_Opmask_state (1 << 5)
#define bit_ZMM0_15_state (1 << 6)
#define bit_ZMM16_31_state (1 << 7)
@@ -107,6 +109,8 @@
# define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE
# define index_arch_Fast_Unaligned_Copy FEATURE_INDEX_1*FEATURE_SIZE
# define index_arch_Prefer_ERMS FEATURE_INDEX_1*FEATURE_SIZE
+# define index_arch_Use_dl_runtime_resolve_opt FEATURE_INDEX_1*FEATURE_SIZE
+# define index_arch_Use_dl_runtime_resolve_slow FEATURE_INDEX_1*FEATURE_SIZE
# if defined (_LIBC) && !IS_IN (nonlib)
@@ -277,6 +281,8 @@ extern const struct cpu_features *__get_cpu_features (void)
# define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1
# define index_arch_Fast_Unaligned_Copy FEATURE_INDEX_1
# define index_arch_Prefer_ERMS FEATURE_INDEX_1
+# define index_arch_Use_dl_runtime_resolve_opt FEATURE_INDEX_1
+# define index_arch_Use_dl_runtime_resolve_slow FEATURE_INDEX_1
#endif /* !__ASSEMBLER__ */
diff --git a/sysdeps/x86/fpu/bits/fenv.h b/sysdeps/x86/fpu/bits/fenv.h
index 8c8503bd7e..688407281c 100644
--- a/sysdeps/x86/fpu/bits/fenv.h
+++ b/sysdeps/x86/fpu/bits/fenv.h
@@ -101,6 +101,20 @@ fenv_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef struct
+ {
+ unsigned short int __control_word;
+ unsigned short int __glibc_reserved;
+ unsigned int __mxcsr;
+ }
+femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) -1L)
+#endif
+
#ifdef __USE_EXTERN_INLINES
__BEGIN_DECLS
diff --git a/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h b/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h
new file mode 100644
index 0000000000..6052280371
--- /dev/null
+++ b/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h
@@ -0,0 +1,28 @@
+/* Fix for missing "invalid" exceptions from floating-point
+ comparisons. x86 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H 1
+
+/* As of GCC 5, both x87 and SSE comparisons use unordered comparison
+ instructions when they should use ordered comparisons
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52451>. */
+#define FIX_COMPARE_INVALID 1
+
+#endif /* fix-fp-int-compare-invalid.h */
diff --git a/sysdeps/x86/fpu/include/bits/fenv.h b/sysdeps/x86/fpu/include/bits/fenv.h
index 6e8b733f33..a410ed00d0 100644
--- a/sysdeps/x86/fpu/include/bits/fenv.h
+++ b/sysdeps/x86/fpu/include/bits/fenv.h
@@ -16,8 +16,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_FENV_H
#include_next <bits/fenv.h>
+# ifndef _ISOMAC
+
/* Ensure __feraiseexcept calls in glibc are optimized the same as
feraiseexcept calls. */
@@ -40,3 +43,6 @@ __NTH (__feraiseexcept (int __excepts))
__END_DECLS
#endif
+
+# endif /* _ISOMAC */
+#endif /* bits/fenv.h */
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index ed0c1a8efd..5c021dcf99 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -68,7 +68,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
Elf64_Addr *got;
extern void _dl_runtime_resolve_sse (ElfW(Word)) attribute_hidden;
extern void _dl_runtime_resolve_avx (ElfW(Word)) attribute_hidden;
+ extern void _dl_runtime_resolve_avx_slow (ElfW(Word)) attribute_hidden;
+ extern void _dl_runtime_resolve_avx_opt (ElfW(Word)) attribute_hidden;
extern void _dl_runtime_resolve_avx512 (ElfW(Word)) attribute_hidden;
+ extern void _dl_runtime_resolve_avx512_opt (ElfW(Word)) attribute_hidden;
extern void _dl_runtime_profile_sse (ElfW(Word)) attribute_hidden;
extern void _dl_runtime_profile_avx (ElfW(Word)) attribute_hidden;
extern void _dl_runtime_profile_avx512 (ElfW(Word)) attribute_hidden;
@@ -118,9 +121,26 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
indicated by the offset on the stack, and then jump to
the resolved address. */
if (HAS_ARCH_FEATURE (AVX512F_Usable))
- *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_avx512;
+ {
+ if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_opt))
+ *(ElfW(Addr) *) (got + 2)
+ = (ElfW(Addr)) &_dl_runtime_resolve_avx512_opt;
+ else
+ *(ElfW(Addr) *) (got + 2)
+ = (ElfW(Addr)) &_dl_runtime_resolve_avx512;
+ }
else if (HAS_ARCH_FEATURE (AVX_Usable))
- *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_avx;
+ {
+ if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_opt))
+ *(ElfW(Addr) *) (got + 2)
+ = (ElfW(Addr)) &_dl_runtime_resolve_avx_opt;
+ else if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_slow))
+ *(ElfW(Addr) *) (got + 2)
+ = (ElfW(Addr)) &_dl_runtime_resolve_avx_slow;
+ else
+ *(ElfW(Addr) *) (got + 2)
+ = (ElfW(Addr)) &_dl_runtime_resolve_avx;
+ }
else
*(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_sse;
}
@@ -311,7 +331,23 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
0)
&& __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
&& __builtin_expect (!skip_ifunc, 1))
- value = ((ElfW(Addr) (*) (void)) value) ();
+ {
+# ifndef RTLD_BOOTSTRAP
+ if (sym_map != map
+ && sym_map->l_type != lt_executable
+ && !sym_map->l_relocated)
+ {
+ const char *strtab
+ = (const char *) D_PTR (map, l_info[DT_STRTAB]);
+ _dl_fatal_printf ("\
+%s: Relink `%s' with `%s' for IFUNC symbol `%s'\n",
+ RTLD_PROGNAME, map->l_name,
+ sym_map->l_name,
+ strtab + refsym->st_name);
+ }
+# endif
+ value = ((ElfW(Addr) (*) (void)) value) ();
+ }
switch (r_type)
{
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 12f1a5cf84..39f595e1e1 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -18,6 +18,7 @@
#include <config.h>
#include <sysdep.h>
+#include <cpu-features.h>
#include <link-defines.h>
#ifndef DL_STACK_ALIGNMENT
@@ -86,9 +87,11 @@
#endif
#define VEC(i) zmm##i
#define _dl_runtime_resolve _dl_runtime_resolve_avx512
+#define _dl_runtime_resolve_opt _dl_runtime_resolve_avx512_opt
#define _dl_runtime_profile _dl_runtime_profile_avx512
#include "dl-trampoline.h"
#undef _dl_runtime_resolve
+#undef _dl_runtime_resolve_opt
#undef _dl_runtime_profile
#undef VEC
#undef VMOV
@@ -104,9 +107,11 @@
#endif
#define VEC(i) ymm##i
#define _dl_runtime_resolve _dl_runtime_resolve_avx
+#define _dl_runtime_resolve_opt _dl_runtime_resolve_avx_opt
#define _dl_runtime_profile _dl_runtime_profile_avx
#include "dl-trampoline.h"
#undef _dl_runtime_resolve
+#undef _dl_runtime_resolve_opt
#undef _dl_runtime_profile
#undef VEC
#undef VMOV
@@ -126,3 +131,18 @@
#define _dl_runtime_profile _dl_runtime_profile_sse
#undef RESTORE_AVX
#include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef _dl_runtime_profile
+#undef VMOV
+#undef VMOVA
+
+/* Used by _dl_runtime_resolve_avx_opt/_dl_runtime_resolve_avx512_opt
+ to preserve the full vector registers with zero upper bits. */
+#define VMOVA vmovdqa
+#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
+# define VMOV vmovdqa
+#else
+# define VMOV vmovdqu
+#endif
+#define _dl_runtime_resolve _dl_runtime_resolve_sse_vex
+#include "dl-trampoline.h"
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
index b90836ab13..d6c7f989b5 100644
--- a/sysdeps/x86_64/dl-trampoline.h
+++ b/sysdeps/x86_64/dl-trampoline.h
@@ -50,6 +50,105 @@
#endif
.text
+#ifdef _dl_runtime_resolve_opt
+/* Use the smallest vector registers to preserve the full YMM/ZMM
+ registers to avoid SSE transition penalty. */
+
+# if VEC_SIZE == 32
+/* Check if the upper 128 bits in %ymm0 - %ymm7 registers are non-zero
+ and preserve %xmm0 - %xmm7 registers with the zero upper bits. Since
+ there is no SSE transition penalty on AVX512 processors which don't
+ support XGETBV with ECX == 1, _dl_runtime_resolve_avx512_slow isn't
+ provided. */
+ .globl _dl_runtime_resolve_avx_slow
+ .hidden _dl_runtime_resolve_avx_slow
+ .type _dl_runtime_resolve_avx_slow, @function
+ .align 16
+_dl_runtime_resolve_avx_slow:
+ cfi_startproc
+ cfi_adjust_cfa_offset(16) # Incorporate PLT
+ vorpd %ymm0, %ymm1, %ymm8
+ vorpd %ymm2, %ymm3, %ymm9
+ vorpd %ymm4, %ymm5, %ymm10
+ vorpd %ymm6, %ymm7, %ymm11
+ vorpd %ymm8, %ymm9, %ymm9
+ vorpd %ymm10, %ymm11, %ymm10
+ vpcmpeqd %xmm8, %xmm8, %xmm8
+ vorpd %ymm9, %ymm10, %ymm10
+ vptest %ymm10, %ymm8
+ # Preserve %ymm0 - %ymm7 registers if the upper 128 bits of any
+ # %ymm0 - %ymm7 registers aren't zero.
+ PRESERVE_BND_REGS_PREFIX
+ jnc _dl_runtime_resolve_avx
+ # Use vzeroupper to avoid SSE transition penalty.
+ vzeroupper
+ # Preserve %xmm0 - %xmm7 registers with the zero upper 128 bits
+ # when the upper 128 bits of %ymm0 - %ymm7 registers are zero.
+ PRESERVE_BND_REGS_PREFIX
+ jmp _dl_runtime_resolve_sse_vex
+ cfi_adjust_cfa_offset(-16) # Restore PLT adjustment
+ cfi_endproc
+ .size _dl_runtime_resolve_avx_slow, .-_dl_runtime_resolve_avx_slow
+# endif
+
+/* Use XGETBV with ECX == 1 to check which bits in vector registers are
+ non-zero and only preserve the non-zero lower bits with zero upper
+ bits. */
+ .globl _dl_runtime_resolve_opt
+ .hidden _dl_runtime_resolve_opt
+ .type _dl_runtime_resolve_opt, @function
+ .align 16
+_dl_runtime_resolve_opt:
+ cfi_startproc
+ cfi_adjust_cfa_offset(16) # Incorporate PLT
+ pushq %rax
+ cfi_adjust_cfa_offset(8)
+ cfi_rel_offset(%rax, 0)
+ pushq %rcx
+ cfi_adjust_cfa_offset(8)
+ cfi_rel_offset(%rcx, 0)
+ pushq %rdx
+ cfi_adjust_cfa_offset(8)
+ cfi_rel_offset(%rdx, 0)
+ movl $1, %ecx
+ xgetbv
+ movl %eax, %r11d
+ popq %rdx
+ cfi_adjust_cfa_offset(-8)
+ cfi_restore (%rdx)
+ popq %rcx
+ cfi_adjust_cfa_offset(-8)
+ cfi_restore (%rcx)
+ popq %rax
+ cfi_adjust_cfa_offset(-8)
+ cfi_restore (%rax)
+# if VEC_SIZE == 32
+ # For YMM registers, check if YMM state is in use.
+ andl $bit_YMM_state, %r11d
+ # Preserve %xmm0 - %xmm7 registers with the zero upper 128 bits if
+ # YMM state isn't in use.
+ PRESERVE_BND_REGS_PREFIX
+ jz _dl_runtime_resolve_sse_vex
+# elif VEC_SIZE == 64
+ # For ZMM registers, check if YMM state and ZMM state are in
+ # use.
+ andl $(bit_YMM_state | bit_ZMM0_15_state), %r11d
+ cmpl $bit_YMM_state, %r11d
+ # Preserve %xmm0 - %xmm7 registers with the zero upper 384 bits if
+ # neither YMM state nor ZMM state are in use.
+ PRESERVE_BND_REGS_PREFIX
+ jl _dl_runtime_resolve_sse_vex
+ # Preserve %ymm0 - %ymm7 registers with the zero upper 256 bits if
+ # ZMM state isn't in use.
+ PRESERVE_BND_REGS_PREFIX
+ je _dl_runtime_resolve_avx
+# else
+# error Unsupported VEC_SIZE!
+# endif
+ cfi_adjust_cfa_offset(-16) # Restore PLT adjustment
+ cfi_endproc
+ .size _dl_runtime_resolve_opt, .-_dl_runtime_resolve_opt
+#endif
.globl _dl_runtime_resolve
.hidden _dl_runtime_resolve
.type _dl_runtime_resolve, @function
@@ -69,7 +168,9 @@ _dl_runtime_resolve:
and $-VEC_SIZE, %RSP_LP
#endif
sub $REGISTER_SAVE_AREA, %RSP_LP
+#if !DL_RUNTIME_RESOLVE_REALIGN_STACK
cfi_adjust_cfa_offset(REGISTER_SAVE_AREA)
+#endif
# Preserve registers otherwise clobbered.
movq %rax, REGISTER_SAVE_RAX(%rsp)
movq %rcx, REGISTER_SAVE_RCX(%rsp)
@@ -162,7 +263,10 @@ _dl_runtime_resolve:
.size _dl_runtime_resolve, .-_dl_runtime_resolve
-#ifndef PROF
+/* To preserve %xmm0 - %xmm7 registers, dl-trampoline.h is included
+ twice, for _dl_runtime_resolve_sse and _dl_runtime_resolve_sse_vex.
+ But we don't need another _dl_runtime_profile for XMM registers. */
+#if !defined PROF && defined _dl_runtime_profile
# if (LR_VECTOR_OFFSET % VEC_SIZE) != 0
# error LR_VECTOR_OFFSET must be multples of VEC_SIZE
# endif
diff --git a/sysdeps/x86_64/fpu/dla.h b/sysdeps/x86_64/fpu/dla.h
deleted file mode 100644
index 688efa0f5b..0000000000
--- a/sysdeps/x86_64/fpu/dla.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <features.h>
-
-#ifdef __FMA4__
-# define DLA_FMS(x,y,z) \
- __builtin_fma (x, y, -(z))
-#endif
-
-#include "sysdeps/ieee754/dbl-64/dla.h"
diff --git a/math/cimagl.c b/sysdeps/x86_64/fpu/fegetmode.c
index c1d0910787..f4a179d36b 100644
--- a/math/cimagl.c
+++ b/sysdeps/x86_64/fpu/fegetmode.c
@@ -1,7 +1,6 @@
-/* Return imaginary part of complex long double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Store current floating-point control modes. x86_64 version.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,11 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <complex.h>
+#include <fenv.h>
+#include <fpu_control.h>
-long double
-__cimagl (long double _Complex z)
+int
+fegetmode (femode_t *modep)
{
- return __imag__ z;
+ _FPU_GETCW (modep->__control_word);
+ __asm__ ("stmxcsr %0" : "=m" (modep->__mxcsr));
+ return 0;
}
-weak_alias (__cimagl, cimagl)
diff --git a/sysdeps/x86_64/fpu/fesetexcept.c b/sysdeps/x86_64/fpu/fesetexcept.c
new file mode 100644
index 0000000000..805f769f13
--- /dev/null
+++ b/sysdeps/x86_64/fpu/fesetexcept.c
@@ -0,0 +1,31 @@
+/* Set given exception flags. x86_64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+
+int
+fesetexcept (int excepts)
+{
+ unsigned int mxcsr;
+
+ __asm__ ("stmxcsr %0" : "=m" (*&mxcsr));
+ mxcsr |= excepts & FE_ALL_EXCEPT;
+ __asm__ ("ldmxcsr %0" : : "m" (*&mxcsr));
+
+ return 0;
+}
diff --git a/sysdeps/x86_64/fpu/fesetmode.c b/sysdeps/x86_64/fpu/fesetmode.c
new file mode 100644
index 0000000000..19173f91cb
--- /dev/null
+++ b/sysdeps/x86_64/fpu/fesetmode.c
@@ -0,0 +1,50 @@
+/* Install given floating-point control modes. x86_64 version.
+ Copyright (C) 2016 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+/* All exceptions, including the x86-specific "denormal operand"
+ exception. */
+#define FE_ALL_EXCEPT_X86 (FE_ALL_EXCEPT | __FE_DENORM)
+
+int
+fesetmode (const femode_t *modep)
+{
+ fpu_control_t cw;
+ unsigned int mxcsr;
+ __asm__ ("stmxcsr %0" : "=m" (mxcsr));
+ /* Preserve SSE exception flags but restore other state in
+ MXCSR. */
+ mxcsr &= FE_ALL_EXCEPT_X86;
+ if (modep == FE_DFL_MODE)
+ {
+ cw = _FPU_DEFAULT;
+ /* Default MXCSR state has all bits zero except for those
+ masking exceptions. */
+ mxcsr |= FE_ALL_EXCEPT_X86 << 7;
+ }
+ else
+ {
+ cw = modep->__control_word;
+ mxcsr |= modep->__mxcsr & ~FE_ALL_EXCEPT_X86;
+ }
+ _FPU_SETCW (cw);
+ __asm__ ("ldmxcsr %0" : : "m" (mxcsr));
+ return 0;
+}
diff --git a/sysdeps/x86_64/fpu/k_rem_pio2l.c b/sysdeps/x86_64/fpu/k_rem_pio2l.c
deleted file mode 100644
index eea55a98d2..0000000000
--- a/sysdeps/x86_64/fpu/k_rem_pio2l.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/x86_64/fpu/libm-test-ulps-name b/sysdeps/x86_64/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..1c09346681
--- /dev/null
+++ b/sysdeps/x86_64/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+x86_64
diff --git a/sysvipc/sys/ipc.h b/sysvipc/sys/ipc.h
index 70bd7a6968..0392662340 100644
--- a/sysvipc/sys/ipc.h
+++ b/sysvipc/sys/ipc.h
@@ -20,10 +20,6 @@
#include <features.h>
-#if !defined __USE_MISC && !defined __USE_XOPEN && __GNUC__ >= 2
-# warning "Files using this header must be compiled with _GNU_SOURCE or _XOPEN_SOURCE"
-#endif
-
/* Get system dependent definition of `struct ipc_perm' and more. */
#include <bits/ipctypes.h>
#include <bits/ipc.h>
diff --git a/sysvipc/sys/msg.h b/sysvipc/sys/msg.h
index 4dc559f49a..4499dc5e91 100644
--- a/sysvipc/sys/msg.h
+++ b/sysvipc/sys/msg.h
@@ -30,8 +30,7 @@
#include <bits/msq.h>
/* Define types required by the standard. */
-#define __need_time_t
-#include <time.h>
+#include <bits/types/time_t.h>
#ifndef __pid_t_defined
typedef __pid_t pid_t;
diff --git a/sysvipc/sys/sem.h b/sysvipc/sys/sem.h
index 1b32092922..3a79f9d27a 100644
--- a/sysvipc/sys/sem.h
+++ b/sysvipc/sys/sem.h
@@ -30,8 +30,7 @@
#include <bits/sem.h>
#ifdef __USE_GNU
-# define __need_timespec
-# include <time.h>
+# include <bits/types/struct_timespec.h>
#endif
/* The following System V style IPC functions implement a semaphore
diff --git a/sysvipc/sys/shm.h b/sysvipc/sys/shm.h
index df263dcba6..41dc6c63f7 100644
--- a/sysvipc/sys/shm.h
+++ b/sysvipc/sys/shm.h
@@ -30,8 +30,7 @@
#include <bits/shm.h>
/* Define types required by the standard. */
-#define __need_time_t
-#include <time.h>
+#include <bits/types/time_t.h>
#ifdef __USE_XOPEN
# ifndef __pid_t_defined
diff --git a/test-skeleton.c b/test-skeleton.c
index 5a90c65826..fa457befa5 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -36,7 +36,22 @@
/* The test function is normally called `do_test' and it is called
with argc and argv as the arguments. We nevertheless provide the
- possibility to overwrite this name. */
+ possibility to overwrite this name.
+
+ The TEST_FUNCTION expression should have a type of 'int' and should
+ return 0 to indicate a passing test, 1 to indicate a failing test,
+ or 77 to indicate an unsupported test. Other result values could be
+ used to indicate a failing test, but the result of the expression
+ is passed to exit and exit only returns the lower 8 bits of its input.
+ A non-zero return with some values could cause a test to incorrectly
+ be considered passing when it really failed. For this reason the
+ expression should always return 0, 1, or 77.
+
+ The test function may print out diagnostic or warning messages as well
+ as messages about failures. These messages should be printed to stdout
+ and not stderr so that the output is properly ordered with respect to
+ the rest of the glibc testsuite run output. */
+
#ifndef TEST_FUNCTION
# define TEST_FUNCTION do_test (argc, argv)
#endif
@@ -70,6 +85,25 @@ static pid_t pid;
/* Directory to place temporary files in. */
static const char *test_dir;
+#define _FAIL(...) \
+ printf ("error: %s:%d: ", __FILE__, __LINE__); \
+ printf (__VA_ARGS__); \
+ printf ("\n"); \
+
+#define FAIL_RET(...) \
+ ({ \
+ _FAIL (__VA_ARGS__); \
+ return 1; \
+ })
+
+#define FAIL_EXIT(value, ...) \
+ ({ \
+ _FAIL (__VA_ARGS__); \
+ exit (value); \
+ })
+
+#define FAIL_EXIT1(...) FAIL_EXIT(1, __VA_ARGS__)
+
static void
oom_error (const char *fn, size_t size)
{
@@ -115,6 +149,20 @@ xrealloc (void *p, size_t n)
return result;
}
+/* Call asprintf with error checking. */
+__attribute__ ((always_inline, format (printf, 1, 2)))
+static __inline__ char *
+xasprintf (const char *format, ...)
+{
+ char *result;
+ if (asprintf (&result, format, __builtin_va_arg_pack ()) < 0)
+ {
+ printf ("error: asprintf: %m\n");
+ exit (1);
+ }
+ return result;
+}
+
/* Write a message to standard output. Can be used in signal
handlers. */
static void
@@ -559,3 +607,160 @@ main (int argc, char *argv[])
#endif
}
}
+
+/* The following functionality is only available if <pthread.h> was
+ included before this file. */
+#ifdef _PTHREAD_H
+
+/* Call pthread_sigmask with error checking. */
+static void
+xpthread_sigmask (int how, const sigset_t *set, sigset_t *oldset)
+{
+ if (pthread_sigmask (how, set, oldset) != 0)
+ {
+ write_message ("error: pthread_setmask failed\n");
+ _exit (1);
+ }
+}
+
+/* Call pthread_mutex_lock with error checking. */
+__attribute__ ((unused))
+static void
+xpthread_mutex_lock (pthread_mutex_t *mutex)
+{
+ int ret = pthread_mutex_lock (mutex);
+ if (ret != 0)
+ {
+ errno = ret;
+ printf ("error: pthread_mutex_lock: %m\n");
+ exit (1);
+ }
+}
+
+/* Call pthread_spin_lock with error checking. */
+__attribute__ ((unused))
+static void
+xpthread_spin_lock (pthread_spinlock_t *lock)
+{
+ int ret = pthread_spin_lock (lock);
+ if (ret != 0)
+ {
+ errno = ret;
+ printf ("error: pthread_spin_lock: %m\n");
+ exit (1);
+ }
+}
+
+/* Call pthread_cond_wait with error checking. */
+__attribute__ ((unused))
+static void
+xpthread_cond_wait (pthread_cond_t * cond,
+ pthread_mutex_t * mutex)
+{
+ int ret = pthread_cond_wait (cond, mutex);
+ if (ret != 0)
+ {
+ errno = ret;
+ printf ("error: pthread_cond_wait: %m\n");
+ exit (1);
+ }
+}
+
+/* Call pthread_barrier_wait with error checking. */
+__attribute__ ((unused))
+static int
+xpthread_barrier_wait (pthread_barrier_t *barrier)
+{
+ int ret = pthread_barrier_wait (barrier);
+ if (ret != 0 && ret != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ errno = ret;
+ printf ("error: pthread_barrier_wait: %m\n");
+ exit (1);
+ }
+ return ret;
+}
+
+/* Call pthread_create with error checking. */
+static pthread_t
+xpthread_create (pthread_attr_t *attr,
+ void *(*thread_func) (void *), void *closure)
+{
+ pthread_t thr;
+ int ret = pthread_create (&thr, attr, thread_func, closure);
+ if (ret != 0)
+ {
+ errno = ret;
+ printf ("error: pthread_create: %m\n");
+ exit (1);
+ }
+ return thr;
+}
+
+/* Call pthread_detach with error checking. */
+static void
+xpthread_detach (pthread_t thr)
+{
+ int ret = pthread_detach (thr);
+ if (ret != 0)
+ {
+ errno = ret;
+ printf ("error: pthread_detach: %m\n");
+ exit (1);
+ }
+}
+
+/* Call pthread_join with error checking. */
+__attribute__ ((unused))
+static void *
+xpthread_join (pthread_t thr)
+{
+ void *result;
+ int ret = pthread_join (thr, &result);
+ if (ret != 0)
+ {
+ errno = ret;
+ printf ("error: pthread_join: %m\n");
+ exit (1);
+ }
+ return result;
+}
+
+/* Used to implement the delayed_exit function defined below. */
+static void *
+delayed_exit_thread (void *seconds_as_ptr)
+{
+ int seconds = (uintptr_t) seconds_as_ptr;
+ struct timespec delay = { seconds, 0 };
+ struct timespec remaining = { 0 };
+ if (nanosleep (&delay, &remaining) != 0)
+ {
+ printf ("error: nanosleep: %m\n");
+ _exit (1);
+ }
+ /* Exit the process sucessfully. */
+ exit (0);
+ return NULL;
+}
+
+/* Exit (with status 0) after SECONDS have elapsed, from a helper
+ thread. The process is terminated with the exit function, so
+ atexit handlers are executed. */
+__attribute__ ((unused))
+static void
+delayed_exit (int seconds)
+{
+ /* Create the new thread with all signals blocked. */
+ sigset_t all_blocked;
+ sigfillset (&all_blocked);
+ sigset_t old_set;
+ xpthread_sigmask (SIG_SETMASK, &all_blocked, &old_set);
+ /* Create a detached thread. */
+ pthread_t thr = xpthread_create
+ (NULL, delayed_exit_thread, (void *) (uintptr_t) seconds);
+ xpthread_detach (thr);
+ /* Restore the original signal mask. */
+ xpthread_sigmask (SIG_SETMASK, &old_set, NULL);
+}
+
+#endif /* _PTHREAD_H */
diff --git a/time/Makefile b/time/Makefile
index e052c0765d..326a81bcae 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -22,7 +22,12 @@ subdir := time
include ../Makeconfig
-headers := time.h sys/time.h sys/timeb.h bits/time.h
+headers := time.h sys/time.h sys/timeb.h bits/time.h \
+ bits/types/clockid_t.h bits/types/clock_t.h \
+ bits/types/struct_itimerspec.h \
+ bits/types/struct_timespec.h bits/types/struct_timeval.h \
+ bits/types/struct_tm.h bits/types/timer_t.h \
+ bits/types/time_t.h
routines := offtime asctime clock ctime ctime_r difftime \
gmtime localtime mktime time \
diff --git a/time/bits/types/clock_t.h b/time/bits/types/clock_t.h
new file mode 100644
index 0000000000..b8cbaf2cb6
--- /dev/null
+++ b/time/bits/types/clock_t.h
@@ -0,0 +1,15 @@
+#ifndef __clock_t_defined
+#define __clock_t_defined 1
+
+#include <bits/types.h>
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `clock'. */
+typedef __clock_t clock_t;
+__END_NAMESPACE_STD
+
+#if defined __USE_XOPEN || defined __USE_POSIX
+__USING_NAMESPACE_STD(clock_t)
+#endif
+
+#endif
diff --git a/time/bits/types/clockid_t.h b/time/bits/types/clockid_t.h
new file mode 100644
index 0000000000..b17c7da853
--- /dev/null
+++ b/time/bits/types/clockid_t.h
@@ -0,0 +1,9 @@
+#ifndef __clockid_t_defined
+#define __clockid_t_defined 1
+
+#include <bits/types.h>
+
+/* Clock ID used in clock and timer functions. */
+typedef __clockid_t clockid_t;
+
+#endif
diff --git a/time/bits/types/struct_itimerspec.h b/time/bits/types/struct_itimerspec.h
new file mode 100644
index 0000000000..17cc1ac86d
--- /dev/null
+++ b/time/bits/types/struct_itimerspec.h
@@ -0,0 +1,14 @@
+#ifndef __itimerspec_defined
+#define __itimerspec_defined 1
+
+#include <bits/types.h>
+#include <bits/types/struct_timespec.h>
+
+/* POSIX.1b structure for timer start values and intervals. */
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+#endif
diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h
new file mode 100644
index 0000000000..644db9fdb6
--- /dev/null
+++ b/time/bits/types/struct_timespec.h
@@ -0,0 +1,14 @@
+#ifndef __timespec_defined
+#define __timespec_defined 1
+
+#include <bits/types.h>
+
+/* POSIX.1b structure for a time value. This is like a `struct timeval' but
+ has nanoseconds instead of microseconds. */
+struct timespec
+{
+ __time_t tv_sec; /* Seconds. */
+ __syscall_slong_t tv_nsec; /* Nanoseconds. */
+};
+
+#endif
diff --git a/time/bits/types/struct_timeval.h b/time/bits/types/struct_timeval.h
new file mode 100644
index 0000000000..70394ce886
--- /dev/null
+++ b/time/bits/types/struct_timeval.h
@@ -0,0 +1,13 @@
+#ifndef __timeval_defined
+#define __timeval_defined 1
+
+#include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+{
+ __time_t tv_sec; /* Seconds. */
+ __suseconds_t tv_usec; /* Microseconds. */
+};
+#endif
diff --git a/time/bits/types/struct_tm.h b/time/bits/types/struct_tm.h
new file mode 100644
index 0000000000..8f5af16715
--- /dev/null
+++ b/time/bits/types/struct_tm.h
@@ -0,0 +1,33 @@
+#ifndef __struct_tm_defined
+#define __struct_tm_defined 1
+
+#include <bits/types.h>
+
+/* ISO C `broken-down time' structure. */
+__BEGIN_NAMESPACE_STD
+struct tm
+{
+ int tm_sec; /* Seconds. [0-60] (1 leap second) */
+ int tm_min; /* Minutes. [0-59] */
+ int tm_hour; /* Hours. [0-23] */
+ int tm_mday; /* Day. [1-31] */
+ int tm_mon; /* Month. [0-11] */
+ int tm_year; /* Year - 1900. */
+ int tm_wday; /* Day of week. [0-6] */
+ int tm_yday; /* Days in year.[0-365] */
+ int tm_isdst; /* DST. [-1/0/1]*/
+
+# ifdef __USE_MISC
+ long int tm_gmtoff; /* Seconds east of UTC. */
+ const char *tm_zone; /* Timezone abbreviation. */
+# else
+ long int __tm_gmtoff; /* Seconds east of UTC. */
+ const char *__tm_zone; /* Timezone abbreviation. */
+# endif
+};
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN || defined __USE_POSIX
+__USING_NAMESPACE_STD(tm)
+#endif
+
+#endif
diff --git a/time/bits/types/time_t.h b/time/bits/types/time_t.h
new file mode 100644
index 0000000000..16e5269184
--- /dev/null
+++ b/time/bits/types/time_t.h
@@ -0,0 +1,14 @@
+#ifndef __time_t_defined
+#define __time_t_defined 1
+
+#include <bits/types.h>
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `time'. */
+typedef __time_t time_t;
+__END_NAMESPACE_STD
+#ifdef __USE_POSIX
+__USING_NAMESPACE_STD(time_t)
+#endif
+
+#endif
diff --git a/time/bits/types/timer_t.h b/time/bits/types/timer_t.h
new file mode 100644
index 0000000000..d71a4130e2
--- /dev/null
+++ b/time/bits/types/timer_t.h
@@ -0,0 +1,9 @@
+#ifndef __timer_t_defined
+#define __timer_t_defined 1
+
+#include <bits/types.h>
+
+/* Timer ID returned by `timer_create'. */
+typedef __timer_t timer_t;
+
+#endif
diff --git a/time/sys/time.h b/time/sys/time.h
index 545de6f3d8..89d574f54d 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -21,18 +21,15 @@
#include <features.h>
#include <bits/types.h>
-#define __need_time_t
-#include <time.h>
-#define __need_timeval
-#include <bits/time.h>
-
-#include <sys/select.h>
+#include <bits/types/time_t.h>
+#include <bits/types/struct_timeval.h>
#ifndef __suseconds_t_defined
typedef __suseconds_t suseconds_t;
# define __suseconds_t_defined
#endif
+#include <sys/select.h>
__BEGIN_DECLS
diff --git a/time/sys/timeb.h b/time/sys/timeb.h
index 41d71bf9e9..1e7d0a943b 100644
--- a/time/sys/timeb.h
+++ b/time/sys/timeb.h
@@ -20,9 +20,7 @@
#include <features.h>
-#define __need_time_t
-#include <time.h>
-
+#include <bits/types/time_t.h>
__BEGIN_DECLS
diff --git a/time/time.h b/time/time.h
index cc93917b82..c38fac7ff8 100644
--- a/time/time.h
+++ b/time/time.h
@@ -20,168 +20,52 @@
*/
#ifndef _TIME_H
+#define _TIME_H 1
-#if (! defined __need_time_t && !defined __need_clock_t && \
- ! defined __need_timespec)
-# define _TIME_H 1
-# include <features.h>
+#include <features.h>
-__BEGIN_DECLS
-
-#endif
-
-#ifdef _TIME_H
-/* Get size_t and NULL from <stddef.h>. */
-# define __need_size_t
-# define __need_NULL
-# include <stddef.h>
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
/* This defines CLOCKS_PER_SEC, which is the number of processor clock
- ticks per second. */
-# include <bits/time.h>
-
-/* This is the obsolete POSIX.1-1988 name for the same constant. */
-# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
-# ifndef CLK_TCK
-# define CLK_TCK CLOCKS_PER_SEC
-# endif
-# endif
-
-#endif /* <time.h> included. */
-
-#if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t)
-# define __clock_t_defined 1
-
-# include <bits/types.h>
-
-__BEGIN_NAMESPACE_STD
-/* Returned by `clock'. */
-typedef __clock_t clock_t;
-__END_NAMESPACE_STD
-#if defined __USE_XOPEN || defined __USE_POSIX
-__USING_NAMESPACE_STD(clock_t)
-#endif
-
-#endif /* clock_t not defined and <time.h> or need clock_t. */
-#undef __need_clock_t
-
-#if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t)
-# define __time_t_defined 1
-
-# include <bits/types.h>
-
-__BEGIN_NAMESPACE_STD
-/* Returned by `time'. */
-typedef __time_t time_t;
-__END_NAMESPACE_STD
-#ifdef __USE_POSIX
-__USING_NAMESPACE_STD(time_t)
-#endif
-
-#endif /* time_t not defined and <time.h> or need time_t. */
-#undef __need_time_t
-
-#if !defined __clockid_t_defined && \
- ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t)
-# define __clockid_t_defined 1
-
-# include <bits/types.h>
-
-/* Clock ID used in clock and timer functions. */
-typedef __clockid_t clockid_t;
-
-#endif /* clockid_t not defined and <time.h> or need clockid_t. */
-#undef __clockid_time_t
-
-#if !defined __timer_t_defined && \
- ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t)
-# define __timer_t_defined 1
-
-# include <bits/types.h>
-
-/* Timer ID returned by `timer_create'. */
-typedef __timer_t timer_t;
-
-#endif /* timer_t not defined and <time.h> or need timer_t. */
-#undef __need_timer_t
+ ticks per second, and possibly a number of other constants. */
+#include <bits/time.h>
+/* Many of the typedefs and structs whose official home is this header
+ may also need to be defined by other headers. */
+#include <bits/types/clock_t.h>
+#include <bits/types/time_t.h>
+#include <bits/types/struct_tm.h>
-#if (!defined __timespec_defined \
- && ((defined _TIME_H \
- && (defined __USE_POSIX199309 \
- || defined __USE_ISOC11)) \
- || defined __need_timespec))
-# define __timespec_defined 1
-
-# include <bits/types.h> /* This defines __time_t for us. */
-
-/* POSIX.1b structure for a time value. This is like a `struct timeval' but
- has nanoseconds instead of microseconds. */
-struct timespec
- {
- __time_t tv_sec; /* Seconds. */
- __syscall_slong_t tv_nsec; /* Nanoseconds. */
- };
-
-#endif /* timespec not defined and <time.h> or need timespec. */
-#undef __need_timespec
-
-
-#ifdef _TIME_H
-__BEGIN_NAMESPACE_STD
-/* Used by other time functions. */
-struct tm
-{
- int tm_sec; /* Seconds. [0-60] (1 leap second) */
- int tm_min; /* Minutes. [0-59] */
- int tm_hour; /* Hours. [0-23] */
- int tm_mday; /* Day. [1-31] */
- int tm_mon; /* Month. [0-11] */
- int tm_year; /* Year - 1900. */
- int tm_wday; /* Day of week. [0-6] */
- int tm_yday; /* Days in year.[0-365] */
- int tm_isdst; /* DST. [-1/0/1]*/
-
-# ifdef __USE_MISC
- long int tm_gmtoff; /* Seconds east of UTC. */
- const char *tm_zone; /* Timezone abbreviation. */
-# else
- long int __tm_gmtoff; /* Seconds east of UTC. */
- const char *__tm_zone; /* Timezone abbreviation. */
-# endif
-};
-__END_NAMESPACE_STD
-#if defined __USE_XOPEN || defined __USE_POSIX
-__USING_NAMESPACE_STD(tm)
+#if defined __USE_POSIX199309 || defined __USE_ISOC11
+# include <bits/types/struct_timespec.h>
#endif
-
-# ifdef __USE_POSIX199309
-/* POSIX.1b structure for timer start values and intervals. */
-struct itimerspec
- {
- struct timespec it_interval;
- struct timespec it_value;
- };
-
-/* We can use a simple forward declaration. */
+#ifdef __USE_POSIX199309
+# include <bits/types/clockid_t.h>
+# include <bits/types/timer_t.h>
+# include <bits/types/struct_itimerspec.h>
struct sigevent;
+#endif
-# endif /* POSIX.1b */
-
-# ifdef __USE_XOPEN2K
-# ifndef __pid_t_defined
+#ifdef __USE_XOPEN2K
+# ifndef __pid_t_defined
typedef __pid_t pid_t;
-# define __pid_t_defined
-# endif
+# define __pid_t_defined
# endif
+#endif
+#ifdef __USE_XOPEN2K8
+# include <xlocale.h>
+#endif
-# ifdef __USE_ISOC11
+#ifdef __USE_ISOC11
/* Time base values for timespec_get. */
# define TIME_UTC 1
-# endif
+#endif
+__BEGIN_DECLS
__BEGIN_NAMESPACE_STD
/* Time used by the program so far (user time + system time).
@@ -207,30 +91,29 @@ extern size_t strftime (char *__restrict __s, size_t __maxsize,
const struct tm *__restrict __tp) __THROW;
__END_NAMESPACE_STD
-# ifdef __USE_XOPEN
+#ifdef __USE_XOPEN
/* Parse S according to FORMAT and store binary time information in TP.
The return value is a pointer to the first unparsed character in S. */
extern char *strptime (const char *__restrict __s,
const char *__restrict __fmt, struct tm *__tp)
__THROW;
-# endif
+#endif
-# ifdef __USE_XOPEN2K8
+#ifdef __USE_XOPEN2K8
/* Similar to the two functions above but take the information from
the provided locale and not the global locale. */
-# include <xlocale.h>
extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
const char *__restrict __format,
const struct tm *__restrict __tp,
__locale_t __loc) __THROW;
-# endif
+#endif
-# ifdef __USE_GNU
+#ifdef __USE_GNU
extern char *strptime_l (const char *__restrict __s,
const char *__restrict __fmt, struct tm *__tp,
__locale_t __loc) __THROW;
-# endif
+#endif
__BEGIN_NAMESPACE_STD
@@ -243,7 +126,7 @@ extern struct tm *gmtime (const time_t *__timer) __THROW;
extern struct tm *localtime (const time_t *__timer) __THROW;
__END_NAMESPACE_STD
-# ifdef __USE_POSIX
+#ifdef __USE_POSIX
/* Return the `struct tm' representation of *TIMER in UTC,
using *TP to store the result. */
extern struct tm *gmtime_r (const time_t *__restrict __timer,
@@ -253,7 +136,7 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer,
using *TP to store the result. */
extern struct tm *localtime_r (const time_t *__restrict __timer,
struct tm *__restrict __tp) __THROW;
-# endif /* POSIX */
+#endif /* POSIX */
__BEGIN_NAMESPACE_STD
/* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n"
@@ -264,7 +147,7 @@ extern char *asctime (const struct tm *__tp) __THROW;
extern char *ctime (const time_t *__timer) __THROW;
__END_NAMESPACE_STD
-# ifdef __USE_POSIX
+#ifdef __USE_POSIX
/* Reentrant versions of the above functions. */
/* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n"
@@ -275,7 +158,7 @@ extern char *asctime_r (const struct tm *__restrict __tp,
/* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */
extern char *ctime_r (const time_t *__restrict __timer,
char *__restrict __buf) __THROW;
-# endif /* POSIX */
+#endif /* POSIX */
/* Defined in localtime.c. */
@@ -284,34 +167,34 @@ extern int __daylight; /* If daylight-saving time is ever in use. */
extern long int __timezone; /* Seconds west of UTC. */
-# ifdef __USE_POSIX
+#ifdef __USE_POSIX
/* Same as above. */
extern char *tzname[2];
/* Set time conversion information from the TZ environment variable.
If TZ is not defined, a locale-dependent default is used. */
extern void tzset (void) __THROW;
-# endif
+#endif
-# if defined __USE_MISC || defined __USE_XOPEN
+#if defined __USE_MISC || defined __USE_XOPEN
extern int daylight;
extern long int timezone;
-# endif
+#endif
-# ifdef __USE_MISC
+#ifdef __USE_MISC
/* Set the system time to *WHEN.
This call is restricted to the superuser. */
extern int stime (const time_t *__when) __THROW;
-# endif
+#endif
/* Nonzero if YEAR is a leap year (every 4 years,
except every 100th isn't, and every 400th is). */
-# define __isleap(year) \
+#define __isleap(year) \
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
-# ifdef __USE_MISC
+#ifdef __USE_MISC
/* Miscellaneous functions many Unices inherited from the public domain
localtime package. These are included only for compatibility. */
@@ -323,10 +206,10 @@ extern time_t timelocal (struct tm *__tp) __THROW;
/* Return the number of days in YEAR. */
extern int dysize (int __year) __THROW __attribute__ ((__const__));
-# endif
+#endif
-# ifdef __USE_POSIX199309
+#ifdef __USE_POSIX199309
/* Pause execution for a number of nanoseconds.
This function is a cancellation point and therefore not marked with
@@ -345,7 +228,7 @@ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW;
extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
__THROW;
-# ifdef __USE_XOPEN2K
+# ifdef __USE_XOPEN2K
/* High-resolution sleep with the specified clock.
This function is a cancellation point and therefore not marked with
@@ -356,7 +239,7 @@ extern int clock_nanosleep (clockid_t __clock_id, int __flags,
/* Return clock ID for CPU-time clock. */
extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW;
-# endif
+# endif
/* Create new per-process timer using CLOCK_ID. */
@@ -378,17 +261,17 @@ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
/* Get expiration overrun for timer TIMERID. */
extern int timer_getoverrun (timer_t __timerid) __THROW;
-# endif
+#endif
-# ifdef __USE_ISOC11
+#ifdef __USE_ISOC11
/* Set TS to calendar time based in time base BASE. */
extern int timespec_get (struct timespec *__ts, int __base)
__THROW __nonnull ((1));
-# endif
+#endif
-# ifdef __USE_XOPEN_EXTENDED
+#ifdef __USE_XOPEN_EXTENDED
/* Set to one of the following values to indicate an error.
1 the DATEMSK environment variable is null or undefined,
2 the template file cannot be opened for reading,
@@ -410,9 +293,9 @@ extern int getdate_err;
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern struct tm *getdate (const char *__string);
-# endif
+#endif
-# ifdef __USE_GNU
+#ifdef __USE_GNU
/* Since `getdate' is not reentrant because of the use of `getdate_err'
and the static buffer to return the result in, we provide a thread-safe
variant. The functionality is the same. The result is returned in
@@ -425,10 +308,8 @@ extern struct tm *getdate (const char *__string);
therefore not marked with __THROW. */
extern int getdate_r (const char *__restrict __string,
struct tm *__restrict __resbufp);
-# endif
+#endif
__END_DECLS
-#endif /* <time.h> included. */
-
-#endif /* <time.h> not already included. */
+#endif /* time.h. */
diff --git a/time/tst-strptime2.c b/time/tst-strptime2.c
index 7fe7350024..04f7cff437 100644
--- a/time/tst-strptime2.c
+++ b/time/tst-strptime2.c
@@ -4,6 +4,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <time.h>
+#include <libc-internal.h>
/* Dummy string is used to match strptime's %s specifier. */
@@ -67,10 +68,20 @@ mkbuf (char *buf, bool neg, bool colon, unsigned int hhmm, size_t ndigits)
long int expect = LONG_MAX;
i = sprintf (buf, "%s %c", dummy_string, sign);
+#if __GNUC_PREREQ (7, 0)
+ /* GCC issues a warning when it thinks the snprintf buffer may be too short.
+ This test is explicitly using short buffers to force snprintf to truncate
+ the output so we ignore the warnings. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-length");
+#endif
if (colon)
snprintf (buf + i, ndigits + 2, "%02u:%02u", hh, mm);
else
snprintf (buf + i, ndigits + 1, "%04u", hhmm);
+#if __GNUC_PREREQ (7, 0)
+ DIAG_POP_NEEDS_COMMENT;
+#endif
if (mm <= mm_max && (ndigits == 2 || ndigits == 4))
{
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
index 8b599f75be..9384a10678 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -49,6 +49,7 @@ strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \
tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \
tst-c16c32-1 wcsatcliff tst-wcstol-locale tst-wcstod-nan-locale \
+ tst-wcstod-round \
$(addprefix test-,$(strop-tests))
include ../Rules
@@ -68,6 +69,8 @@ $(objpfx)tst-wcstol-locale.out: $(gen-locales)
$(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
endif
+$(objpfx)tst-wcstod-round: $(libm)
+
CFLAGS-wcwidth.c = -I../wctype
CFLAGS-wcswidth.c = -I../wctype
diff --git a/math/s_nanl.c b/wcsmbs/tst-wcstod-round.c
index e6149bc0c7..38ddaea192 100644
--- a/math/s_nanl.c
+++ b/wcsmbs/tst-wcstod-round.c
@@ -1,7 +1,6 @@
-/* Return quiet nan.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* wide character shim for tst-strtod-round-skeleton.c.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,17 +16,16 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
+#include <wchar.h>
+
+/* Include stdio.h early to avoid issues with the snprintf
+ redefinition below. */
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ieee754.h>
+#define L_(str) L ## str
+#define FNPFX wcs
+#define CHAR wchar_t
+#define STRM "%ls"
+#define snprintf swprintf
-#undef __nanl
-long double
-__nanl (const char *tagp)
-{
- return __strtold_nan (tagp, NULL, 0);
-}
-weak_alias (__nanl, nanl)
+#include <stdlib/tst-strtod-round-skeleton.c>